@intentius/chant 0.124.87 → 0.124.89
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/dist/action-pins.d.ts +1 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +2 -0
- package/dist/actor.d.ts +47 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +56 -0
- package/dist/bundle-check.d.ts +20 -5
- package/dist/bundle-check.d.ts.map +1 -1
- package/dist/bundle-check.js +20 -5
- package/dist/chant-install.d.ts +98 -0
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +203 -2
- package/dist/ci-base.d.ts +30 -0
- package/dist/ci-base.d.ts.map +1 -0
- package/dist/ci-base.js +33 -0
- package/dist/ci-comment-commands.d.ts +177 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +325 -0
- package/dist/ci-comment-replies.d.ts +40 -0
- package/dist/ci-comment-replies.d.ts.map +1 -0
- package/dist/ci-comment-replies.js +59 -0
- package/dist/ci-commit.d.ts +1 -1
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +1 -2
- package/dist/ci-control.d.ts +1 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +1 -1
- package/dist/ci-evidence-claims.d.ts +59 -0
- package/dist/ci-evidence-claims.d.ts.map +1 -0
- package/dist/ci-evidence-claims.js +87 -0
- package/dist/ci-evidence-from-job.d.ts +128 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -0
- package/dist/ci-evidence-from-job.js +203 -0
- package/dist/ci-evidence-jobs.d.ts +68 -4
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +82 -5
- package/dist/ci-handover.d.ts +12 -0
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +15 -3
- package/dist/ci-identity.d.ts +32 -6
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +40 -8
- package/dist/ci-image.d.ts +65 -10
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +101 -22
- package/dist/ci-jobs.d.ts +1 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -2
- package/dist/ci-login.d.ts +75 -13
- package/dist/ci-login.d.ts.map +1 -1
- package/dist/ci-login.js +89 -37
- package/dist/ci-note-commands.d.ts +63 -3
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +69 -35
- package/dist/ci-product-words.d.ts +62 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +52 -1
- package/dist/ci-product.d.ts +52 -2
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +51 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve-confirm.d.ts +14 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
- package/dist/cli/handlers/approve-confirm.js +46 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -1
- package/dist/cli/handlers/build.d.ts +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -1
- package/dist/cli/handlers/ci-check.d.ts +1 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +37 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +255 -20
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-forge-check.js +34 -17
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +3 -1
- package/dist/cli/handlers/generated-check.d.ts +11 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -0
- package/dist/cli/handlers/generated-check.js +71 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +3 -0
- package/dist/cli/handlers/local-chant.d.ts +13 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -1
- package/dist/cli/handlers/local-chant.js +42 -1
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +121 -4
- package/dist/cli/handlers/pr-comment.d.ts +21 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +112 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +6 -3
- package/dist/cli/handlers/pr.d.ts +23 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +97 -14
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +2 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +11 -2
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +36 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +2 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +60 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +82 -0
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -1
- package/dist/components/check-hooks.d.ts +10 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +18 -0
- package/dist/components/pr-checks.d.ts +169 -0
- package/dist/components/pr-checks.d.ts.map +1 -0
- package/dist/components/pr-checks.js +180 -0
- package/dist/components/pr-pipeline.d.ts +38 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +6 -1
- package/dist/components/product-pipeline.d.ts +58 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +76 -9
- package/dist/components/product-plan.d.ts +445 -7
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +426 -15
- package/dist/config.d.ts +10 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/control/consumers.d.ts +6 -0
- package/dist/control/consumers.d.ts.map +1 -1
- package/dist/control/consumers.js +6 -0
- package/dist/dead-guards.d.ts.map +1 -1
- package/dist/dead-guards.js +9 -6
- package/dist/discovery/files.d.ts +1 -1
- package/dist/discovery/files.js +1 -1
- package/dist/drift-issue.d.ts +20 -3
- package/dist/drift-issue.d.ts.map +1 -1
- package/dist/drift-issue.js +16 -0
- package/dist/drift-record.d.ts +52 -5
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +46 -6
- package/dist/floor-table.d.ts +6 -6
- package/dist/floor-table.d.ts.map +1 -1
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +81 -21
- package/dist/floor-table.js +10 -7
- package/dist/forge-check/contract.d.ts +19 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +8 -2
- package/dist/forge-check/index.d.ts +4 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +4 -0
- package/dist/forge-flags.d.ts +10 -0
- package/dist/forge-flags.d.ts.map +1 -1
- package/dist/forge-flags.js +31 -0
- package/dist/forge-remote.d.ts +47 -0
- package/dist/forge-remote.d.ts.map +1 -0
- package/dist/forge-remote.js +69 -0
- package/dist/gate-resume-run.d.ts +9 -1
- package/dist/gate-resume-run.d.ts.map +1 -1
- package/dist/gate-resume-run.js +26 -3
- package/dist/generated-check.d.ts +88 -0
- package/dist/generated-check.d.ts.map +1 -0
- package/dist/generated-check.js +248 -0
- package/dist/image-pins.d.ts +26 -0
- package/dist/image-pins.d.ts.map +1 -0
- package/dist/image-pins.js +19 -0
- package/dist/lexicon.d.ts +27 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +30 -3
- package/dist/lifecycle/publish-npm.d.ts +26 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +76 -4
- package/dist/lifecycle/reach-locks.d.ts +131 -0
- package/dist/lifecycle/reach-locks.d.ts.map +1 -0
- package/dist/lifecycle/reach-locks.js +118 -0
- package/dist/lifecycle/release-cut.d.ts +3 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-images.d.ts +22 -1
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +26 -3
- package/dist/lifecycle/release-ledger.d.ts +4 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +3 -2
- package/dist/local-chant.d.ts +57 -3
- package/dist/local-chant.d.ts.map +1 -1
- package/dist/local-chant.js +122 -13
- package/dist/notify-product.d.ts +12 -3
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +10 -6
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +2 -1
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +2 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-evidence-jobs.d.ts +97 -0
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-jobs.js +118 -0
- package/dist/op/op-waves-evidence.d.ts +12 -1
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +23 -2
- package/dist/op/op-waves-render-spec.d.ts +100 -0
- package/dist/op/op-waves-render-spec.d.ts.map +1 -0
- package/dist/op/op-waves-render-spec.js +162 -0
- package/dist/op/op-waves-run.d.ts +14 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +56 -4
- package/dist/op/op-waves.d.ts +12 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +14 -1
- package/dist/op/schedule-overdue.d.ts +39 -2
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +148 -10
- package/dist/op/wave-stop.d.ts +64 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +127 -0
- package/dist/planned-files.d.ts +76 -0
- package/dist/planned-files.d.ts.map +1 -0
- package/dist/planned-files.js +108 -0
- package/dist/pr-forge-job.d.ts +22 -0
- package/dist/pr-forge-job.d.ts.map +1 -0
- package/dist/pr-forge-job.js +46 -0
- package/dist/pr-forge-reads.d.ts +21 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +19 -1
- package/dist/pr-forge.d.ts +7 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +7 -2
- package/dist/pr-loop.d.ts +3 -6
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -81
- package/dist/pr-plan-note.d.ts +121 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +104 -1
- package/dist/pr-plan-record.d.ts +47 -0
- package/dist/pr-plan-record.d.ts.map +1 -0
- package/dist/pr-plan-record.js +89 -0
- package/dist/pr-post.d.ts +68 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +218 -13
- package/dist/pr-requires.d.ts +8 -0
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +3 -1
- package/dist/pr-status.d.ts +16 -0
- package/dist/pr-status.d.ts.map +1 -0
- package/dist/pr-status.js +90 -0
- package/dist/ref-gate-init.d.ts +90 -0
- package/dist/ref-gate-init.d.ts.map +1 -0
- package/dist/ref-gate-init.js +155 -0
- package/dist/ref-gate-rules.d.ts +19 -0
- package/dist/ref-gate-rules.d.ts.map +1 -0
- package/dist/ref-gate-rules.js +17 -0
- package/dist/release-floors.d.ts +100 -16
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +101 -17
- package/dist/render-module.d.ts +15 -0
- package/dist/render-module.d.ts.map +1 -0
- package/dist/render-module.js +73 -0
- package/dist/state-migration.d.ts +24 -1
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +39 -4
- package/dist/state-unlock.d.ts +32 -1
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +31 -0
- package/dist/wave-runtime.mjs +307 -297
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +15 -8
- package/dist/workspace/drift-cli.d.ts +1 -1
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +5 -12
- package/dist/workspace/forge-work.d.ts +3 -2
- package/dist/workspace/forge-work.d.ts.map +1 -1
- package/dist/workspace/forge-work.js +7 -17
- package/dist/workspace/lexicon-outputs.js +2 -2
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +2 -1
- package/dist/workspace/release-workflow.d.ts +27 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +52 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +25 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +28 -8
- package/dist/workspace/trust/check-evidence.d.ts +13 -1
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +8 -3
- package/dist/workspace/trust/evidence.d.ts +5 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/open-evidence.d.ts +67 -0
- package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/open-evidence.js +92 -0
- package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +93 -11
- package/dist/workspace/trust/ref-gate.d.ts +61 -2
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +72 -7
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +1 -1
- package/src/action-pins.ts +2 -0
- package/src/actor.test.ts +78 -0
- package/src/actor.ts +79 -0
- package/src/bundle-check.test.ts +22 -0
- package/src/bundle-check.ts +33 -5
- package/src/chant-install.test.ts +108 -1
- package/src/chant-install.ts +242 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +376 -0
- package/src/ci-comment-commands.ts +389 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +51 -6
- package/src/ci-commit.ts +1 -2
- package/src/ci-control.ts +1 -0
- package/src/ci-evidence-claims.ts +102 -0
- package/src/ci-evidence-from-job.test.ts +165 -0
- package/src/ci-evidence-from-job.ts +251 -0
- package/src/ci-evidence-jobs.ts +88 -6
- package/src/ci-handover.ts +16 -3
- package/src/ci-identity.test.ts +3 -3
- package/src/ci-identity.ts +51 -11
- package/src/ci-image.test.ts +187 -16
- package/src/ci-image.ts +157 -25
- package/src/ci-jobs.ts +7 -2
- package/src/ci-login.test.ts +131 -3
- package/src/ci-login.token-drop.test.ts +204 -0
- package/src/ci-login.ts +137 -39
- package/src/ci-note-commands.ts +104 -41
- package/src/ci-product-words.ts +89 -0
- package/src/ci-product.ts +62 -1
- package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve-confirm.test.ts +35 -0
- package/src/cli/handlers/approve-confirm.ts +44 -0
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/build-source-dir.test.ts +4 -0
- package/src/cli/handlers/build.ts +20 -2
- package/src/cli/handlers/ci-check.ts +37 -7
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +233 -18
- package/src/cli/handlers/ci-forge-check.ts +22 -9
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +69 -0
- package/src/cli/handlers/lifecycle.test.ts +20 -0
- package/src/cli/handlers/lifecycle.ts +4 -0
- package/src/cli/handlers/local-chant.ts +39 -1
- package/src/cli/handlers/lock-reach.test.ts +103 -0
- package/src/cli/handlers/lock.ts +100 -4
- package/src/cli/handlers/pr-comment.ts +104 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +93 -15
- package/src/cli/handlers/promote.ts +2 -1
- package/src/cli/handlers/release.e2e.test.ts +35 -0
- package/src/cli/handlers/release.ts +14 -2
- package/src/cli/handlers/run-wave.ts +35 -2
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +60 -4
- package/src/cli/parse-args.ts +58 -0
- package/src/cli/registry.ts +35 -0
- package/src/components/auto-release.ts +2 -1
- package/src/components/check-hooks.ts +22 -0
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/pr-checks.ts +254 -0
- package/src/components/pr-pipeline.ts +43 -1
- package/src/components/product-pipeline.ts +113 -9
- package/src/components/product-plan.test.ts +140 -1
- package/src/components/product-plan.ts +707 -20
- package/src/config.ts +13 -8
- package/src/control/consumers.ts +7 -0
- package/src/dead-guards.test.ts +27 -5
- package/src/dead-guards.ts +9 -6
- package/src/discovery/files.ts +1 -1
- package/src/drift-issue.test.ts +29 -1
- package/src/drift-issue.ts +28 -3
- package/src/drift-record.test.ts +45 -0
- package/src/drift-record.ts +71 -6
- package/src/floor-table.data.ts +81 -21
- package/src/floor-table.ts +12 -9
- package/src/forge-check/contract.ts +23 -2
- package/src/forge-check/forge-check.test.ts +25 -0
- package/src/forge-check/index.ts +4 -0
- package/src/forge-flags.test.ts +25 -1
- package/src/forge-flags.ts +34 -0
- package/src/forge-remote.test.ts +37 -0
- package/src/forge-remote.ts +79 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +118 -0
- package/src/generated-check.test.ts +170 -0
- package/src/generated-check.ts +310 -0
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +28 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +87 -4
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-catalog.test.ts +2 -2
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
- package/src/lifecycle/release-images.test.ts +100 -0
- package/src/lifecycle/release-images.ts +38 -3
- package/src/lifecycle/release-ledger.ts +4 -3
- package/src/local-chant.e2e.test.ts +81 -6
- package/src/local-chant.test.ts +22 -3
- package/src/local-chant.ts +130 -13
- package/src/notify-product.ts +19 -8
- package/src/op/activities/source-release.ts +2 -1
- package/src/op/activities/source-rollback.ts +2 -1
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/index.ts +10 -0
- package/src/op/op-waves-evidence-jobs.ts +140 -0
- package/src/op/op-waves-evidence.test.ts +36 -3
- package/src/op/op-waves-evidence.ts +23 -3
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +160 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +59 -3
- package/src/op/op-waves.ts +16 -2
- package/src/op/schedule-overdue.test.ts +126 -1
- package/src/op/schedule-overdue.ts +164 -12
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +137 -0
- package/src/planned-files.test.ts +80 -0
- package/src/planned-files.ts +134 -0
- package/src/pr-forge-job.test.ts +53 -0
- package/src/pr-forge-job.ts +46 -0
- package/src/pr-forge-reads-compare.test.ts +2 -1
- package/src/pr-forge-reads.ts +37 -1
- package/src/pr-forge.ts +14 -3
- package/src/pr-loop-narrowed.test.ts +2 -1
- package/src/pr-loop-words.test.ts +2 -1
- package/src/pr-loop.test.ts +1 -2
- package/src/pr-loop.ts +4 -80
- package/src/pr-plan-note.ts +184 -3
- package/src/pr-plan-record.test.ts +75 -0
- package/src/pr-plan-record.ts +101 -0
- package/src/pr-post-plan-note.test.ts +60 -0
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +32 -1
- package/src/pr-post.ts +254 -15
- package/src/pr-requires.test.ts +20 -0
- package/src/pr-requires.ts +10 -1
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +208 -0
- package/src/ref-gate-rules.ts +26 -0
- package/src/release-floors.ts +139 -17
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +89 -0
- package/src/state-migration.test.ts +1 -1
- package/src/state-migration.ts +52 -4
- package/src/state-unlock.test.ts +33 -1
- package/src/state-unlock.ts +49 -1
- package/src/workspace/ci-green-cli.ts +14 -7
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/drift-cli.ts +6 -18
- package/src/workspace/forge-work.ts +7 -14
- package/src/workspace/lexicon-outputs.ts +2 -2
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +104 -3
- package/src/workspace/release-workflow.ts +60 -9
- package/src/workspace/trust/check-evidence-report.ts +39 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/check-evidence.ts +17 -5
- package/src/workspace/trust/evidence.ts +5 -0
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/ref-gate-cli.ts +88 -10
- package/src/workspace/trust/ref-gate-pieces.test.ts +220 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/trust/ref-gate.ts +87 -6
- package/src/workspace/workspace-run.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-run.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAgE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAMnJ,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKpE,OAAO,EAAsB,KAAK,kBAAkB,EAAyB,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAuD,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace-run.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-run.ts"],"names":[],"mappings":"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"}
|
|
@@ -43,6 +43,7 @@ import { executePlan, planMembers } from "./member-commands.js";
|
|
|
43
43
|
import { locateWorkspace } from "./which-chant.js";
|
|
44
44
|
import { appendWorkspaceRun } from "./workspace-ledger.js";
|
|
45
45
|
import { appendWorkspaceGatePending } from "./workspace-gates.js";
|
|
46
|
+
import { actorFromEnv } from "../actor.js";
|
|
46
47
|
/** `chant run`'s exit code for a run that stopped at an unapproved gate (`GATED_EXIT_CODE`). */
|
|
47
48
|
const GATED_EXIT = CHANT_EXIT.waiting;
|
|
48
49
|
const USAGE = "chant workspace run <member>/<op>... [--env <env>] [--gate <name>] [--dry-run] [--json] | chant workspace run --dependents-of <member> --op <op> [--env <env>] [--gate <name>] [--dry-run] [--json] | chant workspace run approve <gate> [--plan <digest>] [--approver <principal>]";
|
|
@@ -412,7 +413,7 @@ async function runWorkspaceRunApprove(ctx, words) {
|
|
|
412
413
|
return 1;
|
|
413
414
|
}
|
|
414
415
|
const { approveWorkspaceGate } = await import("./workspace-gates.js");
|
|
415
|
-
const approvedBy = ctx.args.approver ?? ctx.args.actor ??
|
|
416
|
+
const approvedBy = ctx.args.approver ?? ctx.args.actor ?? actorFromEnv();
|
|
416
417
|
try {
|
|
417
418
|
const record = await approveWorkspaceGate(resolve("."), {
|
|
418
419
|
gate,
|
package/package.json
CHANGED
package/src/action-pins.ts
CHANGED
|
@@ -49,6 +49,8 @@ export const ACTION_PINS = {
|
|
|
49
49
|
setupBun2: pin("oven-sh/setup-bun", "v2", "0c5077e51419868618aeaa5fe8019c62421857d6", "v2.2.0"),
|
|
50
50
|
golangciLint9: pin("golangci/golangci-lint-action", "v9", "ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a", "v9.3.0"),
|
|
51
51
|
dockerLogin4: pin("docker/login-action", "v4", "81c6f93d4bc991e510b342a00b419b3bb4efc5c6", "v4.7.0"),
|
|
52
|
+
// #4876: the release workflow's QEMU binfmt setup for a `release.images` platform the runner can't run.
|
|
53
|
+
dockerSetupQemu4: pin("docker/setup-qemu-action", "v4", "99012661954931238ded8c8b007157a8430204e1", "v4.4.0"),
|
|
52
54
|
dockerSetupBuildx4: pin("docker/setup-buildx-action", "v4", "f87e5991a6d7451dcb8d9637bfbc97413f497069", "v4.4.1"),
|
|
53
55
|
dockerMetadata6: pin("docker/metadata-action", "v6", "dc802804100637a589fabce1cb79ff13a1411302", "v6.2.0"),
|
|
54
56
|
dockerBuildPush7: pin("docker/build-push-action", "v7", "c3c9e263c25d99ce0380d002d59b67737d91b0dc", "v7.4.0"),
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** #4911: one actor fallback for the lexicons' gated requests and the products' requesters. */
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { mkdtempSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join, relative } from "node:path";
|
|
6
|
+
import { beforeAll, describe, expect, test } from "vitest";
|
|
7
|
+
import { ACTOR_ENV_ORDER, actorFromEnv, actorOf, actorOrder } from "./actor";
|
|
8
|
+
|
|
9
|
+
test("the forge's actor, then the login, then unknown", () => {
|
|
10
|
+
expect(actorFromEnv({ GITHUB_ACTOR: "octo", GITLAB_USER_LOGIN: "gl", USER: "me" })).toBe("octo");
|
|
11
|
+
expect(actorFromEnv({ GITLAB_USER_LOGIN: "gl", USER: "me" })).toBe("gl");
|
|
12
|
+
expect(actorFromEnv({ GITHUB_ACTOR: " ", USER: "me" })).toBe("me");
|
|
13
|
+
expect(actorFromEnv({ USERNAME: "win" })).toBe("win");
|
|
14
|
+
expect(actorFromEnv({})).toBe("unknown");
|
|
15
|
+
expect(actorFromEnv({}, "chant")).toBe("chant");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/** #4966: a product's requester order, with the triggering actor and git's user.name. */
|
|
19
|
+
describe("actorOf", () => {
|
|
20
|
+
let repo: string;
|
|
21
|
+
beforeAll(() => {
|
|
22
|
+
repo = mkdtempSync(join(tmpdir(), "chant-actor-"));
|
|
23
|
+
execFileSync("git", ["init", "-q", repo]);
|
|
24
|
+
execFileSync("git", ["-C", repo, "config", "user.name", "Ada Person"]);
|
|
25
|
+
execFileSync("git", ["-C", repo, "config", "user.email", "ada@example.com"]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("with no options it answers as actorFromEnv", () => {
|
|
29
|
+
for (const env of [{ GITHUB_ACTOR: "octo", USER: "me" }, { GITLAB_USER_LOGIN: "gl" }, { USERNAME: "win" }, {}]) {
|
|
30
|
+
expect(actorOf({ env })).toBe(actorFromEnv(env));
|
|
31
|
+
}
|
|
32
|
+
expect(actorOrder()).toEqual([...ACTOR_ENV_ORDER]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("the triggering actor comes ahead of the forge's actor", () => {
|
|
36
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: "rerunner", GITHUB_ACTOR: "starter" }, triggering: true })).toBe("rerunner");
|
|
37
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: " ", GITHUB_ACTOR: "starter" }, triggering: true })).toBe("starter");
|
|
38
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: "rerunner", GITHUB_ACTOR: "starter" } })).toBe("starter");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("git's user.name comes after the forge's actor and before the login", () => {
|
|
42
|
+
expect(actorOf({ env: { GITHUB_ACTOR: "octo", USER: "me" }, repo })).toBe("octo");
|
|
43
|
+
expect(actorOf({ env: { USER: "me" }, repo })).toBe("Ada Person");
|
|
44
|
+
expect(actorOf({ env: { USER: "me" }, repo, gitKeys: ["user.email", "user.name"] })).toBe("ada@example.com");
|
|
45
|
+
expect(actorOrder({ triggering: true, repo })).toEqual(["GITHUB_TRIGGERING_ACTOR", "GITHUB_ACTOR", "GITLAB_USER_LOGIN", "git:user.name", "USER", "USERNAME"]);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test("the forge and the login can be left out, and the fallback named", () => {
|
|
49
|
+
expect(actorOf({ env: { GITHUB_ACTOR: "octo", USER: "me" }, forge: false, repo })).toBe("Ada Person");
|
|
50
|
+
expect(actorOf({ env: { USER: "me" }, triggering: true, login: false, fallback: "" })).toBe("");
|
|
51
|
+
expect(actorOf({ env: {}, fallback: "terragucci" })).toBe("terragucci");
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* #4952: chant's own handlers and records read the fallback from
|
|
57
|
+
* `actorFromEnv`, so none writes the order inline. A cut's actor
|
|
58
|
+
* (`lifecycle/release-workstation.ts`) is another order, with git's
|
|
59
|
+
* `user.email` between the forge and the login, and stays its own.
|
|
60
|
+
*/
|
|
61
|
+
test("no source under packages/core/src writes the actor fallback inline", () => {
|
|
62
|
+
const root = __dirname;
|
|
63
|
+
const own = new Set(["actor.ts", "lifecycle/release-workstation.ts"]);
|
|
64
|
+
const inline = /GITHUB_ACTOR\s*(?:\?\?|\|\|)\s*(?:process\.)?env\.GITLAB_USER_LOGIN/;
|
|
65
|
+
const found: string[] = [];
|
|
66
|
+
const walk = (dir: string): void => {
|
|
67
|
+
for (const name of readdirSync(dir)) {
|
|
68
|
+
const path = join(dir, name);
|
|
69
|
+
if (statSync(path).isDirectory()) {
|
|
70
|
+
if (name !== "node_modules" && name !== "__fixtures__") walk(path);
|
|
71
|
+
} else if (name.endsWith(".ts") && !name.endsWith(".test.ts") && !own.has(relative(root, path))) {
|
|
72
|
+
if (inline.test(readFileSync(path, "utf-8"))) found.push(relative(root, path));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
walk(root);
|
|
77
|
+
expect(found).toEqual([]);
|
|
78
|
+
});
|
package/src/actor.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who runs a command, when the caller names nobody (#4911): the forge's
|
|
3
|
+
* actor in a job (`GITHUB_ACTOR`, which Forgejo sets too, then
|
|
4
|
+
* `GITLAB_USER_LOGIN`), else the login (`USER`, `USERNAME` on Windows).
|
|
5
|
+
* The terraform and pulumi lexicons' gated requests and the products'
|
|
6
|
+
* requesters read it here rather than each writing the order, and so do
|
|
7
|
+
* chant's own CLI handlers and the records they write (#4952). A caller
|
|
8
|
+
* that refuses when nobody is named passes `""` as the fallback.
|
|
9
|
+
*
|
|
10
|
+
* {@link actorOf} is the same order with the two places a product's
|
|
11
|
+
* requester also looks (#4966): `GITHUB_TRIGGERING_ACTOR` ahead of the
|
|
12
|
+
* forge's actor, which names who re-ran a job rather than who started its
|
|
13
|
+
* run, and git's `user.name` in the checkout between the forge's actor and
|
|
14
|
+
* the login, which names the person at a laptop better than `$USER`.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { spawnSync } from "node:child_process";
|
|
18
|
+
|
|
19
|
+
/** The actor fallback's variables, in the order {@link actorFromEnv} reads them. */
|
|
20
|
+
export const ACTOR_ENV_ORDER = ["GITHUB_ACTOR", "GITLAB_USER_LOGIN", "USER", "USERNAME"] as const;
|
|
21
|
+
|
|
22
|
+
/** The first of {@link ACTOR_ENV_ORDER} set to something other than blanks, else `fallback` (default `unknown`). */
|
|
23
|
+
export function actorFromEnv(env: Record<string, string | undefined> = process.env, fallback = "unknown"): string {
|
|
24
|
+
for (const name of ACTOR_ENV_ORDER) {
|
|
25
|
+
const v = env[name]?.trim();
|
|
26
|
+
if (v) return v;
|
|
27
|
+
}
|
|
28
|
+
return fallback;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Which of the places {@link actorOf} reads, and the answer when none is set. */
|
|
32
|
+
export interface ActorOptions {
|
|
33
|
+
/** The variables. Default `process.env`. */
|
|
34
|
+
env?: Record<string, string | undefined>;
|
|
35
|
+
/** Read `GITHUB_TRIGGERING_ACTOR` first: who re-ran the job, ahead of who started the run. Default false. */
|
|
36
|
+
triggering?: boolean;
|
|
37
|
+
/** Read the forge's actor (`GITHUB_ACTOR`, `GITLAB_USER_LOGIN`). Default true. */
|
|
38
|
+
forge?: boolean;
|
|
39
|
+
/** A checkout whose git config is read after the forge's actor. Unset, git is not asked. */
|
|
40
|
+
repo?: string;
|
|
41
|
+
/** The git config keys read in `repo`, in order. Default `["user.name"]`. */
|
|
42
|
+
gitKeys?: readonly string[];
|
|
43
|
+
/** Read the login (`USER`, `USERNAME`) last. Default true. */
|
|
44
|
+
login?: boolean;
|
|
45
|
+
/** The answer when nothing is set. Default `unknown`; `""` for a caller that refuses. */
|
|
46
|
+
fallback?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The places {@link actorOf} reads for `options`, in order: variable names, and `git:<key>` for a git config key. */
|
|
50
|
+
export function actorOrder(options: Omit<ActorOptions, "env" | "fallback"> = {}): string[] {
|
|
51
|
+
return [
|
|
52
|
+
...(options.triggering ? ["GITHUB_TRIGGERING_ACTOR"] : []),
|
|
53
|
+
...(options.forge === false ? [] : ["GITHUB_ACTOR", "GITLAB_USER_LOGIN"]),
|
|
54
|
+
...(options.repo !== undefined ? (options.gitKeys ?? ["user.name"]).map((k) => `git:${k}`) : []),
|
|
55
|
+
...(options.login === false ? [] : ["USER", "USERNAME"]),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function gitConfig(repo: string, key: string): string | undefined {
|
|
60
|
+
const r = spawnSync("git", ["-C", repo, "config", key], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
|
|
61
|
+
return r.status === 0 ? r.stdout.trim() : undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The first place of {@link actorOrder} set to something other than blanks,
|
|
66
|
+
* else `fallback` (#4966). With no options it answers as
|
|
67
|
+
* {@link actorFromEnv}. A git config key is read only when every place
|
|
68
|
+
* before it is empty, so a job with a forge actor runs no git.
|
|
69
|
+
*/
|
|
70
|
+
export function actorOf(options: ActorOptions = {}): string {
|
|
71
|
+
const env = options.env ?? process.env;
|
|
72
|
+
for (const place of actorOrder(options)) {
|
|
73
|
+
const v = (place.startsWith("git:") ? gitConfig(options.repo!, place.slice(4)) : env[place])?.trim();
|
|
74
|
+
if (v) return v;
|
|
75
|
+
}
|
|
76
|
+
return options.fallback ?? "unknown";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { ACTOR_ORDER_FLOOR } from "./release-floors";
|
package/src/bundle-check.test.ts
CHANGED
|
@@ -64,6 +64,28 @@ describe("chantRuntimeTarget (#4787)", () => {
|
|
|
64
64
|
expect(cb!({ path: "@intentius/chant/ts-only" })).toBeUndefined();
|
|
65
65
|
expect([...external]).toEqual(["@intentius/chant/notify"]);
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
it("keeps external only the chant packages in the package's dependencies, or the ones it is given (#4922)", () => {
|
|
69
|
+
const { app, root } = product();
|
|
70
|
+
const lexicon = join(root, "node_modules/@intentius/chant-lexicon-k8s");
|
|
71
|
+
write(join(lexicon, "package.json"), { name: "@intentius/chant-lexicon-k8s", version: "1.2.3", exports: { ".": { import: "./dist/index.js" } } });
|
|
72
|
+
write(join(lexicon, "dist/index.js"), "export {};\n");
|
|
73
|
+
const resolver = (plugin: ReturnType<typeof chantExternalPlugin>) => {
|
|
74
|
+
let cb: ((a: { path: string }) => unknown) | undefined;
|
|
75
|
+
plugin.setup({ onResolve: (_o, f) => { cb = f; } });
|
|
76
|
+
return cb!;
|
|
77
|
+
};
|
|
78
|
+
// The app depends on @intentius/chant only, so the lexicon (a devDependency it bundles) stays in the bundle.
|
|
79
|
+
const byDeps = resolver(chantExternalPlugin(app));
|
|
80
|
+
expect(byDeps({ path: "@intentius/chant/notify" })).toEqual({ path: "@intentius/chant/notify", external: true });
|
|
81
|
+
expect(byDeps({ path: "@intentius/chant-lexicon-k8s" })).toBeUndefined();
|
|
82
|
+
// Named packages win over the dependencies.
|
|
83
|
+
const external = new Set<string>();
|
|
84
|
+
const named = resolver(chantExternalPlugin(app, { packages: ["@intentius/chant-lexicon-k8s"], external }));
|
|
85
|
+
expect(named({ path: "@intentius/chant-lexicon-k8s" })).toEqual({ path: "@intentius/chant-lexicon-k8s", external: true });
|
|
86
|
+
expect(named({ path: "@intentius/chant" })).toBeUndefined();
|
|
87
|
+
expect([...external]).toEqual(["@intentius/chant-lexicon-k8s"]);
|
|
88
|
+
});
|
|
67
89
|
});
|
|
68
90
|
|
|
69
91
|
describe("bundleImports (#4787)", () => {
|
package/src/bundle-check.ts
CHANGED
|
@@ -113,18 +113,46 @@ export interface EsbuildPluginLike {
|
|
|
113
113
|
}): void;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/** What {@link chantExternalPlugin} keeps external, and where it records it. */
|
|
117
|
+
export interface ChantExternalOptions {
|
|
118
|
+
/**
|
|
119
|
+
* The chant packages whose imports may stay external (#4922). Default: the
|
|
120
|
+
* `@intentius/chant*` packages in the `dependencies` of `pkgDir`'s
|
|
121
|
+
* package.json, the ones an install of the published package brings. A
|
|
122
|
+
* product that bundles its lexicons (devDependencies) and depends only on
|
|
123
|
+
* `@intentius/chant` gets core external and the lexicons bundled.
|
|
124
|
+
*/
|
|
125
|
+
packages?: Iterable<string>;
|
|
126
|
+
/** Collects the specifiers left external. */
|
|
127
|
+
external?: Set<string>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** The `@intentius/chant*` names in the `dependencies` of the package at `pkgDir`. */
|
|
131
|
+
function chantDependencies(pkgDir: string): string[] {
|
|
132
|
+
const f = join(pkgDir, "package.json");
|
|
133
|
+
if (!existsSync(f)) return [];
|
|
134
|
+
const deps = (JSON.parse(readFileSync(f, "utf8")) as { dependencies?: Record<string, string> }).dependencies ?? {};
|
|
135
|
+
return Object.keys(deps).filter((n) => CHANT.test(n));
|
|
136
|
+
}
|
|
137
|
+
|
|
116
138
|
/**
|
|
117
139
|
* An esbuild plugin that leaves an `@intentius/chant*` import external when
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
140
|
+
* its package is one of `options.packages` (by default the package's chant
|
|
141
|
+
* `dependencies`, #4922) and the chant installed for `pkgDir` (where the bin
|
|
142
|
+
* runs) serves it as compiled JS, so the bundle runs the installed, pinned
|
|
143
|
+
* chant. Any other chant import goes on to the next plugin and esbuild, which
|
|
144
|
+
* bundle it. A bundled lexicon's own imports of core come through here too.
|
|
145
|
+
* The second argument may still be the `external` set alone.
|
|
122
146
|
*/
|
|
123
|
-
export function chantExternalPlugin(pkgDir: string,
|
|
147
|
+
export function chantExternalPlugin(pkgDir: string, options?: ChantExternalOptions | Set<string>): EsbuildPluginLike {
|
|
148
|
+
const opts: ChantExternalOptions = options instanceof Set ? { external: options } : (options ?? {});
|
|
149
|
+
const external = opts.external;
|
|
150
|
+
const keep = new Set(opts.packages ?? chantDependencies(pkgDir));
|
|
124
151
|
return {
|
|
125
152
|
name: "chant-external",
|
|
126
153
|
setup(b) {
|
|
127
154
|
b.onResolve({ filter: CHANT }, (args) => {
|
|
155
|
+
if (!keep.has(CHANT.exec(args.path)![1])) return undefined;
|
|
128
156
|
if (chantRuntimeTarget(args.path, pkgDir) === undefined) return undefined;
|
|
129
157
|
external?.add(args.path);
|
|
130
158
|
return { path: args.path, external: true };
|
|
@@ -4,11 +4,29 @@
|
|
|
4
4
|
* runs with, and plywood's resolve fallback for a repository with no chant.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
7
8
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
8
9
|
import { tmpdir } from "node:os";
|
|
9
10
|
import { delimiter, join } from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
10
12
|
import { afterAll, describe, expect, test } from "vitest";
|
|
11
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
bareResolveFallback,
|
|
15
|
+
bundledChant,
|
|
16
|
+
CHANT_RUN_FLOOR,
|
|
17
|
+
CHANT_SPECIFIER,
|
|
18
|
+
chantArgv,
|
|
19
|
+
chantCommand,
|
|
20
|
+
chantEnv,
|
|
21
|
+
chantResolveFallback,
|
|
22
|
+
fallbackImportArgs,
|
|
23
|
+
fallbackParent,
|
|
24
|
+
hasNodeModulesAbove,
|
|
25
|
+
installedChant,
|
|
26
|
+
isBareSpecifier,
|
|
27
|
+
lastJsonLine,
|
|
28
|
+
runChant,
|
|
29
|
+
} from "./chant-install";
|
|
12
30
|
|
|
13
31
|
const scratch = mkdtempSync(join(tmpdir(), "chant-install-"));
|
|
14
32
|
afterAll(() => rmSync(scratch, { recursive: true, force: true }));
|
|
@@ -110,3 +128,92 @@ describe("chantResolveFallback", () => {
|
|
|
110
128
|
expect(() => hook("@intentius/chant", { parentURL: from }, fail(missing))).toThrow("not found");
|
|
111
129
|
});
|
|
112
130
|
});
|
|
131
|
+
|
|
132
|
+
/** #4889: a file with no node_modules above it, outside every checkout and install. */
|
|
133
|
+
describe("the resolve fallback for any bare specifier (#4889)", () => {
|
|
134
|
+
const worktree = join(import.meta.dirname, "..", "..", "..");
|
|
135
|
+
const parent = pathToFileURL(join(worktree, "chant-resolve-fallback.js")).href;
|
|
136
|
+
const missing = Object.assign(new Error("not found"), { code: "ERR_MODULE_NOT_FOUND" });
|
|
137
|
+
const bare = join(scratch, "worktree");
|
|
138
|
+
mkdirSync(join(bare, "src"), { recursive: true });
|
|
139
|
+
const importer = pathToFileURL(join(bare, "src", "chant.config.ts")).href;
|
|
140
|
+
|
|
141
|
+
test("a bare specifier is a package name, nothing else", () => {
|
|
142
|
+
for (const s of ["semver", "@intentius/sql-yodeler", "@intentius/chant/op"]) expect(isBareSpecifier(s), s).toBe(true);
|
|
143
|
+
for (const s of ["./a.js", "../a.js", "/abs/a.js", "file:///a.js", "node:fs", "data:text/javascript,", "#internal"]) expect(isBareSpecifier(s), s).toBe(false);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("the scratch worktree has no node_modules above it, and this file does", () => {
|
|
147
|
+
expect(hasNodeModulesAbove(importer)).toBe(false);
|
|
148
|
+
expect(hasNodeModulesAbove(pathToFileURL(import.meta.filename).href)).toBe(true);
|
|
149
|
+
expect(hasNodeModulesAbove("node:fs")).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test("fallbackParent is a file beside the node_modules holding chant, or chant's own file in a checkout", () => {
|
|
153
|
+
expect(fallbackParent("file:///opt/yodel/node_modules/@intentius/chant/dist/chant-install.js")).toBe("file:///opt/yodel/chant-resolve-fallback.js");
|
|
154
|
+
expect(fallbackParent("file:///src/chant/packages/core/src/chant-install.ts")).toBe("file:///src/chant/packages/core/src/chant-install.ts");
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test("retries a bare import of a file with no install from the product's, and leaves the rest as Node reports them", () => {
|
|
158
|
+
const hook = bareResolveFallback(parent);
|
|
159
|
+
const seen: unknown[] = [];
|
|
160
|
+
const next = (specifier: string, context?: Record<string, unknown>) => {
|
|
161
|
+
seen.push(context?.parentURL);
|
|
162
|
+
if (context?.parentURL !== parent) throw missing;
|
|
163
|
+
return { url: `file:///product/node_modules/${specifier}/index.js` };
|
|
164
|
+
};
|
|
165
|
+
expect(hook("@intentius/sql-yodeler", { parentURL: importer }, next).url).toBe("file:///product/node_modules/@intentius/sql-yodeler/index.js");
|
|
166
|
+
expect(seen).toEqual([importer, parent]);
|
|
167
|
+
const fail = (e: Error) => () => {
|
|
168
|
+
throw e;
|
|
169
|
+
};
|
|
170
|
+
expect(() => hook("./local.js", { parentURL: importer }, fail(missing))).toThrow("not found");
|
|
171
|
+
expect(() => hook("left-pad", { parentURL: pathToFileURL(import.meta.filename).href }, fail(missing))).toThrow("not found");
|
|
172
|
+
expect(() => hook("left-pad", { parentURL: importer }, fail(new Error("syntax")))).toThrow("syntax");
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test("fallbackImportArgs lets a child import a package from the product's install", () => {
|
|
176
|
+
const file = join(bare, "src", "uses-semver.mjs");
|
|
177
|
+
writeFileSync(file, 'import semver from "semver";\nconsole.log(semver.valid("1.2.3"));\n');
|
|
178
|
+
const without = spawnSync(process.execPath, [file], { encoding: "utf8" });
|
|
179
|
+
expect(without.status).not.toBe(0);
|
|
180
|
+
expect(without.stderr).toMatch(/Cannot find package 'semver'/);
|
|
181
|
+
const withIt = spawnSync(process.execPath, [...fallbackImportArgs(parent), file], { encoding: "utf8" });
|
|
182
|
+
expect(withIt.stderr).toBe("");
|
|
183
|
+
expect(withIt.stdout.trim()).toBe("1.2.3");
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe("runChant (#4889)", () => {
|
|
188
|
+
test("lastJsonLine is the last line that is a JSON object, or a pretty-printed document", () => {
|
|
189
|
+
expect(lastJsonLine('fold: 1 file folded\n{"a":1}\n{not json\n')).toEqual({ a: 1 });
|
|
190
|
+
expect(lastJsonLine('{"a":1}\nlog\n{"b":2}\n')).toEqual({ b: 2 });
|
|
191
|
+
expect(lastJsonLine('{\n "a": 2\n}\n')).toEqual({ a: 2 });
|
|
192
|
+
expect(lastJsonLine("no json here")).toBeUndefined();
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test("runs the install's bin with this node, the fallback's --import and chant's bin first on PATH, and reads its --json document", async () => {
|
|
196
|
+
const root = pkg(join(scratch, "run", "node_modules", "@intentius", "chant"), { name: "@intentius/chant", version: "9.9.9", bin: { chant: "./bin/chant" } }, "bin/chant");
|
|
197
|
+
writeFileSync(
|
|
198
|
+
join(root, "bin", "chant"),
|
|
199
|
+
'console.error("chant: working");\nconsole.log("a log line");\nconsole.log(JSON.stringify({ args: process.argv.slice(2), imports: process.execArgv.filter((a) => a.startsWith("data:")).length, path: process.env.PATH.split(require("path").delimiter)[0], color: process.env.NO_COLOR ?? null }));\nprocess.exit(3);\n',
|
|
200
|
+
);
|
|
201
|
+
const install = installedChant([join(scratch, "run")])!;
|
|
202
|
+
const chunks: string[] = [];
|
|
203
|
+
const ran = await runChant(["build", "--json"], { install, cwd: scratch, resolveFallback: true, noColor: true, onStderr: (t) => chunks.push(t) });
|
|
204
|
+
expect(ran.code).toBe(3);
|
|
205
|
+
expect(ran.stdout).toMatch(/^a log line\n/);
|
|
206
|
+
expect(ran.json).toEqual({ args: ["build", "--json"], imports: 1, path: install.binDir, color: "1" });
|
|
207
|
+
expect(chunks.join("")).toBe("chant: working\n");
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("a named chant runs as it is, and a child that cannot start rejects", async () => {
|
|
211
|
+
const ran = await runChant(["-e", "console.log(JSON.stringify({ ok: true }))"], { chant: process.execPath });
|
|
212
|
+
expect(ran).toMatchObject({ code: 0, json: { ok: true } });
|
|
213
|
+
await expect(runChant([], { chant: join(scratch, "no-such-chant") })).rejects.toThrow(/ENOENT/);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test("CHANT_RUN_FLOOR is the release that shipped it", () => {
|
|
217
|
+
expect(CHANT_RUN_FLOOR).toBe("0.124.88");
|
|
218
|
+
});
|
|
219
|
+
});
|