packtory 0.0.90 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/artifacts-builder.js +4 -37
- package/artifacts/artifacts-builder.js.map +1 -1
- package/artifacts/content-collection.js +2 -59
- package/artifacts/content-collection.js.map +1 -1
- package/artifacts/folder-writer.js +2 -25
- package/artifacts/folder-writer.js.map +1 -1
- package/bundle-emitter/emitter.d.ts +0 -8
- package/bundle-emitter/emitter.d.ts.map +1 -1
- package/bundle-emitter/emitter.js +6 -106
- package/bundle-emitter/emitter.js.map +1 -1
- package/bundle-emitter/extract-package-tarball.js +2 -13
- package/bundle-emitter/extract-package-tarball.js.map +1 -1
- package/bundle-emitter/fetch-published-artifacts.js +2 -16
- package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
- package/bundle-emitter/publication-outcome.d.ts +0 -3
- package/bundle-emitter/publication-outcome.d.ts.map +1 -1
- package/bundle-emitter/publication-outcome.js +0 -5
- package/bundle-emitter/publication-outcome.js.map +1 -1
- package/bundle-emitter/publish-error/auto-mode-error-matching.js +2 -28
- package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/error-shape-helpers.js +0 -9
- package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
- package/bundle-emitter/publish-error/file-mode-error-matching.js +2 -33
- package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
- package/bundle-emitter/publish-error/publish-error-messages.js +0 -24
- package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
- package/bundle-emitter/registry/metadata-auth-retry.js +1 -24
- package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
- package/bundle-emitter/registry/oidc-token-exchange.js +3 -68
- package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts +0 -13
- package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -1
- package/bundle-emitter/registry/package-metadata-fetcher.js +7 -186
- package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
- package/bundle-emitter/registry/publish-settings-bridge.js +3 -34
- package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
- package/bundle-emitter/registry/registry-auth-config.js +0 -106
- package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
- package/bundle-emitter/registry/registry-client.d.ts +1 -13
- package/bundle-emitter/registry/registry-client.d.ts.map +1 -1
- package/bundle-emitter/registry/registry-client.js +4 -71
- package/bundle-emitter/registry/registry-client.js.map +1 -1
- package/bundle-emitter/registry/registry-package-path.js +0 -3
- package/bundle-emitter/registry/registry-package-path.js.map +1 -1
- package/bundle-emitter/registry/registry-response-schemas.js +2 -50
- package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.d.ts +0 -1
- package/bundle-emitter/registry/tarball-integrity.d.ts.map +1 -1
- package/bundle-emitter/registry/tarball-integrity.js +1 -31
- package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
- package/bundle-emitter/registry/validate-tarball-host.js +1 -26
- package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
- package/bundle-emitter/release-artifact-canonicalizer.js +5 -31
- package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
- package/checks/check-runner.js +0 -8
- package/checks/check-runner.js.map +1 -1
- package/checks/rule.js +2 -12
- package/checks/rule.js.map +1 -1
- package/checks/rules/duplicate-detection.js +1 -23
- package/checks/rules/duplicate-detection.js.map +1 -1
- package/checks/rules/duplicate-messages.js +0 -22
- package/checks/rules/duplicate-messages.js.map +1 -1
- package/checks/rules/file-ownership.js +0 -15
- package/checks/rules/file-ownership.js.map +1 -1
- package/checks/rules/max-bundle-size.js +1 -55
- package/checks/rules/max-bundle-size.js.map +1 -1
- package/checks/rules/no-dev-dependency-imports.js +1 -51
- package/checks/rules/no-dev-dependency-imports.js.map +1 -1
- package/checks/rules/no-duplicated-files.js +3 -53
- package/checks/rules/no-duplicated-files.js.map +1 -1
- package/checks/rules/no-side-effects.js +1 -50
- package/checks/rules/no-side-effects.js.map +1 -1
- package/checks/rules/no-unexposed-executables.js +2 -43
- package/checks/rules/no-unexposed-executables.js.map +1 -1
- package/checks/rules/no-unused-bundle-dependencies.js +2 -30
- package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
- package/checks/rules/registry.js +9 -22
- package/checks/rules/registry.js.map +1 -1
- package/checks/rules/required-files.js +3 -41
- package/checks/rules/required-files.js.map +1 -1
- package/checks/rules/type-script-declaration-integrity.js +3 -81
- package/checks/rules/type-script-declaration-integrity.js.map +1 -1
- package/checks/rules/type-script-declaration-paths.js +1 -55
- package/checks/rules/type-script-declaration-paths.js.map +1 -1
- package/checks/rules/type-script-declaration-project.js +3 -202
- package/checks/rules/type-script-declaration-project.js.map +1 -1
- package/checks/rules/type-script-declaration-reachability.js +2 -38
- package/checks/rules/type-script-declaration-reachability.js.map +1 -1
- package/checks/rules/type-script-declaration-roots.js +0 -29
- package/checks/rules/type-script-declaration-roots.js.map +1 -1
- package/checks/rules/type-script-integrity.js +2 -72
- package/checks/rules/type-script-integrity.js.map +1 -1
- package/checks/rules/type-script-package-resolution.js +1 -42
- package/checks/rules/type-script-package-resolution.js.map +1 -1
- package/checks/rules/type-script-resolution-summary.js +0 -53
- package/checks/rules/type-script-resolution-summary.js.map +1 -1
- package/checks/rules/unique-target-paths.js +2 -34
- package/checks/rules/unique-target-paths.js.map +1 -1
- package/common/bundled-dependency-groups.js +0 -27
- package/common/bundled-dependency-groups.js.map +1 -1
- package/common/code-files.js +0 -28
- package/common/code-files.js.map +1 -1
- package/common/declaration-companion-paths.js +0 -24
- package/common/declaration-companion-paths.js.map +1 -1
- package/common/package-name-map.js +0 -7
- package/common/package-name-map.js.map +1 -1
- package/common/stable-json.js +2 -42
- package/common/stable-json.js.map +1 -1
- package/common/worklist.js +0 -22
- package/common/worklist.js.map +1 -1
- package/config/additional-files.js +2 -6
- package/config/additional-files.js.map +1 -1
- package/config/additional-package-json-attributes-schema.js +2 -6
- package/config/additional-package-json-attributes-schema.js.map +1 -1
- package/config/automatic-versioning-settings.js +2 -6
- package/config/automatic-versioning-settings.js.map +1 -1
- package/config/changelog-settings.d.ts +0 -44
- package/config/changelog-settings.d.ts.map +1 -1
- package/config/changelog-settings.js +3 -120
- package/config/changelog-settings.js.map +1 -1
- package/config/common-package-settings-schemas.js +3 -19
- package/config/common-package-settings-schemas.js.map +1 -1
- package/config/config.d.ts +1 -6
- package/config/config.d.ts.map +1 -1
- package/config/config.js +1 -3
- package/config/config.js.map +1 -1
- package/config/cross-package-validation.js +0 -17
- package/config/cross-package-validation.js.map +1 -1
- package/config/dead-code-elimination-settings.d.ts +0 -1
- package/config/dead-code-elimination-settings.d.ts.map +1 -1
- package/config/dead-code-elimination-settings.js +2 -36
- package/config/dead-code-elimination-settings.js.map +1 -1
- package/config/dependency-existence-validation.js +1 -19
- package/config/dependency-existence-validation.js.map +1 -1
- package/config/dependency-policy.js +2 -5
- package/config/dependency-policy.js.map +1 -1
- package/config/main-package-json-schema.js +2 -13
- package/config/main-package-json-schema.js.map +1 -1
- package/config/manual-versioning-settings.d.ts +0 -12
- package/config/manual-versioning-settings.d.ts.map +1 -1
- package/config/manual-versioning-settings.js +2 -29
- package/config/manual-versioning-settings.js.map +1 -1
- package/config/optional-package-settings-schema.js +7 -16
- package/config/optional-package-settings-schema.js.map +1 -1
- package/config/package-config.d.ts +0 -4
- package/config/package-config.d.ts.map +1 -1
- package/config/package-config.js +1 -2
- package/config/package-config.js.map +1 -1
- package/config/package-graph-builder.js +2 -14
- package/config/package-graph-builder.js.map +1 -1
- package/config/package-interface.js +2 -25
- package/config/package-interface.js.map +1 -1
- package/config/package-json.d.ts +0 -2
- package/config/package-json.d.ts.map +1 -1
- package/config/package-json.js +0 -16
- package/config/package-json.js.map +1 -1
- package/config/packtory-config-without-registry-schema.js +0 -6
- package/config/packtory-config-without-registry-schema.js.map +1 -1
- package/config/per-package-settings-schema.js +6 -22
- package/config/per-package-settings-schema.js.map +1 -1
- package/config/pre-graph-validation.js +5 -20
- package/config/pre-graph-validation.js.map +1 -1
- package/config/publish-settings.d.ts +0 -3
- package/config/publish-settings.d.ts.map +1 -1
- package/config/publish-settings.js +3 -25
- package/config/publish-settings.js.map +1 -1
- package/config/publish-settings.report.js +1 -17
- package/config/publish-settings.report.js.map +1 -1
- package/config/registry-settings.d.ts +0 -41
- package/config/registry-settings.d.ts.map +1 -1
- package/config/registry-settings.js +2 -40
- package/config/registry-settings.js.map +1 -1
- package/config/registry-settings.report.js +0 -46
- package/config/registry-settings.report.js.map +1 -1
- package/config/root-config-validation.js +0 -141
- package/config/root-config-validation.js.map +1 -1
- package/config/root.js +2 -6
- package/config/root.js.map +1 -1
- package/config/sbom-settings.js +1 -4
- package/config/sbom-settings.js.map +1 -1
- package/config/settings-validation.js +0 -28
- package/config/settings-validation.js.map +1 -1
- package/config/versioning-settings.d.ts +1 -18
- package/config/versioning-settings.d.ts.map +1 -1
- package/config/versioning-settings.js +3 -10
- package/config/versioning-settings.js.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.d.ts +0 -11
- package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.js +0 -7
- package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
- package/dead-code-eliminator/class-purity.js +2 -48
- package/dead-code-eliminator/class-purity.js.map +1 -1
- package/dead-code-eliminator/code-file-analyzer.js +4 -62
- package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/bundle-index.js +1 -27
- package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +3 -18
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/import-export-walker.js +4 -75
- package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
- package/dead-code-eliminator/cross-bundle/seed-store.js +1 -22
- package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
- package/dead-code-eliminator/dependency-metadata.js +3 -205
- package/dead-code-eliminator/dependency-metadata.js.map +1 -1
- package/dead-code-eliminator/elimination-emitter.js +0 -52
- package/dead-code-eliminator/elimination-emitter.js.map +1 -1
- package/dead-code-eliminator/eliminator.js +8 -64
- package/dead-code-eliminator/eliminator.js.map +1 -1
- package/dead-code-eliminator/expression-unwrapping.js +1 -16
- package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
- package/dead-code-eliminator/imported-expression-origin.js +2 -101
- package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
- package/dead-code-eliminator/liveness/asset-side-effects.js +1 -9
- package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
- package/dead-code-eliminator/liveness/boolean-facts.js +2 -98
- package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
- package/dead-code-eliminator/liveness/external-module-resolution.js +2 -172
- package/dead-code-eliminator/liveness/external-module-resolution.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity-summary.js +3 -294
- package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
- package/dead-code-eliminator/liveness/external-purity.js +3 -39
- package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
- package/dead-code-eliminator/liveness/module-analysis.js +2 -27
- package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
- package/dead-code-eliminator/liveness/resource-retention.js +1 -78
- package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
- package/dead-code-eliminator/liveness/runtime-code.js +1 -15
- package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
- package/dead-code-eliminator/load-bundle.js +5 -70
- package/dead-code-eliminator/load-bundle.js.map +1 -1
- package/dead-code-eliminator/pure-expression.js +5 -178
- package/dead-code-eliminator/pure-expression.js.map +1 -1
- package/dead-code-eliminator/reachability/bfs-closure.js +0 -50
- package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-extractor.js +2 -100
- package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
- package/dead-code-eliminator/reachability/binding-id.js +0 -32
- package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
- package/dead-code-eliminator/reachability/identifier-target-collector.js +1 -39
- package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
- package/dead-code-eliminator/reachability/impure-statements.js +2 -11
- package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
- package/dead-code-eliminator/reachability/local-seed-gathering.js +4 -43
- package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
- package/dead-code-eliminator/reachability/reachability.js +4 -38
- package/dead-code-eliminator/reachability/reachability.js.map +1 -1
- package/dead-code-eliminator/side-effect-classifier.js +4 -39
- package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
- package/dead-code-eliminator/side-effects-field.js +1 -23
- package/dead-code-eliminator/side-effects-field.js.map +1 -1
- package/dead-code-eliminator/source-map-recomposition.js +2 -29
- package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
- package/dead-code-eliminator/statement-classifiers.js +4 -94
- package/dead-code-eliminator/statement-classifiers.js.map +1 -1
- package/dead-code-eliminator/syntax-kind-sets.js +0 -16
- package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.d.ts +0 -8
- package/dead-code-eliminator/transform/atom-translator.d.ts.map +1 -1
- package/dead-code-eliminator/transform/atom-translator.js +2 -57
- package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-removal.js +4 -135
- package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
- package/dead-code-eliminator/transform/declaration-remover.js +2 -17
- package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
- package/dead-code-eliminator/transform/line-index.d.ts +0 -7
- package/dead-code-eliminator/transform/line-index.d.ts.map +1 -1
- package/dead-code-eliminator/transform/line-index.js +0 -20
- package/dead-code-eliminator/transform/line-index.js.map +1 -1
- package/dead-code-eliminator/transform/named-declaration-kinds.js +0 -3
- package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
- package/dead-code-eliminator/transform/source-map-composer.js +3 -84
- package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
- package/dead-code-eliminator/variable-declaration-bindings.js +1 -25
- package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
- package/dependency-scanner/dependency-graph.js +3 -74
- package/dependency-scanner/dependency-graph.js.map +1 -1
- package/dependency-scanner/external-dependencies.d.ts +0 -9
- package/dependency-scanner/external-dependencies.d.ts.map +1 -1
- package/dependency-scanner/external-dependencies.js +1 -55
- package/dependency-scanner/external-dependencies.js.map +1 -1
- package/dependency-scanner/file-host-predicates.js +0 -9
- package/dependency-scanner/file-host-predicates.js.map +1 -1
- package/dependency-scanner/host-method-binding.js +0 -18
- package/dependency-scanner/host-method-binding.js.map +1 -1
- package/dependency-scanner/injected-dynamic-imports.js +1 -232
- package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
- package/dependency-scanner/node-modules-manifest-synthesizer.js +4 -52
- package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
- package/dependency-scanner/package-owned-asset-file-path.js +1 -9
- package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
- package/dependency-scanner/scanner.js +4 -102
- package/dependency-scanner/scanner.js.map +1 -1
- package/dependency-scanner/source-file-references.js +6 -174
- package/dependency-scanner/source-file-references.js.map +1 -1
- package/dependency-scanner/source-map-file-locator.js +2 -66
- package/dependency-scanner/source-map-file-locator.js.map +1 -1
- package/dependency-scanner/typescript-compiler-options.js +1 -21
- package/dependency-scanner/typescript-compiler-options.js.map +1 -1
- package/dependency-scanner/typescript-file-host.js +5 -49
- package/dependency-scanner/typescript-file-host.js.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.js +3 -35
- package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
- package/dependency-scanner/virtual-package-json-host.js +4 -45
- package/dependency-scanner/virtual-package-json-host.js.map +1 -1
- package/directed-graph/graph.d.ts +0 -1
- package/directed-graph/graph.d.ts.map +1 -1
- package/directed-graph/graph.js +1 -240
- package/directed-graph/graph.js.map +1 -1
- package/file-manager/compare.js +2 -23
- package/file-manager/compare.js.map +1 -1
- package/file-manager/equal.js +0 -5
- package/file-manager/equal.js.map +1 -1
- package/file-manager/file-description.d.ts +0 -1
- package/file-manager/file-description.d.ts.map +1 -1
- package/file-manager/file-description.js +0 -3
- package/file-manager/file-description.js.map +1 -1
- package/file-manager/permissions.js +1 -28
- package/file-manager/permissions.js.map +1 -1
- package/git/current-git-head.js +0 -24
- package/git/current-git-head.js.map +1 -1
- package/git/git-command.js +1 -49
- package/git/git-command.js.map +1 -1
- package/linker/linked-bundle.d.ts +0 -8
- package/linker/linked-bundle.d.ts.map +1 -1
- package/linker/linked-bundle.js +0 -5
- package/linker/linked-bundle.js.map +1 -1
- package/linker/linker.js +5 -51
- package/linker/linker.js.map +1 -1
- package/linker/replacement-lookup.js +8 -253
- package/linker/replacement-lookup.js.map +1 -1
- package/linker/resource-graph.js +2 -44
- package/linker/resource-graph.js.map +1 -1
- package/linker/source-modifier/import-paths.js +3 -76
- package/linker/source-modifier/import-paths.js.map +1 -1
- package/linker/substitute-bundles.js +3 -140
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +2 -99
- package/linker/substituted-resource-graph.js.map +1 -1
- package/npm-oidc-id-token-resolver.js +0 -82
- package/npm-oidc-id-token-resolver.js.map +1 -1
- package/pack-emitter/pack-emitter.d.ts +0 -20
- package/pack-emitter/pack-emitter.d.ts.map +1 -1
- package/pack-emitter/pack-emitter.js +0 -27
- package/pack-emitter/pack-emitter.js.map +1 -1
- package/package-surface/bin-field.js +2 -8
- package/package-surface/bin-field.js.map +1 -1
- package/package-surface/explicit-bin.js +2 -24
- package/package-surface/explicit-bin.js.map +1 -1
- package/package-surface/explicit-exports.js +3 -26
- package/package-surface/explicit-exports.js.map +1 -1
- package/package-surface/export-map.js +2 -9
- package/package-surface/export-map.js.map +1 -1
- package/package-surface/implicit-bin.js +1 -25
- package/package-surface/implicit-bin.js.map +1 -1
- package/package-surface/implicit-exports.js +3 -10
- package/package-surface/implicit-exports.js.map +1 -1
- package/package-surface/implicit-root-exports.js +2 -13
- package/package-surface/implicit-root-exports.js.map +1 -1
- package/package-surface/package-json-export.js +0 -9
- package/package-surface/package-json-export.js.map +1 -1
- package/package-surface/package-shape.js +1 -10
- package/package-surface/package-shape.js.map +1 -1
- package/package-surface/package-surface-index.js +3 -165
- package/package-surface/package-surface-index.js.map +1 -1
- package/package-surface/public-module-usage.js +3 -46
- package/package-surface/public-module-usage.js.map +1 -1
- package/package-surface/public-specifiers.js +1 -7
- package/package-surface/public-specifiers.js.map +1 -1
- package/package-surface/root-registry.js +0 -26
- package/package-surface/root-registry.js.map +1 -1
- package/package-surface/specifier-syntax.js +0 -4
- package/package-surface/specifier-syntax.js.map +1 -1
- package/package-surface/substitution-exports.js +3 -101
- package/package-surface/substitution-exports.js.map +1 -1
- package/package-surface/surface.d.ts +0 -2
- package/package-surface/surface.d.ts.map +1 -1
- package/package-surface/surface.js +0 -12
- package/package-surface/surface.js.map +1 -1
- package/package.json +2 -2
- package/packages/package-processor.composition.d.ts +0 -22
- package/packages/package-processor.composition.d.ts.map +1 -1
- package/packages/package-processor.composition.js +34 -160
- package/packages/package-processor.composition.js.map +1 -1
- package/packtory/map-config.d.ts +3 -22
- package/packtory/map-config.d.ts.map +1 -1
- package/packtory/map-config.js +4 -35
- package/packtory/map-config.js.map +1 -1
- package/packtory/normalize-paths.js +1 -25
- package/packtory/normalize-paths.js.map +1 -1
- package/packtory/options/bundle-dependency-resolution.js +1 -17
- package/packtory/options/bundle-dependency-resolution.js.map +1 -1
- package/packtory/options/dead-code-elimination-resolution.js +1 -10
- package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
- package/packtory/options/prepare-package-options.d.ts +0 -14
- package/packtory/options/prepare-package-options.d.ts.map +1 -1
- package/packtory/options/prepare-package-options.js +5 -46
- package/packtory/options/prepare-package-options.js.map +1 -1
- package/packtory/options/required-value-helpers.js +0 -17
- package/packtory/options/required-value-helpers.js.map +1 -1
- package/packtory/options/setting-resolvers.d.ts +0 -18
- package/packtory/options/setting-resolvers.d.ts.map +1 -1
- package/packtory/options/setting-resolvers.js +3 -47
- package/packtory/options/setting-resolvers.js.map +1 -1
- package/packtory/options/surface-resolution.js +2 -15
- package/packtory/options/surface-resolution.js.map +1 -1
- package/packtory/options/version-provider-context.js +2 -24
- package/packtory/options/version-provider-context.js.map +1 -1
- package/packtory/options/version-trigger.js +2 -39
- package/packtory/options/version-trigger.js.map +1 -1
- package/packtory/pack-output-preflight.js +3 -60
- package/packtory/pack-output-preflight.js.map +1 -1
- package/packtory/package-processor-build.js +3 -97
- package/packtory/package-processor-build.js.map +1 -1
- package/packtory/package-processor-publish.d.ts +0 -13
- package/packtory/package-processor-publish.d.ts.map +1 -1
- package/packtory/package-processor-publish.js +5 -293
- package/packtory/package-processor-publish.js.map +1 -1
- package/packtory/package-processor.d.ts +1 -34
- package/packtory/package-processor.d.ts.map +1 -1
- package/packtory/package-processor.js +2 -10
- package/packtory/package-processor.js.map +1 -1
- package/packtory/packtory-pack.js +10 -298
- package/packtory/packtory-pack.js.map +1 -1
- package/packtory/packtory-package-dependencies.js +7 -135
- package/packtory/packtory-package-dependencies.js.map +1 -1
- package/packtory/packtory-package-tree.js +4 -43
- package/packtory/packtory-package-tree.js.map +1 -1
- package/packtory/packtory-publish.js +4 -17
- package/packtory/packtory-publish.js.map +1 -1
- package/packtory/packtory-release-analysis.js +6 -64
- package/packtory/packtory-release-analysis.js.map +1 -1
- package/packtory/packtory-release-diff.js +5 -48
- package/packtory/packtory-release-diff.js.map +1 -1
- package/packtory/packtory-release-plan.js +6 -87
- package/packtory/packtory-release-plan.js.map +1 -1
- package/packtory/packtory-resolve.js +5 -16
- package/packtory/packtory-resolve.js.map +1 -1
- package/packtory/packtory.d.ts +1 -28
- package/packtory/packtory.d.ts.map +1 -1
- package/packtory/packtory.js +12 -225
- package/packtory/packtory.js.map +1 -1
- package/packtory/publish-failure-mapping.js +0 -6
- package/packtory/publish-failure-mapping.js.map +1 -1
- package/packtory/published-release-state.d.ts +0 -19
- package/packtory/published-release-state.d.ts.map +1 -1
- package/packtory/published-release-state.js +0 -11
- package/packtory/published-release-state.js.map +1 -1
- package/packtory/release-analysis.js +5 -153
- package/packtory/release-analysis.js.map +1 -1
- package/packtory/release-diff-failure-mapping.js +0 -6
- package/packtory/release-diff-failure-mapping.js.map +1 -1
- package/packtory/release-plan.js +7 -135
- package/packtory/release-plan.js.map +1 -1
- package/packtory/report-attachment.js +2 -35
- package/packtory/report-attachment.js.map +1 -1
- package/packtory/resolved-package.d.ts +0 -11
- package/packtory/resolved-package.d.ts.map +1 -1
- package/packtory/resolved-package.js +3 -97
- package/packtory/resolved-package.js.map +1 -1
- package/packtory/scheduler.d.ts +0 -47
- package/packtory/scheduler.d.ts.map +1 -1
- package/packtory/scheduler.js +1 -99
- package/packtory/scheduler.js.map +1 -1
- package/packtory/stages/package-analysis-stage.js +2 -50
- package/packtory/stages/package-analysis-stage.js.map +1 -1
- package/packtory/stages/package-resolution-stage.js +5 -77
- package/packtory/stages/package-resolution-stage.js.map +1 -1
- package/packtory/stages/publish-stage.js +3 -54
- package/packtory/stages/publish-stage.js.map +1 -1
- package/packtory/stages/release-diff-stage.js +5 -84
- package/packtory/stages/release-diff-stage.js.map +1 -1
- package/progress/progress-broadcaster.d.ts +0 -1
- package/progress/progress-broadcaster.d.ts.map +1 -1
- package/progress/progress-broadcaster.js +0 -45
- package/progress/progress-broadcaster.js.map +1 -1
- package/published-package/published-package.d.ts +0 -2
- package/published-package/published-package.d.ts.map +1 -1
- package/published-package/published-package.js +1 -12
- package/published-package/published-package.js.map +1 -1
- package/report/aggregator/artifact-entry-merger.js +0 -20
- package/report/aggregator/artifact-entry-merger.js.map +1 -1
- package/report/aggregator/package-report-materialization.js +2 -75
- package/report/aggregator/package-report-materialization.js.map +1 -1
- package/report/aggregator/report-aggregator.js +2 -37
- package/report/aggregator/report-aggregator.js.map +1 -1
- package/report/aggregator/report-event-handlers.js +2 -141
- package/report/aggregator/report-event-handlers.js.map +1 -1
- package/report/aggregator/report-types.d.ts +0 -21
- package/report/aggregator/report-types.d.ts.map +1 -1
- package/report/aggregator/report-types.js +0 -3
- package/report/aggregator/report-types.js.map +1 -1
- package/report/config-redactor.js +3 -29
- package/report/config-redactor.js.map +1 -1
- package/report/decorators.js +0 -76
- package/report/decorators.js.map +1 -1
- package/report/inspectors/inspect-artifact-sizes.js +1 -34
- package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
- package/report/inspectors/inspect-linker-rewrites.js +1 -14
- package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
- package/report/inspectors/inspect-package-json-provenance.js +0 -15
- package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
- package/report/inspectors/inspect-scan-results.js +0 -15
- package/report/inspectors/inspect-scan-results.js.map +1 -1
- package/report/release-diff/release-version-transition.js +0 -18
- package/report/release-diff/release-version-transition.js.map +1 -1
- package/resource-resolver/bundle-resource-lookup.js +0 -25
- package/resource-resolver/bundle-resource-lookup.js.map +1 -1
- package/resource-resolver/content.js +3 -81
- package/resource-resolver/content.js.map +1 -1
- package/resource-resolver/dependency-resolution-walker.js +2 -73
- package/resource-resolver/dependency-resolution-walker.js.map +1 -1
- package/resource-resolver/resolved-bundle.d.ts +0 -17
- package/resource-resolver/resolved-bundle.d.ts.map +1 -1
- package/resource-resolver/resolved-bundle.js +0 -3
- package/resource-resolver/resolved-bundle.js.map +1 -1
- package/resource-resolver/resource-resolve-options.d.ts +0 -5
- package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
- package/resource-resolver/resource-resolve-options.js +1 -13
- package/resource-resolver/resource-resolve-options.js.map +1 -1
- package/resource-resolver/resource-resolver.js +5 -83
- package/resource-resolver/resource-resolver.js.map +1 -1
- package/sbom/extract-license.js +1 -11
- package/sbom/extract-license.js.map +1 -1
- package/sbom/license-resolver.js +2 -23
- package/sbom/license-resolver.js.map +1 -1
- package/sbom/sbom-builder.js +2 -57
- package/sbom/sbom-builder.js.map +1 -1
- package/sbom/sbom-canonicalizer.js +3 -45
- package/sbom/sbom-canonicalizer.js.map +1 -1
- package/sbom/sbom-file.d.ts +0 -10
- package/sbom/sbom-file.d.ts.map +1 -1
- package/sbom/sbom-file.js +5 -54
- package/sbom/sbom-file.js.map +1 -1
- package/sbom/sbom-serializer.js +1 -14
- package/sbom/sbom-serializer.js.map +1 -1
- package/sbom/tool-version.js +1 -49
- package/sbom/tool-version.js.map +1 -1
- package/sbom.cdx.json +10 -10
- package/tar/extract-tar.js +3 -83
- package/tar/extract-tar.js.map +1 -1
- package/tar/gzipped-pack.js +0 -20
- package/tar/gzipped-pack.js.map +1 -1
- package/tar/tarball-builder.js +4 -44
- package/tar/tarball-builder.js.map +1 -1
- package/vendor-materializer/vendor-entry.js +1 -20
- package/vendor-materializer/vendor-entry.js.map +1 -1
- package/vendor-materializer/vendor-materializer.js +8 -240
- package/vendor-materializer/vendor-materializer.js.map +1 -1
- package/version-manager/dependencies/bundle-dependency-grouping.js +2 -32
- package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
- package/version-manager/dependencies/dependency-groups.js +1 -11
- package/version-manager/dependencies/dependency-groups.js.map +1 -1
- package/version-manager/dependencies/external-dependency-classification.js +3 -82
- package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
- package/version-manager/dependencies/versioned-bundle-dependencies.js +3 -8
- package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
- package/version-manager/imports/hash-import-scanner.js +2 -20
- package/version-manager/imports/hash-import-scanner.js.map +1 -1
- package/version-manager/imports/imports-key-matcher.js +0 -22
- package/version-manager/imports/imports-key-matcher.js.map +1 -1
- package/version-manager/imports/versioned-bundle-imports.js +2 -44
- package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
- package/version-manager/manager.d.ts +0 -5
- package/version-manager/manager.d.ts.map +1 -1
- package/version-manager/manager.js +6 -46
- package/version-manager/manager.js.map +1 -1
- package/version-manager/manifest/builder.js +1 -51
- package/version-manager/manifest/builder.js.map +1 -1
- package/version-manager/manifest/serialize.js +1 -8
- package/version-manager/manifest/serialize.js.map +1 -1
- package/version-manager/optional-bundle-fields.js +1 -5
- package/version-manager/optional-bundle-fields.js.map +1 -1
- package/version-manager/representative-root.js +1 -9
- package/version-manager/representative-root.js.map +1 -1
- package/version-manager/specifier-classifier.js +2 -42
- package/version-manager/specifier-classifier.js.map +1 -1
- package/version-manager/specifier-errors.js +0 -58
- package/version-manager/specifier-errors.js.map +1 -1
- package/version-manager/versioned-bundle.d.ts +1 -3
- package/version-manager/versioned-bundle.d.ts.map +1 -1
- package/version-manager/versioned-bundle.js +6 -31
- package/version-manager/versioned-bundle.js.map +1 -1
- package/zip/zip-builder.js +2 -81
- package/zip/zip-builder.js.map +1 -1
- package/artifacts/artifacts-builder.d.ts +0 -28
- package/artifacts/artifacts-builder.d.ts.map +0 -1
- package/bundle-emitter/registry/registry-auth-config.d.ts +0 -17
- package/bundle-emitter/registry/registry-auth-config.d.ts.map +0 -1
- package/checks/check-runner.d.ts +0 -18
- package/checks/check-runner.d.ts.map +0 -1
- package/checks/rule.d.ts +0 -42
- package/checks/rule.d.ts.map +0 -1
- package/checks/rules/max-bundle-size.d.ts +0 -13
- package/checks/rules/max-bundle-size.d.ts.map +0 -1
- package/checks/rules/no-dev-dependency-imports.d.ts +0 -11
- package/checks/rules/no-dev-dependency-imports.d.ts.map +0 -1
- package/checks/rules/no-duplicated-files.d.ts +0 -11
- package/checks/rules/no-duplicated-files.d.ts.map +0 -1
- package/checks/rules/no-side-effects.d.ts +0 -15
- package/checks/rules/no-side-effects.d.ts.map +0 -1
- package/checks/rules/no-unexposed-executables.d.ts +0 -8
- package/checks/rules/no-unexposed-executables.d.ts.map +0 -1
- package/checks/rules/no-unused-bundle-dependencies.d.ts +0 -8
- package/checks/rules/no-unused-bundle-dependencies.d.ts.map +0 -1
- package/checks/rules/registry.d.ts +0 -23
- package/checks/rules/registry.d.ts.map +0 -1
- package/checks/rules/required-files.d.ts +0 -15
- package/checks/rules/required-files.d.ts.map +0 -1
- package/checks/rules/type-script-declaration-integrity.d.ts +0 -9
- package/checks/rules/type-script-declaration-integrity.d.ts.map +0 -1
- package/checks/rules/type-script-declaration-project.d.ts +0 -29
- package/checks/rules/type-script-declaration-project.d.ts.map +0 -1
- package/checks/rules/type-script-integrity.d.ts +0 -24
- package/checks/rules/type-script-integrity.d.ts.map +0 -1
- package/checks/rules/type-script-package-resolution.d.ts +0 -29
- package/checks/rules/type-script-package-resolution.d.ts.map +0 -1
- package/checks/rules/unique-target-paths.d.ts +0 -8
- package/checks/rules/unique-target-paths.d.ts.map +0 -1
- package/dependency-scanner/dependency-graph.d.ts +0 -38
- package/dependency-scanner/dependency-graph.d.ts.map +0 -1
- package/dependency-scanner/scanner.d.ts +0 -20
- package/dependency-scanner/scanner.d.ts.map +0 -1
- package/dependency-scanner/source-file-references.d.ts +0 -30
- package/dependency-scanner/source-file-references.d.ts.map +0 -1
- package/dependency-scanner/source-map-file-locator.d.ts +0 -10
- package/dependency-scanner/source-map-file-locator.d.ts.map +0 -1
- package/dependency-scanner/typescript-compiler-options.d.ts +0 -8
- package/dependency-scanner/typescript-compiler-options.d.ts.map +0 -1
- package/dependency-scanner/typescript-file-host.d.ts +0 -12
- package/dependency-scanner/typescript-file-host.d.ts.map +0 -1
- package/dependency-scanner/typescript-project-analyzer.d.ts +0 -19
- package/dependency-scanner/typescript-project-analyzer.d.ts.map +0 -1
- package/git/current-git-head.d.ts +0 -12
- package/git/current-git-head.d.ts.map +0 -1
- package/linker/linker.d.ts +0 -13
- package/linker/linker.d.ts.map +0 -1
- package/resource-resolver/resource-resolver.d.ts +0 -15
- package/resource-resolver/resource-resolver.d.ts.map +0 -1
- package/sbom/license-resolver.d.ts +0 -14
- package/sbom/license-resolver.d.ts.map +0 -1
- package/sbom/sbom-serializer.d.ts +0 -8
- package/sbom/sbom-serializer.d.ts.map +0 -1
- package/tar/tarball-builder.d.ts +0 -14
- package/tar/tarball-builder.d.ts.map +0 -1
- package/vendor-materializer/vendor-entry.d.ts +0 -12
- package/vendor-materializer/vendor-entry.d.ts.map +0 -1
- package/vendor-materializer/vendor-materializer.d.ts +0 -55
- package/vendor-materializer/vendor-materializer.d.ts.map +0 -1
- package/zip/zip-builder.d.ts +0 -22
- package/zip/zip-builder.d.ts.map +0 -1
|
@@ -1,69 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
}
|
|
1
|
+
import "./registry-auth-config.js";
|
|
2
|
+
import "./registry-package-path.js";
|
|
3
|
+
import "./registry-response-schemas.js";
|
|
69
4
|
//# 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,OAQO,2BAA2B,CAAC;AACnC,OAAsC,4BAA4B,CAAC;AACnE,OAA0C,gCAAgC,CAAC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
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';
|
|
5
1
|
import { type TarballIntegrity } from './tarball-integrity.ts';
|
|
6
2
|
export type PackageVersionDetails = {
|
|
7
3
|
readonly version: string;
|
|
@@ -16,14 +12,5 @@ export type PackageReleaseMetadata = {
|
|
|
16
12
|
readonly version: string;
|
|
17
13
|
readonly gitHead: string | undefined;
|
|
18
14
|
};
|
|
19
|
-
type NpmFetchResponse = Awaited<ReturnType<typeof _npmFetch>>;
|
|
20
|
-
export type NpmFetch = {
|
|
21
|
-
(url: string, options?: NpmFetchOptions): Promise<NpmFetchResponse>;
|
|
22
|
-
readonly json: typeof _npmFetch.json;
|
|
23
|
-
};
|
|
24
|
-
export declare function fetchLatestPackageVersion(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<Maybe<PackageVersionDetails>>;
|
|
25
|
-
export declare function fetchLatestPackageReleaseMetadata(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<Maybe<PackageReleaseMetadata>>;
|
|
26
|
-
export declare function fetchStagedPackageVersions(npmFetch: NpmFetch, packageName: string, registrySettings: Readonly<RegistrySettings>): Promise<readonly string[]>;
|
|
27
|
-
export declare function fetchPackageTarball(npmFetch: NpmFetch, tarballUrl: string, tarballIntegrity: TarballIntegrity, registrySettings: Readonly<RegistrySettings>): Promise<Buffer>;
|
|
28
15
|
export {};
|
|
29
16
|
//# 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,OACO,OAgB+B,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAOvF,MAAM,MAAM,qBAAqB,GAAG;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;MAkGI,CAAiB,EAGtB,CAAC"}
|
|
@@ -1,187 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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 extractLatestVersionDetails(packageResponse, packageName) {
|
|
110
|
-
const latestVersion = packageResponse['dist-tags'].latest;
|
|
111
|
-
if (latestVersion === undefined) {
|
|
112
|
-
return Maybe.nothing();
|
|
113
|
-
}
|
|
114
|
-
const versionData = packageResponse.versions[latestVersion];
|
|
115
|
-
if (versionData === undefined) {
|
|
116
|
-
throw new Error(`Version "${latestVersion}" for package "${packageName}" has no entry in the registry response`);
|
|
117
|
-
}
|
|
118
|
-
return Maybe.just({
|
|
119
|
-
version: latestVersion,
|
|
120
|
-
tarballUrl: versionData.dist.tarball,
|
|
121
|
-
tarballIntegrity: readTarballIntegrity(versionData.dist, packageName, latestVersion),
|
|
122
|
-
gitHead: versionData.gitHead
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
export async function fetchLatestPackageVersion(npmFetch, packageName, registrySettings) {
|
|
126
|
-
const packageResponse = await fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, abbreviatedPackageMetadataRequest);
|
|
127
|
-
if (packageResponse.isNothing) {
|
|
128
|
-
return Maybe.nothing();
|
|
129
|
-
}
|
|
130
|
-
return extractLatestVersionDetails(packageResponse.value, packageName);
|
|
131
|
-
}
|
|
132
|
-
export async function fetchLatestPackageReleaseMetadata(npmFetch, packageName, registrySettings) {
|
|
133
|
-
const packageResponse = await fetchAndParsePackageMetadata(npmFetch, packageName, registrySettings, fullPackageMetadataRequest);
|
|
134
|
-
if (packageResponse.isNothing) {
|
|
135
|
-
return Maybe.nothing();
|
|
136
|
-
}
|
|
137
|
-
const latestVersion = extractLatestVersionDetails(packageResponse.value, packageName);
|
|
138
|
-
if (latestVersion.isNothing) {
|
|
139
|
-
return Maybe.nothing();
|
|
140
|
-
}
|
|
141
|
-
const publishedAtTimestamp = packageResponse.value.time?.[latestVersion.value.version];
|
|
142
|
-
return Maybe.just({
|
|
143
|
-
version: latestVersion.value.version,
|
|
144
|
-
tarballUrl: latestVersion.value.tarballUrl,
|
|
145
|
-
tarballIntegrity: latestVersion.value.tarballIntegrity,
|
|
146
|
-
publishedAt: publishedAtTimestamp === undefined ? undefined : parseTimestamp(publishedAtTimestamp),
|
|
147
|
-
gitHead: latestVersion.value.gitHead
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
async function fetchStagedPackageVersionPage(npmFetch, auth, packageName, page) {
|
|
151
|
-
const searchParams = new URLSearchParams({
|
|
152
|
-
package: packageName,
|
|
153
|
-
page: String(page),
|
|
154
|
-
perPage: String(stageListPageSize)
|
|
155
|
-
});
|
|
156
|
-
return parseStagedPackageListResponse(await npmFetch.json(`/-/stage?${searchParams.toString()}`, auth.options));
|
|
157
|
-
}
|
|
158
|
-
export async function fetchStagedPackageVersions(npmFetch, packageName, registrySettings) {
|
|
159
|
-
const auth = resolveStageListingAuthOptions(registrySettings);
|
|
160
|
-
const versions = [];
|
|
161
|
-
const pages = Array.from({ length: maximumStageListPages }, function (_value, index) {
|
|
162
|
-
return index;
|
|
163
|
-
});
|
|
164
|
-
for (const page of pages) {
|
|
165
|
-
const response = await fetchStagedPackageVersionPage(npmFetch, auth, packageName, page);
|
|
166
|
-
versions.push(...response.items.map(function (item) {
|
|
167
|
-
return item.version;
|
|
168
|
-
}));
|
|
169
|
-
if (versions.length >= response.total || response.items.length === 0) {
|
|
170
|
-
return versions;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
throw new Error(`Staged package listing exceeded ${maximumStageListPages} pages`);
|
|
174
|
-
}
|
|
175
|
-
export async function fetchPackageTarball(npmFetch, tarballUrl, tarballIntegrity, registrySettings) {
|
|
176
|
-
assertTarballOriginMatchesRegistry(tarballUrl, registrySettings);
|
|
177
|
-
const auth = resolveMetadataAuthOptions(registrySettings);
|
|
178
|
-
const response = await retryWithFallbackAuth(registrySettings, auth, async function (options) {
|
|
179
|
-
return npmFetch(tarballUrl, options);
|
|
180
|
-
});
|
|
181
|
-
assertContentLengthWithinDownloadLimit(response);
|
|
182
|
-
const tarball = await response.buffer();
|
|
183
|
-
assertDownloadedTarballSize(tarball.length);
|
|
184
|
-
assertTarballIntegrity(tarball, tarballIntegrity);
|
|
185
|
-
return tarball;
|
|
186
|
-
}
|
|
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";
|
|
187
8
|
//# 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,OAAsB,WAAW,CAAC;AAElC,OAAsC,0BAA0B,CAAC;AACjE,OAAsC,4BAA4B,CAAC;AACnE,OAKO,2BAA2B,CAAC;AACnC,OAKO,gCAAgC,CAAC;AACxC,OAA8D,wBAAwB,CAAC;AACvF,OAAmD,4BAA4B,CAAC"}
|
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
}
|
|
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";
|
|
35
4
|
//# 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,OAAmC,8CAA8C,CAAC;AAClF,OAA4B,yCAAyC,CAAC;AACtE,OAAmC,8CAA8C,CAAC"}
|
|
@@ -1,107 +1 @@
|
|
|
1
|
-
export const npmRegistryUrl = 'https://registry.npmjs.org/';
|
|
2
|
-
function isSplitRegistryAuth(auth) {
|
|
3
|
-
return Object.hasOwn(auth, 'publish');
|
|
4
|
-
}
|
|
5
|
-
export 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
|
-
}
|
|
107
1
|
//# 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":""}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type _npmFetch from 'npm-registry-fetch';
|
|
2
1
|
import type { Maybe } from 'true-myth';
|
|
3
|
-
import type { Clock } from '../../common/clock.ts';
|
|
4
2
|
import type { PublishSettings } from '../../config/publish-settings.ts';
|
|
5
|
-
import type {
|
|
3
|
+
import type { RegistrySettings } from '../../config/registry-settings.ts';
|
|
6
4
|
import { type PublicationOutcome } from '../publication-outcome.ts';
|
|
7
5
|
import { type PackageReleaseMetadata, type PackageVersionDetails } from './package-metadata-fetcher.ts';
|
|
8
6
|
import type { TarballIntegrity } from './tarball-integrity.ts';
|
|
@@ -10,7 +8,6 @@ type PublishManifest = Readonly<Record<string, unknown>> & {
|
|
|
10
8
|
readonly name: string;
|
|
11
9
|
readonly version: string;
|
|
12
10
|
};
|
|
13
|
-
type PublishLibraryOptions = Readonly<Record<string, unknown>>;
|
|
14
11
|
type PublishPackageArguments = readonly [
|
|
15
12
|
manifest: PublishManifest,
|
|
16
13
|
tarData: Buffer,
|
|
@@ -18,14 +15,6 @@ type PublishPackageArguments = readonly [
|
|
|
18
15
|
publishSettings: PublishSettings,
|
|
19
16
|
stage: boolean
|
|
20
17
|
];
|
|
21
|
-
export type RegistryClientDependencies = {
|
|
22
|
-
readonly npmFetch: typeof _npmFetch;
|
|
23
|
-
readonly publish: (manifest: PublishManifest, tarData: Buffer, options?: PublishLibraryOptions) => Promise<unknown>;
|
|
24
|
-
readonly fetch: typeof globalThis.fetch;
|
|
25
|
-
readonly clock: Clock;
|
|
26
|
-
readonly resolveIdToken: (auth: NpmOidcPublishAuth) => Promise<string>;
|
|
27
|
-
readonly promptForOneTimePassword?: (() => Promise<string | undefined>) | undefined;
|
|
28
|
-
};
|
|
29
18
|
export type RegistryClient = {
|
|
30
19
|
fetchLatestReleaseMetadata: (packageName: string, config: RegistrySettings) => Promise<Maybe<PackageReleaseMetadata>>;
|
|
31
20
|
fetchLatestVersion: (packageName: string, config: RegistrySettings) => Promise<Maybe<PackageVersionDetails>>;
|
|
@@ -33,6 +22,5 @@ export type RegistryClient = {
|
|
|
33
22
|
publishPackage: (...publishArguments: PublishPackageArguments) => Promise<PublicationOutcome>;
|
|
34
23
|
fetchTarball: (tarballUrl: string, tarballIntegrity: TarballIntegrity, config: RegistrySettings) => Promise<Buffer>;
|
|
35
24
|
};
|
|
36
|
-
export declare function createRegistryClient(dependencies: Readonly<RegistryClientDependencies>): RegistryClient;
|
|
37
25
|
export {};
|
|
38
26
|
//# sourceMappingURL=registry-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-client.ts"],"names":[],"mappings":"AAAA,OAAO,KACK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EACE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,EAA0C,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE5G,OAAO,EAKH,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,KAAK,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,CAAC;AACF,KAAK,OAQA,gBAAuB,GAAG,SAAS;IACpC,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,gBAAgB;IACxB,eAAe,EAAE,eAAe;IAChC,KAAK,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,MAAM,cAA0B,GAAG;eAS7B,eACkB,EAAE,CACxB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,KACvB,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC5C,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC7G,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IACnG,cAAc,EAAE,CAAC,GAAG,gBAAgB,EAAE,uBAAuB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9F,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvH,CAAC;AA2CF"}
|
|
@@ -1,72 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
function isStageIdRecord(response) {
|
|
6
|
-
return (typeof response === 'object' &&
|
|
7
|
-
response !== null &&
|
|
8
|
-
Object.hasOwn(response, 'stageId'));
|
|
9
|
-
}
|
|
10
|
-
function hasStageId(response) {
|
|
11
|
-
return isStageIdRecord(response) && typeof response.stageId === 'string' && response.stageId.length > 0;
|
|
12
|
-
}
|
|
13
|
-
function readStageId(response) {
|
|
14
|
-
if (!hasStageId(response)) {
|
|
15
|
-
throw new Error('npm staged publish succeeded without returning a stage ID');
|
|
16
|
-
}
|
|
17
|
-
return response.stageId;
|
|
18
|
-
}
|
|
19
|
-
async function readPublishedPublicationOutcome(publishPromise) {
|
|
20
|
-
await publishPromise;
|
|
21
|
-
return publishedToRegistry;
|
|
22
|
-
}
|
|
23
|
-
async function readStagedPublicationOutcome(publishPromise) {
|
|
24
|
-
return stagedForApproval(readStageId(await publishPromise));
|
|
25
|
-
}
|
|
26
|
-
async function readPublicationOutcome(publishPromise, readOutcome, publishSettings) {
|
|
27
|
-
try {
|
|
28
|
-
return await readOutcome(publishPromise);
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
throw remapPublishError(error, publishSettings);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function createRegistryClient(dependencies) {
|
|
35
|
-
const { npmFetch, publish, fetch: fetchImplementation, clock, promptForOneTimePassword, resolveIdToken } = dependencies;
|
|
36
|
-
const oidcExchanger = createOidcTokenExchanger({ fetch: fetchImplementation, clock, resolveIdToken });
|
|
37
|
-
return {
|
|
38
|
-
async fetchTarball(tarballUrl, tarballIntegrity, registrySettings) {
|
|
39
|
-
return fetchPackageTarball(npmFetch, tarballUrl, tarballIntegrity, registrySettings);
|
|
40
|
-
},
|
|
41
|
-
async publishPackage(...[manifest, tarData, registrySettings, publishSettings, stage]) {
|
|
42
|
-
const authOptions = await oidcExchanger.resolveWriteAuthOptions(manifest.name, registrySettings);
|
|
43
|
-
const publishOptionsFromSettings = buildPublishOptionsForPublishSettings(publishSettings);
|
|
44
|
-
const publishOptions = {
|
|
45
|
-
defaultTag: 'latest',
|
|
46
|
-
...authOptions,
|
|
47
|
-
...publishOptionsFromSettings,
|
|
48
|
-
...stage ? { stage: true } : {}
|
|
49
|
-
};
|
|
50
|
-
const publishOptionsWithOneTimePassword = {
|
|
51
|
-
...publishOptions,
|
|
52
|
-
otpPrompt: promptForOneTimePassword
|
|
53
|
-
};
|
|
54
|
-
const publishOptionsForOneTimePassword = promptForOneTimePassword === undefined
|
|
55
|
-
? publishOptions
|
|
56
|
-
: publishOptionsWithOneTimePassword;
|
|
57
|
-
const publishPromise = publish(manifest, tarData, publishOptionsForOneTimePassword);
|
|
58
|
-
const readOutcome = stage ? readStagedPublicationOutcome : readPublishedPublicationOutcome;
|
|
59
|
-
return readPublicationOutcome(publishPromise, readOutcome, publishSettings);
|
|
60
|
-
},
|
|
61
|
-
async fetchLatestVersion(packageName, registrySettings) {
|
|
62
|
-
return fetchLatestPackageVersion(npmFetch, packageName, registrySettings);
|
|
63
|
-
},
|
|
64
|
-
async fetchStagedVersions(packageName, registrySettings) {
|
|
65
|
-
return fetchStagedPackageVersions(npmFetch, packageName, registrySettings);
|
|
66
|
-
},
|
|
67
|
-
async fetchLatestReleaseMetadata(packageName, registrySettings) {
|
|
68
|
-
return fetchLatestPackageReleaseMetadata(npmFetch, packageName, registrySettings);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
1
|
+
import "../publication-outcome.js";
|
|
2
|
+
import "./oidc-token-exchange.js";
|
|
3
|
+
import "./package-metadata-fetcher.js";
|
|
4
|
+
import "./publish-settings-bridge.js";
|
|
72
5
|
//# sourceMappingURL=registry-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-client.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-client.ts"],"names":[],"mappings":"AAKA,OAAgF,2BAA2B,CAAC;AAC5G,OAAyC,0BAA0B,CAAC;AACpE,OAOO,+BAA+B,CAAC;AACvC,OAAyE,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-package-path.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-package-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-package-path.js","sourceRoot":"","sources":["../../../../../source/bundle-emitter/registry/registry-package-path.ts"],"names":[],"mappings":""}
|