packtory 0.0.8 → 0.0.10
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 +7 -5
- package/artifacts/artifacts-builder.d.ts.map +1 -1
- package/artifacts/artifacts-builder.js +1 -47
- package/artifacts/artifacts-builder.js.map +1 -1
- package/bundle-emitter/emitter.d.ts +12 -2
- package/bundle-emitter/emitter.d.ts.map +1 -1
- package/bundle-emitter/emitter.js +2 -31
- package/bundle-emitter/emitter.js.map +1 -1
- package/bundle-emitter/extract-package-tarball.js +0 -12
- package/bundle-emitter/extract-package-tarball.js.map +1 -1
- package/bundle-emitter/publish-settings-bridge.js +133 -0
- package/bundle-emitter/publish-settings-bridge.js.map +1 -0
- package/bundle-emitter/registry-client.d.ts +13 -6
- package/bundle-emitter/registry-client.d.ts.map +1 -1
- package/bundle-emitter/registry-client.js +1 -90
- package/bundle-emitter/registry-client.js.map +1 -1
- package/bundle-emitter/repository-coherence.js +54 -0
- package/bundle-emitter/repository-coherence.js.map +1 -0
- package/bundle-emitter/repository-url-normalizer.js +2 -0
- package/bundle-emitter/repository-url-normalizer.js.map +1 -0
- package/checks/check-runner.js +1 -12
- package/checks/check-runner.js.map +1 -1
- package/checks/rule.js +5 -0
- package/checks/rule.js.map +1 -0
- package/checks/rules/max-bundle-size.js +9 -0
- package/checks/rules/max-bundle-size.js.map +1 -0
- package/checks/rules/no-dev-dependency-imports.js +9 -0
- package/checks/rules/no-dev-dependency-imports.js.map +1 -0
- package/checks/rules/no-duplicated-files.js +6 -38
- package/checks/rules/no-duplicated-files.js.map +1 -1
- package/checks/rules/no-side-effects.js +9 -0
- package/checks/rules/no-side-effects.js.map +1 -0
- package/checks/rules/no-unused-bundle-dependencies.js +9 -0
- package/checks/rules/no-unused-bundle-dependencies.js.map +1 -0
- package/checks/rules/registry.js +8 -0
- package/checks/rules/registry.js.map +1 -0
- package/checks/rules/required-files.js +10 -0
- package/checks/rules/required-files.js.map +1 -0
- package/checks/rules/unique-target-paths.js +9 -0
- package/checks/rules/unique-target-paths.js.map +1 -0
- package/common/clock.d.ts +7 -0
- package/common/clock.d.ts.map +1 -0
- package/common/clock.js +11 -0
- package/common/clock.js.map +1 -0
- package/common/code-files.js +5 -0
- package/common/code-files.js.map +1 -0
- package/config/additional-files.js +0 -4
- package/config/additional-files.js.map +1 -1
- package/config/additional-package-json-attributes-schema.js +7 -0
- package/config/additional-package-json-attributes-schema.js.map +1 -0
- package/config/automatic-versioning-settings.js +3 -0
- package/config/automatic-versioning-settings.js.map +1 -0
- package/config/checks-schema.d.ts +74 -0
- package/config/checks-schema.d.ts.map +1 -0
- package/config/checks-schema.js +27 -0
- package/config/checks-schema.js.map +1 -0
- package/config/common-package-settings-schemas.js +20 -0
- package/config/common-package-settings-schemas.js.map +1 -0
- package/config/config.d.ts +16 -704
- package/config/config.d.ts.map +1 -1
- package/config/config.js +1 -71
- package/config/config.js.map +1 -1
- package/config/dead-code-elimination-settings.d.ts +12 -0
- package/config/dead-code-elimination-settings.d.ts.map +1 -0
- package/config/dead-code-elimination-settings.js +3 -0
- package/config/dead-code-elimination-settings.js.map +1 -0
- package/config/dependency-policy.d.ts +6 -0
- package/config/dependency-policy.d.ts.map +1 -0
- package/config/dependency-policy.js +3 -0
- package/config/dependency-policy.js.map +1 -0
- package/config/main-package-json-schema.js +13 -0
- package/config/main-package-json-schema.js.map +1 -0
- package/config/manual-versioning-settings.js +3 -0
- package/config/manual-versioning-settings.js.map +1 -0
- package/config/optional-package-settings-schema.js +15 -0
- package/config/optional-package-settings-schema.js.map +1 -0
- package/config/package-config.d.ts +49 -0
- package/config/package-config.d.ts.map +1 -0
- package/config/package-config.js +1 -0
- package/config/package-config.js.map +1 -0
- package/config/package-interface.d.ts +36 -0
- package/config/package-interface.d.ts.map +1 -0
- package/config/package-interface.js +3 -0
- package/config/package-interface.js.map +1 -0
- package/config/package-json.d.ts +10 -10
- package/config/package-json.d.ts.map +1 -1
- package/config/package-json.js +0 -24
- package/config/package-json.js.map +1 -1
- package/config/package-schemas.js +10 -0
- package/config/package-schemas.js.map +1 -0
- package/config/packtory-config-schema.js +4 -0
- package/config/packtory-config-schema.js.map +1 -0
- package/config/packtory-config-without-registry-schema.js +32 -0
- package/config/packtory-config-without-registry-schema.js.map +1 -0
- package/config/per-package-settings-schema.js +22 -0
- package/config/per-package-settings-schema.js.map +1 -0
- package/config/publish-settings.d.ts +22 -0
- package/config/publish-settings.d.ts.map +1 -0
- package/config/publish-settings.js +4 -0
- package/config/publish-settings.js.map +1 -0
- package/config/publish-settings.report.js +17 -0
- package/config/publish-settings.report.js.map +1 -0
- package/config/registry-settings.d.ts +63 -1
- package/config/registry-settings.d.ts.map +1 -1
- package/config/registry-settings.js +0 -4
- package/config/registry-settings.js.map +1 -1
- package/config/registry-settings.report.js +41 -0
- package/config/registry-settings.report.js.map +1 -0
- package/config/root.d.ts +7 -0
- package/config/root.d.ts.map +1 -0
- package/config/root.js +3 -0
- package/config/root.js.map +1 -0
- package/config/sbom-settings.js +2 -0
- package/config/sbom-settings.js.map +1 -0
- package/config/validation.d.ts +2 -2
- package/config/validation.d.ts.map +1 -1
- package/config/validation.js +4 -118
- package/config/validation.js.map +1 -1
- package/config/versioning-settings.d.ts.map +1 -1
- package/config/versioning-settings.js +2 -10
- package/config/versioning-settings.js.map +1 -1
- package/dead-code-eliminator/analyzed-bundle.d.ts +29 -0
- package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -0
- package/dead-code-eliminator/analyzed-bundle.js +1 -0
- package/dead-code-eliminator/analyzed-bundle.js.map +1 -0
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +126 -0
- package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -0
- package/dead-code-eliminator/elimination-emitter.js +53 -0
- package/dead-code-eliminator/elimination-emitter.js.map +1 -0
- package/dead-code-eliminator/eliminator.js +142 -0
- package/dead-code-eliminator/eliminator.js.map +1 -0
- package/dead-code-eliminator/load-bundle.js +53 -0
- package/dead-code-eliminator/load-bundle.js.map +1 -0
- package/dead-code-eliminator/reachability/binding-extractor.js +88 -0
- package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -0
- package/dead-code-eliminator/reachability/impure-statements.js +12 -0
- package/dead-code-eliminator/reachability/impure-statements.js.map +1 -0
- package/dead-code-eliminator/reachability/reachability.js +141 -0
- package/dead-code-eliminator/reachability/reachability.js.map +1 -0
- package/dead-code-eliminator/side-effect-classifier.js +406 -0
- package/dead-code-eliminator/side-effect-classifier.js.map +1 -0
- package/dead-code-eliminator/side-effects-field.js +25 -0
- package/dead-code-eliminator/side-effects-field.js.map +1 -0
- package/dead-code-eliminator/transform/atom-translator.js +13 -0
- package/dead-code-eliminator/transform/atom-translator.js.map +1 -0
- package/dead-code-eliminator/transform/declaration-remover.js +92 -0
- package/dead-code-eliminator/transform/declaration-remover.js.map +1 -0
- package/dead-code-eliminator/transform/line-index.js +27 -0
- package/dead-code-eliminator/transform/line-index.js.map +1 -0
- package/dead-code-eliminator/transform/source-map-composer.js +68 -0
- package/dead-code-eliminator/transform/source-map-composer.js.map +1 -0
- package/dependency-scanner/dependency-graph.d.ts +1 -3
- package/dependency-scanner/dependency-graph.d.ts.map +1 -1
- package/dependency-scanner/dependency-graph.js +1 -76
- package/dependency-scanner/dependency-graph.js.map +1 -1
- package/dependency-scanner/external-dependencies.d.ts +0 -1
- package/dependency-scanner/external-dependencies.d.ts.map +1 -1
- package/dependency-scanner/external-dependencies.js +1 -17
- package/dependency-scanner/external-dependencies.js.map +1 -1
- package/dependency-scanner/scanner.d.ts +7 -7
- package/dependency-scanner/scanner.d.ts.map +1 -1
- package/dependency-scanner/scanner.js +1 -75
- package/dependency-scanner/scanner.js.map +1 -1
- package/dependency-scanner/source-file-references.js +2 -73
- package/dependency-scanner/source-file-references.js.map +1 -1
- package/dependency-scanner/source-map-file-locator.d.ts.map +1 -1
- package/dependency-scanner/source-map-file-locator.js +0 -20
- package/dependency-scanner/source-map-file-locator.js.map +1 -1
- package/dependency-scanner/typescript-file-host.d.ts +2 -0
- package/dependency-scanner/typescript-file-host.d.ts.map +1 -1
- package/dependency-scanner/typescript-file-host.js +1 -48
- package/dependency-scanner/typescript-file-host.js.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.d.ts +4 -6
- package/dependency-scanner/typescript-project-analyzer.d.ts.map +1 -1
- package/dependency-scanner/typescript-project-analyzer.js +0 -64
- package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
- package/directed-graph/graph.d.ts +1 -2
- package/directed-graph/graph.d.ts.map +1 -1
- package/directed-graph/graph.js +0 -194
- package/directed-graph/graph.js.map +1 -1
- package/file-manager/compare.js +1 -16
- 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-manager.d.ts +1 -1
- package/file-manager/file-manager.d.ts.map +1 -1
- package/file-manager/file-manager.js +0 -46
- package/file-manager/file-manager.js.map +1 -1
- package/file-manager/permissions.js +0 -12
- package/file-manager/permissions.js.map +1 -1
- package/linker/linked-bundle.d.ts +5 -3
- package/linker/linked-bundle.d.ts.map +1 -1
- package/linker/linker.d.ts.map +1 -1
- package/linker/linker.js +0 -22
- package/linker/linker.js.map +1 -1
- package/linker/resource-graph.js +1 -29
- package/linker/resource-graph.js.map +1 -1
- package/linker/source-modifier/import-paths.js +0 -33
- package/linker/source-modifier/import-paths.js.map +1 -1
- package/linker/substitute-bundles.js +1 -73
- package/linker/substitute-bundles.js.map +1 -1
- package/linker/substituted-resource-graph.js +1 -76
- package/linker/substituted-resource-graph.js.map +1 -1
- package/npm-oidc-id-token-resolver.js +56 -0
- package/npm-oidc-id-token-resolver.js.map +1 -0
- package/package-surface/modules.js +89 -0
- package/package-surface/modules.js.map +1 -0
- package/package-surface/public-module-usage.js +37 -0
- package/package-surface/public-module-usage.js.map +1 -0
- package/package-surface/surface.d.ts +12 -0
- package/package-surface/surface.d.ts.map +1 -0
- package/package-surface/surface.js +1 -0
- package/package-surface/surface.js.map +1 -0
- package/package.json +53 -11
- package/packages/package-processor.composition.js +127 -0
- package/packages/package-processor.composition.js.map +1 -0
- package/packages/packtory/packtory.entry-point.d.ts +10 -5
- package/packages/packtory/packtory.entry-point.d.ts.map +1 -1
- package/packages/packtory/packtory.entry-point.js +7 -43
- package/packages/packtory/packtory.entry-point.js.map +1 -1
- package/packtory/map-config.d.ts +7 -16
- package/packtory/map-config.d.ts.map +1 -1
- package/packtory/map-config.js +1 -70
- package/packtory/map-config.js.map +1 -1
- package/packtory/normalize-paths.js +0 -24
- package/packtory/normalize-paths.js.map +1 -1
- package/packtory/package-processor-build.js +3 -0
- package/packtory/package-processor-build.js.map +1 -0
- package/packtory/package-processor-publish.d.ts +18 -0
- package/packtory/package-processor-publish.d.ts.map +1 -0
- package/packtory/package-processor-publish.js +1 -0
- package/packtory/package-processor-publish.js.map +1 -0
- package/packtory/package-processor.d.ts +17 -21
- package/packtory/package-processor.d.ts.map +1 -1
- package/packtory/package-processor.js +2 -85
- package/packtory/package-processor.js.map +1 -1
- package/packtory/packtory-publish.js +66 -0
- package/packtory/packtory-publish.js.map +1 -0
- package/packtory/packtory-resolve.js +84 -0
- package/packtory/packtory-resolve.js.map +1 -0
- package/packtory/packtory-results.d.ts +47 -0
- package/packtory/packtory-results.d.ts.map +1 -0
- package/packtory/packtory-results.js +1 -0
- package/packtory/packtory-results.js.map +1 -0
- package/packtory/packtory.d.ts +16 -37
- package/packtory/packtory.d.ts.map +1 -1
- package/packtory/packtory.js +33 -114
- package/packtory/packtory.js.map +1 -1
- package/packtory/prepare-package-options.d.ts +16 -0
- package/packtory/prepare-package-options.d.ts.map +1 -0
- package/packtory/prepare-package-options.js +5 -0
- package/packtory/prepare-package-options.js.map +1 -0
- package/packtory/report-attachment.js +25 -0
- package/packtory/report-attachment.js.map +1 -0
- package/packtory/resolved-package.d.ts +17 -0
- package/packtory/resolved-package.d.ts.map +1 -0
- package/packtory/resolved-package.js +4 -0
- package/packtory/resolved-package.js.map +1 -0
- package/packtory/scheduler.d.ts.map +1 -1
- package/packtory/scheduler.js +17 -15
- package/packtory/scheduler.js.map +1 -1
- package/progress/progress-broadcaster.d.ts +128 -5
- package/progress/progress-broadcaster.d.ts.map +1 -1
- package/progress/progress-broadcaster.js +0 -16
- package/progress/progress-broadcaster.js.map +1 -1
- package/report/artifact-entry-merger.js +2 -0
- package/report/artifact-entry-merger.js.map +1 -0
- package/report/config-redactor.js +27 -0
- package/report/config-redactor.js.map +1 -0
- package/report/decorators.js +68 -0
- package/report/decorators.js.map +1 -0
- package/report/inspectors.js +1 -0
- package/report/inspectors.js.map +1 -0
- package/report/report-aggregator.d.ts +61 -0
- package/report/report-aggregator.d.ts.map +1 -0
- package/report/report-aggregator.js +2 -0
- package/report/report-aggregator.js.map +1 -0
- package/resource-resolver/content.js +1 -40
- package/resource-resolver/content.js.map +1 -1
- package/resource-resolver/resolved-bundle.d.ts +4 -2
- package/resource-resolver/resolved-bundle.d.ts.map +1 -1
- package/resource-resolver/resource-resolve-options.d.ts +12 -5
- package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
- package/resource-resolver/resource-resolve-options.js +2 -0
- package/resource-resolver/resource-resolve-options.js.map +1 -0
- package/resource-resolver/resource-resolver.d.ts +1 -1
- package/resource-resolver/resource-resolver.d.ts.map +1 -1
- package/resource-resolver/resource-resolver.js +1 -64
- package/resource-resolver/resource-resolver.js.map +1 -1
- package/sbom/extract-license.js +2 -0
- package/sbom/extract-license.js.map +1 -0
- package/sbom/license-resolver.d.ts +14 -0
- package/sbom/license-resolver.d.ts.map +1 -0
- package/sbom/license-resolver.js +3 -0
- package/sbom/license-resolver.js.map +1 -0
- package/sbom/sbom-builder.js +68 -0
- package/sbom/sbom-builder.js.map +1 -0
- package/sbom/sbom-file.d.ts +19 -0
- package/sbom/sbom-file.d.ts.map +1 -0
- package/sbom/sbom-file.js +3 -0
- package/sbom/sbom-file.js.map +1 -0
- package/sbom/sbom-serializer.d.ts +6 -0
- package/sbom/sbom-serializer.d.ts.map +1 -0
- package/sbom/sbom-serializer.js +2 -0
- package/sbom/sbom-serializer.js.map +1 -0
- package/sbom/tool-version.js +44 -0
- package/sbom/tool-version.js.map +1 -0
- package/sbom.cdx.json +390 -0
- package/tar/extract-tar.js +0 -13
- package/tar/extract-tar.js.map +1 -1
- package/tar/tarball-builder.d.ts.map +1 -1
- package/tar/tarball-builder.js +10 -7
- package/tar/tarball-builder.js.map +1 -1
- package/version-manager/manager.d.ts +5 -1
- package/version-manager/manager.d.ts.map +1 -1
- package/version-manager/manager.js +1 -39
- package/version-manager/manager.js.map +1 -1
- package/version-manager/manifest/builder.js +2 -12
- package/version-manager/manifest/builder.js.map +1 -1
- package/version-manager/manifest/serialize.js +1 -55
- package/version-manager/manifest/serialize.js.map +1 -1
- package/version-manager/manifest/sort-values.js +1 -0
- package/version-manager/manifest/sort-values.js.map +1 -0
- package/version-manager/specifier-classifier.js +2 -0
- package/version-manager/specifier-classifier.js.map +1 -0
- package/version-manager/specifier-errors.js +1 -0
- package/version-manager/specifier-errors.js.map +1 -0
- package/version-manager/versioned-bundle-dependencies.js +5 -0
- package/version-manager/versioned-bundle-dependencies.js.map +1 -0
- package/version-manager/versioned-bundle-imports.d.ts +4 -0
- package/version-manager/versioned-bundle-imports.d.ts.map +1 -0
- package/version-manager/versioned-bundle-imports.js +3 -0
- package/version-manager/versioned-bundle-imports.js.map +1 -0
- package/version-manager/versioned-bundle.d.ts +16 -9
- package/version-manager/versioned-bundle.d.ts.map +1 -1
- package/version-manager/versioned-bundle.js +4 -78
- package/version-manager/versioned-bundle.js.map +1 -1
- package/config/entry-point.d.ts +0 -7
- package/config/entry-point.d.ts.map +0 -1
- package/config/entry-point.js +0 -7
- package/config/entry-point.js.map +0 -1
- package/file-manager/sort.js +0 -13
- package/file-manager/sort.js.map +0 -1
- package/list/unique-list.js +0 -5
- package/list/unique-list.js.map +0 -1
- package/version-manager/manifest/builder.d.ts +0 -5
- package/version-manager/manifest/builder.d.ts.map +0 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import type { FileDescription } from '../file-manager/file-description.ts';
|
|
2
2
|
import type { FileManager } from '../file-manager/file-manager.ts';
|
|
3
|
+
import type { ProgressBroadcastProvider } from '../progress/progress-broadcaster.ts';
|
|
3
4
|
import type { VersionedBundleWithManifest } from '../version-manager/versioned-bundle.ts';
|
|
4
5
|
import type { TarballBuilder } from '../tar/tarball-builder.ts';
|
|
5
6
|
export type ArtifactsBuilderDependencies = {
|
|
6
7
|
readonly fileManager: FileManager;
|
|
7
8
|
readonly tarballBuilder: TarballBuilder;
|
|
9
|
+
readonly progressBroadcaster: ProgressBroadcastProvider;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
type TarballArtifact = {
|
|
10
12
|
readonly tarData: Buffer;
|
|
11
|
-
readonly shasum: string;
|
|
12
13
|
};
|
|
13
14
|
export type ArtifactsBuilder = {
|
|
14
|
-
collectContents: (bundle: VersionedBundleWithManifest, prefix?: string) => readonly FileDescription[];
|
|
15
|
-
buildTarball: (bundle: VersionedBundleWithManifest) => Promise<TarballArtifact>;
|
|
16
|
-
buildFolder: (bundle: VersionedBundleWithManifest, targetFolder: string) => Promise<void>;
|
|
15
|
+
collectContents: (bundle: VersionedBundleWithManifest, prefix?: string, extraFiles?: readonly FileDescription[]) => readonly FileDescription[];
|
|
16
|
+
buildTarball: (bundle: VersionedBundleWithManifest, extraFiles?: readonly FileDescription[]) => Promise<TarballArtifact>;
|
|
17
|
+
buildFolder: (bundle: VersionedBundleWithManifest, targetFolder: string, extraFiles?: readonly FileDescription[]) => Promise<void>;
|
|
17
18
|
};
|
|
18
19
|
export declare function createArtifactsBuilder(artifactsBuilderDependencies: ArtifactsBuilderDependencies): ArtifactsBuilder;
|
|
20
|
+
export {};
|
|
19
21
|
//# sourceMappingURL=artifacts-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts-builder.d.ts","sourceRoot":"","sources":["../../../../source/artifacts/artifacts-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"artifacts-builder.d.ts","sourceRoot":"","sources":["../../../../source/artifacts/artifacts-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,MAAM,4BAA4B,GAAG;IACvC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;CAC3D,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,eAAe,EAAE,CACb,MAAM,EAAE,2BAA2B,EACnC,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,KACtC,SAAS,eAAe,EAAE,CAAC;IAChC,YAAY,EAAE,CACV,MAAM,EAAE,2BAA2B,EACnC,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,KACtC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9B,WAAW,EAAE,CACT,MAAM,EAAE,2BAA2B,EACnC,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,KACtC,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,4BAA4B,EAAE,4BAA4B,GAAG,gBAAgB,CA4FnH"}
|
|
@@ -1,49 +1,3 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import
|
|
3
|
-
export function createArtifactsBuilder(artifactsBuilderDependencies) {
|
|
4
|
-
const { fileManager, tarballBuilder } = artifactsBuilderDependencies;
|
|
5
|
-
function collectContents(bundle, prefix) {
|
|
6
|
-
const artifactContents = [
|
|
7
|
-
{
|
|
8
|
-
...bundle.manifestFile,
|
|
9
|
-
filePath: prefix === undefined
|
|
10
|
-
? bundle.manifestFile.filePath
|
|
11
|
-
: path.join(prefix, bundle.manifestFile.filePath)
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
for (const entry of bundle.contents) {
|
|
15
|
-
const targetFilePath = prefix === undefined
|
|
16
|
-
? entry.fileDescription.targetFilePath
|
|
17
|
-
: path.join(prefix, entry.fileDescription.targetFilePath);
|
|
18
|
-
artifactContents.push({
|
|
19
|
-
filePath: targetFilePath,
|
|
20
|
-
content: entry.fileDescription.content,
|
|
21
|
-
isExecutable: entry.fileDescription.isExecutable
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return artifactContents;
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
collectContents,
|
|
28
|
-
async buildTarball(bundle) {
|
|
29
|
-
const contents = collectContents(bundle, 'package');
|
|
30
|
-
const tarData = await tarballBuilder.build(contents);
|
|
31
|
-
return {
|
|
32
|
-
shasum: ssri.fromData(tarData, { algorithms: ['sha1'] }).hexDigest(),
|
|
33
|
-
tarData
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
async buildFolder(bundle, targetFolder) {
|
|
37
|
-
const readability = await fileManager.checkReadability(targetFolder);
|
|
38
|
-
if (readability.isReadable) {
|
|
39
|
-
throw new Error(`Folder ${targetFolder} already exists`);
|
|
40
|
-
}
|
|
41
|
-
const contents = collectContents(bundle);
|
|
42
|
-
for (const entry of contents) {
|
|
43
|
-
const targetFilePath = path.join(targetFolder, entry.filePath);
|
|
44
|
-
await fileManager.writeFile(targetFilePath, entry.content);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
2
|
+
import { inspectArtifactSizes } from "../report/inspectors.js";
|
|
49
3
|
//# sourceMappingURL=artifacts-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts-builder.js","sourceRoot":"","sources":["../../../../source/artifacts/artifacts-builder.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"artifacts-builder.js","sourceRoot":"","sources":["../../../../source/artifacts/artifacts-builder.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW;AAI5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { Maybe } from 'true-myth';
|
|
2
2
|
import type { ArtifactsBuilder } from '../artifacts/artifacts-builder.ts';
|
|
3
|
+
import type { PublishSettings } from '../config/publish-settings.ts';
|
|
3
4
|
import type { RegistrySettings } from '../config/registry-settings.ts';
|
|
4
5
|
import type { VersioningSettings } from '../config/versioning-settings.ts';
|
|
6
|
+
import type { FileDescription } from '../file-manager/file-description.ts';
|
|
5
7
|
import type { VersionedBundleWithManifest } from '../version-manager/versioned-bundle.ts';
|
|
6
8
|
import type { RegistryClient } from './registry-client.ts';
|
|
7
9
|
export type BundleEmitterDependencies = {
|
|
8
10
|
readonly artifactsBuilder: ArtifactsBuilder;
|
|
9
11
|
readonly registryClient: RegistryClient;
|
|
12
|
+
readonly ciRepositoryUrl: string | undefined;
|
|
10
13
|
};
|
|
11
|
-
|
|
14
|
+
type PublishOptions = {
|
|
12
15
|
readonly bundle: VersionedBundleWithManifest;
|
|
13
16
|
readonly registrySettings: RegistrySettings;
|
|
17
|
+
readonly publishSettings: PublishSettings;
|
|
18
|
+
readonly extraFiles?: readonly FileDescription[];
|
|
19
|
+
};
|
|
20
|
+
type AlreadyPublishedCheckOptions = {
|
|
21
|
+
readonly bundle: VersionedBundleWithManifest;
|
|
22
|
+
readonly registrySettings: RegistrySettings;
|
|
23
|
+
readonly extraFiles?: readonly FileDescription[];
|
|
14
24
|
};
|
|
15
25
|
type CurrentVersionLookupOptions = {
|
|
16
26
|
readonly name: string;
|
|
@@ -23,7 +33,7 @@ type BundlePublishedCheckResult = {
|
|
|
23
33
|
export type BundleEmitter = {
|
|
24
34
|
publish: (options: PublishOptions) => Promise<void>;
|
|
25
35
|
determineCurrentVersion: (options: CurrentVersionLookupOptions) => Promise<Maybe<string>>;
|
|
26
|
-
checkBundleAlreadyPublished: (options:
|
|
36
|
+
checkBundleAlreadyPublished: (options: AlreadyPublishedCheckOptions) => Promise<BundlePublishedCheckResult>;
|
|
27
37
|
};
|
|
28
38
|
export declare function createBundleEmitter(dependencies: BundleEmitterDependencies): BundleEmitter;
|
|
29
39
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../../source/bundle-emitter/emitter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../../source/bundle-emitter/emitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAE1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,MAAM,yBAAyB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aAAa,CA8C1F"}
|
|
@@ -1,35 +1,6 @@
|
|
|
1
|
+
/* eslint-disable import/max-dependencies -- the publish/check flow legitimately depends on registry, artifacts, file-manager, and provenance helpers */
|
|
1
2
|
import { Maybe } from 'true-myth';
|
|
2
3
|
import { compareFileDescriptions } from "../file-manager/compare.js";
|
|
3
4
|
import { extractPackageTarball } from "./extract-package-tarball.js";
|
|
4
|
-
|
|
5
|
-
const { artifactsBuilder, registryClient } = dependencies;
|
|
6
|
-
return {
|
|
7
|
-
async determineCurrentVersion(options) {
|
|
8
|
-
const { versioning, registrySettings, name } = options;
|
|
9
|
-
if (versioning.automatic) {
|
|
10
|
-
const latestVersion = await registryClient.fetchLatestVersion(name, registrySettings);
|
|
11
|
-
return latestVersion.map((version) => {
|
|
12
|
-
return version.version;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
return Maybe.just(versioning.version);
|
|
16
|
-
},
|
|
17
|
-
async checkBundleAlreadyPublished(options) {
|
|
18
|
-
const { bundle, registrySettings } = options;
|
|
19
|
-
const latestVersion = await registryClient.fetchLatestVersion(bundle.name, registrySettings);
|
|
20
|
-
if (latestVersion.isNothing) {
|
|
21
|
-
return { alreadyPublishedAsLatest: false };
|
|
22
|
-
}
|
|
23
|
-
const artifactContents = artifactsBuilder.collectContents(bundle, 'package');
|
|
24
|
-
const tarball = await registryClient.fetchTarball(latestVersion.value.tarballUrl, latestVersion.value.shasum);
|
|
25
|
-
const latestVersionArtifactContents = await extractPackageTarball(tarball);
|
|
26
|
-
const result = compareFileDescriptions(artifactContents, latestVersionArtifactContents);
|
|
27
|
-
return { alreadyPublishedAsLatest: result.status === 'equal' };
|
|
28
|
-
},
|
|
29
|
-
async publish(options) {
|
|
30
|
-
const tarball = await artifactsBuilder.buildTarball(options.bundle);
|
|
31
|
-
await registryClient.publishPackage(options.bundle.packageJson, tarball.tarData, options.registrySettings);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
5
|
+
import { assertRepositoryCoherence } from "./repository-coherence.js";
|
|
35
6
|
//# sourceMappingURL=emitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/emitter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/emitter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW;AAMjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B;AAEpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
import { isExecutableFileMode } from "../file-manager/permissions.js";
|
|
2
2
|
import { extractTarEntries } from "../tar/extract-tar.js";
|
|
3
|
-
function tarEntryToFileDescription(tarEntry) {
|
|
4
|
-
const isExecutable = tarEntry.header.mode === undefined ? false : isExecutableFileMode(tarEntry.header.mode);
|
|
5
|
-
return {
|
|
6
|
-
filePath: tarEntry.header.name,
|
|
7
|
-
content: tarEntry.content,
|
|
8
|
-
isExecutable
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export async function extractPackageTarball(tarball) {
|
|
12
|
-
const tarEntries = await extractTarEntries(tarball);
|
|
13
|
-
return tarEntries.map(tarEntryToFileDescription);
|
|
14
|
-
}
|
|
15
3
|
//# sourceMappingURL=extract-package-tarball.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-package-tarball.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/extract-package-tarball.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"extract-package-tarball.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/extract-package-tarball.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC;AACrE,OAAO,EAAE,iBAAiB,EAAiB,MAAM,uBAAuB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export function buildPublishOptionsForPublishSettings(publishSettings) {
|
|
2
|
+
if (publishSettings.access === 'restricted') {
|
|
3
|
+
return { access: 'restricted' };
|
|
4
|
+
}
|
|
5
|
+
if (publishSettings.provenance === undefined) {
|
|
6
|
+
return { access: 'public' };
|
|
7
|
+
}
|
|
8
|
+
if (publishSettings.provenance.type === 'auto') {
|
|
9
|
+
return { access: 'public', provenance: true };
|
|
10
|
+
}
|
|
11
|
+
return { access: 'public', provenanceFile: publishSettings.provenance.path };
|
|
12
|
+
}
|
|
13
|
+
function isRecord(value) {
|
|
14
|
+
return value instanceof Object;
|
|
15
|
+
}
|
|
16
|
+
function isErrorLike(error) {
|
|
17
|
+
return isRecord(error) && typeof error.message === 'string';
|
|
18
|
+
}
|
|
19
|
+
const unsupportedProviderMarker = 'not supported for provider:';
|
|
20
|
+
function getCiName(message) {
|
|
21
|
+
const tail = message.slice(message.indexOf(unsupportedProviderMarker) + unsupportedProviderMarker.length).trim();
|
|
22
|
+
if (tail === '') {
|
|
23
|
+
return 'unknown';
|
|
24
|
+
}
|
|
25
|
+
const whitespaceIndex = tail.search(/\s/u);
|
|
26
|
+
if (whitespaceIndex === -1) {
|
|
27
|
+
return tail;
|
|
28
|
+
}
|
|
29
|
+
return tail.slice(0, whitespaceIndex);
|
|
30
|
+
}
|
|
31
|
+
function buildUnsupportedProviderMessage(ciName) {
|
|
32
|
+
return [
|
|
33
|
+
'Provenance auto mode requires GitHub Actions or GitLab CI.',
|
|
34
|
+
`Detected CI: ${ciName}.`,
|
|
35
|
+
"Use provenance: { type: 'file' } for other environments."
|
|
36
|
+
].join(' ');
|
|
37
|
+
}
|
|
38
|
+
const githubActionsIdTokenMessage = [
|
|
39
|
+
'GitHub Actions provenance needs "permissions: id-token: write" on the workflow job.',
|
|
40
|
+
'See the packtory readme for the workflow snippet.'
|
|
41
|
+
].join(' ');
|
|
42
|
+
const gitlabSigstoreIdTokenMessage = [
|
|
43
|
+
'GitLab CI provenance needs an "id_tokens" entry with audience "sigstore"',
|
|
44
|
+
'exposed as SIGSTORE_ID_TOKEN. See the packtory readme for the workflow snippet.'
|
|
45
|
+
].join(' ');
|
|
46
|
+
function buildMissingProvenanceFileMessage(filePath) {
|
|
47
|
+
return [
|
|
48
|
+
`Provenance bundle file "${filePath}" does not exist.`,
|
|
49
|
+
"Generate it with your CI's attestation tool (e.g. actions/attest-build-provenance)",
|
|
50
|
+
'before running packtory.'
|
|
51
|
+
].join(' ');
|
|
52
|
+
}
|
|
53
|
+
function buildInvalidProvenanceFileMessage(filePath) {
|
|
54
|
+
return [
|
|
55
|
+
`Provenance bundle file "${filePath}" is not a valid sigstore bundle.`,
|
|
56
|
+
'Re-generate it from the current build.'
|
|
57
|
+
].join(' ');
|
|
58
|
+
}
|
|
59
|
+
function buildProvenanceDigestMismatchMessage(filePath) {
|
|
60
|
+
return [
|
|
61
|
+
`Provenance bundle at "${filePath}" was signed against a different tarball`,
|
|
62
|
+
'than the one packtory built. Re-generate the bundle from the current source —',
|
|
63
|
+
'shipping a mismatched attestation would defeat the purpose of provenance.'
|
|
64
|
+
].join(' ');
|
|
65
|
+
}
|
|
66
|
+
function isProvenanceBundleError(message) {
|
|
67
|
+
return (message.includes('Bundle is invalid') ||
|
|
68
|
+
message.includes('Unsupported bundle format') ||
|
|
69
|
+
message.includes('Invalid bundle') ||
|
|
70
|
+
message.includes('subject does not match'));
|
|
71
|
+
}
|
|
72
|
+
function isProvenanceDigestMismatch(message) {
|
|
73
|
+
return message.includes('subject') || message.includes('digest');
|
|
74
|
+
}
|
|
75
|
+
function matchAutoModeError(error) {
|
|
76
|
+
if (!isErrorLike(error)) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const { message } = error;
|
|
80
|
+
if (message.includes(unsupportedProviderMarker)) {
|
|
81
|
+
return new Error(buildUnsupportedProviderMessage(getCiName(message)), { cause: error });
|
|
82
|
+
}
|
|
83
|
+
if (message.includes('"write" access to the "id-token" permission')) {
|
|
84
|
+
return new Error(githubActionsIdTokenMessage, { cause: error });
|
|
85
|
+
}
|
|
86
|
+
if (message.includes('SIGSTORE_ID_TOKEN')) {
|
|
87
|
+
return new Error(gitlabSigstoreIdTokenMessage, { cause: error });
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
function matchFileModeError(error, filePath) {
|
|
92
|
+
if (isRecord(error) && error.code === 'ENOENT') {
|
|
93
|
+
return new Error(buildMissingProvenanceFileMessage(filePath), { cause: error });
|
|
94
|
+
}
|
|
95
|
+
if (!isErrorLike(error)) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const { message } = error;
|
|
99
|
+
if (!isProvenanceBundleError(message)) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
if (isProvenanceDigestMismatch(message)) {
|
|
103
|
+
return new Error(buildProvenanceDigestMismatchMessage(filePath), { cause: error });
|
|
104
|
+
}
|
|
105
|
+
return new Error(buildInvalidProvenanceFileMessage(filePath), { cause: error });
|
|
106
|
+
}
|
|
107
|
+
function getProvenanceFilePath(publishSettings) {
|
|
108
|
+
if (publishSettings.access !== 'public') {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
if (publishSettings.provenance?.type !== 'file') {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return publishSettings.provenance.path;
|
|
115
|
+
}
|
|
116
|
+
function ensureError(error) {
|
|
117
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
118
|
+
}
|
|
119
|
+
export function remapPublishError(error, publishSettings) {
|
|
120
|
+
const autoModeError = matchAutoModeError(error);
|
|
121
|
+
if (autoModeError !== undefined) {
|
|
122
|
+
return autoModeError;
|
|
123
|
+
}
|
|
124
|
+
const filePath = getProvenanceFilePath(publishSettings);
|
|
125
|
+
if (filePath !== undefined) {
|
|
126
|
+
const fileModeError = matchFileModeError(error, filePath);
|
|
127
|
+
if (fileModeError !== undefined) {
|
|
128
|
+
return fileModeError;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return ensureError(error);
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=publish-settings-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-settings-bridge.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/publish-settings-bridge.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,qCAAqC,CACjD,eAA0C;IAE1C,IAAI,eAAe,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IACpC,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC7C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;AACjF,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,KAAK,YAAY,MAAM,CAAC;AACnC,CAAC;AAID,SAAS,WAAW,CAAC,KAAc;IAC/B,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC;AAChE,CAAC;AAED,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEhE,SAAS,SAAS,CAAC,OAAe;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,yBAAyB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AAC;IACzB,CAAC;IAED,MAAM,QAAQ,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACxD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,aAAa,CAAC;QACzB,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import type _npmFetch from 'npm-registry-fetch';
|
|
2
2
|
import type { publish as _publish } from 'libnpmpublish';
|
|
3
3
|
import { Maybe } from 'true-myth';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { Clock } from '../common/clock.ts';
|
|
5
|
+
import type { PublishSettings } from '../config/publish-settings.ts';
|
|
6
|
+
import type { PublishAuthStrategy, RegistrySettings } from '../config/registry-settings.ts';
|
|
7
|
+
import type { BundlePackageJson } from '../version-manager/versioned-bundle.ts';
|
|
6
8
|
type PublishFunction = typeof _publish;
|
|
7
9
|
export type RegistryClientDependencies = {
|
|
8
10
|
readonly npmFetch: typeof _npmFetch;
|
|
9
11
|
readonly publish: PublishFunction;
|
|
12
|
+
readonly fetch: typeof globalThis.fetch;
|
|
13
|
+
readonly clock: Clock;
|
|
14
|
+
readonly resolveIdToken: (auth: Extract<PublishAuthStrategy, {
|
|
15
|
+
type: 'npm-oidc';
|
|
16
|
+
}>) => Promise<string>;
|
|
17
|
+
readonly promptForOneTimePassword?: (() => Promise<string | undefined>) | undefined;
|
|
10
18
|
};
|
|
11
19
|
export type RegistryClient = {
|
|
12
20
|
fetchLatestVersion: (packageName: string, config: RegistrySettings) => Promise<Maybe<PackageVersionDetails>>;
|
|
13
|
-
publishPackage: (manifest: Readonly<BundlePackageJson>, tarData: Buffer, config: RegistrySettings) => Promise<void>;
|
|
14
|
-
fetchTarball: (tarballUrl: string,
|
|
21
|
+
publishPackage: (manifest: Readonly<BundlePackageJson>, tarData: Buffer, config: RegistrySettings, publishSettings: PublishSettings) => Promise<void>;
|
|
22
|
+
fetchTarball: (tarballUrl: string, config: RegistrySettings) => Promise<Buffer>;
|
|
15
23
|
};
|
|
16
|
-
|
|
24
|
+
type PackageVersionDetails = {
|
|
17
25
|
readonly version: string;
|
|
18
|
-
readonly shasum: string;
|
|
19
26
|
readonly tarballUrl: string;
|
|
20
27
|
};
|
|
21
28
|
export declare function createRegistryClient(dependencies: Readonly<RegistryClientDependencies>): RegistryClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../../source/bundle-emitter/registry-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../../source/bundle-emitter/registry-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAGR,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAGhF,KAAK,eAAe,GAAG,OAAO,QAAQ,CAAC;AAmBvC,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,CAAC,QAAQ,EAAE,OAAO,SAAS,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvG,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;CACvF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC7G,cAAc,EAAE,CACZ,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,eAAe,KAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACnF,CAAC;AAmDF,KAAK,qBAAqB,GAAG;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B,CAAC;AA4FF,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAAG,cAAc,CAwNvG"}
|
|
@@ -1,93 +1,4 @@
|
|
|
1
1
|
import { Maybe } from 'true-myth';
|
|
2
2
|
import { z } from 'zod/mini';
|
|
3
|
-
import {
|
|
4
|
-
function isFetchError(error) {
|
|
5
|
-
return typeof error === 'object' && error !== null && Object.hasOwn(error, 'statusCode');
|
|
6
|
-
}
|
|
7
|
-
function encodePackageName(name) {
|
|
8
|
-
return name.replace('/', '%2F');
|
|
9
|
-
}
|
|
10
|
-
const distTagsSchema = z.object({
|
|
11
|
-
latest: z.optional(z.string())
|
|
12
|
-
});
|
|
13
|
-
const versionDataSchema = z.object({
|
|
14
|
-
dist: z.object({ shasum: z.string(), tarball: z.string() })
|
|
15
|
-
});
|
|
16
|
-
const abbreviatedPackageResponseSchema = z.object({
|
|
17
|
-
name: z.string(),
|
|
18
|
-
'dist-tags': distTagsSchema,
|
|
19
|
-
versions: z.record(z.string(), versionDataSchema)
|
|
20
|
-
});
|
|
21
|
-
const httpStatusCode = {
|
|
22
|
-
notFound: 404,
|
|
23
|
-
forbidden: 403
|
|
24
|
-
};
|
|
25
|
-
export function createRegistryClient(dependencies) {
|
|
26
|
-
const { npmFetch, publish } = dependencies;
|
|
27
|
-
async function fetchRegistryEndpoint(endpoint, registrySettings) {
|
|
28
|
-
const acceptHeaderForFetchingAbbreviatedResponse = 'application/vnd.npm.install-v1+json';
|
|
29
|
-
return npmFetch.json(endpoint, {
|
|
30
|
-
forceAuth: {
|
|
31
|
-
alwaysAuth: true,
|
|
32
|
-
token: registrySettings.token
|
|
33
|
-
},
|
|
34
|
-
registry: registrySettings.registryUrl,
|
|
35
|
-
headers: { accept: acceptHeaderForFetchingAbbreviatedResponse }
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
async function fetchPackage(packageName, registrySettings) {
|
|
39
|
-
const endpointUri = `/${encodePackageName(packageName)}`;
|
|
40
|
-
try {
|
|
41
|
-
const response = await fetchRegistryEndpoint(endpointUri, registrySettings);
|
|
42
|
-
const result = safeParse(abbreviatedPackageResponseSchema, response);
|
|
43
|
-
if (!result.success) {
|
|
44
|
-
throw new Error('Got an invalid response from registry API');
|
|
45
|
-
}
|
|
46
|
-
return Maybe.just(result.data);
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
if (isFetchError(error) &&
|
|
50
|
-
(error.statusCode === httpStatusCode.notFound || error.statusCode === httpStatusCode.forbidden)) {
|
|
51
|
-
return Maybe.nothing();
|
|
52
|
-
}
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
async fetchTarball(tarballUrl) {
|
|
58
|
-
const response = await npmFetch(tarballUrl);
|
|
59
|
-
return response.buffer();
|
|
60
|
-
},
|
|
61
|
-
async publishPackage(manifest, tarData, registrySettings) {
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ok in this case
|
|
63
|
-
await publish(manifest, tarData, {
|
|
64
|
-
defaultTag: 'latest',
|
|
65
|
-
forceAuth: {
|
|
66
|
-
alwaysAuth: true,
|
|
67
|
-
token: registrySettings.token
|
|
68
|
-
},
|
|
69
|
-
registry: registrySettings.registryUrl
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
async fetchLatestVersion(packageName, registrySettings) {
|
|
73
|
-
const packageResponse = await fetchPackage(packageName, registrySettings);
|
|
74
|
-
if (packageResponse.isNothing) {
|
|
75
|
-
return Maybe.nothing();
|
|
76
|
-
}
|
|
77
|
-
const latestVersion = packageResponse.value['dist-tags'].latest;
|
|
78
|
-
if (latestVersion !== undefined) {
|
|
79
|
-
const versionData = packageResponse.value.versions[latestVersion];
|
|
80
|
-
if (versionData === undefined) {
|
|
81
|
-
throw new Error(`Version "${latestVersion}" for package "${packageName}" is missing a shasum`);
|
|
82
|
-
}
|
|
83
|
-
return Maybe.just({
|
|
84
|
-
version: latestVersion,
|
|
85
|
-
shasum: versionData.dist.shasum,
|
|
86
|
-
tarballUrl: versionData.dist.tarball
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return Maybe.nothing();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
3
|
+
import { buildPublishOptionsForPublishSettings, remapPublishError } from "./publish-settings-bridge.js";
|
|
93
4
|
//# sourceMappingURL=registry-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/registry-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/registry-client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU;AAU5B,OAAO,EAAE,qCAAqC,EAAE,iBAAiB,EAAE,MAAM,8BAA8B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { normalizeRepositoryUrl } from "./repository-url-normalizer.js";
|
|
2
|
+
function isNonEmptyString(value) {
|
|
3
|
+
return typeof value === 'string' && value.length > 0;
|
|
4
|
+
}
|
|
5
|
+
export function readCiEnvironment(env) {
|
|
6
|
+
return {
|
|
7
|
+
githubServerUrl: env.GITHUB_SERVER_URL,
|
|
8
|
+
githubRepository: env.GITHUB_REPOSITORY,
|
|
9
|
+
gitlabProjectUrl: env.CI_PROJECT_URL
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function getCiRepositoryUrl(env) {
|
|
13
|
+
if (isNonEmptyString(env.githubServerUrl) && isNonEmptyString(env.githubRepository)) {
|
|
14
|
+
return `${env.githubServerUrl}/${env.githubRepository}`;
|
|
15
|
+
}
|
|
16
|
+
if (isNonEmptyString(env.gitlabProjectUrl)) {
|
|
17
|
+
return env.gitlabProjectUrl;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const noRepositoryDeclaredMessage = [
|
|
22
|
+
'Provenance is enabled but the package has no repository declared.',
|
|
23
|
+
'Add a "repository" entry to additionalPackageJsonAttributes',
|
|
24
|
+
"so consumers can verify the attestation's source claim."
|
|
25
|
+
].join('\n');
|
|
26
|
+
const noCiDetectedMessage = [
|
|
27
|
+
'Provenance auto mode is enabled but no CI repository was detected.',
|
|
28
|
+
'Provenance auto mode requires GitHub Actions or GitLab CI; expected',
|
|
29
|
+
'one of GITHUB_SERVER_URL+GITHUB_REPOSITORY or CI_PROJECT_URL.'
|
|
30
|
+
].join('\n');
|
|
31
|
+
function buildMismatchMessage(configuredUrl, ciUrl) {
|
|
32
|
+
return [
|
|
33
|
+
"Provenance is enabled but the package's repository URL does not match",
|
|
34
|
+
'the CI repository.',
|
|
35
|
+
`Configured repository: ${configuredUrl}`,
|
|
36
|
+
`CI repository: ${ciUrl}`,
|
|
37
|
+
'Either correct the package.json repository field, or disable provenance',
|
|
38
|
+
'if the mismatch is intentional.'
|
|
39
|
+
].join('\n');
|
|
40
|
+
}
|
|
41
|
+
export function assertRepositoryCoherence(manifest, ciRepositoryUrl) {
|
|
42
|
+
const normalizedManifestUrl = normalizeRepositoryUrl(manifest.repository);
|
|
43
|
+
if (normalizedManifestUrl === undefined) {
|
|
44
|
+
throw new Error(noRepositoryDeclaredMessage);
|
|
45
|
+
}
|
|
46
|
+
const normalizedCiUrl = normalizeRepositoryUrl(ciRepositoryUrl);
|
|
47
|
+
if (normalizedCiUrl === undefined) {
|
|
48
|
+
throw new Error(noCiDetectedMessage);
|
|
49
|
+
}
|
|
50
|
+
if (normalizedCiUrl !== normalizedManifestUrl) {
|
|
51
|
+
throw new Error(buildMismatchMessage(normalizedManifestUrl, normalizedCiUrl));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=repository-coherence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-coherence.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/repository-coherence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAQxE,SAAS,gBAAgB,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAiD;IAC/E,OAAO;QACH,eAAe,EAAE,GAAG,CAAC,iBAAiB;QACtC,gBAA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KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,eAAe,KAAK,qBAAqB,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC,CAAC;IAClF,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-url-normalizer.js","sourceRoot":"","sources":["../../../../source/bundle-emitter/repository-url-normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB"}
|
package/checks/check-runner.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const checkRules = [noDuplicatedFilesRule];
|
|
3
|
-
export function runChecks(params) {
|
|
4
|
-
const { settings, bundles: packages } = params;
|
|
5
|
-
return checkRules
|
|
6
|
-
.filter((rule) => {
|
|
7
|
-
return rule.isEnabled(settings);
|
|
8
|
-
})
|
|
9
|
-
.flatMap((rule) => {
|
|
10
|
-
return rule.run({ bundles: packages }, settings);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
1
|
+
import { allRules } from "./rules/registry.js";
|
|
13
2
|
//# sourceMappingURL=check-runner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-runner.js","sourceRoot":"","sources":["../../../../source/checks/check-runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"check-runner.js","sourceRoot":"","sources":["../../../../source/checks/check-runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB"}
|
package/checks/rule.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod/mini';
|
|
2
|
+
import { nonEmptyStringSchema } from "../config/base-validations.js";
|
|
3
|
+
export const enabledOnlyGlobalSchema = z.strictObject({ enabled: z.boolean() });
|
|
4
|
+
export const emptyPerPackageSchema = z.strictObject({});
|
|
5
|
+
//# sourceMappingURL=rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../../source/checks/rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAoB,MAAM,UAAU;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B;AAGpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-bundle-size.js","sourceRoot":"","sources":["../../../../../source/checks/rules/max-bundle-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU;AAI5B,MAAM,QAAQ,GAAG,eAAe;AAgDhC,MAAM,CAAC,MAAM,iBAAiB,GAAyE;IACnG,IAAI,EAAE,QAAQ;IACd,YAAY;IACZ,gBAAgB;IAChB,GAAG;CACN"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { emptyPerPackageSchema, enabledOnlyGlobalSchema } from "../rule.js";
|
|
2
|
+
const ruleName = 'noDevDependencyImports';
|
|
3
|
+
export const noDevDependencyImportsRule = {
|
|
4
|
+
name: ruleName,
|
|
5
|
+
globalSchema: enabledOnlyGlobalSchema,
|
|
6
|
+
perPackageSchema: emptyPerPackageSchema,
|
|
7
|
+
run
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=no-dev-dependency-imports.js.map
|