packtory 0.0.95 → 0.0.97
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 +28 -0
- package/artifacts/artifacts-builder.d.ts.map +1 -0
- package/artifacts/artifacts-builder.js +37 -4
- package/artifacts/artifacts-builder.js.map +1 -1
- package/artifacts/content-collection.js +59 -2
- package/artifacts/content-collection.js.map +1 -1
- package/artifacts/folder-writer.js +25 -2
- package/artifacts/folder-writer.js.map +1 -1
- package/bundle-emitter/emitter.d.ts +8 -0
- package/bundle-emitter/emitter.d.ts.map +1 -1
- package/bundle-emitter/emitter.js +137 -6
- package/bundle-emitter/emitter.js.map +1 -1
- package/bundle-emitter/extract-package-tarball.js +13 -2
- package/bundle-emitter/extract-package-tarball.js.map +1 -1
- package/bundle-emitter/fetch-published-artifacts.d.ts +2 -0
- package/bundle-emitter/fetch-published-artifacts.d.ts.map +1 -1
- package/bundle-emitter/fetch-published-artifacts.js +19 -2
- package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
- package/bundle-emitter/publication-outcome.d.ts +3 -0
- package/bundle-emitter/publication-outcome.d.ts.map +1 -1
- package/bundle-emitter/publication-outcome.js +5 -0
- package/bundle-emitter/publication-outcome.js.map +1 -1
- package/bundle-emitter/publish-error/auto-mode-error-matching.js +28 -2
- package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/error-shape-helpers.js +9 -0
- package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
- package/bundle-emitter/publish-error/file-mode-error-matching.js +33 -2
- package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/publish-error-messages.js +24 -0
- package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
- package/bundle-emitter/registry/metadata-auth-retry.js +24 -1
- package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
- package/bundle-emitter/registry/oidc-token-exchange.js +68 -3
- package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts +14 -0
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.js +210 -7
- package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
- package/bundle-emitter/registry/publish-settings-bridge.js +34 -3
- package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
- package/bundle-emitter/registry/registry-auth-config.d.ts +17 -0
- package/bundle-emitter/registry/registry-auth-config.d.ts.map +1 -0
- package/bundle-emitter/registry/registry-auth-config.js +106 -0
- package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
- package/bundle-emitter/registry/registry-client.d.ts +13 -1
- package/bundle-emitter/registry/registry-client.d.ts.map +1 -1
- package/bundle-emitter/registry/registry-client.js +74 -4
- package/bundle-emitter/registry/registry-client.js.map +1 -1
- package/bundle-emitter/registry/registry-package-path.js +3 -0
- package/bundle-emitter/registry/registry-package-path.js.map +1 -1
- package/bundle-emitter/registry/registry-response-schemas.js +50 -2
- package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.d.ts +1 -0
- package/bundle-emitter/registry/tarball-integrity.d.ts.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.js +31 -1
- package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
- package/bundle-emitter/registry/validate-tarball-host.js +26 -1
- package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
- package/bundle-emitter/release-artifact-canonicalizer.js +31 -5
- package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
- package/checks/check-runner.d.ts +18 -0
- package/checks/check-runner.d.ts.map +1 -0
- package/checks/check-runner.js +8 -0
- package/checks/check-runner.js.map +1 -1
- package/checks/rule.d.ts +42 -0
- package/checks/rule.d.ts.map +1 -0
- package/checks/rule.js +12 -2
- package/checks/rule.js.map +1 -1
- package/checks/rules/duplicate-detection.js +23 -1
- package/checks/rules/duplicate-detection.js.map +1 -1
- package/checks/rules/duplicate-messages.js +22 -0
- package/checks/rules/duplicate-messages.js.map +1 -1
- package/checks/rules/file-ownership.js +15 -0
- package/checks/rules/file-ownership.js.map +1 -1
- package/checks/rules/max-bundle-size.d.ts +13 -0
- package/checks/rules/max-bundle-size.d.ts.map +1 -0
- package/checks/rules/max-bundle-size.js +55 -1
- package/checks/rules/max-bundle-size.js.map +1 -1
- package/checks/rules/no-dev-dependency-imports.d.ts +11 -0
- package/checks/rules/no-dev-dependency-imports.d.ts.map +1 -0
- package/checks/rules/no-dev-dependency-imports.js +51 -1
- package/checks/rules/no-dev-dependency-imports.js.map +1 -1
- package/checks/rules/no-duplicated-files.d.ts +11 -0
- package/checks/rules/no-duplicated-files.d.ts.map +1 -0
- package/checks/rules/no-duplicated-files.js +53 -3
- package/checks/rules/no-duplicated-files.js.map +1 -1
- package/checks/rules/no-side-effects.d.ts +15 -0
- package/checks/rules/no-side-effects.d.ts.map +1 -0
- package/checks/rules/no-side-effects.js +50 -1
- package/checks/rules/no-side-effects.js.map +1 -1
- package/checks/rules/no-unexposed-executables.d.ts +8 -0
- package/checks/rules/no-unexposed-executables.d.ts.map +1 -0
- package/checks/rules/no-unexposed-executables.js +43 -2
- package/checks/rules/no-unexposed-executables.js.map +1 -1
- package/checks/rules/no-unused-bundle-dependencies.d.ts +8 -0
- package/checks/rules/no-unused-bundle-dependencies.d.ts.map +1 -0
- package/checks/rules/no-unused-bundle-dependencies.js +30 -2
- package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
- package/checks/rules/registry.d.ts +23 -0
- package/checks/rules/registry.d.ts.map +1 -0
- package/checks/rules/registry.js +22 -9
- package/checks/rules/registry.js.map +1 -1
- package/checks/rules/required-files.d.ts +15 -0
- package/checks/rules/required-files.d.ts.map +1 -0
- package/checks/rules/required-files.js +41 -3
- package/checks/rules/required-files.js.map +1 -1
- package/checks/rules/type-script-declaration-integrity.d.ts +9 -0
- package/checks/rules/type-script-declaration-integrity.d.ts.map +1 -0
- package/checks/rules/type-script-declaration-integrity.js +81 -3
- package/checks/rules/type-script-declaration-integrity.js.map +1 -1
- package/checks/rules/type-script-declaration-paths.js +55 -1
- package/checks/rules/type-script-declaration-paths.js.map +1 -1
- package/checks/rules/type-script-declaration-project.d.ts +29 -0
- package/checks/rules/type-script-declaration-project.d.ts.map +1 -0
- package/checks/rules/type-script-declaration-project.js +202 -3
- package/checks/rules/type-script-declaration-project.js.map +1 -1
- package/checks/rules/type-script-declaration-reachability.js +38 -2
- package/checks/rules/type-script-declaration-reachability.js.map +1 -1
- package/checks/rules/type-script-declaration-roots.js +29 -0
- package/checks/rules/type-script-declaration-roots.js.map +1 -1
- package/checks/rules/type-script-integrity.d.ts +24 -0
- package/checks/rules/type-script-integrity.d.ts.map +1 -0
- package/checks/rules/type-script-integrity.js +72 -2
- package/checks/rules/type-script-integrity.js.map +1 -1
- package/checks/rules/type-script-package-resolution.d.ts +29 -0
- package/checks/rules/type-script-package-resolution.d.ts.map +1 -0
- package/checks/rules/type-script-package-resolution.js +42 -1
- package/checks/rules/type-script-package-resolution.js.map +1 -1
- package/checks/rules/type-script-resolution-summary.js +53 -0
- package/checks/rules/type-script-resolution-summary.js.map +1 -1
- package/checks/rules/unique-target-paths.d.ts +8 -0
- package/checks/rules/unique-target-paths.d.ts.map +1 -0
- package/checks/rules/unique-target-paths.js +34 -2
- package/checks/rules/unique-target-paths.js.map +1 -1
- package/common/bundled-dependency-groups.js +27 -0
- package/common/bundled-dependency-groups.js.map +1 -1
- package/common/code-files.js +28 -0
- package/common/code-files.js.map +1 -1
- package/common/declaration-companion-paths.js +24 -0
- package/common/declaration-companion-paths.js.map +1 -1
- package/common/package-name-map.js +7 -0
- package/common/package-name-map.js.map +1 -1
- package/common/stable-json.js +42 -2
- package/common/stable-json.js.map +1 -1
- package/common/worklist.js +22 -0
- package/common/worklist.js.map +1 -1
- package/config/additional-files.d.ts +1 -1
- package/config/additional-files.js +6 -2
- package/config/additional-files.js.map +1 -1
- package/config/additional-package-json-attributes-schema.js +6 -2
- package/config/additional-package-json-attributes-schema.js.map +1 -1
- package/config/automatic-versioning-settings.js +6 -2
- package/config/automatic-versioning-settings.js.map +1 -1
- package/config/changelog-settings.d.ts +44 -0
- package/config/changelog-settings.d.ts.map +1 -1
- package/config/changelog-settings.js +120 -3
- package/config/changelog-settings.js.map +1 -1
- package/config/common-package-settings-schemas.js +19 -3
- package/config/common-package-settings-schemas.js.map +1 -1
- package/config/config.d.ts +6 -1
- package/config/config.d.ts.map +1 -1
- package/config/config.js +3 -1
- package/config/config.js.map +1 -1
- package/config/cross-package-validation.js +17 -0
- package/config/cross-package-validation.js.map +1 -1
- package/config/dead-code-elimination-settings.d.ts +1 -0
- package/config/dead-code-elimination-settings.d.ts.map +1 -1
- package/config/dead-code-elimination-settings.js +36 -2
- package/config/dead-code-elimination-settings.js.map +1 -1
- package/config/dependency-existence-validation.js +19 -1
- package/config/dependency-existence-validation.js.map +1 -1
- package/config/dependency-policy.js +5 -2
- package/config/dependency-policy.js.map +1 -1
- package/config/main-package-json-schema.js +13 -2
- package/config/main-package-json-schema.js.map +1 -1
- package/config/manual-versioning-settings.d.ts +12 -0
- package/config/manual-versioning-settings.d.ts.map +1 -1
- package/config/manual-versioning-settings.js +29 -2
- package/config/manual-versioning-settings.js.map +1 -1
- package/config/optional-package-settings-schema.js +16 -7
- package/config/optional-package-settings-schema.js.map +1 -1
- package/config/package-config.d.ts +4 -0
- package/config/package-config.d.ts.map +1 -1
- package/config/package-config.js +2 -1
- package/config/package-config.js.map +1 -1
- package/config/package-graph-builder.js +14 -2
- package/config/package-graph-builder.js.map +1 -1
- package/config/package-interface.js +25 -2
- package/config/package-interface.js.map +1 -1
- package/config/package-json.d.ts +2 -0
- package/config/package-json.d.ts.map +1 -1
- package/config/package-json.js +16 -0
- package/config/package-json.js.map +1 -1
- package/config/packtory-config-schema.d.ts +12 -12
- package/config/packtory-config-without-registry-schema.js +6 -0
- package/config/packtory-config-without-registry-schema.js.map +1 -1
- package/config/per-package-settings-schema.js +22 -6
- package/config/per-package-settings-schema.js.map +1 -1
- package/config/pre-graph-validation.js +20 -5
- package/config/pre-graph-validation.js.map +1 -1
- package/config/publish-settings.d.ts +3 -0
- package/config/publish-settings.d.ts.map +1 -1
- package/config/publish-settings.js +25 -3
- package/config/publish-settings.js.map +1 -1
- package/config/publish-settings.report.js +17 -1
- package/config/publish-settings.report.js.map +1 -1
- package/config/registry-settings.d.ts +41 -0
- package/config/registry-settings.d.ts.map +1 -1
- package/config/registry-settings.js +40 -2
- package/config/registry-settings.js.map +1 -1
- package/config/registry-settings.report.js +46 -0
- package/config/registry-settings.report.js.map +1 -1
- package/config/root-config-validation.js +141 -0
- package/config/root-config-validation.js.map +1 -1
- package/config/root.js +6 -2
- package/config/root.js.map +1 -1
- package/config/sbom-settings.js +4 -1
- package/config/sbom-settings.js.map +1 -1
- package/config/settings-validation.js +28 -0
- package/config/settings-validation.js.map +1 -1
- package/config/validation.d.ts.map +1 -1
- package/config/validation.js +35 -1
- package/config/validation.js.map +1 -1
- package/config/versioning-settings.d.ts +18 -1
- package/config/versioning-settings.d.ts.map +1 -1
- package/config/versioning-settings.js +10 -3
- package/config/versioning-settings.js.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.d.ts +11 -0
- package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.js +7 -0
- package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
- package/dead-code-eliminator/bundle-analysis.js +38 -5
- package/dead-code-eliminator/bundle-analysis.js.map +1 -1
- package/dead-code-eliminator/class-purity.js +48 -2
- package/dead-code-eliminator/class-purity.js.map +1 -1
- package/dead-code-eliminator/code-file-analyzer.js +68 -4
- package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/bundle-index.js +10 -1
- package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +22 -3
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/import-export-walker.js +164 -4
- package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/seed-store.js +10 -0
- package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
- package/dead-code-eliminator/dependency-metadata.js +172 -3
- package/dead-code-eliminator/dependency-metadata.js.map +1 -1
- package/dead-code-eliminator/elimination-emitter.js +52 -0
- package/dead-code-eliminator/elimination-emitter.js.map +1 -1
- package/dead-code-eliminator/eliminator.js +22 -4
- package/dead-code-eliminator/eliminator.js.map +1 -1
- package/dead-code-eliminator/expression-unwrapping.js +16 -1
- package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
- package/dead-code-eliminator/imported-expression-origin.js +101 -2
- package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
- package/dead-code-eliminator/liveness/asset-side-effects.js +9 -1
- package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
- package/dead-code-eliminator/liveness/boolean-facts.js +98 -2
- package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
- package/dead-code-eliminator/liveness/external-module-resolution.js +172 -2
- package/dead-code-eliminator/liveness/external-module-resolution.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity-summary.js +294 -3
- package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity.js +39 -3
- package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
- package/dead-code-eliminator/liveness/module-analysis.js +27 -2
- package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
- package/dead-code-eliminator/liveness/resource-retention.js +91 -1
- package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
- package/dead-code-eliminator/liveness/runtime-code.js +15 -1
- package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
- package/dead-code-eliminator/load-bundle.js +86 -5
- package/dead-code-eliminator/load-bundle.js.map +1 -1
- package/dead-code-eliminator/pure-expression.js +178 -5
- package/dead-code-eliminator/pure-expression.js.map +1 -1
- package/dead-code-eliminator/reachability/bfs-closure.js +53 -0
- package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-extractor.js +100 -2
- package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-id.js +106 -1
- package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
- package/dead-code-eliminator/reachability/identifier-target-collector.js +96 -2
- package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
- package/dead-code-eliminator/reachability/impure-statements.js +11 -2
- package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
- package/dead-code-eliminator/reachability/local-seed-gathering.js +91 -4
- package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
- package/dead-code-eliminator/reachability/reachability.js +65 -4
- package/dead-code-eliminator/reachability/reachability.js.map +1 -1
- package/dead-code-eliminator/side-effect-classifier.js +39 -4
- package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
- package/dead-code-eliminator/side-effects-field.js +23 -1
- package/dead-code-eliminator/side-effects-field.js.map +1 -1
- package/dead-code-eliminator/source-map-recomposition.js +29 -2
- package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
- package/dead-code-eliminator/statement-classifiers.js +94 -4
- package/dead-code-eliminator/statement-classifiers.js.map +1 -1
- package/dead-code-eliminator/syntax-kind-sets.js +16 -0
- package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.d.ts +8 -0
- package/dead-code-eliminator/transform/atom-translator.d.ts.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.js +57 -2
- package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-removal.js +183 -5
- package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-remover.js +17 -2
- package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
- package/dead-code-eliminator/transform/line-index.d.ts +7 -0
- package/dead-code-eliminator/transform/line-index.d.ts.map +1 -1
- package/dead-code-eliminator/transform/line-index.js +20 -0
- package/dead-code-eliminator/transform/line-index.js.map +1 -1
- package/dead-code-eliminator/transform/named-declaration-kinds.js +3 -0
- package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
- package/dead-code-eliminator/transform/source-map-composer.js +84 -3
- package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
- package/dead-code-eliminator/variable-declaration-bindings.js +25 -1
- package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
- package/dependency-scanner/dependency-graph.d.ts +41 -0
- package/dependency-scanner/dependency-graph.d.ts.map +1 -0
- package/dependency-scanner/dependency-graph.js +77 -3
- package/dependency-scanner/dependency-graph.js.map +1 -1
- package/dependency-scanner/external-dependencies.d.ts +10 -1
- package/dependency-scanner/external-dependencies.d.ts.map +1 -1
- package/dependency-scanner/external-dependencies.js +55 -1
- package/dependency-scanner/external-dependencies.js.map +1 -1
- package/dependency-scanner/file-host-predicates.js +9 -0
- package/dependency-scanner/file-host-predicates.js.map +1 -1
- package/dependency-scanner/host-method-binding.js +18 -0
- package/dependency-scanner/host-method-binding.js.map +1 -1
- package/dependency-scanner/injected-dynamic-imports.js +232 -1
- package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
- package/dependency-scanner/node-modules-manifest-synthesizer.js +52 -4
- package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
- package/dependency-scanner/package-owned-asset-file-path.js +9 -1
- package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
- package/dependency-scanner/scanner.d.ts +20 -0
- package/dependency-scanner/scanner.d.ts.map +1 -0
- package/dependency-scanner/scanner.js +109 -4
- package/dependency-scanner/scanner.js.map +1 -1
- package/dependency-scanner/source-file-references.d.ts +37 -0
- package/dependency-scanner/source-file-references.d.ts.map +1 -0
- package/dependency-scanner/source-file-references.js +181 -6
- package/dependency-scanner/source-file-references.js.map +1 -1
- package/dependency-scanner/source-map-file-locator.d.ts +10 -0
- package/dependency-scanner/source-map-file-locator.d.ts.map +1 -0
- package/dependency-scanner/source-map-file-locator.js +66 -2
- package/dependency-scanner/source-map-file-locator.js.map +1 -1
- package/dependency-scanner/typescript-compiler-options.d.ts +8 -0
- package/dependency-scanner/typescript-compiler-options.d.ts.map +1 -0
- package/dependency-scanner/typescript-compiler-options.js +21 -1
- package/dependency-scanner/typescript-compiler-options.js.map +1 -1
- package/dependency-scanner/typescript-file-host.d.ts +12 -0
- package/dependency-scanner/typescript-file-host.d.ts.map +1 -0
- package/dependency-scanner/typescript-file-host.js +49 -5
- package/dependency-scanner/typescript-file-host.js.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.d.ts +19 -0
- package/dependency-scanner/typescript-project-analyzer.d.ts.map +1 -0
- package/dependency-scanner/typescript-project-analyzer.js +35 -3
- package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
- package/dependency-scanner/virtual-package-json-host.js +45 -4
- package/dependency-scanner/virtual-package-json-host.js.map +1 -1
- package/directed-graph/graph.d.ts +1 -0
- package/directed-graph/graph.d.ts.map +1 -1
- package/directed-graph/graph.js +240 -1
- package/directed-graph/graph.js.map +1 -1
- package/file-manager/compare.js +23 -2
- package/file-manager/compare.js.map +1 -1
- package/file-manager/equal.js +5 -0
- package/file-manager/equal.js.map +1 -1
- package/file-manager/file-description.d.ts +2 -1
- package/file-manager/file-description.d.ts.map +1 -1
- package/file-manager/file-description.js +3 -0
- package/file-manager/file-description.js.map +1 -1
- package/file-manager/file-manager.d.ts +1 -1
- package/file-manager/file-manager.d.ts.map +1 -1
- package/file-manager/file-manager.js +4 -4
- package/file-manager/file-manager.js.map +1 -1
- package/file-manager/permissions.js +28 -1
- package/file-manager/permissions.js.map +1 -1
- package/git/current-git-head.d.ts +12 -0
- package/git/current-git-head.d.ts.map +1 -0
- package/git/current-git-head.js +24 -0
- package/git/current-git-head.js.map +1 -1
- package/git/git-command.js +49 -1
- package/git/git-command.js.map +1 -1
- package/linker/linked-bundle.d.ts +19 -2
- package/linker/linked-bundle.d.ts.map +1 -1
- package/linker/linked-bundle.js +5 -0
- package/linker/linked-bundle.js.map +1 -1
- package/linker/linker.d.ts +13 -0
- package/linker/linker.d.ts.map +1 -0
- package/linker/linker.js +51 -5
- package/linker/linker.js.map +1 -1
- package/linker/replacement-lookup.js +297 -8
- package/linker/replacement-lookup.js.map +1 -1
- package/linker/resource-graph.js +65 -2
- package/linker/resource-graph.js.map +1 -1
- package/linker/source-modifier/import-paths.js +76 -3
- package/linker/source-modifier/import-paths.js.map +1 -1
- package/linker/substitute-bundles.js +166 -3
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +111 -2
- package/linker/substituted-resource-graph.js.map +1 -1
- package/npm-oidc-id-token-resolver.js +82 -0
- package/npm-oidc-id-token-resolver.js.map +1 -1
- package/pack-emitter/pack-emitter.d.ts +20 -0
- package/pack-emitter/pack-emitter.d.ts.map +1 -1
- package/pack-emitter/pack-emitter.js +27 -0
- package/pack-emitter/pack-emitter.js.map +1 -1
- package/package-surface/bin-field.js +8 -2
- package/package-surface/bin-field.js.map +1 -1
- package/package-surface/explicit-bin.js +24 -2
- package/package-surface/explicit-bin.js.map +1 -1
- package/package-surface/explicit-exports.js +26 -3
- package/package-surface/explicit-exports.js.map +1 -1
- package/package-surface/export-map.js +9 -2
- package/package-surface/export-map.js.map +1 -1
- package/package-surface/implicit-bin.js +25 -1
- package/package-surface/implicit-bin.js.map +1 -1
- package/package-surface/implicit-exports.js +10 -3
- package/package-surface/implicit-exports.js.map +1 -1
- package/package-surface/implicit-root-exports.js +13 -2
- package/package-surface/implicit-root-exports.js.map +1 -1
- package/package-surface/package-json-export.js +9 -0
- package/package-surface/package-json-export.js.map +1 -1
- package/package-surface/package-shape.js +10 -1
- package/package-surface/package-shape.js.map +1 -1
- package/package-surface/package-surface-index.js +165 -3
- package/package-surface/package-surface-index.js.map +1 -1
- package/package-surface/public-module-usage.js +46 -3
- package/package-surface/public-module-usage.js.map +1 -1
- package/package-surface/public-specifiers.js +7 -1
- package/package-surface/public-specifiers.js.map +1 -1
- package/package-surface/root-registry.js +26 -0
- package/package-surface/root-registry.js.map +1 -1
- package/package-surface/specifier-syntax.js +4 -0
- package/package-surface/specifier-syntax.js.map +1 -1
- package/package-surface/substitution-exports.js +101 -3
- package/package-surface/substitution-exports.js.map +1 -1
- package/package-surface/surface.d.ts +2 -0
- package/package-surface/surface.d.ts.map +1 -1
- package/package-surface/surface.js +12 -0
- package/package-surface/surface.js.map +1 -1
- package/package.json +1 -1
- package/packages/package-processor.composition.d.ts +22 -0
- package/packages/package-processor.composition.d.ts.map +1 -1
- package/packages/package-processor.composition.js +161 -34
- package/packages/package-processor.composition.js.map +1 -1
- package/packtory/changelog-source-attribution.js +16 -16
- package/packtory/changelog-source-attribution.js.map +1 -1
- package/packtory/map-config.d.ts +11 -1
- package/packtory/map-config.d.ts.map +1 -1
- package/packtory/map-config.js +35 -4
- package/packtory/map-config.js.map +1 -1
- package/packtory/normalize-paths.js +25 -1
- package/packtory/normalize-paths.js.map +1 -1
- package/packtory/options/bundle-dependency-resolution.js +17 -1
- package/packtory/options/bundle-dependency-resolution.js.map +1 -1
- package/packtory/options/dead-code-elimination-resolution.js +10 -1
- package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
- package/packtory/options/prepare-package-options.d.ts +13 -1
- package/packtory/options/prepare-package-options.d.ts.map +1 -1
- package/packtory/options/prepare-package-options.js +46 -5
- package/packtory/options/prepare-package-options.js.map +1 -1
- package/packtory/options/required-value-helpers.js +17 -0
- package/packtory/options/required-value-helpers.js.map +1 -1
- package/packtory/options/setting-resolvers.d.ts +17 -1
- package/packtory/options/setting-resolvers.d.ts.map +1 -1
- package/packtory/options/setting-resolvers.js +47 -3
- package/packtory/options/setting-resolvers.js.map +1 -1
- package/packtory/options/surface-resolution.js +15 -2
- package/packtory/options/surface-resolution.js.map +1 -1
- package/packtory/options/version-provider-context.js +24 -2
- package/packtory/options/version-provider-context.js.map +1 -1
- package/packtory/options/version-trigger.js +39 -2
- package/packtory/options/version-trigger.js.map +1 -1
- package/packtory/pack-output-preflight.js +60 -3
- package/packtory/pack-output-preflight.js.map +1 -1
- package/packtory/package-processor-build.js +97 -3
- package/packtory/package-processor-build.js.map +1 -1
- package/packtory/package-processor-publish-result.d.ts +3 -0
- package/packtory/package-processor-publish-result.d.ts.map +1 -1
- package/packtory/package-processor-publish.d.ts +2 -0
- package/packtory/package-processor-publish.d.ts.map +1 -1
- package/packtory/package-processor-publish.js +297 -6
- package/packtory/package-processor-publish.js.map +1 -1
- package/packtory/package-processor.d.ts +34 -0
- package/packtory/package-processor.d.ts.map +1 -1
- package/packtory/package-processor.js +10 -2
- package/packtory/package-processor.js.map +1 -1
- package/packtory/packtory-pack.js +298 -10
- package/packtory/packtory-pack.js.map +1 -1
- package/packtory/packtory-package-dependencies.js +116 -3
- package/packtory/packtory-package-dependencies.js.map +1 -1
- package/packtory/packtory-package-inspection.js +26 -5
- package/packtory/packtory-package-inspection.js.map +1 -1
- package/packtory/packtory-package-side-effects.js +64 -3
- package/packtory/packtory-package-side-effects.js.map +1 -1
- package/packtory/packtory-package-tree.js +43 -4
- package/packtory/packtory-package-tree.js.map +1 -1
- package/packtory/packtory-publish.js +17 -4
- package/packtory/packtory-publish.js.map +1 -1
- package/packtory/packtory-release-analysis.js +64 -6
- package/packtory/packtory-release-analysis.js.map +1 -1
- package/packtory/packtory-release-diff.js +48 -5
- package/packtory/packtory-release-diff.js.map +1 -1
- package/packtory/packtory-release-plan.js +87 -6
- package/packtory/packtory-release-plan.js.map +1 -1
- package/packtory/packtory-resolve.js +16 -5
- package/packtory/packtory-resolve.js.map +1 -1
- package/packtory/packtory.d.ts +28 -1
- package/packtory/packtory.d.ts.map +1 -1
- package/packtory/packtory.js +242 -13
- package/packtory/packtory.js.map +1 -1
- package/packtory/publish-failure-mapping.js +6 -0
- package/packtory/publish-failure-mapping.js.map +1 -1
- package/packtory/publish-target-preflight.js +25 -3
- package/packtory/publish-target-preflight.js.map +1 -1
- package/packtory/published-release-state.d.ts +19 -0
- package/packtory/published-release-state.d.ts.map +1 -1
- package/packtory/published-release-state.js +11 -0
- package/packtory/published-release-state.js.map +1 -1
- package/packtory/release-analysis.js +153 -5
- package/packtory/release-analysis.js.map +1 -1
- package/packtory/release-diff-failure-mapping.js +6 -0
- package/packtory/release-diff-failure-mapping.js.map +1 -1
- package/packtory/release-plan.js +135 -7
- package/packtory/release-plan.js.map +1 -1
- package/packtory/report-attachment.js +35 -2
- package/packtory/report-attachment.js.map +1 -1
- package/packtory/resolved-package.d.ts +11 -0
- package/packtory/resolved-package.d.ts.map +1 -1
- package/packtory/resolved-package.js +97 -3
- package/packtory/resolved-package.js.map +1 -1
- package/packtory/scheduler.d.ts +47 -0
- package/packtory/scheduler.d.ts.map +1 -1
- package/packtory/scheduler.js +99 -1
- package/packtory/scheduler.js.map +1 -1
- package/packtory/stages/package-analysis-stage.js +50 -2
- package/packtory/stages/package-analysis-stage.js.map +1 -1
- package/packtory/stages/package-resolution-stage.js +80 -5
- package/packtory/stages/package-resolution-stage.js.map +1 -1
- package/packtory/stages/publish-stage.js +125 -4
- package/packtory/stages/publish-stage.js.map +1 -1
- package/packtory/stages/release-diff-stage.js +84 -5
- package/packtory/stages/release-diff-stage.js.map +1 -1
- package/progress/progress-broadcaster.d.ts +1 -0
- package/progress/progress-broadcaster.d.ts.map +1 -1
- package/progress/progress-broadcaster.js +45 -0
- package/progress/progress-broadcaster.js.map +1 -1
- package/published-package/published-package.d.ts +2 -0
- package/published-package/published-package.d.ts.map +1 -1
- package/published-package/published-package.js +12 -1
- package/published-package/published-package.js.map +1 -1
- package/report/aggregator/artifact-entry-merger.js +20 -0
- package/report/aggregator/artifact-entry-merger.js.map +1 -1
- package/report/aggregator/package-report-materialization.js +75 -2
- package/report/aggregator/package-report-materialization.js.map +1 -1
- package/report/aggregator/report-aggregator.js +37 -2
- package/report/aggregator/report-aggregator.js.map +1 -1
- package/report/aggregator/report-event-handlers.js +141 -2
- package/report/aggregator/report-event-handlers.js.map +1 -1
- package/report/aggregator/report-types.d.ts +21 -0
- package/report/aggregator/report-types.d.ts.map +1 -1
- package/report/aggregator/report-types.js +3 -0
- package/report/aggregator/report-types.js.map +1 -1
- package/report/config-redactor.js +29 -3
- package/report/config-redactor.js.map +1 -1
- package/report/decorators.js +85 -0
- package/report/decorators.js.map +1 -1
- package/report/inspectors/inspect-artifact-sizes.js +34 -1
- package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
- package/report/inspectors/inspect-linker-rewrites.js +14 -1
- package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
- package/report/inspectors/inspect-package-json-provenance.js +15 -0
- package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
- package/report/inspectors/inspect-scan-results.js +15 -0
- package/report/inspectors/inspect-scan-results.js.map +1 -1
- package/report/release-diff/release-version-transition.js +18 -0
- package/report/release-diff/release-version-transition.js.map +1 -1
- package/resource-resolver/bundle-resource-lookup.js +25 -0
- package/resource-resolver/bundle-resource-lookup.js.map +1 -1
- package/resource-resolver/content.js +136 -3
- package/resource-resolver/content.js.map +1 -1
- package/resource-resolver/dependency-resolution-walker.js +73 -2
- package/resource-resolver/dependency-resolution-walker.js.map +1 -1
- package/resource-resolver/resolved-bundle.d.ts +54 -0
- package/resource-resolver/resolved-bundle.d.ts.map +1 -1
- package/resource-resolver/resolved-bundle.js +3 -0
- package/resource-resolver/resolved-bundle.js.map +1 -1
- package/resource-resolver/resource-resolve-options.d.ts +5 -0
- package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
- package/resource-resolver/resource-resolve-options.js +13 -1
- package/resource-resolver/resource-resolve-options.js.map +1 -1
- package/resource-resolver/resource-resolver.d.ts +15 -0
- package/resource-resolver/resource-resolver.d.ts.map +1 -0
- package/resource-resolver/resource-resolver.js +128 -5
- package/resource-resolver/resource-resolver.js.map +1 -1
- package/sbom/extract-license.js +11 -1
- package/sbom/extract-license.js.map +1 -1
- package/sbom/license-resolver.d.ts +14 -0
- package/sbom/license-resolver.d.ts.map +1 -0
- package/sbom/license-resolver.js +23 -2
- package/sbom/license-resolver.js.map +1 -1
- package/sbom/sbom-builder.js +57 -2
- package/sbom/sbom-builder.js.map +1 -1
- package/sbom/sbom-canonicalizer.js +45 -3
- package/sbom/sbom-canonicalizer.js.map +1 -1
- package/sbom/sbom-file.d.ts +10 -0
- package/sbom/sbom-file.d.ts.map +1 -1
- package/sbom/sbom-file.js +54 -5
- package/sbom/sbom-file.js.map +1 -1
- package/sbom/sbom-serializer.d.ts +8 -0
- package/sbom/sbom-serializer.d.ts.map +1 -0
- package/sbom/sbom-serializer.js +14 -1
- package/sbom/sbom-serializer.js.map +1 -1
- package/sbom/tool-version.js +49 -1
- package/sbom/tool-version.js.map +1 -1
- package/sbom.cdx.json +5 -5
- package/tar/extract-tar.js +83 -3
- package/tar/extract-tar.js.map +1 -1
- package/tar/gzipped-pack.js +20 -0
- package/tar/gzipped-pack.js.map +1 -1
- package/tar/tarball-builder.d.ts +14 -0
- package/tar/tarball-builder.d.ts.map +1 -0
- package/tar/tarball-builder.js +44 -4
- package/tar/tarball-builder.js.map +1 -1
- package/vendor-materializer/vendor-entry.d.ts +12 -0
- package/vendor-materializer/vendor-entry.d.ts.map +1 -0
- package/vendor-materializer/vendor-entry.js +20 -1
- package/vendor-materializer/vendor-entry.js.map +1 -1
- package/vendor-materializer/vendor-materializer.d.ts +55 -0
- package/vendor-materializer/vendor-materializer.d.ts.map +1 -0
- package/vendor-materializer/vendor-materializer.js +240 -8
- package/vendor-materializer/vendor-materializer.js.map +1 -1
- package/version-manager/dependencies/bundle-dependency-grouping.js +32 -2
- package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
- package/version-manager/dependencies/dependency-groups.js +11 -1
- package/version-manager/dependencies/dependency-groups.js.map +1 -1
- package/version-manager/dependencies/external-dependency-classification.js +82 -3
- package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
- package/version-manager/dependencies/versioned-bundle-dependencies.js +8 -3
- package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
- package/version-manager/imports/hash-import-scanner.js +20 -2
- package/version-manager/imports/hash-import-scanner.js.map +1 -1
- package/version-manager/imports/imports-key-matcher.js +22 -0
- package/version-manager/imports/imports-key-matcher.js.map +1 -1
- package/version-manager/imports/versioned-bundle-imports.js +44 -2
- package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
- package/version-manager/manager.d.ts +5 -0
- package/version-manager/manager.d.ts.map +1 -1
- package/version-manager/manager.js +46 -6
- package/version-manager/manager.js.map +1 -1
- package/version-manager/manifest/builder.js +51 -1
- package/version-manager/manifest/builder.js.map +1 -1
- package/version-manager/manifest/serialize.js +8 -1
- package/version-manager/manifest/serialize.js.map +1 -1
- package/version-manager/optional-bundle-fields.js +5 -1
- package/version-manager/optional-bundle-fields.js.map +1 -1
- package/version-manager/representative-root.js +9 -1
- package/version-manager/representative-root.js.map +1 -1
- package/version-manager/specifier-classifier.js +42 -2
- package/version-manager/specifier-classifier.js.map +1 -1
- package/version-manager/specifier-errors.js +58 -0
- package/version-manager/specifier-errors.js.map +1 -1
- package/version-manager/versioned-bundle.d.ts +3 -1
- package/version-manager/versioned-bundle.d.ts.map +1 -1
- package/version-manager/versioned-bundle.js +31 -6
- package/version-manager/versioned-bundle.js.map +1 -1
- package/zip/zip-builder.d.ts +22 -0
- package/zip/zip-builder.d.ts.map +1 -0
- package/zip/zip-builder.js +81 -2
- package/zip/zip-builder.js.map +1 -1
|
@@ -1 +1,25 @@
|
|
|
1
|
+
export const unsupportedProviderMarker = 'not supported for provider:';
|
|
2
|
+
export const githubActionsIdTokenMessage = 'GitHub Actions provenance needs "permissions: id-token: write" on the workflow job. ' +
|
|
3
|
+
'See the packtory readme for the workflow snippet.';
|
|
4
|
+
export const gitlabSigstoreIdTokenMessage = 'GitLab CI provenance needs an "id_tokens" entry with audience "sigstore" ' +
|
|
5
|
+
'exposed as SIGSTORE_ID_TOKEN. See the packtory readme for the workflow snippet.';
|
|
6
|
+
export function buildUnsupportedProviderMessage(ciName) {
|
|
7
|
+
return ('Provenance auto mode requires GitHub Actions or GitLab CI. ' +
|
|
8
|
+
`Detected CI: ${ciName}. ` +
|
|
9
|
+
"Use provenance: { type: 'file' } for other environments.");
|
|
10
|
+
}
|
|
11
|
+
export function buildMissingProvenanceFileMessage(filePath) {
|
|
12
|
+
return (`Provenance bundle file "${filePath}" does not exist. ` +
|
|
13
|
+
"Generate it with your CI's attestation tool (e.g. actions/attest-build-provenance) " +
|
|
14
|
+
'before running packtory.');
|
|
15
|
+
}
|
|
16
|
+
export function buildInvalidProvenanceFileMessage(filePath) {
|
|
17
|
+
return (`Provenance bundle file "${filePath}" is not a valid sigstore bundle. ` +
|
|
18
|
+
'Re-generate it from the current build.');
|
|
19
|
+
}
|
|
20
|
+
export function buildProvenanceDigestMismatchMessage(filePath) {
|
|
21
|
+
return (`Provenance bundle at "${filePath}" was signed against a different tarball ` +
|
|
22
|
+
'than the one packtory built. Re-generate the bundle from the current source: ' +
|
|
23
|
+
'shipping a mismatched attestation would defeat the purpose of provenance.');
|
|
24
|
+
}
|
|
1
25
|
//# sourceMappingURL=publish-error-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-error-messages.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/publish-error/publish-error-messages.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"publish-error-messages.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/publish-error/publish-error-messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,MAAM,CAAC,MAAM,2BAA2B,GACpC,sFAAsF;IACtF,mDAAmD,CAAC;AAExD,MAAM,CAAC,MAAM,4BAA4B,GACrC,2EAA2E;IAC3E,iFAAiF,CAAC;AAEtF,MAAM,UAAU,+BAA+B,CAAC,MAAc;IAC1D,OAAO,CACH,6DAA6D;QAC7D,gBAAgB,MAAM,IAAI;QAC1B,0DAA0D,CAC7D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,QAAgB;IAC9D,OAAO,CACH,2BAA2B,QAAQ,oBAAoB;QACvD,qFAAqF;QACrF,0BAA0B,CAC7B,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,QAAgB;IAC9D,OAAO,CACH,2BAA2B,QAAQ,oCAAoC;QACvE,wCAAwC,CAC3C,CAAC;AACN,CAAC;AAED,MAAM,UAAU,oCAAoC,CAAC,QAAgB;IACjE,OAAO,CACH,yBAAyB,QAAQ,2CAA2C;QAC5E,+EAA+E;QAC/E,2EAA2E,CAC9E,CAAC;AACN,CAAC"}
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import "./registry-auth-config.js";
|
|
1
|
+
import { buildAuthOptions, resolvePublishAuth } from "./registry-auth-config.js";
|
|
2
|
+
const unauthorizedStatusCode = 401;
|
|
3
|
+
const forbiddenStatusCode = 403;
|
|
4
|
+
function isAuthFailure(error) {
|
|
5
|
+
const statusCode = error instanceof Object && Object.hasOwn(error, 'statusCode')
|
|
6
|
+
? error.statusCode
|
|
7
|
+
: undefined;
|
|
8
|
+
return statusCode === forbiddenStatusCode || statusCode === unauthorizedStatusCode;
|
|
9
|
+
}
|
|
10
|
+
export async function retryWithFallbackAuth(registrySettings, auth, run) {
|
|
11
|
+
try {
|
|
12
|
+
return await run(auth.options);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (!auth.allowsAutomaticRetry || !isAuthFailure(error)) {
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
const publishAuth = resolvePublishAuth(registrySettings);
|
|
19
|
+
if (publishAuth.type === 'npm-oidc') {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
return run(buildAuthOptions(publishAuth, registrySettings).options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
2
25
|
//# sourceMappingURL=metadata-auth-retry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-auth-retry.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/metadata-auth-retry.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"metadata-auth-retry.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/metadata-auth-retry.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,EAChB,kBAAkB,EAGrB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,SAAS,aAAa,CAAC,KAAc;IACjC,MAAM,UAAU,GAAG,KAAK,YAAY,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC;QAC5E,CAAC,CAAE,KAA4C,CAAC,UAAU;QAC1D,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,UAAU,KAAK,mBAAmB,IAAI,UAAU,KAAK,sBAAsB,CAAC;AACvF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACvC,gBAA4C,EAC5C,IAAoB,EACpB,GAA6C;IAE7C,IAAI,CAAC;QACD,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACtD,MAAM,KAAK,CAAC;QAChB,CAAC;QAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;QACzD,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAClC,MAAM,KAAK,CAAC;QAChB,CAAC;QAED,OAAO,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,69 @@
|
|
|
1
|
-
import "./registry-auth-config.js";
|
|
2
|
-
import "./registry-package-path.js";
|
|
3
|
-
import "./registry-response-schemas.js";
|
|
1
|
+
import { buildAuthOptions, createBaseOptions, isNpmRegistry, npmRegistryUrl, resolvePublishAuth, resolveRegistryUrl } from "./registry-auth-config.js";
|
|
2
|
+
import { toRegistryPackagePath } from "./registry-package-path.js";
|
|
3
|
+
import { parseOidcExchangeResponse } from "./registry-response-schemas.js";
|
|
4
|
+
const oidcExchangeRefreshThresholdInMilliseconds = 60_000;
|
|
5
|
+
export function createOidcTokenExchanger(dependencies) {
|
|
6
|
+
const { fetch: fetchImplementation, clock, resolveIdToken } = dependencies;
|
|
7
|
+
const cache = new Map();
|
|
8
|
+
function getCacheKey(packageName, registrySettings) {
|
|
9
|
+
return `${resolveRegistryUrl(registrySettings) ?? npmRegistryUrl}::${packageName}`;
|
|
10
|
+
}
|
|
11
|
+
function readCachedToken(cacheKey) {
|
|
12
|
+
const cachedToken = cache.get(cacheKey);
|
|
13
|
+
if (cachedToken === undefined) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const currentTime = clock.getCurrentTimeInMilliseconds();
|
|
17
|
+
if (cachedToken.expiresAt - currentTime > oidcExchangeRefreshThresholdInMilliseconds) {
|
|
18
|
+
return cachedToken.token;
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
function parseExchangedToken(body) {
|
|
23
|
+
const parsed = parseOidcExchangeResponse(body);
|
|
24
|
+
if (!parsed.success) {
|
|
25
|
+
throw new TypeError(`OIDC token exchange returned an invalid response: ${parsed.issues.join('; ')}`);
|
|
26
|
+
}
|
|
27
|
+
return { token: parsed.data.token, expiresAt: parsed.data.expires.getTime() };
|
|
28
|
+
}
|
|
29
|
+
async function requestExchange(packageName, auth) {
|
|
30
|
+
const idToken = await resolveIdToken(auth);
|
|
31
|
+
const requestInit = {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: { Authorization: `Bearer ${idToken}` }
|
|
34
|
+
};
|
|
35
|
+
const exchangeResponse = await fetchImplementation(`${npmRegistryUrl}-/npm/v1/oidc/token/exchange/package/${toRegistryPackagePath(packageName)}`, requestInit);
|
|
36
|
+
if (!exchangeResponse.ok) {
|
|
37
|
+
throw new Error(`OIDC token exchange failed with status ${exchangeResponse.status}`);
|
|
38
|
+
}
|
|
39
|
+
return parseExchangedToken((await exchangeResponse.json()));
|
|
40
|
+
}
|
|
41
|
+
async function exchangeToken(packageName, registrySettings, auth) {
|
|
42
|
+
const cacheKey = getCacheKey(packageName, registrySettings);
|
|
43
|
+
const cached = readCachedToken(cacheKey);
|
|
44
|
+
if (cached !== undefined) {
|
|
45
|
+
return cached;
|
|
46
|
+
}
|
|
47
|
+
if (!isNpmRegistry(resolveRegistryUrl(registrySettings))) {
|
|
48
|
+
throw new Error('npm-oidc auth is only supported with the npmjs.org registry');
|
|
49
|
+
}
|
|
50
|
+
const exchanged = await requestExchange(packageName, auth);
|
|
51
|
+
cache.set(cacheKey, exchanged);
|
|
52
|
+
return exchanged.token;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
exchangeToken,
|
|
56
|
+
async resolveWriteAuthOptions(packageName, registrySettings) {
|
|
57
|
+
const auth = resolvePublishAuth(registrySettings);
|
|
58
|
+
if (auth.type !== 'npm-oidc') {
|
|
59
|
+
return buildAuthOptions(auth, registrySettings).options;
|
|
60
|
+
}
|
|
61
|
+
const token = await exchangeToken(packageName, registrySettings, auth);
|
|
62
|
+
return {
|
|
63
|
+
...createBaseOptions(registrySettings),
|
|
64
|
+
forceAuth: { token }
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
4
69
|
//# sourceMappingURL=oidc-token-exchange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc-token-exchange.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/oidc-token-exchange.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"oidc-token-exchange.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/oidc-token-exchange.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAErB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,0CAA0C,GAAG,MAAM,CAAC;AA8B1D,MAAM,UAAU,wBAAwB,CAAC,YAAuC;IAC5E,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,YAAY,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;IAEnD,SAAS,WAAW,CAAC,WAAmB,EAAE,gBAA4C;QAClF,OAAO,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;IACvF,CAAC;IAED,SAAS,eAAe,CAAC,QAAgB;QACrC,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC;QACzD,IAAI,WAAW,CAAC,SAAS,GAAG,WAAW,GAAG,0CAA0C,EAAE,CAAC;YACnF,OAAO,WAAW,CAAC,KAAK,CAAC;QAC7B,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,SAAS,mBAAmB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;QAClB,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC3D,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED,OAAO;QACH,aAAa;QAEb,KAAK,CAAC,uBAAuB,CAAC,WAAW,EAAE,gBAAgB;YACvD,MAAM,IAAI,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBAC3B,OAAO,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC;YAC5D,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;YACvE,OAAO;gBACH,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;gBACtC,SAAS,EAAE,EAAE,KAAK,EAAE;aACvB,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type _npmFetch from 'npm-registry-fetch';
|
|
2
|
+
import { Maybe } from 'true-myth';
|
|
3
|
+
import type { RegistrySettings } from '../../config/registry-settings.ts';
|
|
4
|
+
import { type NpmFetchOptions } from './registry-auth-config.ts';
|
|
1
5
|
import { type TarballIntegrity } from './tarball-integrity.ts';
|
|
2
6
|
export type PackageVersionDetails = {
|
|
3
7
|
readonly version: string;
|
|
@@ -15,5 +19,15 @@ export type PackageReleaseMetadata = {
|
|
|
15
19
|
export type PackageVersionReleaseMetadata = PackageReleaseMetadata & {
|
|
16
20
|
readonly latestVersion: string | undefined;
|
|
17
21
|
};
|
|
22
|
+
type NpmFetchResponse = Awaited<ReturnType<typeof _npmFetch>>;
|
|
23
|
+
export type NpmFetch = {
|
|
24
|
+
(url: string, options?: NpmFetchOptions): Promise<NpmFetchResponse>;
|
|
25
|
+
readonly json: typeof _npmFetch.json;
|
|
26
|
+
};
|
|
27
|
+
export declare function fetchLatestPackageVersion(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<Maybe<PackageVersionDetails>>;
|
|
28
|
+
export declare function fetchLatestPackageReleaseMetadata(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<Maybe<PackageReleaseMetadata>>;
|
|
29
|
+
export declare function fetchPackageVersionReleaseMetadata(npmFetch: NpmFetch, packageName: string, version: string, registrySettings: Readonly<RegistrySettings>): Promise<Maybe<PackageVersionReleaseMetadata>>;
|
|
30
|
+
export declare function fetchStagedPackageVersions(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<readonly string[]>;
|
|
31
|
+
export declare function fetchPackageTarball(npmFetch: NpmFetch, tarballUrl: string, tarballIntegrity: TarballIntegrity, registrySettings: Readonly<RegistrySettings>): Promise<Buffer>;
|
|
18
32
|
export {};
|
|
19
33
|
//# sourceMappingURL=package-metadata-fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-metadata-fetcher.d.ts","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/package-metadata-fetcher.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"package-metadata-fetcher.d.ts","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/package-metadata-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OA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AED,wBAAsB,iCAAiC,CACnD,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAiBxC;AAED,wBAAsB,kCAAkC,CACpD,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,CAoB/C;AAgBD,wBAAsB,0BAA0B,CAC5C,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC7C,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAoB5B;AAED,wBAAsB,mBAAmB,CACrC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC7C,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -1,8 +1,211 @@
|
|
|
1
|
-
import 'true-myth';
|
|
2
|
-
import "./metadata-auth-retry.js";
|
|
3
|
-
import "./registry-package-path.js";
|
|
4
|
-
import "./registry-auth-config.js";
|
|
5
|
-
import "./registry-response-schemas.js";
|
|
6
|
-
import "./tarball-integrity.js";
|
|
7
|
-
import "./validate-tarball-host.js";
|
|
1
|
+
import { Maybe } from 'true-myth';
|
|
2
|
+
import { retryWithFallbackAuth } from "./metadata-auth-retry.js";
|
|
3
|
+
import { toRegistryPackagePath } from "./registry-package-path.js";
|
|
4
|
+
import { resolveMetadataAuthOptions, resolveStageListingAuthOptions } from "./registry-auth-config.js";
|
|
5
|
+
import { parseAbbreviatedPackageResponse, parseFullPackageResponse } from "./registry-response-schemas.js";
|
|
6
|
+
import { assertTarballIntegrity } from "./tarball-integrity.js";
|
|
7
|
+
import { assertTarballOriginMatchesRegistry } from "./validate-tarball-host.js";
|
|
8
|
+
const notFoundStatusCode = 404;
|
|
9
|
+
const abbreviatedResponseAcceptHeader = 'application/vnd.npm.install-v1+json';
|
|
10
|
+
const maxDownloadedTarballBytes = 268_435_456;
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return value instanceof Object;
|
|
13
|
+
}
|
|
14
|
+
function assertDownloadedTarballSize(size) {
|
|
15
|
+
if (size > maxDownloadedTarballBytes) {
|
|
16
|
+
throw new Error(`Refusing to download tarball larger than ${maxDownloadedTarballBytes} bytes`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function assertContentLengthWithinDownloadLimit(response) {
|
|
20
|
+
assertDownloadedTarballSize(Number(response.headers?.get('content-length')));
|
|
21
|
+
}
|
|
22
|
+
function isMissingPackageError(error) {
|
|
23
|
+
const statusCode = isRecord(error) ? error.statusCode : undefined;
|
|
24
|
+
return statusCode === notFoundStatusCode;
|
|
25
|
+
}
|
|
26
|
+
function parseTimestamp(timestamp) {
|
|
27
|
+
const parsed = new Date(timestamp);
|
|
28
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
29
|
+
throw new TypeError(`Version publish time "${timestamp}" is not a valid timestamp`);
|
|
30
|
+
}
|
|
31
|
+
return parsed;
|
|
32
|
+
}
|
|
33
|
+
function isNonNegativeInteger(value) {
|
|
34
|
+
if (!Number.isSafeInteger(value)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return Number(value) >= 0;
|
|
38
|
+
}
|
|
39
|
+
function parseStagedPackageListResponse(response) {
|
|
40
|
+
if (!isRecord(response)) {
|
|
41
|
+
throw new Error('Got an invalid response from registry stage API');
|
|
42
|
+
}
|
|
43
|
+
const { items, total } = response;
|
|
44
|
+
if (!Array.isArray(items) || !isNonNegativeInteger(total)) {
|
|
45
|
+
throw new Error('Got an invalid response from registry stage API');
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
items: items.map(function (item) {
|
|
49
|
+
if (!isRecord(item) || typeof item.version !== 'string') {
|
|
50
|
+
throw new Error('Got an invalid response from registry stage API');
|
|
51
|
+
}
|
|
52
|
+
return { version: item.version };
|
|
53
|
+
}),
|
|
54
|
+
total
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const abbreviatedPackageMetadataRequest = {
|
|
58
|
+
parsePackageResponse: parseAbbreviatedPackageResponse,
|
|
59
|
+
headers: { accept: abbreviatedResponseAcceptHeader }
|
|
60
|
+
};
|
|
61
|
+
const fullPackageMetadataRequest = {
|
|
62
|
+
parsePackageResponse: parseFullPackageResponse,
|
|
63
|
+
headers: undefined
|
|
64
|
+
};
|
|
65
|
+
const stageListPageSize = 100;
|
|
66
|
+
const maximumStageListPages = 1000;
|
|
67
|
+
async function fetchPackageMetadataResponse(npmFetch, packageName, registrySettings, request) {
|
|
68
|
+
const auth = resolveMetadataAuthOptions(registrySettings);
|
|
69
|
+
return retryWithFallbackAuth(registrySettings, auth, async function (options) {
|
|
70
|
+
return npmFetch.json(`/${toRegistryPackagePath(packageName)}`, {
|
|
71
|
+
...options,
|
|
72
|
+
headers: request.headers
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function parsePackageMetadataResponse(response, request) {
|
|
77
|
+
const result = request.parsePackageResponse(response);
|
|
78
|
+
if (result === undefined) {
|
|
79
|
+
throw new Error('Got an invalid response from registry API');
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
async function fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, request) {
|
|
84
|
+
try {
|
|
85
|
+
return Maybe.just(parsePackageMetadataResponse(await fetchPackageMetadataResponse(npmFetch, packageName, registrySettings, request), request));
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (isMissingPackageError(error)) {
|
|
89
|
+
return Maybe.nothing();
|
|
90
|
+
}
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function readTarballDigestField(value, fieldName, packageName, version) {
|
|
95
|
+
if (value === undefined) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Registry returned invalid ${fieldName} for package "${packageName}" version "${version}"`);
|
|
102
|
+
}
|
|
103
|
+
function readTarballIntegrity(dist, packageName, version) {
|
|
104
|
+
return {
|
|
105
|
+
integrity: readTarballDigestField(dist.integrity, 'dist.integrity', packageName, version),
|
|
106
|
+
shasum: readTarballDigestField(dist.shasum, 'dist.shasum', packageName, version)
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function extractPackageVersionDetails(packageResponse, packageName, version) {
|
|
110
|
+
const versionData = packageResponse.versions[version];
|
|
111
|
+
if (versionData === undefined) {
|
|
112
|
+
return Maybe.nothing();
|
|
113
|
+
}
|
|
114
|
+
return Maybe.just({
|
|
115
|
+
version,
|
|
116
|
+
tarballUrl: versionData.dist.tarball,
|
|
117
|
+
tarballIntegrity: readTarballIntegrity(versionData.dist, packageName, version),
|
|
118
|
+
gitHead: versionData.gitHead
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function extractLatestVersionDetails(packageResponse, packageName) {
|
|
122
|
+
const latestVersion = packageResponse['dist-tags'].latest;
|
|
123
|
+
if (latestVersion === undefined) {
|
|
124
|
+
return Maybe.nothing();
|
|
125
|
+
}
|
|
126
|
+
const versionDetails = extractPackageVersionDetails(packageResponse, packageName, latestVersion);
|
|
127
|
+
if (versionDetails.isNothing) {
|
|
128
|
+
throw new Error(`Version "${latestVersion}" for package "${packageName}" has no entry in the registry response`);
|
|
129
|
+
}
|
|
130
|
+
return versionDetails;
|
|
131
|
+
}
|
|
132
|
+
function releaseMetadataFrom(packageResponse, versionDetails) {
|
|
133
|
+
const publishedAtTimestamp = packageResponse.time?.[versionDetails.version];
|
|
134
|
+
return {
|
|
135
|
+
version: versionDetails.version,
|
|
136
|
+
tarballUrl: versionDetails.tarballUrl,
|
|
137
|
+
tarballIntegrity: versionDetails.tarballIntegrity,
|
|
138
|
+
publishedAt: publishedAtTimestamp === undefined ? undefined : parseTimestamp(publishedAtTimestamp),
|
|
139
|
+
gitHead: versionDetails.gitHead
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export async function fetchLatestPackageVersion(npmFetch, packageName, registrySettings) {
|
|
143
|
+
const packageResponse = await fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, abbreviatedPackageMetadataRequest);
|
|
144
|
+
if (packageResponse.isNothing) {
|
|
145
|
+
return Maybe.nothing();
|
|
146
|
+
}
|
|
147
|
+
return extractLatestVersionDetails(packageResponse.value, packageName);
|
|
148
|
+
}
|
|
149
|
+
export async function fetchLatestPackageReleaseMetadata(npmFetch, packageName, registrySettings) {
|
|
150
|
+
const packageResponse = await fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, fullPackageMetadataRequest);
|
|
151
|
+
if (packageResponse.isNothing) {
|
|
152
|
+
return Maybe.nothing();
|
|
153
|
+
}
|
|
154
|
+
const latestVersion = extractLatestVersionDetails(packageResponse.value, packageName);
|
|
155
|
+
if (latestVersion.isNothing) {
|
|
156
|
+
return Maybe.nothing();
|
|
157
|
+
}
|
|
158
|
+
return Maybe.just(releaseMetadataFrom(packageResponse.value, latestVersion.value));
|
|
159
|
+
}
|
|
160
|
+
export async function fetchPackageVersionReleaseMetadata(npmFetch, packageName, version, registrySettings) {
|
|
161
|
+
const packageResponse = await fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, fullPackageMetadataRequest);
|
|
162
|
+
if (packageResponse.isNothing) {
|
|
163
|
+
return Maybe.nothing();
|
|
164
|
+
}
|
|
165
|
+
const versionDetails = extractPackageVersionDetails(packageResponse.value, packageName, version);
|
|
166
|
+
if (versionDetails.isNothing) {
|
|
167
|
+
return Maybe.nothing();
|
|
168
|
+
}
|
|
169
|
+
return Maybe.just({
|
|
170
|
+
...releaseMetadataFrom(packageResponse.value, versionDetails.value),
|
|
171
|
+
latestVersion: packageResponse.value['dist-tags'].latest
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async function fetchStagedPackageVersionPage(npmFetch, auth, packageName, page) {
|
|
175
|
+
const searchParams = new URLSearchParams({
|
|
176
|
+
package: packageName,
|
|
177
|
+
page: String(page),
|
|
178
|
+
perPage: String(stageListPageSize)
|
|
179
|
+
});
|
|
180
|
+
return parseStagedPackageListResponse(await npmFetch.json(`/-/stage?${searchParams.toString()}`, auth.options));
|
|
181
|
+
}
|
|
182
|
+
export async function fetchStagedPackageVersions(npmFetch, packageName, registrySettings) {
|
|
183
|
+
const auth = resolveStageListingAuthOptions(registrySettings);
|
|
184
|
+
const versions = [];
|
|
185
|
+
const pages = Array.from({ length: maximumStageListPages }, function (_value, index) {
|
|
186
|
+
return index;
|
|
187
|
+
});
|
|
188
|
+
for (const page of pages) {
|
|
189
|
+
const response = await fetchStagedPackageVersionPage(npmFetch, auth, packageName, page);
|
|
190
|
+
versions.push(...response.items.map(function (item) {
|
|
191
|
+
return item.version;
|
|
192
|
+
}));
|
|
193
|
+
if (versions.length >= response.total || response.items.length === 0) {
|
|
194
|
+
return versions;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
throw new Error(`Staged package listing exceeded ${maximumStageListPages} pages`);
|
|
198
|
+
}
|
|
199
|
+
export async function fetchPackageTarball(npmFetch, tarballUrl, tarballIntegrity, registrySettings) {
|
|
200
|
+
assertTarballOriginMatchesRegistry(tarballUrl, registrySettings);
|
|
201
|
+
const auth = resolveMetadataAuthOptions(registrySettings);
|
|
202
|
+
const response = await retryWithFallbackAuth(registrySettings, auth, async function (options) {
|
|
203
|
+
return npmFetch(tarballUrl, options);
|
|
204
|
+
});
|
|
205
|
+
assertContentLengthWithinDownloadLimit(response);
|
|
206
|
+
const tarball = await response.buffer();
|
|
207
|
+
assertDownloadedTarballSize(tarball.length);
|
|
208
|
+
assertTarballIntegrity(tarball, tarballIntegrity);
|
|
209
|
+
return tarball;
|
|
210
|
+
}
|
|
8
211
|
//# sourceMappingURL=package-metadata-fetcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-metadata-fetcher.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/package-metadata-fetcher.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"package-metadata-fetcher.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/package-metadata-fetcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACH,0BAA0B,EAC1B,8BAA8B,EAGjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,+BAA+B,EAC/B,wBAAwB,EAG3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAyB,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAEhF,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,+BAA+B,GAAG,qCAAqC,CAAC;AAC9E,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAqB9C,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,KAAK,YAAY,MAAM,CAAC;AACnC,CAAC;AAOD,SAAS,2BAA2B,CAAC,IAAY;IAC7C,IAAI,IAAI,GAAG,yBAAyB,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,4CAA4C,yBAAyB,QAAQ,CAAC,CAAC;IACnG,CAAC;AACL,CAAC;AAED,SAAS,sCAAsC,CAAC,QAAkC;IAC9E,2BAA2B,CAAC,MAAM,CAAC,QAAQ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AQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,IAAI;YAC9C,OAAO,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnE,OAAO,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,mCAAmC,qBAAqB,QAAQ,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACrC,QAAkB,EAClB,UAAkB,EAClB,gBAAkC,EAClC,gBAA4C;IAE5C,kCAAkC,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,gBAAgB,EAAE,IAAI,EAAE,KAAK,WAAW,OAAO;QACxF,OAAO,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,sCAAsC,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;IACxC,2BAA2B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAClD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
import "../publish-error/auto-mode-error-matching.js";
|
|
2
|
-
import "../publish-error/error-shape-helpers.js";
|
|
3
|
-
import "../publish-error/file-mode-error-matching.js";
|
|
1
|
+
import { matchAutoModeError } from "../publish-error/auto-mode-error-matching.js";
|
|
2
|
+
import { ensureError } from "../publish-error/error-shape-helpers.js";
|
|
3
|
+
import { matchFileModeError } from "../publish-error/file-mode-error-matching.js";
|
|
4
|
+
export function buildPublishOptionsForPublishSettings(publishSettings) {
|
|
5
|
+
if (publishSettings.access === 'restricted') {
|
|
6
|
+
return { access: 'restricted' };
|
|
7
|
+
}
|
|
8
|
+
if (publishSettings.provenance?.type === 'auto') {
|
|
9
|
+
return { access: 'public', provenance: true };
|
|
10
|
+
}
|
|
11
|
+
if (publishSettings.provenance?.type === 'file') {
|
|
12
|
+
return { access: 'public', provenanceFile: publishSettings.provenance.path };
|
|
13
|
+
}
|
|
14
|
+
return { access: 'public' };
|
|
15
|
+
}
|
|
16
|
+
function getProvenanceFilePath(publishSettings) {
|
|
17
|
+
return publishSettings.access === 'public' && publishSettings.provenance?.type === 'file'
|
|
18
|
+
? publishSettings.provenance.path
|
|
19
|
+
: undefined;
|
|
20
|
+
}
|
|
21
|
+
export function remapPublishError(error, publishSettings) {
|
|
22
|
+
const autoModeError = matchAutoModeError(error);
|
|
23
|
+
if (autoModeError !== undefined) {
|
|
24
|
+
return autoModeError;
|
|
25
|
+
}
|
|
26
|
+
const filePath = getProvenanceFilePath(publishSettings);
|
|
27
|
+
if (filePath !== undefined) {
|
|
28
|
+
const fileModeError = matchFileModeError(error, filePath);
|
|
29
|
+
if (fileModeError !== undefined) {
|
|
30
|
+
return fileModeError;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return ensureError(error);
|
|
34
|
+
}
|
|
4
35
|
//# sourceMappingURL=publish-settings-bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-settings-bridge.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/publish-settings-bridge.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"publish-settings-bridge.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/publish-settings-bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8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D,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,aAAa,CAAC;QACzB,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type _npmFetch from 'npm-registry-fetch';
|
|
2
|
+
import type { MetadataAuthStrategy, PublishAuthStrategy, RegistrySettings } from '../../config/registry-settings.ts';
|
|
3
|
+
export declare const npmRegistryUrl = "https://registry.npmjs.org/";
|
|
4
|
+
export type NpmFetchOptions = Readonly<NonNullable<Parameters<typeof _npmFetch>[1]>>;
|
|
5
|
+
export type AuthResolution = {
|
|
6
|
+
readonly allowsAutomaticRetry: boolean;
|
|
7
|
+
readonly registry: string | undefined;
|
|
8
|
+
readonly options: NpmFetchOptions;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveRegistryUrl(registrySettings: Readonly<RegistrySettings>): string | undefined;
|
|
11
|
+
export declare function isNpmRegistry(registry: string | undefined): boolean;
|
|
12
|
+
export declare function resolvePublishAuth(registrySettings: Readonly<RegistrySettings>): PublishAuthStrategy;
|
|
13
|
+
export declare function createBaseOptions(registrySettings: Readonly<RegistrySettings>): NpmFetchOptions;
|
|
14
|
+
export declare function buildAuthOptions(auth: MetadataAuthStrategy, registrySettings: Readonly<RegistrySettings>): AuthResolution;
|
|
15
|
+
export declare function resolveMetadataAuthOptions(registrySettings: Readonly<RegistrySettings>): AuthResolution;
|
|
16
|
+
export declare function resolveStageListingAuthOptions(registrySettings: Readonly<RegistrySettings>): AuthResolution;
|
|
17
|
+
//# sourceMappingURL=registry-auth-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-auth-config.d.ts","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-auth-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAER,oBAAoB,EACp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function resolveRegistryUrl(registrySettings) {
|
|
6
|
+
return registrySettings.registryUrl;
|
|
7
|
+
}
|
|
8
|
+
export function isNpmRegistry(registry) {
|
|
9
|
+
const resolvedRegistryUrl = new URL(registry ?? npmRegistryUrl);
|
|
10
|
+
return resolvedRegistryUrl.href === npmRegistryUrl;
|
|
11
|
+
}
|
|
12
|
+
const publishAuthRequiredErrorMessage = 'registrySettings.auth must be configured to publish; this code path should be unreachable when auth is missing.';
|
|
13
|
+
export function resolvePublishAuth(registrySettings) {
|
|
14
|
+
if (registrySettings.auth === undefined) {
|
|
15
|
+
throw new Error(publishAuthRequiredErrorMessage);
|
|
16
|
+
}
|
|
17
|
+
return isSplitRegistryAuth(registrySettings.auth) ? registrySettings.auth.publish : registrySettings.auth;
|
|
18
|
+
}
|
|
19
|
+
export function createBaseOptions(registrySettings) {
|
|
20
|
+
return {
|
|
21
|
+
alwaysAuth: true,
|
|
22
|
+
registry: resolveRegistryUrl(registrySettings)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function buildAuthOptions(auth, registrySettings) {
|
|
26
|
+
const registry = resolveRegistryUrl(registrySettings);
|
|
27
|
+
const options = createBaseOptions(registrySettings);
|
|
28
|
+
if (auth.type === 'bearer-token') {
|
|
29
|
+
return {
|
|
30
|
+
allowsAutomaticRetry: false,
|
|
31
|
+
registry,
|
|
32
|
+
options: {
|
|
33
|
+
...options,
|
|
34
|
+
forceAuth: {
|
|
35
|
+
token: auth.token
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
allowsAutomaticRetry: false,
|
|
42
|
+
registry,
|
|
43
|
+
options: {
|
|
44
|
+
...options,
|
|
45
|
+
forceAuth: {
|
|
46
|
+
_auth: Buffer.from(`${auth.username}:${auth.password}`).toString('base64')
|
|
47
|
+
},
|
|
48
|
+
...auth.email === undefined ? undefined : { email: auth.email }
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createAnonymousAuthResolution(registrySettings) {
|
|
53
|
+
return {
|
|
54
|
+
allowsAutomaticRetry: false,
|
|
55
|
+
registry: resolveRegistryUrl(registrySettings),
|
|
56
|
+
options: createBaseOptions(registrySettings)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function createAutomaticRetryAuthResolution(registrySettings) {
|
|
60
|
+
return {
|
|
61
|
+
...createAnonymousAuthResolution(registrySettings),
|
|
62
|
+
allowsAutomaticRetry: true
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function resolveInheritedMetadataAuth(publishAuth, registrySettings) {
|
|
66
|
+
return publishAuth.type === 'npm-oidc'
|
|
67
|
+
? createAnonymousAuthResolution(registrySettings)
|
|
68
|
+
: buildAuthOptions(publishAuth, registrySettings);
|
|
69
|
+
}
|
|
70
|
+
function resolveMetadataAuthFromMode(metadataMode, publishAuth, registrySettings) {
|
|
71
|
+
if (metadataMode === 'auto') {
|
|
72
|
+
return createAutomaticRetryAuthResolution(registrySettings);
|
|
73
|
+
}
|
|
74
|
+
if (metadataMode === 'anonymous') {
|
|
75
|
+
return createAnonymousAuthResolution(registrySettings);
|
|
76
|
+
}
|
|
77
|
+
if (typeof metadataMode === 'object') {
|
|
78
|
+
return buildAuthOptions(metadataMode, registrySettings);
|
|
79
|
+
}
|
|
80
|
+
return resolveInheritedMetadataAuth(publishAuth, registrySettings);
|
|
81
|
+
}
|
|
82
|
+
export function resolveMetadataAuthOptions(registrySettings) {
|
|
83
|
+
if (registrySettings.auth === undefined) {
|
|
84
|
+
return createAnonymousAuthResolution(registrySettings);
|
|
85
|
+
}
|
|
86
|
+
if (isSplitRegistryAuth(registrySettings.auth)) {
|
|
87
|
+
return resolveMetadataAuthFromMode(registrySettings.auth.metadata, registrySettings.auth.publish, registrySettings);
|
|
88
|
+
}
|
|
89
|
+
return resolveInheritedMetadataAuth(registrySettings.auth, registrySettings);
|
|
90
|
+
}
|
|
91
|
+
const stagedVersionLookupRequiresTokenAuthMessage = 'npm staged publishing with automatic versioning requires token-based metadata auth ' +
|
|
92
|
+
'when publish auth uses npm-oidc';
|
|
93
|
+
export function resolveStageListingAuthOptions(registrySettings) {
|
|
94
|
+
const { auth } = registrySettings;
|
|
95
|
+
if (auth === undefined) {
|
|
96
|
+
throw new Error(publishAuthRequiredErrorMessage);
|
|
97
|
+
}
|
|
98
|
+
const publishAuth = isSplitRegistryAuth(auth) ? auth.publish : auth;
|
|
99
|
+
if (isSplitRegistryAuth(auth) && typeof auth.metadata === 'object') {
|
|
100
|
+
return buildAuthOptions(auth.metadata, registrySettings);
|
|
101
|
+
}
|
|
102
|
+
if (publishAuth.type === 'npm-oidc') {
|
|
103
|
+
throw new Error(stagedVersionLookupRequiresTokenAuthMessage);
|
|
104
|
+
}
|
|
105
|
+
return buildAuthOptions(publishAuth, registrySettings);
|
|
106
|
+
}
|
|
1
107
|
//# sourceMappingURL=registry-auth-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-auth-config.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-auth-config.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"registry-auth-config.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-auth-config.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAa5D,SAAS,mBAAmB,CAAC,IAAkB;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,gBAA4C;IAC3E,OAAO,gBAAgB,CAAC,WAAW,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAA4B;IACtD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,QAAQ,IAAI,cAAc,CAAC,CAAC;IAChE,OAAO,mBAAmB,CAAC,IAAI,KAAK,cAAc,CAAC;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