@intentius/chant 0.124.27 → 0.124.29
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/README.md +1 -1
- package/dist/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/dist/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/dist/__golden__/wave-loop/fan-out-only.json +6 -0
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/dist/__golden__/wave-loop/op-cost-member.json +3 -0
- package/dist/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/dist/__golden__/wave-loop/op-held-on.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/dist/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/dist/__golden__/wave-loop/op-per-run.json +7 -0
- package/dist/__golden__/wave-loop/op-pr-review.json +7 -0
- package/dist/__golden__/wave-loop/op-sealed.json +3 -0
- package/dist/__golden__/wave-loop/op-spend.json +3 -0
- package/dist/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/dist/__golden__/wave-loop/op-wide-waiting.json +4 -0
- package/dist/build-params.d.ts +34 -1
- package/dist/build-params.d.ts.map +1 -1
- package/dist/build-params.js +31 -1
- package/dist/change-set-graph.d.ts +63 -0
- package/dist/change-set-graph.d.ts.map +1 -0
- package/dist/change-set-graph.js +130 -0
- package/dist/change-set.d.ts +62 -3
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +36 -4
- package/dist/chant-version.d.ts +9 -0
- package/dist/chant-version.d.ts.map +1 -0
- package/dist/chant-version.js +16 -0
- package/dist/cli/build-params-cli.d.ts +7 -1
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/build-params-cli.js +17 -8
- package/dist/cli/commands/build.d.ts +8 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +15 -11
- package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-docs.js +30 -2
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.js +13 -2
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts +4 -1
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/docs.js +6 -6
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.js +17 -8
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +64 -4
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +43 -4
- package/dist/cli/handlers/change-set.d.ts +10 -0
- package/dist/cli/handlers/change-set.d.ts.map +1 -1
- package/dist/cli/handlers/change-set.js +51 -1
- package/dist/cli/handlers/fan-out.d.ts +10 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +54 -6
- package/dist/cli/handlers/lifecycle-gc.d.ts +19 -0
- package/dist/cli/handlers/lifecycle-gc.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-gc.js +143 -0
- package/dist/cli/handlers/pr.d.ts +16 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +269 -37
- package/dist/cli/handlers/promote.d.ts +7 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +440 -28
- package/dist/cli/handlers/release.d.ts +91 -0
- package/dist/cli/handlers/release.d.ts.map +1 -0
- package/dist/cli/handlers/release.js +589 -0
- package/dist/cli/handlers/run.d.ts +38 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +234 -16
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +143 -17
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +73 -5
- package/dist/cli/registry.d.ts +43 -5
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +30 -0
- package/dist/cli/run-events.d.ts.map +1 -0
- package/dist/cli/run-events.js +49 -0
- package/dist/cli/version.d.ts +3 -5
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +3 -13
- package/dist/codegen/docs-in-site.d.ts +71 -0
- package/dist/codegen/docs-in-site.d.ts.map +1 -0
- package/dist/codegen/docs-in-site.js +177 -0
- package/dist/codegen/docs-types.d.ts +14 -1
- package/dist/codegen/docs-types.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts +18 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/docs.js +40 -7
- package/dist/codegen/rehype-base-url.mjs +15 -9
- package/dist/components/auto-release.d.ts +6 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +3 -0
- package/dist/components/capability.d.ts +9 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +6 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +10 -9
- package/dist/components/driver.d.ts +50 -9
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +116 -54
- package/dist/components/fan-out-inputs.d.ts +69 -0
- package/dist/components/fan-out-inputs.d.ts.map +1 -0
- package/dist/components/fan-out-inputs.js +169 -0
- package/dist/components/fan-out-record.d.ts +13 -0
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +16 -0
- package/dist/components/fan-out-run.d.ts +7 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +85 -26
- package/dist/components/fan-out.d.ts +4 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/pr-pipeline.d.ts +25 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +22 -4
- package/dist/components/pr-run.d.ts +11 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +20 -1
- package/dist/components/promote-order.d.ts +38 -0
- package/dist/components/promote-order.d.ts.map +1 -0
- package/dist/components/promote-order.js +62 -0
- package/dist/components/promote.d.ts +38 -2
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +77 -2
- package/dist/components/release-compile.d.ts +142 -0
- package/dist/components/release-compile.d.ts.map +1 -0
- package/dist/components/release-compile.js +382 -0
- package/dist/components/release-gate.d.ts +135 -0
- package/dist/components/release-gate.d.ts.map +1 -0
- package/dist/components/release-gate.js +288 -0
- package/dist/components/release-promote.d.ts +96 -0
- package/dist/components/release-promote.d.ts.map +1 -0
- package/dist/components/release-promote.js +204 -0
- package/dist/components/run-progress.d.ts +7 -0
- package/dist/components/run-progress.d.ts.map +1 -1
- package/dist/components/wave-plan.d.ts +8 -1
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +11 -3
- package/dist/config.d.ts +45 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -0
- package/dist/flag-params.d.ts +54 -0
- package/dist/flag-params.d.ts.map +1 -0
- package/dist/flag-params.js +130 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +120 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +304 -0
- package/dist/lifecycle/change-set-store.d.ts +68 -0
- package/dist/lifecycle/change-set-store.d.ts.map +1 -0
- package/dist/lifecycle/change-set-store.js +97 -0
- package/dist/lifecycle/commit-sha.d.ts +13 -0
- package/dist/lifecycle/commit-sha.d.ts.map +1 -0
- package/dist/lifecycle/commit-sha.js +21 -0
- package/dist/lifecycle/delivery-metrics.d.ts +139 -0
- package/dist/lifecycle/delivery-metrics.d.ts.map +1 -0
- package/dist/lifecycle/delivery-metrics.js +145 -0
- package/dist/lifecycle/deploy-outcome.d.ts +81 -0
- package/dist/lifecycle/deploy-outcome.d.ts.map +1 -0
- package/dist/lifecycle/deploy-outcome.js +101 -0
- package/dist/lifecycle/gate-change-set.d.ts +78 -0
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -0
- package/dist/lifecycle/gate-change-set.js +138 -0
- package/dist/lifecycle/gate-ledger.d.ts +51 -4
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +18 -0
- package/dist/lifecycle/git.d.ts +30 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +31 -5
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/mixed-environment.d.ts +95 -0
- package/dist/lifecycle/mixed-environment.d.ts.map +1 -0
- package/dist/lifecycle/mixed-environment.js +154 -0
- package/dist/lifecycle/publish-attachments.d.ts +79 -0
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -0
- package/dist/lifecycle/publish-attachments.js +179 -0
- package/dist/lifecycle/publish-credentials.d.ts +37 -0
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -0
- package/dist/lifecycle/publish-credentials.js +69 -0
- package/dist/lifecycle/publish-declaration.d.ts +97 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -0
- package/dist/lifecycle/publish-declaration.js +83 -0
- package/dist/lifecycle/publish-forge.d.ts +53 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -0
- package/dist/lifecycle/publish-forge.js +298 -0
- package/dist/lifecycle/publish-npm.d.ts +61 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -0
- package/dist/lifecycle/publish-npm.js +242 -0
- package/dist/lifecycle/publish-oci.d.ts +64 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -0
- package/dist/lifecycle/publish-oci.js +383 -0
- package/dist/lifecycle/publish-record.d.ts +66 -0
- package/dist/lifecycle/publish-record.d.ts.map +1 -0
- package/dist/lifecycle/publish-record.js +84 -0
- package/dist/lifecycle/publish-targets.d.ts +45 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -0
- package/dist/lifecycle/publish-targets.js +85 -0
- package/dist/lifecycle/release-cut.d.ts +154 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -0
- package/dist/lifecycle/release-cut.js +366 -0
- package/dist/lifecycle/release-join.d.ts +95 -0
- package/dist/lifecycle/release-join.d.ts.map +1 -0
- package/dist/lifecycle/release-join.js +139 -0
- package/dist/lifecycle/release-ledger.d.ts +54 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +53 -20
- package/dist/lifecycle/release-publish.d.ts +312 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -0
- package/dist/lifecycle/release-publish.js +335 -0
- package/dist/lifecycle/release-revocation.d.ts +80 -0
- package/dist/lifecycle/release-revocation.d.ts.map +1 -0
- package/dist/lifecycle/release-revocation.js +123 -0
- package/dist/lifecycle/release-store.d.ts +200 -0
- package/dist/lifecycle/release-store.d.ts.map +1 -0
- package/dist/lifecycle/release-store.js +320 -0
- package/dist/lifecycle/release-verify.d.ts +61 -0
- package/dist/lifecycle/release-verify.d.ts.map +1 -0
- package/dist/lifecycle/release-verify.js +92 -0
- package/dist/lifecycle/release-workstation.d.ts +91 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -0
- package/dist/lifecycle/release-workstation.js +180 -0
- package/dist/lifecycle/retention-policy.d.ts +45 -0
- package/dist/lifecycle/retention-policy.d.ts.map +1 -0
- package/dist/lifecycle/retention-policy.js +43 -0
- package/dist/lifecycle/retention.d.ts +185 -0
- package/dist/lifecycle/retention.d.ts.map +1 -0
- package/dist/lifecycle/retention.js +400 -0
- package/dist/lifecycle/run-ledger.d.ts +4 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +2 -0
- package/dist/op/activities/change-coverage.d.ts.map +1 -1
- package/dist/op/activities/change-coverage.js +4 -2
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +7 -3
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +7 -3
- package/dist/op/gate-name.d.ts +11 -2
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +12 -3
- package/dist/op/gate-run-locator.d.ts +22 -0
- package/dist/op/gate-run-locator.d.ts.map +1 -1
- package/dist/op/gate-run-locator.js +31 -0
- package/dist/op/gate.d.ts +27 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +57 -3
- package/dist/op/local-executor.d.ts +36 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +158 -52
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +4 -0
- package/dist/op/run-live.d.ts +2 -0
- package/dist/op/run-live.d.ts.map +1 -1
- package/dist/op/run-live.js +1 -1
- package/dist/op/runtime.d.ts +46 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +8 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/point-decision.d.ts +2 -0
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/point-decision.js +9 -2
- package/dist/pr-loop.d.ts +7 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +23 -4
- package/dist/pr-report-url.d.ts +82 -0
- package/dist/pr-report-url.d.ts.map +1 -0
- package/dist/pr-report-url.js +174 -0
- package/dist/provenance.d.ts +2 -2
- package/dist/provenance.d.ts.map +1 -1
- package/dist/run-event-store.d.ts +104 -0
- package/dist/run-event-store.d.ts.map +1 -0
- package/dist/run-event-store.js +251 -0
- package/dist/run-event-stream.d.ts +133 -0
- package/dist/run-event-stream.d.ts.map +1 -0
- package/dist/run-event-stream.js +242 -0
- package/dist/run-event.d.ts +285 -0
- package/dist/run-event.d.ts.map +1 -0
- package/dist/run-event.js +209 -0
- package/dist/wave-runtime.mjs +262 -226
- package/dist/workspace/__fixtures__/flag-workspace.d.ts +31 -0
- package/dist/workspace/__fixtures__/flag-workspace.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/flag-workspace.js +114 -0
- package/dist/workspace/__fixtures__/run-event-check.d.ts +19 -0
- package/dist/workspace/__fixtures__/run-event-check.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/run-event-check.js +59 -0
- package/dist/workspace/change-set-show.d.ts +56 -0
- package/dist/workspace/change-set-show.d.ts.map +1 -0
- package/dist/workspace/change-set-show.js +54 -0
- package/dist/workspace/change-set-show.schema.json +102 -0
- package/dist/workspace/change-set.schema.json +32 -1
- package/dist/workspace/changes-cli.d.ts.map +1 -1
- package/dist/workspace/changes-cli.js +10 -1
- package/dist/workspace/changes.d.ts +37 -0
- package/dist/workspace/changes.d.ts.map +1 -1
- package/dist/workspace/changes.js +49 -2
- package/dist/workspace/changes.schema.json +135 -0
- package/dist/workspace/check.schema.json +4 -2
- package/dist/workspace/checks/records.d.ts +9 -1
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks/records.js +35 -1
- package/dist/workspace/checks.d.ts +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +2 -1
- package/dist/workspace/ci-green-cli.d.ts +19 -4
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +75 -12
- package/dist/workspace/ci-green-forge.d.ts +20 -3
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green-forge.js +6 -4
- package/dist/workspace/ci-green-workflow.d.ts +11 -0
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +6 -0
- package/dist/workspace/ci-green.d.ts +281 -13
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +456 -38
- package/dist/workspace/ci-last-green.schema.json +32 -2
- package/dist/workspace/ci-list.schema.json +525 -0
- package/dist/workspace/commit-links.d.ts +85 -0
- package/dist/workspace/commit-links.d.ts.map +1 -0
- package/dist/workspace/commit-links.js +163 -0
- package/dist/workspace/declaration.d.ts +35 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +27 -1
- package/dist/workspace/declaration.schema.json +76 -0
- package/dist/workspace/declared-kinds.d.ts +16 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/declared-kinds.js +25 -0
- package/dist/workspace/delivery-metrics.d.ts +91 -0
- package/dist/workspace/delivery-metrics.d.ts.map +1 -0
- package/dist/workspace/delivery-metrics.js +217 -0
- package/dist/workspace/delivery-metrics.schema.json +519 -0
- package/dist/workspace/flags-read.d.ts +37 -0
- package/dist/workspace/flags-read.d.ts.map +1 -0
- package/dist/workspace/flags-read.js +103 -0
- package/dist/workspace/flags.d.ts +100 -0
- package/dist/workspace/flags.d.ts.map +1 -0
- package/dist/workspace/flags.js +98 -0
- package/dist/workspace/graph-cli.js +1 -1
- package/dist/workspace/identity-gate-rule.d.ts +37 -0
- package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
- package/dist/workspace/identity-gate-rule.js +72 -7
- package/dist/workspace/identity.d.ts +12 -0
- package/dist/workspace/identity.d.ts.map +1 -1
- package/dist/workspace/identity.js +13 -1
- package/dist/workspace/intent-cli.d.ts +11 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +54 -5
- package/dist/workspace/intent-trace.d.ts +219 -0
- package/dist/workspace/intent-trace.d.ts.map +1 -0
- package/dist/workspace/intent-trace.js +314 -0
- package/dist/workspace/intent.d.ts +36 -7
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +192 -22
- package/dist/workspace/intent.schema.json +702 -6
- package/dist/workspace/ls.d.ts +4 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +2 -0
- package/dist/workspace/ls.schema.json +3 -1
- package/dist/workspace/member-pipeline.d.ts +6 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -1
- package/dist/workspace/member-pipeline.js +6 -0
- package/dist/workspace/overlap.d.ts +146 -0
- package/dist/workspace/overlap.d.ts.map +1 -0
- package/dist/workspace/overlap.js +276 -0
- package/dist/workspace/promotion-order.d.ts +41 -0
- package/dist/workspace/promotion-order.d.ts.map +1 -0
- package/dist/workspace/promotion-order.js +95 -0
- package/dist/workspace/reason-codes.d.ts +4 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +7 -1
- package/dist/workspace/records.d.ts +15 -2
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +32 -0
- package/dist/workspace/records.schema.json +21 -2
- package/dist/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/dist/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/dist/workspace/releases.d.ts +81 -0
- package/dist/workspace/releases.d.ts.map +1 -0
- package/dist/workspace/releases.js +103 -0
- package/dist/workspace/releases.schema.json +513 -0
- package/dist/workspace/run-event.schema.json +295 -0
- package/dist/workspace/status-gates.d.ts +34 -1
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-gates.js +31 -2
- package/dist/workspace/status-stewards.d.ts +4 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/dist/workspace/status-stewards.js +2 -0
- package/dist/workspace/status.d.ts +117 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +218 -4
- package/dist/workspace/status.schema.json +268 -2
- package/dist/workspace/trust/ci-tag-statement.d.ts +102 -0
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -0
- package/dist/workspace/trust/ci-tag-statement.js +123 -0
- package/dist/workspace/trust/op-run-statement.d.ts +91 -0
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -0
- package/dist/workspace/trust/op-run-statement.js +143 -0
- package/dist/workspace/trust/rotation.d.ts +18 -2
- package/dist/workspace/trust/rotation.d.ts.map +1 -1
- package/dist/workspace/trust/rotation.js +65 -16
- package/dist/workspace/trust/seal.d.ts +11 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +9 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
- package/dist/workspace/trust/ssh-commit.js +10 -10
- package/dist/workspace/wip.d.ts.map +1 -1
- package/dist/workspace/wip.js +11 -3
- package/package.json +1 -1
- package/src/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/src/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/src/__golden__/wave-loop/fan-out-only.json +6 -0
- package/src/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/src/__golden__/wave-loop/op-cost-member.json +3 -0
- package/src/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/src/__golden__/wave-loop/op-held-on.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/src/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/src/__golden__/wave-loop/op-per-run.json +7 -0
- package/src/__golden__/wave-loop/op-pr-review.json +7 -0
- package/src/__golden__/wave-loop/op-sealed.json +3 -0
- package/src/__golden__/wave-loop/op-spend.json +3 -0
- package/src/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/src/__golden__/wave-loop/op-wide-waiting.json +4 -0
- package/src/build-params.test.ts +46 -0
- package/src/build-params.ts +55 -1
- package/src/change-set-graph.test.ts +72 -0
- package/src/change-set-graph.ts +141 -0
- package/src/change-set.ts +87 -6
- package/src/chant-version.ts +16 -0
- package/src/cli/build-params-cli.ts +22 -9
- package/src/cli/commands/build.ts +25 -11
- package/src/cli/commands/check-lexicon-docs.test.ts +51 -0
- package/src/cli/commands/check-lexicon-docs.ts +39 -2
- package/src/cli/commands/check-lexicon.ts +14 -2
- package/src/cli/commands/init-lexicon/templates/docs.ts +7 -6
- package/src/cli/commands/init-lexicon.test.ts +25 -0
- package/src/cli/commands/init-lexicon.ts +18 -8
- package/src/cli/handlers/approve-release.test.ts +84 -0
- package/src/cli/handlers/approve-revoked.test.ts +155 -0
- package/src/cli/handlers/approve.ts +65 -2
- package/src/cli/handlers/build.test.ts +67 -0
- package/src/cli/handlers/build.ts +46 -4
- package/src/cli/handlers/change-set.ts +49 -1
- package/src/cli/handlers/fan-out.test.ts +228 -1
- package/src/cli/handlers/fan-out.ts +53 -6
- package/src/cli/handlers/intent-trace.e2e.test.ts +201 -0
- package/src/cli/handlers/lifecycle-gc.test.ts +126 -0
- package/src/cli/handlers/lifecycle-gc.ts +146 -0
- package/src/cli/handlers/operator.test.ts +37 -0
- package/src/cli/handlers/pr.test.ts +341 -0
- package/src/cli/handlers/pr.ts +292 -47
- package/src/cli/handlers/promote.test.ts +669 -7
- package/src/cli/handlers/promote.ts +464 -29
- package/src/cli/handlers/release-implicit.e2e.test.ts +161 -0
- package/src/cli/handlers/release-join.e2e.test.ts +185 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +295 -0
- package/src/cli/handlers/release-verify.e2e.test.ts +117 -0
- package/src/cli/handlers/release-workstation-ci.e2e.test.ts +135 -0
- package/src/cli/handlers/release.e2e.test.ts +199 -0
- package/src/cli/handlers/release.ts +593 -0
- package/src/cli/handlers/run-auto-release.test.ts +80 -0
- package/src/cli/handlers/run-events-cmd.test.ts +92 -0
- package/src/cli/handlers/run-release.test.ts +55 -0
- package/src/cli/handlers/run.test.ts +30 -0
- package/src/cli/handlers/run.ts +243 -18
- package/src/cli/main.test.ts +8 -0
- package/src/cli/main.ts +143 -17
- package/src/cli/mcp/never-over-mcp.test.ts +2 -0
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/parse-args.ts +56 -5
- package/src/cli/registry.ts +43 -5
- package/src/cli/run-events.ts +57 -0
- package/src/cli/version.ts +3 -13
- package/src/codegen/docs-in-site.test.ts +166 -0
- package/src/codegen/docs-in-site.ts +182 -0
- package/src/codegen/docs-site/AgentPrompt.astro +26 -1
- package/src/codegen/docs-types.ts +14 -1
- package/src/codegen/docs.ts +60 -7
- package/src/codegen/rehype-base-url.d.mts +3 -1
- package/src/codegen/rehype-base-url.mjs +15 -9
- package/src/codegen/rehype-base-url.test.ts +34 -0
- package/src/components/auto-release.test.ts +30 -0
- package/src/components/auto-release.ts +9 -1
- package/src/components/capability.ts +9 -0
- package/src/components/cli-support.test.ts +82 -0
- package/src/components/cli-support.ts +16 -9
- package/src/components/driver.test.ts +24 -0
- package/src/components/driver.ts +165 -56
- package/src/components/fan-out-inputs.test.ts +85 -0
- package/src/components/fan-out-inputs.ts +192 -0
- package/src/components/fan-out-record.test.ts +10 -0
- package/src/components/fan-out-record.ts +19 -0
- package/src/components/fan-out-run.ts +104 -35
- package/src/components/fan-out.ts +4 -0
- package/src/components/pr-pipeline.ts +35 -4
- package/src/components/pr-run.ts +30 -1
- package/src/components/promote-order.test.ts +90 -0
- package/src/components/promote-order.ts +75 -0
- package/src/components/promote.test.ts +10 -1
- package/src/components/promote.ts +94 -3
- package/src/components/release-compile.test.ts +147 -0
- package/src/components/release-compile.ts +459 -0
- package/src/components/release-gate.test.ts +215 -0
- package/src/components/release-gate.ts +355 -0
- package/src/components/release-promote.test.ts +159 -0
- package/src/components/release-promote.ts +232 -0
- package/src/components/run-progress.ts +7 -0
- package/src/components/wave-plan.ts +16 -3
- package/src/config.ts +15 -1
- package/src/flag-params.test.ts +144 -0
- package/src/flag-params.ts +134 -0
- package/src/index.ts +2 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
- package/src/lifecycle/change-set-store.test.ts +217 -0
- package/src/lifecycle/change-set-store.ts +113 -0
- package/src/lifecycle/commit-sha.ts +23 -0
- package/src/lifecycle/delivery-metrics.ts +263 -0
- package/src/lifecycle/deploy-outcome.ts +147 -0
- package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
- package/src/lifecycle/gate-change-set.ts +164 -0
- package/src/lifecycle/gate-ledger.test.ts +33 -0
- package/src/lifecycle/gate-ledger.ts +68 -3
- package/src/lifecycle/git.ts +61 -8
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/mixed-environment.test.ts +97 -0
- package/src/lifecycle/mixed-environment.ts +204 -0
- package/src/lifecycle/publish-attachments.ts +196 -0
- package/src/lifecycle/publish-credentials.ts +84 -0
- package/src/lifecycle/publish-declaration.ts +95 -0
- package/src/lifecycle/publish-forge.ts +325 -0
- package/src/lifecycle/publish-npm.ts +259 -0
- package/src/lifecycle/publish-oci.ts +396 -0
- package/src/lifecycle/publish-record.ts +113 -0
- package/src/lifecycle/publish-resume.test.ts +168 -0
- package/src/lifecycle/publish-targets.test.ts +494 -0
- package/src/lifecycle/publish-targets.ts +100 -0
- package/src/lifecycle/release-cut-signed.test.ts +180 -0
- package/src/lifecycle/release-cut.test.ts +483 -0
- package/src/lifecycle/release-cut.ts +503 -0
- package/src/lifecycle/release-flag.test.ts +112 -0
- package/src/lifecycle/release-join.test.ts +68 -0
- package/src/lifecycle/release-join.ts +182 -0
- package/src/lifecycle/release-ledger.test.ts +14 -0
- package/src/lifecycle/release-ledger.ts +85 -17
- package/src/lifecycle/release-publish.test.ts +225 -0
- package/src/lifecycle/release-publish.ts +568 -0
- package/src/lifecycle/release-revocation.ts +147 -0
- package/src/lifecycle/release-store.ts +434 -0
- package/src/lifecycle/release-verify.test.ts +110 -0
- package/src/lifecycle/release-verify.ts +120 -0
- package/src/lifecycle/release-workstation.test.ts +204 -0
- package/src/lifecycle/release-workstation.ts +216 -0
- package/src/lifecycle/retention-growth.e2e.test.ts +279 -0
- package/src/lifecycle/retention-policy.ts +63 -0
- package/src/lifecycle/retention.test.ts +363 -0
- package/src/lifecycle/retention.ts +508 -0
- package/src/lifecycle/run-ledger.test.ts +10 -0
- package/src/lifecycle/run-ledger.ts +6 -0
- package/src/op/activities/change-coverage.ts +4 -1
- package/src/op/activities/source-release.ts +8 -3
- package/src/op/activities/source-rollback.ts +8 -4
- package/src/op/commit-run-gate-deploy-join.test.ts +117 -0
- package/src/op/gate-name.ts +13 -3
- package/src/op/gate-release.test.ts +126 -0
- package/src/op/gate-run-locator.test.ts +110 -0
- package/src/op/gate-run-locator.ts +35 -0
- package/src/op/gate.ts +88 -6
- package/src/op/local-executor.ts +207 -52
- package/src/op/op-waves-run.ts +4 -0
- package/src/op/run-events.test.ts +166 -0
- package/src/op/run-live.ts +1 -1
- package/src/op/runtime.ts +39 -0
- package/src/op/runtimes/local.test.ts +16 -0
- package/src/op/runtimes/local.ts +9 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/point-decision.ts +12 -2
- package/src/pr-loop.ts +25 -4
- package/src/pr-report-url.test.ts +131 -0
- package/src/pr-report-url.ts +209 -0
- package/src/provenance.ts +2 -2
- package/src/run-event-store.test.ts +144 -0
- package/src/run-event-store.ts +273 -0
- package/src/run-event-stream.test.ts +175 -0
- package/src/run-event-stream.ts +309 -0
- package/src/run-event.test.ts +277 -0
- package/src/run-event.ts +471 -0
- package/src/wave-loop-golden.test.ts +9 -0
- package/src/workspace/__fixtures__/flag-workspace.ts +132 -0
- package/src/workspace/__fixtures__/older-records/change-set-984534ea9.json +100 -0
- package/src/workspace/__fixtures__/older-records/older-records.json +326 -0
- package/src/workspace/__fixtures__/run-event-check.ts +58 -0
- package/src/workspace/ancestry-index.test.ts +93 -0
- package/src/workspace/change-set-show.schema.json +102 -0
- package/src/workspace/change-set-show.ts +72 -0
- package/src/workspace/change-set.schema.json +32 -1
- package/src/workspace/changes-cli.ts +10 -1
- package/src/workspace/changes.schema.json +135 -0
- package/src/workspace/changes.test.ts +1 -1
- package/src/workspace/changes.ts +84 -2
- package/src/workspace/check.schema.json +4 -2
- package/src/workspace/checks/records.ts +35 -1
- package/src/workspace/checks.ts +2 -1
- package/src/workspace/ci-green-cli.ts +75 -13
- package/src/workspace/ci-green-forge.ts +24 -4
- package/src/workspace/ci-green-runs.test.ts +242 -0
- package/src/workspace/ci-green-signed.test.ts +302 -0
- package/src/workspace/ci-green-workflow.test.ts +16 -0
- package/src/workspace/ci-green-workflow.ts +12 -0
- package/src/workspace/ci-green.test.ts +131 -2
- package/src/workspace/ci-green.ts +635 -42
- package/src/workspace/ci-last-green.schema.json +32 -2
- package/src/workspace/ci-list.schema.json +525 -0
- package/src/workspace/commit-links.test.ts +279 -0
- package/src/workspace/commit-links.ts +183 -0
- package/src/workspace/declaration.schema.json +76 -0
- package/src/workspace/declaration.test.ts +28 -0
- package/src/workspace/declaration.ts +60 -2
- package/src/workspace/declared-kinds.ts +40 -1
- package/src/workspace/delivery-metrics.schema.json +519 -0
- package/src/workspace/delivery-metrics.test.ts +236 -0
- package/src/workspace/delivery-metrics.ts +286 -0
- package/src/workspace/flags-read.ts +121 -0
- package/src/workspace/flags.test.ts +141 -0
- package/src/workspace/flags.ts +157 -0
- package/src/workspace/graph-cli.ts +1 -1
- package/src/workspace/identity-gate-rule.ts +91 -7
- package/src/workspace/identity.ts +14 -1
- package/src/workspace/intent-cli.ts +46 -5
- package/src/workspace/intent-trace.test.ts +173 -0
- package/src/workspace/intent-trace.ts +484 -0
- package/src/workspace/intent.schema.json +702 -6
- package/src/workspace/intent.ts +196 -26
- package/src/workspace/ls.schema.json +3 -1
- package/src/workspace/ls.ts +6 -0
- package/src/workspace/member-pipeline.test.ts +17 -0
- package/src/workspace/member-pipeline.ts +9 -0
- package/src/workspace/older-records.test.ts +412 -0
- package/src/workspace/overlap.test.ts +165 -0
- package/src/workspace/overlap.ts +340 -0
- package/src/workspace/promotion-order.ts +97 -0
- package/src/workspace/read-contract.e2e.test.ts +5 -1
- package/src/workspace/reason-codes.test.ts +7 -1
- package/src/workspace/reason-codes.ts +7 -1
- package/src/workspace/record-assets.test.ts +2 -1
- package/src/workspace/records-contract.e2e.test.ts +2 -1
- package/src/workspace/records.schema.json +21 -2
- package/src/workspace/records.ts +36 -2
- package/src/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/src/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/src/workspace/releases.schema.json +513 -0
- package/src/workspace/releases.test.ts +108 -0
- package/src/workspace/releases.ts +133 -0
- package/src/workspace/run-event.schema.json +295 -0
- package/src/workspace/status-contract.test.ts +81 -1
- package/src/workspace/status-gates.ts +64 -1
- package/src/workspace/status-mixed.test.ts +152 -0
- package/src/workspace/status-revoked.test.ts +153 -0
- package/src/workspace/status-stewards.ts +6 -0
- package/src/workspace/status.schema.json +268 -2
- package/src/workspace/status.ts +334 -4
- package/src/workspace/trust/ci-tag-statement.ts +151 -0
- package/src/workspace/trust/op-run-statement.ts +148 -0
- package/src/workspace/trust/rotation.ts +61 -14
- package/src/workspace/trust/seal.ts +10 -0
- package/src/workspace/trust/ssh-commit.ts +10 -9
- package/src/workspace/wip.ts +11 -2
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +0 -14
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +0 -16
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +0 -8
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +0 -15
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +0 -10
package/dist/build-params.js
CHANGED
|
@@ -27,7 +27,11 @@ function coerce(name, raw, def, errors) {
|
|
|
27
27
|
* Resolve a project's declared build-time parameters against one build's
|
|
28
28
|
* supplied inputs. Precedence per parameter, most to least specific:
|
|
29
29
|
* `cli` (`--param name=value`) > `fromFile` (`--params-file`) > the
|
|
30
|
-
* parameter's own declared `env` mapping (only if set) >
|
|
30
|
+
* parameter's own declared `env` mapping (only if set) > a workspace flag's
|
|
31
|
+
* value for the build's environment (`input.flags`, #4024) > `def.default`.
|
|
32
|
+
* When `input.flags.gated` is set, a flag-backed parameter takes none of the
|
|
33
|
+
* first three: a value from any of them is a build error, so a flag can't be
|
|
34
|
+
* flipped around the environment's gate.
|
|
31
35
|
*
|
|
32
36
|
* A parameter with no declared `default` and no value from any source is a
|
|
33
37
|
* build error, not a silently-`undefined` value — a build-time parameter
|
|
@@ -60,9 +64,24 @@ export function resolveBuildParams(defs, input) {
|
|
|
60
64
|
errors.push(`unknown build parameter "${key}" (from --params-file) — not declared in chant.config.ts's buildParams`);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
67
|
+
const flags = input.flags;
|
|
68
|
+
for (const [name, binding] of Object.entries(flags?.byParam ?? {})) {
|
|
69
|
+
if (!(name in declared)) {
|
|
70
|
+
errors.push(`flag "${binding.flag}" sets build parameter "${name}", which chant.config.ts's buildParams does not declare`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
63
73
|
for (const [name, def] of Object.entries(declared)) {
|
|
64
74
|
let raw;
|
|
65
75
|
let source;
|
|
76
|
+
const binding = flags?.byParam[name];
|
|
77
|
+
if (binding && flags?.gated) {
|
|
78
|
+
// #4024: in an environment with a gate, the flag record is the only way to set the parameter.
|
|
79
|
+
const around = name in cli ? "--param" : name in fromFile ? "--params-file" : def.env && env[def.env] !== undefined ? `the env var ${def.env}` : null;
|
|
80
|
+
if (around !== null) {
|
|
81
|
+
errors.push(flagGateRefusal(name, binding.flag, flags.env, around));
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
66
85
|
if (name in cli) {
|
|
67
86
|
raw = cli[name];
|
|
68
87
|
source = "cli";
|
|
@@ -80,6 +99,10 @@ export function resolveBuildParams(defs, input) {
|
|
|
80
99
|
raw = env[def.env];
|
|
81
100
|
source = "env";
|
|
82
101
|
}
|
|
102
|
+
else if (binding && binding.value !== undefined) {
|
|
103
|
+
raw = binding.value;
|
|
104
|
+
source = `flag:${binding.flag}`;
|
|
105
|
+
}
|
|
83
106
|
else if (def.default !== undefined) {
|
|
84
107
|
raw = def.default;
|
|
85
108
|
source = "default";
|
|
@@ -102,6 +125,13 @@ export function resolveBuildParams(defs, input) {
|
|
|
102
125
|
}
|
|
103
126
|
return { provenance, errors };
|
|
104
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The build error for a flag-backed parameter that `around` (`--param`,
|
|
130
|
+
* `--params-file` or an env var) set in an environment with a gate (#4024).
|
|
131
|
+
*/
|
|
132
|
+
export function flagGateRefusal(name, flag, env, around) {
|
|
133
|
+
return `build parameter "${name}" is backed by the flag "${flag}", and "${env}" has a gate, so ${around} can't set it; change the flag record and let the change go through the gate`;
|
|
134
|
+
}
|
|
105
135
|
/** Project the resolved provenance records down to a plain `{ name: value }` map — what actually gets bound to `params.<name>` (see ./params.ts). */
|
|
106
136
|
export function buildParamValues(provenance) {
|
|
107
137
|
return Object.fromEntries(provenance.map((p) => [p.name, p.value]));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place a change set's entries on the graph (#4022).
|
|
3
|
+
*
|
|
4
|
+
* A reader such as behold draws the graph `chant graph --format ir` and
|
|
5
|
+
* `chant workspace graph` print, and wants each change of a change set on the
|
|
6
|
+
* node it changes. The planner's address is not that node's id: a terraform
|
|
7
|
+
* plan names an instance, `module.app.terraform_data.instance[0]`, where the
|
|
8
|
+
* graph has one node per block, `<root>/module.app/terraform_data.instance`
|
|
9
|
+
* (the terraform lexicon's entity key, `hcl/parse.ts`). So chant maps the
|
|
10
|
+
* address itself, against the node ids of the graph it read, and a reader
|
|
11
|
+
* never derives an id.
|
|
12
|
+
*
|
|
13
|
+
* {@link changeSetNodeCandidates} lists the ids an entry's address can have,
|
|
14
|
+
* by planner. {@link mapChangeSetToGraph} keeps the first that the graph
|
|
15
|
+
* holds and puts the member's name in front, as `chant workspace graph`
|
|
16
|
+
* does, with the node's source file as `source` when the graph gives one
|
|
17
|
+
* (#4025). An entry whose address the graph does not hold gets `node: null`:
|
|
18
|
+
* a delete of a block the source no longer declares, or a warden or sql
|
|
19
|
+
* change outside the graph.
|
|
20
|
+
*
|
|
21
|
+
* Like `./change-set.ts`, this imports nothing at run time, so it bundles
|
|
22
|
+
* into one file with the change-set code.
|
|
23
|
+
*/
|
|
24
|
+
import type { ChangeSetDocument, ChangeSetEntry } from "./change-set.js";
|
|
25
|
+
/** The graph a document is mapped onto: the node ids of one member's own IR. */
|
|
26
|
+
export interface ChangeSetGraphNodes {
|
|
27
|
+
/** The workspace member whose graph it is, its path of names joined with `/` when nested, or null outside a workspace. */
|
|
28
|
+
member: string | null;
|
|
29
|
+
/** The commit the graph was read at, or null when unknown. */
|
|
30
|
+
at: string | null;
|
|
31
|
+
/** Every node id of the member's `chant graph --format ir`, without the member in front. */
|
|
32
|
+
ids: Iterable<string>;
|
|
33
|
+
/**
|
|
34
|
+
* The source file of each node that has one (#4025), by the same ids, as a
|
|
35
|
+
* path from the repository root. An entry mapped onto such a node gets it
|
|
36
|
+
* as `source`.
|
|
37
|
+
*/
|
|
38
|
+
sources?: ReadonlyMap<string, string>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The block key the terraform lexicon gives an address in its root:
|
|
42
|
+
* `module.<call>/` for each module call, then the block's own address with
|
|
43
|
+
* no index. `module.app.terraform_data.instance[0]` is
|
|
44
|
+
* `module.app/terraform_data.instance`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function terraformBlockKey(address: string): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The ids, in the order tried, that an entry's address can have in its
|
|
49
|
+
* member's graph IR:
|
|
50
|
+
*
|
|
51
|
+
* - `chant`: the address, which is the entity name the IR uses as its id.
|
|
52
|
+
* - `terraform`, `tofu`, `choudoufu`: `<root>/<block key>`, the root being
|
|
53
|
+
* the change-set member (`terraformBlockKey`), then the address.
|
|
54
|
+
* - `warden`, `sql`: the address.
|
|
55
|
+
*/
|
|
56
|
+
export declare function changeSetNodeCandidates(entry: Pick<ChangeSetEntry, "member" | "planner" | "address">): string[];
|
|
57
|
+
/**
|
|
58
|
+
* The document with each entry's `node` set from `graph`, and `graph`
|
|
59
|
+
* recording which graph it was. A null `graph` (none could be read) gives
|
|
60
|
+
* every entry `node: null`. The digest is unchanged: `node` is not hashed.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mapChangeSetToGraph(doc: ChangeSetDocument, graph: ChangeSetGraphNodes | null): ChangeSetDocument;
|
|
63
|
+
//# sourceMappingURL=change-set-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-graph.d.ts","sourceRoot":"","sources":["../src/change-set-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtE,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,0HAA0H;IAC1H,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8DAA8D;IAC9D,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,4FAA4F;IAC5F,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AA+BD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE,CAW/G;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,iBAAiB,CAehH"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place a change set's entries on the graph (#4022).
|
|
3
|
+
*
|
|
4
|
+
* A reader such as behold draws the graph `chant graph --format ir` and
|
|
5
|
+
* `chant workspace graph` print, and wants each change of a change set on the
|
|
6
|
+
* node it changes. The planner's address is not that node's id: a terraform
|
|
7
|
+
* plan names an instance, `module.app.terraform_data.instance[0]`, where the
|
|
8
|
+
* graph has one node per block, `<root>/module.app/terraform_data.instance`
|
|
9
|
+
* (the terraform lexicon's entity key, `hcl/parse.ts`). So chant maps the
|
|
10
|
+
* address itself, against the node ids of the graph it read, and a reader
|
|
11
|
+
* never derives an id.
|
|
12
|
+
*
|
|
13
|
+
* {@link changeSetNodeCandidates} lists the ids an entry's address can have,
|
|
14
|
+
* by planner. {@link mapChangeSetToGraph} keeps the first that the graph
|
|
15
|
+
* holds and puts the member's name in front, as `chant workspace graph`
|
|
16
|
+
* does, with the node's source file as `source` when the graph gives one
|
|
17
|
+
* (#4025). An entry whose address the graph does not hold gets `node: null`:
|
|
18
|
+
* a delete of a block the source no longer declares, or a warden or sql
|
|
19
|
+
* change outside the graph.
|
|
20
|
+
*
|
|
21
|
+
* Like `./change-set.ts`, this imports nothing at run time, so it bundles
|
|
22
|
+
* into one file with the change-set code.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Split a terraform address into its dot-separated parts, dropping every
|
|
26
|
+
* `[...]` index. A quoted key may hold `.` or `]`, so quotes are honoured.
|
|
27
|
+
*/
|
|
28
|
+
function terraformParts(address) {
|
|
29
|
+
const parts = [];
|
|
30
|
+
let current = "";
|
|
31
|
+
let depth = 0;
|
|
32
|
+
let quoted = false;
|
|
33
|
+
for (let i = 0; i < address.length; i++) {
|
|
34
|
+
const c = address[i];
|
|
35
|
+
if (depth > 0) {
|
|
36
|
+
if (quoted) {
|
|
37
|
+
if (c === "\\")
|
|
38
|
+
i++;
|
|
39
|
+
else if (c === '"')
|
|
40
|
+
quoted = false;
|
|
41
|
+
}
|
|
42
|
+
else if (c === '"')
|
|
43
|
+
quoted = true;
|
|
44
|
+
else if (c === "]")
|
|
45
|
+
depth--;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (c === "[")
|
|
49
|
+
depth++;
|
|
50
|
+
else if (c === ".") {
|
|
51
|
+
parts.push(current);
|
|
52
|
+
current = "";
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
current += c;
|
|
56
|
+
}
|
|
57
|
+
parts.push(current);
|
|
58
|
+
return parts.filter((p) => p.length > 0);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The block key the terraform lexicon gives an address in its root:
|
|
62
|
+
* `module.<call>/` for each module call, then the block's own address with
|
|
63
|
+
* no index. `module.app.terraform_data.instance[0]` is
|
|
64
|
+
* `module.app/terraform_data.instance`.
|
|
65
|
+
*/
|
|
66
|
+
export function terraformBlockKey(address) {
|
|
67
|
+
const parts = terraformParts(address);
|
|
68
|
+
const scope = [];
|
|
69
|
+
let i = 0;
|
|
70
|
+
while (parts[i] === "module" && i + 1 < parts.length) {
|
|
71
|
+
scope.push(`module.${parts[i + 1]}`);
|
|
72
|
+
i += 2;
|
|
73
|
+
}
|
|
74
|
+
const rest = parts.slice(i);
|
|
75
|
+
let block;
|
|
76
|
+
if (rest[0] === "data" && rest.length >= 3)
|
|
77
|
+
block = `data.${rest[1]}.${rest[2]}`;
|
|
78
|
+
else if (rest.length >= 2)
|
|
79
|
+
block = `${rest[0]}.${rest[1]}`;
|
|
80
|
+
else if (rest.length === 0 && scope.length > 0) {
|
|
81
|
+
// The module call itself is a block of its caller.
|
|
82
|
+
const call = scope.pop();
|
|
83
|
+
block = call;
|
|
84
|
+
}
|
|
85
|
+
if (block === undefined)
|
|
86
|
+
return undefined;
|
|
87
|
+
return [...scope, block].join("/");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The ids, in the order tried, that an entry's address can have in its
|
|
91
|
+
* member's graph IR:
|
|
92
|
+
*
|
|
93
|
+
* - `chant`: the address, which is the entity name the IR uses as its id.
|
|
94
|
+
* - `terraform`, `tofu`, `choudoufu`: `<root>/<block key>`, the root being
|
|
95
|
+
* the change-set member (`terraformBlockKey`), then the address.
|
|
96
|
+
* - `warden`, `sql`: the address.
|
|
97
|
+
*/
|
|
98
|
+
export function changeSetNodeCandidates(entry) {
|
|
99
|
+
switch (entry.planner) {
|
|
100
|
+
case "terraform":
|
|
101
|
+
case "tofu":
|
|
102
|
+
case "choudoufu": {
|
|
103
|
+
const key = terraformBlockKey(entry.address);
|
|
104
|
+
return key === undefined ? [entry.address] : [`${entry.member}/${key}`, entry.address];
|
|
105
|
+
}
|
|
106
|
+
default:
|
|
107
|
+
return [entry.address];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The document with each entry's `node` set from `graph`, and `graph`
|
|
112
|
+
* recording which graph it was. A null `graph` (none could be read) gives
|
|
113
|
+
* every entry `node: null`. The digest is unchanged: `node` is not hashed.
|
|
114
|
+
*/
|
|
115
|
+
export function mapChangeSetToGraph(doc, graph) {
|
|
116
|
+
if (graph === null) {
|
|
117
|
+
return { ...doc, entries: doc.entries.map((e) => ({ ...e, node: null })), graph: null };
|
|
118
|
+
}
|
|
119
|
+
const ids = new Set(graph.ids);
|
|
120
|
+
const prefix = graph.member ? `${graph.member}/` : "";
|
|
121
|
+
return {
|
|
122
|
+
...doc,
|
|
123
|
+
entries: doc.entries.map((e) => {
|
|
124
|
+
const id = changeSetNodeCandidates(e).find((c) => ids.has(c));
|
|
125
|
+
const source = id === undefined ? undefined : graph.sources?.get(id);
|
|
126
|
+
return { ...e, node: id === undefined ? null : `${prefix}${id}`, ...(source !== undefined ? { source } : {}) };
|
|
127
|
+
}),
|
|
128
|
+
graph: { member: graph.member, at: graph.at },
|
|
129
|
+
};
|
|
130
|
+
}
|
package/dist/change-set.d.ts
CHANGED
|
@@ -102,6 +102,25 @@ export interface ChangeSetEntry {
|
|
|
102
102
|
/** The estate, environment or org the change lands in. */
|
|
103
103
|
scope?: string;
|
|
104
104
|
attributes: ChangeSetAttribute[];
|
|
105
|
+
/**
|
|
106
|
+
* The graph node the entry changes, as `chant graph --format ir` and
|
|
107
|
+
* `chant workspace graph` name it (#4022): `<member>/<id>` inside a
|
|
108
|
+
* workspace. Null when the graph holds no node for the address, such as
|
|
109
|
+
* a delete of a block the source no longer declares. Absent until the
|
|
110
|
+
* document is mapped onto a graph (`./change-set-graph.ts`), and never
|
|
111
|
+
* part of the digest.
|
|
112
|
+
*/
|
|
113
|
+
node?: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* The source file that declares the entry's node, from the repository
|
|
116
|
+
* root (#4025): the node's `sourceLoc.file` in the member's graph IR, with
|
|
117
|
+
* the member's directory in front. Set beside `node` when a stored change
|
|
118
|
+
* set is mapped onto a graph whose node has a source location, absent
|
|
119
|
+
* otherwise. Like `node`, never part of the digest. The overlap report
|
|
120
|
+
* attributes the entry to a work item through the commits that changed
|
|
121
|
+
* this file.
|
|
122
|
+
*/
|
|
123
|
+
source?: string;
|
|
105
124
|
}
|
|
106
125
|
/** Something a planner could not read, so the plan says nothing about it. */
|
|
107
126
|
export interface ChangeSetHole {
|
|
@@ -182,6 +201,29 @@ export interface ChangeSetDocument {
|
|
|
182
201
|
/** Triggered actions, sorted by member and address. Absent when no member runs one. */
|
|
183
202
|
sideEffects?: ChangeSetSideEffect[];
|
|
184
203
|
summary: ChangeSetSummary;
|
|
204
|
+
/**
|
|
205
|
+
* The graph the entries' `node` ids come from (#4022): the workspace member
|
|
206
|
+
* whose graph it is, or null outside a workspace, and the commit it was
|
|
207
|
+
* read at, or null when that is unknown. Null when no graph could be read,
|
|
208
|
+
* so every `node` is null. Absent on a document never mapped. Not hashed.
|
|
209
|
+
*/
|
|
210
|
+
graph?: ChangeSetGraph | null;
|
|
211
|
+
/**
|
|
212
|
+
* The release this change set was planned for (#4045): the `releaseDigest`
|
|
213
|
+
* of the release a `components promote --release` deploys. Set with
|
|
214
|
+
* `environment` on a release gate's document, absent on every other. Part
|
|
215
|
+
* of the digest when present, so a stored document names the one release
|
|
216
|
+
* and environment its gate bound, and two releases whose plans read the
|
|
217
|
+
* same never share a document or an approval.
|
|
218
|
+
*/
|
|
219
|
+
releaseDigest?: string;
|
|
220
|
+
/** The environment this change set was planned for (#4045), set with `releaseDigest`. Part of the digest when present. */
|
|
221
|
+
environment?: string;
|
|
222
|
+
}
|
|
223
|
+
/** Where a document's node ids come from. */
|
|
224
|
+
export interface ChangeSetGraph {
|
|
225
|
+
member: string | null;
|
|
226
|
+
at: string | null;
|
|
185
227
|
}
|
|
186
228
|
/**
|
|
187
229
|
* The set digest over members' plan digests: `computePlanDigest("change-set",
|
|
@@ -196,19 +238,29 @@ export declare function changeSetDigest(members: ReadonlyArray<Pick<ChangeSetMem
|
|
|
196
238
|
/**
|
|
197
239
|
* The document's digest: `computePlanDigest("change-set-document", …)` over
|
|
198
240
|
* the set digest ({@link changeSetDigest}), each member's name, status and
|
|
199
|
-
* holes, the entries and the side effects.
|
|
241
|
+
* holes, the entries (without their graph `node`) and the side effects.
|
|
242
|
+
* Members are sorted by name and
|
|
200
243
|
* entries and side effects by the keys {@link composeChangeSet} sorts them by,
|
|
201
244
|
* so order makes no difference.
|
|
202
245
|
*
|
|
203
246
|
* A provisional member is left out, with its entries and side effects, as
|
|
204
247
|
* the set digest leaves it out: no approval of the document covers it.
|
|
248
|
+
*
|
|
249
|
+
* A release gate's document (#4045) also hashes the `releaseDigest` and
|
|
250
|
+
* `environment` it was planned for. A document without them hashes as it
|
|
251
|
+
* always has, so no earlier digest moves.
|
|
205
252
|
*/
|
|
206
|
-
export declare function changeSetDocumentDigest(doc: Pick<ChangeSetDocument, "members" | "entries" | "sideEffects">): string;
|
|
253
|
+
export declare function changeSetDocumentDigest(doc: Pick<ChangeSetDocument, "members" | "entries" | "sideEffects" | "releaseDigest" | "environment">): string;
|
|
207
254
|
/** The summary of a set of members and entries. */
|
|
208
255
|
export declare function summarizeChangeSet(members: ChangeSetMember[], entries: ChangeSetEntry[]): ChangeSetSummary;
|
|
209
256
|
export interface ComposeChangeSetOptions {
|
|
210
257
|
/** The chant version to record in `chant`. */
|
|
211
258
|
chant?: string;
|
|
259
|
+
/** The release and environment a release gate's change set was planned for (#4045), recorded and hashed. */
|
|
260
|
+
planned?: {
|
|
261
|
+
releaseDigest: string;
|
|
262
|
+
environment: string;
|
|
263
|
+
};
|
|
212
264
|
}
|
|
213
265
|
/**
|
|
214
266
|
* Join adapters' parts into one document: members sorted by name, entries
|
|
@@ -222,7 +274,14 @@ export declare function composeChangeSet(parts: ReadonlyArray<ChangeSetPart>, op
|
|
|
222
274
|
* effects give ({@link changeSetDocumentDigest}). A document that names a
|
|
223
275
|
* member twice has no digest and is not verified.
|
|
224
276
|
*/
|
|
225
|
-
export declare function verifyChangeSetDigest(doc: Pick<ChangeSetDocument, "digest" | "members" | "entries" | "sideEffects">): boolean;
|
|
277
|
+
export declare function verifyChangeSetDigest(doc: Pick<ChangeSetDocument, "digest" | "members" | "entries" | "sideEffects" | "releaseDigest" | "environment">): boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Whether a change set changes nothing (ws-104 question 6, #4045): it has at
|
|
280
|
+
* least one member, every member planned, none failed or provisional, no
|
|
281
|
+
* member has a hole, and every entry is a `no-op` or a `read`. A release
|
|
282
|
+
* gate over such a document passes without an approval.
|
|
283
|
+
*/
|
|
284
|
+
export declare function isEmptyChangeSet(doc: Pick<ChangeSetDocument, "members" | "entries">): boolean;
|
|
226
285
|
export interface LifecyclePlanPartInput {
|
|
227
286
|
member: string;
|
|
228
287
|
/** `chant lifecycle plan <env> --json`, parsed. */
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,SAAS,CAAC,GAAG,OAAO,CAM7F;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,EAAE,kBAAkB,CAAC;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAkD9E;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IAChD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAyC9E;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAsB/H"}
|
package/dist/change-set.js
CHANGED
|
@@ -78,12 +78,17 @@ export function changeSetDigest(members) {
|
|
|
78
78
|
/**
|
|
79
79
|
* The document's digest: `computePlanDigest("change-set-document", …)` over
|
|
80
80
|
* the set digest ({@link changeSetDigest}), each member's name, status and
|
|
81
|
-
* holes, the entries and the side effects.
|
|
81
|
+
* holes, the entries (without their graph `node`) and the side effects.
|
|
82
|
+
* Members are sorted by name and
|
|
82
83
|
* entries and side effects by the keys {@link composeChangeSet} sorts them by,
|
|
83
84
|
* so order makes no difference.
|
|
84
85
|
*
|
|
85
86
|
* A provisional member is left out, with its entries and side effects, as
|
|
86
87
|
* the set digest leaves it out: no approval of the document covers it.
|
|
88
|
+
*
|
|
89
|
+
* A release gate's document (#4045) also hashes the `releaseDigest` and
|
|
90
|
+
* `environment` it was planned for. A document without them hashes as it
|
|
91
|
+
* always has, so no earlier digest moves.
|
|
87
92
|
*/
|
|
88
93
|
export function changeSetDocumentDigest(doc) {
|
|
89
94
|
const provisional = new Set(doc.members.filter((m) => m.provisional === true).map((m) => m.member));
|
|
@@ -91,9 +96,19 @@ export function changeSetDocumentDigest(doc) {
|
|
|
91
96
|
.filter((m) => !provisional.has(m.member))
|
|
92
97
|
.map((m) => ({ member: m.member, status: m.status, holes: m.holes }))
|
|
93
98
|
.sort((a, b) => byString(a.member, b.member));
|
|
94
|
-
|
|
99
|
+
// An entry's graph node (#4022) and its source file (#4025) say where on
|
|
100
|
+
// the graph the change is, not what the plan does, so they stay outside
|
|
101
|
+
// the digest: mapping a stored
|
|
102
|
+
// document onto a graph never moves the value its gate bound.
|
|
103
|
+
const entries = doc.entries
|
|
104
|
+
.filter((e) => !provisional.has(e.member))
|
|
105
|
+
.map(({ node: _node, source: _source, ...e }) => e)
|
|
106
|
+
.sort((a, b) => byString(entryKey(a), entryKey(b)));
|
|
95
107
|
const sideEffects = (doc.sideEffects ?? []).filter((s) => !provisional.has(s.member)).sort(bySideEffect);
|
|
96
|
-
|
|
108
|
+
const planned = doc.releaseDigest !== undefined || doc.environment !== undefined
|
|
109
|
+
? { planned: { releaseDigest: doc.releaseDigest ?? null, environment: doc.environment ?? null } }
|
|
110
|
+
: {};
|
|
111
|
+
return computePlanDigest("change-set-document", { set: changeSetDigest(doc.members), members, entries, sideEffects, ...planned });
|
|
97
112
|
}
|
|
98
113
|
/** The summary of a set of members and entries. */
|
|
99
114
|
export function summarizeChangeSet(members, entries) {
|
|
@@ -155,12 +170,14 @@ export function composeChangeSet(parts, options = {}) {
|
|
|
155
170
|
const sideEffects = parts
|
|
156
171
|
.flatMap((p) => (p.sideEffects ?? []).map((s) => ({ member: p.member.member, ...s })))
|
|
157
172
|
.sort(bySideEffect);
|
|
158
|
-
const
|
|
173
|
+
const planned = options.planned ? { releaseDigest: options.planned.releaseDigest, environment: options.planned.environment } : {};
|
|
174
|
+
const digest = changeSetDocumentDigest({ members, entries, sideEffects, ...planned });
|
|
159
175
|
return {
|
|
160
176
|
$schema: CHANGE_SET_SCHEMA_ID,
|
|
161
177
|
contract: CHANGE_SET_CONTRACT,
|
|
162
178
|
...(options.chant !== undefined ? { chant: options.chant } : {}),
|
|
163
179
|
digest,
|
|
180
|
+
...planned,
|
|
164
181
|
members,
|
|
165
182
|
entries,
|
|
166
183
|
...(sideEffects.length > 0 ? { sideEffects } : {}),
|
|
@@ -180,6 +197,21 @@ export function verifyChangeSetDigest(doc) {
|
|
|
180
197
|
return false;
|
|
181
198
|
}
|
|
182
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Whether a change set changes nothing (ws-104 question 6, #4045): it has at
|
|
202
|
+
* least one member, every member planned, none failed or provisional, no
|
|
203
|
+
* member has a hole, and every entry is a `no-op` or a `read`. A release
|
|
204
|
+
* gate over such a document passes without an approval.
|
|
205
|
+
*/
|
|
206
|
+
export function isEmptyChangeSet(doc) {
|
|
207
|
+
if (doc.members.length === 0)
|
|
208
|
+
return false;
|
|
209
|
+
for (const m of doc.members) {
|
|
210
|
+
if (m.status !== "planned" || m.provisional === true || m.holes.length > 0)
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
return doc.entries.every((e) => e.action === "no-op" || e.action === "read");
|
|
214
|
+
}
|
|
183
215
|
function lifecycleAttributes(entry) {
|
|
184
216
|
const because = new Set(entry.disruptionBecause ?? []);
|
|
185
217
|
return (entry.deltas ?? []).map((d) => ({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The installed chant's version, read from `@intentius/chant`'s own
|
|
3
|
+
* package.json, or "0.0.0" when it can't be read. The path is the same from
|
|
4
|
+
* `src/` and `dist/`, so it holds whether chant runs from source or from its
|
|
5
|
+
* build. Kept outside `cli/` so that a module the Op entry loads, such as the
|
|
6
|
+
* run-event writer (#4041), can name the version without loading the CLI.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CHANT_VERSION: string;
|
|
9
|
+
//# sourceMappingURL=chant-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chant-version.d.ts","sourceRoot":"","sources":["../src/chant-version.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,MAMxB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
/**
|
|
3
|
+
* The installed chant's version, read from `@intentius/chant`'s own
|
|
4
|
+
* package.json, or "0.0.0" when it can't be read. The path is the same from
|
|
5
|
+
* `src/` and `dist/`, so it holds whether chant runs from source or from its
|
|
6
|
+
* build. Kept outside `cli/` so that a module the Op entry loads, such as the
|
|
7
|
+
* run-event writer (#4041), can name the version without loading the CLI.
|
|
8
|
+
*/
|
|
9
|
+
export const CHANT_VERSION = (() => {
|
|
10
|
+
try {
|
|
11
|
+
return createRequire(import.meta.url)("../package.json").version ?? "0.0.0";
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return "0.0.0";
|
|
15
|
+
}
|
|
16
|
+
})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuildParamsConfig } from "../build-params.js";
|
|
1
|
+
import { type BuildParamFlags, type BuildParamsConfig } from "../build-params.js";
|
|
2
2
|
import type { BuildParamProvenance } from "../provenance.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared CLI-layer wiring for chant #1064's build-time parameters, factored
|
|
@@ -26,6 +26,10 @@ export interface CliBuildParamsArgs {
|
|
|
26
26
|
paramsFile?: string;
|
|
27
27
|
/** `--verbose` — list every resolved parameter one per line instead of the one-line count (#1424). */
|
|
28
28
|
verbose?: boolean;
|
|
29
|
+
/** The workspace flags backing parameters in this build's environment (#4024), from `../flag-params.ts`. */
|
|
30
|
+
flags?: BuildParamFlags;
|
|
31
|
+
/** `false` to resolve without printing the summary line, for a caller that checks more before it prints ({@link echoBuildParams}). */
|
|
32
|
+
echo?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export interface CliBuildParamsResolution {
|
|
31
35
|
success: boolean;
|
|
@@ -56,6 +60,8 @@ export interface CliBuildParamsResolution {
|
|
|
56
60
|
* `[param] <name> = <value> (<source>)` instead (#1424).
|
|
57
61
|
*/
|
|
58
62
|
export declare function resolveCliBuildParams(buildParamsConfig: BuildParamsConfig | undefined, args: CliBuildParamsArgs): CliBuildParamsResolution;
|
|
63
|
+
/** Print a successful resolution: the one-line summary, or every value under `--verbose` or `CHANT_PARAM_ECHO=all` (#1424). */
|
|
64
|
+
export declare function echoBuildParams(provenance: readonly BuildParamProvenance[], verboseFlag?: boolean): void;
|
|
59
65
|
/**
|
|
60
66
|
* `N build parameters resolved (1 from cli, 3 default); --verbose to list` —
|
|
61
67
|
* the non-verbose echo of a successful resolution (#1424). Sources appear in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-params-cli.d.ts","sourceRoot":"","sources":["../../src/cli/build-params-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-params-cli.d.ts","sourceRoot":"","sources":["../../src/cli/build-params-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;;;;;;;;;;;;GAeG;AAEH,4SAA4S;AAC5S,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAQtF;AAED,qOAAqO;AACrO,MAAM,WAAW,kBAAkB;IACjC,mNAAmN;IACnN,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4GAA4G;IAC5G,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,sIAAsI;IACtI,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,4FAA4F;IAC5F,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CACnC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE,kBAAkB,GACvB,wBAAwB,CAgC1B;AAED,+HAA+H;AAC/H,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAcxG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CActF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,kBAAkB,CACtC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAAC,oBAAoB,EAAE,GAAG,SAAS,CAAC,CAU7C"}
|
|
@@ -65,6 +65,7 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
65
65
|
cli: args.cli,
|
|
66
66
|
fromFile,
|
|
67
67
|
env: process.env,
|
|
68
|
+
...(args.flags ? { flags: args.flags } : {}),
|
|
68
69
|
});
|
|
69
70
|
for (const message of resolution.errors) {
|
|
70
71
|
errors.push(formatError({ message }));
|
|
@@ -72,21 +73,26 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
72
73
|
if (errors.length > 0) {
|
|
73
74
|
return { success: false, provenance: [], errors };
|
|
74
75
|
}
|
|
76
|
+
if (args.echo !== false)
|
|
77
|
+
echoBuildParams(resolution.provenance, args.verbose);
|
|
78
|
+
return { success: true, provenance: resolution.provenance, errors: [] };
|
|
79
|
+
}
|
|
80
|
+
/** Print a successful resolution: the one-line summary, or every value under `--verbose` or `CHANT_PARAM_ECHO=all` (#1424). */
|
|
81
|
+
export function echoBuildParams(provenance, verboseFlag) {
|
|
75
82
|
// #1424 — one line by default. A project with two dozen declared
|
|
76
83
|
// parameters printed two dozen grey lines on every build, ahead of the
|
|
77
84
|
// warnings the reader actually needed. The count by source still answers
|
|
78
85
|
// "did my override reach the build" (the failure mode
|
|
79
86
|
// warnIfParamsCannotReachProject exists for); --verbose names every value.
|
|
80
|
-
const verbose =
|
|
87
|
+
const verbose = verboseFlag === true || process.env.CHANT_PARAM_ECHO === "all";
|
|
81
88
|
if (verbose) {
|
|
82
|
-
for (const p of
|
|
89
|
+
for (const p of provenance) {
|
|
83
90
|
console.error(formatInfo(`[param] ${p.name} = ${JSON.stringify(p.value)} (${p.source})`));
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
|
-
else if (
|
|
87
|
-
console.error(formatInfo(summarizeBuildParams(
|
|
93
|
+
else if (provenance.length > 0) {
|
|
94
|
+
console.error(formatInfo(summarizeBuildParams(provenance)));
|
|
88
95
|
}
|
|
89
|
-
return { success: true, provenance: resolution.provenance, errors: [] };
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
98
|
* `N build parameters resolved (1 from cli, 3 default); --verbose to list` —
|
|
@@ -95,9 +101,12 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
95
101
|
*/
|
|
96
102
|
export function summarizeBuildParams(provenance) {
|
|
97
103
|
const counts = new Map();
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
// Every flag source (`flag:<name>`, #4024) counts as one, "from flags".
|
|
105
|
+
for (const p of provenance) {
|
|
106
|
+
const source = p.source.startsWith("flag:") ? "flags" : p.source;
|
|
107
|
+
counts.set(source, (counts.get(source) ?? 0) + 1);
|
|
108
|
+
}
|
|
109
|
+
const order = ["cli", "params-file", "env", "flags", "default"];
|
|
101
110
|
const rank = (s) => (order.includes(s) ? order.indexOf(s) : order.length);
|
|
102
111
|
const parts = [...counts.keys()]
|
|
103
112
|
.sort((a, b) => rank(a) - rank(b))
|
|
@@ -80,6 +80,14 @@ export interface BuildOptions {
|
|
|
80
80
|
serializers: Serializer[];
|
|
81
81
|
result?: ReturnType<typeof build>;
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Where each output file goes: called with its absolute path and its
|
|
85
|
+
* content in place of creating the directory and writing the file. A
|
|
86
|
+
* release cut (#4046) passes one that keeps the files in memory, so it
|
|
87
|
+
* records exactly what this build writes and nothing left on disk by an
|
|
88
|
+
* earlier one.
|
|
89
|
+
*/
|
|
90
|
+
writeFile?: (path: string, content: string) => void;
|
|
83
91
|
}
|
|
84
92
|
/**
|
|
85
93
|
* Resolve the output format for `chant build`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAepC,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAgBrF,OAAO,EAAuC,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOrG;;GAEG;AACH,M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