packtory 0.0.96 → 0.0.98
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/artifacts/artifacts-builder.js +37 -4
- package/artifacts/artifacts-builder.js.map +1 -1
- package/artifacts/content-collection.js +59 -2
- package/artifacts/content-collection.js.map +1 -1
- package/artifacts/folder-writer.js +25 -2
- package/artifacts/folder-writer.js.map +1 -1
- package/bundle-emitter/emitter.js +137 -6
- package/bundle-emitter/emitter.js.map +1 -1
- package/bundle-emitter/extract-package-tarball.js +13 -2
- package/bundle-emitter/extract-package-tarball.js.map +1 -1
- package/bundle-emitter/fetch-published-artifacts.js +19 -2
- package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
- package/bundle-emitter/publication-outcome.js +5 -0
- package/bundle-emitter/publication-outcome.js.map +1 -1
- package/bundle-emitter/publish-error/auto-mode-error-matching.js +28 -2
- package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/error-shape-helpers.js +9 -0
- package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
- package/bundle-emitter/publish-error/file-mode-error-matching.js +33 -2
- package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/publish-error-messages.js +24 -0
- package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
- package/bundle-emitter/registry/metadata-auth-retry.js +24 -1
- package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
- package/bundle-emitter/registry/oidc-token-exchange.js +68 -3
- package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.js +210 -7
- package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
- package/bundle-emitter/registry/publish-settings-bridge.js +34 -3
- package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
- package/bundle-emitter/registry/registry-auth-config.js +106 -0
- package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
- package/bundle-emitter/registry/registry-client.js +74 -4
- package/bundle-emitter/registry/registry-client.js.map +1 -1
- package/bundle-emitter/registry/registry-package-path.js +3 -0
- package/bundle-emitter/registry/registry-package-path.js.map +1 -1
- package/bundle-emitter/registry/registry-response-schemas.js +50 -2
- package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.js +31 -1
- package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
- package/bundle-emitter/registry/validate-tarball-host.js +26 -1
- package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
- package/bundle-emitter/release-artifact-canonicalizer.js +31 -5
- package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
- package/checks/check-runner.js +8 -0
- package/checks/check-runner.js.map +1 -1
- package/checks/rule.js +12 -2
- package/checks/rule.js.map +1 -1
- package/checks/rules/duplicate-detection.js +23 -1
- package/checks/rules/duplicate-detection.js.map +1 -1
- package/checks/rules/duplicate-messages.js +22 -0
- package/checks/rules/duplicate-messages.js.map +1 -1
- package/checks/rules/file-ownership.js +15 -0
- package/checks/rules/file-ownership.js.map +1 -1
- package/checks/rules/max-bundle-size.js +55 -1
- package/checks/rules/max-bundle-size.js.map +1 -1
- package/checks/rules/no-dev-dependency-imports.js +51 -1
- package/checks/rules/no-dev-dependency-imports.js.map +1 -1
- package/checks/rules/no-duplicated-files.js +53 -3
- package/checks/rules/no-duplicated-files.js.map +1 -1
- package/checks/rules/no-side-effects.js +50 -1
- package/checks/rules/no-side-effects.js.map +1 -1
- package/checks/rules/no-unexposed-executables.js +43 -2
- package/checks/rules/no-unexposed-executables.js.map +1 -1
- package/checks/rules/no-unused-bundle-dependencies.js +30 -2
- package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
- package/checks/rules/registry.js +22 -9
- package/checks/rules/registry.js.map +1 -1
- package/checks/rules/required-files.js +41 -3
- package/checks/rules/required-files.js.map +1 -1
- package/checks/rules/type-script-declaration-integrity.js +81 -3
- package/checks/rules/type-script-declaration-integrity.js.map +1 -1
- package/checks/rules/type-script-declaration-paths.js +55 -1
- package/checks/rules/type-script-declaration-paths.js.map +1 -1
- package/checks/rules/type-script-declaration-project.js +202 -3
- package/checks/rules/type-script-declaration-project.js.map +1 -1
- package/checks/rules/type-script-declaration-reachability.js +38 -2
- package/checks/rules/type-script-declaration-reachability.js.map +1 -1
- package/checks/rules/type-script-declaration-roots.js +29 -0
- package/checks/rules/type-script-declaration-roots.js.map +1 -1
- package/checks/rules/type-script-integrity.js +72 -2
- package/checks/rules/type-script-integrity.js.map +1 -1
- package/checks/rules/type-script-package-resolution.js +42 -1
- package/checks/rules/type-script-package-resolution.js.map +1 -1
- package/checks/rules/type-script-resolution-summary.js +53 -0
- package/checks/rules/type-script-resolution-summary.js.map +1 -1
- package/checks/rules/unique-target-paths.js +34 -2
- package/checks/rules/unique-target-paths.js.map +1 -1
- package/common/bundled-dependency-groups.js +27 -0
- package/common/bundled-dependency-groups.js.map +1 -1
- package/common/code-files.js +28 -0
- package/common/code-files.js.map +1 -1
- package/common/declaration-companion-paths.js +24 -0
- package/common/declaration-companion-paths.js.map +1 -1
- package/common/package-name-map.js +7 -0
- package/common/package-name-map.js.map +1 -1
- package/common/stable-json.js +42 -2
- package/common/stable-json.js.map +1 -1
- package/common/worklist.js +22 -0
- package/common/worklist.js.map +1 -1
- package/config/additional-files.js +6 -2
- package/config/additional-files.js.map +1 -1
- package/config/additional-package-json-attributes-schema.js +6 -2
- package/config/additional-package-json-attributes-schema.js.map +1 -1
- package/config/automatic-versioning-settings.js +6 -2
- package/config/automatic-versioning-settings.js.map +1 -1
- package/config/changelog-settings.js +120 -3
- package/config/changelog-settings.js.map +1 -1
- package/config/common-package-settings-schemas.js +19 -3
- package/config/common-package-settings-schemas.js.map +1 -1
- package/config/config.js +3 -1
- package/config/config.js.map +1 -1
- package/config/cross-package-validation.js +17 -0
- package/config/cross-package-validation.js.map +1 -1
- package/config/dead-code-elimination-settings.js +36 -2
- package/config/dead-code-elimination-settings.js.map +1 -1
- package/config/dependency-existence-validation.js +19 -1
- package/config/dependency-existence-validation.js.map +1 -1
- package/config/dependency-policy.js +5 -2
- package/config/dependency-policy.js.map +1 -1
- package/config/main-package-json-schema.js +11 -2
- package/config/main-package-json-schema.js.map +1 -1
- package/config/manual-versioning-settings.d.ts +12 -0
- package/config/manual-versioning-settings.d.ts.map +1 -1
- package/config/manual-versioning-settings.js +29 -2
- package/config/manual-versioning-settings.js.map +1 -1
- package/config/optional-package-settings-schema.js +16 -7
- package/config/optional-package-settings-schema.js.map +1 -1
- package/config/package-config.js +2 -1
- package/config/package-config.js.map +1 -1
- package/config/package-graph-builder.js +14 -2
- package/config/package-graph-builder.js.map +1 -1
- package/config/package-interface.js +25 -2
- package/config/package-interface.js.map +1 -1
- package/config/package-json.d.ts.map +1 -1
- package/config/package-json.js +16 -0
- package/config/package-json.js.map +1 -1
- package/config/packtory-config-without-registry-schema.js +6 -0
- package/config/packtory-config-without-registry-schema.js.map +1 -1
- package/config/per-package-settings-schema.js +22 -6
- package/config/per-package-settings-schema.js.map +1 -1
- package/config/pre-graph-validation.js +20 -5
- package/config/pre-graph-validation.js.map +1 -1
- package/config/publish-settings.js +25 -3
- package/config/publish-settings.js.map +1 -1
- package/config/publish-settings.report.js +17 -1
- package/config/publish-settings.report.js.map +1 -1
- package/config/registry-settings.js +40 -2
- package/config/registry-settings.js.map +1 -1
- package/config/registry-settings.report.js +46 -0
- package/config/registry-settings.report.js.map +1 -1
- package/config/root-config-validation.js +141 -0
- package/config/root-config-validation.js.map +1 -1
- package/config/root.js +6 -2
- package/config/root.js.map +1 -1
- package/config/sbom-settings.js +4 -1
- package/config/sbom-settings.js.map +1 -1
- package/config/settings-validation.js +28 -0
- package/config/settings-validation.js.map +1 -1
- package/config/versioning-settings.js +10 -3
- package/config/versioning-settings.js.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.js +7 -0
- package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
- package/dead-code-eliminator/artifact-module-reference-contract.js +27 -0
- package/dead-code-eliminator/artifact-module-reference-contract.js.map +1 -0
- package/dead-code-eliminator/bundle-analysis.js +38 -5
- package/dead-code-eliminator/bundle-analysis.js.map +1 -1
- package/dead-code-eliminator/class-purity.js +48 -2
- package/dead-code-eliminator/class-purity.js.map +1 -1
- package/dead-code-eliminator/code-file-analyzer.js +68 -4
- package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/bundle-index.js +10 -0
- package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +22 -3
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/import-export-walker.js +164 -3
- package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/seed-store.js +10 -0
- package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
- package/dead-code-eliminator/dependency-metadata.js +172 -2
- package/dead-code-eliminator/dependency-metadata.js.map +1 -1
- package/dead-code-eliminator/elimination-emitter.js +52 -0
- package/dead-code-eliminator/elimination-emitter.js.map +1 -1
- package/dead-code-eliminator/eliminator.js +22 -4
- package/dead-code-eliminator/eliminator.js.map +1 -1
- package/dead-code-eliminator/expression-unwrapping.js +16 -1
- package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
- package/dead-code-eliminator/imported-expression-origin.js +101 -2
- package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
- package/dead-code-eliminator/liveness/asset-side-effects.js +9 -1
- package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
- package/dead-code-eliminator/liveness/boolean-facts.js +98 -2
- package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity-summary.js +314 -3
- package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity.js +39 -3
- package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
- package/dead-code-eliminator/liveness/module-analysis.js +27 -2
- package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
- package/dead-code-eliminator/liveness/resource-retention.js +91 -1
- package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
- package/dead-code-eliminator/liveness/runtime-code.js +15 -1
- package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
- package/dead-code-eliminator/load-bundle.js +86 -5
- package/dead-code-eliminator/load-bundle.js.map +1 -1
- package/dead-code-eliminator/pure-expression.js +178 -5
- package/dead-code-eliminator/pure-expression.js.map +1 -1
- package/dead-code-eliminator/reachability/bfs-closure.js +53 -0
- package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-extractor.js +100 -2
- package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-id.js +106 -1
- package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
- package/dead-code-eliminator/reachability/identifier-target-collector.js +96 -1
- package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
- package/dead-code-eliminator/reachability/impure-statements.js +11 -2
- package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
- package/dead-code-eliminator/reachability/local-seed-gathering.js +91 -4
- package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
- package/dead-code-eliminator/reachability/reachability.js +70 -4
- package/dead-code-eliminator/reachability/reachability.js.map +1 -1
- package/dead-code-eliminator/side-effect-classifier.js +39 -4
- package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
- package/dead-code-eliminator/side-effects-field.js +23 -1
- package/dead-code-eliminator/side-effects-field.js.map +1 -1
- package/dead-code-eliminator/source-map-recomposition.js +29 -2
- package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
- package/dead-code-eliminator/statement-classifiers.js +94 -4
- package/dead-code-eliminator/statement-classifiers.js.map +1 -1
- package/dead-code-eliminator/syntax-kind-sets.js +16 -0
- package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.js +57 -2
- package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-removal.js +183 -5
- package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-remover.js +17 -2
- package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
- package/dead-code-eliminator/transform/line-index.js +20 -0
- package/dead-code-eliminator/transform/line-index.js.map +1 -1
- package/dead-code-eliminator/transform/named-declaration-kinds.js +3 -0
- package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
- package/dead-code-eliminator/transform/source-map-composer.js +84 -3
- package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
- package/dead-code-eliminator/variable-declaration-bindings.js +25 -1
- package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
- package/dependency-scanner/dependency-graph.js +77 -3
- package/dependency-scanner/dependency-graph.js.map +1 -1
- package/dependency-scanner/external-dependencies.js +55 -1
- package/dependency-scanner/external-dependencies.js.map +1 -1
- package/dependency-scanner/file-host-predicates.js +9 -0
- package/dependency-scanner/file-host-predicates.js.map +1 -1
- package/dependency-scanner/host-method-binding.js +18 -0
- package/dependency-scanner/host-method-binding.js.map +1 -1
- package/dependency-scanner/injected-dynamic-imports.js +232 -1
- package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
- package/dependency-scanner/node-modules-manifest-synthesizer.js +52 -4
- package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
- package/dependency-scanner/package-owned-asset-file-path.js +9 -1
- package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
- package/dependency-scanner/scanner.js +109 -4
- package/dependency-scanner/scanner.js.map +1 -1
- package/dependency-scanner/source-file-references.js +171 -6
- package/dependency-scanner/source-file-references.js.map +1 -1
- package/dependency-scanner/source-map-file-locator.js +66 -2
- package/dependency-scanner/source-map-file-locator.js.map +1 -1
- package/dependency-scanner/typescript-compiler-options.js +21 -1
- package/dependency-scanner/typescript-compiler-options.js.map +1 -1
- package/dependency-scanner/typescript-file-host.js +49 -5
- package/dependency-scanner/typescript-file-host.js.map +1 -1
- package/dependency-scanner/typescript-module-resolution.js +214 -0
- package/dependency-scanner/typescript-module-resolution.js.map +1 -0
- package/dependency-scanner/typescript-project-analyzer.js +32 -3
- package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
- package/dependency-scanner/virtual-package-json-host.js +45 -4
- package/dependency-scanner/virtual-package-json-host.js.map +1 -1
- package/directed-graph/graph.js +240 -1
- package/directed-graph/graph.js.map +1 -1
- package/file-manager/compare.js +23 -2
- package/file-manager/compare.js.map +1 -1
- package/file-manager/equal.js +5 -0
- package/file-manager/equal.js.map +1 -1
- package/file-manager/file-description.js +3 -0
- package/file-manager/file-description.js.map +1 -1
- package/file-manager/permissions.js +28 -1
- package/file-manager/permissions.js.map +1 -1
- package/git/current-git-head.js +24 -0
- package/git/current-git-head.js.map +1 -1
- package/git/git-command.js +49 -1
- package/git/git-command.js.map +1 -1
- package/linker/linked-bundle.js +5 -0
- package/linker/linked-bundle.js.map +1 -1
- package/linker/linker.js +51 -5
- package/linker/linker.js.map +1 -1
- package/linker/replacement-lookup.js +297 -8
- package/linker/replacement-lookup.js.map +1 -1
- package/linker/resource-graph.js +65 -2
- package/linker/resource-graph.js.map +1 -1
- package/linker/source-modifier/import-paths.js +80 -3
- package/linker/source-modifier/import-paths.js.map +1 -1
- package/linker/substitute-bundles.js +166 -3
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +111 -2
- package/linker/substituted-resource-graph.js.map +1 -1
- package/npm-oidc-id-token-resolver.js +82 -0
- package/npm-oidc-id-token-resolver.js.map +1 -1
- package/pack-emitter/pack-emitter.js +27 -0
- package/pack-emitter/pack-emitter.js.map +1 -1
- package/package-surface/bin-field.js +8 -2
- package/package-surface/bin-field.js.map +1 -1
- package/package-surface/explicit-bin.js +24 -2
- package/package-surface/explicit-bin.js.map +1 -1
- package/package-surface/explicit-exports.js +26 -3
- package/package-surface/explicit-exports.js.map +1 -1
- package/package-surface/export-map.js +9 -2
- package/package-surface/export-map.js.map +1 -1
- package/package-surface/implicit-bin.js +25 -1
- package/package-surface/implicit-bin.js.map +1 -1
- package/package-surface/implicit-exports.js +10 -3
- package/package-surface/implicit-exports.js.map +1 -1
- package/package-surface/implicit-root-exports.js +13 -2
- package/package-surface/implicit-root-exports.js.map +1 -1
- package/package-surface/package-json-export.js +9 -0
- package/package-surface/package-json-export.js.map +1 -1
- package/package-surface/package-shape.js +10 -1
- package/package-surface/package-shape.js.map +1 -1
- package/package-surface/package-surface-index.js +165 -3
- package/package-surface/package-surface-index.js.map +1 -1
- package/package-surface/public-module-usage.js +46 -3
- package/package-surface/public-module-usage.js.map +1 -1
- package/package-surface/public-specifiers.js +7 -1
- package/package-surface/public-specifiers.js.map +1 -1
- package/package-surface/root-registry.js +26 -0
- package/package-surface/root-registry.js.map +1 -1
- package/package-surface/specifier-syntax.js +4 -0
- package/package-surface/specifier-syntax.js.map +1 -1
- package/package-surface/substitution-exports.js +101 -3
- package/package-surface/substitution-exports.js.map +1 -1
- package/package-surface/surface.js +12 -0
- package/package-surface/surface.js.map +1 -1
- package/package.json +2 -2
- package/packages/package-processor.composition.js +161 -34
- package/packages/package-processor.composition.js.map +1 -1
- package/packtory/map-config.js +35 -4
- package/packtory/map-config.js.map +1 -1
- package/packtory/normalize-paths.js +25 -1
- package/packtory/normalize-paths.js.map +1 -1
- package/packtory/options/bundle-dependency-resolution.js +17 -1
- package/packtory/options/bundle-dependency-resolution.js.map +1 -1
- package/packtory/options/dead-code-elimination-resolution.js +10 -1
- package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
- package/packtory/options/prepare-package-options.js +46 -5
- package/packtory/options/prepare-package-options.js.map +1 -1
- package/packtory/options/required-value-helpers.js +17 -0
- package/packtory/options/required-value-helpers.js.map +1 -1
- package/packtory/options/setting-resolvers.js +47 -3
- package/packtory/options/setting-resolvers.js.map +1 -1
- package/packtory/options/surface-resolution.js +15 -2
- package/packtory/options/surface-resolution.js.map +1 -1
- package/packtory/options/version-provider-context.js +24 -2
- package/packtory/options/version-provider-context.js.map +1 -1
- package/packtory/options/version-trigger.js +39 -2
- package/packtory/options/version-trigger.js.map +1 -1
- package/packtory/pack-output-preflight.js +60 -3
- package/packtory/pack-output-preflight.js.map +1 -1
- package/packtory/package-processor-build.js +97 -3
- package/packtory/package-processor-build.js.map +1 -1
- package/packtory/package-processor-publish.js +297 -6
- package/packtory/package-processor-publish.js.map +1 -1
- package/packtory/package-processor.js +10 -2
- package/packtory/package-processor.js.map +1 -1
- package/packtory/packtory-pack.js +298 -10
- package/packtory/packtory-pack.js.map +1 -1
- package/packtory/packtory-package-dependencies.js +116 -2
- package/packtory/packtory-package-dependencies.js.map +1 -1
- package/packtory/packtory-package-inspection.js +26 -5
- package/packtory/packtory-package-inspection.js.map +1 -1
- package/packtory/packtory-package-side-effects.js +64 -3
- package/packtory/packtory-package-side-effects.js.map +1 -1
- package/packtory/packtory-package-tree.js +43 -4
- package/packtory/packtory-package-tree.js.map +1 -1
- package/packtory/packtory-publish.js +17 -4
- package/packtory/packtory-publish.js.map +1 -1
- package/packtory/packtory-release-analysis.js +64 -6
- package/packtory/packtory-release-analysis.js.map +1 -1
- package/packtory/packtory-release-diff.js +48 -5
- package/packtory/packtory-release-diff.js.map +1 -1
- package/packtory/packtory-release-plan.js +87 -6
- package/packtory/packtory-release-plan.js.map +1 -1
- package/packtory/packtory-resolve.js +16 -5
- package/packtory/packtory-resolve.js.map +1 -1
- package/packtory/packtory.js +242 -13
- package/packtory/packtory.js.map +1 -1
- package/packtory/publish-failure-mapping.js +6 -0
- package/packtory/publish-failure-mapping.js.map +1 -1
- package/packtory/publish-target-preflight.js +25 -3
- package/packtory/publish-target-preflight.js.map +1 -1
- package/packtory/published-release-state.js +11 -0
- package/packtory/published-release-state.js.map +1 -1
- package/packtory/release-analysis.js +153 -5
- package/packtory/release-analysis.js.map +1 -1
- package/packtory/release-diff-failure-mapping.js +6 -0
- package/packtory/release-diff-failure-mapping.js.map +1 -1
- package/packtory/release-plan.js +135 -7
- package/packtory/release-plan.js.map +1 -1
- package/packtory/report-attachment.js +35 -2
- package/packtory/report-attachment.js.map +1 -1
- package/packtory/resolved-package.js +97 -3
- package/packtory/resolved-package.js.map +1 -1
- package/packtory/scheduler.js +99 -1
- package/packtory/scheduler.js.map +1 -1
- package/packtory/stages/package-analysis-stage.js +50 -2
- package/packtory/stages/package-analysis-stage.js.map +1 -1
- package/packtory/stages/package-resolution-stage.js +80 -5
- package/packtory/stages/package-resolution-stage.js.map +1 -1
- package/packtory/stages/publish-stage.js +125 -4
- package/packtory/stages/publish-stage.js.map +1 -1
- package/packtory/stages/release-diff-stage.js +84 -5
- package/packtory/stages/release-diff-stage.js.map +1 -1
- package/progress/progress-broadcaster.js +45 -0
- package/progress/progress-broadcaster.js.map +1 -1
- package/published-package/published-package.js +12 -1
- package/published-package/published-package.js.map +1 -1
- package/report/aggregator/artifact-entry-merger.js +20 -0
- package/report/aggregator/artifact-entry-merger.js.map +1 -1
- package/report/aggregator/package-report-materialization.js +75 -2
- package/report/aggregator/package-report-materialization.js.map +1 -1
- package/report/aggregator/report-aggregator.js +37 -2
- package/report/aggregator/report-aggregator.js.map +1 -1
- package/report/aggregator/report-event-handlers.js +141 -2
- package/report/aggregator/report-event-handlers.js.map +1 -1
- package/report/aggregator/report-types.js +3 -0
- package/report/aggregator/report-types.js.map +1 -1
- package/report/config-redactor.js +29 -3
- package/report/config-redactor.js.map +1 -1
- package/report/decorators.js +85 -0
- package/report/decorators.js.map +1 -1
- package/report/inspectors/inspect-artifact-sizes.js +34 -1
- package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
- package/report/inspectors/inspect-linker-rewrites.js +14 -1
- package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
- package/report/inspectors/inspect-package-json-provenance.js +15 -0
- package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
- package/report/inspectors/inspect-scan-results.js +15 -0
- package/report/inspectors/inspect-scan-results.js.map +1 -1
- package/report/release-diff/release-version-transition.js +18 -0
- package/report/release-diff/release-version-transition.js.map +1 -1
- package/resource-resolver/bundle-resource-lookup.js +25 -0
- package/resource-resolver/bundle-resource-lookup.js.map +1 -1
- package/resource-resolver/content.js +136 -4
- package/resource-resolver/content.js.map +1 -1
- package/resource-resolver/dependency-resolution-walker.js +73 -2
- package/resource-resolver/dependency-resolution-walker.js.map +1 -1
- package/resource-resolver/resolved-bundle.js +3 -0
- package/resource-resolver/resolved-bundle.js.map +1 -1
- package/resource-resolver/resource-resolve-options.js +13 -1
- package/resource-resolver/resource-resolve-options.js.map +1 -1
- package/resource-resolver/resource-resolver.js +128 -6
- package/resource-resolver/resource-resolver.js.map +1 -1
- package/sbom/extract-license.js +11 -1
- package/sbom/extract-license.js.map +1 -1
- package/sbom/license-resolver.js +23 -2
- package/sbom/license-resolver.js.map +1 -1
- package/sbom/sbom-builder.js +57 -2
- package/sbom/sbom-builder.js.map +1 -1
- package/sbom/sbom-canonicalizer.js +45 -3
- package/sbom/sbom-canonicalizer.js.map +1 -1
- package/sbom/sbom-file.js +54 -5
- package/sbom/sbom-file.js.map +1 -1
- package/sbom/sbom-serializer.js +14 -1
- package/sbom/sbom-serializer.js.map +1 -1
- package/sbom/tool-version.js +49 -1
- package/sbom/tool-version.js.map +1 -1
- package/sbom.cdx.json +10 -10
- package/tar/extract-tar.js +83 -3
- package/tar/extract-tar.js.map +1 -1
- package/tar/gzipped-pack.js +20 -0
- package/tar/gzipped-pack.js.map +1 -1
- package/tar/tarball-builder.js +44 -4
- package/tar/tarball-builder.js.map +1 -1
- package/vendor-materializer/vendor-entry.js +20 -1
- package/vendor-materializer/vendor-entry.js.map +1 -1
- package/vendor-materializer/vendor-materializer.js +240 -8
- package/vendor-materializer/vendor-materializer.js.map +1 -1
- package/version-manager/dependencies/bundle-dependency-grouping.js +32 -2
- package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
- package/version-manager/dependencies/dependency-groups.js +11 -1
- package/version-manager/dependencies/dependency-groups.js.map +1 -1
- package/version-manager/dependencies/external-dependency-classification.js +82 -3
- package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
- package/version-manager/dependencies/versioned-bundle-dependencies.js +8 -3
- package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
- package/version-manager/imports/hash-import-scanner.js +20 -2
- package/version-manager/imports/hash-import-scanner.js.map +1 -1
- package/version-manager/imports/imports-key-matcher.js +22 -0
- package/version-manager/imports/imports-key-matcher.js.map +1 -1
- package/version-manager/imports/versioned-bundle-imports.js +44 -2
- package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
- package/version-manager/manager.js +46 -6
- package/version-manager/manager.js.map +1 -1
- package/version-manager/manifest/builder.js +51 -1
- package/version-manager/manifest/builder.js.map +1 -1
- package/version-manager/manifest/serialize.js +8 -1
- package/version-manager/manifest/serialize.js.map +1 -1
- package/version-manager/optional-bundle-fields.js +5 -1
- package/version-manager/optional-bundle-fields.js.map +1 -1
- package/version-manager/representative-root.js +9 -1
- package/version-manager/representative-root.js.map +1 -1
- package/version-manager/specifier-classifier.js +42 -2
- package/version-manager/specifier-classifier.js.map +1 -1
- package/version-manager/specifier-errors.js +58 -0
- package/version-manager/specifier-errors.js.map +1 -1
- package/version-manager/versioned-bundle.js +31 -6
- package/version-manager/versioned-bundle.js.map +1 -1
- package/zip/zip-builder.js +81 -2
- package/zip/zip-builder.js.map +1 -1
- package/dead-code-eliminator/liveness/external-module-resolution.js +0 -3
- package/dead-code-eliminator/liveness/external-module-resolution.js.map +0 -1
|
@@ -1 +1,10 @@
|
|
|
1
|
+
function packageJsonExportPath() {
|
|
2
|
+
return './package.json';
|
|
3
|
+
}
|
|
4
|
+
export function decorateWithPackageJsonExport(bundle, exportsField) {
|
|
5
|
+
if (bundle.exportPackageJson !== true) {
|
|
6
|
+
return exportsField;
|
|
7
|
+
}
|
|
8
|
+
return { ...exportsField, [packageJsonExportPath()]: packageJsonExportPath() };
|
|
9
|
+
}
|
|
1
10
|
//# sourceMappingURL=package-json-export.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-export.js","sourceRoot":"","sources":["../../../../source/package-surface/package-json-export.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"package-json-export.js","sourceRoot":"","sources":["../../../../source/package-surface/package-json-export.ts"],"names":[],"mappings":"AAEA,SAAS,qBAAqB;IAC1B,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,6BAA6B,CACzC,MAA6B,EAC7B,YAAsB;IAEtB,IAAI,MAAM,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,YAAY,CAAC;IACxB,CAAC;IACD,OAAO,EAAE,GAAG,YAAY,EAAE,CAAC,qBAAqB,EAAE,CAAC,EAAE,qBAAqB,EAAE,EAAE,CAAC;AACnF,CAAC"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import 'remeda';
|
|
1
|
+
import { isDefined, pickBy } from 'remeda';
|
|
2
|
+
export function toImportTarget(targetFilePath) {
|
|
3
|
+
return `./${targetFilePath}`;
|
|
4
|
+
}
|
|
5
|
+
export function buildExportEntry(root) {
|
|
6
|
+
return pickBy({
|
|
7
|
+
import: toImportTarget(root.js.targetFilePath),
|
|
8
|
+
types: root.declarationFile === undefined ? undefined : toImportTarget(root.declarationFile.targetFilePath)
|
|
9
|
+
}, isDefined);
|
|
10
|
+
}
|
|
2
11
|
//# sourceMappingURL=package-shape.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-shape.js","sourceRoot":"","sources":["../../../../source/package-surface/package-shape.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"package-shape.js","sourceRoot":"","sources":["../../../../source/package-surface/package-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA8B3C,MAAM,UAAU,cAAc,CAAC,cAAsB;IACjD,OAAO,KAAK,cAAc,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAyB;IACtD,OAAO,MAAM,CACT;QACI,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC;QAC9C,KAAK,EAAE,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;KAC9G,EACD,SAAS,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,166 @@
|
|
|
1
|
-
import "../common/declaration-companion-paths.js";
|
|
2
|
-
import "./root-registry.js";
|
|
3
|
-
import "./specifier-syntax.js";
|
|
1
|
+
import { declarationCompanionCandidates } from "../common/declaration-companion-paths.js";
|
|
2
|
+
import { getEntryRootIds, getRoot } from "./root-registry.js";
|
|
3
|
+
import { toPackageSpecifier } from "./specifier-syntax.js";
|
|
4
|
+
function createPublicModuleIndexBuilder() {
|
|
5
|
+
const inputFilePathBySpecifier = new Map();
|
|
6
|
+
const specifierByInputFilePath = new Map();
|
|
7
|
+
function recordSourceFileSpecifier(inputFilePath, candidateSpecifier) {
|
|
8
|
+
const currentSpecifier = specifierByInputFilePath.get(inputFilePath);
|
|
9
|
+
if (currentSpecifier === undefined) {
|
|
10
|
+
specifierByInputFilePath.set(inputFilePath, candidateSpecifier);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function recordShortestSourceFileSpecifier(inputFilePath, candidateSpecifier) {
|
|
14
|
+
const currentSpecifier = specifierByInputFilePath.get(inputFilePath);
|
|
15
|
+
if (currentSpecifier === undefined || candidateSpecifier.length < currentSpecifier.length) {
|
|
16
|
+
specifierByInputFilePath.set(inputFilePath, candidateSpecifier);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function recordPublicInputFilePath(write) {
|
|
20
|
+
const hasPublicSpecifier = inputFilePathBySpecifier.has(write.specifier);
|
|
21
|
+
if (!hasPublicSpecifier && write.publicInputFilePath !== undefined) {
|
|
22
|
+
inputFilePathBySpecifier.set(write.specifier, write.publicInputFilePath);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
build() {
|
|
27
|
+
return { inputFilePathBySpecifier, specifierByInputFilePath };
|
|
28
|
+
},
|
|
29
|
+
recordFirstIndexedPublicSpecifier(write) {
|
|
30
|
+
for (const inputFilePath of write.inputFilePaths) {
|
|
31
|
+
recordSourceFileSpecifier(inputFilePath, write.specifier);
|
|
32
|
+
}
|
|
33
|
+
recordPublicInputFilePath(write);
|
|
34
|
+
},
|
|
35
|
+
recordShortestIndexedPublicSpecifier(write) {
|
|
36
|
+
for (const inputFilePath of write.inputFilePaths) {
|
|
37
|
+
recordShortestSourceFileSpecifier(inputFilePath, write.specifier);
|
|
38
|
+
}
|
|
39
|
+
recordPublicInputFilePath(write);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function rootInputFilePaths(root) {
|
|
44
|
+
if (root.declarationFile === undefined) {
|
|
45
|
+
return [root.js.inputFilePath];
|
|
46
|
+
}
|
|
47
|
+
return [root.js.inputFilePath, root.declarationFile.inputFilePath];
|
|
48
|
+
}
|
|
49
|
+
function isExplicitSummaryBundle(bundle) {
|
|
50
|
+
return bundle.surface.mode === 'explicit';
|
|
51
|
+
}
|
|
52
|
+
function isImplicitSummaryBundle(bundle) {
|
|
53
|
+
return bundle.surface.mode === 'implicit';
|
|
54
|
+
}
|
|
55
|
+
function isExplicitModuleBundle(bundle) {
|
|
56
|
+
return bundle.surface.mode === 'explicit';
|
|
57
|
+
}
|
|
58
|
+
function isImplicitModuleBundle(bundle) {
|
|
59
|
+
return bundle.surface.mode === 'implicit';
|
|
60
|
+
}
|
|
61
|
+
function firstExplicitRootId(surface) {
|
|
62
|
+
return surface.packageInterface.modules?.[0]?.root ?? surface.packageInterface.bins?.[0]?.root;
|
|
63
|
+
}
|
|
64
|
+
function summarizeImplicitPackageSurface(bundle) {
|
|
65
|
+
return {
|
|
66
|
+
publicRootIds: getEntryRootIds(bundle),
|
|
67
|
+
representativeRootId: bundle.surface.defaultModuleRoot
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function summarizeExplicitPackageSurface(bundle) {
|
|
71
|
+
const representativeRootId = firstExplicitRootId(bundle.surface);
|
|
72
|
+
if (representativeRootId === undefined) {
|
|
73
|
+
throw new Error(`Package "${bundle.name}" explicit surface declares neither modules nor bins`);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
publicRootIds: getEntryRootIds(bundle),
|
|
77
|
+
representativeRootId
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function summarizePackageSurface(bundle) {
|
|
81
|
+
if (isExplicitSummaryBundle(bundle)) {
|
|
82
|
+
return summarizeExplicitPackageSurface(bundle);
|
|
83
|
+
}
|
|
84
|
+
if (isImplicitSummaryBundle(bundle)) {
|
|
85
|
+
return summarizeImplicitPackageSurface(bundle);
|
|
86
|
+
}
|
|
87
|
+
throw new Error(`Unsupported package surface mode: ${bundle.surface.mode}`);
|
|
88
|
+
}
|
|
89
|
+
function indexExplicitPublicModules(bundle) {
|
|
90
|
+
const publicModuleIndex = createPublicModuleIndexBuilder();
|
|
91
|
+
const { modules } = bundle.surface.packageInterface;
|
|
92
|
+
if (modules === undefined) {
|
|
93
|
+
return publicModuleIndex.build();
|
|
94
|
+
}
|
|
95
|
+
for (const entry of modules) {
|
|
96
|
+
const root = getRoot(bundle, entry.root);
|
|
97
|
+
publicModuleIndex.recordShortestIndexedPublicSpecifier({
|
|
98
|
+
publicInputFilePath: root.js.inputFilePath,
|
|
99
|
+
inputFilePaths: rootInputFilePaths(root),
|
|
100
|
+
specifier: toPackageSpecifier(bundle.name, entry.export)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return publicModuleIndex.build();
|
|
104
|
+
}
|
|
105
|
+
function declarationCompanionSpecifier(bundle, targetFilePath) {
|
|
106
|
+
const companion = bundle.contents.find(function (entry) {
|
|
107
|
+
const candidatePaths = declarationCompanionCandidates(entry.fileDescription.targetFilePath);
|
|
108
|
+
return candidatePaths.includes(targetFilePath);
|
|
109
|
+
});
|
|
110
|
+
if (companion === undefined) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
return toPackageSpecifier(bundle.name, `./${companion.fileDescription.targetFilePath}`);
|
|
114
|
+
}
|
|
115
|
+
function recordImplicitRootModules(bundle, publicModuleIndex) {
|
|
116
|
+
const defaultRoot = getRoot(bundle, bundle.surface.defaultModuleRoot);
|
|
117
|
+
publicModuleIndex.recordFirstIndexedPublicSpecifier({
|
|
118
|
+
publicInputFilePath: defaultRoot.js.inputFilePath,
|
|
119
|
+
inputFilePaths: rootInputFilePaths(defaultRoot),
|
|
120
|
+
specifier: bundle.name
|
|
121
|
+
});
|
|
122
|
+
for (const root of Object.values(bundle.roots)) {
|
|
123
|
+
if (root.declarationFile !== undefined) {
|
|
124
|
+
publicModuleIndex.recordFirstIndexedPublicSpecifier({
|
|
125
|
+
publicInputFilePath: undefined,
|
|
126
|
+
inputFilePaths: [root.declarationFile.inputFilePath],
|
|
127
|
+
specifier: toPackageSpecifier(bundle.name, `./${root.js.targetFilePath}`)
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function recordImplicitContentModule(bundle, publicModuleIndex, entry) {
|
|
133
|
+
const companionSpecifier = declarationCompanionSpecifier(bundle, entry.fileDescription.targetFilePath);
|
|
134
|
+
if (companionSpecifier === undefined) {
|
|
135
|
+
publicModuleIndex.recordFirstIndexedPublicSpecifier({
|
|
136
|
+
publicInputFilePath: entry.fileDescription.inputFilePath,
|
|
137
|
+
inputFilePaths: [entry.fileDescription.inputFilePath],
|
|
138
|
+
specifier: toPackageSpecifier(bundle.name, `./${entry.fileDescription.targetFilePath}`)
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
publicModuleIndex.recordFirstIndexedPublicSpecifier({
|
|
143
|
+
publicInputFilePath: undefined,
|
|
144
|
+
inputFilePaths: [entry.fileDescription.inputFilePath],
|
|
145
|
+
specifier: companionSpecifier
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function indexImplicitPublicModules(bundle) {
|
|
150
|
+
const publicModuleIndex = createPublicModuleIndexBuilder();
|
|
151
|
+
recordImplicitRootModules(bundle, publicModuleIndex);
|
|
152
|
+
for (const entry of bundle.contents) {
|
|
153
|
+
recordImplicitContentModule(bundle, publicModuleIndex, entry);
|
|
154
|
+
}
|
|
155
|
+
return publicModuleIndex.build();
|
|
156
|
+
}
|
|
157
|
+
export function indexPublicModules(bundle) {
|
|
158
|
+
if (isExplicitModuleBundle(bundle)) {
|
|
159
|
+
return indexExplicitPublicModules(bundle);
|
|
160
|
+
}
|
|
161
|
+
if (isImplicitModuleBundle(bundle)) {
|
|
162
|
+
return indexImplicitPublicModules(bundle);
|
|
163
|
+
}
|
|
164
|
+
throw new Error(`Unsupported package surface mode: ${bundle.surface.mode}`);
|
|
165
|
+
}
|
|
4
166
|
//# sourceMappingURL=package-surface-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-surface-index.js","sourceRoot":"","sources":["../../../../source/package-surface/package-surface-index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"package-surface-index.js","sourceRoot":"","sources":["../../../../source/package-surface/package-surface-index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,8BAA8B,EACjC,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAsC3D,SAAS,8BAA8B;IACnC,M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AAU,kBAAkB,CAAC,MAA0B;IACzD,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
-
import 'ts-morph';
|
|
2
|
-
import "../common/code-files.js";
|
|
3
|
-
import "./public-specifiers.js";
|
|
1
|
+
import { ts as typescript } from 'ts-morph';
|
|
2
|
+
import { isCodeFile } from "../common/code-files.js";
|
|
3
|
+
import { resolvePublicModuleInputFilePath } from "./public-specifiers.js";
|
|
4
|
+
function* collectModuleSpecifiers(bundle) {
|
|
5
|
+
for (const resource of bundle.contents) {
|
|
6
|
+
const { targetFilePath, content } = resource.fileDescription;
|
|
7
|
+
if (isCodeFile(targetFilePath)) {
|
|
8
|
+
const parsedFile = typescript.preProcessFile(content, true);
|
|
9
|
+
for (const literal of parsedFile.importedFiles) {
|
|
10
|
+
yield literal.fileName;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function createUsageRecorder() {
|
|
16
|
+
const usages = new Map();
|
|
17
|
+
return {
|
|
18
|
+
usages,
|
|
19
|
+
recordUsage(bundleName, inputFilePath) {
|
|
20
|
+
const existing = usages.get(bundleName) ?? new Set();
|
|
21
|
+
existing.add(inputFilePath);
|
|
22
|
+
usages.set(bundleName, existing);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function recordConsumerPublicModuleUsage(recorder, bundles, consumer) {
|
|
27
|
+
const specifiers = collectModuleSpecifiers(consumer);
|
|
28
|
+
for (const specifier of specifiers) {
|
|
29
|
+
const otherBundles = bundles.filter(function (bundle) {
|
|
30
|
+
return bundle.name !== consumer.name;
|
|
31
|
+
});
|
|
32
|
+
for (const target of otherBundles) {
|
|
33
|
+
const inputFilePath = resolvePublicModuleInputFilePath(target, specifier);
|
|
34
|
+
if (inputFilePath !== undefined) {
|
|
35
|
+
recorder.recordUsage(target.name, inputFilePath);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function collectPublicModuleUsage(bundles) {
|
|
41
|
+
const recorder = createUsageRecorder();
|
|
42
|
+
for (const consumer of bundles) {
|
|
43
|
+
recordConsumerPublicModuleUsage(recorder, bundles, consumer);
|
|
44
|
+
}
|
|
45
|
+
return recorder.usages;
|
|
46
|
+
}
|
|
4
47
|
//# sourceMappingURL=public-module-usage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-module-usage.js","sourceRoot":"","sources":["../../../../source/package-surface/public-module-usage.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"public-module-usage.js","sourceRoot":"","sources":["../../../../source/package-surface/public-module-usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAO1E,QAAQ,CAAC,CAAC,uBAAuB,CAAC,MAAsB;IACpD,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAC7D,IAAI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7B,MAAM,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC5D,KAAK,MAAM,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B,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CAAC;AAC3B,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import "./package-surface-index.js";
|
|
1
|
+
import { indexPublicModules } from "./package-surface-index.js";
|
|
2
|
+
export function getPublicModuleSpecifierForSourcePath(bundle, inputFilePath) {
|
|
3
|
+
return indexPublicModules(bundle).specifierByInputFilePath.get(inputFilePath);
|
|
4
|
+
}
|
|
5
|
+
export function resolvePublicModuleInputFilePath(bundle, specifier) {
|
|
6
|
+
return indexPublicModules(bundle).inputFilePathBySpecifier.get(specifier);
|
|
7
|
+
}
|
|
2
8
|
//# sourceMappingURL=public-specifiers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-specifiers.js","sourceRoot":"","sources":["../../../../source/package-surface/public-specifiers.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"public-specifiers.js","sourceRoot":"","sources":["../../../../source/package-surface/public-specifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,MAAM,UAAU,qCAAqC,CAAC,MAAkB,EAAE,aAAqB;IAC3F,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,MAAkB,EAAE,SAAiB;IAClF,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1 +1,27 @@
|
|
|
1
|
+
export function getRoot(bundle, rootId) {
|
|
2
|
+
const root = bundle.roots[rootId];
|
|
3
|
+
if (root === undefined) {
|
|
4
|
+
throw new Error(`Package "${bundle.name}" references unknown root "${rootId}"`);
|
|
5
|
+
}
|
|
6
|
+
return root;
|
|
7
|
+
}
|
|
8
|
+
function collectExplicitPublicRootIds(surface) {
|
|
9
|
+
const publicRootIds = new Set();
|
|
10
|
+
const moduleEntries = surface.packageInterface.modules ?? [];
|
|
11
|
+
const binEntries = surface.packageInterface.bins ?? [];
|
|
12
|
+
for (const entry of moduleEntries) {
|
|
13
|
+
publicRootIds.add(entry.root);
|
|
14
|
+
}
|
|
15
|
+
for (const entry of binEntries) {
|
|
16
|
+
publicRootIds.add(entry.root);
|
|
17
|
+
}
|
|
18
|
+
return publicRootIds;
|
|
19
|
+
}
|
|
20
|
+
export function getEntryRootIds(bundle) {
|
|
21
|
+
if (bundle.surface.mode === 'implicit') {
|
|
22
|
+
return new Set(Object.keys(bundle.roots));
|
|
23
|
+
}
|
|
24
|
+
const publicRootIds = collectExplicitPublicRootIds(bundle.surface);
|
|
25
|
+
return new Set([...publicRootIds, ...bundle.surface.packageInterface.privateRoots ?? []]);
|
|
26
|
+
}
|
|
1
27
|
//# sourceMappingURL=root-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-registry.js","sourceRoot":"","sources":["../../../../source/package-surface/root-registry.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"root-registry.js","sourceRoot":"","sources":["../../../../source/package-surface/root-registry.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,MAA0C,EAAE,MAAc;IAC9E,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,CAAC,IAAI,8BAA8B,MAAM,GAAG,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,OAAwB;IAC1D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IACxC,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,IAAI,EAAE,CAAC;IAC7D,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,IAAI,EAAE,CAAC;IACvD,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;QAChC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC7B,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,aAAa,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAA6C;IACzE,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACrC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,aAAa,GAAG,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnE,OAAO,IAAI,GAAG,CAAC,CAAE,GAAG,aAAa,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,IAAI,EAAE,CAAE,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specifier-syntax.js","sourceRoot":"","sources":["../../../../source/package-surface/specifier-syntax.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"specifier-syntax.js","sourceRoot":"","sources":["../../../../source/package-surface/specifier-syntax.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,SAAiB;IACrE,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC;AACxG,CAAC"}
|
|
@@ -1,4 +1,102 @@
|
|
|
1
|
-
import 'remeda';
|
|
2
|
-
import "../common/declaration-companion-paths.js";
|
|
3
|
-
import "./package-shape.js";
|
|
1
|
+
import { isDefined, pickBy } from 'remeda';
|
|
2
|
+
import { declarationCompanionCandidates, isDeclarationCompanionFilePath } from "../common/declaration-companion-paths.js";
|
|
3
|
+
import { toImportTarget } from "./package-shape.js";
|
|
4
|
+
function collectRootInputFilePaths(bundle) {
|
|
5
|
+
const rootInputFilePaths = new Set();
|
|
6
|
+
for (const root of Object.values(bundle.roots)) {
|
|
7
|
+
rootInputFilePaths.add(root.js.inputFilePath);
|
|
8
|
+
}
|
|
9
|
+
return rootInputFilePaths;
|
|
10
|
+
}
|
|
11
|
+
function hasDeclarationRoots(bundle) {
|
|
12
|
+
return Object.values(bundle.roots).some(function (root) {
|
|
13
|
+
return root.declarationFile !== undefined;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function collectBundleContentLookups(bundle) {
|
|
17
|
+
const contentByInputFilePath = new Map();
|
|
18
|
+
const targetFilePaths = new Set();
|
|
19
|
+
for (const entry of bundle.contents) {
|
|
20
|
+
const { inputFilePath, targetFilePath } = entry.fileDescription;
|
|
21
|
+
if (!contentByInputFilePath.has(inputFilePath)) {
|
|
22
|
+
contentByInputFilePath.set(inputFilePath, entry);
|
|
23
|
+
}
|
|
24
|
+
targetFilePaths.add(targetFilePath);
|
|
25
|
+
}
|
|
26
|
+
return { contentByInputFilePath, targetFilePaths };
|
|
27
|
+
}
|
|
28
|
+
function createSubstitutionBundleLookups(bundle) {
|
|
29
|
+
const { contentByInputFilePath, targetFilePaths } = collectBundleContentLookups(bundle);
|
|
30
|
+
return {
|
|
31
|
+
contentByInputFilePath,
|
|
32
|
+
hasDeclarationRoots: hasDeclarationRoots(bundle),
|
|
33
|
+
targetFilePaths,
|
|
34
|
+
rootInputFilePaths: collectRootInputFilePaths(bundle)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function findBundleContent(bundleName, contentByInputFilePath, inputFilePath) {
|
|
38
|
+
const content = contentByInputFilePath.get(inputFilePath);
|
|
39
|
+
if (content === undefined) {
|
|
40
|
+
throw new Error(`Package "${bundleName}" is missing content for "${inputFilePath}"`);
|
|
41
|
+
}
|
|
42
|
+
return content;
|
|
43
|
+
}
|
|
44
|
+
function findDeclarationCompanionTargetPath(targetFilePaths, candidatePaths) {
|
|
45
|
+
return candidatePaths.find(function (candidatePath) {
|
|
46
|
+
return targetFilePaths.has(candidatePath);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function rejectMissingTypedDeclarationCompanion(bundleName, jsTargetFilePath, candidatePaths) {
|
|
50
|
+
throw new Error(`Package "${bundleName}" exposes substituted module "./${jsTargetFilePath}" without declaration companion ${candidatePaths.map(toImportTarget).join(' or ')}`);
|
|
51
|
+
}
|
|
52
|
+
function existingDeclarationTargetFilePathFor(bundleName, lookups, jsTargetFilePath, declarationCandidates) {
|
|
53
|
+
const declarationTargetFilePath = findDeclarationCompanionTargetPath(lookups.targetFilePaths, declarationCandidates);
|
|
54
|
+
if (declarationTargetFilePath !== undefined) {
|
|
55
|
+
return declarationTargetFilePath;
|
|
56
|
+
}
|
|
57
|
+
if (lookups.hasDeclarationRoots) {
|
|
58
|
+
rejectMissingTypedDeclarationCompanion(bundleName, jsTargetFilePath, declarationCandidates);
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
function declarationTargetFilePathFor(bundleName, lookups, jsTargetFilePath) {
|
|
63
|
+
const declarationCandidates = declarationCompanionCandidates(jsTargetFilePath);
|
|
64
|
+
if (declarationCandidates.length === 0) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return existingDeclarationTargetFilePathFor(bundleName, lookups, jsTargetFilePath, declarationCandidates);
|
|
68
|
+
}
|
|
69
|
+
function buildSubstitutionExportEntry(bundleName, lookups, inputFilePath) {
|
|
70
|
+
if (lookups.rootInputFilePaths.has(inputFilePath)) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const content = findBundleContent(bundleName, lookups.contentByInputFilePath, inputFilePath);
|
|
74
|
+
const jsTargetFilePath = content.fileDescription.targetFilePath;
|
|
75
|
+
if (isDeclarationCompanionFilePath(jsTargetFilePath)) {
|
|
76
|
+
return [
|
|
77
|
+
`./${jsTargetFilePath}`,
|
|
78
|
+
{ types: toImportTarget(jsTargetFilePath) }
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
const declarationTargetFilePath = declarationTargetFilePathFor(bundleName, lookups, jsTargetFilePath);
|
|
82
|
+
return [
|
|
83
|
+
`./${jsTargetFilePath}`,
|
|
84
|
+
pickBy({
|
|
85
|
+
import: toImportTarget(jsTargetFilePath),
|
|
86
|
+
types: declarationTargetFilePath === undefined ? undefined : toImportTarget(declarationTargetFilePath)
|
|
87
|
+
}, isDefined)
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
export function collectSubstitutionExports(bundle, substitutionPublicModuleSourcePaths) {
|
|
91
|
+
const lookups = createSubstitutionBundleLookups(bundle);
|
|
92
|
+
const substitutionExports = {};
|
|
93
|
+
for (const inputFilePath of substitutionPublicModuleSourcePaths) {
|
|
94
|
+
const entry = buildSubstitutionExportEntry(bundle.name, lookups, inputFilePath);
|
|
95
|
+
if (entry !== undefined) {
|
|
96
|
+
const [exportKey, exportEntry] = entry;
|
|
97
|
+
substitutionExports[exportKey] = exportEntry;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return substitutionExports;
|
|
101
|
+
}
|
|
4
102
|
//# sourceMappingURL=substitution-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitution-exports.js","sourceRoot":"","sources":["../../../../source/package-surface/substitution-exports.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"substitution-exports.js","sourceRoot":"","sources":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AAC,CAAC,CAAC,cAAc,CAAC,yBAAyB,CAAC;SACzG,EACD,SAAS,CACZ;KACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,0BAA0B,CACtC,MAA0B,EAC1B,mCAAwD;IAExD,MAAM,OAAO,GAAG,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAgC,EAAE,CAAC;IAE5D,KAAK,MAAM,aAAa,IAAI,mCAAmC,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAG,4BAA4B,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAChF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,CAAE,SAAS,EAAE,WAAW,CAAE,GAAG,KAAK,CAAC;YACzC,mBAAmB,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;QACjD,CAAC;IACL,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
export function implicitPackageSurface(defaultModuleRoot) {
|
|
2
|
+
return {
|
|
3
|
+
mode: 'implicit',
|
|
4
|
+
defaultModuleRoot
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export function explicitPackageSurface(packageInterface) {
|
|
8
|
+
return {
|
|
9
|
+
mode: 'explicit',
|
|
10
|
+
packageInterface
|
|
11
|
+
};
|
|
12
|
+
}
|
|
1
13
|
//# sourceMappingURL=surface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../../source/package-surface/surface.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../../source/package-surface/surface.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,sBAAsB,CAAC,iBAAyB;IAC5D,OAAO;QACH,IAAI,EAAE,UAAU;QAChB,iBAAiB;KACpB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,gBAAkC;IACrE,OAAO;QACH,IAAI,EAAE,UAAU;QAChB,gBAAgB;KACnB,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"libnpmpublish": "12.0.0",
|
|
21
21
|
"npm-package-arg": "14.0.0",
|
|
22
22
|
"npm-registry-fetch": "20.0.1",
|
|
23
|
-
"remeda": "2.
|
|
23
|
+
"remeda": "2.46.0",
|
|
24
24
|
"semver": "7.8.5",
|
|
25
25
|
"spdx-expression-parse": "5.0.0",
|
|
26
26
|
"ssri": "14.0.0",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"./tar/tarball-builder.js"
|
|
150
150
|
],
|
|
151
151
|
"type": "module",
|
|
152
|
-
"version": "0.0.
|
|
152
|
+
"version": "0.0.98"
|
|
153
153
|
}
|