@rrlab/cli 1.0.1-git-e008b4d.0 → 1.1.0

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.
@@ -1,7 +1,7 @@
1
1
  // @generated by @usage-spec/commander from Commander.js metadata
2
2
  name rr
3
3
  bin rr
4
- version "1.0.1-git-e008b4d.0"
4
+ version "1.1.0"
5
5
  usage "<command...> [options...]"
6
6
  flag --usage help="print KDL spec for this CLI (https://kdl.dev)"
7
7
  cmd completion help="print shell completion script (usage)" {
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { u as Plugin } from "./types-6gZWuLJf.mjs";
1
+ import { u as Plugin } from "./types-snfbujDH.mjs";
2
2
 
3
3
  //#region src/types/config.d.ts
4
4
  type UserConfig = {
package/dist/plugin.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as StaticChecker, D as ReleaseService, E as TypeChecker, O as ReleaseServiceOptions, S as RunReport, T as TypeCheckOptions, _ as Doctor, a as InstallFlags, b as LintOptions, c as PLUGIN_KINDS, d as PluginCapabilities, f as PluginContext, g as UninstallResult, h as UninstallFlags, i as InstallContext, l as Packer, m as UninstallContext, n as ClackPromptsSelectOption, o as InstallResult, p as PluginKind, r as FileOp, s as JsonEdit, t as ClackPrompts, u as Plugin, v as FormatOptions, w as StaticCheckerOptions, x as Linter, y as Formatter } from "./types-6gZWuLJf.mjs";
1
+ import { C as StaticChecker, D as ReleaseService, E as TypeChecker, O as ReleaseServiceOptions, S as RunReport, T as TypeCheckOptions, _ as Doctor, a as InstallFlags, b as LintOptions, c as PLUGIN_KINDS, d as PluginCapabilities, f as PluginContext, g as UninstallResult, h as UninstallFlags, i as InstallContext, l as Packer, m as UninstallContext, n as ClackPromptsSelectOption, o as InstallResult, p as PluginKind, r as FileOp, s as JsonEdit, t as ClackPrompts, u as Plugin, v as FormatOptions, w as StaticCheckerOptions, x as Linter, y as Formatter } from "./types-snfbujDH.mjs";
2
2
  import { ShellService } from "@vlandoss/clibuddy";
3
3
 
4
4
  //#region src/plugin/decide-scaffold.d.ts
package/dist/run.mjs CHANGED
@@ -164,29 +164,19 @@ function commandTool(command, provider) {
164
164
  function pkgName(appPkg) {
165
165
  return appPkg.packageJson.name ?? basename(appPkg.dirPath);
166
166
  }
167
- /**
168
- * The one canonical row label for a single-target run: `<command> (<tool>) · <package>`.
169
- * Every command/subcommand that acts on one target (lint, format, jsc, pack,
170
- * single-app tsc, a `doctor` subcommand) builds its row through here so they
171
- * all read identically.
172
- */
167
+ /** The canonical single-target row label, `<command> (<tool>) · <package>`, so every command reads alike. */
173
168
  function targetLabel(command, provider, appPkg) {
174
169
  return `${commandTool(command, provider)} ${palette.dim(`· ${pkgName(appPkg)}`)}`;
175
170
  }
176
171
  /**
177
- * The one canonical section title for a fan-out run: `<command> (<tool>) · <n> <unit>`
178
- * (e.g. `tsc (oxlint) · 8 packages`). The tool is omitted when the fan-out
179
- * spans several tools (`rr doctor` → `doctor · 3 tools`); the rows then carry
180
- * the per-unit name.
172
+ * The canonical fan-out section title, `<command> (<tool>) · <n> <unit>`. The
173
+ * tool is omitted when the fan-out spans several tools (`rr doctor` → `doctor ·
174
+ * 3 tools`), since the rows then carry the per-tool name.
181
175
  */
182
176
  function fanoutTitle(command, provider, count, unit) {
183
177
  return `${provider ? commandTool(command, provider) : command} · ${count} ${unit}`;
184
178
  }
185
- /**
186
- * Bridges a check-family verb (which returns a `RunReport`) to a board row.
187
- * The row's spinner reflects the in-flight run; the captured `output` becomes
188
- * the detail the board flushes grouped under the label.
189
- */
179
+ /** Bridges a check-family verb (returns a `RunReport`) to a board row, its `output` becoming the flushed detail. */
190
180
  function reportTask(label, run) {
191
181
  return {
192
182
  label,
@@ -283,17 +273,11 @@ ${runRunColor(`
283
273
  //#endregion
284
274
  //#region src/program/commands/check.ts
285
275
  /**
286
- * `rr check` is the umbrella that runs the JS check (lint+format) and the
287
- * TS type check together. Both subcommands are already wired into
288
- * commander as siblings (`rr jsc`, `rr tsc`), so we reuse the program's
289
- * command tree as the action registry instead of duplicating it: look the
290
- * sibling up by name and invoke its action via `parseAsync([])`, which
291
- * applies its declared option defaults exactly as if the user had typed
292
- * `rr jsc` directly.
293
- *
294
- * Commander binds the running command as `this` inside an action (see
295
- * `command.js` — `fn.apply(this, actionArgs)`). `this.parent` gives us the
296
- * parent program without any late-binding ceremony.
276
+ * `rr check` runs `jsc` then `tsc`. Rather than keep a parallel action
277
+ * registry, it reuses commander's command tree: it finds each sibling on
278
+ * `this.parent` and runs it via `parseAsync([])`, which applies the sibling's
279
+ * own option defaults. (`this` is the running command inside a non-arrow
280
+ * action see cli/CLAUDE.md.)
297
281
  */
298
282
  function createCheckCommand(ctx) {
299
283
  return createCommand("check").summary(`run static checks${checkAnnotation(ctx)}`).description("Runs `rr jsc` then `rr tsc` in-process, each as its own section. Aggregates their exit codes — non-zero when either subcommand fails.").action(async function checkAction() {
@@ -336,12 +320,9 @@ function findCommand(program, name) {
336
320
  return program.commands.find((c) => c.name() === name || c.aliases().includes(name));
337
321
  }
338
322
  /**
339
- * Mirrors the provider resolution of `jsc` + `tsc` and flattens the
340
- * underlying tool labels — e.g. biome (composed lint+format) + oxc (tsc)
341
- * renders as `(biome, oxlint)` rather than `(biome + biome, oxlint)`. When
342
- * neither sibling has a provider, falls back to the standard `(not
343
- * configured)` annotation so the help reads consistently with other
344
- * commands.
323
+ * Flattens the underlying tool labels of `jsc` + `tsc` for the help summary —
324
+ * e.g. `(biome, oxlint)`, deduped, not `(biome + biome, oxlint)`. Falls back to
325
+ * the standard `(not configured)` when neither sibling has a provider.
345
326
  */
346
327
  function checkAnnotation(ctx) {
347
328
  const directJsc = ctx.registry.get("jsc");
@@ -475,15 +456,11 @@ function createFormatCommand(ctx) {
475
456
  //#endregion
476
457
  //#region src/program/composed-jsc.ts
477
458
  /**
478
- * Synthesises a `StaticChecker & Doctor` (the `jsc` capability) by composing
479
- * a separately-registered linter and formatter. Used when the user's plugin
480
- * set provides `lint` and `format` independently (e.g. oxc, or eslint +
481
- * prettier) but no single plugin claims `jsc`.
482
- *
483
- * The check runs lint then format sequentially — interleaved stdout from a
484
- * parallel run is hard to read for the user — and merges their reports into one
485
- * so the board renders the pair as a single row. `fixStaged` is dropped because
486
- * the underlying tools don't have a uniform staged-aware mode.
459
+ * Synthesises the `jsc` capability (`StaticChecker & Doctor`) by composing a
460
+ * separately-registered linter and formatter used when the plugin set
461
+ * provides `lint` and `format` independently (e.g. oxc) but no plugin claims
462
+ * `jsc`. Runs lint then format sequentially (parallel stdout interleaves badly)
463
+ * and merges their reports into one board row.
487
464
  */
488
465
  function composedJscProvider(linter, formatter) {
489
466
  return {
@@ -28,13 +28,11 @@ declare class ReleaseService {
28
28
  //#endregion
29
29
  //#region src/types/tool.d.ts
30
30
  /**
31
- * The outcome of running a check-family tool (lint / format / static check /
32
- * type check) captured rather than streamed. `ok` is the tool's own verdict
33
- * its exit code, never a guess parsed from output — and `output` is the
34
- * combined captured stdout+stderr (color preserved), flushed verbatim grouped
35
- * under the package label. We deliberately do NOT parse tool summaries for
36
- * warning/error counts: the formats are unstable and not uniform across tools
37
- * (tsc and oxfmt have no machine output at all). See decisions/013.
31
+ * The outcome of a check-family tool (lint / format / static check / type
32
+ * check) captured rather than streamed. `ok` is the tool's exit code never a
33
+ * guess parsed from output, since tool summaries are unstable and not uniform
34
+ * (tsc and oxfmt emit none) — and `output` is the combined stdout+stderr (color
35
+ * preserved), flushed verbatim under the package label. See decisions/013.
38
36
  */
39
37
  type RunReport = {
40
38
  ok: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rrlab/cli",
3
- "version": "1.0.1-git-e008b4d.0",
3
+ "version": "1.1.0",
4
4
  "description": "The CLI toolbox to fullstack common scripts in Variable Land",
5
5
  "homepage": "https://github.com/variableland/dx/tree/main/run-run/cli#readme",
6
6
  "bugs": {
@@ -56,7 +56,7 @@
56
56
  "memoize": "10.2.0",
57
57
  "nypm": "0.6.0",
58
58
  "rimraf": "6.1.3",
59
- "@vlandoss/clibuddy": "0.6.2-git-e008b4d.0",
59
+ "@vlandoss/clibuddy": "0.7.0",
60
60
  "@vlandoss/loggy": "0.2.1"
61
61
  },
62
62
  "devDependencies": {
@@ -17,32 +17,22 @@ function pkgName(appPkg: Pkg): string {
17
17
  return appPkg.packageJson.name ?? basename(appPkg.dirPath);
18
18
  }
19
19
 
20
- /**
21
- * The one canonical row label for a single-target run: `<command> (<tool>) · <package>`.
22
- * Every command/subcommand that acts on one target (lint, format, jsc, pack,
23
- * single-app tsc, a `doctor` subcommand) builds its row through here so they
24
- * all read identically.
25
- */
20
+ /** The canonical single-target row label, `<command> (<tool>) · <package>`, so every command reads alike. */
26
21
  export function targetLabel(command: string, provider: Provider, appPkg: Pkg): string {
27
22
  return `${commandTool(command, provider)} ${palette.dim(`· ${pkgName(appPkg)}`)}`;
28
23
  }
29
24
 
30
25
  /**
31
- * The one canonical section title for a fan-out run: `<command> (<tool>) · <n> <unit>`
32
- * (e.g. `tsc (oxlint) · 8 packages`). The tool is omitted when the fan-out
33
- * spans several tools (`rr doctor` → `doctor · 3 tools`); the rows then carry
34
- * the per-unit name.
26
+ * The canonical fan-out section title, `<command> (<tool>) · <n> <unit>`. The
27
+ * tool is omitted when the fan-out spans several tools (`rr doctor` → `doctor ·
28
+ * 3 tools`), since the rows then carry the per-tool name.
35
29
  */
36
30
  export function fanoutTitle(command: string, provider: Provider | undefined, count: number, unit: string): string {
37
31
  const head = provider ? commandTool(command, provider) : command;
38
32
  return `${head} · ${count} ${unit}`;
39
33
  }
40
34
 
41
- /**
42
- * Bridges a check-family verb (which returns a `RunReport`) to a board row.
43
- * The row's spinner reflects the in-flight run; the captured `output` becomes
44
- * the detail the board flushes grouped under the label.
45
- */
35
+ /** Bridges a check-family verb (returns a `RunReport`) to a board row, its `output` becoming the flushed detail. */
46
36
  export function reportTask(label: string, run: () => Promise<RunReport>): BoardTask {
47
37
  return {
48
38
  label,
@@ -53,11 +43,8 @@ export function reportTask(label: string, run: () => Promise<RunReport>): BoardT
53
43
  };
54
44
  }
55
45
 
56
- // `rr check` runs several single-task sections (jsc, tsc) back to back. On its
57
- // own each would render compactly, but the frame is what visually divides the
58
- // sections — so while check is dispatching, force every board to stay framed.
59
- // While active, the collector also gathers each section's result in run order
60
- // so `check` can print one overall verdict.
46
+ // While `rr check` is dispatching, boards stay framed (to divide the sections)
47
+ // and their results land in this collector so `check` can print one verdict.
61
48
  let collector: BoardResult[] | null = null;
62
49
 
63
50
  export async function runCheckSections(run: () => Promise<void>): Promise<BoardResult[]> {
@@ -6,17 +6,11 @@ import type { Context } from "#src/services/ctx.ts";
6
6
  import { logger } from "#src/services/logger.ts";
7
7
 
8
8
  /**
9
- * `rr check` is the umbrella that runs the JS check (lint+format) and the
10
- * TS type check together. Both subcommands are already wired into
11
- * commander as siblings (`rr jsc`, `rr tsc`), so we reuse the program's
12
- * command tree as the action registry instead of duplicating it: look the
13
- * sibling up by name and invoke its action via `parseAsync([])`, which
14
- * applies its declared option defaults exactly as if the user had typed
15
- * `rr jsc` directly.
16
- *
17
- * Commander binds the running command as `this` inside an action (see
18
- * `command.js` — `fn.apply(this, actionArgs)`). `this.parent` gives us the
19
- * parent program without any late-binding ceremony.
9
+ * `rr check` runs `jsc` then `tsc`. Rather than keep a parallel action
10
+ * registry, it reuses commander's command tree: it finds each sibling on
11
+ * `this.parent` and runs it via `parseAsync([])`, which applies the sibling's
12
+ * own option defaults. (`this` is the running command inside a non-arrow
13
+ * action see cli/CLAUDE.md.)
20
14
  */
21
15
  export function createCheckCommand(ctx: Context) {
22
16
  return createCommand("check")
@@ -32,13 +26,11 @@ export function createCheckCommand(ctx: Context) {
32
26
  throw new Error("`rr check` requires the parent program to dispatch sibling subcommands.");
33
27
  }
34
28
 
35
- // jsc then tsc, sequentially: each renders its own live board and two
36
- // boards can't animate the same terminal region at once (decision 012).
37
- // Each section runs inside its own `runCheckSections` scope that both
38
- // keeps it framed (so the frames divide the sections) and returns the
39
- // boards THAT section rendered, so failure is attributed by section name,
40
- // never by a fragile dispatch-vs-render index. A section that runs no
41
- // board (tsc with no tsconfig) simply reports no results.
29
+ // Sequentially, not in parallel: two live boards can't animate the same
30
+ // terminal region at once (decision 012). Each section runs in its own
31
+ // `runCheckSections` scope, which frames it and returns the boards it
32
+ // rendered so a failure is attributed by section name, not a fragile
33
+ // dispatch-vs-render index.
42
34
  const start = Date.now();
43
35
  const failed: string[] = [];
44
36
  let rendered = false;
@@ -85,12 +77,9 @@ function findCommand(program: Command, name: string): Command | undefined {
85
77
  }
86
78
 
87
79
  /**
88
- * Mirrors the provider resolution of `jsc` + `tsc` and flattens the
89
- * underlying tool labels — e.g. biome (composed lint+format) + oxc (tsc)
90
- * renders as `(biome, oxlint)` rather than `(biome + biome, oxlint)`. When
91
- * neither sibling has a provider, falls back to the standard `(not
92
- * configured)` annotation so the help reads consistently with other
93
- * commands.
80
+ * Flattens the underlying tool labels of `jsc` + `tsc` for the help summary —
81
+ * e.g. `(biome, oxlint)`, deduped, not `(biome + biome, oxlint)`. Falls back to
82
+ * the standard `(not configured)` when neither sibling has a provider.
94
83
  */
95
84
  function checkAnnotation(ctx: Context): string {
96
85
  const directJsc = ctx.registry.get("jsc");
@@ -1,15 +1,11 @@
1
1
  import type { Doctor, Formatter, Linter, RunReport, StaticChecker, StaticCheckerOptions } from "#src/plugin/types.ts";
2
2
 
3
3
  /**
4
- * Synthesises a `StaticChecker & Doctor` (the `jsc` capability) by composing
5
- * a separately-registered linter and formatter. Used when the user's plugin
6
- * set provides `lint` and `format` independently (e.g. oxc, or eslint +
7
- * prettier) but no single plugin claims `jsc`.
8
- *
9
- * The check runs lint then format sequentially — interleaved stdout from a
10
- * parallel run is hard to read for the user — and merges their reports into one
11
- * so the board renders the pair as a single row. `fixStaged` is dropped because
12
- * the underlying tools don't have a uniform staged-aware mode.
4
+ * Synthesises the `jsc` capability (`StaticChecker & Doctor`) by composing a
5
+ * separately-registered linter and formatter used when the plugin set
6
+ * provides `lint` and `format` independently (e.g. oxc) but no plugin claims
7
+ * `jsc`. Runs lint then format sequentially (parallel stdout interleaves badly)
8
+ * and merges their reports into one board row.
13
9
  */
14
10
  export function composedJscProvider(linter: Linter & Doctor, formatter: Formatter & Doctor): StaticChecker & Doctor {
15
11
  return {
package/src/types/tool.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  /**
2
- * The outcome of running a check-family tool (lint / format / static check /
3
- * type check) captured rather than streamed. `ok` is the tool's own verdict
4
- * its exit code, never a guess parsed from output — and `output` is the
5
- * combined captured stdout+stderr (color preserved), flushed verbatim grouped
6
- * under the package label. We deliberately do NOT parse tool summaries for
7
- * warning/error counts: the formats are unstable and not uniform across tools
8
- * (tsc and oxfmt have no machine output at all). See decisions/013.
2
+ * The outcome of a check-family tool (lint / format / static check / type
3
+ * check) captured rather than streamed. `ok` is the tool's exit code never a
4
+ * guess parsed from output, since tool summaries are unstable and not uniform
5
+ * (tsc and oxfmt emit none) — and `output` is the combined stdout+stderr (color
6
+ * preserved), flushed verbatim under the package label. See decisions/013.
9
7
  */
10
8
  export type RunReport = {
11
9
  ok: boolean;