@theholocron/cli 5.0.0-alpha.107 → 5.0.0-alpha.109

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 CHANGED
@@ -296,6 +296,23 @@ job execute the same thing — at a turbo root both are
296
296
  `turbo run test -- --coverage` (the registry's org-default flags flow through
297
297
  turbo's `--`).
298
298
 
299
+ ### `holocron deploy-on-release`
300
+
301
+ ```bash
302
+ holocron deploy-on-release [--channel <alpha|main>] [--from <commit>] [--to <commit>] [--dry-run]
303
+ ```
304
+
305
+ Deploys every workspace package whose own `holocron.config` declares
306
+ `{ name: "delivery.deploy", with: { on: "release" } }` (holocron#930), when the
307
+ release (`--channel`: its prerelease identifier, or `main`/empty for a stable
308
+ release) is on the task's `channel` (default `main`, the stable release) and changes the package or one of its
309
+ `workspace:*` dependencies between `--from` (the previous release's commit,
310
+ omitted when there is none) and `--to` (default `HEAD`). It waits for npm to
311
+ serve the release's new dependency versions, then runs `pnpm --filter <pkg>
312
+ delivery.deploy`. A package that doesn't apply is skipped; a failed deploy
313
+ exits non-zero. The shared `delivery.publish` workflow runs it as its own
314
+ `deploy` job after the release job (opt in with `deploy-on-release: true`).
315
+
299
316
  ### `holocron ci`
300
317
 
301
318
  ```bash
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
4
  import path, { basename, dirname, join, relative, resolve, sep } from "node:path";
5
5
  import { checkbox, input, select } from "@inquirer/prompts";
6
- import { KNOWN_WORKFLOWS, createAstromech, extractPreviewConfig, readWorkspacePackages, reusableTemplates } from "@theholocron/astromech";
6
+ import { KNOWN_WORKFLOWS, createAstromech, deployOnRelease, extractPreviewConfig, readWorkspacePackages, reusableTemplates } from "@theholocron/astromech";
7
7
  import { loadTasksConfig } from "@theholocron/astromech/config";
8
8
  import yargs from "yargs";
9
9
  import { hideBin } from "yargs/helpers";
@@ -1225,6 +1225,7 @@ const COMMAND_CONTEXTS = {
1225
1225
  "lint commit-msg": "global",
1226
1226
  run: "repo-aware",
1227
1227
  ci: "repo-aware",
1228
+ "deploy-on-release": "repo-aware",
1228
1229
  "config show": "repo-aware",
1229
1230
  "sync-readme": "repo-aware",
1230
1231
  doctor: "workspace",
@@ -8845,6 +8846,25 @@ try {
8845
8846
  scope: argv.all ? "all" : "required",
8846
8847
  ...argv.filter ? { filter: argv.filter } : {}
8847
8848
  }).status === "fail") process.exitCode = 1;
8849
+ }).command("deploy-on-release", "Deploy every workspace package whose delivery.deploy task is `on: release` — run by the delivery.publish workflow's deploy job", (y) => y.option("channel", {
8850
+ type: "string",
8851
+ default: "",
8852
+ describe: "The release's channel: its prerelease identifier (`alpha`); empty or `main` for a stable release."
8853
+ }).option("from", {
8854
+ type: "string",
8855
+ describe: "The previous release's commit, to diff against. Omit when there is none."
8856
+ }).option("to", {
8857
+ type: "string",
8858
+ describe: "The release commit. Default HEAD."
8859
+ }), async (argv) => {
8860
+ if ((await deployOnRelease({
8861
+ cwd: argv.cwd,
8862
+ channel: argv.channel,
8863
+ ...argv.from ? { from: argv.from } : {},
8864
+ ...argv.to ? { to: argv.to } : {},
8865
+ dryRun: argv.dryRun,
8866
+ print: (line) => console.log(line)
8867
+ })).status === "fail") process.exitCode = 1;
8848
8868
  }).command("lint", "Lint content locally against the org's shared rules", (y) => y.command("commit-msg <file>", "Lint a commit message file — matches `commitlint --edit`'s own contract, for use from .husky/commit-msg", (yy) => yy.positional("file", {
8849
8869
  type: "string",
8850
8870
  demandOption: true,