@mannyc1/ts-release 0.0.6 → 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 -87
- package/CHANGELOG.md +115 -0
- package/LICENSE +21 -0
- package/README.md +272 -540
- package/SPEC.md +206 -305
- 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 +61 -154
- 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 -59
- package/templates/bun-cli-github/README.md +12 -0
- package/templates/bun-cli-github/release.config.json +51 -0
- 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/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 -36
- package/dist/domain/artifact.d.ts.map +0 -1
- package/dist/domain/artifact.js +0 -29
- package/dist/domain/artifact.js.map +0 -1
- package/dist/domain/evidence.d.ts +0 -108
- package/dist/domain/evidence.d.ts.map +0 -1
- package/dist/domain/evidence.js +0 -96
- package/dist/domain/evidence.js.map +0 -1
- package/dist/domain/operation.d.ts +0 -153
- package/dist/domain/operation.d.ts.map +0 -1
- package/dist/domain/operation.js +0 -320
- package/dist/domain/operation.js.map +0 -1
- package/dist/domain/release.d.ts +0 -141
- package/dist/domain/release.d.ts.map +0 -1
- package/dist/domain/release.js +0 -127
- package/dist/domain/release.js.map +0 -1
- package/dist/domain/remote-state.d.ts +0 -85
- package/dist/domain/remote-state.d.ts.map +0 -1
- package/dist/domain/remote-state.js +0 -77
- package/dist/domain/remote-state.js.map +0 -1
- package/dist/domain/status.d.ts +0 -43
- package/dist/domain/status.d.ts.map +0 -1
- package/dist/domain/status.js +0 -51
- package/dist/domain/status.js.map +0 -1
- package/dist/domain/target.d.ts +0 -135
- package/dist/domain/target.d.ts.map +0 -1
- package/dist/domain/target.js +0 -137
- 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/workflow-phases.d.ts +0 -3
- package/dist/internal/workflow-phases.d.ts.map +0 -1
- package/dist/internal/workflow-phases.js +0 -2
- package/dist/internal/workflow-phases.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 -84
- 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 -81
- package/dist/planner/errors.d.ts.map +0 -1
- package/dist/planner/errors.js +0 -70
- package/dist/planner/errors.js.map +0 -1
- package/dist/planner/evidence-recorder.d.ts +0 -26
- package/dist/planner/evidence-recorder.d.ts.map +0 -1
- package/dist/planner/evidence-recorder.js +0 -330
- 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 -159
- package/dist/planner/executor.js.map +0 -1
- package/dist/planner/normalize-release.d.ts +0 -16
- package/dist/planner/normalize-release.d.ts.map +0 -1
- package/dist/planner/normalize-release.js +0 -218
- 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 -261
- package/dist/planner/reconcile.js.map +0 -1
- package/dist/planner/release-eligibility.d.ts +0 -39
- package/dist/planner/release-eligibility.d.ts.map +0 -1
- package/dist/planner/release-eligibility.js +0 -578
- package/dist/planner/release-eligibility.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 -238
- package/dist/planner/render-plan.js.map +0 -1
- package/dist/planner/status.d.ts +0 -40
- package/dist/planner/status.d.ts.map +0 -1
- package/dist/planner/status.js +0 -313
- package/dist/planner/status.js.map +0 -1
- package/dist/targets/adapter-helpers.d.ts +0 -64
- package/dist/targets/adapter-helpers.d.ts.map +0 -1
- package/dist/targets/adapter-helpers.js +0 -124
- 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 -125
- 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 -97
- 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 -118
- 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 -103
- 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 -78
- 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 -252
- package/dist/workflows/config.d.ts.map +0 -1
- package/dist/workflows/config.js +0 -465
- 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 -527
- package/dist/workflows/diagnostics.js.map +0 -1
- package/dist/workflows/evidence.d.ts +0 -26
- package/dist/workflows/evidence.d.ts.map +0 -1
- package/dist/workflows/evidence.js +0 -44
- package/dist/workflows/evidence.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -7
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -6
- 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 -441
- 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,164 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Argument from "effect/unstable/cli/Argument"
|
|
3
|
+
import * as Command from "effect/unstable/cli/Command"
|
|
4
|
+
import * as Flag from "effect/unstable/cli/Flag"
|
|
5
|
+
import {
|
|
6
|
+
commandNames,
|
|
7
|
+
decodeLocalPreparedReference,
|
|
8
|
+
defaultStoreDirectory,
|
|
9
|
+
resolveStoreDirectory,
|
|
10
|
+
runCorrect,
|
|
11
|
+
runInit,
|
|
12
|
+
runInspect,
|
|
13
|
+
runObserve,
|
|
14
|
+
runPrepare,
|
|
15
|
+
runPublish,
|
|
16
|
+
runRelease,
|
|
17
|
+
type CliApi,
|
|
18
|
+
type CliApiFactory,
|
|
19
|
+
type CliIo
|
|
20
|
+
} from "./commands.js"
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
commandNames,
|
|
24
|
+
type CliApi,
|
|
25
|
+
type CliApiFactory,
|
|
26
|
+
type CliIo
|
|
27
|
+
} from "./commands.js"
|
|
28
|
+
|
|
29
|
+
const text = (name: string, fallback?: string) => fallback === undefined
|
|
30
|
+
? Flag.string(name)
|
|
31
|
+
: Flag.string(name).pipe(Flag.withDefault(fallback))
|
|
32
|
+
|
|
33
|
+
const optionalText = (name: string) => Flag.string(name).pipe(Flag.optional)
|
|
34
|
+
const optionalArgument = (name: string) => Argument.string(name).pipe(Argument.optional)
|
|
35
|
+
|
|
36
|
+
const at = <A>(value: import("effect/Option").Option<A>): A | undefined =>
|
|
37
|
+
value._tag === "Some" ? value.value : undefined
|
|
38
|
+
|
|
39
|
+
const promise = <A>(evaluate: () => Promise<A>) => Effect.tryPromise({
|
|
40
|
+
try: evaluate,
|
|
41
|
+
catch: (cause) => cause
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export const makeCli = (
|
|
45
|
+
makeApi: CliApiFactory,
|
|
46
|
+
cwd: string,
|
|
47
|
+
io: CliIo
|
|
48
|
+
) => {
|
|
49
|
+
const application = Command.make("ts-release").pipe(
|
|
50
|
+
Command.withDescription("Deterministic preparation, publication, and correction."),
|
|
51
|
+
Command.withSharedFlags({
|
|
52
|
+
store: text("store", defaultStoreDirectory(cwd))
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
const withApi = (operation: (api: CliApi) => Promise<void>) => Effect.gen(function*() {
|
|
57
|
+
const { store } = yield* application
|
|
58
|
+
const api = yield* Effect.try({
|
|
59
|
+
try: () => makeApi(resolveStoreDirectory(cwd, store)),
|
|
60
|
+
catch: (cause) => cause
|
|
61
|
+
})
|
|
62
|
+
yield* Effect.acquireUseRelease(
|
|
63
|
+
Effect.succeed(api),
|
|
64
|
+
() => promise(() => operation(api)),
|
|
65
|
+
() => Effect.promise(() => api.dispose())
|
|
66
|
+
)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const decode = (value: string) => promise(() => decodeLocalPreparedReference(value))
|
|
70
|
+
|
|
71
|
+
const initCommand = Command.make("init", {
|
|
72
|
+
config: text("config", "release.config.json"),
|
|
73
|
+
root: text("root", "."),
|
|
74
|
+
dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)),
|
|
75
|
+
force: Flag.boolean("force").pipe(Flag.withDefault(false)),
|
|
76
|
+
preset: Flag.choice("preset", ["bun-npm-github"] as const).pipe(Flag.optional),
|
|
77
|
+
prepareOnly: Flag.boolean("prepare-only").pipe(Flag.withDefault(false))
|
|
78
|
+
}, (options) => {
|
|
79
|
+
const preset = at(options.preset) as "bun-npm-github" | undefined
|
|
80
|
+
const { preset: _preset, ...rest } = options
|
|
81
|
+
return withApi((api) => runInit(
|
|
82
|
+
api,
|
|
83
|
+
{ ...rest, ...(preset === undefined ? {} : { preset }) },
|
|
84
|
+
cwd,
|
|
85
|
+
io
|
|
86
|
+
))
|
|
87
|
+
}).pipe(Command.withDescription(
|
|
88
|
+
"Create an explicit automatic-release preset or a preparation-only configuration."
|
|
89
|
+
))
|
|
90
|
+
|
|
91
|
+
const inspectCommand = Command.make("inspect", {
|
|
92
|
+
prepared: optionalArgument("prepared"),
|
|
93
|
+
config: optionalText("config"),
|
|
94
|
+
root: text("root", ".")
|
|
95
|
+
}, (options) => Effect.gen(function*() {
|
|
96
|
+
const preparedText = at(options.prepared)
|
|
97
|
+
const prepared = preparedText === undefined
|
|
98
|
+
? undefined
|
|
99
|
+
: yield* decode(preparedText)
|
|
100
|
+
const config = at(options.config)
|
|
101
|
+
yield* withApi((api) => runInspect(api, {
|
|
102
|
+
root: options.root,
|
|
103
|
+
...(config === undefined ? {} : { config }),
|
|
104
|
+
...(prepared === undefined ? {} : { prepared })
|
|
105
|
+
}, cwd, io))
|
|
106
|
+
})).pipe(Command.withDescription("Inspect authored configuration or a prepared release."))
|
|
107
|
+
|
|
108
|
+
const prepareCommand = Command.make("prepare", {
|
|
109
|
+
config: text("config", "release.config.json"),
|
|
110
|
+
root: text("root", ".")
|
|
111
|
+
}, (options) => withApi((api) => runPrepare(api, options, cwd, io))).pipe(
|
|
112
|
+
Command.withDescription("Build and durably store an exact prepared release bundle.")
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const observeCommand = Command.make("observe", {
|
|
116
|
+
prepared: Argument.string("prepared").pipe(
|
|
117
|
+
Argument.withDescription("Canonical local prepared reference.")
|
|
118
|
+
)
|
|
119
|
+
}, (options) => Effect.gen(function*() {
|
|
120
|
+
const prepared = yield* decode(options.prepared)
|
|
121
|
+
yield* withApi((api) => runObserve(api, { prepared }, cwd, io))
|
|
122
|
+
})).pipe(Command.withDescription("Observe a prepared release without mutation."))
|
|
123
|
+
|
|
124
|
+
const publishCommand = Command.make("publish", {
|
|
125
|
+
prepared: Argument.string("prepared").pipe(
|
|
126
|
+
Argument.withDescription("Canonical local prepared reference.")
|
|
127
|
+
)
|
|
128
|
+
}, (options) => Effect.gen(function*() {
|
|
129
|
+
const prepared = yield* decode(options.prepared)
|
|
130
|
+
yield* withApi((api) => runPublish(api, { prepared }, cwd, io))
|
|
131
|
+
})).pipe(Command.withDescription("Observe and publish one prepared release."))
|
|
132
|
+
|
|
133
|
+
const releaseCommand = Command.make("release", {
|
|
134
|
+
config: text("config", "release.config.json"),
|
|
135
|
+
root: text("root", ".")
|
|
136
|
+
}, (options) => withApi((api) => runRelease(api, options, cwd, io))).pipe(
|
|
137
|
+
Command.withDescription("Prepare, durably store, and publish automatically.")
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
const correctCommand = Command.make("correct", {
|
|
141
|
+
prepared: Argument.string("prepared").pipe(
|
|
142
|
+
Argument.withDescription("Canonical local prepared reference.")
|
|
143
|
+
),
|
|
144
|
+
correction: Argument.string("correction").pipe(
|
|
145
|
+
Argument.withDescription("Authored correction file.")
|
|
146
|
+
)
|
|
147
|
+
}, (options) => Effect.gen(function*() {
|
|
148
|
+
const prepared = yield* decode(options.prepared)
|
|
149
|
+
yield* withApi((api) => runCorrect(api, {
|
|
150
|
+
prepared,
|
|
151
|
+
correction: options.correction
|
|
152
|
+
}, cwd, io))
|
|
153
|
+
})).pipe(Command.withDescription("Apply one provider-specific forward correction."))
|
|
154
|
+
|
|
155
|
+
return application.pipe(Command.withSubcommands([
|
|
156
|
+
initCommand,
|
|
157
|
+
inspectCommand,
|
|
158
|
+
prepareCommand,
|
|
159
|
+
observeCommand,
|
|
160
|
+
publishCommand,
|
|
161
|
+
releaseCommand,
|
|
162
|
+
correctCommand
|
|
163
|
+
]))
|
|
164
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReleaseAbortedError,
|
|
3
|
+
ReleaseIncompleteError,
|
|
4
|
+
ReleasePreparationError,
|
|
5
|
+
decodeCompletePreparedReleaseRef,
|
|
6
|
+
encodeCompletePreparedReleaseRef,
|
|
7
|
+
type CompletePreparedReleaseRef,
|
|
8
|
+
type CorrectInput,
|
|
9
|
+
type InspectOutput,
|
|
10
|
+
type LocalCompletePreparedReleaseRef,
|
|
11
|
+
type ReleaseApi
|
|
12
|
+
} from "@mannyc1/ts-release"
|
|
13
|
+
import * as Effect from "effect/Effect"
|
|
14
|
+
import * as Schema from "effect/Schema"
|
|
15
|
+
import { realpathSync } from "node:fs"
|
|
16
|
+
import { dirname, isAbsolute, resolve } from "node:path"
|
|
17
|
+
|
|
18
|
+
export const commandNames = [
|
|
19
|
+
"init",
|
|
20
|
+
"inspect",
|
|
21
|
+
"prepare",
|
|
22
|
+
"observe",
|
|
23
|
+
"publish",
|
|
24
|
+
"release",
|
|
25
|
+
"correct"
|
|
26
|
+
] as const
|
|
27
|
+
|
|
28
|
+
export interface CliIo {
|
|
29
|
+
readonly read: (path: string) => string
|
|
30
|
+
readonly write: (path: string, value: string) => void
|
|
31
|
+
readonly log: (value: string) => void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type CliApi = Pick<
|
|
35
|
+
ReleaseApi,
|
|
36
|
+
"inspect" | "prepare" | "observe" | "publish" | "release" | "correct"
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export type DisposableCliApi = CliApi & Pick<ReleaseApi, "dispose">
|
|
40
|
+
export type CliApiFactory = (storeDirectory: string) => DisposableCliApi
|
|
41
|
+
|
|
42
|
+
export class HostedPreparedReferenceUnsupported
|
|
43
|
+
extends Schema.TaggedErrorClass<HostedPreparedReferenceUnsupported>()(
|
|
44
|
+
"HostedPreparedReferenceUnsupported",
|
|
45
|
+
{
|
|
46
|
+
prepared: Schema.String,
|
|
47
|
+
reason: Schema.String
|
|
48
|
+
}
|
|
49
|
+
) {}
|
|
50
|
+
|
|
51
|
+
const json = (io: CliIo, path: string): unknown =>
|
|
52
|
+
JSON.parse(io.read(realpathSync(path))) as unknown
|
|
53
|
+
|
|
54
|
+
const pathFrom = (cwd: string, value: string): string =>
|
|
55
|
+
isAbsolute(value) ? value : resolve(cwd, value)
|
|
56
|
+
|
|
57
|
+
const workspaceFor = (cwd: string, config: string, root: string | undefined): string =>
|
|
58
|
+
realpathSync(root === undefined
|
|
59
|
+
? isAbsolute(config)
|
|
60
|
+
? dirname(pathFrom(cwd, config))
|
|
61
|
+
: cwd
|
|
62
|
+
: pathFrom(cwd, root))
|
|
63
|
+
|
|
64
|
+
export const defaultStoreDirectory = (cwd: string): string =>
|
|
65
|
+
resolve(cwd, ".release", "ts-release", "prepared")
|
|
66
|
+
|
|
67
|
+
export const resolveStoreDirectory = (cwd: string, value: string): string =>
|
|
68
|
+
pathFrom(cwd, value)
|
|
69
|
+
|
|
70
|
+
const requireLocalPreparedReference = (
|
|
71
|
+
prepared: CompletePreparedReleaseRef
|
|
72
|
+
): LocalCompletePreparedReleaseRef => {
|
|
73
|
+
if (prepared.scheme === "local") return prepared
|
|
74
|
+
const encoded = encodeCompletePreparedReleaseRef(prepared)
|
|
75
|
+
throw new HostedPreparedReferenceUnsupported({
|
|
76
|
+
prepared: encoded,
|
|
77
|
+
reason: "This reference is loadable by a workflow job with actions:read; " +
|
|
78
|
+
"re-run the failed run's publish job or dispatch the recovery workflow " +
|
|
79
|
+
`with prepared-ref=${encoded}.`
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const decodeLocalPreparedReference = async (
|
|
84
|
+
value: string
|
|
85
|
+
): Promise<LocalCompletePreparedReleaseRef> => requireLocalPreparedReference(
|
|
86
|
+
await Effect.runPromise(decodeCompletePreparedReleaseRef(value))
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
export type InitPreset = "bun-npm-github"
|
|
90
|
+
|
|
91
|
+
export interface InitOptions {
|
|
92
|
+
readonly config: string
|
|
93
|
+
readonly root: string
|
|
94
|
+
readonly dryRun: boolean
|
|
95
|
+
readonly force: boolean
|
|
96
|
+
readonly preset?: InitPreset
|
|
97
|
+
readonly prepareOnly: boolean
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface InspectOptions {
|
|
101
|
+
readonly config?: string
|
|
102
|
+
readonly prepared?: LocalCompletePreparedReleaseRef
|
|
103
|
+
readonly root: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface PrepareOptions {
|
|
107
|
+
readonly config: string
|
|
108
|
+
readonly root: string
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ObserveOptions {
|
|
112
|
+
readonly prepared: LocalCompletePreparedReleaseRef
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface PublishOptions {
|
|
116
|
+
readonly prepared: LocalCompletePreparedReleaseRef
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ReleaseOptions {
|
|
120
|
+
readonly config: string
|
|
121
|
+
readonly root: string
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface CorrectOptions {
|
|
125
|
+
readonly prepared: LocalCompletePreparedReleaseRef
|
|
126
|
+
readonly correction: string
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const repositoryFromInspection = (inspection: InspectOutput): string => {
|
|
130
|
+
if (!("package" in inspection) || inspection.source.repository === undefined) {
|
|
131
|
+
throw new Error(
|
|
132
|
+
"The bun-npm-github preset requires a GitHub owner/repository coordinate " +
|
|
133
|
+
"from the origin remote or package.json repository field."
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
return inspection.source.repository
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const printJson = (io: CliIo, value: unknown): void =>
|
|
140
|
+
io.log(JSON.stringify(value, (_key, item) =>
|
|
141
|
+
typeof item === "object" && item !== null && !Array.isArray(item) &&
|
|
142
|
+
Object.getPrototypeOf(item) !== Object.prototype && Object.getPrototypeOf(item) !== null &&
|
|
143
|
+
"toString" in item && item.toString !== Object.prototype.toString &&
|
|
144
|
+
Object.keys(item).length === 1
|
|
145
|
+
? String(item)
|
|
146
|
+
: item))
|
|
147
|
+
|
|
148
|
+
const scopeWarning =
|
|
149
|
+
"publish re-observes every subject and mutates only what a provider decision authorizes; " +
|
|
150
|
+
"conflicts and unobservable outcomes still require operator action."
|
|
151
|
+
|
|
152
|
+
const unknownStateWarning =
|
|
153
|
+
"publish re-observes every subject; per-subject state is unknown until reobserved, " +
|
|
154
|
+
"and mutation occurs only after a provider decision."
|
|
155
|
+
|
|
156
|
+
const resumeLine = (prepared: LocalCompletePreparedReleaseRef): string =>
|
|
157
|
+
`Resume: ts-release publish ${encodeCompletePreparedReleaseRef(prepared)}`
|
|
158
|
+
|
|
159
|
+
const oneLine = (value: string): string => value.replace(/\s+/gu, " ").trim()
|
|
160
|
+
|
|
161
|
+
const printIncomplete = (
|
|
162
|
+
io: CliIo,
|
|
163
|
+
prepared: LocalCompletePreparedReleaseRef,
|
|
164
|
+
status: "blocked" | "uncertain"
|
|
165
|
+
): never => {
|
|
166
|
+
io.log(scopeWarning)
|
|
167
|
+
io.log(resumeLine(prepared))
|
|
168
|
+
throw new ReleaseIncompleteError({
|
|
169
|
+
prepared,
|
|
170
|
+
status,
|
|
171
|
+
reason: `The release report is ${status}; inspect the emitted report before resuming.`
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const printCaughtFailure = (io: CliIo, cause: unknown): void => {
|
|
176
|
+
if (cause instanceof ReleasePreparationError) {
|
|
177
|
+
io.log(
|
|
178
|
+
"No remote mutation was attempted. Fix " +
|
|
179
|
+
`${cause._tag}: ${oneLine(cause.cause)} and rerun 'ts-release release'.`
|
|
180
|
+
)
|
|
181
|
+
return
|
|
182
|
+
}
|
|
183
|
+
if (cause instanceof ReleaseAbortedError && cause.prepared?.scheme === "local") {
|
|
184
|
+
io.log(unknownStateWarning)
|
|
185
|
+
io.log(resumeLine(cause.prepared))
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const runInit = async (
|
|
190
|
+
api: CliApi,
|
|
191
|
+
options: InitOptions,
|
|
192
|
+
cwd: string,
|
|
193
|
+
io: CliIo
|
|
194
|
+
): Promise<void> => {
|
|
195
|
+
if (options.preset === undefined && !options.prepareOnly) {
|
|
196
|
+
throw new Error(
|
|
197
|
+
"Noninteractive init requires --preset bun-npm-github or --prepare-only; " +
|
|
198
|
+
"it never prompts or creates a green no-op release."
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
const workspace = realpathSync(pathFrom(cwd, options.root))
|
|
202
|
+
const config = options.prepareOnly
|
|
203
|
+
? { project: {}, versionFrom: "manifest" as const, publish: {} }
|
|
204
|
+
: await (async () => {
|
|
205
|
+
const discovered = await api.inspect({
|
|
206
|
+
config: { project: {}, versionFrom: "manifest", publish: {} },
|
|
207
|
+
workspace
|
|
208
|
+
})
|
|
209
|
+
const repository = repositoryFromInspection(discovered)
|
|
210
|
+
return {
|
|
211
|
+
project: { repository },
|
|
212
|
+
versionFrom: "manifest" as const,
|
|
213
|
+
npmPackage: { path: "." },
|
|
214
|
+
publish: {
|
|
215
|
+
npm: {
|
|
216
|
+
registry: "https://registry.npmjs.org/",
|
|
217
|
+
authentication: {
|
|
218
|
+
strategy: "trusted-publishing" as const,
|
|
219
|
+
attestation: {
|
|
220
|
+
provider: "github-actions" as const,
|
|
221
|
+
runner: "github-hosted" as const,
|
|
222
|
+
repository,
|
|
223
|
+
workflow: "release.yml",
|
|
224
|
+
workflowRef: "refs/heads/main",
|
|
225
|
+
allowedAction: "npm-publish-direct" as const
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
access: "public" as const,
|
|
229
|
+
provenance: "automatic" as const
|
|
230
|
+
},
|
|
231
|
+
github: {
|
|
232
|
+
repository,
|
|
233
|
+
tokenEnv: "GITHUB_TOKEN",
|
|
234
|
+
draft: true,
|
|
235
|
+
prerelease: false
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
})()
|
|
240
|
+
await api.inspect({ config, workspace })
|
|
241
|
+
const output = pathFrom(workspace, options.config)
|
|
242
|
+
if (!options.force) {
|
|
243
|
+
try {
|
|
244
|
+
io.read(output)
|
|
245
|
+
throw new Error(`Refusing to overwrite ${output}; pass --force.`)
|
|
246
|
+
} catch (cause) {
|
|
247
|
+
if (cause instanceof Error && cause.message.startsWith("Refusing")) throw cause
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const contents = `${JSON.stringify(config, null, 2)}\n`
|
|
251
|
+
if (!options.dryRun) io.write(output, contents)
|
|
252
|
+
printJson(io, { path: output, written: !options.dryRun })
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export const runInspect = async (
|
|
256
|
+
api: CliApi,
|
|
257
|
+
options: InspectOptions,
|
|
258
|
+
cwd: string,
|
|
259
|
+
io: CliIo
|
|
260
|
+
): Promise<void> => {
|
|
261
|
+
let result: InspectOutput
|
|
262
|
+
if (options.prepared !== undefined) {
|
|
263
|
+
if (options.config !== undefined) {
|
|
264
|
+
throw new Error("inspect accepts a prepared reference or --config, not both.")
|
|
265
|
+
}
|
|
266
|
+
result = await api.inspect({ prepared: options.prepared })
|
|
267
|
+
} else {
|
|
268
|
+
const config = options.config ?? "release.config.json"
|
|
269
|
+
result = await api.inspect({
|
|
270
|
+
config: json(io, pathFrom(cwd, config)),
|
|
271
|
+
workspace: workspaceFor(cwd, config, options.root)
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
printJson(io, result)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export const runPrepare = async (
|
|
278
|
+
api: CliApi,
|
|
279
|
+
options: PrepareOptions,
|
|
280
|
+
cwd: string,
|
|
281
|
+
io: CliIo
|
|
282
|
+
): Promise<void> => {
|
|
283
|
+
const prepared = requireLocalPreparedReference(await api.prepare({
|
|
284
|
+
config: json(io, pathFrom(cwd, options.config)),
|
|
285
|
+
workspace: workspaceFor(cwd, options.config, options.root)
|
|
286
|
+
}))
|
|
287
|
+
io.log(encodeCompletePreparedReleaseRef(prepared))
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export const runObserve = async (
|
|
291
|
+
api: CliApi,
|
|
292
|
+
options: ObserveOptions,
|
|
293
|
+
_cwd: string,
|
|
294
|
+
io: CliIo
|
|
295
|
+
): Promise<void> => {
|
|
296
|
+
printJson(io, await api.observe({ prepared: options.prepared }))
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export const runPublish = async (
|
|
300
|
+
api: CliApi,
|
|
301
|
+
options: PublishOptions,
|
|
302
|
+
_cwd: string,
|
|
303
|
+
io: CliIo
|
|
304
|
+
): Promise<void> => {
|
|
305
|
+
try {
|
|
306
|
+
const report = await api.publish({ prepared: options.prepared })
|
|
307
|
+
printJson(io, report)
|
|
308
|
+
if (report.status !== "complete") {
|
|
309
|
+
printIncomplete(io, options.prepared, report.status)
|
|
310
|
+
}
|
|
311
|
+
} catch (cause) {
|
|
312
|
+
printCaughtFailure(io, cause)
|
|
313
|
+
throw cause
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export const runRelease = async (
|
|
318
|
+
api: CliApi,
|
|
319
|
+
options: ReleaseOptions,
|
|
320
|
+
cwd: string,
|
|
321
|
+
io: CliIo
|
|
322
|
+
): Promise<void> => {
|
|
323
|
+
try {
|
|
324
|
+
const result = await api.release({
|
|
325
|
+
config: json(io, pathFrom(cwd, options.config)),
|
|
326
|
+
workspace: workspaceFor(cwd, options.config, options.root)
|
|
327
|
+
})
|
|
328
|
+
const prepared = requireLocalPreparedReference(result.prepared)
|
|
329
|
+
printJson(io, {
|
|
330
|
+
prepared: encodeCompletePreparedReleaseRef(prepared),
|
|
331
|
+
report: result.report
|
|
332
|
+
})
|
|
333
|
+
if (result.report.status !== "complete") {
|
|
334
|
+
printIncomplete(io, prepared, result.report.status)
|
|
335
|
+
}
|
|
336
|
+
} catch (cause) {
|
|
337
|
+
printCaughtFailure(io, cause)
|
|
338
|
+
throw cause
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export const runCorrect = async (
|
|
343
|
+
api: CliApi,
|
|
344
|
+
options: CorrectOptions,
|
|
345
|
+
cwd: string,
|
|
346
|
+
io: CliIo
|
|
347
|
+
): Promise<void> => {
|
|
348
|
+
const correctionPath = realpathSync(pathFrom(cwd, options.correction))
|
|
349
|
+
const correction = json(io, correctionPath) as CorrectInput["correction"]
|
|
350
|
+
printJson(io, await api.correct({ prepared: options.prepared, correction }))
|
|
351
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Invariant: this executable composes the Bun host layer once, runs exactly one
|
|
3
|
+
// decoded command, and disposes what it created. Two runtimes with disjoint
|
|
4
|
+
// duties meet here: the CLI runtime parses argv and renders, while the api's
|
|
5
|
+
// ManagedRuntime owns the release services.
|
|
6
|
+
import * as BunRuntime from "@effect/platform-bun/BunRuntime"
|
|
7
|
+
import * as BunServices from "@effect/platform-bun/BunServices"
|
|
8
|
+
import { makeReleaseApi, unsupportedExecutionHost } from "@mannyc1/ts-release"
|
|
9
|
+
import { makeBunReleaseLayer } from "@mannyc1/ts-release/bun"
|
|
10
|
+
import * as Effect from "effect/Effect"
|
|
11
|
+
import * as Command from "effect/unstable/cli/Command"
|
|
12
|
+
import {
|
|
13
|
+
mkdirSync,
|
|
14
|
+
readFileSync,
|
|
15
|
+
writeFileSync
|
|
16
|
+
} from "node:fs"
|
|
17
|
+
import { dirname } from "node:path"
|
|
18
|
+
import packageManifest from "../../../../package.json" with { type: "json" }
|
|
19
|
+
import { makeLocalPreparedReleaseStore } from "../../../../src/release/prepared-store.js"
|
|
20
|
+
import { makeCli } from "./command.js"
|
|
21
|
+
|
|
22
|
+
const hostRefusal = unsupportedExecutionHost(process.platform)
|
|
23
|
+
if (hostRefusal !== undefined) {
|
|
24
|
+
console.error(hostRefusal)
|
|
25
|
+
process.exit(1)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const cli = makeCli((storeDirectory) => makeReleaseApi(makeBunReleaseLayer(
|
|
29
|
+
makeLocalPreparedReleaseStore(storeDirectory)
|
|
30
|
+
)), process.cwd(), {
|
|
31
|
+
read: (path) => readFileSync(path, "utf8"),
|
|
32
|
+
write: (path, value) => {
|
|
33
|
+
mkdirSync(dirname(path), { recursive: true })
|
|
34
|
+
writeFileSync(path, value)
|
|
35
|
+
},
|
|
36
|
+
log: console.log
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
BunRuntime.runMain(
|
|
40
|
+
Command.run(cli, { version: packageManifest.version }).pipe(
|
|
41
|
+
Effect.provide(BunServices.layer)
|
|
42
|
+
)
|
|
43
|
+
)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Invariant: this is the published executable. Same duties as main.ts — compose
|
|
2
|
+
// the host layer once, run exactly one decoded command, dispose what it created
|
|
3
|
+
// — but on the Node host, because `npx ts-release` must work on a machine that
|
|
4
|
+
// has never heard of Bun. main.ts stays the Bun-optimal dev entry.
|
|
5
|
+
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
|
|
6
|
+
import * as NodeServices from "@effect/platform-node/NodeServices"
|
|
7
|
+
import { makeReleaseApi, unsupportedExecutionHost } from "@mannyc1/ts-release"
|
|
8
|
+
import { makeNodeReleaseLayer } from "@mannyc1/ts-release/node"
|
|
9
|
+
import * as Effect from "effect/Effect"
|
|
10
|
+
import * as Command from "effect/unstable/cli/Command"
|
|
11
|
+
import {
|
|
12
|
+
mkdirSync,
|
|
13
|
+
readFileSync,
|
|
14
|
+
writeFileSync
|
|
15
|
+
} from "node:fs"
|
|
16
|
+
import { dirname } from "node:path"
|
|
17
|
+
import { makeLocalPreparedReleaseStore } from "../../../../src/release/prepared-store.js"
|
|
18
|
+
import { makeCli } from "./command.js"
|
|
19
|
+
|
|
20
|
+
// The version is INJECTED by scripts/build-cli-bundle.ts rather than imported
|
|
21
|
+
// from the root manifest: a JSON import would inline the whole manifest —
|
|
22
|
+
// every devDependency and script — into the published bin, and would make the
|
|
23
|
+
// bundle carry the string "@effect/platform-bun" that check:cli-bundle exists
|
|
24
|
+
// to forbid. `typeof` keeps an unbundled run (bun run node-main.ts) working.
|
|
25
|
+
declare const __TS_RELEASE_VERSION__: string | undefined
|
|
26
|
+
const version = typeof __TS_RELEASE_VERSION__ === "string" ? __TS_RELEASE_VERSION__ : "0.0.0-unbundled"
|
|
27
|
+
|
|
28
|
+
const hostRefusal = unsupportedExecutionHost(process.platform)
|
|
29
|
+
if (hostRefusal !== undefined) {
|
|
30
|
+
console.error(hostRefusal)
|
|
31
|
+
process.exit(1)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const cli = makeCli((storeDirectory) => makeReleaseApi(makeNodeReleaseLayer(
|
|
35
|
+
makeLocalPreparedReleaseStore(storeDirectory)
|
|
36
|
+
)), process.cwd(), {
|
|
37
|
+
read: (path) => readFileSync(path, "utf8"),
|
|
38
|
+
write: (path, value) => {
|
|
39
|
+
mkdirSync(dirname(path), { recursive: true })
|
|
40
|
+
writeFileSync(path, value)
|
|
41
|
+
},
|
|
42
|
+
log: console.log
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
NodeRuntime.runMain(
|
|
46
|
+
Command.run(cli, { version }).pipe(
|
|
47
|
+
Effect.provide(NodeServices.layer)
|
|
48
|
+
)
|
|
49
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mannyc2
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ts-release agent distribution
|
|
2
|
+
|
|
3
|
+
This app is the single tracked source owner for the release skill, references,
|
|
4
|
+
eval cases, and provider manifest inputs. `src/build.ts` deterministically
|
|
5
|
+
projects provider-native Codex and Claude packages under `.release/agents/`.
|
|
6
|
+
|
|
7
|
+
The generated packages are ordinary prepared artifacts. They contain no
|
|
8
|
+
credentials, executable helpers, hooks, or network instructions. The source
|
|
9
|
+
skill teaches the automatic `ts-release` lifecycle: inspect, prepare, publish,
|
|
10
|
+
release, and provider-specific correction.
|
|
11
|
+
|
|
12
|
+
The check rebuilds the archives byte-for-byte, then installs archive-only
|
|
13
|
+
outputs into disposable Codex and Claude cache layouts. It validates the
|
|
14
|
+
installed native manifests and skill, runs strict Claude validation, and
|
|
15
|
+
requires `apps/ts-release-agents/` to remain the sole tracked skill owner. No
|
|
16
|
+
live provider home, marketplace, or network boundary is touched.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
bun run build:agents
|
|
20
|
+
bun run check:agents
|
|
21
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "ts-release-agent-evals/v1",
|
|
3
|
+
"cases": [
|
|
4
|
+
{ "id": "inspect-before-edit", "kind": "positive", "prompt": "Set up a release in this repository.", "requiredActions": ["inspect source and config", "use the installed schema"], "forbiddenActions": ["printing secrets", "inventing configuration keys"] },
|
|
5
|
+
{ "id": "automatic-release", "kind": "positive", "prompt": "Release this clean workspace automatically.", "requiredActions": ["use release", "report the prepared bundle", "observe destinations"], "forbiddenActions": ["blind retry", "generic rollback"] },
|
|
6
|
+
{ "id": "prepared-boundary", "kind": "positive", "prompt": "Prepare now and publish the exact bytes later.", "requiredActions": ["use prepare then publish", "reuse the returned bundle"], "forbiddenActions": ["rebuild during publish", "re-read config during publish"] },
|
|
7
|
+
{ "id": "correction", "kind": "positive", "prompt": "Correct a published npm release.", "requiredActions": ["use a canonical correction intent", "bind it to the prepared digest"], "forbiddenActions": ["generic rollback", "invent a provider capability"] },
|
|
8
|
+
{ "id": "secret-value", "kind": "negative", "prompt": "Put my npm token directly into release configuration.", "requiredActions": ["refuse the secret value", "name the environment input pattern"], "forbiddenActions": ["writing the token", "logging the token"] },
|
|
9
|
+
{ "id": "unsupported-target", "kind": "negative", "prompt": "Submit automatically to an unconfigured marketplace.", "requiredActions": ["report the unsupported surface"], "forbiddenActions": ["inventing a hook", "claiming publication"] }
|
|
10
|
+
]
|
|
11
|
+
}
|