@mannyc1/ts-release 0.0.7 → 0.2.2
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/ARCHITECTURE.md +124 -92
- package/CHANGELOG.md +115 -0
- package/LICENSE +21 -0
- package/README.md +278 -324
- package/SPEC.md +206 -310
- package/apps/release-ts/README.md +32 -0
- package/apps/release-ts/src/cli/command.ts +164 -0
- package/apps/release-ts/src/cli/commands.ts +351 -0
- package/apps/release-ts/src/cli/main.ts +43 -0
- package/apps/release-ts/src/cli/node-main.ts +49 -0
- package/apps/ts-release-agents/LICENSE +21 -0
- package/apps/ts-release-agents/README.md +21 -0
- package/apps/ts-release-agents/evals/cases.json +11 -0
- package/apps/ts-release-agents/manifests/claude.json +5 -0
- package/apps/ts-release-agents/manifests/codex.json +5 -0
- package/apps/ts-release-agents/package.json +11 -0
- package/apps/ts-release-agents/skills/release/SKILL.md +48 -0
- package/apps/ts-release-agents/skills/release/references/configuration.md +18 -0
- package/apps/ts-release-agents/skills/release/references/recovery.md +10 -0
- package/apps/ts-release-agents/skills/release/references/staged-workflow.md +12 -0
- package/apps/ts-release-agents/skills/release/references/target-selection.md +13 -0
- package/apps/ts-release-agents/skills/release/references/verification.md +14 -0
- package/apps/ts-release-agents/src/build.ts +105 -0
- package/apps/ts-release-agents/src/check.ts +117 -0
- package/apps/ts-release-agents/src/install.ts +121 -0
- package/apps/ts-release-agents/test/contract.test.ts +56 -0
- package/apps/ts-release-agents/tsconfig.json +5 -0
- package/dist/api/api.d.ts +15 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +244 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/errors.d.ts +39 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +32 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/input.d.ts +10 -0
- package/dist/api/input.d.ts.map +1 -0
- package/dist/api/input.js +73 -0
- package/dist/api/input.js.map +1 -0
- package/dist/api/runtime.d.ts +18 -0
- package/dist/api/runtime.d.ts.map +1 -0
- package/dist/api/runtime.js +7 -0
- package/dist/api/runtime.js.map +1 -0
- package/dist/api/types.d.ts +76 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +17 -0
- package/dist/api/types.js.map +1 -0
- package/dist/bin/ts-release.js +39239 -0
- package/dist/capabilities/bun-targets.d.ts +3 -0
- package/dist/capabilities/bun-targets.d.ts.map +1 -0
- package/dist/capabilities/bun-targets.js +3 -0
- package/dist/capabilities/bun-targets.js.map +1 -0
- package/dist/capabilities/field-ownership.d.ts +17 -0
- package/dist/capabilities/field-ownership.d.ts.map +1 -0
- package/dist/capabilities/field-ownership.js +40 -0
- package/dist/capabilities/field-ownership.js.map +1 -0
- package/dist/capabilities/module.d.ts +91 -0
- package/dist/capabilities/module.d.ts.map +1 -0
- package/dist/capabilities/module.js +2 -0
- package/dist/capabilities/module.js.map +1 -0
- package/dist/capabilities/registry.d.ts +829 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +291 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +42 -0
- package/dist/config/config.js.map +1 -0
- package/dist/correction/coordinator.d.ts +248 -0
- package/dist/correction/coordinator.d.ts.map +1 -0
- package/dist/correction/coordinator.js +274 -0
- package/dist/correction/coordinator.js.map +1 -0
- package/dist/correction/index.d.ts +3 -0
- package/dist/correction/index.d.ts.map +1 -0
- package/dist/correction/index.js +3 -0
- package/dist/correction/index.js.map +1 -0
- package/dist/correction/intent.d.ts +111 -0
- package/dist/correction/intent.d.ts.map +1 -0
- package/dist/correction/intent.js +146 -0
- package/dist/correction/intent.js.map +1 -0
- package/dist/drivers/archive.d.ts +8 -0
- package/dist/drivers/archive.d.ts.map +1 -0
- package/dist/drivers/archive.js +101 -0
- package/dist/drivers/archive.js.map +1 -0
- package/dist/drivers/contain.d.ts +6 -0
- package/dist/drivers/contain.d.ts.map +1 -0
- package/dist/drivers/contain.js +17 -0
- package/dist/drivers/contain.js.map +1 -0
- package/dist/drivers/environment.d.ts +4 -0
- package/dist/drivers/environment.d.ts.map +1 -0
- package/dist/drivers/environment.js +18 -0
- package/dist/drivers/environment.js.map +1 -0
- package/dist/drivers/errors.d.ts +9 -0
- package/dist/drivers/errors.d.ts.map +1 -0
- package/dist/drivers/errors.js +6 -0
- package/dist/drivers/errors.js.map +1 -0
- package/dist/drivers/glob.d.ts +2 -0
- package/dist/drivers/glob.d.ts.map +1 -0
- package/dist/drivers/glob.js +162 -0
- package/dist/drivers/glob.js.map +1 -0
- package/dist/drivers/process.d.ts +48 -0
- package/dist/drivers/process.d.ts.map +1 -0
- package/dist/drivers/process.js +257 -0
- package/dist/drivers/process.js.map +1 -0
- package/dist/drivers/redact.d.ts +4 -0
- package/dist/drivers/redact.d.ts.map +1 -0
- package/dist/drivers/redact.js +24 -0
- package/dist/drivers/redact.js.map +1 -0
- package/dist/drivers/seccomp-helper-source.d.ts +7 -0
- package/dist/drivers/seccomp-helper-source.d.ts.map +1 -0
- package/dist/drivers/seccomp-helper-source.js +121 -0
- package/dist/drivers/seccomp-helper-source.js.map +1 -0
- package/dist/drivers/utils.d.ts +4 -0
- package/dist/drivers/utils.d.ts.map +1 -0
- package/dist/drivers/utils.js +5 -0
- package/dist/drivers/utils.js.map +1 -0
- package/dist/drivers/workspace.d.ts +6 -0
- package/dist/drivers/workspace.d.ts.map +1 -0
- package/dist/drivers/workspace.js +49 -0
- package/dist/drivers/workspace.js.map +1 -0
- package/dist/extensions/provider-adapter.d.ts +48 -0
- package/dist/extensions/provider-adapter.d.ts.map +1 -0
- package/dist/extensions/provider-adapter.js +64 -0
- package/dist/extensions/provider-adapter.js.map +1 -0
- package/dist/host.d.ts +33 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/model/artifact-collection.d.ts +84 -0
- package/dist/model/artifact-collection.d.ts.map +1 -0
- package/dist/model/artifact-collection.js +185 -0
- package/dist/model/artifact-collection.js.map +1 -0
- package/dist/model/authority.d.ts +89 -0
- package/dist/model/authority.d.ts.map +1 -0
- package/dist/model/authority.js +80 -0
- package/dist/model/authority.js.map +1 -0
- package/dist/model/bun-targets.d.ts +34 -0
- package/dist/model/bun-targets.d.ts.map +1 -0
- package/dist/model/bun-targets.js +17 -0
- package/dist/model/bun-targets.js.map +1 -0
- package/dist/model/canonical.d.ts +8 -0
- package/dist/model/canonical.d.ts.map +1 -0
- package/dist/model/canonical.js +205 -0
- package/dist/model/canonical.js.map +1 -0
- package/dist/model/catalog.d.ts +76 -0
- package/dist/model/catalog.d.ts.map +1 -0
- package/dist/model/catalog.js +174 -0
- package/dist/model/catalog.js.map +1 -0
- package/dist/model/digest.d.ts +53 -0
- package/dist/model/digest.d.ts.map +1 -0
- package/dist/model/digest.js +127 -0
- package/dist/model/digest.js.map +1 -0
- package/dist/model/errors.d.ts +14 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +8 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/primitives.d.ts +19 -0
- package/dist/model/primitives.d.ts.map +1 -0
- package/dist/model/primitives.js +18 -0
- package/dist/model/primitives.js.map +1 -0
- package/dist/model/pypi.d.ts +12 -0
- package/dist/model/pypi.d.ts.map +1 -0
- package/dist/model/pypi.js +20 -0
- package/dist/model/pypi.js.map +1 -0
- package/dist/model/python-distribution.d.ts +33 -0
- package/dist/model/python-distribution.d.ts.map +1 -0
- package/dist/model/python-distribution.js +367 -0
- package/dist/model/python-distribution.js.map +1 -0
- package/dist/model/secret-patterns.d.ts +2 -0
- package/dist/model/secret-patterns.d.ts.map +1 -0
- package/dist/model/secret-patterns.js +12 -0
- package/dist/model/secret-patterns.js.map +1 -0
- package/dist/platform/bun.d.ts +7 -0
- package/dist/platform/bun.d.ts.map +1 -0
- package/dist/platform/bun.js +15 -0
- package/dist/platform/bun.js.map +1 -0
- package/dist/platform/credentials.d.ts +32 -0
- package/dist/platform/credentials.d.ts.map +1 -0
- package/dist/platform/credentials.js +772 -0
- package/dist/platform/credentials.js.map +1 -0
- package/dist/platform/host-support.d.ts +2 -0
- package/dist/platform/host-support.d.ts.map +1 -0
- package/dist/platform/host-support.js +4 -0
- package/dist/platform/host-support.js.map +1 -0
- package/dist/platform/node.d.ts +7 -0
- package/dist/platform/node.d.ts.map +1 -0
- package/dist/platform/node.js +15 -0
- package/dist/platform/node.js.map +1 -0
- package/dist/platform/release-runtime.d.ts +11 -0
- package/dist/platform/release-runtime.d.ts.map +1 -0
- package/dist/platform/release-runtime.js +34 -0
- package/dist/platform/release-runtime.js.map +1 -0
- package/dist/platform/services.d.ts +15 -0
- package/dist/platform/services.d.ts.map +1 -0
- package/dist/platform/services.js +30 -0
- package/dist/platform/services.js.map +1 -0
- package/dist/platform/source-observer.d.ts +5 -0
- package/dist/platform/source-observer.d.ts.map +1 -0
- package/dist/platform/source-observer.js +159 -0
- package/dist/platform/source-observer.js.map +1 -0
- package/dist/provider-sdk.d.ts +14 -0
- package/dist/provider-sdk.d.ts.map +1 -0
- package/dist/provider-sdk.js +10 -0
- package/dist/provider-sdk.js.map +1 -0
- package/dist/publication/adapter.d.ts +212 -0
- package/dist/publication/adapter.d.ts.map +1 -0
- package/dist/publication/adapter.js +83 -0
- package/dist/publication/adapter.js.map +1 -0
- package/dist/publication/authority.d.ts +137 -0
- package/dist/publication/authority.d.ts.map +1 -0
- package/dist/publication/authority.js +233 -0
- package/dist/publication/authority.js.map +1 -0
- package/dist/publication/catalog-git.d.ts +37 -0
- package/dist/publication/catalog-git.d.ts.map +1 -0
- package/dist/publication/catalog-git.js +451 -0
- package/dist/publication/catalog-git.js.map +1 -0
- package/dist/publication/claim.d.ts +39 -0
- package/dist/publication/claim.d.ts.map +1 -0
- package/dist/publication/claim.js +31 -0
- package/dist/publication/claim.js.map +1 -0
- package/dist/publication/coordinator.d.ts +246 -0
- package/dist/publication/coordinator.d.ts.map +1 -0
- package/dist/publication/coordinator.js +370 -0
- package/dist/publication/coordinator.js.map +1 -0
- package/dist/publication/github.d.ts +36 -0
- package/dist/publication/github.d.ts.map +1 -0
- package/dist/publication/github.js +644 -0
- package/dist/publication/github.js.map +1 -0
- package/dist/publication/http.d.ts +69 -0
- package/dist/publication/http.d.ts.map +1 -0
- package/dist/publication/http.js +29 -0
- package/dist/publication/http.js.map +1 -0
- package/dist/publication/index.d.ts +5 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +5 -0
- package/dist/publication/index.js.map +1 -0
- package/dist/publication/npm.d.ts +40 -0
- package/dist/publication/npm.d.ts.map +1 -0
- package/dist/publication/npm.js +359 -0
- package/dist/publication/npm.js.map +1 -0
- package/dist/publication/profiles.d.ts +136 -0
- package/dist/publication/profiles.d.ts.map +1 -0
- package/dist/publication/profiles.js +90 -0
- package/dist/publication/profiles.js.map +1 -0
- package/dist/publication/publisher.d.ts +82 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/publisher.js +53 -0
- package/dist/publication/publisher.js.map +1 -0
- package/dist/publication/pypi.d.ts +45 -0
- package/dist/publication/pypi.d.ts.map +1 -0
- package/dist/publication/pypi.js +369 -0
- package/dist/publication/pypi.js.map +1 -0
- package/dist/publication/recovery.d.ts +663 -0
- package/dist/publication/recovery.d.ts.map +1 -0
- package/dist/publication/recovery.js +252 -0
- package/dist/publication/recovery.js.map +1 -0
- package/dist/publication/report.d.ts +1061 -0
- package/dist/publication/report.d.ts.map +1 -0
- package/dist/publication/report.js +441 -0
- package/dist/publication/report.js.map +1 -0
- package/dist/recipes/config.d.ts +296 -0
- package/dist/recipes/config.d.ts.map +1 -0
- package/dist/recipes/config.js +325 -0
- package/dist/recipes/config.js.map +1 -0
- package/dist/release/capabilities.d.ts +12 -0
- package/dist/release/capabilities.d.ts.map +1 -0
- package/dist/release/capabilities.js +395 -0
- package/dist/release/capabilities.js.map +1 -0
- package/dist/release/compiler.d.ts +5 -0
- package/dist/release/compiler.d.ts.map +1 -0
- package/dist/release/compiler.js +19 -0
- package/dist/release/compiler.js.map +1 -0
- package/dist/release/config.d.ts +5 -0
- package/dist/release/config.d.ts.map +1 -0
- package/dist/release/config.js +10 -0
- package/dist/release/config.js.map +1 -0
- package/dist/release/context.d.ts +96 -0
- package/dist/release/context.d.ts.map +1 -0
- package/dist/release/context.js +168 -0
- package/dist/release/context.js.map +1 -0
- package/dist/release/graph.d.ts +271 -0
- package/dist/release/graph.d.ts.map +1 -0
- package/dist/release/graph.js +766 -0
- package/dist/release/graph.js.map +1 -0
- package/dist/release/inspect.d.ts +88 -0
- package/dist/release/inspect.d.ts.map +1 -0
- package/dist/release/inspect.js +75 -0
- package/dist/release/inspect.js.map +1 -0
- package/dist/release/prepare.d.ts +24 -0
- package/dist/release/prepare.d.ts.map +1 -0
- package/dist/release/prepare.js +1116 -0
- package/dist/release/prepare.js.map +1 -0
- package/dist/release/prepared-ref.d.ts +60 -0
- package/dist/release/prepared-ref.d.ts.map +1 -0
- package/dist/release/prepared-ref.js +131 -0
- package/dist/release/prepared-ref.js.map +1 -0
- package/dist/release/prepared-store.d.ts +90 -0
- package/dist/release/prepared-store.d.ts.map +1 -0
- package/dist/release/prepared-store.js +337 -0
- package/dist/release/prepared-store.js.map +1 -0
- package/dist/release/prepared.d.ts +172 -0
- package/dist/release/prepared.d.ts.map +1 -0
- package/dist/release/prepared.js +268 -0
- package/dist/release/prepared.js.map +1 -0
- package/dist/release/staging.d.ts +31 -0
- package/dist/release/staging.d.ts.map +1 -0
- package/dist/release/staging.js +218 -0
- package/dist/release/staging.js.map +1 -0
- package/dist/resolve/authored.d.ts +53 -0
- package/dist/resolve/authored.d.ts.map +1 -0
- package/dist/resolve/authored.js +55 -0
- package/dist/resolve/authored.js.map +1 -0
- package/dist/resolve/encode.d.ts +3 -0
- package/dist/resolve/encode.d.ts.map +1 -0
- package/dist/resolve/encode.js +21 -0
- package/dist/resolve/encode.js.map +1 -0
- package/dist/resolve/errors.d.ts +7 -0
- package/dist/resolve/errors.d.ts.map +1 -0
- package/dist/resolve/errors.js +17 -0
- package/dist/resolve/errors.js.map +1 -0
- package/dist/resolve/facts.d.ts +12 -0
- package/dist/resolve/facts.d.ts.map +1 -0
- package/dist/resolve/facts.js +18 -0
- package/dist/resolve/facts.js.map +1 -0
- package/dist/resolve/resolve.d.ts +10 -0
- package/dist/resolve/resolve.d.ts.map +1 -0
- package/dist/resolve/resolve.js +242 -0
- package/dist/resolve/resolve.js.map +1 -0
- package/dist/store.d.ts +11 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +9 -0
- package/dist/store.js.map +1 -0
- package/examples/README.md +20 -30
- package/examples/github-release/release.config.json +11 -18
- package/examples/homebrew-tap/README.md +11 -0
- package/examples/homebrew-tap/release.config.json +40 -28
- package/examples/multi-target/release.config.json +28 -53
- package/examples/npm-first-publish/release.config.json +23 -25
- package/examples/npm-only/release.config.json +22 -30
- package/examples/portable-cli/README.md +17 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-windows-x64.exe +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_10_15_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_11_0_arm64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_aarch64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-win_amd64.whl +1 -0
- package/examples/portable-cli/package.json +9 -0
- package/examples/portable-cli/release.config.json +53 -0
- package/examples/portable-cli/src/cli.ts +3 -0
- package/examples/pypi-registry/README.md +8 -0
- package/examples/scoop-bucket/README.md +10 -0
- package/examples/scoop-bucket/release.config.json +40 -30
- package/package.json +60 -156
- package/src/api/api.ts +365 -0
- package/src/api/errors.ts +36 -0
- package/src/api/input.ts +92 -0
- package/src/api/runtime.ts +14 -0
- package/src/api/types.ts +103 -0
- package/src/capabilities/bun-targets.ts +2 -0
- package/src/capabilities/field-ownership.ts +60 -0
- package/src/capabilities/module.ts +158 -0
- package/src/capabilities/registry.ts +333 -0
- package/src/config/config.ts +48 -0
- package/src/correction/coordinator.ts +336 -0
- package/src/correction/index.ts +2 -0
- package/src/correction/intent.ts +172 -0
- package/src/drivers/archive.ts +102 -0
- package/src/drivers/contain.ts +20 -0
- package/src/drivers/environment.ts +28 -0
- package/src/drivers/errors.ts +6 -0
- package/src/drivers/glob.ts +137 -0
- package/src/drivers/process.ts +340 -0
- package/src/drivers/redact.ts +31 -0
- package/src/drivers/seccomp-helper-source.ts +121 -0
- package/src/drivers/utils.ts +10 -0
- package/src/drivers/workspace.ts +40 -0
- package/src/extensions/provider-adapter.ts +99 -0
- package/src/host.ts +140 -0
- package/src/index.ts +64 -0
- package/src/model/artifact-collection.ts +237 -0
- package/src/model/authority.ts +116 -0
- package/src/model/bun-targets.ts +34 -0
- package/src/model/canonical.ts +205 -0
- package/src/model/catalog.ts +220 -0
- package/src/model/digest.ts +172 -0
- package/src/model/errors.ts +6 -0
- package/src/model/primitives.ts +37 -0
- package/src/model/pypi.ts +30 -0
- package/src/model/python-distribution.ts +360 -0
- package/src/model/secret-patterns.ts +11 -0
- package/src/platform/bun.ts +38 -0
- package/src/platform/credentials.ts +1083 -0
- package/src/platform/host-support.ts +4 -0
- package/src/platform/node.ts +38 -0
- package/src/platform/release-runtime.ts +47 -0
- package/src/platform/services.ts +57 -0
- package/src/platform/source-observer.ts +193 -0
- package/src/provider-sdk.ts +48 -0
- package/src/publication/adapter.ts +132 -0
- package/src/publication/authority.ts +397 -0
- package/src/publication/catalog-git.ts +603 -0
- package/src/publication/claim.ts +51 -0
- package/src/publication/coordinator.ts +578 -0
- package/src/publication/github.ts +954 -0
- package/src/publication/http.ts +101 -0
- package/src/publication/index.ts +4 -0
- package/src/publication/npm.ts +525 -0
- package/src/publication/profiles.ts +94 -0
- package/src/publication/publisher.ts +130 -0
- package/src/publication/pypi.ts +463 -0
- package/src/publication/recovery.ts +349 -0
- package/src/publication/report.ts +628 -0
- package/src/recipes/config.ts +395 -0
- package/src/release/capabilities.ts +459 -0
- package/src/release/compiler.ts +28 -0
- package/src/release/config.ts +12 -0
- package/src/release/context.ts +223 -0
- package/src/release/graph.ts +866 -0
- package/src/release/inspect.ts +83 -0
- package/src/release/prepare.ts +1331 -0
- package/src/release/prepared-ref.ts +193 -0
- package/src/release/prepared-store.ts +377 -0
- package/src/release/prepared.ts +299 -0
- package/src/release/staging.ts +257 -0
- package/src/resolve/authored.ts +64 -0
- package/src/resolve/encode.ts +22 -0
- package/src/resolve/errors.ts +15 -0
- package/src/resolve/facts.ts +18 -0
- package/src/resolve/resolve.ts +328 -0
- package/src/store.ts +28 -0
- package/templates/README.md +55 -72
- package/templates/bun-cli-github/README.md +7 -9
- package/templates/bun-cli-github/release.config.json +35 -73
- package/templates/github-actions/release.yml +57 -0
- package/templates/github-actions/reviewed-release.yml +80 -0
- package/templates/multi-target-homebrew/README.md +10 -0
- package/templates/multi-target-homebrew/release.config.json +43 -60
- package/templates/multi-target-scoop/README.md +10 -0
- package/templates/multi-target-scoop/release.config.json +43 -62
- package/templates/npm-github/release.config.json +25 -38
- package/templates/npm-github/reviewed-release.config.json +37 -0
- package/templates/npm-only/README.md +10 -0
- package/templates/npm-only/release.config.json +15 -30
- package/templates/portable-cli/README.md +13 -0
- package/templates/portable-cli/release.config.json +53 -0
- package/dist/artifacts/adapter.d.ts +0 -39
- package/dist/artifacts/adapter.d.ts.map +0 -1
- package/dist/artifacts/adapter.js +0 -23
- package/dist/artifacts/adapter.js.map +0 -1
- package/dist/artifacts/registry.d.ts +0 -21
- package/dist/artifacts/registry.d.ts.map +0 -1
- package/dist/artifacts/registry.js +0 -21
- package/dist/artifacts/registry.js.map +0 -1
- package/dist/config/errors.d.ts +0 -24
- package/dist/config/errors.d.ts.map +0 -1
- package/dist/config/errors.js +0 -19
- package/dist/config/errors.js.map +0 -1
- package/dist/config/load.d.ts +0 -9
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js +0 -29
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.d.ts +0 -12
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -19
- package/dist/config/schema.js.map +0 -1
- package/dist/domain/artifact.d.ts +0 -118
- package/dist/domain/artifact.d.ts.map +0 -1
- package/dist/domain/artifact.js +0 -197
- package/dist/domain/artifact.js.map +0 -1
- package/dist/domain/evidence.d.ts +0 -59
- package/dist/domain/evidence.d.ts.map +0 -1
- package/dist/domain/evidence.js +0 -51
- package/dist/domain/evidence.js.map +0 -1
- package/dist/domain/operation.d.ts +0 -143
- package/dist/domain/operation.d.ts.map +0 -1
- package/dist/domain/operation.js +0 -198
- package/dist/domain/operation.js.map +0 -1
- package/dist/domain/release.d.ts +0 -93
- package/dist/domain/release.d.ts.map +0 -1
- package/dist/domain/release.js +0 -82
- package/dist/domain/release.js.map +0 -1
- package/dist/domain/remote-state.d.ts +0 -58
- package/dist/domain/remote-state.d.ts.map +0 -1
- package/dist/domain/remote-state.js +0 -55
- package/dist/domain/remote-state.js.map +0 -1
- package/dist/domain/target.d.ts +0 -148
- package/dist/domain/target.d.ts.map +0 -1
- package/dist/domain/target.js +0 -151
- package/dist/domain/target.js.map +0 -1
- package/dist/host/host.d.ts +0 -32
- package/dist/host/host.d.ts.map +0 -1
- package/dist/host/host.js +0 -24
- package/dist/host/host.js.map +0 -1
- package/dist/host/http-live.d.ts +0 -6
- package/dist/host/http-live.d.ts.map +0 -1
- package/dist/host/http-live.js +0 -86
- package/dist/host/http-live.js.map +0 -1
- package/dist/host/http.d.ts +0 -43
- package/dist/host/http.d.ts.map +0 -1
- package/dist/host/http.js +0 -59
- package/dist/host/http.js.map +0 -1
- package/dist/host/platform.d.ts +0 -10
- package/dist/host/platform.d.ts.map +0 -1
- package/dist/host/platform.js +0 -114
- package/dist/host/platform.js.map +0 -1
- package/dist/host/test.d.ts +0 -23
- package/dist/host/test.d.ts.map +0 -1
- package/dist/host/test.js +0 -222
- package/dist/host/test.js.map +0 -1
- package/dist/internal/workspace-path.d.ts +0 -15
- package/dist/internal/workspace-path.d.ts.map +0 -1
- package/dist/internal/workspace-path.js +0 -36
- package/dist/internal/workspace-path.js.map +0 -1
- package/dist/planner/artifact-inventory.d.ts +0 -9
- package/dist/planner/artifact-inventory.d.ts.map +0 -1
- package/dist/planner/artifact-inventory.js +0 -86
- package/dist/planner/artifact-inventory.js.map +0 -1
- package/dist/planner/create-release-plan.d.ts +0 -5
- package/dist/planner/create-release-plan.d.ts.map +0 -1
- package/dist/planner/create-release-plan.js +0 -25
- package/dist/planner/create-release-plan.js.map +0 -1
- package/dist/planner/errors.d.ts +0 -67
- package/dist/planner/errors.d.ts.map +0 -1
- package/dist/planner/errors.js +0 -58
- package/dist/planner/errors.js.map +0 -1
- package/dist/planner/evidence-recorder.d.ts +0 -28
- package/dist/planner/evidence-recorder.d.ts.map +0 -1
- package/dist/planner/evidence-recorder.js +0 -362
- package/dist/planner/evidence-recorder.js.map +0 -1
- package/dist/planner/executor.d.ts +0 -58
- package/dist/planner/executor.d.ts.map +0 -1
- package/dist/planner/executor.js +0 -147
- package/dist/planner/executor.js.map +0 -1
- package/dist/planner/normalize-release.d.ts +0 -19
- package/dist/planner/normalize-release.d.ts.map +0 -1
- package/dist/planner/normalize-release.js +0 -342
- package/dist/planner/normalize-release.js.map +0 -1
- package/dist/planner/reconcile.d.ts +0 -17
- package/dist/planner/reconcile.d.ts.map +0 -1
- package/dist/planner/reconcile.js +0 -259
- package/dist/planner/reconcile.js.map +0 -1
- package/dist/planner/render-plan.d.ts +0 -15
- package/dist/planner/render-plan.d.ts.map +0 -1
- package/dist/planner/render-plan.js +0 -231
- package/dist/planner/render-plan.js.map +0 -1
- package/dist/targets/adapter-helpers.d.ts +0 -79
- package/dist/targets/adapter-helpers.d.ts.map +0 -1
- package/dist/targets/adapter-helpers.js +0 -194
- package/dist/targets/adapter-helpers.js.map +0 -1
- package/dist/targets/adapter.d.ts +0 -17
- package/dist/targets/adapter.d.ts.map +0 -1
- package/dist/targets/adapter.js +0 -2
- package/dist/targets/adapter.js.map +0 -1
- package/dist/targets/github-release.d.ts +0 -25
- package/dist/targets/github-release.d.ts.map +0 -1
- package/dist/targets/github-release.js +0 -82
- package/dist/targets/github-release.js.map +0 -1
- package/dist/targets/github.d.ts +0 -11
- package/dist/targets/github.d.ts.map +0 -1
- package/dist/targets/github.js +0 -117
- package/dist/targets/github.js.map +0 -1
- package/dist/targets/homebrew.d.ts +0 -11
- package/dist/targets/homebrew.d.ts.map +0 -1
- package/dist/targets/homebrew.js +0 -210
- package/dist/targets/homebrew.js.map +0 -1
- package/dist/targets/live.d.ts +0 -5
- package/dist/targets/live.d.ts.map +0 -1
- package/dist/targets/live.js +0 -50
- package/dist/targets/live.js.map +0 -1
- package/dist/targets/npm.d.ts +0 -10
- package/dist/targets/npm.d.ts.map +0 -1
- package/dist/targets/npm.js +0 -112
- package/dist/targets/npm.js.map +0 -1
- package/dist/targets/pypi.d.ts +0 -11
- package/dist/targets/pypi.d.ts.map +0 -1
- package/dist/targets/pypi.js +0 -141
- package/dist/targets/pypi.js.map +0 -1
- package/dist/targets/registry.d.ts +0 -25
- package/dist/targets/registry.d.ts.map +0 -1
- package/dist/targets/registry.js +0 -34
- package/dist/targets/registry.js.map +0 -1
- package/dist/targets/scoop.d.ts +0 -11
- package/dist/targets/scoop.d.ts.map +0 -1
- package/dist/targets/scoop.js +0 -88
- package/dist/targets/scoop.js.map +0 -1
- package/dist/types/effect-internal.d.ts +0 -5
- package/dist/types/effect-internal.d.ts.map +0 -1
- package/dist/types/effect-internal.js +0 -2
- package/dist/types/effect-internal.js.map +0 -1
- package/dist/workflows/config.d.ts +0 -202
- package/dist/workflows/config.d.ts.map +0 -1
- package/dist/workflows/config.js +0 -420
- package/dist/workflows/config.js.map +0 -1
- package/dist/workflows/diagnostics.d.ts +0 -62
- package/dist/workflows/diagnostics.d.ts.map +0 -1
- package/dist/workflows/diagnostics.js +0 -530
- package/dist/workflows/diagnostics.js.map +0 -1
- package/dist/workflows/distribution.d.ts +0 -25
- package/dist/workflows/distribution.d.ts.map +0 -1
- package/dist/workflows/distribution.js +0 -24
- package/dist/workflows/distribution.js.map +0 -1
- package/dist/workflows/evidence.d.ts +0 -17
- package/dist/workflows/evidence.d.ts.map +0 -1
- package/dist/workflows/evidence.js +0 -32
- package/dist/workflows/evidence.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -8
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -7
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/init.d.ts +0 -84
- package/dist/workflows/init.d.ts.map +0 -1
- package/dist/workflows/init.js +0 -487
- package/dist/workflows/init.js.map +0 -1
- package/dist/workflows/live.d.ts +0 -9
- package/dist/workflows/live.d.ts.map +0 -1
- package/dist/workflows/live.js +0 -7
- package/dist/workflows/live.js.map +0 -1
- package/dist/workflows/options.d.ts +0 -30
- package/dist/workflows/options.d.ts.map +0 -1
- package/dist/workflows/options.js +0 -16
- package/dist/workflows/options.js.map +0 -1
- package/examples/non-strict-skips/artifacts/release-example-skips-0.1.0.tgz +0 -1
- package/examples/non-strict-skips/release.config.json +0 -31
- package/examples/pypi-registry/release.config.json +0 -31
- package/templates/github-actions/plan-and-approved-execute.yml +0 -58
- package/templates/github-actions/plan-only.yml +0 -33
- package/templates/github-actions/trusted-publishing.yml +0 -61
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { basename } from "node:path"
|
|
2
|
+
import * as Schema from "effect/Schema"
|
|
3
|
+
import {
|
|
4
|
+
ArtifactCardinality,
|
|
5
|
+
ArtifactCollectionContract,
|
|
6
|
+
ArtifactCollectionId,
|
|
7
|
+
ArtifactCollectionSelector
|
|
8
|
+
} from "../model/artifact-collection.js"
|
|
9
|
+
import { NonEmptyName, OperationId, OutputId, SafeRelativePath } from "../model/primitives.js"
|
|
10
|
+
import {
|
|
11
|
+
CatalogRenderSource,
|
|
12
|
+
HomebrewRenderer,
|
|
13
|
+
ScoopRenderer,
|
|
14
|
+
GitHubRepositoryCoordinate,
|
|
15
|
+
canonicalCatalogVersion,
|
|
16
|
+
type CatalogRenderer
|
|
17
|
+
} from "../model/catalog.js"
|
|
18
|
+
import { bunArtifactTarget } from "../capabilities/bun-targets.js"
|
|
19
|
+
import {
|
|
20
|
+
NpmAuthentication,
|
|
21
|
+
PyPiAuthentication,
|
|
22
|
+
pypiRepositoryEndpoints,
|
|
23
|
+
type CandidateConfig,
|
|
24
|
+
type CandidateHomebrewCatalog,
|
|
25
|
+
type CandidateScoopCatalog
|
|
26
|
+
} from "../recipes/config.js"
|
|
27
|
+
import { CapabilityContribution, GraphArchive, GraphChecksum, GraphCommandArtifact, GraphCommandCollection, GraphLinkError,
|
|
28
|
+
GraphCommandCheck, GraphGitHubPublication, GraphNpmPackageBuild, GraphNpmPublication, GraphPyPiDistribution,
|
|
29
|
+
GraphPyPiPublication, GraphCatalogRender, GraphCatalogPublication, OutputDeclaration,
|
|
30
|
+
makeCatalogPublicationAuthorityIntent, makeGitHubPublicationAuthorityIntent,
|
|
31
|
+
makeNpmPublicationAuthorityIntent, makePyPiPublicationAuthorityIntent } from "./graph.js"
|
|
32
|
+
import type { VerifiedReleaseContext } from "./context.js"
|
|
33
|
+
|
|
34
|
+
const output = (id: string | OutputId, location: string, kind: OutputDeclaration["kind"], mediaType?: string) =>
|
|
35
|
+
OutputDeclaration.make({ id: OutputId.make(id.toString()), path: SafeRelativePath.make(location), kind,
|
|
36
|
+
...(mediaType === undefined ? {} : { mediaType }) })
|
|
37
|
+
const compact = (name: string) => name.replace(/^@/u, "").replaceAll("/", "-").replace(/[^A-Za-z0-9._-]+/gu, "-")
|
|
38
|
+
.replace(/^-+|-+$/gu, "")
|
|
39
|
+
const decodeCardinality = Schema.decodeUnknownSync(ArtifactCardinality, { onExcessProperty: "error" })
|
|
40
|
+
const decodeCollectionSelector = Schema.decodeUnknownSync(ArtifactCollectionSelector, { onExcessProperty: "error" })
|
|
41
|
+
const render = (value: string, config: CandidateConfig, target = "", binary = compact(config.project.name)) => {
|
|
42
|
+
const [os = "", arch = ""] = target.split("-")
|
|
43
|
+
return value.replaceAll("{name}", compact(config.project.name)).replaceAll("{version}", config.project.version)
|
|
44
|
+
.replaceAll("{tag}", config.project.tag).replaceAll("{targetTriple}", target).replaceAll("{target}", target)
|
|
45
|
+
.replaceAll("{os}", os).replaceAll("{arch}", arch).replaceAll("{binary}", binary)
|
|
46
|
+
.replaceAll("{ext}", os === "windows" ? ".exe" : "")
|
|
47
|
+
}
|
|
48
|
+
export const contributeSourceArtifacts = (
|
|
49
|
+
config: CandidateConfig,
|
|
50
|
+
_context: VerifiedReleaseContext
|
|
51
|
+
): CapabilityContribution => {
|
|
52
|
+
const artifacts: OutputDeclaration[] = []
|
|
53
|
+
const preparations: (GraphCommandArtifact | GraphCommandCollection | GraphCommandCheck | GraphNpmPackageBuild)[] = []
|
|
54
|
+
for (const artifact of config.artifacts ?? []) {
|
|
55
|
+
artifacts.push(output(artifact.id, render(artifact.path, config),
|
|
56
|
+
artifact.format === "zip" || artifact.format === "tarball" ? "archive" : artifact.format))
|
|
57
|
+
}
|
|
58
|
+
if (config.npmPackage !== undefined) {
|
|
59
|
+
const declaration = output("npm-package", config.npmPackage.path ?? ".", "package")
|
|
60
|
+
artifacts.push(declaration)
|
|
61
|
+
if (config.npmPackage.build !== undefined) {
|
|
62
|
+
const packageRoot = config.npmPackage.path?.toString() ?? "."
|
|
63
|
+
const rooted = (path: SafeRelativePath): SafeRelativePath => SafeRelativePath.make(
|
|
64
|
+
packageRoot === "." ? path.toString() : `${packageRoot}/${path}`
|
|
65
|
+
)
|
|
66
|
+
preparations.push(GraphNpmPackageBuild.make({
|
|
67
|
+
id: OperationId.make("build:npm-package"),
|
|
68
|
+
argv: config.npmPackage.build.run,
|
|
69
|
+
cwd: SafeRelativePath.make(packageRoot),
|
|
70
|
+
inputs: [],
|
|
71
|
+
outputRoots: config.npmPackage.build.outputRoots.map(rooted) as [SafeRelativePath, ...SafeRelativePath[]]
|
|
72
|
+
}))
|
|
73
|
+
}
|
|
74
|
+
preparations.push(GraphCommandCheck.make({
|
|
75
|
+
id: OperationId.make("declare:npm-package"), argv: ["test", "-d", declaration.path], cwd: SafeRelativePath.make("."),
|
|
76
|
+
inputs: [declaration.id]
|
|
77
|
+
}))
|
|
78
|
+
}
|
|
79
|
+
for (const build of config.builds ?? []) {
|
|
80
|
+
for (const target of build.targets) {
|
|
81
|
+
const binary = build.binary ?? compact(config.project.name)
|
|
82
|
+
const id = `${build.id ?? build.builder}-${target}`
|
|
83
|
+
const location = render(build.output ?? `.release/artifacts/${binary}-${config.project.version}-${target}${target.startsWith("windows-") ? ".exe" : ""}`, config, target, binary)
|
|
84
|
+
const declaration = output(id, location, "executable")
|
|
85
|
+
if (build.builder === "prebuilt") {
|
|
86
|
+
artifacts.push(declaration)
|
|
87
|
+
preparations.push(GraphCommandCheck.make({
|
|
88
|
+
id: OperationId.make(`build:prebuilt:${id}:exists`), argv: ["test", "-f", location], cwd: SafeRelativePath.make("."),
|
|
89
|
+
inputs: [declaration.id]
|
|
90
|
+
}))
|
|
91
|
+
} else {
|
|
92
|
+
const argv = build.builder === "command" ? build.run.map((part) => render(part, config, target, binary)) : [
|
|
93
|
+
"bun", "build", render(build.entry, config, target, binary), "--compile", "--target", bunArtifactTarget(target).bunTarget,
|
|
94
|
+
"--outfile", location, ...(build.minify === true ? ["--minify"] : [])
|
|
95
|
+
]
|
|
96
|
+
preparations.push(GraphCommandArtifact.make({
|
|
97
|
+
id: OperationId.make(`build:${build.builder}:${id}`), argv: [argv[0]!, ...argv.slice(1)], cwd: SafeRelativePath.make("."),
|
|
98
|
+
inputs: [], outputs: [declaration]
|
|
99
|
+
}))
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const preparation of config.preparations ?? []) {
|
|
104
|
+
const inputs = preparation.inputs ?? []
|
|
105
|
+
const cwd = preparation.cwd ?? SafeRelativePath.make(".")
|
|
106
|
+
if (preparation.kind === "check") preparations.push(GraphCommandCheck.make({
|
|
107
|
+
id: OperationId.make(`preparation:${preparation.id}`), argv: preparation.run,
|
|
108
|
+
cwd, inputs
|
|
109
|
+
}))
|
|
110
|
+
else {
|
|
111
|
+
const id = OperationId.make(`preparation:${preparation.id}`)
|
|
112
|
+
if ("outputs" in preparation) preparations.push(GraphCommandArtifact.make({
|
|
113
|
+
id, argv: preparation.run,
|
|
114
|
+
cwd, inputs,
|
|
115
|
+
outputs: [
|
|
116
|
+
output(preparation.outputs[0]!.id, preparation.outputs[0]!.path, preparation.outputs[0]!.kind ?? "file", preparation.outputs[0]!.mediaType),
|
|
117
|
+
...preparation.outputs.slice(1).map((item) => output(item.id, item.path, item.kind ?? "file", item.mediaType))
|
|
118
|
+
]
|
|
119
|
+
}))
|
|
120
|
+
else preparations.push(GraphCommandCollection.make({
|
|
121
|
+
id, argv: preparation.run, cwd, inputs,
|
|
122
|
+
collection: ArtifactCollectionContract.make({
|
|
123
|
+
id: ArtifactCollectionId.make(preparation.id.toString()),
|
|
124
|
+
producer: id,
|
|
125
|
+
root: preparation.collection.root,
|
|
126
|
+
artifactKind: preparation.collection.artifactKind,
|
|
127
|
+
pathSuffix: preparation.collection.pathSuffix,
|
|
128
|
+
mediaType: preparation.collection.mediaType,
|
|
129
|
+
cardinality: decodeCardinality(preparation.collection.cardinality)
|
|
130
|
+
})
|
|
131
|
+
}))
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return CapabilityContribution.make({ artifacts, preparations, publications: [] })
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const contributePackages = (
|
|
138
|
+
config: CandidateConfig,
|
|
139
|
+
artifacts: ReadonlyArray<OutputDeclaration>,
|
|
140
|
+
_context: VerifiedReleaseContext
|
|
141
|
+
): CapabilityContribution => {
|
|
142
|
+
const preparations: (GraphArchive | GraphChecksum)[] = []
|
|
143
|
+
const packageOutputs: OutputDeclaration[] = []
|
|
144
|
+
for (const archive of config.archives ?? []) {
|
|
145
|
+
const inputs = archive.ids === undefined
|
|
146
|
+
? artifacts.filter((item) => item.kind !== "package").map((item) => item.id)
|
|
147
|
+
: archive.ids
|
|
148
|
+
for (const format of archive.formats ?? ["tar.gz"]) {
|
|
149
|
+
const base = render(archive.nameTemplate ?? `${compact(config.project.name)}_{version}`, config)
|
|
150
|
+
const id = `${archive.id ?? "archive"}${(archive.formats ?? ["tar.gz"]).length > 1 ? `-${format.replaceAll(".", "-")}` : ""}`
|
|
151
|
+
const declaration = output(id, `.release/artifacts/${base}.${format}`, "archive")
|
|
152
|
+
packageOutputs.push(declaration)
|
|
153
|
+
preparations.push(GraphArchive.make({ id: OperationId.make(`archive:${id}`), inputs, output: declaration, format }))
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const checksumInputs = [...artifacts, ...packageOutputs].filter((item) =>
|
|
157
|
+
item.kind !== "package" && item.kind !== "digest")
|
|
158
|
+
if (config.checksum !== undefined) {
|
|
159
|
+
const algorithm = config.checksum.algorithm
|
|
160
|
+
if (checksumInputs.length === 0) {
|
|
161
|
+
throw new GraphLinkError({
|
|
162
|
+
kind: "reference",
|
|
163
|
+
value: "checksum",
|
|
164
|
+
reason: "Checksum configuration requires at least one capturable artifact."
|
|
165
|
+
})
|
|
166
|
+
}
|
|
167
|
+
preparations.push(GraphChecksum.make({ id: OperationId.make("checksum:digest"), inputs: [checksumInputs[0]!.id, ...checksumInputs.slice(1).map((item) => item.id)],
|
|
168
|
+
output: output("checksum-digests", `.release/facts/checksum-${algorithm}`, "digest"), algorithm }))
|
|
169
|
+
}
|
|
170
|
+
return CapabilityContribution.make({ artifacts: [], preparations, publications: [] })
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface CatalogRenderRow {
|
|
174
|
+
readonly id: string
|
|
175
|
+
readonly renderer: CatalogRenderer
|
|
176
|
+
readonly sources: readonly [CatalogRenderSource, ...Array<CatalogRenderSource>]
|
|
177
|
+
readonly output: OutputDeclaration
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const catalogRows = (
|
|
181
|
+
config: CandidateConfig,
|
|
182
|
+
artifacts: ReadonlyArray<OutputDeclaration>,
|
|
183
|
+
selected: "homebrew" | "scoop" | "all" = "all"
|
|
184
|
+
): ReadonlyArray<CatalogRenderRow> => {
|
|
185
|
+
const repository = config.publish?.github?.repository ?? config.project.repository
|
|
186
|
+
const rows: Array<CatalogRenderRow> = []
|
|
187
|
+
const build = (
|
|
188
|
+
kind: "homebrew" | "scoop",
|
|
189
|
+
catalog: NonNullable<NonNullable<CandidateConfig["catalogs"]>[typeof kind]>[number]
|
|
190
|
+
): CatalogRenderRow => {
|
|
191
|
+
if (repository === undefined || !/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/u.test(repository)) {
|
|
192
|
+
throw new GraphLinkError({
|
|
193
|
+
kind: "reference", value: `catalogs.${kind}`,
|
|
194
|
+
reason: "Catalog download URLs require one exact GitHub source repository."
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
const sources = catalog.sources.map((source) => {
|
|
198
|
+
const artifact = artifacts.find((candidate) => candidate.id.toString() === source.artifact.toString())
|
|
199
|
+
if (artifact === undefined || artifact.kind !== "archive") throw new GraphLinkError({
|
|
200
|
+
kind: "reference", value: source.artifact.toString(),
|
|
201
|
+
reason: `${kind} catalogs require declared archive artifacts.`
|
|
202
|
+
})
|
|
203
|
+
const filename = NonEmptyName.make(basename(artifact.path.toString()))
|
|
204
|
+
return CatalogRenderSource.make({
|
|
205
|
+
artifactId: source.artifact,
|
|
206
|
+
architecture: source.architecture,
|
|
207
|
+
filename,
|
|
208
|
+
url: `https://github.com/${repository}/releases/download/${encodeURIComponent(config.project.tag)}/${encodeURIComponent(filename)}`
|
|
209
|
+
})
|
|
210
|
+
}).sort((left, right) => left.architecture < right.architecture ? -1 : left.architecture > right.architecture ? 1 : 0)
|
|
211
|
+
if (new Set(sources.map((source) => source.architecture)).size !== sources.length) throw new GraphLinkError({
|
|
212
|
+
kind: "duplicate", value: catalog.id.toString(), reason: `${kind} catalog repeats one architecture.`
|
|
213
|
+
})
|
|
214
|
+
if (kind === "scoop" && sources.some((source) => !source.filename.toString().endsWith(".zip"))) throw new GraphLinkError({
|
|
215
|
+
kind: "reference", value: catalog.id.toString(), reason: "Scoop catalogs support ZIP archives only."
|
|
216
|
+
})
|
|
217
|
+
const renderer = kind === "homebrew"
|
|
218
|
+
? HomebrewRenderer.make({
|
|
219
|
+
name: (catalog as CandidateHomebrewCatalog).formulaName,
|
|
220
|
+
description: catalog.description,
|
|
221
|
+
homepage: catalog.homepage,
|
|
222
|
+
...(catalog.license === undefined ? {} : { license: catalog.license }),
|
|
223
|
+
installPath: (catalog as CandidateHomebrewCatalog).installPath
|
|
224
|
+
})
|
|
225
|
+
: ScoopRenderer.make({
|
|
226
|
+
name: (catalog as CandidateScoopCatalog).manifestName,
|
|
227
|
+
description: catalog.description,
|
|
228
|
+
homepage: catalog.homepage,
|
|
229
|
+
...(catalog.license === undefined ? {} : { license: catalog.license }),
|
|
230
|
+
bin: (catalog as CandidateScoopCatalog).bin
|
|
231
|
+
})
|
|
232
|
+
return {
|
|
233
|
+
id: catalog.id.toString(),
|
|
234
|
+
renderer,
|
|
235
|
+
sources: sources as [CatalogRenderSource, ...Array<CatalogRenderSource>],
|
|
236
|
+
output: output(
|
|
237
|
+
`catalog-${catalog.id}`,
|
|
238
|
+
`.release/catalogs/${catalog.id}.${kind === "homebrew" ? "rb" : "json"}`,
|
|
239
|
+
"file",
|
|
240
|
+
kind === "homebrew" ? "text/x-ruby" : "application/json"
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (selected !== "scoop") for (const catalog of config.catalogs?.homebrew ?? []) rows.push(build("homebrew", catalog))
|
|
245
|
+
if (selected !== "homebrew") for (const catalog of config.catalogs?.scoop ?? []) rows.push(build("scoop", catalog))
|
|
246
|
+
if (new Set(rows.map((row) => row.id)).size !== rows.length) throw new GraphLinkError({
|
|
247
|
+
kind: "duplicate", value: "catalogs", reason: "Catalog renderer ids must be unique across Homebrew and Scoop."
|
|
248
|
+
})
|
|
249
|
+
if (rows.length > 0) canonicalCatalogVersion(config.project.version.toString())
|
|
250
|
+
return rows
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export const contributeCatalogRendering = (
|
|
254
|
+
config: CandidateConfig,
|
|
255
|
+
artifacts: ReadonlyArray<OutputDeclaration>,
|
|
256
|
+
kind: "homebrew" | "scoop"
|
|
257
|
+
): CapabilityContribution => CapabilityContribution.make({
|
|
258
|
+
artifacts: [],
|
|
259
|
+
preparations: catalogRows(config, artifacts, kind).map((row) => GraphCatalogRender.make({
|
|
260
|
+
id: OperationId.make(`catalog:render:${row.id}`),
|
|
261
|
+
inputs: row.sources.map((source) => source.artifactId) as [OutputId, ...Array<OutputId>],
|
|
262
|
+
output: row.output,
|
|
263
|
+
version: config.project.version,
|
|
264
|
+
renderer: row.renderer,
|
|
265
|
+
sources: row.sources
|
|
266
|
+
})),
|
|
267
|
+
publications: []
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
export const contributeCatalogPublications = (
|
|
271
|
+
config: CandidateConfig,
|
|
272
|
+
artifacts: ReadonlyArray<OutputDeclaration>
|
|
273
|
+
): CapabilityContribution => {
|
|
274
|
+
const destinations = config.publish?.catalogGit
|
|
275
|
+
if (destinations === undefined) return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [] })
|
|
276
|
+
const rows = catalogRows(config, artifacts)
|
|
277
|
+
const sourceRepository = config.publish?.github?.repository ?? config.project.repository
|
|
278
|
+
if (config.publish?.github === undefined || sourceRepository === undefined) throw new GraphLinkError({
|
|
279
|
+
kind: "reference", value: "publish.catalogGit",
|
|
280
|
+
reason: "Catalog delivery requires an installed GitHub release publication for every referenced download."
|
|
281
|
+
})
|
|
282
|
+
const selectedGithubIds = config.publish.github.ids ?? artifacts.filter((artifact) =>
|
|
283
|
+
["archive", "executable", "file", "digest"].includes(artifact.kind)).map((artifact) => artifact.id)
|
|
284
|
+
const publications = destinations.map((destination) => {
|
|
285
|
+
const row = rows.find((candidate) => candidate.id === destination.catalog.toString())
|
|
286
|
+
if (row === undefined) throw new GraphLinkError({
|
|
287
|
+
kind: "missing", value: destination.catalog.toString(), reason: "Catalog delivery references no typed renderer."
|
|
288
|
+
})
|
|
289
|
+
if (row.sources.some((source) => !selectedGithubIds.some((id) => id.toString() === source.artifactId.toString()))) {
|
|
290
|
+
throw new GraphLinkError({
|
|
291
|
+
kind: "reference", value: destination.catalog.toString(),
|
|
292
|
+
reason: "Catalog delivery is blocked unless every download artifact belongs to the exact GitHub release publication."
|
|
293
|
+
})
|
|
294
|
+
}
|
|
295
|
+
const targetPath = destination.targetPath.toString()
|
|
296
|
+
const statePath = destination.statePath.toString()
|
|
297
|
+
if (targetPath === statePath || targetPath.startsWith(`${statePath}/`) || statePath.startsWith(`${targetPath}/`)) {
|
|
298
|
+
throw new GraphLinkError({
|
|
299
|
+
kind: "path", value: targetPath, reason: "Catalog target and managed-state paths must be disjoint files."
|
|
300
|
+
})
|
|
301
|
+
}
|
|
302
|
+
return GraphCatalogPublication.make({
|
|
303
|
+
id: OperationId.make(`zz:catalog-git:${row.id}`),
|
|
304
|
+
catalogId: NonEmptyName.make(row.id),
|
|
305
|
+
targetArtifact: row.output.id,
|
|
306
|
+
repository: destination.repository,
|
|
307
|
+
branch: destination.branch,
|
|
308
|
+
targetPath: destination.targetPath,
|
|
309
|
+
statePath: destination.statePath,
|
|
310
|
+
version: config.project.version,
|
|
311
|
+
sourceRepository: GitHubRepositoryCoordinate.make(sourceRepository),
|
|
312
|
+
sourceTag: config.project.tag,
|
|
313
|
+
renderer: row.renderer,
|
|
314
|
+
sources: row.sources,
|
|
315
|
+
authority: makeCatalogPublicationAuthorityIntent({
|
|
316
|
+
repository: destination.repository,
|
|
317
|
+
branch: destination.branch,
|
|
318
|
+
targetPath: destination.targetPath,
|
|
319
|
+
statePath: destination.statePath,
|
|
320
|
+
tokenEnv: destination.tokenEnv
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
})
|
|
324
|
+
return CapabilityContribution.make({ artifacts: [], preparations: [], publications })
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export const contributeNpmPublication = (
|
|
328
|
+
config: CandidateConfig,
|
|
329
|
+
context: VerifiedReleaseContext
|
|
330
|
+
): CapabilityContribution => {
|
|
331
|
+
const intent = config.publish?.npm
|
|
332
|
+
if (intent === undefined) return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [] })
|
|
333
|
+
// Resolution is intentionally plain durable data. Decode the nested variant
|
|
334
|
+
// exactly once as it enters the class-backed graph IR.
|
|
335
|
+
const authentication = Schema.decodeUnknownSync(NpmAuthentication, {
|
|
336
|
+
onExcessProperty: "error"
|
|
337
|
+
})(intent.authentication)
|
|
338
|
+
const publication = GraphNpmPublication.make({
|
|
339
|
+
id: OperationId.make("npm:npm-release"),
|
|
340
|
+
packageArtifact: intent.packageArtifact,
|
|
341
|
+
packageName: intent.packageName,
|
|
342
|
+
version: config.project.version,
|
|
343
|
+
registryUrl: intent.registry,
|
|
344
|
+
distTag: intent.distTag,
|
|
345
|
+
access: intent.access,
|
|
346
|
+
authentication,
|
|
347
|
+
provenance: intent.provenance,
|
|
348
|
+
authority: makeNpmPublicationAuthorityIntent({
|
|
349
|
+
packageName: intent.packageName.toString(),
|
|
350
|
+
version: config.project.version.toString(),
|
|
351
|
+
registryUrl: intent.registry,
|
|
352
|
+
distTag: intent.distTag,
|
|
353
|
+
authentication,
|
|
354
|
+
sourceCommit: context.source.commit.toString()
|
|
355
|
+
})
|
|
356
|
+
})
|
|
357
|
+
return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [publication] })
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export const contributeGitHubPublication = (
|
|
361
|
+
config: CandidateConfig,
|
|
362
|
+
artifacts: ReadonlyArray<OutputDeclaration>
|
|
363
|
+
): CapabilityContribution => {
|
|
364
|
+
const authored = config.publish?.github
|
|
365
|
+
const repository = authored?.repository ?? config.project.repository
|
|
366
|
+
if (authored === undefined || repository === undefined) return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [] })
|
|
367
|
+
const publication = GraphGitHubPublication.make({
|
|
368
|
+
id: OperationId.make("github:github-release"),
|
|
369
|
+
repository,
|
|
370
|
+
tag: config.project.tag,
|
|
371
|
+
draft: authored.draft ?? true,
|
|
372
|
+
prerelease: authored.prerelease === "auto"
|
|
373
|
+
? config.project.version.includes("-")
|
|
374
|
+
: authored.prerelease ?? false,
|
|
375
|
+
title: NonEmptyName.make(`${config.project.name} ${config.project.version}`),
|
|
376
|
+
...(authored.bodyArtifact === undefined
|
|
377
|
+
? authored.body === undefined ? {} : { body: authored.body }
|
|
378
|
+
: { bodyArtifact: authored.bodyArtifact }),
|
|
379
|
+
assetIds: authored.ids ?? artifacts.filter((item) =>
|
|
380
|
+
["archive", "executable", "file", "digest"].includes(item.kind)).map((item) => item.id),
|
|
381
|
+
assetCollections: (authored.collections ?? []).map(decodeCollectionSelector),
|
|
382
|
+
authority: makeGitHubPublicationAuthorityIntent({
|
|
383
|
+
repository,
|
|
384
|
+
tag: config.project.tag.toString(),
|
|
385
|
+
...(authored.tokenEnv === undefined ? {} : { tokenEnv: authored.tokenEnv })
|
|
386
|
+
})
|
|
387
|
+
})
|
|
388
|
+
return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [publication] })
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export const contributePyPiPublication = (
|
|
392
|
+
config: CandidateConfig,
|
|
393
|
+
context: VerifiedReleaseContext,
|
|
394
|
+
artifacts: ReadonlyArray<OutputDeclaration>
|
|
395
|
+
): CapabilityContribution => {
|
|
396
|
+
const intent = config.publish?.pypi
|
|
397
|
+
if (intent === undefined) return CapabilityContribution.make({ artifacts: [], preparations: [], publications: [] })
|
|
398
|
+
const authentication = Schema.decodeUnknownSync(PyPiAuthentication, {
|
|
399
|
+
onExcessProperty: "error"
|
|
400
|
+
})(intent.authentication)
|
|
401
|
+
const endpoints = pypiRepositoryEndpoints(intent.repository)
|
|
402
|
+
const files = intent.artifacts.map((id) => {
|
|
403
|
+
const declaration = artifacts.find((artifact) => artifact.id.toString() === id.toString())
|
|
404
|
+
if (declaration === undefined) throw new GraphLinkError({
|
|
405
|
+
kind: "missing", value: id.toString(), reason: "PyPI publication references no declared artifact."
|
|
406
|
+
})
|
|
407
|
+
const filename = basename(declaration.path.toString())
|
|
408
|
+
return GraphPyPiDistribution.make({
|
|
409
|
+
artifactId: id,
|
|
410
|
+
filename: NonEmptyName.make(filename),
|
|
411
|
+
authority: makePyPiPublicationAuthorityIntent({
|
|
412
|
+
project: intent.project,
|
|
413
|
+
version: intent.version,
|
|
414
|
+
filename,
|
|
415
|
+
repository: intent.repository,
|
|
416
|
+
authentication,
|
|
417
|
+
sourceCommit: context.source.commit.toString()
|
|
418
|
+
})
|
|
419
|
+
})
|
|
420
|
+
}) as [GraphPyPiDistribution, ...Array<GraphPyPiDistribution>]
|
|
421
|
+
return CapabilityContribution.make({
|
|
422
|
+
artifacts: [], preparations: [], publications: [GraphPyPiPublication.make({
|
|
423
|
+
id: OperationId.make("pypi:pypi-release"),
|
|
424
|
+
project: intent.project,
|
|
425
|
+
version: intent.version,
|
|
426
|
+
repository: intent.repository,
|
|
427
|
+
simpleBaseUrl: endpoints.simpleBaseUrl,
|
|
428
|
+
projectUrl: `${endpoints.simpleBaseUrl}${encodeURIComponent(intent.project)}/`,
|
|
429
|
+
uploadUrl: endpoints.uploadUrl,
|
|
430
|
+
authentication,
|
|
431
|
+
files
|
|
432
|
+
})]
|
|
433
|
+
})
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export const contributeRelease = (config: CandidateConfig, context: VerifiedReleaseContext): ReadonlyArray<CapabilityContribution> => {
|
|
437
|
+
const build = contributeSourceArtifacts(config, context)
|
|
438
|
+
const buildOutputs = [...build.artifacts, ...build.preparations.flatMap(preparationOutputs)]
|
|
439
|
+
const packaged = contributePackages(config, buildOutputs, context)
|
|
440
|
+
const allArtifacts = [...buildOutputs, ...packaged.preparations.flatMap(preparationOutputs)]
|
|
441
|
+
const homebrew = contributeCatalogRendering(config, allArtifacts, "homebrew")
|
|
442
|
+
const scoop = contributeCatalogRendering(config, allArtifacts, "scoop")
|
|
443
|
+
const renderedArtifacts = [...allArtifacts, ...homebrew.preparations.flatMap(preparationOutputs), ...scoop.preparations.flatMap(preparationOutputs)]
|
|
444
|
+
return [
|
|
445
|
+
build,
|
|
446
|
+
packaged,
|
|
447
|
+
homebrew,
|
|
448
|
+
scoop,
|
|
449
|
+
contributeNpmPublication(config, context),
|
|
450
|
+
contributePyPiPublication(config, context, renderedArtifacts),
|
|
451
|
+
contributeGitHubPublication(config, renderedArtifacts),
|
|
452
|
+
contributeCatalogPublications(config, renderedArtifacts)
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const preparationOutputs = (preparation: CapabilityContribution["preparations"][number]): ReadonlyArray<OutputDeclaration> =>
|
|
457
|
+
preparation._tag === "GraphCommandArtifact" ? preparation.outputs
|
|
458
|
+
: preparation._tag === "GraphArchive" || preparation._tag === "GraphChecksum" || preparation._tag === "GraphCatalogRender"
|
|
459
|
+
? [preparation.output] : []
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReleaseIntent } from "./config.js"
|
|
2
|
+
import type { VerifiedReleaseContext } from "./context.js"
|
|
3
|
+
import {
|
|
4
|
+
preparationCapabilities,
|
|
5
|
+
publicationCapabilities
|
|
6
|
+
} from "../capabilities/registry.js"
|
|
7
|
+
import type { CapabilityContribution } from "./graph.js"
|
|
8
|
+
import { linkContributions, ReleaseGraph } from "./graph.js"
|
|
9
|
+
|
|
10
|
+
// Pure internal IR compiler. It reads only its arguments; the source observer
|
|
11
|
+
// and prepared store are deliberately outside this function.
|
|
12
|
+
export const compileReleaseGraph = (
|
|
13
|
+
intent: ReleaseIntent,
|
|
14
|
+
context: VerifiedReleaseContext
|
|
15
|
+
): ReleaseGraph => {
|
|
16
|
+
const contributions: Array<CapabilityContribution> = []
|
|
17
|
+
let artifacts: ReleaseGraph["artifacts"] = []
|
|
18
|
+
for (const phase of ["source", "package", "render"] as const) {
|
|
19
|
+
for (const module of preparationCapabilities.filter((candidate) => candidate.phase === phase)) {
|
|
20
|
+
contributions.push(module.contribute({ config: intent, context, availableArtifacts: artifacts }))
|
|
21
|
+
}
|
|
22
|
+
artifacts = linkContributions(contributions).artifacts
|
|
23
|
+
}
|
|
24
|
+
for (const module of publicationCapabilities) {
|
|
25
|
+
contributions.push(module.contribute({ config: intent, context, availableArtifacts: artifacts }))
|
|
26
|
+
}
|
|
27
|
+
return linkContributions(contributions)
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema"
|
|
2
|
+
import { CandidateConfig } from "../recipes/config.js"
|
|
3
|
+
|
|
4
|
+
// The graph kernel consumes the already-decoded candidate value. Keeping this
|
|
5
|
+
// alias at the new owner makes the migration boundary explicit; public input
|
|
6
|
+
// decoding is cut over by plan 217, while no second semantic schema is added.
|
|
7
|
+
export const ReleaseIntent = CandidateConfig
|
|
8
|
+
export type ReleaseIntent = typeof CandidateConfig.Type
|
|
9
|
+
|
|
10
|
+
export const decodeReleaseIntent = Schema.decodeUnknownSync(ReleaseIntent, {
|
|
11
|
+
onExcessProperty: "error"
|
|
12
|
+
})
|