rman 2.8.0 → 2.9.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.
- package/builtins/platforms/node/node-manifest.provider.d.ts +10 -0
- package/builtins/platforms/node/node-manifest.provider.js +32 -5
- package/builtins/platforms/node/services/clean.service.js +104 -23
- package/cli.js +31 -13
- package/constants.js +1 -1
- package/core/classes/repository.d.ts +48 -0
- package/core/classes/repository.js +139 -8
- package/core/command-builder.d.ts +9 -1
- package/core/command-builder.js +24 -11
- package/core/config/config-paths.js +24 -0
- package/core/interfaces/custom-command.d.ts +39 -0
- package/core/interfaces/run-step.d.ts +50 -3
- package/index.d.ts +7 -1
- package/index.js +11 -0
- package/interfaces/rman-config.interface.d.ts +21 -3
- package/package.json +1 -1
- package/services/run.service.d.ts +125 -1
- package/services/run.service.js +388 -120
- package/services/version.service.d.ts +2 -0
- package/services/version.service.js +7 -2
- package/utils/run-options.d.ts +44 -0
- package/utils/run-options.js +55 -0
|
@@ -86,7 +86,10 @@ export class VersionService extends Service {
|
|
|
86
86
|
const hook = (slot) => RunService.runLifecycleSlot(pkg, VERSION_LIFECYCLE, slot, RunService.normalizeScriptValue(
|
|
87
87
|
/** `at`: the path is what tells a step function from a value one, and this is a fragment -
|
|
88
88
|
* without it a function here was called while the hook was being prepared. */
|
|
89
|
-
interpolator.interpolate({ config: pkg.config?.version?.[slot], scope, at: ['version', slot] }), `version.${slot}
|
|
89
|
+
interpolator.interpolate({ config: pkg.config?.version?.[slot], scope, at: ['version', slot] }), `version.${slot}`,
|
|
90
|
+
/** A version hook runs for one package around its own version write - there is no
|
|
91
|
+
* package graph here to wait on, so `topo` is refused rather than silently ignored. */
|
|
92
|
+
{ topo: false }));
|
|
90
93
|
await hook('before');
|
|
91
94
|
/** Through the manifest, not through a `package.json` field: where a version is written is
|
|
92
95
|
* the provider's business (see `Plugin`'s manifest members), and this is the one place rman changes
|
|
@@ -286,8 +289,10 @@ export class VersionService extends Service {
|
|
|
286
289
|
* never run. (The doc comment also still named `.script`/`.preScript`/`.postScript`, three keys
|
|
287
290
|
* that have been `before`/`exec`/`after` for a long time.)
|
|
288
291
|
*/
|
|
292
|
+
/** `topo` is refused by default here, which is the one way this differs from `RunService`'s: a
|
|
293
|
+
* version hook has no package ordering to join. */
|
|
289
294
|
function normalizeScriptValue(value, at) {
|
|
290
|
-
return RunService.normalizeScriptValue(value, at);
|
|
295
|
+
return RunService.normalizeScriptValue(value, at, { topo: false });
|
|
291
296
|
}
|
|
292
297
|
VersionService.normalizeScriptValue = normalizeScriptValue;
|
|
293
298
|
/**
|
package/utils/run-options.d.ts
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
1
|
import type { RunService } from '../services/run.service.js';
|
|
2
|
+
/**
|
|
3
|
+
* The three scheduling flags any command that sweeps packages can take - `--parallel`, `--bail`,
|
|
4
|
+
* `--progress`.
|
|
5
|
+
*
|
|
6
|
+
* **Exported as a group for the reason `packageFilterOptions` is**: a command spreading it gets the
|
|
7
|
+
* flags spelled and behaving exactly as `run`'s, where restating them means `--parallel` quietly
|
|
8
|
+
* accepting a number on one command and not on another. `--parallel`'s `coerce` is the part nobody
|
|
9
|
+
* would copy correctly - it takes a boolean *or* a number, and the type of the parsed value is read
|
|
10
|
+
* off that function.
|
|
11
|
+
*
|
|
12
|
+
* **`--topo` is deliberately not in it.** `run`'s default is ordering on; a command reaching for
|
|
13
|
+
* this is sweeping packages with an independent tool, where a wait nobody asked for costs the whole
|
|
14
|
+
* point. A command that does want it declares it, and `forEachPackage` takes `topo` as an option.
|
|
15
|
+
*
|
|
16
|
+
* The `describe` texts here name no `.rmanrc run.<script>` key, because a command using them owns
|
|
17
|
+
* its own (`check.concurrency`) - which is also why `runOptions` keeps its own wording rather than
|
|
18
|
+
* spreading this.
|
|
19
|
+
*/
|
|
20
|
+
export declare const parallelOptions: {
|
|
21
|
+
parallel: {
|
|
22
|
+
target: "cli";
|
|
23
|
+
describe: string;
|
|
24
|
+
/** No `type`: the flag takes a boolean *or* a number, and `coerce` is what says so - which is
|
|
25
|
+
* also where `OptionValue` reads this option's type from. */
|
|
26
|
+
coerce: (v: unknown) => boolean | number | undefined;
|
|
27
|
+
};
|
|
28
|
+
bail: {
|
|
29
|
+
target: "cli";
|
|
30
|
+
describe: string;
|
|
31
|
+
type: "boolean";
|
|
32
|
+
};
|
|
33
|
+
progress: {
|
|
34
|
+
target: "cli";
|
|
35
|
+
describe: string;
|
|
36
|
+
type: "boolean";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/** The scheduling half of `forEachPackage`'s options, read off argv - the mirror of
|
|
40
|
+
* `readRunOptions` for a command that declared `parallelOptions`. */
|
|
41
|
+
export declare function readParallelOptions(args: any): {
|
|
42
|
+
parallel?: boolean | number;
|
|
43
|
+
bail?: boolean;
|
|
44
|
+
progress?: boolean;
|
|
45
|
+
};
|
|
2
46
|
/**
|
|
3
47
|
* Everything `run`, `build` and `test` accept - the package filter, the branch guard, `--from-root`, and
|
|
4
48
|
* the scheduling flags on top.
|
package/utils/run-options.js
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
import { branchGuardOptions } from './branch-guard.js';
|
|
2
2
|
import { fromRootOption, packageFilterOptions, readPackageFilterOptions } from './package-filter.js';
|
|
3
|
+
/**
|
|
4
|
+
* The three scheduling flags any command that sweeps packages can take - `--parallel`, `--bail`,
|
|
5
|
+
* `--progress`.
|
|
6
|
+
*
|
|
7
|
+
* **Exported as a group for the reason `packageFilterOptions` is**: a command spreading it gets the
|
|
8
|
+
* flags spelled and behaving exactly as `run`'s, where restating them means `--parallel` quietly
|
|
9
|
+
* accepting a number on one command and not on another. `--parallel`'s `coerce` is the part nobody
|
|
10
|
+
* would copy correctly - it takes a boolean *or* a number, and the type of the parsed value is read
|
|
11
|
+
* off that function.
|
|
12
|
+
*
|
|
13
|
+
* **`--topo` is deliberately not in it.** `run`'s default is ordering on; a command reaching for
|
|
14
|
+
* this is sweeping packages with an independent tool, where a wait nobody asked for costs the whole
|
|
15
|
+
* point. A command that does want it declares it, and `forEachPackage` takes `topo` as an option.
|
|
16
|
+
*
|
|
17
|
+
* The `describe` texts here name no `.rmanrc run.<script>` key, because a command using them owns
|
|
18
|
+
* its own (`check.concurrency`) - which is also why `runOptions` keeps its own wording rather than
|
|
19
|
+
* spreading this.
|
|
20
|
+
*/
|
|
21
|
+
export const parallelOptions = {
|
|
22
|
+
parallel: {
|
|
23
|
+
target: 'cli',
|
|
24
|
+
describe: 'Max packages at once: omit/true for CPU count, a number for that many, false to run serially',
|
|
25
|
+
/** No `type`: the flag takes a boolean *or* a number, and `coerce` is what says so - which is
|
|
26
|
+
* also where `OptionValue` reads this option's type from. */
|
|
27
|
+
coerce: (v) => {
|
|
28
|
+
if (v === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (v === 'false' || v === false)
|
|
31
|
+
return false;
|
|
32
|
+
if (v === 'true' || v === true)
|
|
33
|
+
return true;
|
|
34
|
+
const n = Number(v);
|
|
35
|
+
return Number.isFinite(n) ? n : true;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
bail: {
|
|
39
|
+
target: 'cli',
|
|
40
|
+
describe: 'Stop at the first failure. Default true.',
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
},
|
|
43
|
+
progress: {
|
|
44
|
+
target: 'cli',
|
|
45
|
+
describe: 'Show a live progress panel (default: true; auto-disabled when not a TTY)',
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
/** The scheduling half of `forEachPackage`'s options, read off argv - the mirror of
|
|
50
|
+
* `readRunOptions` for a command that declared `parallelOptions`. */
|
|
51
|
+
export function readParallelOptions(args) {
|
|
52
|
+
return {
|
|
53
|
+
parallel: args.parallel,
|
|
54
|
+
bail: args.bail,
|
|
55
|
+
progress: args.progress,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
3
58
|
/**
|
|
4
59
|
* Everything `run`, `build` and `test` accept - the package filter, the branch guard, `--from-root`, and
|
|
5
60
|
* the scheduling flags on top.
|