zedbee 0.1.0-beta.16 → 0.1.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +68 -74
- package/dist/attribution/metrics.d.ts.map +1 -1
- package/dist/attribution/metrics.js +8 -5
- package/dist/attribution/metrics.js.map +1 -1
- package/dist/attribution/pair-source-moves.d.ts +12 -0
- package/dist/attribution/pair-source-moves.d.ts.map +1 -0
- package/dist/attribution/pair-source-moves.js +108 -0
- package/dist/attribution/pair-source-moves.js.map +1 -0
- package/dist/attribution/source-moves.d.ts +47 -0
- package/dist/attribution/source-moves.d.ts.map +1 -0
- package/dist/attribution/source-moves.js +199 -0
- package/dist/attribution/source-moves.js.map +1 -0
- package/dist/checks/applicability.d.ts.map +1 -1
- package/dist/checks/applicability.js +1 -1
- package/dist/checks/applicability.js.map +1 -1
- package/dist/checks/changed-file-paths.d.ts.map +1 -1
- package/dist/checks/changed-file-paths.js +7 -1
- package/dist/checks/changed-file-paths.js.map +1 -1
- package/dist/checks/closed-compiler-project.d.ts +5 -0
- package/dist/checks/closed-compiler-project.d.ts.map +1 -0
- package/dist/checks/closed-compiler-project.js +106 -0
- package/dist/checks/closed-compiler-project.js.map +1 -0
- package/dist/checks/compiler-inputs.d.ts +1 -1
- package/dist/checks/compiler-inputs.d.ts.map +1 -1
- package/dist/checks/compiler-inputs.js +33 -2
- package/dist/checks/compiler-inputs.js.map +1 -1
- package/dist/checks/complexity/adapter.d.ts.map +1 -1
- package/dist/checks/complexity/adapter.js +21 -2
- package/dist/checks/complexity/adapter.js.map +1 -1
- package/dist/checks/dead-code/adapter.d.ts.map +1 -1
- package/dist/checks/dead-code/adapter.js +16 -5
- package/dist/checks/dead-code/adapter.js.map +1 -1
- package/dist/checks/dead-code/entry-configuration.d.ts +6 -0
- package/dist/checks/dead-code/entry-configuration.d.ts.map +1 -0
- package/dist/checks/dead-code/entry-configuration.js +48 -0
- package/dist/checks/dead-code/entry-configuration.js.map +1 -0
- package/dist/checks/dead-code/managed-config.d.ts +1 -1
- package/dist/checks/dead-code/managed-config.d.ts.map +1 -1
- package/dist/checks/dead-code/managed-config.js +24 -3
- package/dist/checks/dead-code/managed-config.js.map +1 -1
- package/dist/checks/dead-code/vite-entrypoints.d.ts +13 -0
- package/dist/checks/dead-code/vite-entrypoints.d.ts.map +1 -0
- package/dist/checks/dead-code/vite-entrypoints.js +314 -0
- package/dist/checks/dead-code/vite-entrypoints.js.map +1 -0
- package/dist/checks/diagnostic-details.d.ts.map +1 -1
- package/dist/checks/diagnostic-details.js +32 -0
- package/dist/checks/diagnostic-details.js.map +1 -1
- package/dist/checks/engine-identity.d.ts.map +1 -1
- package/dist/checks/engine-identity.js +5 -4
- package/dist/checks/engine-identity.js.map +1 -1
- package/dist/checks/eslint/convert-message.d.ts.map +1 -1
- package/dist/checks/eslint/convert-message.js +5 -2
- package/dist/checks/eslint/convert-message.js.map +1 -1
- package/dist/checks/observation-result.d.ts.map +1 -1
- package/dist/checks/observation-result.js +69 -7
- package/dist/checks/observation-result.js.map +1 -1
- package/dist/checks/project-inputs.d.ts +1 -1
- package/dist/checks/project-inputs.d.ts.map +1 -1
- package/dist/checks/project-inputs.js +10 -1
- package/dist/checks/project-inputs.js.map +1 -1
- package/dist/checks/react/adapter.d.ts.map +1 -1
- package/dist/checks/react/adapter.js +25 -3
- package/dist/checks/react/adapter.js.map +1 -1
- package/dist/checks/source-moves.d.ts +9 -0
- package/dist/checks/source-moves.d.ts.map +1 -0
- package/dist/checks/source-moves.js +184 -0
- package/dist/checks/source-moves.js.map +1 -0
- package/dist/commands/checks.js +3 -3
- package/dist/commands/checks.js.map +1 -1
- package/dist/commands/diagnostics.d.ts +1 -0
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +28 -0
- package/dist/commands/diagnostics.js.map +1 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +4 -1
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +4 -0
- package/dist/commands/scan.js.map +1 -1
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +6 -0
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/schema.d.ts +37 -17
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +16 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/settings-registry.js +2 -2
- package/dist/config/settings-registry.js.map +1 -1
- package/dist/renderers/text.d.ts.map +1 -1
- package/dist/renderers/text.js +4 -0
- package/dist/renderers/text.js.map +1 -1
- package/dist/reporting/finding-priority.d.ts +6 -0
- package/dist/reporting/finding-priority.d.ts.map +1 -0
- package/dist/reporting/finding-priority.js +69 -0
- package/dist/reporting/finding-priority.js.map +1 -0
- package/dist/reporting/fix-plan-store.d.ts +2 -5
- package/dist/reporting/fix-plan-store.d.ts.map +1 -1
- package/dist/reporting/fix-plan-store.js +2 -1
- package/dist/reporting/fix-plan-store.js.map +1 -1
- package/dist/reporting/presentation.d.ts +3 -1
- package/dist/reporting/presentation.d.ts.map +1 -1
- package/dist/reporting/presentation.js +19 -7
- package/dist/reporting/presentation.js.map +1 -1
- package/dist/reporting/result-sections.d.ts +1 -0
- package/dist/reporting/result-sections.d.ts.map +1 -1
- package/dist/reporting/result-sections.js +12 -0
- package/dist/reporting/result-sections.js.map +1 -1
- package/dist/reporting/temporary-report-common.d.ts +13 -1
- package/dist/reporting/temporary-report-common.d.ts.map +1 -1
- package/dist/reporting/temporary-report-common.js +4 -1
- package/dist/reporting/temporary-report-common.js.map +1 -1
- package/dist/reporting/temporary-report-lifecycle.d.ts +3 -3
- package/dist/reporting/temporary-report-lifecycle.d.ts.map +1 -1
- package/dist/reporting/temporary-report-lifecycle.js +18 -4
- package/dist/reporting/temporary-report-lifecycle.js.map +1 -1
- package/dist/reporting/temporary-reports.d.ts +1 -1
- package/dist/reporting/temporary-reports.d.ts.map +1 -1
- package/dist/reporting/temporary-reports.js +22 -3
- package/dist/reporting/temporary-reports.js.map +1 -1
- package/dist/scan/analysis-session.d.ts.map +1 -1
- package/dist/scan/analysis-session.js +15 -1
- package/dist/scan/analysis-session.js.map +1 -1
- package/dist/ui/scan-result-dashboard.d.ts.map +1 -1
- package/dist/ui/scan-result-dashboard.js +1 -1
- package/dist/ui/scan-result-dashboard.js.map +1 -1
- package/docs/checks.md +96 -2
- package/docs/privacy.md +13 -0
- package/docs/reporting.md +35 -1
- package/{node_modules/dependency-cruiser/node_modules/picomatch/LICENSE → licenses/overrides/jscpd-5.4.2-LICENSE} +5 -5
- package/licenses/overrides/napi-rs-wasm-runtime-1.2.5-LICENSE +43 -0
- package/licenses/reviewed-overrides.json +70 -0
- package/node_modules/acorn/CHANGELOG.md +14 -0
- package/node_modules/acorn/dist/acorn.js +42 -14
- package/node_modules/acorn/dist/acorn.mjs +42 -14
- package/node_modules/acorn/package.json +1 -1
- package/node_modules/dependency-cruiser/README.md +7 -8
- package/node_modules/dependency-cruiser/bin/depcruise-baseline.mjs +12 -5
- package/node_modules/dependency-cruiser/bin/{dependency-cruise.mjs → dependency-cruiser.mjs} +24 -14
- package/node_modules/dependency-cruiser/configs/rules/no-duplicate-dependency-types.cjs +1 -1
- package/node_modules/dependency-cruiser/node_modules/ignore/README.md +138 -8
- package/node_modules/dependency-cruiser/node_modules/ignore/index.d.ts +56 -20
- package/node_modules/dependency-cruiser/node_modules/ignore/index.js +1032 -229
- package/node_modules/dependency-cruiser/node_modules/ignore/legacy.js +868 -184
- package/node_modules/dependency-cruiser/node_modules/ignore/package.json +10 -4
- package/node_modules/dependency-cruiser/node_modules/semver/LICENSE +15 -0
- package/node_modules/dependency-cruiser/node_modules/semver/README.md +680 -0
- package/node_modules/dependency-cruiser/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/index.js +7 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/range.js +577 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/major.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/index.js +93 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/constants.js +67 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/re.js +223 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/dependency-cruiser/node_modules/semver/package.json +78 -0
- package/node_modules/dependency-cruiser/node_modules/semver/preload.js +4 -0
- package/node_modules/dependency-cruiser/node_modules/semver/range.bnf +17 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/dependency-cruiser/package.json +16 -10
- package/node_modules/dependency-cruiser/src/analyze/analyze-modules.mjs +5 -1
- package/node_modules/dependency-cruiser/src/analyze/index.mjs +3 -3
- package/node_modules/dependency-cruiser/src/analyze/soften-known-violations.mjs +4 -2
- package/node_modules/dependency-cruiser/src/analyze/summarize/get-stats.mjs +38 -3
- package/node_modules/dependency-cruiser/src/analyze/summarize/index.mjs +28 -105
- package/node_modules/dependency-cruiser/src/analyze/summarize/summarize-options.mjs +3 -0
- package/node_modules/dependency-cruiser/src/analyze/summarize/verify-environment.mjs +146 -0
- package/node_modules/dependency-cruiser/src/cache/cache.mjs +1 -1
- package/node_modules/dependency-cruiser/src/cache/options-compatible.mjs +3 -0
- package/node_modules/dependency-cruiser/src/cli/defaults.mjs +0 -1
- package/node_modules/dependency-cruiser/src/cli/index.mjs +11 -3
- package/node_modules/dependency-cruiser/src/cli/init-config/build-config.mjs +14 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/config-template.mjs +7 -2
- package/node_modules/dependency-cruiser/src/cli/init-config/environment-helpers.mjs +5 -1
- package/node_modules/dependency-cruiser/src/cli/init-config/get-user-input.mjs +11 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/index.mjs +1 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/normalize-init-options.mjs +1 -1
- package/node_modules/dependency-cruiser/src/cli/init-config/types.d.mts +4 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/write-run-scripts-to-manifest.mjs +7 -7
- package/node_modules/dependency-cruiser/src/cli/normalize-cli-options.mjs +63 -2
- package/node_modules/dependency-cruiser/src/config-utl/extract-ts-config.mjs +1 -1
- package/node_modules/dependency-cruiser/src/extract/helpers.mjs +1 -0
- package/node_modules/dependency-cruiser/src/extract/resolve/determine-dependency-types.mjs +15 -7
- package/node_modules/dependency-cruiser/src/extract/resolve/merge-manifests.mjs +6 -3
- package/node_modules/dependency-cruiser/src/extract/swc/dependency-visitor.mjs +21 -4
- package/node_modules/dependency-cruiser/src/extract/swc/parse.mjs +14 -4
- package/node_modules/dependency-cruiser/src/extract/transpile/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/extract/transpile/meta.mjs +15 -3
- package/node_modules/dependency-cruiser/src/extract/transpile/svelte-wrap.mjs +23 -2
- package/node_modules/dependency-cruiser/src/extract/transpile/try-import-available.mjs +2 -2
- package/node_modules/dependency-cruiser/src/extract/transpile/typescript-wrap.mjs +23 -1
- package/node_modules/dependency-cruiser/src/extract/tsc/extract-typescript-deps.mjs +57 -12
- package/node_modules/dependency-cruiser/src/extract/tsc/extract.mjs +2 -0
- package/node_modules/dependency-cruiser/src/graph-utl/add-focus.mjs +2 -2
- package/node_modules/dependency-cruiser/src/graph-utl/compare.mjs +113 -14
- package/node_modules/dependency-cruiser/src/main/cruise.mjs +1 -2
- package/node_modules/dependency-cruiser/src/main/format.mjs +1 -1
- package/node_modules/dependency-cruiser/src/main/options/defaults.mjs +1 -0
- package/node_modules/dependency-cruiser/src/main/options/normalize.mjs +13 -4
- package/node_modules/dependency-cruiser/src/main/report-wrap.mjs +4 -2
- package/node_modules/dependency-cruiser/src/main/resolve-options/normalize.mjs +0 -27
- package/node_modules/dependency-cruiser/src/meta.cjs +1 -1
- package/node_modules/dependency-cruiser/src/report/anon/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/azure-devops.mjs +15 -11
- package/node_modules/dependency-cruiser/src/report/baseline.mjs +67 -10
- package/node_modules/dependency-cruiser/src/report/csv.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/dot/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/dot-webpage/dot-module.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/error-html/error-html-template.mjs +2 -0
- package/node_modules/dependency-cruiser/src/report/error-html/index.mjs +84 -8
- package/node_modules/dependency-cruiser/src/report/error.mjs +62 -13
- package/node_modules/dependency-cruiser/src/report/html/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/index.mjs +3 -2
- package/node_modules/dependency-cruiser/src/report/markdown.mjs +89 -19
- package/node_modules/dependency-cruiser/src/report/metrics.mjs +3 -3
- package/node_modules/dependency-cruiser/src/report/null.mjs +6 -3
- package/node_modules/dependency-cruiser/src/report/teamcity.mjs +4 -1
- package/node_modules/dependency-cruiser/src/schema/configuration.validate.mjs +1 -1
- package/node_modules/dependency-cruiser/src/schema/cruise-result.validate.mjs +1 -1
- package/node_modules/dependency-cruiser/src/utl/try-import.mjs +1 -1
- package/node_modules/dependency-cruiser/types/cruise-result.d.mts +14 -0
- package/node_modules/dependency-cruiser/types/dependency-cruiser.d.mts +6 -0
- package/node_modules/dependency-cruiser/types/options.d.mts +37 -2
- package/node_modules/dependency-cruiser/types/reporter-options.d.mts +30 -5
- package/node_modules/dependency-cruiser/types/restrictions.d.mts +2 -2
- package/node_modules/dependency-cruiser/types/shared-types.d.mts +16 -13
- package/node_modules/enhanced-resolve/README.md +46 -1
- package/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js +31 -6
- package/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js +27 -6
- package/node_modules/enhanced-resolve/lib/PackageMapPlugin.js +297 -0
- package/node_modules/enhanced-resolve/lib/Resolver.js +37 -30
- package/node_modules/enhanced-resolve/lib/ResolverFactory.js +104 -11
- package/node_modules/enhanced-resolve/lib/getPaths.js +6 -1
- package/node_modules/enhanced-resolve/lib/index.js +4 -0
- package/node_modules/enhanced-resolve/lib/util/entrypoints.js +104 -0
- package/node_modules/enhanced-resolve/lib/util/graceful-fs-browser.js +5 -1
- package/node_modules/enhanced-resolve/lib/util/identifier.js +4 -2
- package/node_modules/enhanced-resolve/lib/util/packageMap.js +224 -0
- package/node_modules/enhanced-resolve/lib/util/path.js +29 -8
- package/node_modules/enhanced-resolve/lib/util/pathToFileURL.js +87 -0
- package/node_modules/enhanced-resolve/package.json +8 -9
- package/node_modules/enhanced-resolve/types/AliasFieldPlugin.d.ts +41 -0
- package/node_modules/enhanced-resolve/types/AliasPlugin.d.ts +32 -0
- package/node_modules/enhanced-resolve/types/AliasUtils.d.ts +128 -0
- package/node_modules/enhanced-resolve/types/AppendPlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/CachedInputFileSystem.d.ts +224 -0
- package/node_modules/enhanced-resolve/types/CloneBasenamePlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/ConditionalPlugin.d.ts +33 -0
- package/node_modules/enhanced-resolve/types/DescriptionFilePlugin.d.ts +30 -0
- package/node_modules/enhanced-resolve/types/DescriptionFileUtils.d.ts +83 -0
- package/node_modules/enhanced-resolve/types/DirectoryExistsPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/ExportsFieldPlugin.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/ExtensionAliasPlugin.d.ts +31 -0
- package/node_modules/enhanced-resolve/types/FileExistsPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/ImportsFieldPlugin.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/JoinRequestPartPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/JoinRequestPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/LogInfoPlugin.d.ts +18 -0
- package/node_modules/enhanced-resolve/types/MainFieldPlugin.d.ts +41 -0
- package/node_modules/enhanced-resolve/types/ModulesInHierachicDirectoriesPlugin.d.ts +2 -0
- package/node_modules/enhanced-resolve/types/ModulesInHierarchicalDirectoriesPlugin.d.ts +26 -0
- package/node_modules/enhanced-resolve/types/ModulesInRootPlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/ModulesUtils.d.ts +25 -0
- package/node_modules/enhanced-resolve/types/NextPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/PackageMapPlugin.d.ts +85 -0
- package/node_modules/enhanced-resolve/types/ParsePlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/PnpPlugin.d.ts +42 -0
- package/node_modules/enhanced-resolve/types/Resolver.d.ts +1545 -0
- package/node_modules/enhanced-resolve/types/ResolverFactory.d.ts +340 -0
- package/node_modules/enhanced-resolve/types/RestrictionsPlugin.d.ts +52 -0
- package/node_modules/enhanced-resolve/types/ResultPlugin.d.ts +18 -0
- package/node_modules/enhanced-resolve/types/RootsPlugin.d.ts +30 -0
- package/node_modules/enhanced-resolve/types/SelfReferencePlugin.d.ts +31 -0
- package/node_modules/enhanced-resolve/types/SymlinkPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/SyncAsyncFileSystemDecorator.d.ts +52 -0
- package/node_modules/enhanced-resolve/types/TryNextPlugin.d.ts +26 -0
- package/node_modules/enhanced-resolve/types/TsconfigPathsPlugin.d.ts +204 -0
- package/node_modules/enhanced-resolve/types/UnsafeCachePlugin.d.ts +43 -0
- package/node_modules/enhanced-resolve/types/UseFilePlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/createInnerContext.d.ts +10 -0
- package/node_modules/enhanced-resolve/types/forEachBail.d.ts +15 -0
- package/node_modules/enhanced-resolve/types/getInnerRequest.d.ts +7 -0
- package/node_modules/enhanced-resolve/types/getPaths.d.ts +34 -0
- package/node_modules/enhanced-resolve/types/index.d.ts +131 -0
- package/node_modules/enhanced-resolve/types/util/entrypoints.d.ts +62 -0
- package/node_modules/enhanced-resolve/types/util/fileURLToPath.d.ts +14 -0
- package/node_modules/enhanced-resolve/types/util/fs.d.ts +38 -0
- package/node_modules/enhanced-resolve/types/util/graceful-fs-browser.d.ts +22 -0
- package/node_modules/enhanced-resolve/types/util/identifier.d.ts +7 -0
- package/node_modules/enhanced-resolve/types/util/memoize.d.ts +15 -0
- package/node_modules/enhanced-resolve/types/util/module-browser.d.ts +1 -0
- package/node_modules/enhanced-resolve/types/util/packageMap.d.ts +118 -0
- package/node_modules/enhanced-resolve/types/util/path-browser.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/util/path.d.ts +125 -0
- package/node_modules/enhanced-resolve/types/util/pathToFileURL.d.ts +14 -0
- package/node_modules/enhanced-resolve/types/util/process-browser.d.ts +3 -0
- package/node_modules/enhanced-resolve/types/util/strip-json-comments.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/util/url-browser.d.ts +1 -0
- package/node_modules/enhanced-resolve/types.d.ts +5 -2057
- package/node_modules/is-installed-globally/index.js +26 -4
- package/node_modules/is-installed-globally/package.json +1 -1
- package/package.json +5 -5
- package/schema/zedbee.schema.json +12 -1
- package/node_modules/dependency-cruiser/node_modules/picomatch/README.md +0 -743
- package/node_modules/dependency-cruiser/node_modules/picomatch/index.js +0 -17
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/constants.js +0 -184
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/parse.js +0 -1416
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/picomatch.js +0 -361
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/scan.js +0 -391
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/utils.js +0 -72
- package/node_modules/dependency-cruiser/node_modules/picomatch/package.json +0 -83
- package/node_modules/dependency-cruiser/node_modules/picomatch/posix.js +0 -3
|
@@ -73,7 +73,12 @@ function getPathsCached(fileSystem, path) {
|
|
|
73
73
|
const cached = cache.get(path);
|
|
74
74
|
if (cached !== undefined) return cached;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const { paths, segments } = getPaths(path);
|
|
77
|
+
// `push` leaves a store sized for 17 entries while a path has a handful, and
|
|
78
|
+
// what is cached here is kept for the filesystem's lifetime. A copy sizes both
|
|
79
|
+
// to what they hold, and copying a pushed array keeps them packed, which is
|
|
80
|
+
// the element kind every reader of them is compiled for.
|
|
81
|
+
const result = { paths: [...paths], segments: [...segments] };
|
|
77
82
|
cache.set(path, result);
|
|
78
83
|
return result;
|
|
79
84
|
}
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
const memoize = require("./util/memoize");
|
|
9
9
|
|
|
10
|
+
/** @typedef {import("./CachedInputFileSystem")} CachedInputFileSystem */
|
|
10
11
|
/** @typedef {import("./CachedInputFileSystem").BaseFileSystem} BaseFileSystem */
|
|
12
|
+
/** @typedef {import("./CloneBasenamePlugin")} CloneBasenamePlugin */
|
|
13
|
+
/** @typedef {import("./LogInfoPlugin")} LogInfoPlugin */
|
|
11
14
|
/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */
|
|
12
15
|
/** @typedef {import("./Resolver")} Resolver */
|
|
13
16
|
/** @typedef {import("./Resolver").Context} Context */
|
|
@@ -18,6 +21,7 @@ const memoize = require("./util/memoize");
|
|
|
18
21
|
/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */
|
|
19
22
|
/** @typedef {import("./ResolverFactory").Plugin} Plugin */
|
|
20
23
|
/** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */
|
|
24
|
+
/** @typedef {import("./TsconfigPathsPlugin")} TsconfigPathsPlugin */
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* @typedef {{
|
|
@@ -582,6 +582,110 @@ function assertExportsFieldRequest(request) {
|
|
|
582
582
|
return request.slice(2);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Looks for a conditional mapping whose keys are subpaths - the "conditions
|
|
587
|
+
* wrapping subpaths" shape from
|
|
588
|
+
* https://github.com/webpack/enhanced-resolve/issues/325, which Node.js does
|
|
589
|
+
* not support: the subpaths are read as condition names and match nothing.
|
|
590
|
+
*
|
|
591
|
+
* Diagnostic only, and deliberately not part of building the field. Walking
|
|
592
|
+
* every target of every package.json would cost a full tree walk per package
|
|
593
|
+
* to catch a mistake almost none of them make, and rejecting the field
|
|
594
|
+
* outright would break packages that resolve today under some conditions.
|
|
595
|
+
* Callers run this once a request has already failed, where the walk is free
|
|
596
|
+
* relative to the error being raised anyway.
|
|
597
|
+
* @param {MappingValue} mapping mapping in target position
|
|
598
|
+
* @param {number} subpathCode leading char code that marks a subpath key
|
|
599
|
+
* @param {string[]} trail keys walked from the field root down to `mapping`
|
|
600
|
+
* @returns {{ trail: string[], keys: string[] } | null} offending mapping
|
|
601
|
+
*/
|
|
602
|
+
function findSubpathsInConditions(mapping, subpathCode, trail) {
|
|
603
|
+
if (mapping === null || typeof mapping !== "object") return null;
|
|
604
|
+
|
|
605
|
+
if (Array.isArray(mapping)) {
|
|
606
|
+
for (let i = 0; i < mapping.length; i++) {
|
|
607
|
+
const found = findSubpathsInConditions(mapping[i], subpathCode, trail);
|
|
608
|
+
if (found) return found;
|
|
609
|
+
}
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const keys = Object.keys(mapping);
|
|
614
|
+
|
|
615
|
+
for (let i = 0; i < keys.length; i++) {
|
|
616
|
+
if (keys[i].charCodeAt(0) === subpathCode) {
|
|
617
|
+
return { trail: [...trail], keys };
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
for (let i = 0; i < keys.length; i++) {
|
|
622
|
+
const key = keys[i];
|
|
623
|
+
trail.push(key);
|
|
624
|
+
const found = findSubpathsInConditions(mapping[key], subpathCode, trail);
|
|
625
|
+
if (found) return found;
|
|
626
|
+
trail.pop();
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Explains why nothing matched, when the reason is a conditional mapping that
|
|
634
|
+
* wraps subpaths. Returns `null` when the field does not have that shape, so
|
|
635
|
+
* the caller keeps its ordinary "not exported" wording.
|
|
636
|
+
*
|
|
637
|
+
* Only the top-level values are descended into, never the field's own keys:
|
|
638
|
+
* in both forms of `exports` and in `imports` those values are targets, while
|
|
639
|
+
* the keys are either subpaths or - for the `exports` shorthand, where the
|
|
640
|
+
* whole field is one conditional mapping - condition names that
|
|
641
|
+
* `buildExportsField` has already checked.
|
|
642
|
+
* @param {ExportsField | ImportsField | null | undefined} field the field
|
|
643
|
+
* @param {boolean} isExports true for `exports`, false for `imports`
|
|
644
|
+
* @returns {string | null} explanation to append to the error, if any
|
|
645
|
+
*/
|
|
646
|
+
module.exports.explainSubpathsInConditions =
|
|
647
|
+
function explainSubpathsInConditions(field, isExports) {
|
|
648
|
+
if (field === null || typeof field !== "object" || Array.isArray(field)) {
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const subpathCode = isExports ? dotCode : hashCode;
|
|
653
|
+
const keys = Object.keys(field);
|
|
654
|
+
/** @type {string[]} */
|
|
655
|
+
const trail = [];
|
|
656
|
+
/** @type {{ trail: string[], keys: string[] } | null} */
|
|
657
|
+
let found = null;
|
|
658
|
+
|
|
659
|
+
for (let i = 0; i < keys.length && !found; i++) {
|
|
660
|
+
trail.push(keys[i]);
|
|
661
|
+
found = findSubpathsInConditions(
|
|
662
|
+
/** @type {Record<string, MappingValue>} */ (field)[keys[i]],
|
|
663
|
+
subpathCode,
|
|
664
|
+
trail,
|
|
665
|
+
);
|
|
666
|
+
trail.pop();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (!found) return null;
|
|
670
|
+
|
|
671
|
+
const quote = (/** @type {string} */ key) => JSON.stringify(key);
|
|
672
|
+
const subpathKeys = found.keys.filter(
|
|
673
|
+
(key) => key.charCodeAt(0) === subpathCode,
|
|
674
|
+
);
|
|
675
|
+
const condition = found.trail[found.trail.length - 1];
|
|
676
|
+
const example = subpathKeys
|
|
677
|
+
.map((key) => `${quote(key)}: { ${quote(condition)}: ... }`)
|
|
678
|
+
.join(", ");
|
|
679
|
+
|
|
680
|
+
return `the value at ${found.trail
|
|
681
|
+
.map(quote)
|
|
682
|
+
.join(" -> ")} is an object with subpath keys (${subpathKeys
|
|
683
|
+
.map(quote)
|
|
684
|
+
.join(
|
|
685
|
+
", ",
|
|
686
|
+
)}), which is not supported - a condition can only map to a target or to further conditions, so those subpaths never match. Put the subpaths at the top level and nest the conditions inside them instead, e.g. { ${example} }.`;
|
|
687
|
+
};
|
|
688
|
+
|
|
585
689
|
/**
|
|
586
690
|
* @param {ExportsField} field exports field
|
|
587
691
|
* @returns {ExportsField} normalized exports field
|
|
@@ -16,9 +16,13 @@ const message =
|
|
|
16
16
|
"Pass a `fileSystem` to `create()` or `ResolverFactory.createResolver()`.";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
+
* Takes the arguments its callers pass - `readFile(path, callback)` and the
|
|
20
|
+
* rest - so the declaration describes a call that actually compiles, even
|
|
21
|
+
* though every one of them throws.
|
|
22
|
+
* @param {...unknown} _args arguments, ignored
|
|
19
23
|
* @returns {never} always throws
|
|
20
24
|
*/
|
|
21
|
-
const unavailable = () => {
|
|
25
|
+
const unavailable = (..._args) => {
|
|
22
26
|
throw new Error(message);
|
|
23
27
|
};
|
|
24
28
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
const { fileURLToPath } = require("url");
|
|
9
|
+
const { isFileURL } = require("./path");
|
|
9
10
|
|
|
10
11
|
const PATH_QUERY_FRAGMENT_REGEXP =
|
|
11
12
|
/^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
|
|
12
13
|
const ZERO_ESCAPE_REGEXP = /\0(.)/g;
|
|
13
|
-
const FILE_REG_EXP = /file:/i;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Index past a DOS device path prefix (`\\?\…` or `\\.\…`), or 0. Kept
|
|
@@ -41,7 +41,9 @@ function parseIdentifier(identifier) {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
// Only a whole `file:` URL is one - a path segment spelled `file:`, which
|
|
45
|
+
// `/tmp/profile:1.js` also contains, stays the path it is.
|
|
46
|
+
if (isFileURL(identifier)) {
|
|
45
47
|
identifier = fileURLToPath(identifier);
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
// Node.js package maps: https://nodejs.org/api/packages.html#package-maps
|
|
8
|
+
//
|
|
9
|
+
// A package map is a static table that maps bare specifiers to package
|
|
10
|
+
// locations per importing package, so resolution never has to walk
|
|
11
|
+
// `node_modules`. This module turns the configuration file into the lookup
|
|
12
|
+
// tables `PackageMapPlugin` needs; no file system access is involved beyond
|
|
13
|
+
// reading the file itself.
|
|
14
|
+
//
|
|
15
|
+
// @experimental Package maps are stability 1 (experimental) in Node.js and are
|
|
16
|
+
// only reachable there behind `--experimental-package-map`. This parser tracks
|
|
17
|
+
// that specification and may change with it, including in a patch release.
|
|
18
|
+
|
|
19
|
+
const fileURLToPath = require("./fileURLToPath");
|
|
20
|
+
const { isInside, normalize } = require("./path");
|
|
21
|
+
const pathToFileURL = require("./pathToFileURL");
|
|
22
|
+
|
|
23
|
+
/** @typedef {import("../Resolver").JsonObject} JsonObject */
|
|
24
|
+
|
|
25
|
+
/** @typedef {{ [specifier: string]: string }} PackageMapDependencies */
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A single entry of the configuration file's `packages` object.
|
|
29
|
+
* @typedef {object} PackageMapPackage
|
|
30
|
+
* @property {string} url an absolute or relative `file:` URL, resolved against the configuration file
|
|
31
|
+
* @property {PackageMapDependencies=} dependencies bare specifier to package id
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** @typedef {{ [id: string]: PackageMapPackage }} PackageMapPackages */
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The parsed contents of a package map configuration file.
|
|
38
|
+
* @typedef {object} PackageMapJson
|
|
39
|
+
* @property {PackageMapPackages} packages package entries by package id
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {object} PackageMapEntry
|
|
44
|
+
* @property {string} id the package id this entry is keyed by
|
|
45
|
+
* @property {string} path absolute filesystem path the entry's `url` points at
|
|
46
|
+
* @property {Map<string, string>} dependencies bare specifier to package id
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {object} PackageMap
|
|
51
|
+
* @property {Map<string, PackageMapEntry>} packages entries by package id
|
|
52
|
+
* @property {{ path: string, ids: string[] }[]} locations package ids by location, longest path first
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} message message
|
|
57
|
+
* @param {string} code error code
|
|
58
|
+
* @returns {Error & { code: string }} the error
|
|
59
|
+
*/
|
|
60
|
+
function createError(message, code) {
|
|
61
|
+
const error = /** @type {Error & { code: string }} */ (new Error(message));
|
|
62
|
+
error.code = code;
|
|
63
|
+
return error;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Resolve an entry's `url` the way Node does: through the WHATWG `URL` parser
|
|
68
|
+
* with the configuration file as the base, accepting only `file:`.
|
|
69
|
+
* @param {string} url the entry's `url` value
|
|
70
|
+
* @param {URL} base the configuration file URL
|
|
71
|
+
* @param {string} id the package id, for error messages
|
|
72
|
+
* @returns {string} the absolute filesystem path
|
|
73
|
+
*/
|
|
74
|
+
function toPackagePath(url, base, id) {
|
|
75
|
+
let parsed;
|
|
76
|
+
try {
|
|
77
|
+
parsed = new URL(url, base);
|
|
78
|
+
} catch (_err) {
|
|
79
|
+
throw createError(
|
|
80
|
+
`Package map entry "${id}" has an invalid "url": ${url}`,
|
|
81
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (parsed.protocol !== "file:") {
|
|
85
|
+
throw createError(
|
|
86
|
+
`Package map entry "${id}" must use a "file:" url, received: ${url}`,
|
|
87
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
return normalize(fileURLToPath(parsed));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Parse and validate a package map configuration file.
|
|
95
|
+
*
|
|
96
|
+
* Dangling dependency targets are rejected here rather than at resolution
|
|
97
|
+
* time: the map is static, so a broken table is a configuration error that is
|
|
98
|
+
* better surfaced once and in full.
|
|
99
|
+
* @param {JsonObject} data the parsed configuration file contents
|
|
100
|
+
* @param {string} configFilePath absolute path of the configuration file, used as the base for relative urls
|
|
101
|
+
* @returns {PackageMap} the parsed package map
|
|
102
|
+
*/
|
|
103
|
+
function parsePackageMap(data, configFilePath) {
|
|
104
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
105
|
+
throw createError(
|
|
106
|
+
`Package map "${configFilePath}" must contain a JSON object`,
|
|
107
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const rawPackages = data.packages;
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
!rawPackages ||
|
|
115
|
+
typeof rawPackages !== "object" ||
|
|
116
|
+
Array.isArray(rawPackages)
|
|
117
|
+
) {
|
|
118
|
+
throw createError(
|
|
119
|
+
`Package map "${configFilePath}" must contain a "packages" object`,
|
|
120
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const base = pathToFileURL(configFilePath);
|
|
125
|
+
/** @type {Map<string, PackageMapEntry>} */
|
|
126
|
+
const packages = new Map();
|
|
127
|
+
/** @type {Map<string, string[]>} */
|
|
128
|
+
const idsByPath = new Map();
|
|
129
|
+
|
|
130
|
+
for (const id of Object.keys(rawPackages)) {
|
|
131
|
+
const rawEntry = /** @type {JsonObject} */ (rawPackages[id]);
|
|
132
|
+
|
|
133
|
+
if (!rawEntry || typeof rawEntry !== "object" || Array.isArray(rawEntry)) {
|
|
134
|
+
throw createError(
|
|
135
|
+
`Package map entry "${id}" must be an object`,
|
|
136
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
// An empty `url` would resolve to the configuration file itself rather
|
|
140
|
+
// than to a package directory, so reject it like Node does.
|
|
141
|
+
if (typeof rawEntry.url !== "string" || rawEntry.url === "") {
|
|
142
|
+
throw createError(
|
|
143
|
+
`Package map entry "${id}" must have a non-empty string "url"`,
|
|
144
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const packagePath = toPackagePath(rawEntry.url, base, id);
|
|
149
|
+
/** @type {Map<string, string>} */
|
|
150
|
+
const dependencies = new Map();
|
|
151
|
+
const rawDependencies = rawEntry.dependencies;
|
|
152
|
+
|
|
153
|
+
if (rawDependencies !== undefined) {
|
|
154
|
+
if (
|
|
155
|
+
!rawDependencies ||
|
|
156
|
+
typeof rawDependencies !== "object" ||
|
|
157
|
+
Array.isArray(rawDependencies)
|
|
158
|
+
) {
|
|
159
|
+
throw createError(
|
|
160
|
+
`Package map entry "${id}" has a non-object "dependencies"`,
|
|
161
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
for (const specifier of Object.keys(rawDependencies)) {
|
|
165
|
+
const target = rawDependencies[specifier];
|
|
166
|
+
|
|
167
|
+
if (typeof target !== "string") {
|
|
168
|
+
throw createError(
|
|
169
|
+
`Package map entry "${id}" maps "${specifier}" to a non-string package id`,
|
|
170
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
dependencies.set(specifier, target);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
packages.set(id, { id, path: packagePath, dependencies });
|
|
178
|
+
|
|
179
|
+
const ids = idsByPath.get(packagePath);
|
|
180
|
+
if (ids) {
|
|
181
|
+
ids.push(id);
|
|
182
|
+
} else {
|
|
183
|
+
idsByPath.set(packagePath, [id]);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
for (const entry of packages.values()) {
|
|
188
|
+
for (const [specifier, target] of entry.dependencies) {
|
|
189
|
+
if (!packages.has(target)) {
|
|
190
|
+
throw createError(
|
|
191
|
+
`Package map entry "${entry.id}" maps "${specifier}" to unknown package id "${target}"`,
|
|
192
|
+
"ERR_INVALID_PACKAGE_MAP",
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Longest path first so a package nested inside another one wins the
|
|
199
|
+
// containment lookup below.
|
|
200
|
+
const locations = [...idsByPath]
|
|
201
|
+
.map(([path, ids]) => ({ path, ids }))
|
|
202
|
+
.sort((a, b) => b.path.length - a.path.length);
|
|
203
|
+
|
|
204
|
+
return { packages, locations };
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Find the package ids whose location contains `filePath`. More than one id is
|
|
209
|
+
* returned when several package entries share the same `url`, which the caller
|
|
210
|
+
* has to disambiguate with an explicit package id.
|
|
211
|
+
* @param {PackageMap} packageMap the package map
|
|
212
|
+
* @param {string} filePath an absolute filesystem path
|
|
213
|
+
* @returns {string[]} the matching package ids, empty when the path is outside every package
|
|
214
|
+
*/
|
|
215
|
+
function findPackageIds(packageMap, filePath) {
|
|
216
|
+
for (const location of packageMap.locations) {
|
|
217
|
+
if (isInside(location.path, filePath)) return location.ids;
|
|
218
|
+
}
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports.createError = createError;
|
|
223
|
+
module.exports.findPackageIds = findPackageIds;
|
|
224
|
+
module.exports.parsePackageMap = parsePackageMap;
|
|
@@ -17,6 +17,10 @@ const CHAR_LOWER_A = "a".charCodeAt(0);
|
|
|
17
17
|
const CHAR_LOWER_Z = "z".charCodeAt(0);
|
|
18
18
|
const CHAR_DOT = ".".charCodeAt(0);
|
|
19
19
|
const CHAR_COLON = ":".charCodeAt(0);
|
|
20
|
+
const CHAR_F = "F".charCodeAt(0);
|
|
21
|
+
const CHAR_LOWER_F = "f".charCodeAt(0);
|
|
22
|
+
|
|
23
|
+
const FILE_URL_REGEXP = /^file:\//i;
|
|
20
24
|
|
|
21
25
|
const posixNormalize = path.posix.normalize;
|
|
22
26
|
const winNormalize = path.win32.normalize;
|
|
@@ -422,16 +426,32 @@ const isSubPath = (parentPath, childPath) => {
|
|
|
422
426
|
};
|
|
423
427
|
|
|
424
428
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* @
|
|
429
|
+
* Whether a string names a `file:` URL rather than a path. The scheme has to
|
|
430
|
+
* open the string and be followed by a slash, as Node's own URL parser needs,
|
|
431
|
+
* so a path segment spelled `file:` stays a path and `file:x.js` — which Node
|
|
432
|
+
* reads as `/x.js` — stays the relative request it looks like.
|
|
433
|
+
* @param {string} maybePath a path or a `file:` URL string
|
|
434
|
+
* @returns {boolean} true when the string is a `file:` URL
|
|
435
|
+
*/
|
|
436
|
+
const isFileURL = (maybePath) => {
|
|
437
|
+
// The first character keeps every path not starting with `f` off the regexp
|
|
438
|
+
const c0 = maybePath.charCodeAt(0);
|
|
439
|
+
return (
|
|
440
|
+
(c0 === CHAR_LOWER_F || c0 === CHAR_F) && FILE_URL_REGEXP.test(maybePath)
|
|
441
|
+
);
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Convert a `file:` URL — a `URL` instance or a `file:/` string, the form
|
|
446
|
+
* `import.meta.resolve` returns — to the path it names. Anything else is
|
|
447
|
+
* returned unchanged, so a path passes through.
|
|
448
|
+
* @param {string | URL} maybeURL a path, a `file:` URL string or a `file:` `URL` instance
|
|
431
449
|
* @returns {string} a filesystem path
|
|
432
450
|
*/
|
|
433
|
-
const toPath = (maybeURL) =>
|
|
434
|
-
maybeURL instanceof URL
|
|
451
|
+
const toPath = (maybeURL) => {
|
|
452
|
+
if (maybeURL instanceof URL) return fileURLToPath(maybeURL);
|
|
453
|
+
return isFileURL(maybeURL) ? fileURLToPath(maybeURL) : maybeURL;
|
|
454
|
+
};
|
|
435
455
|
|
|
436
456
|
module.exports.PathType = PathType;
|
|
437
457
|
module.exports.createCachedBasename = createCachedBasename;
|
|
@@ -441,6 +461,7 @@ module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx;
|
|
|
441
461
|
module.exports.dirname = dirname;
|
|
442
462
|
module.exports.getType = getType;
|
|
443
463
|
module.exports.invalidSegmentRegEx = invalidSegmentRegEx;
|
|
464
|
+
module.exports.isFileURL = isFileURL;
|
|
444
465
|
module.exports.isInside = isInside;
|
|
445
466
|
module.exports.isRelativeRequest = isRelativeRequest;
|
|
446
467
|
module.exports.isSubPath = isSubPath;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
// A runtime-agnostic port of Node's `url.pathToFileURL`, built on the global
|
|
8
|
+
// `URL` (available in Node, browsers, Deno and Bun) so the resolver does not
|
|
9
|
+
// depend on the Node `url` builtin. It is the inverse of `./fileURLToPath` and
|
|
10
|
+
// takes the same `windows` option to force the platform branch.
|
|
11
|
+
//
|
|
12
|
+
// Unlike Node's version this does not call `path.resolve` on the input: the
|
|
13
|
+
// resolver only ever converts paths it has already made absolute, and reaching
|
|
14
|
+
// for the current working directory would not work in a browser.
|
|
15
|
+
|
|
16
|
+
const percentRegEx = /%/g;
|
|
17
|
+
const backslashRegEx = /\\/g;
|
|
18
|
+
const newlineRegEx = /\n/g;
|
|
19
|
+
const carriageReturnRegEx = /\r/g;
|
|
20
|
+
const tabRegEx = /\t/g;
|
|
21
|
+
|
|
22
|
+
const isWindows =
|
|
23
|
+
typeof process !== "undefined" && process.platform === "win32";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Percent-encode the characters the `URL` pathname setter would otherwise
|
|
27
|
+
* interpret. Everything else is left to the setter itself.
|
|
28
|
+
* @param {string} filepath absolute filesystem path
|
|
29
|
+
* @param {boolean} windows true to follow the Windows branch
|
|
30
|
+
* @returns {string} the encoded path
|
|
31
|
+
*/
|
|
32
|
+
function encodePathChars(filepath, windows) {
|
|
33
|
+
if (filepath.includes("%")) {
|
|
34
|
+
filepath = filepath.replace(percentRegEx, "%25");
|
|
35
|
+
}
|
|
36
|
+
// A backslash is a legal character in a POSIX file name, so it has to be
|
|
37
|
+
// encoded rather than treated as a separator.
|
|
38
|
+
if (!windows && filepath.includes("\\")) {
|
|
39
|
+
filepath = filepath.replace(backslashRegEx, "%5C");
|
|
40
|
+
}
|
|
41
|
+
if (filepath.includes("\n")) {
|
|
42
|
+
filepath = filepath.replace(newlineRegEx, "%0A");
|
|
43
|
+
}
|
|
44
|
+
if (filepath.includes("\r")) {
|
|
45
|
+
filepath = filepath.replace(carriageReturnRegEx, "%0D");
|
|
46
|
+
}
|
|
47
|
+
if (filepath.includes("\t")) {
|
|
48
|
+
filepath = filepath.replace(tabRegEx, "%09");
|
|
49
|
+
}
|
|
50
|
+
return filepath;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} filepath an absolute filesystem path
|
|
55
|
+
* @param {{ windows?: boolean }=} options force the platform branch
|
|
56
|
+
* @returns {URL} the `file:` URL
|
|
57
|
+
*/
|
|
58
|
+
function pathToFileURL(filepath, options) {
|
|
59
|
+
const windows =
|
|
60
|
+
options && options.windows !== undefined ? options.windows : isWindows;
|
|
61
|
+
|
|
62
|
+
if (windows && filepath.startsWith("\\\\")) {
|
|
63
|
+
// UNC path: `\\server\share\file` becomes `file://server/share/file`.
|
|
64
|
+
const hostnameEndIndex = filepath.indexOf("\\", 2);
|
|
65
|
+
if (hostnameEndIndex === -1) {
|
|
66
|
+
throw new TypeError(
|
|
67
|
+
`Missing UNC resource path in file path '${filepath}'`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (hostnameEndIndex === 2) {
|
|
71
|
+
throw new TypeError(`Empty UNC servername in file path '${filepath}'`);
|
|
72
|
+
}
|
|
73
|
+
const url = new URL("file://");
|
|
74
|
+
url.hostname = filepath.slice(2, hostnameEndIndex);
|
|
75
|
+
url.pathname = encodePathChars(
|
|
76
|
+
filepath.slice(hostnameEndIndex).replace(backslashRegEx, "/"),
|
|
77
|
+
windows,
|
|
78
|
+
);
|
|
79
|
+
return url;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const url = new URL("file://");
|
|
83
|
+
url.pathname = encodePathChars(filepath, windows);
|
|
84
|
+
return url;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
module.exports = pathToFileURL;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enhanced-resolve",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.0",
|
|
4
4
|
"description": "Offers a async require.resolve function. It's highly configurable.",
|
|
5
5
|
"homepage": "https://github.com/webpack/enhanced-resolve#readme",
|
|
6
6
|
"repository": {
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
"types": "types.d.ts",
|
|
21
21
|
"files": [
|
|
22
22
|
"lib",
|
|
23
|
+
"types",
|
|
23
24
|
"types.d.ts",
|
|
24
25
|
"LICENSE"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"prepare": "husky",
|
|
28
|
-
"lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run
|
|
29
|
+
"lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run fmt:check && npm run lint:spellcheck",
|
|
29
30
|
"lint:code": "eslint --cache .",
|
|
30
|
-
"lint:special": "node node_modules/tooling/inherit-types && node node_modules/tooling/generate-types",
|
|
31
31
|
"lint:types": "tsc",
|
|
32
32
|
"lint:types-test": "tsc -p tsconfig.types.test.json",
|
|
33
33
|
"lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
|
|
34
34
|
"fmt": "npm run fmt:base -- --log-level warn --write",
|
|
35
35
|
"fmt:check": "npm run fmt:base -- --check",
|
|
36
36
|
"fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .",
|
|
37
|
-
"fix": "npm run fix:code && npm run
|
|
37
|
+
"fix": "npm run fix:code && npm run build:types",
|
|
38
38
|
"fix:code": "npm run lint:code -- --fix",
|
|
39
|
-
"
|
|
39
|
+
"build:types": "node -e \"require('fs').rmSync('types', { recursive: true, force: true })\" && tsc -p tsconfig.types.json && prettier --log-level warn --write \"types/**/*.d.ts\"",
|
|
40
40
|
"type-report": "rimraf coverage && npm run cover:types && npm run cover:report && open-cli coverage/lcov-report/index.html",
|
|
41
41
|
"pretest": "npm run lint",
|
|
42
42
|
"test": "npm run test:only",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"tapable": "^2.3.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@changesets/cli": "^
|
|
66
|
-
"@changesets/get-github-info": "^0.
|
|
67
|
-
"@codspeed/core": "^5.
|
|
65
|
+
"@changesets/cli": "^3.0.2",
|
|
66
|
+
"@changesets/get-github-info": "^1.0.1",
|
|
67
|
+
"@codspeed/core": "^5.7.1",
|
|
68
68
|
"@types/graceful-fs": "^4.1.6",
|
|
69
69
|
"@types/node": "^24.10.4",
|
|
70
70
|
"cspell": "^10.0.0",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"memfs": "^4.56.11",
|
|
76
76
|
"prettier": "^3.7.4",
|
|
77
77
|
"tinybench": "^6.0.0",
|
|
78
|
-
"tooling": "webpack/tooling#v1.26.4",
|
|
79
78
|
"typescript": "^6.0.2",
|
|
80
79
|
"webpack": "^5.107.2"
|
|
81
80
|
},
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export = AliasFieldPlugin;
|
|
2
|
+
declare class AliasFieldPlugin {
|
|
3
|
+
/**
|
|
4
|
+
* @param {string | ResolveStepHook} source source
|
|
5
|
+
* @param {string | string[]} field field
|
|
6
|
+
* @param {string | ResolveStepHook} target target
|
|
7
|
+
*/
|
|
8
|
+
constructor(
|
|
9
|
+
source: string | ResolveStepHook,
|
|
10
|
+
field: string | string[],
|
|
11
|
+
target: string | ResolveStepHook,
|
|
12
|
+
);
|
|
13
|
+
source: string | import("./Resolver").ResolveStepHook;
|
|
14
|
+
field: string | string[];
|
|
15
|
+
target: string | import("./Resolver").ResolveStepHook;
|
|
16
|
+
/** @type {WeakMap<import("./Resolver").JsonObject, { [k: string]: JsonPrimitive } | typeof NO_FIELD_OBJECT>} */
|
|
17
|
+
_fieldDataCache: WeakMap<
|
|
18
|
+
import("./Resolver").JsonObject,
|
|
19
|
+
| {
|
|
20
|
+
[k: string]: JsonPrimitive;
|
|
21
|
+
}
|
|
22
|
+
| typeof NO_FIELD_OBJECT
|
|
23
|
+
>;
|
|
24
|
+
/**
|
|
25
|
+
* @param {Resolver} resolver the resolver
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
apply(resolver: Resolver): void;
|
|
29
|
+
}
|
|
30
|
+
declare namespace AliasFieldPlugin {
|
|
31
|
+
export { Resolver, JsonPrimitive, ResolveRequest, ResolveStepHook };
|
|
32
|
+
}
|
|
33
|
+
/** @typedef {import("./Resolver")} Resolver */
|
|
34
|
+
/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */
|
|
35
|
+
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
|
|
36
|
+
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
|
|
37
|
+
declare const NO_FIELD_OBJECT: unique symbol;
|
|
38
|
+
type Resolver = import("./Resolver");
|
|
39
|
+
type JsonPrimitive = import("./Resolver").JsonPrimitive;
|
|
40
|
+
type ResolveRequest = import("./Resolver").ResolveRequest;
|
|
41
|
+
type ResolveStepHook = import("./Resolver").ResolveStepHook;
|