packtory 0.0.14 → 0.0.16
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.d.ts +3 -1
- package/artifacts/artifacts-builder.d.ts.map +1 -1
- package/artifacts/artifacts-builder.js +20 -60
- package/artifacts/artifacts-builder.js.map +1 -1
- package/artifacts/content-collection.js +60 -0
- package/artifacts/content-collection.js.map +1 -0
- package/artifacts/folder-writer.js +24 -0
- package/artifacts/folder-writer.js.map +1 -0
- package/bundle-emitter/emitter.d.ts +3 -2
- package/bundle-emitter/emitter.d.ts.map +1 -1
- package/bundle-emitter/emitter.js +10 -8
- package/bundle-emitter/emitter.js.map +1 -1
- package/bundle-emitter/fetch-published-artifacts.d.ts +10 -0
- package/bundle-emitter/fetch-published-artifacts.d.ts.map +1 -0
- package/bundle-emitter/fetch-published-artifacts.js +16 -0
- package/bundle-emitter/fetch-published-artifacts.js.map +1 -0
- package/bundle-emitter/publish-error/auto-mode-error-matching.js +30 -0
- package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -0
- package/bundle-emitter/publish-error/error-shape-helpers.js +10 -0
- package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -0
- package/bundle-emitter/publish-error/file-mode-error-matching.js +28 -0
- package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -0
- package/bundle-emitter/publish-error/publish-error-messages.js +37 -0
- package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -0
- package/bundle-emitter/registry/metadata-auth-retry.js +26 -0
- package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -0
- package/bundle-emitter/registry/oidc-token-exchange.js +80 -0
- package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -0
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts +4 -0
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -0
- package/bundle-emitter/registry/package-metadata-fetcher.js +99 -0
- package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -0
- package/bundle-emitter/registry/publish-settings-bridge.js +39 -0
- package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -0
- package/bundle-emitter/registry/registry-auth-config.js +82 -0
- package/bundle-emitter/registry/registry-auth-config.js.map +1 -0
- package/bundle-emitter/registry/registry-client.d.ts +10 -0
- package/bundle-emitter/registry/registry-client.d.ts.map +1 -0
- package/bundle-emitter/registry/registry-client.js +38 -0
- package/bundle-emitter/registry/registry-client.js.map +1 -0
- package/bundle-emitter/registry/registry-response-schemas.js +44 -0
- package/bundle-emitter/registry/registry-response-schemas.js.map +1 -0
- package/bundle-emitter/repository-url-normalizer.js +2 -4
- package/bundle-emitter/repository-url-normalizer.js.map +1 -1
- package/checks/rules/duplicate-detection.js +26 -0
- package/checks/rules/duplicate-detection.js.map +1 -0
- package/checks/rules/duplicate-messages.js +26 -0
- package/checks/rules/duplicate-messages.js.map +1 -0
- package/checks/rules/file-ownership.js +16 -0
- package/checks/rules/file-ownership.js.map +1 -0
- package/checks/rules/no-duplicated-files.js +2 -76
- package/checks/rules/no-duplicated-files.js.map +1 -1
- package/checks/rules/required-files.js +2 -1
- package/checks/rules/required-files.js.map +1 -1
- package/checks/rules/set-intersection.js +14 -0
- package/checks/rules/set-intersection.js.map +1 -0
- package/checks/rules/unique-target-paths.js +11 -10
- package/checks/rules/unique-target-paths.js.map +1 -1
- package/common/code-files.js +21 -0
- package/common/code-files.js.map +1 -1
- package/common/max-date.js +6 -0
- package/common/max-date.js.map +1 -0
- package/common/sort-values.js.map +1 -0
- package/common/stable-json.js +42 -0
- package/common/stable-json.js.map +1 -0
- package/common/typed-diff.d.ts +3 -0
- package/common/typed-diff.d.ts.map +1 -0
- package/common/typed-diff.js +5 -0
- package/common/typed-diff.js.map +1 -0
- package/config/config.d.ts +0 -3
- package/config/config.d.ts.map +1 -1
- package/config/cross-package-validation.js +18 -0
- package/config/cross-package-validation.js.map +1 -0
- package/config/dependency-existence-validation.js +20 -0
- package/config/dependency-existence-validation.js.map +1 -0
- package/config/package-config.d.ts +0 -2
- package/config/package-config.d.ts.map +1 -1
- package/config/package-graph-builder.js +15 -0
- package/config/package-graph-builder.js.map +1 -0
- package/config/pre-graph-validation.js +19 -0
- package/config/pre-graph-validation.js.map +1 -0
- package/config/root-config-validation.js +126 -0
- package/config/root-config-validation.js.map +1 -0
- package/config/settings-validation.js +29 -0
- package/config/settings-validation.js.map +1 -0
- package/config/validation.d.ts +2 -2
- package/config/validation.d.ts.map +1 -1
- package/config/validation.js +9 -231
- package/config/validation.js.map +1 -1
- package/dead-code-eliminator/class-purity.js +33 -0
- package/dead-code-eliminator/class-purity.js.map +1 -0
- package/dead-code-eliminator/code-file-analyzer.js +56 -0
- package/dead-code-eliminator/code-file-analyzer.js.map +1 -0
- package/dead-code-eliminator/cross-bundle/bundle-index.js +31 -0
- package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -0
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +4 -111
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/import-export-walker.js +69 -0
- package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -0
- package/dead-code-eliminator/cross-bundle/seed-store.js +19 -0
- package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -0
- package/dead-code-eliminator/eliminator.js +3 -83
- package/dead-code-eliminator/eliminator.js.map +1 -1
- package/dead-code-eliminator/expression-unwrapping.js +17 -0
- package/dead-code-eliminator/expression-unwrapping.js.map +1 -0
- package/dead-code-eliminator/imported-expression-origin.js +95 -0
- package/dead-code-eliminator/imported-expression-origin.js.map +1 -0
- package/dead-code-eliminator/load-bundle.js +1 -1
- package/dead-code-eliminator/load-bundle.js.map +1 -1
- package/dead-code-eliminator/pure-expression.js +116 -0
- package/dead-code-eliminator/pure-expression.js.map +1 -0
- package/dead-code-eliminator/reachability/bfs-closure.js +40 -0
- package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -0
- package/dead-code-eliminator/reachability/binding-id.js +33 -0
- package/dead-code-eliminator/reachability/binding-id.js.map +1 -0
- package/dead-code-eliminator/reachability/identifier-target-collector.js +36 -0
- package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -0
- package/dead-code-eliminator/reachability/local-seed-gathering.js +24 -0
- package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -0
- package/dead-code-eliminator/reachability/reachability.js +19 -130
- package/dead-code-eliminator/reachability/reachability.js.map +1 -1
- package/dead-code-eliminator/side-effect-classifier.js +2 -394
- package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
- package/dead-code-eliminator/source-map-recomposition.js +27 -0
- package/dead-code-eliminator/source-map-recomposition.js.map +1 -0
- package/dead-code-eliminator/statement-classifiers.js +67 -0
- package/dead-code-eliminator/statement-classifiers.js.map +1 -0
- package/dead-code-eliminator/syntax-kind-sets.js +67 -0
- package/dead-code-eliminator/syntax-kind-sets.js.map +1 -0
- package/dead-code-eliminator/transform/declaration-removal.js +34 -0
- package/dead-code-eliminator/transform/declaration-removal.js.map +1 -0
- package/dead-code-eliminator/transform/declaration-remover.js +2 -72
- package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
- package/dead-code-eliminator/transform/named-declaration-kinds.js +13 -0
- package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -0
- package/dead-code-eliminator/transform/survivor-capture.js +33 -0
- package/dead-code-eliminator/transform/survivor-capture.js.map +1 -0
- package/dependency-scanner/dependency-graph.js +46 -28
- package/dependency-scanner/dependency-graph.js.map +1 -1
- package/dependency-scanner/file-host-predicates.js +10 -0
- package/dependency-scanner/file-host-predicates.js.map +1 -0
- package/dependency-scanner/host-method-binding.js +19 -0
- package/dependency-scanner/host-method-binding.js.map +1 -0
- package/dependency-scanner/node-modules-manifest-synthesizer.js +55 -0
- package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -0
- package/dependency-scanner/package-owned-asset-file-path.js +21 -0
- package/dependency-scanner/package-owned-asset-file-path.js.map +1 -0
- package/dependency-scanner/scanner.d.ts +1 -1
- package/dependency-scanner/scanner.d.ts.map +1 -1
- package/dependency-scanner/scanner.js +34 -39
- package/dependency-scanner/scanner.js.map +1 -1
- package/dependency-scanner/source-file-references.d.ts +3 -0
- package/dependency-scanner/source-file-references.d.ts.map +1 -0
- package/dependency-scanner/source-file-references.js +106 -7
- package/dependency-scanner/source-file-references.js.map +1 -1
- package/dependency-scanner/typescript-compiler-options.d.ts +3 -0
- package/dependency-scanner/typescript-compiler-options.d.ts.map +1 -0
- package/dependency-scanner/typescript-compiler-options.js +22 -0
- package/dependency-scanner/typescript-compiler-options.js.map +1 -0
- package/dependency-scanner/typescript-file-host.d.ts.map +1 -1
- package/dependency-scanner/typescript-file-host.js +15 -81
- package/dependency-scanner/typescript-file-host.js.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.d.ts +3 -3
- package/dependency-scanner/typescript-project-analyzer.d.ts.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.js +6 -26
- package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
- package/dependency-scanner/virtual-package-json-host.js +45 -0
- package/dependency-scanner/virtual-package-json-host.js.map +1 -0
- package/directed-graph/graph.js +19 -8
- package/directed-graph/graph.js.map +1 -1
- package/file-manager/file-description.d.ts.map +1 -1
- package/file-manager/file-description.js +4 -0
- package/file-manager/file-description.js.map +1 -0
- package/file-manager/file-manager.js +30 -1
- package/file-manager/file-manager.js.map +1 -1
- package/file-manager/permissions.js +5 -4
- package/file-manager/permissions.js.map +1 -1
- package/linker/linked-bundle.d.ts.map +1 -1
- package/linker/linked-bundle.js +6 -0
- package/linker/linked-bundle.js.map +1 -0
- package/linker/linker.d.ts +1 -1
- package/linker/linker.d.ts.map +1 -1
- package/linker/linker.js +2 -1
- package/linker/linker.js.map +1 -1
- package/linker/replacement-lookup.js +41 -0
- package/linker/replacement-lookup.js.map +1 -0
- package/linker/resource-graph.js +2 -1
- package/linker/resource-graph.js.map +1 -1
- package/linker/substitute-bundles.js +4 -42
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +2 -1
- package/linker/substituted-resource-graph.js.map +1 -1
- package/pack-emitter/pack-emitter.d.ts +8 -0
- package/pack-emitter/pack-emitter.d.ts.map +1 -0
- package/pack-emitter/pack-emitter.js +28 -0
- package/pack-emitter/pack-emitter.js.map +1 -0
- package/package-surface/bin-field.js +9 -0
- package/package-surface/bin-field.js.map +1 -0
- package/package-surface/explicit-bin.js +25 -0
- package/package-surface/explicit-bin.js.map +1 -0
- package/package-surface/explicit-exports.js +12 -0
- package/package-surface/explicit-exports.js.map +1 -0
- package/package-surface/explicit-specifier-build.js +28 -0
- package/package-surface/explicit-specifier-build.js.map +1 -0
- package/package-surface/explicit-specifier-resolve.js +17 -0
- package/package-surface/explicit-specifier-resolve.js.map +1 -0
- package/package-surface/export-map.js +10 -0
- package/package-surface/export-map.js.map +1 -0
- package/package-surface/implicit-bin.js +23 -0
- package/package-surface/implicit-bin.js.map +1 -0
- package/package-surface/implicit-exports.js +11 -0
- package/package-surface/implicit-exports.js.map +1 -0
- package/package-surface/implicit-root-exports.js +14 -0
- package/package-surface/implicit-root-exports.js.map +1 -0
- package/package-surface/implicit-specifier-build.js +26 -0
- package/package-surface/implicit-specifier-build.js.map +1 -0
- package/package-surface/implicit-specifier-resolve.js +17 -0
- package/package-surface/implicit-specifier-resolve.js.map +1 -0
- package/package-surface/package-json-export.js +10 -0
- package/package-surface/package-json-export.js.map +1 -0
- package/package-surface/package-shape.js +10 -0
- package/package-surface/package-shape.js.map +1 -0
- package/package-surface/public-module-usage.js +1 -1
- package/package-surface/public-module-usage.js.map +1 -1
- package/package-surface/public-specifiers.js +17 -0
- package/package-surface/public-specifiers.js.map +1 -0
- package/package-surface/root-registry.js +35 -0
- package/package-surface/root-registry.js.map +1 -0
- package/package-surface/specifier-syntax.js +24 -0
- package/package-surface/specifier-syntax.js.map +1 -0
- package/package-surface/substitution-exports.js +67 -0
- package/package-surface/substitution-exports.js.map +1 -0
- package/package.json +23 -10
- package/packages/package-processor.composition.js +54 -25
- package/packages/package-processor.composition.js.map +1 -1
- package/packages/packtory/packtory.entry-point.d.ts +24 -14
- package/packages/packtory/packtory.entry-point.d.ts.map +1 -1
- package/packages/packtory/packtory.entry-point.js +7 -3
- package/packages/packtory/packtory.entry-point.js.map +1 -1
- package/packtory/map-config.d.ts +3 -2
- package/packtory/map-config.d.ts.map +1 -1
- package/packtory/map-config.js +2 -1
- package/packtory/map-config.js.map +1 -1
- package/packtory/options/bundle-dependency-resolution.js +20 -0
- package/packtory/options/bundle-dependency-resolution.js.map +1 -0
- package/packtory/options/dead-code-elimination-resolution.js +11 -0
- package/packtory/options/dead-code-elimination-resolution.js.map +1 -0
- package/packtory/options/prepare-package-options.d.ts +18 -0
- package/packtory/options/prepare-package-options.d.ts.map +1 -0
- package/packtory/options/prepare-package-options.js +46 -0
- package/packtory/options/prepare-package-options.js.map +1 -0
- package/packtory/options/required-value-helpers.js +18 -0
- package/packtory/options/required-value-helpers.js.map +1 -0
- package/packtory/options/setting-resolvers.d.ts +6 -0
- package/packtory/options/setting-resolvers.d.ts.map +1 -0
- package/packtory/options/setting-resolvers.js +42 -0
- package/packtory/options/setting-resolvers.js.map +1 -0
- package/packtory/options/surface-resolution.js +16 -0
- package/packtory/options/surface-resolution.js.map +1 -0
- package/packtory/options/version-trigger.js +31 -0
- package/packtory/options/version-trigger.js.map +1 -0
- package/packtory/package-processor-build.js +2 -1
- package/packtory/package-processor-build.js.map +1 -1
- package/packtory/package-processor-publish.d.ts +5 -0
- package/packtory/package-processor-publish.d.ts.map +1 -1
- package/packtory/package-processor-publish.js +25 -40
- package/packtory/package-processor-publish.js.map +1 -1
- package/packtory/packtory-pack.js +221 -0
- package/packtory/packtory-pack.js.map +1 -0
- package/packtory/packtory-publish.js +3 -51
- package/packtory/packtory-publish.js.map +1 -1
- package/packtory/packtory-release-analysis.js +69 -0
- package/packtory/packtory-release-analysis.js.map +1 -0
- package/packtory/packtory-release-diff.js +48 -0
- package/packtory/packtory-release-diff.js.map +1 -0
- package/packtory/packtory-resolve.js +3 -71
- package/packtory/packtory-resolve.js.map +1 -1
- package/packtory/packtory-results.d.ts +73 -1
- package/packtory/packtory-results.d.ts.map +1 -1
- package/packtory/packtory-results.js +15 -0
- package/packtory/packtory-results.js.map +1 -1
- package/packtory/packtory.d.ts +15 -1
- package/packtory/packtory.d.ts.map +1 -1
- package/packtory/packtory.js +58 -5
- package/packtory/packtory.js.map +1 -1
- package/packtory/publish-failure-mapping.js +7 -0
- package/packtory/publish-failure-mapping.js.map +1 -0
- package/packtory/release-analysis.js +147 -0
- package/packtory/release-analysis.js.map +1 -0
- package/packtory/release-diff-failure-mapping.js +7 -0
- package/packtory/release-diff-failure-mapping.js.map +1 -0
- package/packtory/report-attachment.js +12 -1
- package/packtory/report-attachment.js.map +1 -1
- package/packtory/stages/package-analysis-stage.js +24 -0
- package/packtory/stages/package-analysis-stage.js.map +1 -0
- package/packtory/stages/package-resolution-stage.js +44 -0
- package/packtory/stages/package-resolution-stage.js.map +1 -0
- package/packtory/stages/publish-stage.js +44 -0
- package/packtory/stages/publish-stage.js.map +1 -0
- package/packtory/stages/release-diff-stage.js +84 -0
- package/packtory/stages/release-diff-stage.js.map +1 -0
- package/published-package/published-package.d.ts +39 -0
- package/published-package/published-package.d.ts.map +1 -0
- package/published-package/published-package.js +11 -0
- package/published-package/published-package.js.map +1 -0
- package/readme.md +27 -12
- package/report/aggregator/artifact-entry-merger.js.map +1 -0
- package/report/aggregator/package-report-materialization.js +63 -0
- package/report/aggregator/package-report-materialization.js.map +1 -0
- package/report/aggregator/report-aggregator.js +36 -0
- package/report/aggregator/report-aggregator.js.map +1 -0
- package/report/{report-aggregator.js → aggregator/report-event-handlers.js} +8 -95
- package/report/aggregator/report-event-handlers.js.map +1 -0
- package/report/{report-aggregator.d.ts → aggregator/report-types.d.ts} +2 -2
- package/report/aggregator/report-types.d.ts.map +1 -0
- package/report/aggregator/report-types.js +4 -0
- package/report/aggregator/report-types.js.map +1 -0
- package/report/config-redactor.js.map +1 -1
- package/report/inspectors/inspect-artifact-sizes.js +34 -0
- package/report/inspectors/inspect-artifact-sizes.js.map +1 -0
- package/report/inspectors/inspect-linker-rewrites.js +15 -0
- package/report/inspectors/inspect-linker-rewrites.js.map +1 -0
- package/report/inspectors/inspect-package-json-provenance.js +16 -0
- package/report/inspectors/inspect-package-json-provenance.js.map +1 -0
- package/report/inspectors/inspect-scan-results.js +10 -0
- package/report/inspectors/inspect-scan-results.js.map +1 -0
- package/report/preview/preview-document-diff.d.ts +13 -0
- package/report/preview/preview-document-diff.d.ts.map +1 -0
- package/report/preview/preview-document-diff.js +29 -0
- package/report/preview/preview-document-diff.js.map +1 -0
- package/report/release-diff/file-hunks.js +10 -0
- package/report/release-diff/file-hunks.js.map +1 -0
- package/report/release-diff/file-set-diff.d.ts +49 -0
- package/report/release-diff/file-set-diff.d.ts.map +1 -0
- package/report/release-diff/file-set-diff.js +71 -0
- package/report/release-diff/file-set-diff.js.map +1 -0
- package/report/release-diff/release-version-transition.js +17 -0
- package/report/release-diff/release-version-transition.js.map +1 -0
- package/resource-resolver/bundle-resource-lookup.js +24 -0
- package/resource-resolver/bundle-resource-lookup.js.map +1 -0
- package/resource-resolver/content.js +8 -4
- package/resource-resolver/content.js.map +1 -1
- package/resource-resolver/dependency-resolution-walker.js +25 -0
- package/resource-resolver/dependency-resolution-walker.js.map +1 -0
- package/resource-resolver/resolved-bundle.d.ts +1 -0
- package/resource-resolver/resolved-bundle.d.ts.map +1 -1
- package/resource-resolver/resolved-bundle.js +4 -0
- package/resource-resolver/resolved-bundle.js.map +1 -0
- package/resource-resolver/resource-resolve-options.js.map +1 -1
- package/resource-resolver/resource-resolver.d.ts.map +1 -1
- package/resource-resolver/resource-resolver.js +22 -57
- package/resource-resolver/resource-resolver.js.map +1 -1
- package/sbom/sbom-canonicalizer.js +46 -0
- package/sbom/sbom-canonicalizer.js.map +1 -0
- package/sbom/sbom-file.d.ts +2 -2
- package/sbom/sbom-file.d.ts.map +1 -1
- package/sbom/sbom-file.js +2 -5
- package/sbom/sbom-file.js.map +1 -1
- package/sbom/tool-version.js +10 -8
- package/sbom/tool-version.js.map +1 -1
- package/tar/extract-tar.js +11 -8
- package/tar/extract-tar.js.map +1 -1
- package/tar/tarball-builder.d.ts +4 -0
- package/tar/tarball-builder.d.ts.map +1 -1
- package/tar/tarball-builder.js +24 -11
- package/tar/tarball-builder.js.map +1 -1
- package/vendor-materializer/vendor-entry.d.ts +1 -0
- package/vendor-materializer/vendor-entry.d.ts.map +1 -0
- package/vendor-materializer/vendor-entry.js +8 -0
- package/vendor-materializer/vendor-entry.js.map +1 -0
- package/vendor-materializer/vendor-materializer.d.ts +5 -0
- package/vendor-materializer/vendor-materializer.d.ts.map +1 -0
- package/vendor-materializer/vendor-materializer.js +232 -0
- package/vendor-materializer/vendor-materializer.js.map +1 -0
- package/version-manager/dependencies/bundle-dependency-grouping.js +23 -0
- package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -0
- package/version-manager/dependencies/dependency-groups.js +12 -0
- package/version-manager/dependencies/dependency-groups.js.map +1 -0
- package/version-manager/{versioned-bundle-dependencies.js → dependencies/external-dependency-classification.js} +4 -42
- package/version-manager/dependencies/external-dependency-classification.js.map +1 -0
- package/version-manager/dependencies/versioned-bundle-dependencies.js +9 -0
- package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -0
- package/version-manager/imports/hash-import-scanner.js +21 -0
- package/version-manager/imports/hash-import-scanner.js.map +1 -0
- package/version-manager/imports/imports-key-matcher.js +21 -0
- package/version-manager/imports/imports-key-matcher.js.map +1 -0
- package/version-manager/{versioned-bundle-imports.js → imports/versioned-bundle-imports.js} +3 -36
- package/version-manager/imports/versioned-bundle-imports.js.map +1 -0
- package/version-manager/manager.js +1 -1
- package/version-manager/manager.js.map +1 -1
- package/version-manager/manifest/builder.js +3 -5
- package/version-manager/manifest/builder.js.map +1 -1
- package/version-manager/manifest/serialize.js +2 -41
- package/version-manager/manifest/serialize.js.map +1 -1
- package/version-manager/optional-bundle-fields.js +9 -0
- package/version-manager/optional-bundle-fields.js.map +1 -0
- package/version-manager/representative-root.js +30 -0
- package/version-manager/representative-root.js.map +1 -0
- package/version-manager/specifier-classifier.js +14 -11
- package/version-manager/specifier-classifier.js.map +1 -1
- package/version-manager/versioned-bundle.d.ts +7 -23
- package/version-manager/versioned-bundle.d.ts.map +1 -1
- package/version-manager/versioned-bundle.js +7 -40
- package/version-manager/versioned-bundle.js.map +1 -1
- package/zip/zip-builder.d.ts +5 -0
- package/zip/zip-builder.d.ts.map +1 -0
- package/zip/zip-builder.js +80 -0
- package/zip/zip-builder.js.map +1 -0
- package/bundle-emitter/publish-settings-bridge.js +0 -133
- package/bundle-emitter/publish-settings-bridge.js.map +0 -1
- package/bundle-emitter/registry-client.d.ts +0 -9
- package/bundle-emitter/registry-client.d.ts.map +0 -1
- package/bundle-emitter/registry-client.js +0 -265
- package/bundle-emitter/registry-client.js.map +0 -1
- package/package-surface/modules.js +0 -322
- package/package-surface/modules.js.map +0 -1
- package/packtory/prepare-package-options.d.ts +0 -14
- package/packtory/prepare-package-options.d.ts.map +0 -1
- package/packtory/prepare-package-options.js +0 -128
- package/packtory/prepare-package-options.js.map +0 -1
- package/report/artifact-entry-merger.js.map +0 -1
- package/report/inspectors.js +0 -74
- package/report/inspectors.js.map +0 -1
- package/report/report-aggregator.d.ts.map +0 -1
- package/report/report-aggregator.js.map +0 -1
- package/version-manager/manifest/sort-values.js.map +0 -1
- package/version-manager/versioned-bundle-dependencies.js.map +0 -1
- package/version-manager/versioned-bundle-imports.d.ts +0 -4
- package/version-manager/versioned-bundle-imports.d.ts.map +0 -1
- package/version-manager/versioned-bundle-imports.js.map +0 -1
- /package/{version-manager/manifest → common}/sort-values.js +0 -0
- /package/report/{artifact-entry-merger.js → aggregator/artifact-entry-merger.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { FileDescription } from '../../file-manager/file-description.ts';
|
|
2
|
+
import type { PreviewDiffHunk } from '../preview/preview-document-diff.ts';
|
|
3
|
+
export type AddedFile = {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly sizeBytes: number;
|
|
6
|
+
readonly isExecutable: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type RemovedFile = {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly sizeBytes: number;
|
|
11
|
+
readonly isExecutable: boolean;
|
|
12
|
+
};
|
|
13
|
+
type UnchangedFile = {
|
|
14
|
+
readonly path: string;
|
|
15
|
+
readonly sizeBytes: number;
|
|
16
|
+
readonly isExecutable: boolean;
|
|
17
|
+
};
|
|
18
|
+
type ModifiedFileContentChange = {
|
|
19
|
+
readonly kind: 'binary';
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'mode-only';
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: 'text';
|
|
24
|
+
readonly hunks: readonly PreviewDiffHunk[];
|
|
25
|
+
};
|
|
26
|
+
export type ModifiedFile = {
|
|
27
|
+
readonly path: string;
|
|
28
|
+
readonly oldSizeBytes: number;
|
|
29
|
+
readonly newSizeBytes: number;
|
|
30
|
+
readonly oldIsExecutable: boolean;
|
|
31
|
+
readonly newIsExecutable: boolean;
|
|
32
|
+
readonly contentChange: ModifiedFileContentChange;
|
|
33
|
+
};
|
|
34
|
+
export type FileSetDiff = {
|
|
35
|
+
readonly added: readonly AddedFile[];
|
|
36
|
+
readonly removed: readonly RemovedFile[];
|
|
37
|
+
readonly modified: readonly ModifiedFile[];
|
|
38
|
+
readonly unchanged: readonly UnchangedFile[];
|
|
39
|
+
};
|
|
40
|
+
type PackageReleaseDiffState = 'changed' | 'first-publish' | 'unchanged';
|
|
41
|
+
export type PackageReleaseDiff = {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly state: PackageReleaseDiffState;
|
|
44
|
+
readonly versionTransition: string;
|
|
45
|
+
readonly previousVersionLabel: string;
|
|
46
|
+
readonly files: FileSetDiff;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=file-set-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-set-diff.d.ts","sourceRoot":"","sources":["../../../../../source/report/release-diff/file-set-diff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC;AAG1E,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC;AAED,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC;AAED,KAAK,yBAAyB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE;AAE3E,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;CACrD;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;CAChD;AAED,KAAK,uBAAuB,GAAG,SAAS,GAAG,eAAe,GAAG,WAAW;AAExE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC/B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { isTextDiffablePath } from "../../common/code-files.js";
|
|
2
|
+
import { areFileDescriptionEqual } from "../../file-manager/equal.js";
|
|
3
|
+
import { buildFileHunks } from "./file-hunks.js";
|
|
4
|
+
function sizeOf(content) {
|
|
5
|
+
return Buffer.byteLength(content);
|
|
6
|
+
}
|
|
7
|
+
function indexByPath(files) {
|
|
8
|
+
return new Map(files.map((file) => {
|
|
9
|
+
return [file.filePath, file];
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
function classifyContentChange(previous, current) {
|
|
13
|
+
if (previous.content === current.content) {
|
|
14
|
+
return { kind: 'mode-only' };
|
|
15
|
+
}
|
|
16
|
+
if (!isTextDiffablePath(current.filePath)) {
|
|
17
|
+
return { kind: 'binary' };
|
|
18
|
+
}
|
|
19
|
+
return { kind: 'text', hunks: buildFileHunks(current.filePath, previous.content, current.content) };
|
|
20
|
+
}
|
|
21
|
+
function toAdded(file) {
|
|
22
|
+
return { path: file.filePath, sizeBytes: sizeOf(file.content), isExecutable: file.isExecutable };
|
|
23
|
+
}
|
|
24
|
+
function toRemoved(file) {
|
|
25
|
+
return { path: file.filePath, sizeBytes: sizeOf(file.content), isExecutable: file.isExecutable };
|
|
26
|
+
}
|
|
27
|
+
function toUnchanged(file) {
|
|
28
|
+
return { path: file.filePath, sizeBytes: sizeOf(file.content), isExecutable: file.isExecutable };
|
|
29
|
+
}
|
|
30
|
+
function toModified(previous, current) {
|
|
31
|
+
return {
|
|
32
|
+
path: current.filePath,
|
|
33
|
+
oldSizeBytes: sizeOf(previous.content),
|
|
34
|
+
newSizeBytes: sizeOf(current.content),
|
|
35
|
+
oldIsExecutable: previous.isExecutable,
|
|
36
|
+
newIsExecutable: current.isExecutable,
|
|
37
|
+
contentChange: classifyContentChange(previous, current)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function isEqual(previous, current, path) {
|
|
41
|
+
return areFileDescriptionEqual({ ...previous, filePath: path }, { ...current, filePath: path });
|
|
42
|
+
}
|
|
43
|
+
function appendBothSidedPair(buckets, path, previous, current) {
|
|
44
|
+
if (isEqual(previous, current, path)) {
|
|
45
|
+
buckets.unchanged.push(toUnchanged(current));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
buckets.modified.push(toModified(previous, current));
|
|
49
|
+
}
|
|
50
|
+
function classifyPreviousSidePath(buckets, path, previous, current) {
|
|
51
|
+
if (current === undefined) {
|
|
52
|
+
buckets.removed.push(toRemoved(previous));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
appendBothSidedPair(buckets, path, previous, current);
|
|
56
|
+
}
|
|
57
|
+
export function buildFileSetDiff(previousFiles, newFiles) {
|
|
58
|
+
const previousIndex = indexByPath(previousFiles);
|
|
59
|
+
const newIndex = indexByPath(newFiles);
|
|
60
|
+
const buckets = { added: [], removed: [], modified: [], unchanged: [] };
|
|
61
|
+
for (const [previousPath, previous] of previousIndex) {
|
|
62
|
+
classifyPreviousSidePath(buckets, previousPath, previous, newIndex.get(previousPath));
|
|
63
|
+
}
|
|
64
|
+
for (const [currentPath, current] of newIndex) {
|
|
65
|
+
if (!previousIndex.has(currentPath)) {
|
|
66
|
+
buckets.added.push(toAdded(current));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return buckets;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=file-set-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-set-diff.js","sourceRoot":"","sources":["../../../../../source/report/release-diff/file-set-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAqDjD,SAAS,MAAM,CAAC,OAAe;IAC3B,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,WAAW,CAAC,KAAiC;IAClD,OAAO,IAAI,GAAG,CACV,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAU,CAAC;IAC1C,CAAC,CAAC,CACL,CAAC;AACN,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAyB,EAAE,OAAwB;IAC9E,IAAI,QAAQ,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;QACvC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACjC,CAAC;IACD,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAC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;IACD,KAAK,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC5C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const unpublishedLabel = '(unpublished)';
|
|
2
|
+
export function buildReleaseVersionTransition(fields) {
|
|
3
|
+
if (fields.chosenVersion === undefined) {
|
|
4
|
+
return unpublishedLabel;
|
|
5
|
+
}
|
|
6
|
+
if (fields.previousVersion === undefined) {
|
|
7
|
+
return `${unpublishedLabel} -> ${fields.chosenVersion}`;
|
|
8
|
+
}
|
|
9
|
+
return `${fields.previousVersion} -> ${fields.chosenVersion}`;
|
|
10
|
+
}
|
|
11
|
+
export function buildReleaseVersionLabel(fields) {
|
|
12
|
+
if (fields.previousVersion === undefined) {
|
|
13
|
+
return unpublishedLabel;
|
|
14
|
+
}
|
|
15
|
+
return fields.previousVersion;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=release-version-transition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-version-transition.js","sourceRoot":"","sources":["../../../../../source/report/release-diff/release-version-transition.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAOzC,MAAM,UAAU,6BAA6B,CAAC,MAA4B;IACtE,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,GAAG,gBAAgB,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,eAAe,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,MAAqD;IAC1F,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC,eAAe,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function requireFileDescriptionBySourcePath(filePath, resources) {
|
|
2
|
+
const matchingResource = resources.find((resource) => {
|
|
3
|
+
return resource.fileDescription.sourceFilePath === filePath;
|
|
4
|
+
});
|
|
5
|
+
if (matchingResource === undefined) {
|
|
6
|
+
throw new Error(`Failed to resolve resource for root ${filePath}`);
|
|
7
|
+
}
|
|
8
|
+
return matchingResource.fileDescription;
|
|
9
|
+
}
|
|
10
|
+
function resolveDeclarationFileResource(declarationFilePath, contents) {
|
|
11
|
+
return contents.find((resource) => {
|
|
12
|
+
return resource.fileDescription.sourceFilePath === declarationFilePath;
|
|
13
|
+
})?.fileDescription;
|
|
14
|
+
}
|
|
15
|
+
export function buildResolvedRoots(normalized, contents) {
|
|
16
|
+
const resolvedRoots = {};
|
|
17
|
+
for (const [rootId, root] of Object.entries(normalized.roots)) {
|
|
18
|
+
const jsResource = requireFileDescriptionBySourcePath(root.js, contents);
|
|
19
|
+
const declarationFile = resolveDeclarationFileResource(root.declarationFile, contents);
|
|
20
|
+
resolvedRoots[rootId] = { js: jsResource, declarationFile };
|
|
21
|
+
}
|
|
22
|
+
return resolvedRoots;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=bundle-resource-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-resource-lookup.js","sourceRoot":"","sources":["../../../../source/resource-resolver/bundle-resource-lookup.ts"],"names":[],"mappings":"AAIA,SAAS,kCAAkC,CACvC,QAAgB,EAChB,SAAoC;IAEpC,MAAM,gBAAgB,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QACjD,OAAO,QAAQ,CAAC,eAAe,CAAC,cAAc,KAAK,QAAQ,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,gBAAgB,CAAC,eAAe,CAAC;AAC5C,CAAC;AAED,SAAS,8BAA8B,CACnC,mBAAuC,EACvC,QAAmC;IAEnC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9B,OAAO,QAAQ,CAAC,eAAe,CAAC,cAAc,KAAK,mBAAmB,CAAC;IAC3E,CAAC,CAAC,EAAE,eAAe,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAC9B,UAAmC,EACnC,QAAmC;IAEnC,MAAM,aAAa,GAGf,EAAE,CAAC;IACP,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,kCAAkC,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACzE,MAAM,eAAe,GAAG,8BAA8B,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;QACvF,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;IAChE,CAAC;IAED,OAAO,aAAa,CAAC;AACzB,CAAC"}
|
|
@@ -19,14 +19,18 @@ function rejectCodeFile(targetFilePath) {
|
|
|
19
19
|
}
|
|
20
20
|
export function combineAllBundleFiles(sourcesFolder, localDependencies, additionalFiles) {
|
|
21
21
|
const resolvedLocalFiles = localDependencies.map((localFile) => {
|
|
22
|
-
const targetFilePath =
|
|
23
|
-
|
|
22
|
+
const targetFilePath = localFile.isGeneratedManifest
|
|
23
|
+
? 'package.json'
|
|
24
|
+
: path.relative(sourcesFolder, localFile.filePath);
|
|
25
|
+
const resolvedBundleFile = {
|
|
24
26
|
sourceFilePath: localFile.filePath,
|
|
25
27
|
targetFilePath,
|
|
26
28
|
directDependencies: localFile.directDependencies,
|
|
27
|
-
project: localFile.project,
|
|
28
|
-
isExplicitlyIncluded: false
|
|
29
|
+
...(localFile.project === undefined ? {} : { project: localFile.project }),
|
|
30
|
+
isExplicitlyIncluded: false,
|
|
31
|
+
...(localFile.isGeneratedManifest ? { isGeneratedManifest: true } : {})
|
|
29
32
|
};
|
|
33
|
+
return resolvedBundleFile;
|
|
30
34
|
});
|
|
31
35
|
const additionalContents = additionalFiles.map((additionalFile) => {
|
|
32
36
|
if (typeof additionalFile === 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../../source/resource-resolver/content.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,SAAS,+BAA+B,CAAC,aAAqB,EAAE,QAAgB;IAC5E,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAS,cAAc,CAAC,cAAsB;IAC1C,IAAI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACX;YACI,0DAA0D,cAAc,IAAI;YAC5E,sEAAsE;YACtE,+DAA+D;YAC/D,iEAAiE;YACjE,qCAAqC;SACxC,CAAC,IAAI,CAAC,GAAG,CAAC,CACd,CAAC;IACN,CAAC;AACL,CAAC;
|
|
1
|
+
{"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KAAK;YAC3B,GAAG,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,CAAC;QACF,OAAO,kBAAkB,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAsB,EAAE;QAClF,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YACrC,cAAc,CAAC,cAAc,CAAC,CAAC;YAC/B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;YAChE,MAAM,cAAc,GAAG,cAAc,CAAC;YACtC,OAAO;gBACH,cAAc;gBACd,cAAc;gBACd,kBAAkB,EAAE,IAAI,GAAG,EAAE;gBAC7B,oBAAoB,EAAE,IAAI;aAC7B,CAAC;QACN,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QACD,cAAc,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;QAE9C,OAAO;YACH,cAAc,EAAE,+BAA+B,CAAC,aAAa,EAAE,cAAc,CAAC,cAAc,CAAC;YAC7F,cAAc,EAAE,cAAc,CAAC,cAAc;YAC7C,kBAAkB,EAAE,IAAI,GAAG,EAAE;YAC7B,oBAAoB,EAAE,IAAI;SAC7B,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mergeDependencyFiles } from "../dependency-scanner/dependency-graph.js";
|
|
2
|
+
import { resolveRootsAndSurface } from "./resource-resolve-options.js";
|
|
3
|
+
export async function resolveDependenciesForAllRoots(dependencyScanner, options) {
|
|
4
|
+
const { roots } = resolveRootsAndSurface(options);
|
|
5
|
+
const { sourcesFolder, includeSourceMapFiles, mainPackageJson } = options;
|
|
6
|
+
let dependencyFiles = { externalDependencies: new Map(), localFiles: [] };
|
|
7
|
+
for (const root of Object.values(roots)) {
|
|
8
|
+
const jsDependencyGraph = await dependencyScanner.scan(root.js, sourcesFolder, {
|
|
9
|
+
includeSourceMapFiles,
|
|
10
|
+
resolveDeclarationFiles: false,
|
|
11
|
+
mainPackageJson
|
|
12
|
+
});
|
|
13
|
+
dependencyFiles = mergeDependencyFiles(dependencyFiles, jsDependencyGraph.flatten(root.js));
|
|
14
|
+
if (root.declarationFile !== undefined) {
|
|
15
|
+
const declarationDependencyGraph = await dependencyScanner.scan(root.declarationFile, sourcesFolder, {
|
|
16
|
+
includeSourceMapFiles,
|
|
17
|
+
resolveDeclarationFiles: true,
|
|
18
|
+
mainPackageJson
|
|
19
|
+
});
|
|
20
|
+
dependencyFiles = mergeDependencyFiles(dependencyFiles, declarationDependencyGraph.flatten(root.declarationFile));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return dependencyFiles;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=dependency-resolution-walker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-resolution-walker.js","sourceRoot":"","sources":["../../../../source/resource-resolver/dependency-resolution-walker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,2CAA2C,CAAC;AAEvG,OAAO,EAAE,sBAAsB,EAA+B,MAAM,+BAA+B,CAAC;AAEpG,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAChD,iBAAoC,EACpC,OAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAC1E,IAAI,eAAe,GAAoB,EAAE,oBAAoB,EAAE,IAAI,GAAG,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;IAE3F,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,EAAE;YAC3E,qBAAqB;YACrB,uBAAuB,EAAE,KAAK;YAC9B,eAAe;SAClB,CAAC,CAAC;QACH,eAAe,GAAG,oBAAoB,CAAC,eAAe,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE5F,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,0BAA0B,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,aAAa,EAAE;gBACjG,qBAAqB;gBACrB,uBAAuB,EAAE,IAAI;gBAC7B,eAAe;aAClB,CAAC,CAAC;YACH,eAAe,GAAG,oBAAoB,CAClC,eAAe,EACf,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAC3D,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -6,6 +6,7 @@ export type BundleResource = {
|
|
|
6
6
|
readonly fileDescription: TransferableFileDescription;
|
|
7
7
|
readonly directDependencies: ReadonlySet<string>;
|
|
8
8
|
readonly isExplicitlyIncluded: boolean;
|
|
9
|
+
readonly isGeneratedManifest?: true | undefined;
|
|
9
10
|
};
|
|
10
11
|
export type RootFileDescription = {
|
|
11
12
|
js: TransferableFileDescription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-bundle.d.ts","sourceRoot":"","sources":["../../../../source/resource-resolver/resolved-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD;AAC1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B;AAEnE,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;IACtD,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"resolved-bundle.d.ts","sourceRoot":"","sources":["../../../../source/resource-resolver/resolved-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD;AAC1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B;AAEnE,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;IACtD,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACnD;AAMD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,2BAA2B,CAAC;IAChC,eAAe,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;CAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolved-bundle.js","sourceRoot":"","sources":["../../../../source/resource-resolver/resolved-bundle.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,sBAAsB,CAClC,IAAyB;IAEzB,OAAO,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-resolve-options.js","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolve-options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"resource-resolve-options.js","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolve-options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAoB5F,MAAM,UAAU,sBAAsB,CAAC,OAA+B;IAClE,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC;IACrC,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,IAAI,iCAAiC,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC;IACrC,OAAO;QACH,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,sBAAsB,CAAC,WAAW,CAAC;KAClE,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-resolver.d.ts","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC;
|
|
1
|
+
{"version":3,"file":"resource-resolver.d.ts","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC;AAIlE,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,sBAAsB;AAC3E,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,+BAA+B"}
|
|
@@ -1,72 +1,37 @@
|
|
|
1
|
-
import { mergeDependencyFiles } from "../dependency-scanner/dependency-graph.js";
|
|
2
|
-
import { resolveRootsAndSurface } from "./resource-resolve-options.js";
|
|
3
1
|
import { combineAllBundleFiles } from "./content.js";
|
|
2
|
+
import { buildResolvedRoots } from "./bundle-resource-lookup.js";
|
|
3
|
+
import { resolveDependenciesForAllRoots } from "./dependency-resolution-walker.js";
|
|
4
|
+
import { resolveRootsAndSurface } from "./resource-resolve-options.js";
|
|
5
|
+
const packageJsonIndentationSpaces = 4;
|
|
6
|
+
function serializeVirtualManifest(mainPackageJson) {
|
|
7
|
+
return `${JSON.stringify(mainPackageJson, null, packageJsonIndentationSpaces)}\n`;
|
|
8
|
+
}
|
|
9
|
+
async function resolveFileDescription(fileManager, bundleFile, mainPackageJson) {
|
|
10
|
+
if (bundleFile.isGeneratedManifest) {
|
|
11
|
+
return {
|
|
12
|
+
content: serializeVirtualManifest(mainPackageJson),
|
|
13
|
+
isExecutable: false,
|
|
14
|
+
sourceFilePath: bundleFile.sourceFilePath,
|
|
15
|
+
targetFilePath: bundleFile.targetFilePath
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return await fileManager.getTransferableFileDescriptionFromPath(bundleFile.sourceFilePath, bundleFile.targetFilePath);
|
|
19
|
+
}
|
|
4
20
|
export function createResourceResolver(dependencies) {
|
|
5
21
|
const { dependencyScanner, fileManager } = dependencies;
|
|
6
|
-
async function resolveDependenciesForAllRoots(options) {
|
|
7
|
-
const { roots } = resolveRootsAndSurface(options);
|
|
8
|
-
const { sourcesFolder, includeSourceMapFiles, mainPackageJson } = options;
|
|
9
|
-
let dependencyFiles = { externalDependencies: new Map(), localFiles: [] };
|
|
10
|
-
for (const root of Object.values(roots)) {
|
|
11
|
-
const jsDependencyGraph = await dependencyScanner.scan(root.js, sourcesFolder, {
|
|
12
|
-
includeSourceMapFiles,
|
|
13
|
-
resolveDeclarationFiles: false,
|
|
14
|
-
mainPackageJson
|
|
15
|
-
});
|
|
16
|
-
dependencyFiles = mergeDependencyFiles(dependencyFiles, jsDependencyGraph.flatten(root.js));
|
|
17
|
-
if (root.declarationFile !== undefined) {
|
|
18
|
-
const declarationDependencyGraph = await dependencyScanner.scan(root.declarationFile, sourcesFolder, {
|
|
19
|
-
includeSourceMapFiles,
|
|
20
|
-
resolveDeclarationFiles: true,
|
|
21
|
-
mainPackageJson
|
|
22
|
-
});
|
|
23
|
-
dependencyFiles = mergeDependencyFiles(dependencyFiles, declarationDependencyGraph.flatten(root.declarationFile));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return dependencyFiles;
|
|
27
|
-
}
|
|
28
|
-
function findFileDescriptionBySourcePath(filePath, resources) {
|
|
29
|
-
const matchingResource = resources.find((resource) => {
|
|
30
|
-
return resource.fileDescription.sourceFilePath === filePath;
|
|
31
|
-
});
|
|
32
|
-
if (matchingResource === undefined) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
return matchingResource.fileDescription;
|
|
36
|
-
}
|
|
37
|
-
function requireFileDescriptionBySourcePath(filePath, resources) {
|
|
38
|
-
const fileDescription = findFileDescriptionBySourcePath(filePath, resources);
|
|
39
|
-
if (fileDescription === undefined) {
|
|
40
|
-
throw new Error(`Failed to resolve resource for root ${filePath}`);
|
|
41
|
-
}
|
|
42
|
-
return fileDescription;
|
|
43
|
-
}
|
|
44
|
-
function resolveDeclarationFileResource(declarationFilePath, contents) {
|
|
45
|
-
return contents.find((resource) => {
|
|
46
|
-
return resource.fileDescription.sourceFilePath === declarationFilePath;
|
|
47
|
-
})?.fileDescription;
|
|
48
|
-
}
|
|
49
|
-
function buildResolvedRoots(normalized, contents) {
|
|
50
|
-
const resolvedRoots = {};
|
|
51
|
-
for (const [rootId, root] of Object.entries(normalized.roots)) {
|
|
52
|
-
const jsResource = requireFileDescriptionBySourcePath(root.js, contents);
|
|
53
|
-
const declarationFile = resolveDeclarationFileResource(root.declarationFile, contents);
|
|
54
|
-
resolvedRoots[rootId] = { js: jsResource, declarationFile };
|
|
55
|
-
}
|
|
56
|
-
return resolvedRoots;
|
|
57
|
-
}
|
|
58
22
|
return {
|
|
59
23
|
async resolve(options) {
|
|
60
24
|
const normalized = resolveRootsAndSurface(options);
|
|
61
|
-
const resolvedDependencies = await resolveDependenciesForAllRoots(options);
|
|
25
|
+
const resolvedDependencies = await resolveDependenciesForAllRoots(dependencyScanner, options);
|
|
62
26
|
const bundleFiles = combineAllBundleFiles(options.sourcesFolder, resolvedDependencies.localFiles, options.additionalFiles);
|
|
63
27
|
const contents = await Promise.all(bundleFiles.map(async (bundleFile) => {
|
|
64
|
-
const fileDescription = await fileManager
|
|
28
|
+
const fileDescription = await resolveFileDescription(fileManager, bundleFile, options.mainPackageJson);
|
|
65
29
|
return {
|
|
66
30
|
fileDescription,
|
|
67
31
|
directDependencies: bundleFile.directDependencies,
|
|
68
32
|
project: bundleFile.project,
|
|
69
|
-
isExplicitlyIncluded: bundleFile.isExplicitlyIncluded
|
|
33
|
+
isExplicitlyIncluded: bundleFile.isExplicitlyIncluded,
|
|
34
|
+
...(bundleFile.isGeneratedManifest ? { isGeneratedManifest: true } : {})
|
|
70
35
|
};
|
|
71
36
|
}));
|
|
72
37
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-resolver.js","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource-resolver.js","sourceRoot":"","sources":["../../../../source/resource-resolver/resource-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAA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AU,EACV,OAAO,CAAC,eAAe,CAC1B,CAAC;gBAEF,OAAO;oBACH,eAAe;oBACf,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;oBACjD,OAAO,EAAE,UAAU,CAAC,OAAO;oBAC3B,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;oBACrD,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC3E,CAAC;YACN,CAAC,CAAC,CACL,CAAC;YAEF,OAAO;gBACH,QAAQ;gBACR,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,oBAAoB,EAAE,oBAAoB,CAAC,oBAAoB;gBAC/D,KAAK,EAAE,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC;aAClD,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { isArray, isPlainObject } from 'remeda';
|
|
2
|
+
import { serializeStableJson } from "../common/stable-json.js";
|
|
3
|
+
const sbomFilePath = 'sbom.cdx.json';
|
|
4
|
+
const packtoryToolName = 'packtory';
|
|
5
|
+
function pluckObjectField(value, key) {
|
|
6
|
+
if (!isPlainObject(value)) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return value[key];
|
|
10
|
+
}
|
|
11
|
+
function resolveToolComponents(parsed) {
|
|
12
|
+
const metadata = pluckObjectField(parsed, 'metadata');
|
|
13
|
+
const tools = pluckObjectField(metadata, 'tools');
|
|
14
|
+
const components = pluckObjectField(tools, 'components');
|
|
15
|
+
return isArray(components) ? components : undefined;
|
|
16
|
+
}
|
|
17
|
+
function stripPacktoryVersion(parsed) {
|
|
18
|
+
const components = resolveToolComponents(parsed);
|
|
19
|
+
if (components === undefined) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
for (const entry of components) {
|
|
23
|
+
if (isPlainObject(entry) && entry.name === packtoryToolName) {
|
|
24
|
+
delete entry.version;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function canonicalizeSbomContent(content) {
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(content);
|
|
31
|
+
stripPacktoryVersion(parsed);
|
|
32
|
+
return serializeStableJson(parsed);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return content;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function canonicalizeSbomInFileSet(files) {
|
|
39
|
+
return files.map((file) => {
|
|
40
|
+
if (file.filePath !== sbomFilePath) {
|
|
41
|
+
return file;
|
|
42
|
+
}
|
|
43
|
+
return { ...file, content: canonicalizeSbomContent(file.content) };
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=sbom-canonicalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sbom-canonicalizer.js","sourceRoot":"","sources":["../../../../source/sbom/sbom-canonicalizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAEpC,SAAS,gBAAgB,CAAC,KAAc,EAAE,GAAW;IACjD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAe;IAC1C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtD,MAA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6 +1,6 @@
|
|
|
1
1
|
import type { PublishSettings } from '../config/publish-settings.ts';
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
2
|
+
import { type FileDescription } from '../file-manager/file-description.ts';
|
|
3
|
+
import type { SbomPackage, SbomSiblingPackage } from '../published-package/published-package.ts';
|
|
4
4
|
import type { LicenseResolver } from './license-resolver.ts';
|
|
5
5
|
import type { SbomSerializer } from './sbom-serializer.ts';
|
|
6
6
|
export {};
|
package/sbom/sbom-file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sbom-file.d.ts","sourceRoot":"","sources":["../../../../source/sbom/sbom-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B;AACpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sbom-file.d.ts","sourceRoot":"","sources":["../../../../source/sbom/sbom-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B;AACpE,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,qCAAqC;AACjG,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,2CAA2C;AAEhG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB"}
|
package/sbom/sbom-file.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createFileDescription } from "../file-manager/file-description.js";
|
|
1
2
|
import { extractLicenseFromManifest } from "./extract-license.js";
|
|
2
3
|
import { buildSbom } from "./sbom-builder.js";
|
|
3
4
|
const sbomFilePath = 'sbom.cdx.json';
|
|
@@ -39,11 +40,7 @@ export function createSbomFileBuilder(dependencies) {
|
|
|
39
40
|
rootComponent: { name: bundle.packageJson.name, version: bundle.packageJson.version },
|
|
40
41
|
dependencies: sbomDependencies
|
|
41
42
|
});
|
|
42
|
-
return
|
|
43
|
-
filePath: sbomFilePath,
|
|
44
|
-
content: sbomSerializer.serialize(bom),
|
|
45
|
-
isExecutable: false
|
|
46
|
-
};
|
|
43
|
+
return createFileDescription(sbomFilePath, sbomSerializer.serialize(bom));
|
|
47
44
|
}
|
|
48
45
|
return {
|
|
49
46
|
async generate(bundle, siblings, publishSettings) {
|
package/sbom/sbom-file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sbom-file.js","sourceRoot":"","sources":["../../../../source/sbom/sbom-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sbom-file.js","sourceRoot":"","sources":["../../../../source/sbom/sbom-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,qCAAqC,CAAC;AAElG,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAgD,MAAM,mBAAmB,CAAC;AAE5F,MAAM,YAAY,GAAG,eAAe,CAAC;AAyBrC,SAAS,aAAa,CAAC,eAAgC;IACnD,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAmB;IAC9C,OAAO;QACH,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAkB,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YAC9E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAChD,CAAC,CAAC;QACF,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAkB,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YAClF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC7C,CAAC,CAAC;KACL,CAAC;A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AC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE;YACrF,YAAY,EAAE,gBAAgB;SACjC,CAAC,CAAC;QACH,OAAO,qBAAqB,CAAC,YAAY,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO;QACH,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe;YAC5C,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,CAAC;gBAClC,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,OAAO,CAAC,MAAM,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC/C,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/sbom/tool-version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPlainObject } from 'remeda';
|
|
1
|
+
import { isObjectType, isPlainObject } from 'remeda';
|
|
2
2
|
const candidatePackageNames = ['@packtory/cli', 'packtory'];
|
|
3
3
|
function buildUnresolvableMessage() {
|
|
4
4
|
const intro = 'Cannot determine packtory tool version: neither "@packtory/cli" nor "packtory" is resolvable.';
|
|
@@ -8,15 +8,17 @@ function isCandidatePackageName(value) {
|
|
|
8
8
|
return value === '@packtory/cli' || value === 'packtory';
|
|
9
9
|
}
|
|
10
10
|
function isImportResolutionError(error) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
if (!isObjectType(error) || !('code' in error)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const { code } = error;
|
|
15
|
+
return code === 'ERR_MODULE_NOT_FOUND' || code === 'ERR_PACKAGE_PATH_NOT_EXPORTED';
|
|
15
16
|
}
|
|
16
17
|
function unwrapJsonModule(importedModule) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (!isPlainObject(importedModule) || !('default' in importedModule)) {
|
|
19
|
+
return importedModule;
|
|
20
|
+
}
|
|
21
|
+
return importedModule.default;
|
|
20
22
|
}
|
|
21
23
|
function parseToolPackageJson(specifier, importedModule) {
|
|
22
24
|
const parsed = unwrapJsonModule(importedModule);
|
package/sbom/tool-version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-version.js","sourceRoot":"","sources":["../../../../source/sbom/tool-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-version.js","sourceRoot":"","sources":["../../../../source/sbom/tool-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAErD,MAAM,qBAAqB,GAAG,CAAC,eAAe,EAAE,UAAU,CAAU,CAAC;AAQrE,SAAS,wBAAwB;IAC7B,MAAM,KAAK,GAAG,+FAA+F,CAAC;IAC9G,OAAO,GAAG,KAAK,4DAA4D,CAAC;AAChF,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC1C,OAAO,KAAK,KAAK,eAAe,IAAI,KAAK,KAAK,UAAU,CAAC;AAC7D,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC3C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,OAAO,IAAI,KAAK,sBAAsB,IAAI,IAAI,KAAK,+BAA+B,CAAC;AACvF,CAAC;AAED,SAAS,gBAAgB,CAAC,cAAuB;IAC7C,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,cAAc,CAAC,EAAE,CAAC;QACnE,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,OAAO,cAAc,CAAC,OAAO,CAAC;AAClC,CAAC;AAED,SAAS,oBAAoB,CAAC,SAAiB,EAAE,cAAuB;IACpE,MAAM,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAChD,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,8BAA8B,CAAC,CAAC;IACrG,CAAC;IACD,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,+BAA+B,CAAC,CAAC;IACtG,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC7C,YAA6C;IAE7C,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC;IAE3C,OAAO,KAAK,UAAU,0BAA0B;QAC5C,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;YACvD,MAAM,SAAS,GAAG,GAAG,oBAAoB,eAAe,CAAC;YACzD,IAAI,CAAC;gBACD,OAAO,oBAAoB,CAAC,SAAS,EAAE,MAAM,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/E,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACtB,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,MAAM,KAAK,CAAC;gBAChB,CAAC;YACL,CAAC;QACL,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;AACN,CAAC"}
|
package/tar/extract-tar.js
CHANGED
|
@@ -22,18 +22,21 @@ async function waitForStreamError(stream) {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
function appendOutcome(outcomes, outcome) {
|
|
26
|
+
outcomes.add(outcome);
|
|
27
|
+
return outcomes;
|
|
28
|
+
}
|
|
29
|
+
async function raceExtractionOutcomes(stream, source, gunzip, extractStream) {
|
|
30
|
+
return await Promise.race(appendOutcome(appendOutcome(appendOutcome(appendOutcome(new Set(), collectTarEntries(stream)), waitForStreamError(source)), waitForStreamError(gunzip)), waitForStreamError(extractStream)));
|
|
31
|
+
}
|
|
32
|
+
export async function extractTarEntries(buffer, dependencies = {}) {
|
|
33
|
+
const createSource = dependencies.createSource ?? Readable.from;
|
|
26
34
|
const extractStream = extract();
|
|
27
|
-
const source =
|
|
35
|
+
const source = createSource(buffer);
|
|
28
36
|
const gunzip = createGunzip();
|
|
29
37
|
const stream = source.pipe(gunzip).pipe(extractStream);
|
|
30
38
|
try {
|
|
31
|
-
return await
|
|
32
|
-
collectTarEntries(stream),
|
|
33
|
-
waitForStreamError(source),
|
|
34
|
-
waitForStreamError(gunzip),
|
|
35
|
-
waitForStreamError(extractStream)
|
|
36
|
-
]);
|
|
39
|
+
return await raceExtractionOutcomes(stream, source, gunzip, extractStream);
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
39
42
|
throw toError(error);
|
package/tar/extract-tar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-tar.js","sourceRoot":"","sources":["../../../../source/tar/extract-tar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAmC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"extract-tar.js","sourceRoot":"","sources":["../../../../source/tar/extract-tar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAmC,MAA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,GAAG,EAAuB,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,EACxE,kBAAkB,CAAC,MAAM,CAAC,CAC7B,EACD,kBAAkB,CAAC,MAAM,CAAC,CAC7B,EACD,kBAAkB,CAAC,aAAa,CAAC,CACpC,CACJ,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACnC,MAAc,EACd,eAAgD,EAAE;IAElD,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,IAAI,QAAQ,CAAC,IAAI,CAAC;IAChE,MAAM,aAAa,GAAG,OAAO,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,CAAkC,CAAC;IAExF,IAAI,CAAC;QACD,OAAO,MAAM,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC/E,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACL,CAAC"}
|
package/tar/tarball-builder.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import zlib from 'node:zlib';
|
|
1
2
|
import type { FileDescription } from '../file-manager/file-description.ts';
|
|
3
|
+
import type { FileManager } from '../file-manager/file-manager.ts';
|
|
4
|
+
import type { VendorEntry } from '../vendor-materializer/vendor-entry.ts';
|
|
5
|
+
export {};
|
|
2
6
|
//# sourceMappingURL=tarball-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tarball-builder.d.ts","sourceRoot":"","sources":["../../../../source/tar/tarball-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tarball-builder.d.ts","sourceRoot":"","sources":["../../../../source/tar/tarball-builder.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC"}
|