@reelout/cli 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @reelout/cli
2
+
3
+ Command-line interface for [ReelOut](https://github.com/reelout/reelout), a
4
+ plugin-driven release automation toolkit for monorepos. This package provides
5
+ the Commander program factory used by the `reelout` executable.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install @reelout/cli
11
+ ```
12
+
13
+ This ESM-only package requires Node.js `>=24.15`.
14
+
15
+ ## API
16
+
17
+ - `createProgram(options)` — create a Commander program configured to run the release workflow.
18
+ - `createProcessAbortSignal()` — create an `AbortSignal` that fires on `SIGINT` or `SIGTERM`.
19
+
20
+ ```ts
21
+ import { createProgram, createProcessAbortSignal } from '@reelout/cli'
22
+
23
+ const program = await createProgram({
24
+ name: 'reelout',
25
+ version: '1.0.0',
26
+ description:
27
+ 'Plugin-driven release automation for JavaScript and TypeScript monorepos.',
28
+ cwd: process.cwd(),
29
+ env: process.env,
30
+ stdout: process.stdout,
31
+ stderr: process.stderr,
32
+ signal: createProcessAbortSignal(),
33
+ })
34
+
35
+ await program.parseAsync(process.argv)
36
+ ```
37
+
38
+ ## Documentation
39
+
40
+ - [CLI and configuration guides](https://github.com/reelout/reelout/tree/main/docs)
41
+ - [API reference](https://reelout.overview.vercel.app/)
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { resolveConfig } from "@reelout/config";
2
2
  import { createContext } from "@reelout/context";
3
3
  import { compact, createPlugin, executeReleaseWorkflow, isTruthyString } from "@reelout/core";
4
4
  import { Command, Option } from "commander";
5
- //#region src/createProcessAbortSignal.ts
5
+ // src/createProcessAbortSignal.ts
6
6
  /**
7
7
  * Create a process abort signal tied to termination events.
8
8
  *
@@ -27,8 +27,7 @@ function createProcessAbortSignal() {
27
27
  Object.defineProperty(signal, Symbol.dispose, { value: dispose });
28
28
  return signal;
29
29
  }
30
- //#endregion
31
- //#region src/createProgram.ts
30
+ // src/createProgram.ts
32
31
  /**
33
32
  * Create and configure a command-line program instance.
34
33
  *
@@ -44,12 +43,12 @@ async function createProgram(options) {
44
43
  const { plugins, ...config } = await resolveConfig(cwd, name);
45
44
  const program = new Command(name);
46
45
  if (description) program.description(description);
47
- program.addOption(new Option("--type <string>", "Specify the release type, bypassing automatic commit analysis.").choices([
46
+ program.addOption(new Option("--type <string>", "Choose a release type instead of deriving it from commits; use `auto` to analyze commits.").choices([
48
47
  "auto",
49
48
  "major",
50
49
  "minor",
51
50
  "patch"
52
- ])).option("--qualifier <boolean or string>", "Set or override the version qualifier (e.g., `alpha`, `beta`); pass `false` to disable.", (value) => value === "true" ? true : value === "false" ? false : value).option("--channel <boolean or string>", "Set or override the release channel (e.g., `stable`, `canary`); pass `false` to disable.", (value) => value === "true" ? true : value === "false" ? false : value).option("--allow-empty", "Proceed with the release workflow even if no qualifying changes are detected.").option("--dry-run", "Simulate the release workflow without modifying files or publishing artifacts.").option("--debug", "Enable verbose logging for detailed troubleshooting.", isTruthyString(env.RUNNER_DEBUG) || isTruthyString(env.ACTIONS_STEP_DEBUG)).action(async (flags) => {
51
+ ])).option("--qualifier <boolean or string>", "Set the SemVer prerelease identifier (for example, `beta`); use `false` to disable it or `true` to follow branch rules.", (value) => value === "true" ? true : value === "false" ? false : value).option("--channel <boolean or string>", "Set the npm dist-tag (for example, `beta`); use `false` to disable it or `true` to follow branch rules.", (value) => value === "true" ? true : value === "false" ? false : value).option("--allow-empty", "Run the release workflow even when no releasable changes are detected.").option("--dry-run", "Preview the release without writing files, creating commits or tags, or publishing packages or releases.").option("--debug", "Enable verbose logging for troubleshooting.", isTruthyString(env.RUNNER_DEBUG) || isTruthyString(env.ACTIONS_STEP_DEBUG)).action(async (flags) => {
53
52
  await executeReleaseWorkflow(await createContext({
54
53
  ...options,
55
54
  ...config,
@@ -60,7 +59,6 @@ async function createProgram(options) {
60
59
  program.helpOption("-h, --help", "Display command usage and options.");
61
60
  return program;
62
61
  }
63
- //#endregion
64
62
  export { createProcessAbortSignal, createProgram };
65
63
 
66
64
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/createProcessAbortSignal.ts","../src/createProgram.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nexport interface ProcessAbortSignal extends AbortSignal, Disposable {\n readonly controller: AbortController\n}\n\n/**\n * Create a process abort signal tied to termination events.\n *\n * Registers event listeners for `SIGINT` and `SIGTERM` on the active process\n * to automatically trigger an abort action upon receipt. Attaches a custom\n * disposal method to clean up listeners and enforce abort state on cleanup.\n *\n * @returns A newly configured process abort signal ready for use\n */\nexport function createProcessAbortSignal(): ProcessAbortSignal {\n const controller = new AbortController()\n const handler = () => controller.abort()\n\n process.on('SIGINT', handler)\n process.on('SIGTERM', handler)\n\n const dispose = () => {\n process.off('SIGINT', handler)\n process.off('SIGTERM', handler)\n\n if (!controller.signal.aborted) {\n controller.abort()\n }\n }\n\n const signal = controller.signal as ProcessAbortSignal\n\n Object.defineProperty(signal, 'controller', { value: controller })\n\n Object.defineProperty(signal, Symbol.dispose, { value: dispose })\n\n return signal\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { resolveConfig } from '@reelout/config'\nimport { createContext } from '@reelout/context'\nimport {\n compact,\n createPlugin,\n executeReleaseWorkflow,\n isTruthyString,\n type ReleaseTypeHint,\n} from '@reelout/core'\nimport { Command, Option } from 'commander'\nimport type { ConsolaInstance } from 'consola/core'\n\nexport interface CreateProgramOptions {\n name: string\n version?: string | undefined\n description?: string | undefined\n cwd: string\n env: Readonly<NodeJS.ProcessEnv>\n signal?: AbortSignal | undefined\n stdout: NodeJS.WritableStream\n stderr: NodeJS.WritableStream\n logger?: ConsolaInstance | undefined\n}\n\ninterface Flags {\n type?: ReleaseTypeHint | undefined\n qualifier?: boolean | string | undefined\n channel?: boolean | string | undefined\n allowEmpty?: boolean | undefined\n dryRun?: boolean | undefined\n debug?: boolean | undefined\n}\n\n/**\n * Create and configure a command-line program instance.\n *\n * Resolves project configuration settings, registers command-line options,\n * and sets up execution handlers alongside version and help flags.\n *\n * @param options Options for configuring the command-line execution context\n * @returns A promise that resolves to the configured `Command` instance\n */\nexport async function createProgram(\n options: CreateProgramOptions\n): Promise<Command> {\n const { name, version, description } = options\n\n const { cwd, env } = options\n\n const { plugins, ...config } = await resolveConfig(cwd, name)\n\n const program = new Command(name)\n\n if (description) {\n program.description(description)\n }\n\n program\n .addOption(\n new Option(\n '--type <string>',\n 'Specify the release type, bypassing automatic commit analysis.'\n ).choices(['auto', 'major', 'minor', 'patch'] satisfies ReleaseTypeHint[])\n )\n .option(\n '--qualifier <boolean or string>',\n 'Set or override the version qualifier (e.g., `alpha`, `beta`); pass `false` to disable.',\n (value) => (value === 'true' ? true : value === 'false' ? false : value)\n )\n .option(\n '--channel <boolean or string>',\n 'Set or override the release channel (e.g., `stable`, `canary`); pass `false` to disable.',\n (value) => (value === 'true' ? true : value === 'false' ? false : value)\n )\n .option(\n '--allow-empty',\n 'Proceed with the release workflow even if no qualifying changes are detected.'\n )\n .option(\n '--dry-run',\n 'Simulate the release workflow without modifying files or publishing artifacts.'\n )\n .option(\n '--debug',\n 'Enable verbose logging for detailed troubleshooting.',\n isTruthyString(env.RUNNER_DEBUG) || isTruthyString(env.ACTIONS_STEP_DEBUG)\n )\n .action(async (flags: Flags) => {\n await executeReleaseWorkflow(\n await createContext({ ...options, ...config, ...flags }),\n compact(await Promise.all(plugins.map(createPlugin)))\n )\n })\n\n if (version) {\n program.version(version, '-v, --version', 'Display the version number.')\n }\n\n program.helpOption('-h, --help', 'Display command usage and options.')\n\n return program\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,2BAA+C;CAC7D,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,gBAAgB,WAAW,MAAM;CAEvC,QAAQ,GA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B;CAGzE,QAAQ,WAAW,cAAc,oCAAoC;CAErE,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/createProcessAbortSignal.ts","../src/createProgram.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nexport interface ProcessAbortSignal extends AbortSignal, Disposable {\n readonly controller: AbortController\n}\n\n/**\n * Create a process abort signal tied to termination events.\n *\n * Registers event listeners for `SIGINT` and `SIGTERM` on the active process\n * to automatically trigger an abort action upon receipt. Attaches a custom\n * disposal method to clean up listeners and enforce abort state on cleanup.\n *\n * @returns A newly configured process abort signal ready for use\n */\nexport function createProcessAbortSignal(): ProcessAbortSignal {\n const controller = new AbortController()\n const handler = () => controller.abort()\n\n process.on('SIGINT', handler)\n process.on('SIGTERM', handler)\n\n const dispose = () => {\n process.off('SIGINT', handler)\n process.off('SIGTERM', handler)\n\n if (!controller.signal.aborted) {\n controller.abort()\n }\n }\n\n const signal = controller.signal as ProcessAbortSignal\n\n Object.defineProperty(signal, 'controller', { value: controller })\n\n Object.defineProperty(signal, Symbol.dispose, { value: dispose })\n\n return signal\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { resolveConfig } from '@reelout/config'\nimport { createContext } from '@reelout/context'\nimport {\n compact,\n createPlugin,\n executeReleaseWorkflow,\n isTruthyString,\n type ReleaseTypeHint,\n} from '@reelout/core'\nimport { Command, Option } from 'commander'\nimport type { ConsolaInstance } from 'consola/core'\n\nexport interface CreateProgramOptions {\n name: string\n version?: string | undefined\n description?: string | undefined\n cwd: string\n env: Readonly<NodeJS.ProcessEnv>\n signal?: AbortSignal | undefined\n stdout: NodeJS.WritableStream\n stderr: NodeJS.WritableStream\n logger?: ConsolaInstance | undefined\n}\n\ninterface Flags {\n type?: ReleaseTypeHint | undefined\n qualifier?: boolean | string | undefined\n channel?: boolean | string | undefined\n allowEmpty?: boolean | undefined\n dryRun?: boolean | undefined\n debug?: boolean | undefined\n}\n\n/**\n * Create and configure a command-line program instance.\n *\n * Resolves project configuration settings, registers command-line options,\n * and sets up execution handlers alongside version and help flags.\n *\n * @param options Options for configuring the command-line execution context\n * @returns A promise that resolves to the configured `Command` instance\n */\nexport async function createProgram(\n options: CreateProgramOptions\n): Promise<Command> {\n const { name, version, description } = options\n\n const { cwd, env } = options\n\n const { plugins, ...config } = await resolveConfig(cwd, name)\n\n const program = new Command(name)\n\n if (description) {\n program.description(description)\n }\n\n program\n .addOption(\n new Option(\n '--type <string>',\n 'Choose a release type instead of deriving it from commits; use `auto` to analyze commits.'\n ).choices(['auto', 'major', 'minor', 'patch'] satisfies ReleaseTypeHint[])\n )\n .option(\n '--qualifier <boolean or string>',\n 'Set the SemVer prerelease identifier (for example, `beta`); use `false` to disable it or `true` to follow branch rules.',\n (value) => (value === 'true' ? true : value === 'false' ? false : value)\n )\n .option(\n '--channel <boolean or string>',\n 'Set the npm dist-tag (for example, `beta`); use `false` to disable it or `true` to follow branch rules.',\n (value) => (value === 'true' ? true : value === 'false' ? false : value)\n )\n .option(\n '--allow-empty',\n 'Run the release workflow even when no releasable changes are detected.'\n )\n .option(\n '--dry-run',\n 'Preview the release without writing files, creating commits or tags, or publishing packages or releases.'\n )\n .option(\n '--debug',\n 'Enable verbose logging for troubleshooting.',\n isTruthyString(env.RUNNER_DEBUG) || isTruthyString(env.ACTIONS_STEP_DEBUG)\n )\n .action(async (flags: Flags) => {\n await executeReleaseWorkflow(\n await createContext({ ...options, ...config, ...flags }),\n compact(await Promise.all(plugins.map(createPlugin)))\n )\n })\n\n if (version) {\n program.version(version, '-v, --version', 'Display the version number.')\n }\n\n program.helpOption('-h, --help', 'Display command usage and options.')\n\n return program\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,2BAA+C;CAC7D,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,gBAAgB,WAAW,MAAM;CAEvC,QAAQ,GAAG,UAAU,OAAO;CAC5B,QAAQ,GAAG,WAAW,OAAO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;AACT"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@reelout/cli",
3
- "version": "0.4.0",
4
- "description": "CLI for running release workflows.",
3
+ "version": "0.4.2",
4
+ "description": "Command-line interface for configuring and running ReelOut release workflows.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/aicest/reelout.git",
7
+ "url": "git+https://github.com/reelout/reelout.git",
8
8
  "directory": "packages/cli"
9
9
  },
10
10
  "license": "MIT",
@@ -32,9 +32,9 @@
32
32
  "./src"
33
33
  ],
34
34
  "dependencies": {
35
- "@reelout/context": "^0.4.0",
36
- "@reelout/core": "^0.4.0",
37
- "commander": "^15.0.0",
35
+ "@reelout/context": "^0.4.2",
36
+ "@reelout/core": "^0.5.1",
37
+ "commander": "^15.1.0",
38
38
  "consola": "^3.4.2"
39
39
  },
40
40
  "engines": {
@@ -62,30 +62,30 @@ export async function createProgram(
62
62
  .addOption(
63
63
  new Option(
64
64
  '--type <string>',
65
- 'Specify the release type, bypassing automatic commit analysis.'
65
+ 'Choose a release type instead of deriving it from commits; use `auto` to analyze commits.'
66
66
  ).choices(['auto', 'major', 'minor', 'patch'] satisfies ReleaseTypeHint[])
67
67
  )
68
68
  .option(
69
69
  '--qualifier <boolean or string>',
70
- 'Set or override the version qualifier (e.g., `alpha`, `beta`); pass `false` to disable.',
70
+ 'Set the SemVer prerelease identifier (for example, `beta`); use `false` to disable it or `true` to follow branch rules.',
71
71
  (value) => (value === 'true' ? true : value === 'false' ? false : value)
72
72
  )
73
73
  .option(
74
74
  '--channel <boolean or string>',
75
- 'Set or override the release channel (e.g., `stable`, `canary`); pass `false` to disable.',
75
+ 'Set the npm dist-tag (for example, `beta`); use `false` to disable it or `true` to follow branch rules.',
76
76
  (value) => (value === 'true' ? true : value === 'false' ? false : value)
77
77
  )
78
78
  .option(
79
79
  '--allow-empty',
80
- 'Proceed with the release workflow even if no qualifying changes are detected.'
80
+ 'Run the release workflow even when no releasable changes are detected.'
81
81
  )
82
82
  .option(
83
83
  '--dry-run',
84
- 'Simulate the release workflow without modifying files or publishing artifacts.'
84
+ 'Preview the release without writing files, creating commits or tags, or publishing packages or releases.'
85
85
  )
86
86
  .option(
87
87
  '--debug',
88
- 'Enable verbose logging for detailed troubleshooting.',
88
+ 'Enable verbose logging for troubleshooting.',
89
89
  isTruthyString(env.RUNNER_DEBUG) || isTruthyString(env.ACTIONS_STEP_DEBUG)
90
90
  )
91
91
  .action(async (flags: Flags) => {