rman 1.3.0 → 2.0.0-beta.3

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 (187) hide show
  1. package/README.md +65 -31
  2. package/builtins/platforms/node/augmentation/rmanrc.augmentation.d.ts +83 -0
  3. package/builtins/platforms/node/augmentation/system-info.augmentation.d.ts +26 -0
  4. package/builtins/platforms/node/augmentation/system-info.augmentation.js +79 -0
  5. package/builtins/platforms/node/commands/ci.command.d.ts +133 -0
  6. package/builtins/platforms/node/commands/ci.command.js +60 -0
  7. package/builtins/platforms/node/commands/clean.command.d.ts +185 -0
  8. package/builtins/platforms/node/commands/clean.command.js +74 -0
  9. package/builtins/platforms/node/index.d.ts +8 -0
  10. package/builtins/platforms/node/index.js +8 -0
  11. package/builtins/platforms/node/node-config.interface.d.ts +76 -0
  12. package/builtins/platforms/node/node-config.interface.js +7 -0
  13. package/builtins/platforms/node/node-manifest.provider.d.ts +68 -0
  14. package/builtins/platforms/node/node-manifest.provider.js +125 -0
  15. package/builtins/platforms/node/node.platform.d.ts +53 -0
  16. package/builtins/platforms/node/node.platform.js +134 -0
  17. package/builtins/platforms/node/services/ci.service.d.ts +47 -0
  18. package/builtins/platforms/node/services/ci.service.js +213 -0
  19. package/builtins/platforms/node/services/clean.service.d.ts +53 -0
  20. package/builtins/platforms/node/services/clean.service.js +237 -0
  21. package/builtins/platforms/node/services/publish.service.d.ts +114 -0
  22. package/builtins/platforms/node/services/publish.service.js +371 -0
  23. package/builtins/platforms/node/services/version-plan.service.d.ts +44 -0
  24. package/builtins/platforms/node/services/version-plan.service.js +58 -0
  25. package/builtins/platforms/node/utils/workspace-range.d.ts +26 -0
  26. package/builtins/platforms/node/utils/workspace-range.js +28 -0
  27. package/builtins/presets/index.d.ts +15 -0
  28. package/builtins/presets/index.js +57 -0
  29. package/builtins/presets/node.d.ts +16 -0
  30. package/builtins/presets/node.js +57 -0
  31. package/{services → builtins/publish-targets/docker}/docker-publish.service.d.ts +52 -31
  32. package/{services → builtins/publish-targets/docker}/docker-publish.service.js +49 -26
  33. package/builtins/publish-targets/docker/docker.target.d.ts +54 -0
  34. package/builtins/publish-targets/docker/docker.target.js +40 -0
  35. package/builtins/publish-targets/docker/index.d.ts +2 -0
  36. package/builtins/publish-targets/docker/index.js +2 -0
  37. package/builtins/publish-targets/npm/index.d.ts +2 -0
  38. package/builtins/publish-targets/npm/index.js +2 -0
  39. package/builtins/publish-targets/npm/npm-publish-target.d.ts +73 -0
  40. package/builtins/publish-targets/npm/npm-publish-target.js +95 -0
  41. package/builtins/publish-targets/npm/npm-view.d.ts +48 -0
  42. package/builtins/publish-targets/npm/npm-view.js +71 -0
  43. package/cli.d.ts +8 -0
  44. package/cli.js +228 -93
  45. package/commands/build.command.d.ts +177 -3
  46. package/commands/build.command.js +20 -10
  47. package/commands/changelog.command.d.ts +296 -3
  48. package/commands/changelog.command.js +127 -43
  49. package/commands/config.command.d.ts +44 -3
  50. package/commands/config.command.js +53 -24
  51. package/commands/diff.command.d.ts +37 -3
  52. package/commands/diff.command.js +25 -16
  53. package/commands/exec.command.d.ts +193 -3
  54. package/commands/exec.command.js +60 -58
  55. package/commands/github-release.command.d.ts +154 -3
  56. package/commands/github-release.command.js +67 -37
  57. package/commands/import.command.d.ts +36 -3
  58. package/commands/import.command.js +28 -20
  59. package/commands/info.command.d.ts +35 -7
  60. package/commands/info.command.js +36 -30
  61. package/commands/lint.command.d.ts +176 -0
  62. package/commands/lint.command.js +34 -0
  63. package/commands/list.command.d.ts +163 -3
  64. package/commands/list.command.js +109 -71
  65. package/commands/publish.command.d.ts +231 -0
  66. package/commands/publish.command.js +304 -0
  67. package/commands/run.command.d.ts +186 -6
  68. package/commands/run.command.js +26 -72
  69. package/commands/test.command.d.ts +173 -3
  70. package/commands/test.command.js +16 -10
  71. package/commands/version.command.d.ts +330 -3
  72. package/commands/version.command.js +292 -78
  73. package/commands.d.ts +32 -0
  74. package/commands.js +28 -0
  75. package/constants.js +1 -1
  76. package/core/application.d.ts +116 -0
  77. package/core/application.js +160 -0
  78. package/core/classes/package.d.ts +219 -0
  79. package/core/classes/package.js +214 -0
  80. package/core/classes/registry.d.ts +30 -0
  81. package/core/classes/registry.js +47 -0
  82. package/core/{repository.d.ts → classes/repository.d.ts} +69 -20
  83. package/core/{repository.js → classes/repository.js} +195 -75
  84. package/core/classes/service.d.ts +49 -0
  85. package/core/classes/service.js +40 -0
  86. package/core/{version-scheme.d.ts → classes/version-scheme.d.ts} +23 -1
  87. package/core/{version-scheme.js → classes/version-scheme.js} +29 -1
  88. package/core/classes/workspace.d.ts +275 -0
  89. package/core/classes/workspace.js +537 -0
  90. package/core/command-builder.d.ts +14 -0
  91. package/core/command-builder.js +94 -0
  92. package/core/config/config-file-scope.d.ts +107 -0
  93. package/core/config/config-file-scope.js +226 -0
  94. package/core/config/config-interpolator.d.ts +164 -0
  95. package/core/config/config-interpolator.js +577 -0
  96. package/core/config/config-paths.d.ts +65 -0
  97. package/core/config/config-paths.js +78 -0
  98. package/core/config/config-reader.d.ts +192 -0
  99. package/core/config/config-reader.js +727 -0
  100. package/core/{merge-config.d.ts → config/merge-config.d.ts} +33 -34
  101. package/core/config/merge-config.js +260 -0
  102. package/core/{resolve-target.d.ts → config/resolve-config-target.d.ts} +1 -1
  103. package/core/{resolve-target.js → config/resolve-config-target.js} +1 -1
  104. package/core/{custom-command.d.ts → interfaces/custom-command.d.ts} +46 -10
  105. package/core/{custom-command.js → interfaces/custom-command.js} +44 -17
  106. package/core/{manifest.d.ts → interfaces/manifest.d.ts} +49 -27
  107. package/core/interfaces/manifest.js +132 -0
  108. package/core/interfaces/plugin.d.ts +174 -0
  109. package/core/interfaces/plugin.js +124 -0
  110. package/core/interfaces/publish-target.d.ts +136 -0
  111. package/core/interfaces/publish-target.js +43 -0
  112. package/core/{run-step.d.ts → interfaces/run-step.d.ts} +4 -4
  113. package/core/interfaces/run-step.js +1 -0
  114. package/core/plugin-loader.d.ts +25 -0
  115. package/core/plugin-loader.js +53 -0
  116. package/index.d.ts +122 -24
  117. package/index.js +66 -16
  118. package/interfaces/config-scope.interface.d.ts +223 -0
  119. package/interfaces/config-scope.interface.js +1 -0
  120. package/interfaces/rman-config.interface.d.ts +821 -203
  121. package/interfaces/rman-config.interface.js +78 -1
  122. package/package.json +3 -1
  123. package/services/change-hash.service.d.ts +42 -8
  124. package/services/change-hash.service.js +92 -13
  125. package/services/changelog.service.d.ts +91 -52
  126. package/services/changelog.service.js +460 -74
  127. package/services/config-service.d.ts +8 -0
  128. package/services/config-service.js +3 -0
  129. package/services/exec.service.d.ts +23 -12
  130. package/services/exec.service.js +14 -9
  131. package/services/github-release.service.d.ts +45 -34
  132. package/services/github-release.service.js +15 -12
  133. package/services/import.service.d.ts +25 -14
  134. package/services/import.service.js +9 -5
  135. package/services/list.service.d.ts +67 -13
  136. package/services/list.service.js +62 -15
  137. package/services/run.service.d.ts +35 -22
  138. package/services/run.service.js +316 -233
  139. package/services/system-info.d.ts +1 -1
  140. package/services/version-plan.service.d.ts +35 -8
  141. package/services/version-plan.service.js +96 -36
  142. package/services/version.service.d.ts +34 -14
  143. package/services/version.service.js +35 -16
  144. package/services.d.ts +1 -1
  145. package/services.js +1 -1
  146. package/utils/bin-path.d.ts +6 -7
  147. package/utils/bin-path.js +7 -18
  148. package/utils/branch-guard.d.ts +30 -1
  149. package/utils/branch-guard.js +31 -0
  150. package/utils/color-yaml.d.ts +8 -0
  151. package/utils/color-yaml.js +86 -0
  152. package/utils/exec.d.ts +10 -0
  153. package/utils/exec.js +1 -1
  154. package/utils/git.d.ts +26 -0
  155. package/utils/git.js +65 -0
  156. package/utils/logger.d.ts +2 -2
  157. package/utils/logger.js +1 -1
  158. package/utils/package-filter.d.ts +135 -8
  159. package/utils/package-filter.js +204 -16
  160. package/utils/printable-config.d.ts +9 -1
  161. package/utils/printable-config.js +46 -1
  162. package/utils/progress-panel.d.ts +9 -0
  163. package/utils/progress-panel.js +23 -1
  164. package/utils/release-version.d.ts +1 -1
  165. package/utils/run-bin.d.ts +10 -0
  166. package/utils/run-bin.js +1 -1
  167. package/utils/run-options.d.ts +97 -0
  168. package/utils/run-options.js +81 -0
  169. package/utils/version-group.d.ts +31 -0
  170. package/utils/version-group.js +43 -0
  171. package/utils/version-stamp.d.ts +1 -1
  172. package/utils/version-stamp.js +1 -1
  173. package/commands/changed.command.d.ts +0 -3
  174. package/commands/changed.command.js +0 -29
  175. package/core/config.d.ts +0 -409
  176. package/core/config.js +0 -939
  177. package/core/extends-config.d.ts +0 -27
  178. package/core/extends-config.js +0 -89
  179. package/core/manifest.js +0 -150
  180. package/core/merge-config.js +0 -219
  181. package/core/package.d.ts +0 -83
  182. package/core/package.js +0 -106
  183. package/core/plugin.d.ts +0 -112
  184. package/core/plugin.js +0 -189
  185. package/core/workspace.d.ts +0 -68
  186. package/core/workspace.js +0 -83
  187. /package/{core/run-step.js → builtins/platforms/node/augmentation/rmanrc.augmentation.js} +0 -0
@@ -1,3 +1,330 @@
1
- import type { Argv } from 'yargs';
2
- import type { Repository } from '../core/repository.js';
3
- export declare function initCli(repository: Repository, program: Argv): void;
1
+ import type { RunStepValue } from '../core/interfaces/run-step.js';
2
+ import type { ConfigValue, RmanConfig } from '../interfaces/rman-config.interface.js';
3
+ /**
4
+ * Hoisted out of the metadata literal so the handler can be annotated against them - see
5
+ * `RmanConfig.ArgsOf` for why an inferred `argv` and the metadata's own typo checking cannot both
6
+ * work in one signature.
7
+ *
8
+ * `as const` on the command string is load-bearing twice over: the config key is derived from it
9
+ * (`'version'`), and so are the positional names it declares.
10
+ */
11
+ declare const COMMAND: "version [bump]";
12
+ declare const config: {
13
+ interactive: {
14
+ target: "cli";
15
+ alias: string;
16
+ describe: string;
17
+ type: "boolean";
18
+ };
19
+ show: {
20
+ target: "cli";
21
+ describe: string;
22
+ type: "boolean";
23
+ conflicts: string;
24
+ };
25
+ yes: {
26
+ target: "cli";
27
+ alias: string;
28
+ describe: string;
29
+ type: "boolean";
30
+ conflicts: string;
31
+ };
32
+ json: {
33
+ target: "cli";
34
+ alias: string;
35
+ describe: string;
36
+ type: "boolean";
37
+ conflicts: string[];
38
+ };
39
+ ignoreDirty: {
40
+ target: "cli";
41
+ cliName: string;
42
+ describe: string;
43
+ type: "boolean";
44
+ };
45
+ push: {
46
+ target: "cli";
47
+ describe: string;
48
+ type: "boolean";
49
+ };
50
+ message: {
51
+ target: "cli";
52
+ alias: string;
53
+ describe: string;
54
+ type: "string";
55
+ };
56
+ changelog: {
57
+ target: "both";
58
+ describe: string;
59
+ type: "boolean";
60
+ };
61
+ preid: {
62
+ target: "cli";
63
+ describe: string;
64
+ type: "string";
65
+ };
66
+ /**
67
+ * Config-only, from here down: `.rmanrc "version.*"` keys with no reason to be a flag.
68
+ * `--message` is `commitMessage`'s flag and is declared above; the rest are settings a repository
69
+ * states once, not things a single run overrides.
70
+ */
71
+ commitMessage: {
72
+ target: "config";
73
+ describe: string;
74
+ type: "string";
75
+ };
76
+ releaseTagPattern: {
77
+ target: "config";
78
+ describe: string;
79
+ type: "string";
80
+ };
81
+ stampDockerfile: {
82
+ target: "config";
83
+ describe: string;
84
+ type: "boolean";
85
+ };
86
+ allowBranch: {
87
+ target: "cli";
88
+ cliName: string;
89
+ describe: string;
90
+ type: "string";
91
+ };
92
+ ignoreBranch: {
93
+ target: "cli";
94
+ cliName: string;
95
+ describe: string;
96
+ type: "string";
97
+ };
98
+ scope: {
99
+ target: "cli";
100
+ describe: string;
101
+ type: "string";
102
+ };
103
+ ignore: {
104
+ target: "cli";
105
+ describe: string;
106
+ type: "string";
107
+ };
108
+ platform: {
109
+ target: "cli";
110
+ describe: string;
111
+ type: "string";
112
+ };
113
+ deps: {
114
+ target: "cli";
115
+ describe: string;
116
+ type: "boolean";
117
+ };
118
+ dependents: {
119
+ target: "cli";
120
+ describe: string;
121
+ type: "boolean";
122
+ };
123
+ };
124
+ /**
125
+ * The rest of `version.*` - the keys an option **cannot** describe, which is the whole test for
126
+ * belonging here.
127
+ *
128
+ * A `CommandOption` says `type: 'string'` or `type: 'boolean'`. It has no way to say "a path, or
129
+ * `{ file, constant }`" or "a shell command, or a function, or a list of either" - so these four
130
+ * are written out, intersected with the derived ones by `CommandContribution`, and the key still
131
+ * has exactly one owner. Everything above that *is* expressible is declared as an option instead:
132
+ * `Extra` is the escape hatch, not the default.
133
+ *
134
+ * **It is also the one interface in the tree holding both kinds of function**, so the value/step
135
+ * split is made here by hand, key by key. `stamp` is a **value**, so it is a `ConfigValue` and may
136
+ * be written as a function evaluated while the config resolves. The three slots are **steps**: they
137
+ * already take a function and it means something else - code `version` calls when the write
138
+ * happens, with a `RunStepContext`. Wrapping one would accept a value function where a step is what
139
+ * actually runs.
140
+ *
141
+ * A new key here goes on one side or the other, and the two mistakes are not symmetric: forgetting
142
+ * `ConfigValue` on a value key is benign (it simply cannot be written as a function yet, which is
143
+ * where every key started), while putting it on a step key is not. That asymmetry is why nothing
144
+ * wraps these automatically - see `CommandConfigFromMetadata` for the half that can be, because an
145
+ * option's value is a value by construction.
146
+ */
147
+ export interface VersionExtraKeys {
148
+ /** Files whose hard-coded version is rewritten to the version being written, in the same commit
149
+ * as the bump - paths relative to the package's own directory (e.g. `["src/constants.ts"]`).
150
+ * Per-package cascaded; a listed file a package doesn't have is a silent no-op, so one `"[*]"`
151
+ * declaration covers a repo where only some packages carry one.
152
+ *
153
+ * Stamping the source, not the build output: a build-time rewrite leaves the checked-in file
154
+ * claiming a placeholder, so anything running from source reports that placeholder, git never
155
+ * records the released version, and the rewrite has to be redone on every build. */
156
+ stamp?: ConfigValue<VersionStampEntry | VersionStampEntry[]>;
157
+ /** Command(s) run at the version write itself, when the package does not declare a hook for that
158
+ * slot of its own (`version` in a Node repository's `package.json#scripts`, whatever a plugin's
159
+ * step source answers elsewhere - the package's own declaration wins, as in `run`). An array
160
+ * runs them in sequence. `${{ pkg.targetVersion }}` is bound here and in the two below, and
161
+ * nowhere else.
162
+ *
163
+ * A `RunStepFn` runs in place of a shell command - but note that `${{ pkg.targetVersion }}` is a
164
+ * *string* substitution, so a function reads the written version off `pkg` instead. */
165
+ exec?: RunStepValue | RunStepValue[];
166
+ /** Same, before the write (`preversion` in a Node repository). */
167
+ before?: RunStepValue | RunStepValue[];
168
+ /** Same, after it (`postversion` in a Node repository). */
169
+ after?: RunStepValue | RunStepValue[];
170
+ }
171
+ /** One `version.stamp` entry: a path, or a path plus the identifier to rewrite when it is not
172
+ * spelled `version`. */
173
+ export type VersionStampEntry = string | {
174
+ file: string;
175
+ constant?: string;
176
+ };
177
+ type Args = RmanConfig.ArgsOf<typeof config, typeof COMMAND>;
178
+ declare const versionCommand: (app: import("../index.js").RmanApplication) => {
179
+ /** `as const` so the config key stays derivable from it: `CommandMetadata['command']` is a
180
+ * plain `string`, so without the assertion inference widens `'version [bump]'` and there is
181
+ * nothing left to read `'version'` out of. */
182
+ command: "version [bump]";
183
+ describe: string;
184
+ /**
185
+ * Read, not owned - so they are named here rather than declared in `config`. `group` is a core
186
+ * per-package key that decides which packages move together, `changelog.*` is consulted when
187
+ * `--changelog` folds one into the bump commit, and `allowBranch`/`ignoreBranch` are repo-wide
188
+ * keys the shared branch-guard group only exposes as flags. `version` itself is not listed: it
189
+ * is this command's own key, derived from `command`.
190
+ */
191
+ configKeys: string[];
192
+ config: {
193
+ interactive: {
194
+ target: "cli";
195
+ alias: string;
196
+ describe: string;
197
+ type: "boolean";
198
+ };
199
+ show: {
200
+ target: "cli";
201
+ describe: string;
202
+ type: "boolean";
203
+ conflicts: string;
204
+ };
205
+ yes: {
206
+ target: "cli";
207
+ alias: string;
208
+ describe: string;
209
+ type: "boolean";
210
+ conflicts: string;
211
+ };
212
+ json: {
213
+ target: "cli";
214
+ alias: string;
215
+ describe: string;
216
+ type: "boolean";
217
+ conflicts: string[];
218
+ };
219
+ ignoreDirty: {
220
+ target: "cli";
221
+ cliName: string;
222
+ describe: string;
223
+ type: "boolean";
224
+ };
225
+ push: {
226
+ target: "cli";
227
+ describe: string;
228
+ type: "boolean";
229
+ };
230
+ message: {
231
+ target: "cli";
232
+ alias: string;
233
+ describe: string;
234
+ type: "string";
235
+ };
236
+ changelog: {
237
+ target: "both";
238
+ describe: string;
239
+ type: "boolean";
240
+ };
241
+ preid: {
242
+ target: "cli";
243
+ describe: string;
244
+ type: "string";
245
+ };
246
+ /**
247
+ * Config-only, from here down: `.rmanrc "version.*"` keys with no reason to be a flag.
248
+ * `--message` is `commitMessage`'s flag and is declared above; the rest are settings a repository
249
+ * states once, not things a single run overrides.
250
+ */
251
+ commitMessage: {
252
+ target: "config";
253
+ describe: string;
254
+ type: "string";
255
+ };
256
+ releaseTagPattern: {
257
+ target: "config";
258
+ describe: string;
259
+ type: "string";
260
+ };
261
+ stampDockerfile: {
262
+ target: "config";
263
+ describe: string;
264
+ type: "boolean";
265
+ };
266
+ allowBranch: {
267
+ target: "cli";
268
+ cliName: string;
269
+ describe: string;
270
+ type: "string";
271
+ };
272
+ ignoreBranch: {
273
+ target: "cli";
274
+ cliName: string;
275
+ describe: string;
276
+ type: "string";
277
+ };
278
+ scope: {
279
+ target: "cli";
280
+ describe: string;
281
+ type: "string";
282
+ };
283
+ ignore: {
284
+ target: "cli";
285
+ describe: string;
286
+ type: "string";
287
+ };
288
+ platform: {
289
+ target: "cli";
290
+ describe: string;
291
+ type: "string";
292
+ };
293
+ deps: {
294
+ target: "cli";
295
+ describe: string;
296
+ type: "boolean";
297
+ };
298
+ dependents: {
299
+ target: "cli";
300
+ describe: string;
301
+ type: "boolean";
302
+ };
303
+ };
304
+ examples: {
305
+ command: string;
306
+ description: string;
307
+ }[];
308
+ positionals: {
309
+ bump: {
310
+ describe: string;
311
+ type: "string";
312
+ };
313
+ };
314
+ /** Annotated rather than inferred - `RmanConfig.ArgsOf` records why, and the casts this
315
+ * replaces are the reason it is worth two hoisted declarations. */
316
+ handler: (args: Args) => Promise<void>;
317
+ };
318
+ export default versionCommand;
319
+ /**
320
+ * `version`'s own keys, on `RmanConfig` - derived from the `config` block above rather than written
321
+ * out again, so an option added there is a config key immediately and one renamed cannot leave a
322
+ * stale interface behind. Only `target: 'config'`/`'both'` options come through, so `--interactive`
323
+ * and the other CLI-only flags stay off the config type.
324
+ */
325
+ declare module '../interfaces/rman-config.interface.js' {
326
+ namespace RmanConfig {
327
+ interface CommandConfigs extends RmanConfig.CommandContribution<ReturnType<typeof versionCommand>, VersionExtraKeys> {
328
+ }
329
+ }
330
+ }