rman 1.2.5 → 2.0.0-beta.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 +63 -19
- package/cli.d.ts +5 -0
- package/cli.js +214 -88
- package/commands/build.command.d.ts +177 -3
- package/commands/build.command.js +20 -10
- package/commands/changed.command.d.ts +80 -3
- package/commands/changed.command.js +19 -12
- package/commands/changelog.command.d.ts +192 -3
- package/commands/changelog.command.js +87 -43
- package/commands/config.command.d.ts +44 -3
- package/commands/config.command.js +30 -19
- package/commands/diff.command.d.ts +37 -3
- package/commands/diff.command.js +25 -16
- package/commands/exec.command.d.ts +193 -3
- package/commands/exec.command.js +60 -58
- package/commands/github-release.command.d.ts +154 -3
- package/commands/github-release.command.js +67 -37
- package/commands/import.command.d.ts +36 -3
- package/commands/import.command.js +28 -20
- package/commands/info.command.d.ts +35 -7
- package/commands/info.command.js +36 -30
- package/commands/list.command.d.ts +163 -3
- package/commands/list.command.js +109 -71
- package/commands/publish.command.d.ts +231 -0
- package/commands/publish.command.js +304 -0
- package/commands/run.command.d.ts +186 -6
- package/commands/run.command.js +26 -72
- package/commands/test.command.d.ts +173 -3
- package/commands/test.command.js +16 -10
- package/commands/version.command.d.ts +317 -3
- package/commands/version.command.js +149 -69
- package/commands.d.ts +32 -0
- package/commands.js +28 -0
- package/constants.js +1 -1
- package/core/application.d.ts +116 -0
- package/core/application.js +143 -0
- package/core/command-builder.d.ts +14 -0
- package/core/command-builder.js +78 -0
- package/core/config.d.ts +180 -50
- package/core/config.js +332 -153
- package/core/core-services.d.ts +14 -0
- package/core/core-services.js +30 -0
- package/core/core-targets.d.ts +14 -0
- package/core/core-targets.js +16 -0
- package/core/custom-command.d.ts +42 -6
- package/core/custom-command.js +44 -17
- package/core/extends-config.d.ts +13 -5
- package/core/extends-config.js +52 -12
- package/core/load-config-module.d.ts +28 -0
- package/core/load-config-module.js +42 -0
- package/core/manifest.d.ts +47 -25
- package/core/manifest.js +51 -69
- package/core/merge-config.d.ts +33 -34
- package/core/merge-config.js +138 -93
- package/core/package.d.ts +145 -17
- package/core/package.js +128 -36
- package/core/plugin-loader.d.ts +65 -0
- package/core/plugin-loader.js +234 -0
- package/core/plugin.d.ts +135 -90
- package/core/plugin.js +70 -173
- package/core/publish-target.d.ts +124 -0
- package/core/publish-target.js +30 -0
- package/core/registry.d.ts +30 -0
- package/core/registry.js +47 -0
- package/core/repository.d.ts +72 -9
- package/core/repository.js +293 -43
- package/core/resolve-target.d.ts +1 -1
- package/core/resolve-target.js +1 -1
- package/core/service.d.ts +49 -0
- package/core/service.js +40 -0
- package/core/version-scheme.d.ts +23 -1
- package/core/version-scheme.js +29 -1
- package/core/workspace.d.ts +84 -33
- package/core/workspace.js +63 -22
- package/index.d.ts +111 -14
- package/index.js +85 -9
- package/interfaces/rman-config.interface.d.ts +739 -212
- package/interfaces/rman-config.interface.js +61 -1
- package/package.json +2 -1
- package/plugins/builtins.d.ts +44 -0
- package/plugins/builtins.js +33 -0
- package/plugins/detect.d.ts +78 -0
- package/plugins/detect.js +70 -0
- package/plugins/node/augmentation/rman.augmentation.d.ts +84 -0
- package/plugins/node/augmentation/rman.augmentation.js +1 -0
- package/plugins/node/augmentation/system-info.augmentation.d.ts +26 -0
- package/plugins/node/augmentation/system-info.augmentation.js +79 -0
- package/plugins/node/commands/ci.command.d.ts +131 -0
- package/plugins/node/commands/ci.command.js +59 -0
- package/plugins/node/commands/clean.command.d.ts +183 -0
- package/plugins/node/commands/clean.command.js +73 -0
- package/plugins/node/index.d.ts +29 -0
- package/plugins/node/index.js +40 -0
- package/plugins/node/node-config.interface.d.ts +77 -0
- package/plugins/node/node-config.interface.js +7 -0
- package/plugins/node/node-manifest.provider.d.ts +68 -0
- package/plugins/node/node-manifest.provider.js +125 -0
- package/plugins/node/node.platform.d.ts +53 -0
- package/plugins/node/node.platform.js +134 -0
- package/plugins/node/npm-publish-target.d.ts +73 -0
- package/plugins/node/npm-publish-target.js +96 -0
- package/plugins/node/services/ci.service.d.ts +47 -0
- package/plugins/node/services/ci.service.js +213 -0
- package/plugins/node/services/clean.service.d.ts +53 -0
- package/plugins/node/services/clean.service.js +237 -0
- package/plugins/node/services/publish.service.d.ts +114 -0
- package/plugins/node/services/publish.service.js +371 -0
- package/plugins/node/services/version-plan.service.d.ts +44 -0
- package/plugins/node/services/version-plan.service.js +58 -0
- package/plugins/node/utils/npm-view.d.ts +48 -0
- package/plugins/node/utils/npm-view.js +71 -0
- package/plugins/node/utils/workspace-range.d.ts +26 -0
- package/plugins/node/utils/workspace-range.js +28 -0
- package/services/change-hash.service.d.ts +2 -2
- package/services/change-hash.service.js +2 -2
- package/services/changelog.service.d.ts +62 -51
- package/services/changelog.service.js +14 -11
- package/services/docker-publish.service.d.ts +50 -29
- package/services/docker-publish.service.js +43 -20
- package/services/exec.service.d.ts +23 -12
- package/services/exec.service.js +14 -9
- package/services/github-release.service.d.ts +44 -33
- package/services/github-release.service.js +13 -10
- package/services/import.service.d.ts +25 -14
- package/services/import.service.js +9 -5
- package/services/list.service.d.ts +62 -10
- package/services/list.service.js +62 -15
- package/services/run.service.d.ts +22 -13
- package/services/run.service.js +262 -223
- package/services/version-plan.service.d.ts +27 -4
- package/services/version-plan.service.js +42 -15
- package/services/version.service.d.ts +31 -11
- package/services/version.service.js +29 -13
- package/targets/docker.target.d.ts +53 -0
- package/targets/docker.target.js +40 -0
- package/utils/bin-path.d.ts +6 -7
- package/utils/bin-path.js +7 -18
- package/utils/branch-guard.d.ts +29 -0
- package/utils/branch-guard.js +31 -0
- package/utils/exec.d.ts +10 -0
- package/utils/exec.js +1 -1
- package/utils/logger.d.ts +1 -1
- package/utils/logger.js +1 -1
- package/utils/package-filter.d.ts +127 -7
- package/utils/package-filter.js +197 -16
- package/utils/printable-config.d.ts +1 -1
- package/utils/printable-config.js +1 -1
- package/utils/run-bin.d.ts +10 -0
- package/utils/run-bin.js +1 -1
- package/utils/run-options.d.ts +97 -0
- package/utils/run-options.js +81 -0
- package/utils/version-stamp.d.ts +1 -1
- package/utils/version-stamp.js +1 -1
|
@@ -1,44 +1,88 @@
|
|
|
1
1
|
import colors from 'ansi-colors';
|
|
2
|
+
import { registerCommand } from '../interfaces/rman-config.interface.js';
|
|
2
3
|
import { ChangeHashService } from '../services/change-hash.service.js';
|
|
3
|
-
import { ChangelogService } from '../services/changelog.service.js';
|
|
4
4
|
import { Logger, resolveRootLogLevel } from '../utils/logger.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { fromRootOption, packageFilterOptions, readPackageFilterOptions } from '../utils/package-filter.js';
|
|
6
|
+
const COMMAND = 'changelog';
|
|
7
|
+
const config = {
|
|
8
|
+
...packageFilterOptions,
|
|
9
|
+
...fromRootOption('Generate'),
|
|
10
|
+
from: {
|
|
11
|
+
target: 'cli',
|
|
12
|
+
describe: 'Generate the changelog since this commit/hash, applied the same way to every package. ' +
|
|
13
|
+
'Default (also "auto" explicitly): auto-detect per package from its own most recent release ' +
|
|
14
|
+
'tag - same as "version"/"changed" - falling back to the version its own ecosystem\'s ' +
|
|
15
|
+
"registry reports (no tag yet), then to its whole history for a package that's never been " +
|
|
16
|
+
'released at all',
|
|
17
|
+
type: 'string',
|
|
18
|
+
},
|
|
19
|
+
write: {
|
|
20
|
+
target: 'cli',
|
|
21
|
+
describe: "Prepend the entry into each package's own changelog file instead of printing it",
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
/** The one option here that is also a config key - hence `'both'`, and hence this command
|
|
25
|
+
* contributing `changelog.filePath` to `RmanConfig`. */
|
|
26
|
+
filePath: {
|
|
27
|
+
target: 'both',
|
|
28
|
+
cliName: 'file-path',
|
|
29
|
+
describe: "With --write, the file to prepend into, relative to each package's own directory " +
|
|
30
|
+
'(default: "CHANGELOG.md", or .rmanrc "changelog.filePath")',
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
includeSkipped: {
|
|
34
|
+
target: 'cli',
|
|
35
|
+
cliName: 'include-skipped',
|
|
36
|
+
describe: 'Also generate for a package with .rmanrc "publish.skip" - excluded by default',
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
},
|
|
39
|
+
releaseVersion: {
|
|
40
|
+
target: 'cli',
|
|
41
|
+
cliName: 'release-version',
|
|
42
|
+
describe: 'The version these notes are for - what the entry heading shows. Default: read back from ' +
|
|
43
|
+
"each package's own latest release tag, which is only right once that release is tagged. " +
|
|
44
|
+
'Pass it when generating notes ahead of the bump (e.g. from "changed --json" in CI), ' +
|
|
45
|
+
'otherwise the heading shows the previous release.',
|
|
46
|
+
type: 'string',
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Config-only, from here down - `.rmanrc "changelog.*"` keys with no reason to be a flag. All
|
|
50
|
+
* three are plain strings or a string list, so this command needs no `Extra` at all: its whole
|
|
51
|
+
* config block is derived from what is declared here.
|
|
52
|
+
*/
|
|
53
|
+
ignoreTypes: {
|
|
54
|
+
target: 'config',
|
|
55
|
+
describe: 'Conventional-commit types to leave out of the notes entirely (e.g. ["chore", "ci"])',
|
|
56
|
+
type: 'string',
|
|
57
|
+
array: true,
|
|
58
|
+
},
|
|
59
|
+
template: {
|
|
60
|
+
target: 'config',
|
|
61
|
+
describe: "Path to a template file for one package's entry, relative to the repository root. Its own " +
|
|
62
|
+
"{{package}}/{{version}} placeholders are that file's content, not config expressions.",
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
tagPattern: {
|
|
66
|
+
target: 'config',
|
|
67
|
+
describe: "The release tag naming scheme each package's changelog boundary is detected from - " +
|
|
68
|
+
'"{name}" is replaced with the package name (e.g. "{name}@*" for independent versioning). ' +
|
|
69
|
+
'Default "v*", one repo-wide tag resolved through git describe.',
|
|
70
|
+
type: 'string',
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const changelogCommand = registerCommand(app => {
|
|
74
|
+
const repository = app.repository;
|
|
75
|
+
return {
|
|
76
|
+
command: COMMAND,
|
|
10
77
|
describe: 'Generates a changelog per package from unreleased commits',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'released at all',
|
|
20
|
-
type: 'string',
|
|
21
|
-
})
|
|
22
|
-
.option('write', {
|
|
23
|
-
describe: "Prepend the entry into each package's own changelog file instead of printing it",
|
|
24
|
-
type: 'boolean',
|
|
25
|
-
})
|
|
26
|
-
.option('file-path', {
|
|
27
|
-
describe: "With --write, the file to prepend into, relative to each package's own directory " +
|
|
28
|
-
'(default: "CHANGELOG.md", or .rmanrc "changelog.filePath")',
|
|
29
|
-
type: 'string',
|
|
30
|
-
})
|
|
31
|
-
.option('include-skipped', {
|
|
32
|
-
describe: 'Also generate for a package with .rmanrc "publish.skip" - excluded by default',
|
|
33
|
-
type: 'boolean',
|
|
34
|
-
})
|
|
35
|
-
.option('release-version', {
|
|
36
|
-
describe: 'The version these notes are for - what the entry heading shows. Default: read back from ' +
|
|
37
|
-
"each package's own latest release tag, which is only right once that release is tagged. " +
|
|
38
|
-
'Pass it when generating notes ahead of the bump (e.g. from "changed --json" in CI), ' +
|
|
39
|
-
'otherwise the heading shows the previous release.',
|
|
40
|
-
type: 'string',
|
|
41
|
-
}),
|
|
78
|
+
/** Read, not owned: `publish.skip` is `publish`'s key, reused here on purpose - a package that is
|
|
79
|
+
* never distributed gets no release notes either. */
|
|
80
|
+
configKeys: ['publish.skip'],
|
|
81
|
+
config,
|
|
82
|
+
examples: [
|
|
83
|
+
{ command: '$0 changelog', description: "# Auto-detects each package's own last release tag (or npm version)" },
|
|
84
|
+
{ command: '$0 changelog --from <hash> --write', description: '# Since a specific commit, written to file' },
|
|
85
|
+
],
|
|
42
86
|
handler: async (args) => {
|
|
43
87
|
const from = args.from;
|
|
44
88
|
const write = args.write;
|
|
@@ -54,13 +98,12 @@ export function initCli(repository, program) {
|
|
|
54
98
|
...readPackageFilterOptions(args),
|
|
55
99
|
from,
|
|
56
100
|
filePath: args.filePath,
|
|
57
|
-
|
|
101
|
+
fromRoot: args.fromRoot,
|
|
58
102
|
includeSkipped: args.includeSkipped,
|
|
59
103
|
version: args.releaseVersion,
|
|
60
104
|
};
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
: await ChangelogService.getEntries(repository, options);
|
|
105
|
+
const changelog = app.getService('changelog');
|
|
106
|
+
const entries = write ? await changelog.generateToFile(options) : await changelog.getEntries(options);
|
|
64
107
|
if (!entries.length) {
|
|
65
108
|
logger.info(colors.gray('No unreleased changes.'));
|
|
66
109
|
return;
|
|
@@ -72,5 +115,6 @@ export function initCli(repository, program) {
|
|
|
72
115
|
console.log(entry.content);
|
|
73
116
|
}
|
|
74
117
|
},
|
|
75
|
-
}
|
|
76
|
-
}
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
export default changelogCommand;
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type RmanConfig } from '../interfaces/rman-config.interface.js';
|
|
2
|
+
declare const COMMAND: "config";
|
|
3
|
+
declare const config: {
|
|
4
|
+
json: {
|
|
5
|
+
target: "cli";
|
|
6
|
+
describe: string;
|
|
7
|
+
type: "boolean";
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
fromRoot: {
|
|
11
|
+
target: "cli";
|
|
12
|
+
cliName: string;
|
|
13
|
+
alias: string;
|
|
14
|
+
describe: string;
|
|
15
|
+
type: "boolean";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type Args = RmanConfig.ArgsOf<typeof config, typeof COMMAND>;
|
|
19
|
+
/** Prints config; declares none of its own, so it contributes nothing to `RmanConfig`. */
|
|
20
|
+
declare const configCommand: (app: import("../index.js").RmanApplication) => {
|
|
21
|
+
command: "config";
|
|
22
|
+
describe: string;
|
|
23
|
+
config: {
|
|
24
|
+
json: {
|
|
25
|
+
target: "cli";
|
|
26
|
+
describe: string;
|
|
27
|
+
type: "boolean";
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
fromRoot: {
|
|
31
|
+
target: "cli";
|
|
32
|
+
cliName: string;
|
|
33
|
+
alias: string;
|
|
34
|
+
describe: string;
|
|
35
|
+
type: "boolean";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
examples: {
|
|
39
|
+
command: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}[];
|
|
42
|
+
handler: (args: Args) => void;
|
|
43
|
+
};
|
|
44
|
+
export default configCommand;
|
|
@@ -2,23 +2,33 @@ import path from 'node:path';
|
|
|
2
2
|
import colors from 'ansi-colors';
|
|
3
3
|
import * as yaml from 'js-yaml';
|
|
4
4
|
import { DEFERRED_PATHS } from '../core/config.js';
|
|
5
|
-
import {
|
|
5
|
+
import { registerCommand } from '../interfaces/rman-config.interface.js';
|
|
6
|
+
import { fromRootOption, readFromRootOption } from '../utils/package-filter.js';
|
|
6
7
|
import { printableConfig } from '../utils/printable-config.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const COMMAND = 'config';
|
|
9
|
+
const config = {
|
|
10
|
+
...fromRootOption('Print the config for'),
|
|
11
|
+
json: {
|
|
12
|
+
target: 'cli',
|
|
13
|
+
describe: 'Print as JSON instead of YAML - nothing else on stdout, so it can be piped.',
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
/** Prints config; declares none of its own, so it contributes nothing to `RmanConfig`. */
|
|
19
|
+
const configCommand = registerCommand(app => {
|
|
20
|
+
const repository = app.repository;
|
|
21
|
+
return {
|
|
22
|
+
command: COMMAND,
|
|
10
23
|
describe: 'Prints the effective .rmanrc config for the package of the current directory',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}),
|
|
20
|
-
handler: args => {
|
|
21
|
-
const target = (!readRootOption(args) && repository.currentPackage) || repository.rootPackage;
|
|
24
|
+
config,
|
|
25
|
+
examples: [
|
|
26
|
+
{ command: '$0 config', description: '# The config of the package you are standing in' },
|
|
27
|
+
{ command: '$0 config --from-root', description: "# The repository root's own config instead" },
|
|
28
|
+
{ command: '$0 config --json | jq .version', description: '# Machine-readable' },
|
|
29
|
+
],
|
|
30
|
+
handler: (args) => {
|
|
31
|
+
const target = (!readFromRootOption(args) && repository.currentPackage) || repository.rootPackage;
|
|
22
32
|
if (args.json) {
|
|
23
33
|
console.log(JSON.stringify(printableConfig(target.config), undefined, 2));
|
|
24
34
|
return;
|
|
@@ -41,8 +51,9 @@ export function initCli(repository, program) {
|
|
|
41
51
|
* as a mistake in something meant to be looked at. */
|
|
42
52
|
console.log(yaml.dump(printableConfig(target.config), { noRefs: true, lineWidth: 100 }).trimEnd());
|
|
43
53
|
},
|
|
44
|
-
}
|
|
45
|
-
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
export default configCommand;
|
|
46
57
|
/**
|
|
47
58
|
* The one honest caveat about this output: **`version.before`/`.exec`/`.after` are printed raw**,
|
|
48
59
|
* expressions and all, because they are the paths in `DEFERRED_PATHS` - `${{ pkg.targetVersion }}`
|
|
@@ -56,6 +67,6 @@ function deferredNotes(pkg) {
|
|
|
56
67
|
return [];
|
|
57
68
|
return [`${raw.join(', ')}: printed raw - evaluated by "version" itself, once it knows the target version`];
|
|
58
69
|
}
|
|
59
|
-
function valueAt(
|
|
60
|
-
return dotted.split('.').reduce((
|
|
70
|
+
function valueAt(node, dotted) {
|
|
71
|
+
return dotted.split('.').reduce((current, key) => (current == null ? undefined : current[key]), node);
|
|
61
72
|
}
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type RmanConfig } from '../interfaces/rman-config.interface.js';
|
|
2
|
+
declare const COMMAND: "diff [package]";
|
|
3
|
+
declare const config: {
|
|
4
|
+
fromRoot: {
|
|
5
|
+
target: "cli";
|
|
6
|
+
cliName: string;
|
|
7
|
+
alias: string;
|
|
8
|
+
describe: string;
|
|
9
|
+
type: "boolean";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type Args = RmanConfig.ArgsOf<typeof config, typeof COMMAND>;
|
|
13
|
+
declare const diffCommand: (app: import("../index.js").RmanApplication) => {
|
|
14
|
+
command: "diff [package]";
|
|
15
|
+
describe: string;
|
|
16
|
+
config: {
|
|
17
|
+
fromRoot: {
|
|
18
|
+
target: "cli";
|
|
19
|
+
cliName: string;
|
|
20
|
+
alias: string;
|
|
21
|
+
describe: string;
|
|
22
|
+
type: "boolean";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
positionals: {
|
|
26
|
+
package: {
|
|
27
|
+
describe: string;
|
|
28
|
+
type: "string";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
examples: {
|
|
32
|
+
command: string;
|
|
33
|
+
description: string;
|
|
34
|
+
}[];
|
|
35
|
+
handler: (args: Args) => Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
export default diffCommand;
|
package/commands/diff.command.js
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import colors from 'ansi-colors';
|
|
3
|
+
import { registerCommand } from '../interfaces/rman-config.interface.js';
|
|
3
4
|
import { ChangeHashService } from '../services/change-hash.service.js';
|
|
4
5
|
import { GitHelper } from '../utils/git.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { fromRootOption, readFromRootOption } from '../utils/package-filter.js';
|
|
7
|
+
const COMMAND = 'diff [package]';
|
|
8
|
+
const config = fromRootOption('Diff');
|
|
9
|
+
const diffCommand = registerCommand(app => {
|
|
10
|
+
const repository = app.repository;
|
|
11
|
+
return {
|
|
12
|
+
command: COMMAND,
|
|
9
13
|
describe: "Shows the git diff since a package's (or the whole repository's) last release tag",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
config,
|
|
15
|
+
positionals: {
|
|
16
|
+
package: {
|
|
17
|
+
describe: 'Package name - diffs just that package, since its own last tag. Omit to diff the whole ' +
|
|
18
|
+
"repository since its own last tag (or the current directory's package, if standing inside one).",
|
|
19
|
+
type: 'string',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
examples: [
|
|
23
|
+
{ command: '$0 diff', description: "# Since the repository's own last tag" },
|
|
24
|
+
{ command: '$0 diff pkg-a', description: "# Since pkg-a's own last tag, scoped to its directory" },
|
|
25
|
+
{ command: '$0 diff --from-root', description: '# The whole repository, from inside a package' },
|
|
26
|
+
],
|
|
19
27
|
handler: async (args) => {
|
|
20
28
|
const git = new GitHelper({ cwd: repository.dirname });
|
|
21
29
|
const packageName = args.package;
|
|
@@ -33,7 +41,7 @@ export function initCli(repository, program) {
|
|
|
33
41
|
target = pkg;
|
|
34
42
|
pathspec = path.relative(repository.dirname, pkg.dirname);
|
|
35
43
|
}
|
|
36
|
-
else if (!
|
|
44
|
+
else if (!readFromRootOption(args) && repository.currentPackage) {
|
|
37
45
|
/** The measured gap this closes: `diff` narrowed to the current package like `run` and
|
|
38
46
|
* `changelog` do, but offered no way to say "the whole repository" without naming a
|
|
39
47
|
* package - and no package name means the repository, so there was nothing to type. */
|
|
@@ -52,5 +60,6 @@ export function initCli(repository, program) {
|
|
|
52
60
|
}
|
|
53
61
|
console.log(text);
|
|
54
62
|
},
|
|
55
|
-
}
|
|
56
|
-
}
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
export default diffCommand;
|
|
@@ -1,3 +1,193 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type RmanConfig } from '../interfaces/rman-config.interface.js';
|
|
2
|
+
declare const COMMAND: "exec [command..]";
|
|
3
|
+
/**
|
|
4
|
+
* `runOptions` with three texts replaced - the override case the spread order exists for.
|
|
5
|
+
*
|
|
6
|
+
* `exec` takes the same scheduling flags as `run`, but not the same *explanations*: `run`'s mention
|
|
7
|
+
* `.rmanrc run.<script>.bail` and friends, and `exec` runs no script, so there is no such block to
|
|
8
|
+
* point at. The declarations are shared; only the sentences that would be untrue differ.
|
|
9
|
+
*/
|
|
10
|
+
declare const config: {
|
|
11
|
+
bail: {
|
|
12
|
+
target: "cli";
|
|
13
|
+
describe: string;
|
|
14
|
+
type: "boolean";
|
|
15
|
+
};
|
|
16
|
+
topo: {
|
|
17
|
+
target: "cli";
|
|
18
|
+
describe: string;
|
|
19
|
+
type: "boolean";
|
|
20
|
+
};
|
|
21
|
+
progress: {
|
|
22
|
+
target: "cli";
|
|
23
|
+
describe: string;
|
|
24
|
+
type: "boolean";
|
|
25
|
+
};
|
|
26
|
+
parallel: {
|
|
27
|
+
target: "cli";
|
|
28
|
+
describe: string;
|
|
29
|
+
coerce: (v: unknown) => boolean | number | undefined;
|
|
30
|
+
};
|
|
31
|
+
changed: {
|
|
32
|
+
target: "cli";
|
|
33
|
+
alias: string;
|
|
34
|
+
describe: string;
|
|
35
|
+
type: "boolean";
|
|
36
|
+
};
|
|
37
|
+
changedSince: {
|
|
38
|
+
target: "cli";
|
|
39
|
+
cliName: string;
|
|
40
|
+
describe: string;
|
|
41
|
+
type: "string";
|
|
42
|
+
conflicts: string;
|
|
43
|
+
};
|
|
44
|
+
fromRoot: {
|
|
45
|
+
target: "cli";
|
|
46
|
+
cliName: string;
|
|
47
|
+
alias: string;
|
|
48
|
+
describe: string;
|
|
49
|
+
type: "boolean";
|
|
50
|
+
};
|
|
51
|
+
allowBranch: {
|
|
52
|
+
target: "cli";
|
|
53
|
+
cliName: string;
|
|
54
|
+
describe: string;
|
|
55
|
+
type: "string";
|
|
56
|
+
};
|
|
57
|
+
ignoreBranch: {
|
|
58
|
+
target: "cli";
|
|
59
|
+
cliName: string;
|
|
60
|
+
describe: string;
|
|
61
|
+
type: "string";
|
|
62
|
+
};
|
|
63
|
+
scope: {
|
|
64
|
+
target: "cli";
|
|
65
|
+
describe: string;
|
|
66
|
+
type: "string";
|
|
67
|
+
};
|
|
68
|
+
ignore: {
|
|
69
|
+
target: "cli";
|
|
70
|
+
describe: string;
|
|
71
|
+
type: "string";
|
|
72
|
+
};
|
|
73
|
+
platform: {
|
|
74
|
+
target: "cli";
|
|
75
|
+
describe: string;
|
|
76
|
+
type: "string";
|
|
77
|
+
};
|
|
78
|
+
deps: {
|
|
79
|
+
target: "cli";
|
|
80
|
+
describe: string;
|
|
81
|
+
type: "boolean";
|
|
82
|
+
};
|
|
83
|
+
dependents: {
|
|
84
|
+
target: "cli";
|
|
85
|
+
describe: string;
|
|
86
|
+
type: "boolean";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
type Args = RmanConfig.ArgsOf<typeof config, typeof COMMAND>;
|
|
90
|
+
declare const execCommand: (app: import("../index.js").RmanApplication) => {
|
|
91
|
+
command: "exec [command..]";
|
|
92
|
+
describe: string;
|
|
93
|
+
/**
|
|
94
|
+
* The two parser switches this command cannot work without: `populate--` keeps everything after
|
|
95
|
+
* `--` out of `exec`'s own options, and `unknown-options-as-args` passes the flags of the command
|
|
96
|
+
* being run through untouched.
|
|
97
|
+
*/
|
|
98
|
+
parserConfiguration: {
|
|
99
|
+
'populate--': true;
|
|
100
|
+
'unknown-options-as-args': true;
|
|
101
|
+
};
|
|
102
|
+
config: {
|
|
103
|
+
bail: {
|
|
104
|
+
target: "cli";
|
|
105
|
+
describe: string;
|
|
106
|
+
type: "boolean";
|
|
107
|
+
};
|
|
108
|
+
topo: {
|
|
109
|
+
target: "cli";
|
|
110
|
+
describe: string;
|
|
111
|
+
type: "boolean";
|
|
112
|
+
};
|
|
113
|
+
progress: {
|
|
114
|
+
target: "cli";
|
|
115
|
+
describe: string;
|
|
116
|
+
type: "boolean";
|
|
117
|
+
};
|
|
118
|
+
parallel: {
|
|
119
|
+
target: "cli";
|
|
120
|
+
describe: string;
|
|
121
|
+
coerce: (v: unknown) => boolean | number | undefined;
|
|
122
|
+
};
|
|
123
|
+
changed: {
|
|
124
|
+
target: "cli";
|
|
125
|
+
alias: string;
|
|
126
|
+
describe: string;
|
|
127
|
+
type: "boolean";
|
|
128
|
+
};
|
|
129
|
+
changedSince: {
|
|
130
|
+
target: "cli";
|
|
131
|
+
cliName: string;
|
|
132
|
+
describe: string;
|
|
133
|
+
type: "string";
|
|
134
|
+
conflicts: string;
|
|
135
|
+
};
|
|
136
|
+
fromRoot: {
|
|
137
|
+
target: "cli";
|
|
138
|
+
cliName: string;
|
|
139
|
+
alias: string;
|
|
140
|
+
describe: string;
|
|
141
|
+
type: "boolean";
|
|
142
|
+
};
|
|
143
|
+
allowBranch: {
|
|
144
|
+
target: "cli";
|
|
145
|
+
cliName: string;
|
|
146
|
+
describe: string;
|
|
147
|
+
type: "string";
|
|
148
|
+
};
|
|
149
|
+
ignoreBranch: {
|
|
150
|
+
target: "cli";
|
|
151
|
+
cliName: string;
|
|
152
|
+
describe: string;
|
|
153
|
+
type: "string";
|
|
154
|
+
};
|
|
155
|
+
scope: {
|
|
156
|
+
target: "cli";
|
|
157
|
+
describe: string;
|
|
158
|
+
type: "string";
|
|
159
|
+
};
|
|
160
|
+
ignore: {
|
|
161
|
+
target: "cli";
|
|
162
|
+
describe: string;
|
|
163
|
+
type: "string";
|
|
164
|
+
};
|
|
165
|
+
platform: {
|
|
166
|
+
target: "cli";
|
|
167
|
+
describe: string;
|
|
168
|
+
type: "string";
|
|
169
|
+
};
|
|
170
|
+
deps: {
|
|
171
|
+
target: "cli";
|
|
172
|
+
describe: string;
|
|
173
|
+
type: "boolean";
|
|
174
|
+
};
|
|
175
|
+
dependents: {
|
|
176
|
+
target: "cli";
|
|
177
|
+
describe: string;
|
|
178
|
+
type: "boolean";
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
positionals: {
|
|
182
|
+
command: {
|
|
183
|
+
describe: string;
|
|
184
|
+
type: "string";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
examples: {
|
|
188
|
+
command: string;
|
|
189
|
+
description: string;
|
|
190
|
+
}[];
|
|
191
|
+
handler: (args: Args) => Promise<void>;
|
|
192
|
+
};
|
|
193
|
+
export default execCommand;
|