@rrlab/cli 1.0.1-git-908d2c0.0 → 1.1.1-git-4903a88.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.
Files changed (110) hide show
  1. package/bin +3 -5
  2. package/dist/cli.usage.kdl +26 -25
  3. package/dist/config.d.mts +1 -1
  4. package/dist/magic-string.es-BgIV5Mu3.mjs +1011 -0
  5. package/dist/plugin/__tests__/bin-probe.test.d.mts +1 -0
  6. package/dist/plugin/__tests__/bin-probe.test.mjs +64 -0
  7. package/dist/plugin/__tests__/decide-scaffold.test.d.mts +1 -0
  8. package/dist/plugin/__tests__/decide-scaffold.test.mjs +103 -0
  9. package/dist/plugin/__tests__/define-plugin.test.d.mts +1 -0
  10. package/dist/plugin/__tests__/define-plugin.test.mjs +130 -0
  11. package/dist/plugin/__tests__/pick-preset.test.d.mts +1 -0
  12. package/dist/plugin/__tests__/pick-preset.test.mjs +72 -0
  13. package/dist/plugin/__tests__/registry.test.d.mts +1 -0
  14. package/dist/plugin/__tests__/registry.test.mjs +104 -0
  15. package/dist/plugin/bin-probe.d.mts +4 -0
  16. package/dist/plugin/bin-probe.mjs +22 -0
  17. package/dist/plugin/decide-scaffold.d.mts +18 -0
  18. package/dist/plugin/decide-scaffold.mjs +36 -0
  19. package/dist/plugin/define-plugin.d.mts +17 -0
  20. package/dist/plugin/define-plugin.mjs +25 -0
  21. package/dist/plugin/directory.d.mts +47 -0
  22. package/dist/plugin/directory.mjs +45 -0
  23. package/dist/plugin/errors.d.mts +11 -0
  24. package/dist/plugin/errors.mjs +15 -0
  25. package/dist/plugin/index.d.mts +7 -0
  26. package/dist/plugin/index.mjs +50 -0
  27. package/dist/plugin/pick-preset.d.mts +13 -0
  28. package/dist/plugin/pick-preset.mjs +17 -0
  29. package/dist/plugin/registry.d.mts +19 -0
  30. package/dist/plugin/registry.mjs +2 -0
  31. package/dist/plugin/tool-service.d.mts +45 -0
  32. package/dist/plugin/tool-service.mjs +64 -0
  33. package/dist/plugin/types.d.mts +3 -0
  34. package/dist/plugin/types.mjs +1 -0
  35. package/dist/registry-BgqfKK5L.mjs +55 -0
  36. package/dist/run.mjs +969 -585
  37. package/dist/test.DNmyFkvJ-09ScyH13.mjs +13617 -0
  38. package/dist/tool-DKL6TauZ.d.mts +43 -0
  39. package/dist/{types-snfbujDH.d.mts → types-Iu4IyWof.d.mts} +11 -75
  40. package/package.json +7 -6
  41. package/src/actions/clean.ts +36 -0
  42. package/src/actions/config.ts +46 -0
  43. package/src/actions/doctor.ts +47 -0
  44. package/src/actions/format.ts +13 -0
  45. package/src/actions/jsc.ts +13 -0
  46. package/src/actions/lint.ts +13 -0
  47. package/src/actions/pack.ts +12 -0
  48. package/src/actions/plugins/add.ts +143 -0
  49. package/src/actions/plugins/list.ts +27 -0
  50. package/src/actions/plugins/remove.ts +110 -0
  51. package/src/actions/plugins/shared.ts +58 -0
  52. package/src/actions/run-tool.ts +23 -0
  53. package/src/actions/tsc.ts +65 -0
  54. package/src/errors/invalid-plugin-module.ts +6 -0
  55. package/src/errors/missing-plugin.ts +17 -0
  56. package/src/errors/plugin-api-version.ts +6 -0
  57. package/src/errors/unknown-plugin.ts +7 -0
  58. package/src/lib/plugin/define-plugin.ts +56 -0
  59. package/src/lib/plugin/directory.ts +30 -0
  60. package/src/lib/plugin/errors.ts +15 -0
  61. package/src/lib/{plugin.ts → plugin/index.ts} +8 -9
  62. package/src/lib/plugin/registry.ts +82 -0
  63. package/src/{plugin → lib/plugin}/tool-service.ts +10 -14
  64. package/src/{plugin → lib/plugin}/types.ts +10 -33
  65. package/src/program/base.ts +75 -0
  66. package/src/program/commands/check.ts +31 -62
  67. package/src/program/commands/clean.ts +12 -43
  68. package/src/program/commands/completion.ts +6 -4
  69. package/src/program/commands/config.ts +6 -11
  70. package/src/program/commands/doctor.ts +5 -54
  71. package/src/program/commands/format.ts +18 -25
  72. package/src/program/commands/jscheck.ts +18 -31
  73. package/src/program/commands/lint.ts +18 -26
  74. package/src/program/commands/pack.ts +18 -22
  75. package/src/program/commands/plugins.ts +17 -364
  76. package/src/program/commands/tscheck.ts +19 -77
  77. package/src/program/index.ts +20 -27
  78. package/src/program/root.ts +62 -0
  79. package/src/render/banner.ts +25 -0
  80. package/src/render/board.ts +41 -0
  81. package/src/render/footer.ts +31 -0
  82. package/src/render/labels.ts +28 -0
  83. package/src/render/lines.ts +100 -0
  84. package/src/render/plugin-view.ts +68 -0
  85. package/src/render/steps.ts +20 -0
  86. package/src/run.ts +2 -8
  87. package/src/services/config.ts +4 -0
  88. package/src/services/context.ts +84 -0
  89. package/src/services/file-ops.ts +79 -0
  90. package/src/services/json-edit.ts +1 -1
  91. package/src/services/plugin-meta.ts +63 -0
  92. package/src/services/plugin-services.ts +41 -0
  93. package/src/services/prompts.ts +1 -1
  94. package/src/services/static-checker.ts +46 -0
  95. package/src/types/config.ts +2 -1
  96. package/src/types/tool.ts +13 -26
  97. package/src/ui/theme.ts +5 -0
  98. package/dist/plugin.d.mts +0 -87
  99. package/dist/plugin.mjs +0 -214
  100. package/src/plugin/define-plugin.ts +0 -54
  101. package/src/plugin/registry.ts +0 -48
  102. package/src/program/board.ts +0 -86
  103. package/src/program/composed-jsc.ts +0 -43
  104. package/src/program/missing-plugin.ts +0 -18
  105. package/src/program/ui.ts +0 -59
  106. package/src/services/ctx.ts +0 -71
  107. package/src/services/plugins-registry.ts +0 -22
  108. /package/src/{plugin → lib/plugin}/bin-probe.ts +0 -0
  109. /package/src/{plugin → lib/plugin}/decide-scaffold.ts +0 -0
  110. /package/src/{plugin → lib/plugin}/pick-preset.ts +0 -0
package/bin CHANGED
@@ -32,14 +32,12 @@ fi
32
32
 
33
33
  # `--usage` emits a KDL spec for downstream parsers (e.g. `usage generate
34
34
  # completion`). Force NO_COLOR so command summaries don't leak ANSI escapes
35
- # into the spec — colors are presentation, KDL is data. Also set
36
- # RR_USAGE_MODE so per-environment annotations (e.g. the active plugin
37
- # next to each command) are stripped from the spec — the KDL must be
38
- # stable across machines.
35
+ # into the spec — colors are presentation, KDL is data. Command summaries are
36
+ # static (no per-environment plugin annotations), so the spec is already stable
37
+ # across machines.
39
38
  for arg in "$@"; do
40
39
  if [ "$arg" = "--usage" ]; then
41
40
  export NO_COLOR=1
42
- export RR_USAGE_MODE=1
43
41
  break
44
42
  fi
45
43
  done
@@ -1,18 +1,12 @@
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-908d2c0.0"
5
- usage "<command...> [options...]"
4
+ version "1.1.1-git-4903a88.0"
5
+ usage "[options] [command]"
6
+ flag --about help="show credits & inspiration"
6
7
  flag --usage help="print KDL spec for this CLI (https://kdl.dev)"
7
- cmd completion help="print shell completion script (usage)" {
8
- long_help "Prints a shell completion script for rr. Add to your shell rc file:\n\n bash: eval \"$(rr completion bash)\"\n zsh: eval \"$(rr completion zsh)\"\n fish: rr completion fish | source"
9
- arg <shell> help="target shell" {
10
- choices bash zsh fish
11
- }
12
- }
13
- cmd pack help="pack a ts library" {
14
- long_help "Compiles TypeScript code into JavaScript and generates type declaration files, packaging the library for distribution."
15
- cmd doctor help="check if the underlying tool is working correctly"
8
+ cmd check help="run static checks" {
9
+ long_help "Runs `rr jsc` then `rr tsc` in-process, each as its own section. Aggregates their exit codes non-zero when either subcommand fails."
16
10
  }
17
11
  cmd jsc help="check format and lint" {
18
12
  alias jscheck
@@ -21,49 +15,56 @@ cmd jsc help="check format and lint" {
21
15
  flag --fix-staged help="try to fix staged files only"
22
16
  cmd doctor help="check if the underlying tool is working correctly"
23
17
  }
24
- cmd tsc help="check typescript errors" {
18
+ cmd tsc help="check types errors" {
25
19
  alias tscheck
26
- long_help "Checks the TypeScript code for type errors, ensuring that the code adheres to the defined type constraints and helps catch potential issues before runtime."
20
+ long_help "Checks type errors, ensuring that the code adheres to the defined type constraints and helps catch potential issues before runtime."
27
21
  cmd doctor help="check if the underlying tool is working correctly"
28
22
  }
29
- cmd lint help="check & fix lint errors" {
23
+ cmd lint help="check & fix lint issues" {
30
24
  long_help "Checks the code for linting issues and optionally fixes them, ensuring it adheres to the defined quality standards."
31
25
  flag "-c --check" help="check if the code is valid" default=#true
32
26
  flag --fix help="try to fix all the code"
33
27
  cmd doctor help="check if the underlying tool is working correctly"
34
28
  }
35
- cmd format help="check & fix format errors" {
29
+ cmd format help="check & fix format issues" {
36
30
  long_help "Checks the code for formatting issues and optionally fixes them, ensuring it adheres to the defined style standards."
37
31
  flag --fix help="format all the code"
38
32
  cmd doctor help="check if the underlying tool is working correctly"
39
33
  }
40
- cmd check help="run static checks" {
41
- long_help "Runs `rr jsc` then `rr tsc` in-process, each as its own section. Aggregates their exit codes — non-zero when either subcommand fails."
34
+ cmd pack help="pack a ts library" {
35
+ long_help "Compiles TypeScript code into JavaScript and generates type declaration files, packaging the library for distribution."
36
+ cmd doctor help="check if the underlying tool is working correctly"
37
+ }
38
+ cmd clean help="delete dirty files" {
39
+ long_help "Deletes generated files and folders such as 'dist', 'node_modules', and lock files to ensure a clean state."
40
+ flag --only-dist help="delete 'dist' folders only"
41
+ flag --dry-run help="outputs the paths that would be deleted"
42
42
  }
43
43
  cmd doctor help="run all plugin doctors" {
44
44
  long_help "Runs the `doctor()` of every configured plugin capability. Each plugin reports ok / not working. The exit code is non-zero if any reports not working."
45
45
  }
46
+ cmd completion help="print shell completion script" {
47
+ long_help "Prints a shell completion script for rr. Add to your shell rc file:\n\n bash: eval \"$(rr completion bash)\"\n zsh: eval \"$(rr completion zsh)\"\n fish: rr completion fish | source"
48
+ arg <shell> help="target shell" {
49
+ choices bash zsh fish
50
+ }
51
+ }
46
52
  cmd plugins subcommand_required=#true help="manage @rrlab plugins" {
47
53
  cmd list help="list plugins configured in run-run.config.{ts,mts}"
48
54
  cmd add help="install and configure an @rrlab plugin" {
49
55
  flag --force help="re-run install even if the plugin is already configured"
50
56
  flag --yes help="skip prompts and use defaults (non-interactive)"
51
57
  flag --dry-run help="show what would happen, without applying changes"
52
- arg <name> help="plugin alias (ts|eslint|biome|oxc|tsdown), optionally with @<spec> e.g. biome@pr-226"
58
+ arg <name> help="plugin alias (ts|biome|oxc|tsdown), optionally with @<spec> e.g. biome@pr-226"
53
59
  }
54
60
  cmd remove help="uninstall an @rrlab plugin and undo its config files + deps" {
55
61
  flag --yes help="skip the confirmation prompt"
56
62
  flag --dry-run help="print the plan without applying changes"
57
63
  arg <name> help="plugin alias to remove" {
58
- choices ts eslint biome oxc tsdown
64
+ choices ts biome oxc tsdown
59
65
  }
60
66
  }
61
67
  }
62
- cmd clean help="delete dirty files (rimraf)" {
63
- long_help "Deletes generated files and folders such as 'dist', 'node_modules', and lock files to ensure a clean state."
64
- flag --only-dist help="delete 'dist' folders only"
65
- flag --dry-run help="outputs the paths that would be deleted"
66
- }
67
68
  cmd config help="display the current config" {
68
- long_help "Displays the current configuration settings, including their source file path if available."
69
+ long_help "Displays the current configuration settings, including their source file path and the plugins it registers."
69
70
  }
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { u as Plugin } from "./types-snfbujDH.mjs";
1
+ import { c as Plugin } from "./types-Iu4IyWof.mjs";
2
2
 
3
3
  //#region src/types/config.d.ts
4
4
  type UserConfig = {