packtory 0.0.15 → 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 -74
- 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/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 -319
- 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
|
@@ -1,48 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const indentationSize = 4;
|
|
3
|
-
function isArray(value) {
|
|
4
|
-
return Array.isArray(value);
|
|
5
|
-
}
|
|
6
|
-
function isRecord(value) {
|
|
7
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
|
-
}
|
|
9
|
-
function assertNoCircularStructures(value) {
|
|
10
|
-
const visitedObjects = new Set();
|
|
11
|
-
JSON.stringify(value, (_key, currentValue) => {
|
|
12
|
-
if (typeof currentValue === 'object' && currentValue !== null) {
|
|
13
|
-
if (visitedObjects.has(currentValue)) {
|
|
14
|
-
throw new Error('Circular structures are not supported');
|
|
15
|
-
}
|
|
16
|
-
visitedObjects.add(currentValue);
|
|
17
|
-
}
|
|
18
|
-
return currentValue;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
1
|
+
import { serializeStableJson } from "../../common/stable-json.js";
|
|
21
2
|
function shouldPreserveArrayOrder(path) {
|
|
22
3
|
const [topLevelKey] = path;
|
|
23
4
|
return topLevelKey === 'imports' || topLevelKey === 'exports';
|
|
24
5
|
}
|
|
25
|
-
function deepSortValue(value, path = []) {
|
|
26
|
-
if (isArray(value)) {
|
|
27
|
-
const mapped = value.map((entry, index) => {
|
|
28
|
-
return deepSortValue(entry, [...path, String(index)]);
|
|
29
|
-
});
|
|
30
|
-
return shouldPreserveArrayOrder(path) ? mapped : mapped.toSorted(compareValues);
|
|
31
|
-
}
|
|
32
|
-
if (isRecord(value)) {
|
|
33
|
-
return Object.fromEntries(Object.entries(value)
|
|
34
|
-
.map(([key, nestedValue]) => {
|
|
35
|
-
return [key, deepSortValue(nestedValue, [...path, key])];
|
|
36
|
-
})
|
|
37
|
-
.toSorted(([leftKey], [rightKey]) => {
|
|
38
|
-
return compareValues(leftKey, rightKey);
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
6
|
export function serializePackageJson(data) {
|
|
44
|
-
|
|
45
|
-
const sortedData = deepSortValue(data);
|
|
46
|
-
return JSON.stringify(sortedData, null, indentationSize);
|
|
7
|
+
return serializeStableJson(data, { shouldPreserveArrayOrder });
|
|
47
8
|
}
|
|
48
9
|
//# sourceMappingURL=serialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../../../source/version-manager/manifest/serialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../../../source/version-manager/manifest/serialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,SAAS,wBAAwB,CAAC,IAAuB;IACrD,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAC3B,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAA2B;IAC5D,OAAO,mBAAmB,CAAC,IAAI,EAAE,EAAE,wBAAwB,EAAE,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function buildOptionalVersionedBundleFields(params) {
|
|
2
|
+
const { importsField, binField, typesMainFile } = params;
|
|
3
|
+
return {
|
|
4
|
+
...(importsField === undefined ? {} : { importsField }),
|
|
5
|
+
...(binField === undefined ? {} : { binField }),
|
|
6
|
+
...(typesMainFile === undefined ? {} : { typesMainFile })
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=optional-bundle-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-bundle-fields.js","sourceRoot":"","sources":["../../../../source/version-manager/optional-bundle-fields.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,kCAAkC,CAAC,MAIlD;IACG,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAEzD,OAAO;QACH,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC;QACvD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;KAC5D,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isImplicitPackageSurface } from "../package-surface/surface.js";
|
|
2
|
+
function firstExplicitRootId(packageInterface) {
|
|
3
|
+
const firstModule = packageInterface.modules?.[0];
|
|
4
|
+
if (firstModule !== undefined) {
|
|
5
|
+
return firstModule.root;
|
|
6
|
+
}
|
|
7
|
+
const firstBin = packageInterface.bins?.[0];
|
|
8
|
+
if (firstBin !== undefined) {
|
|
9
|
+
return firstBin.root;
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
function resolveRepresentativeRootId(bundle) {
|
|
14
|
+
if (isImplicitPackageSurface(bundle.surface)) {
|
|
15
|
+
return bundle.surface.defaultModuleRoot;
|
|
16
|
+
}
|
|
17
|
+
const referencedRootId = firstExplicitRootId(bundle.surface.packageInterface);
|
|
18
|
+
if (referencedRootId === undefined) {
|
|
19
|
+
throw new Error(`Package "${bundle.name}" explicit surface declares neither modules nor bins`);
|
|
20
|
+
}
|
|
21
|
+
return referencedRootId;
|
|
22
|
+
}
|
|
23
|
+
export function resolveRepresentativeRoot(bundle) {
|
|
24
|
+
const rootId = resolveRepresentativeRootId(bundle);
|
|
25
|
+
// Invariant: buildExportsField (implicit) and buildBinField (explicit) run before this
|
|
26
|
+
// and throw when the referenced root is absent, so the lookup cannot return undefined.
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- see invariant above
|
|
28
|
+
return bundle.roots[rootId];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=representative-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"representative-root.js","sourceRoot":"","sources":["../../../../source/version-manager/representative-root.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAQzE,SAAS,mBAAmB,CAAC,gBAA8C;IACvE,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,WAAW,CAAC,IAAI,CAAC;IAC5B,CAAC;IACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAID,SAAS,2BAA2B,CAAC,MAAgC;IACjE,IAAI,wBAAwB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAC5C,CAAC;IACD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9E,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,CAAC,IAAI,sDAAsD,CAAC,CAAC;IACnG,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAgC;IACtE,MAAM,MAAM,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACnD,uFAAuF;IACvF,uFAAuF;IACvF,2FAA2F;IAC3F,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,CAAC;AACjC,CAAC"}
|
|
@@ -4,18 +4,21 @@ const portalProtocolPrefix = 'portal:';
|
|
|
4
4
|
const workspaceMalformedReason = 'workspace protocol is yarn/pnpm/bun-specific; resolved at install time by the workspace,' +
|
|
5
5
|
' not valid in a published manifest';
|
|
6
6
|
const portalMalformedReason = 'portal protocol is yarn-specific; resolved as a local symlink, not valid in a published manifest';
|
|
7
|
-
const
|
|
8
|
-
alias: { kind: 'registry' },
|
|
9
|
-
version: { kind: 'registry' },
|
|
10
|
-
range: { kind: 'registry' },
|
|
11
|
-
tag: { kind: 'registry' },
|
|
12
|
-
git: { kind: 'mutable', npaType: 'git' },
|
|
13
|
-
remote: { kind: 'mutable', npaType: 'remote' },
|
|
14
|
-
file: { kind: 'mutable', npaType: 'file' },
|
|
15
|
-
directory: { kind: 'mutable', npaType: 'directory' }
|
|
16
|
-
};
|
|
7
|
+
const registryNpaTypes = new Set(['alias', 'version', 'range', 'tag']);
|
|
17
8
|
function classifyNpaResult(result) {
|
|
18
|
-
|
|
9
|
+
if (registryNpaTypes.has(result.type)) {
|
|
10
|
+
return { kind: 'registry' };
|
|
11
|
+
}
|
|
12
|
+
if (result.type === 'git') {
|
|
13
|
+
return { kind: 'mutable', npaType: 'git' };
|
|
14
|
+
}
|
|
15
|
+
if (result.type === 'remote') {
|
|
16
|
+
return { kind: 'mutable', npaType: 'remote' };
|
|
17
|
+
}
|
|
18
|
+
if (result.type === 'file') {
|
|
19
|
+
return { kind: 'mutable', npaType: 'file' };
|
|
20
|
+
}
|
|
21
|
+
return { kind: 'mutable', npaType: 'directory' };
|
|
19
22
|
}
|
|
20
23
|
export function classifySpecifier(name, specifier) {
|
|
21
24
|
if (specifier.startsWith(workspaceProtocolPrefix)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specifier-classifier.js","sourceRoot":"","sources":["../../../../source/version-manager/specifier-classifier.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAElC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAC7C,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,MAAM,wBAAwB,GAC1B,0FAA0F;IAC1F,oCAAoC,CAAC;AACzC,MAAM,qBAAqB,GACvB,kGAAkG,CAAC;AAWvG,MAAM,
|
|
1
|
+
{"version":3,"file":"specifier-classifier.js","sourceRoot":"","sources":["../../../../source/version-manager/specifier-classifier.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAElC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAC7C,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,MAAM,wBAAwB,GAC1B,0FAA0F;IAC1F,oCAAoC,CAAC;AACzC,MAAM,qBAAqB,GACvB,kGAAkG,CAAC;AAWvG,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAEtF,SAAS,iBAAiB,CAAC,MAAkB;IACzC,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/C,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAChD,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,SAAiB;IAC7D,IAAI,SAAS,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,CAAC;QAChD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC;IACnE,CAAC;IACD,IAAI,SAAS,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChE,CAAC;IAED,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC5C,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACxD,CAAC;AACL,CAAC"}
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Except } from 'type-fest';
|
|
2
2
|
import type { AnalyzedBundle } from '../dead-code-eliminator/analyzed-bundle.ts';
|
|
3
3
|
import type { AdditionalPackageJsonAttributes, MainPackageJson } from '../config/package-json.ts';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export type
|
|
7
|
-
type
|
|
8
|
-
export type VersionedBundle = Pick<AnalyzedBundle, 'contents' | 'name' | 'roots' | 'sideEffectsField' | 'surface'> & {
|
|
9
|
-
readonly version: string;
|
|
10
|
-
readonly dependencies: Record<string, string>;
|
|
11
|
-
readonly peerDependencies: Record<string, string>;
|
|
12
|
-
readonly importsField?: ImportsField | undefined;
|
|
13
|
-
readonly exportsField: ExportsField;
|
|
14
|
-
readonly binField?: PackageJson['bin'] | undefined;
|
|
15
|
-
readonly additionalAttributes: AdditionalPackageJsonAttributes;
|
|
16
|
-
readonly mainFile: FileDescription | TransferableFileDescription;
|
|
17
|
-
readonly typesMainFile?: FileDescription | TransferableFileDescription | undefined;
|
|
18
|
-
readonly packageType: 'module';
|
|
19
|
-
};
|
|
20
|
-
export type VersionedBundleWithManifest = VersionedBundle & {
|
|
21
|
-
readonly manifestFile: FileDescription;
|
|
22
|
-
readonly packageJson: BundlePackageJson;
|
|
23
|
-
};
|
|
4
|
+
import type { PublishedPackage, PublishedPackageJson, PublishedPackageWithManifest } from '../published-package/published-package.ts';
|
|
5
|
+
type VersionedDependency = Pick<PublishedPackage, 'name' | 'version'>;
|
|
6
|
+
export type VersionedBundle = Except<PublishedPackage, 'contents'> & Pick<AnalyzedBundle, 'contents'>;
|
|
7
|
+
export type VersionedBundleWithManifest = Pick<PublishedPackageWithManifest, 'manifestFile' | 'packageJson'> & VersionedBundle;
|
|
24
8
|
export type BuildVersionedBundleOptions = {
|
|
25
9
|
readonly bundle: AnalyzedBundle;
|
|
26
10
|
readonly version: string;
|
|
27
11
|
readonly mainPackageJson: MainPackageJson;
|
|
28
|
-
readonly bundleDependencies: readonly
|
|
29
|
-
readonly bundlePeerDependencies: readonly
|
|
12
|
+
readonly bundleDependencies: readonly VersionedDependency[];
|
|
13
|
+
readonly bundlePeerDependencies: readonly VersionedDependency[];
|
|
30
14
|
readonly additionalPackageJsonAttributes: AdditionalPackageJsonAttributes;
|
|
31
15
|
readonly allowMutableSpecifiers: readonly string[];
|
|
32
16
|
readonly substitutionPublicModuleSourcePaths?: ReadonlySet<string> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioned-bundle.d.ts","sourceRoot":"","sources":["../../../../source/version-manager/versioned-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"versioned-bundle.d.ts","sourceRoot":"","sources":["../../../../source/version-manager/versioned-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C;AAChF,OAAO,KAAK,EAAE,+BAA+B,EAAE,eAAe,EAAE,MAAM,2BAA2B;AACjG,OAAO,KAAK,EACR,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC/B,MAAM,2CAA2C;AASlD,KAAK,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;AACrG,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,4BAA4B,EAAE,cAAc,GAAG,aAAa,CAAC,GACxG,eAAe;AAEnB,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC5D,QAAQ,CAAC,sBAAsB,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChE,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAC1E,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,QAAQ,CAAC,mCAAmC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAClF"}
|
|
@@ -1,49 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (firstModule !== undefined) {
|
|
8
|
-
return firstModule.root;
|
|
9
|
-
}
|
|
10
|
-
const firstBin = packageInterface.bins?.[0];
|
|
11
|
-
if (firstBin !== undefined) {
|
|
12
|
-
return firstBin.root;
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
function resolveRepresentativeRootId(bundle) {
|
|
17
|
-
if (isImplicitPackageSurface(bundle.surface)) {
|
|
18
|
-
return bundle.surface.defaultModuleRoot;
|
|
19
|
-
}
|
|
20
|
-
const referencedRootId = firstExplicitRootId(bundle.surface.packageInterface);
|
|
21
|
-
if (referencedRootId === undefined) {
|
|
22
|
-
throw new Error(`Package "${bundle.name}" explicit surface declares neither modules nor bins`);
|
|
23
|
-
}
|
|
24
|
-
return referencedRootId;
|
|
25
|
-
}
|
|
26
|
-
function resolveRepresentativeRoot(bundle, rootId) {
|
|
27
|
-
// Invariant: buildExportsField (implicit) and buildBinField (explicit) run before this
|
|
28
|
-
// and throw when the referenced root is absent, so the lookup cannot return undefined.
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- see invariant above
|
|
30
|
-
return bundle.roots[rootId];
|
|
31
|
-
}
|
|
32
|
-
function buildOptionalVersionedBundleFields(params) {
|
|
33
|
-
const { importsField, binField, typesMainFile } = params;
|
|
34
|
-
return {
|
|
35
|
-
...(importsField === undefined ? {} : { importsField }),
|
|
36
|
-
...(binField === undefined ? {} : { binField }),
|
|
37
|
-
...(typesMainFile === undefined ? {} : { typesMainFile })
|
|
38
|
-
};
|
|
39
|
-
}
|
|
1
|
+
import { buildBinField } from "../package-surface/bin-field.js";
|
|
2
|
+
import { buildExportsField } from "../package-surface/export-map.js";
|
|
3
|
+
import { buildOptionalVersionedBundleFields } from "./optional-bundle-fields.js";
|
|
4
|
+
import { resolveRepresentativeRoot } from "./representative-root.js";
|
|
5
|
+
import { distributeDependencies } from "./dependencies/versioned-bundle-dependencies.js";
|
|
6
|
+
import { buildImportsField } from "./imports/versioned-bundle-imports.js";
|
|
40
7
|
export function buildVersionedBundle(options) {
|
|
41
8
|
const { bundle, version, mainPackageJson, additionalPackageJsonAttributes } = options;
|
|
42
9
|
const distributedDependencies = distributeDependencies(options);
|
|
43
10
|
const importsField = buildImportsField(bundle, mainPackageJson);
|
|
44
11
|
const exportsField = buildExportsField(bundle, options.substitutionPublicModuleSourcePaths ?? new Set());
|
|
45
12
|
const binField = buildBinField(bundle);
|
|
46
|
-
const representativeRoot = resolveRepresentativeRoot(bundle
|
|
13
|
+
const representativeRoot = resolveRepresentativeRoot(bundle);
|
|
47
14
|
const mainFile = representativeRoot.js;
|
|
48
15
|
const typesMainFile = representativeRoot.declarationFile;
|
|
49
16
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioned-bundle.js","sourceRoot":"","sources":["../../../../source/version-manager/versioned-bundle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versioned-bundle.js","sourceRoot":"","sources":["../../../../source/version-manager/versioned-bundle.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAoB1E,MAAM,UAAU,oBAAoB,CAAC,OAAoC;IACrE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,+BAA+B,EAAE,GAAG,OAAO,CAAC;IAEtF,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,mCAAmC,IAAI,IAAI,GAAG,EAAU,CAAC,CAAC;IACjH,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,kBAAkB,CAAC,eAAe,CAAC;IAEzD,OAAO;QACH,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO;QACP,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,YAAY,EAAE,uBAAuB,CAAC,YAAY;QAClD,gBAAgB,EAAE,uBAAuB,CAAC,gBAAgB;QAC1D,YAAY;QACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ;QACR,oBAAoB,EAAE,+BAA+B;QACrD,WAAW,EAAE,eAAe,CAAC,IAAI;QACjC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,GAAG,kCAAkC,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;KACnF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FileDescription } from '../file-manager/file-description.ts';
|
|
2
|
+
import type { FileManager } from '../file-manager/file-manager.ts';
|
|
3
|
+
import type { VendorEntry } from '../vendor-materializer/vendor-entry.ts';
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=zip-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip-builder.d.ts","sourceRoot":"","sources":["../../../../source/zip/zip-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { zip as fflateZip } from 'fflate';
|
|
2
|
+
const unixOperatingSystem = 3;
|
|
3
|
+
const executableUnixMode = 0o10_0755;
|
|
4
|
+
const nonExecutableUnixMode = 0o10_0644;
|
|
5
|
+
const highBytesScale = 65_536;
|
|
6
|
+
const maxCompressionLevel = 9;
|
|
7
|
+
// 1980-01-01T12:00:00Z. Zip's DOS time format requires year >= 1980; the noon offset keeps
|
|
8
|
+
// `getFullYear()` at 1980 across all timezones. Kept as a plain literal so the module has no
|
|
9
|
+
// load-time side effects (tree-shake-friendly).
|
|
10
|
+
const staticFileModificationTimestamp = 315_576_000_000;
|
|
11
|
+
function externalAttributes(isExecutable) {
|
|
12
|
+
return (isExecutable ? executableUnixMode : nonExecutableUnixMode) * highBytesScale;
|
|
13
|
+
}
|
|
14
|
+
function asError(error) {
|
|
15
|
+
return error instanceof Error ? error : new Error(JSON.stringify(error));
|
|
16
|
+
}
|
|
17
|
+
function isUint8Array(value) {
|
|
18
|
+
return value instanceof Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
function createZipFunction(zip) {
|
|
21
|
+
const zipValue = zip ?? fflateZip;
|
|
22
|
+
if (typeof zipValue !== 'function') {
|
|
23
|
+
throw new TypeError('fflate zip export is not callable');
|
|
24
|
+
}
|
|
25
|
+
return (data, options, callback) => {
|
|
26
|
+
Reflect.apply(zipValue, undefined, [data, options, callback]);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function buildFileEntry(payload, isExecutable) {
|
|
30
|
+
return [
|
|
31
|
+
payload,
|
|
32
|
+
{
|
|
33
|
+
os: unixOperatingSystem,
|
|
34
|
+
attrs: externalAttributes(isExecutable),
|
|
35
|
+
mtime: staticFileModificationTimestamp,
|
|
36
|
+
level: maxCompressionLevel
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
async function toFileMap(fileDescriptions, vendorEntries, readFileBytes) {
|
|
41
|
+
const fileMap = {};
|
|
42
|
+
for (const fileDescription of fileDescriptions) {
|
|
43
|
+
fileMap[fileDescription.filePath] = buildFileEntry(new TextEncoder().encode(fileDescription.content), fileDescription.isExecutable);
|
|
44
|
+
}
|
|
45
|
+
for (const vendorEntry of vendorEntries) {
|
|
46
|
+
const payload = await readFileBytes(vendorEntry.sourceAbsolutePath);
|
|
47
|
+
fileMap[vendorEntry.targetRelativePath] = buildFileEntry(payload, vendorEntry.isExecutable);
|
|
48
|
+
}
|
|
49
|
+
return fileMap;
|
|
50
|
+
}
|
|
51
|
+
export function createZipBuilder(dependencies = {}) {
|
|
52
|
+
const fileManager = dependencies.fileManager ?? {
|
|
53
|
+
async readFileBytes() {
|
|
54
|
+
throw new Error('readFileBytes is required to materialize vendor entries into the zip');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const zip = createZipFunction(dependencies.zip);
|
|
58
|
+
return {
|
|
59
|
+
async build(fileDescriptions, vendorEntries = []) {
|
|
60
|
+
const fileMap = await toFileMap(fileDescriptions, vendorEntries, async (filePath) => {
|
|
61
|
+
return fileManager.readFileBytes(filePath);
|
|
62
|
+
});
|
|
63
|
+
const data = await new Promise((resolve, reject) => {
|
|
64
|
+
zip(fileMap, {}, (error, zippedData) => {
|
|
65
|
+
if (error === null || error === undefined) {
|
|
66
|
+
if (!isUint8Array(zippedData)) {
|
|
67
|
+
reject(new Error('fflate zip returned a non-binary payload'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
resolve(zippedData);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
reject(asError(error));
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return Buffer.from(data);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=zip-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip-builder.js","sourceRoot":"","sources":["../../../../source/zip/zip-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AAyB1C,MAAM,mBAAmB,GAAG,CAAC,CAAC;A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E;gBAC3D,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;oBACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;4BAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC,CAAC;4BAC9D,OAAO;wBACX,CAAC;wBACD,OAAO,CAAC,UAAU,CAAC,CAAC;wBACpB,OAAO;oBACX,CAAC;oBACD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC3B,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
export function buildPublishOptionsForPublishSettings(publishSettings) {
|
|
2
|
-
if (publishSettings.access === 'restricted') {
|
|
3
|
-
return { access: 'restricted' };
|
|
4
|
-
}
|
|
5
|
-
if (publishSettings.provenance === undefined) {
|
|
6
|
-
return { access: 'public' };
|
|
7
|
-
}
|
|
8
|
-
if (publishSettings.provenance.type === 'auto') {
|
|
9
|
-
return { access: 'public', provenance: true };
|
|
10
|
-
}
|
|
11
|
-
return { access: 'public', provenanceFile: publishSettings.provenance.path };
|
|
12
|
-
}
|
|
13
|
-
function isRecord(value) {
|
|
14
|
-
return value instanceof Object;
|
|
15
|
-
}
|
|
16
|
-
function isErrorLike(error) {
|
|
17
|
-
return isRecord(error) && typeof error.message === 'string';
|
|
18
|
-
}
|
|
19
|
-
const unsupportedProviderMarker = 'not supported for provider:';
|
|
20
|
-
function getCiName(message) {
|
|
21
|
-
const tail = message.slice(message.indexOf(unsupportedProviderMarker) + unsupportedProviderMarker.length).trim();
|
|
22
|
-
if (tail === '') {
|
|
23
|
-
return 'unknown';
|
|
24
|
-
}
|
|
25
|
-
const whitespaceIndex = tail.search(/\s/u);
|
|
26
|
-
if (whitespaceIndex === -1) {
|
|
27
|
-
return tail;
|
|
28
|
-
}
|
|
29
|
-
return tail.slice(0, whitespaceIndex);
|
|
30
|
-
}
|
|
31
|
-
function buildUnsupportedProviderMessage(ciName) {
|
|
32
|
-
return [
|
|
33
|
-
'Provenance auto mode requires GitHub Actions or GitLab CI.',
|
|
34
|
-
`Detected CI: ${ciName}.`,
|
|
35
|
-
"Use provenance: { type: 'file' } for other environments."
|
|
36
|
-
].join(' ');
|
|
37
|
-
}
|
|
38
|
-
const githubActionsIdTokenMessage = [
|
|
39
|
-
'GitHub Actions provenance needs "permissions: id-token: write" on the workflow job.',
|
|
40
|
-
'See the packtory readme for the workflow snippet.'
|
|
41
|
-
].join(' ');
|
|
42
|
-
const gitlabSigstoreIdTokenMessage = [
|
|
43
|
-
'GitLab CI provenance needs an "id_tokens" entry with audience "sigstore"',
|
|
44
|
-
'exposed as SIGSTORE_ID_TOKEN. See the packtory readme for the workflow snippet.'
|
|
45
|
-
].join(' ');
|
|
46
|
-
function buildMissingProvenanceFileMessage(filePath) {
|
|
47
|
-
return [
|
|
48
|
-
`Provenance bundle file "${filePath}" does not exist.`,
|
|
49
|
-
"Generate it with your CI's attestation tool (e.g. actions/attest-build-provenance)",
|
|
50
|
-
'before running packtory.'
|
|
51
|
-
].join(' ');
|
|
52
|
-
}
|
|
53
|
-
function buildInvalidProvenanceFileMessage(filePath) {
|
|
54
|
-
return [
|
|
55
|
-
`Provenance bundle file "${filePath}" is not a valid sigstore bundle.`,
|
|
56
|
-
'Re-generate it from the current build.'
|
|
57
|
-
].join(' ');
|
|
58
|
-
}
|
|
59
|
-
function buildProvenanceDigestMismatchMessage(filePath) {
|
|
60
|
-
return [
|
|
61
|
-
`Provenance bundle at "${filePath}" was signed against a different tarball`,
|
|
62
|
-
'than the one packtory built. Re-generate the bundle from the current source —',
|
|
63
|
-
'shipping a mismatched attestation would defeat the purpose of provenance.'
|
|
64
|
-
].join(' ');
|
|
65
|
-
}
|
|
66
|
-
function isProvenanceBundleError(message) {
|
|
67
|
-
return (message.includes('Bundle is invalid') ||
|
|
68
|
-
message.includes('Unsupported bundle format') ||
|
|
69
|
-
message.includes('Invalid bundle') ||
|
|
70
|
-
message.includes('subject does not match'));
|
|
71
|
-
}
|
|
72
|
-
function isProvenanceDigestMismatch(message) {
|
|
73
|
-
return message.includes('subject') || message.includes('digest');
|
|
74
|
-
}
|
|
75
|
-
function matchAutoModeError(error) {
|
|
76
|
-
if (!isErrorLike(error)) {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
const { message } = error;
|
|
80
|
-
if (message.includes(unsupportedProviderMarker)) {
|
|
81
|
-
return new Error(buildUnsupportedProviderMessage(getCiName(message)), { cause: error });
|
|
82
|
-
}
|
|
83
|
-
if (message.includes('"write" access to the "id-token" permission')) {
|
|
84
|
-
return new Error(githubActionsIdTokenMessage, { cause: error });
|
|
85
|
-
}
|
|
86
|
-
if (message.includes('SIGSTORE_ID_TOKEN')) {
|
|
87
|
-
return new Error(gitlabSigstoreIdTokenMessage, { cause: error });
|
|
88
|
-
}
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
function matchFileModeError(error, filePath) {
|
|
92
|
-
if (isRecord(error) && error.code === 'ENOENT') {
|
|
93
|
-
return new Error(buildMissingProvenanceFileMessage(filePath), { cause: error });
|
|
94
|
-
}
|
|
95
|
-
if (!isErrorLike(error)) {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
const { message } = error;
|
|
99
|
-
if (!isProvenanceBundleError(message)) {
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
if (isProvenanceDigestMismatch(message)) {
|
|
103
|
-
return new Error(buildProvenanceDigestMismatchMessage(filePath), { cause: error });
|
|
104
|
-
}
|
|
105
|
-
return new Error(buildInvalidProvenanceFileMessage(filePath), { cause: error });
|
|
106
|
-
}
|
|
107
|
-
function getProvenanceFilePath(publishSettings) {
|
|
108
|
-
if (publishSettings.access !== 'public') {
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
if (publishSettings.provenance?.type !== 'file') {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
return publishSettings.provenance.path;
|
|
115
|
-
}
|
|
116
|
-
function ensureError(error) {
|
|
117
|
-
return error instanceof Error ? error : new Error(String(error));
|
|
118
|
-
}
|
|
119
|
-
export function remapPublishError(error, publishSettings) {
|
|
120
|
-
const autoModeError = matchAutoModeError(error);
|
|
121
|
-
if (autoModeError !== undefined) {
|
|
122
|
-
return autoModeError;
|
|
123
|
-
}
|
|
124
|
-
const filePath = getProvenanceFilePath(publishSettings);
|
|
125
|
-
if (filePath !== undefined) {
|
|
126
|
-
const fileModeError = matchFileModeError(error, filePath);
|
|
127
|
-
if (fileModeError !== undefined) {
|
|
128
|
-
return fileModeError;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return ensureError(error);
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=publish-settings-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-settings-bridge.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/publish-settings-bridge.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,qCAAqC,CACjD,eAA0C;IAE1C,IAAI,eAAe,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IACpC,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC7C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;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C,UAAU,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAE,eAA0C;IACxF,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,MAAM,QAAQ,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACxD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,aAAa,CAAC;QACzB,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type _npmFetch from 'npm-registry-fetch';
|
|
2
|
-
import type { publish as _publish } from 'libnpmpublish';
|
|
3
|
-
import { Maybe } from 'true-myth';
|
|
4
|
-
import type { Clock } from '../common/clock.ts';
|
|
5
|
-
import type { PublishSettings } from '../config/publish-settings.ts';
|
|
6
|
-
import type { PublishAuthStrategy, RegistrySettings } from '../config/registry-settings.ts';
|
|
7
|
-
import type { BundlePackageJson } from '../version-manager/versioned-bundle.ts';
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=registry-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../../source/bundle-emitter/registry-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW;AAEjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B;AACpE,OAAO,KAAK,EAGR,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,gCAAgC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC"}
|