rman 0.17.0 → 0.18.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/cjs/cli.js +27 -26
- package/cjs/commands/build-command.js +4 -4
- package/cjs/commands/changed-command.js +5 -5
- package/cjs/commands/ci-command.js +9 -9
- package/cjs/commands/execute-command.js +8 -8
- package/cjs/commands/info-command.js +3 -3
- package/cjs/commands/list-command.js +7 -6
- package/cjs/commands/multi-task-command.js +4 -4
- package/cjs/commands/publish-command.js +7 -7
- package/cjs/commands/run-command.js +8 -8
- package/cjs/commands/version-command.js +10 -10
- package/cjs/core/command.js +8 -8
- package/cjs/core/constants.js +2 -2
- package/cjs/core/repository.js +7 -7
- package/cjs/index.js +1 -1
- package/cjs/utils/exec.js +2 -2
- package/cjs/utils/get-dirname.js +1 -3
- package/cjs/utils/git-utils.js +5 -5
- package/cjs/utils/npm-run-path.js +1 -1
- package/cjs/utils/npm-utils.js +2 -2
- package/esm/cli.js +15 -14
- package/esm/commands/build-command.d.ts +2 -2
- package/esm/commands/build-command.js +2 -2
- package/esm/commands/changed-command.d.ts +3 -3
- package/esm/commands/changed-command.js +2 -2
- package/esm/commands/ci-command.d.ts +5 -5
- package/esm/commands/ci-command.js +4 -4
- package/esm/commands/execute-command.d.ts +4 -4
- package/esm/commands/execute-command.js +4 -4
- package/esm/commands/info-command.d.ts +2 -2
- package/esm/commands/info-command.js +1 -1
- package/esm/commands/list-command.d.ts +4 -4
- package/esm/commands/list-command.js +4 -3
- package/esm/commands/multi-task-command.d.ts +4 -4
- package/esm/commands/multi-task-command.js +2 -2
- package/esm/commands/publish-command.d.ts +5 -5
- package/esm/commands/publish-command.js +3 -3
- package/esm/commands/run-command.d.ts +5 -5
- package/esm/commands/run-command.js +4 -4
- package/esm/commands/version-command.d.ts +5 -5
- package/esm/commands/version-command.js +7 -7
- package/esm/core/command.d.ts +1 -1
- package/esm/core/command.js +6 -6
- package/esm/core/constants.d.ts +0 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/repository.d.ts +1 -1
- package/esm/core/repository.js +4 -4
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/exec.js +1 -1
- package/esm/utils/get-dirname.js +1 -3
- package/esm/utils/git-utils.js +1 -1
- package/esm/utils/npm-run-path.js +1 -1
- package/esm/utils/npm-utils.js +1 -1
- package/package.json +4 -4
- package/cjs/core/types.js +0 -2
- package/cjs/debug.js +0 -5
- package/esm/core/types.d.ts +0 -14
- package/esm/core/types.js +0 -1
- package/esm/debug.d.ts +0 -1
- package/esm/debug.js +0 -3
package/cjs/cli.js
CHANGED
|
@@ -4,30 +4,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.runCli = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
-
const yargs_1 = __importDefault(require("yargs"));
|
|
10
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
11
9
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
12
|
+
const build_command_js_1 = require("./commands/build-command.js");
|
|
13
|
+
const changed_command_js_1 = require("./commands/changed-command.js");
|
|
14
|
+
const ci_command_js_1 = require("./commands/ci-command.js");
|
|
15
|
+
const execute_command_js_1 = require("./commands/execute-command.js");
|
|
16
|
+
const info_command_js_1 = require("./commands/info-command.js");
|
|
17
|
+
const list_command_js_1 = require("./commands/list-command.js");
|
|
18
|
+
const publish_command_js_1 = require("./commands/publish-command.js");
|
|
19
|
+
const run_command_js_1 = require("./commands/run-command.js");
|
|
20
|
+
const version_command_js_1 = require("./commands/version-command.js");
|
|
21
|
+
const command_js_1 = require("./core/command.js");
|
|
22
|
+
const repository_js_1 = require("./core/repository.js");
|
|
12
23
|
const get_dirname_js_1 = require("./utils/get-dirname.js");
|
|
13
|
-
const repository_1 = require("./core/repository");
|
|
14
|
-
const info_command_1 = require("./commands/info-command");
|
|
15
|
-
const command_1 = require("./core/command");
|
|
16
|
-
const list_command_1 = require("./commands/list-command");
|
|
17
|
-
const changed_command_1 = require("./commands/changed-command");
|
|
18
|
-
const execute_command_1 = require("./commands/execute-command");
|
|
19
|
-
const run_command_1 = require("./commands/run-command");
|
|
20
|
-
const version_command_1 = require("./commands/version-command");
|
|
21
|
-
const publish_command_1 = require("./commands/publish-command");
|
|
22
|
-
const ci_command_1 = require("./commands/ci-command");
|
|
23
|
-
const build_command_1 = require("./commands/build-command");
|
|
24
24
|
async function runCli(options) {
|
|
25
25
|
try {
|
|
26
26
|
const s = path_1.default.resolve((0, get_dirname_js_1.getDirname)(), '../package.json');
|
|
27
27
|
const pkgJson = JSON.parse(await promises_1.default.readFile(s, 'utf-8'));
|
|
28
|
-
const repository =
|
|
28
|
+
const repository = repository_js_1.Repository.create(options?.cwd);
|
|
29
29
|
const _argv = options?.argv || process.argv.slice(2);
|
|
30
|
-
const globalKeys = Object.keys(
|
|
30
|
+
const globalKeys = Object.keys(command_js_1.Command.globalOptions).concat(["help", "version"]);
|
|
31
31
|
const program = (0, yargs_1.default)(_argv)
|
|
32
32
|
// .scriptName('rman')
|
|
33
33
|
.strict()
|
|
@@ -39,21 +39,22 @@ async function runCli(options) {
|
|
|
39
39
|
const text = (msg
|
|
40
40
|
? msg + '\n\n' + chalk_1.default.whiteBright('Run with --help for available options')
|
|
41
41
|
: (err ? err.message : ''));
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
42
43
|
console.log('\n' + chalk_1.default.red(text));
|
|
43
44
|
throw msg;
|
|
44
45
|
})
|
|
45
46
|
// group options under "Global Options:" header
|
|
46
|
-
.options(
|
|
47
|
+
.options(command_js_1.Command.globalOptions)
|
|
47
48
|
.group(globalKeys, "Global Options:");
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
info_command_js_1.InfoCommand.initCli(repository, program);
|
|
50
|
+
list_command_js_1.ListCommand.initCli(repository, program);
|
|
51
|
+
changed_command_js_1.ChangedCommand.initCli(repository, program);
|
|
52
|
+
execute_command_js_1.ExecuteCommand.initCli(repository, program);
|
|
53
|
+
run_command_js_1.RunCommand.initCli(repository, program);
|
|
54
|
+
version_command_js_1.VersionCommand.initCli(repository, program);
|
|
55
|
+
publish_command_js_1.PublishCommand.initCli(repository, program);
|
|
56
|
+
ci_command_js_1.CleanInstallCommand.initCli(repository, program);
|
|
57
|
+
build_command_js_1.BuildCommand.initCli(repository, program);
|
|
57
58
|
if (!_argv.length)
|
|
58
59
|
program.showHelp();
|
|
59
60
|
else
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BuildCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
class BuildCommand extends
|
|
4
|
+
const command_js_1 = require("../core/command.js");
|
|
5
|
+
const run_command_js_1 = require("./run-command.js");
|
|
6
|
+
class BuildCommand extends run_command_js_1.RunCommand {
|
|
7
7
|
constructor(repository, options) {
|
|
8
8
|
super(repository, 'build', options);
|
|
9
9
|
this.repository = repository;
|
|
@@ -22,7 +22,7 @@ BuildCommand.commandName = 'build';
|
|
|
22
22
|
.option(BuildCommand.cliCommandOptions);
|
|
23
23
|
},
|
|
24
24
|
handler: async (args) => {
|
|
25
|
-
const options =
|
|
25
|
+
const options = command_js_1.Command.composeOptions(BuildCommand.commandName, args, repository.config);
|
|
26
26
|
await new BuildCommand(repository, options)
|
|
27
27
|
.execute();
|
|
28
28
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChangedCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
class ChangedCommand extends
|
|
4
|
+
const command_js_1 = require("../core/command.js");
|
|
5
|
+
const list_command_js_1 = require("./list-command.js");
|
|
6
|
+
class ChangedCommand extends list_command_js_1.ListCommand {
|
|
7
7
|
constructor(repository, options) {
|
|
8
8
|
super(repository, options);
|
|
9
9
|
this.repository = repository;
|
|
@@ -25,10 +25,10 @@ ChangedCommand.commandName = 'changed';
|
|
|
25
25
|
return cmd
|
|
26
26
|
.example("$0 changed", "# List changed packages")
|
|
27
27
|
.example('$0 changed --json', '# List changed packages in JSON format')
|
|
28
|
-
.option(
|
|
28
|
+
.option(list_command_js_1.ListCommand.cliCommandOptions);
|
|
29
29
|
},
|
|
30
30
|
handler: async (args) => {
|
|
31
|
-
const options =
|
|
31
|
+
const options = command_js_1.Command.composeOptions(ChangedCommand.commandName, args, repository.config);
|
|
32
32
|
await new ChangedCommand(repository, options)
|
|
33
33
|
.execute();
|
|
34
34
|
}
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CleanInstallCommand = void 0;
|
|
7
|
-
const power_tasks_1 = require("power-tasks");
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
8
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
10
|
-
const command_1 = require("../core/command");
|
|
11
|
-
const run_command_1 = require("./run-command");
|
|
12
|
-
const file_utils_1 = require("../utils/file-utils");
|
|
13
9
|
const path_1 = __importDefault(require("path"));
|
|
14
|
-
|
|
10
|
+
const power_tasks_1 = require("power-tasks");
|
|
11
|
+
const command_js_1 = require("../core/command.js");
|
|
12
|
+
const file_utils_js_1 = require("../utils/file-utils.js");
|
|
13
|
+
const run_command_js_1 = require("./run-command.js");
|
|
14
|
+
class CleanInstallCommand extends run_command_js_1.RunCommand {
|
|
15
15
|
constructor(repository, options) {
|
|
16
16
|
super(repository, 'clean_', options);
|
|
17
17
|
this.repository = repository;
|
|
@@ -50,9 +50,9 @@ class CleanInstallCommand extends run_command_1.RunCommand {
|
|
|
50
50
|
return super._exec(args, ctx);
|
|
51
51
|
}
|
|
52
52
|
async _fsDelete(fileOrDir) {
|
|
53
|
-
if (await (0,
|
|
53
|
+
if (await (0, file_utils_js_1.fsExists)(fileOrDir)) {
|
|
54
54
|
npmlog_1.default.info(this.commandName, chalk_1.default.yellow('clean'), 'Deleting ' + path_1.default.relative(this.repository.dirname, fileOrDir));
|
|
55
|
-
await (0,
|
|
55
|
+
await (0, file_utils_js_1.fsDelete)(fileOrDir);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -60,7 +60,7 @@ exports.CleanInstallCommand = CleanInstallCommand;
|
|
|
60
60
|
CleanInstallCommand.commandName = 'ci';
|
|
61
61
|
(function (CleanInstallCommand) {
|
|
62
62
|
CleanInstallCommand.cliCommandOptions = {
|
|
63
|
-
...
|
|
63
|
+
...run_command_js_1.RunCommand.cliCommandOptions
|
|
64
64
|
};
|
|
65
65
|
function initCli(repository, program) {
|
|
66
66
|
program.command({
|
|
@@ -72,7 +72,7 @@ CleanInstallCommand.commandName = 'ci';
|
|
|
72
72
|
.option(CleanInstallCommand.cliCommandOptions);
|
|
73
73
|
},
|
|
74
74
|
handler: async (args) => {
|
|
75
|
-
const options =
|
|
75
|
+
const options = command_js_1.Command.composeOptions(CleanInstallCommand.commandName, args, repository.config);
|
|
76
76
|
await new CleanInstallCommand(repository, options).execute();
|
|
77
77
|
}
|
|
78
78
|
});
|
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ExecuteCommand = void 0;
|
|
7
|
-
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
10
9
|
const power_tasks_1 = require("power-tasks");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
const command_js_1 = require("../core/command.js");
|
|
11
|
+
const exec_js_1 = require("../utils/exec.js");
|
|
12
|
+
const multi_task_command_js_1 = require("./multi-task-command.js");
|
|
13
|
+
class ExecuteCommand extends multi_task_command_js_1.MultiTaskCommand {
|
|
14
14
|
constructor(repository, cmd, argv, options) {
|
|
15
15
|
super(repository, options);
|
|
16
16
|
this.repository = repository;
|
|
@@ -23,7 +23,7 @@ class ExecuteCommand extends multi_task_command_1.MultiTaskCommand {
|
|
|
23
23
|
const task = new power_tasks_1.Task(async () => {
|
|
24
24
|
const t = Date.now();
|
|
25
25
|
npmlog_1.default.verbose(this.commandName, p.name, chalk_1.default.cyanBright.bold('executing'), npmlog_1.default.separator, this.cmd + ' ' + (this.argv?.join(' ') || ''));
|
|
26
|
-
const r = await (0,
|
|
26
|
+
const r = await (0, exec_js_1.exec)(this.cmd, {
|
|
27
27
|
cwd: p.dirname,
|
|
28
28
|
argv: this.argv,
|
|
29
29
|
stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe'
|
|
@@ -44,7 +44,7 @@ exports.ExecuteCommand = ExecuteCommand;
|
|
|
44
44
|
ExecuteCommand.commandName = 'exec';
|
|
45
45
|
(function (ExecuteCommand) {
|
|
46
46
|
ExecuteCommand.cliCommandOptions = {
|
|
47
|
-
...
|
|
47
|
+
...multi_task_command_js_1.MultiTaskCommand.cliCommandOptions
|
|
48
48
|
};
|
|
49
49
|
function initCli(repository, program) {
|
|
50
50
|
program.command({
|
|
@@ -69,7 +69,7 @@ ExecuteCommand.commandName = 'exec';
|
|
|
69
69
|
},
|
|
70
70
|
handler: async (args) => {
|
|
71
71
|
const argv = args['--'] || [];
|
|
72
|
-
const options =
|
|
72
|
+
const options = command_js_1.Command.composeOptions(ExecuteCommand.commandName, args, repository.config);
|
|
73
73
|
await new ExecuteCommand(repository, '' + argv.shift(), argv, options).execute();
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -7,8 +7,8 @@ exports.InfoCommand = void 0;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const envinfo_1 = __importDefault(require("envinfo"));
|
|
9
9
|
const semver_1 = __importDefault(require("semver"));
|
|
10
|
-
const
|
|
11
|
-
class InfoCommand extends
|
|
10
|
+
const command_js_1 = require("../core/command.js");
|
|
11
|
+
class InfoCommand extends command_js_1.Command {
|
|
12
12
|
async _execute() {
|
|
13
13
|
const systemInfo = JSON.parse(await envinfo_1.default.run({
|
|
14
14
|
System: ['OS', 'CPU', 'Memory', 'Shell'],
|
|
@@ -56,7 +56,7 @@ InfoCommand.commandName = 'info';
|
|
|
56
56
|
.example('$0 info --json', '# Prints information in JSON format');
|
|
57
57
|
},
|
|
58
58
|
handler: async (args) => {
|
|
59
|
-
const options =
|
|
59
|
+
const options = command_js_1.Command.composeOptions(InfoCommand.commandName, args, repository.config);
|
|
60
60
|
await new InfoCommand(options)
|
|
61
61
|
.execute();
|
|
62
62
|
}
|
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ListCommand = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
8
|
const easy_table_1 = __importDefault(require("easy-table"));
|
|
10
9
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const command_js_1 = require("../core/command.js");
|
|
12
|
+
const git_utils_js_1 = require("../utils/git-utils.js");
|
|
13
|
+
class ListCommand extends command_js_1.Command {
|
|
14
14
|
constructor(repository, options) {
|
|
15
15
|
super(options);
|
|
16
16
|
this.repository = repository;
|
|
@@ -22,7 +22,7 @@ class ListCommand extends command_1.Command {
|
|
|
22
22
|
async _execute() {
|
|
23
23
|
const { repository } = this;
|
|
24
24
|
const packages = repository.getPackages({ toposort: this.options.toposort });
|
|
25
|
-
const git = new
|
|
25
|
+
const git = new git_utils_js_1.GitHelper({ cwd: repository.dirname });
|
|
26
26
|
const dirtyFiles = await git.listDirtyFiles({ absolute: true });
|
|
27
27
|
const committedFiles = await git.listCommittedFiles({ absolute: true });
|
|
28
28
|
const table = new easy_table_1.default();
|
|
@@ -89,6 +89,7 @@ class ListCommand extends command_1.Command {
|
|
|
89
89
|
}
|
|
90
90
|
else if (table.rows.length) {
|
|
91
91
|
npmlog_1.default.output('', '%s', table.toString().trim());
|
|
92
|
+
// eslint-disable-next-line no-console
|
|
92
93
|
console.log('');
|
|
93
94
|
npmlog_1.default.info('list', '%i Package(s) found', count);
|
|
94
95
|
return arr;
|
|
@@ -131,7 +132,7 @@ ListCommand.commandName = 'list';
|
|
|
131
132
|
.option(ListCommand.cliCommandOptions);
|
|
132
133
|
},
|
|
133
134
|
handler: async (args) => {
|
|
134
|
-
const options =
|
|
135
|
+
const options = command_js_1.Command.composeOptions(ListCommand.commandName, args, repository.config);
|
|
135
136
|
await new ListCommand(repository, options)
|
|
136
137
|
.execute();
|
|
137
138
|
}
|
|
@@ -7,13 +7,13 @@ exports.MultiTaskCommand = void 0;
|
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const power_tasks_1 = require("power-tasks");
|
|
9
9
|
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
class MultiTaskCommand extends
|
|
10
|
+
const command_js_1 = require("../core/command.js");
|
|
11
|
+
const constants_js_1 = require("../core/constants.js");
|
|
12
|
+
class MultiTaskCommand extends command_js_1.Command {
|
|
13
13
|
constructor(repository, options) {
|
|
14
14
|
super(options);
|
|
15
15
|
this.repository = repository;
|
|
16
|
-
if (this.options.ci || !
|
|
16
|
+
if (this.options.ci || !constants_js_1.isTTY)
|
|
17
17
|
this.options.progress = false;
|
|
18
18
|
// noinspection SuspiciousTypeOfGuard
|
|
19
19
|
this.options.concurrency = (0, putil_varhelpers_1.toNumber)(options?.concurrency);
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PublishCommand = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
-
const command_1 = require("../core/command");
|
|
10
|
-
const run_command_1 = require("./run-command");
|
|
11
9
|
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
const command_js_1 = require("../core/command.js");
|
|
11
|
+
const npm_utils_js_1 = require("../utils/npm-utils.js");
|
|
12
|
+
const run_command_js_1 = require("./run-command.js");
|
|
13
|
+
class PublishCommand extends run_command_js_1.RunCommand {
|
|
14
14
|
constructor(repository, options) {
|
|
15
15
|
super(repository, 'publish', {
|
|
16
16
|
...options,
|
|
@@ -30,7 +30,7 @@ class PublishCommand extends run_command_1.RunCommand {
|
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
32
|
npmlog_1.default.info(this.commandName, logPkgName, npmlog_1.default.separator, `Fetching package information from repository`);
|
|
33
|
-
const npmHelper = new
|
|
33
|
+
const npmHelper = new npm_utils_js_1.NpmHelper({ cwd: p.dirname });
|
|
34
34
|
promises.push(npmHelper.getPackageInfo(p.json.name)
|
|
35
35
|
.then(r => {
|
|
36
36
|
const sameVersion = !!(r && r.version === p.version);
|
|
@@ -80,7 +80,7 @@ exports.PublishCommand = PublishCommand;
|
|
|
80
80
|
PublishCommand.commandName = 'publish';
|
|
81
81
|
(function (PublishCommand) {
|
|
82
82
|
PublishCommand.cliCommandOptions = {
|
|
83
|
-
...
|
|
83
|
+
...run_command_js_1.RunCommand.cliCommandOptions,
|
|
84
84
|
'contents': {
|
|
85
85
|
describe: '# Subdirectory to publish',
|
|
86
86
|
type: 'string'
|
|
@@ -108,7 +108,7 @@ PublishCommand.commandName = 'publish';
|
|
|
108
108
|
.option(PublishCommand.cliCommandOptions);
|
|
109
109
|
},
|
|
110
110
|
handler: async (args) => {
|
|
111
|
-
const options =
|
|
111
|
+
const options = command_js_1.Command.composeOptions(PublishCommand.commandName, args, repository.config);
|
|
112
112
|
await new PublishCommand(repository, options).execute();
|
|
113
113
|
}
|
|
114
114
|
});
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RunCommand = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
7
8
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
9
|
const power_tasks_1 = require("power-tasks");
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const parse_npm_script_1 = __importDefault(require("@netlify/parse-npm-script"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
class RunCommand extends
|
|
11
|
+
const command_js_1 = require("../core/command.js");
|
|
12
|
+
const exec_js_1 = require("../utils/exec.js");
|
|
13
|
+
const multi_task_command_js_1 = require("./multi-task-command.js");
|
|
14
|
+
class RunCommand extends multi_task_command_js_1.MultiTaskCommand {
|
|
15
15
|
constructor(repository, script, options) {
|
|
16
16
|
super(repository, options);
|
|
17
17
|
this.repository = repository;
|
|
@@ -93,7 +93,7 @@ class RunCommand extends multi_task_command_1.MultiTaskCommand {
|
|
|
93
93
|
if (logLevel)
|
|
94
94
|
npmlog_1.default.verbose(this.commandName, chalk_1.default.cyan(args.name), chalk_1.default.cyanBright.bold('executing'), npmlog_1.default.separator, args.command);
|
|
95
95
|
const t = Date.now();
|
|
96
|
-
const r = await (0,
|
|
96
|
+
const r = await (0, exec_js_1.exec)(args.command, { cwd: args.cwd, stdio: args.stdio, throwOnError: false });
|
|
97
97
|
if (logLevel)
|
|
98
98
|
if (r.error) {
|
|
99
99
|
npmlog_1.default.error(this.commandName, chalk_1.default.cyan(args.name), chalk_1.default.red.bold('failed'), npmlog_1.default.separator, args.command, npmlog_1.default.separator, r.error.message.trim() + ('\n' + r.stdout).trim());
|
|
@@ -109,7 +109,7 @@ exports.RunCommand = RunCommand;
|
|
|
109
109
|
RunCommand.commandName = 'run';
|
|
110
110
|
(function (RunCommand) {
|
|
111
111
|
RunCommand.cliCommandOptions = {
|
|
112
|
-
...
|
|
112
|
+
...multi_task_command_js_1.MultiTaskCommand.cliCommandOptions
|
|
113
113
|
};
|
|
114
114
|
function initCli(repository, program) {
|
|
115
115
|
program.command({
|
|
@@ -133,7 +133,7 @@ RunCommand.commandName = 'run';
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
const options =
|
|
136
|
+
const options = command_js_1.Command.composeOptions(RunCommand.commandName, args, repository.config);
|
|
137
137
|
const script = '' + args.script;
|
|
138
138
|
await new RunCommand(repository, script, options).execute();
|
|
139
139
|
}
|
|
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.VersionCommand = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const
|
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
10
9
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
11
|
-
const
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
12
11
|
const power_tasks_1 = require("power-tasks");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
12
|
+
const semver_1 = __importDefault(require("semver"));
|
|
13
|
+
const strip_color_1 = __importDefault(require("strip-color"));
|
|
14
|
+
const command_js_1 = require("../core/command.js");
|
|
15
|
+
const git_utils_js_1 = require("../utils/git-utils.js");
|
|
16
|
+
const run_command_js_1 = require("./run-command.js");
|
|
17
|
+
class VersionCommand extends run_command_js_1.RunCommand {
|
|
18
18
|
constructor(repository, bump, options) {
|
|
19
19
|
super(repository, 'version', options);
|
|
20
20
|
this.repository = repository;
|
|
@@ -22,7 +22,7 @@ class VersionCommand extends run_command_1.RunCommand {
|
|
|
22
22
|
}
|
|
23
23
|
async _prepareTasks(packages) {
|
|
24
24
|
const { repository } = this;
|
|
25
|
-
const git = new
|
|
25
|
+
const git = new git_utils_js_1.GitHelper({ cwd: repository.dirname });
|
|
26
26
|
const dirtyFiles = await git.listDirtyFiles();
|
|
27
27
|
const committedFiles = await git.listCommittedFiles();
|
|
28
28
|
const newVersions = {};
|
|
@@ -162,7 +162,7 @@ VersionCommand.commandName = 'version';
|
|
|
162
162
|
},
|
|
163
163
|
handler: async (args) => {
|
|
164
164
|
const bump = args.bump;
|
|
165
|
-
const options =
|
|
165
|
+
const options = command_js_1.Command.composeOptions(VersionCommand.commandName, args, repository.config);
|
|
166
166
|
await new VersionCommand(repository, bump, options).execute();
|
|
167
167
|
}
|
|
168
168
|
});
|
package/cjs/core/command.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Command = void 0;
|
|
7
|
-
|
|
8
|
-
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
-
const is_ci_1 = __importDefault(require("is-ci"));
|
|
10
|
-
const putil_merge_1 = __importDefault(require("putil-merge"));
|
|
11
|
-
require("./logger");
|
|
12
|
-
const constants_1 = require("./constants");
|
|
7
|
+
require("./logger.js");
|
|
13
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
14
9
|
const figures_1 = __importDefault(require("figures"));
|
|
10
|
+
const is_ci_1 = __importDefault(require("is-ci"));
|
|
11
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
12
|
+
const putil_merge_1 = __importDefault(require("putil-merge"));
|
|
13
|
+
const strict_typed_events_1 = require("strict-typed-events");
|
|
14
|
+
const constants_js_1 = require("./constants.js");
|
|
15
15
|
const noOp = () => void (0);
|
|
16
16
|
class Command extends (0, strict_typed_events_1.TypedEventEmitterClass)(strict_typed_events_1.AsyncEventEmitter) {
|
|
17
17
|
constructor(options) {
|
|
@@ -48,7 +48,7 @@ class Command extends (0, strict_typed_events_1.TypedEventEmitterClass)(strict_t
|
|
|
48
48
|
try {
|
|
49
49
|
this.logger.level = this.options.logLevel ||
|
|
50
50
|
(this.options.ci ? 'error' : 'info');
|
|
51
|
-
if (this.options.ci || !
|
|
51
|
+
if (this.options.ci || !constants_js_1.isTTY) {
|
|
52
52
|
this.logger.disableColor();
|
|
53
53
|
this.logger.disableUnicode();
|
|
54
54
|
}
|
|
@@ -80,7 +80,7 @@ class Command extends (0, strict_typed_events_1.TypedEventEmitterClass)(strict_t
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
async enableProgress() {
|
|
83
|
-
if (this.options.ci || !
|
|
83
|
+
if (this.options.ci || !constants_js_1.isTTY || (this._screen && this._screen.visible))
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
disableProgress() {
|
package/cjs/core/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTTY =
|
|
4
|
-
|
|
3
|
+
exports.isTTY = void 0;
|
|
4
|
+
// export const DOTS = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
5
5
|
exports.isTTY = process.stdout.isTTY && process.env.TERM !== 'dumb';
|
package/cjs/core/repository.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Repository = void 0;
|
|
7
|
+
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
8
10
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
10
11
|
const putil_merge_1 = __importDefault(require("putil-merge"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
class Repository extends package_1.Package {
|
|
12
|
+
const get_dirname_js_1 = require("../utils/get-dirname.js");
|
|
13
|
+
const package_js_1 = require("./package.js");
|
|
14
|
+
class Repository extends package_js_1.Package {
|
|
15
15
|
constructor(dirname, config, packages) {
|
|
16
16
|
super(dirname);
|
|
17
17
|
this.dirname = dirname;
|
|
@@ -96,14 +96,14 @@ class Repository extends package_1.Package {
|
|
|
96
96
|
for (const dir of dirs) {
|
|
97
97
|
const f = path_1.default.join(dir, 'package.json');
|
|
98
98
|
if (fs_1.default.existsSync(f))
|
|
99
|
-
packages.push(new
|
|
99
|
+
packages.push(new package_js_1.Package(dir));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
return packages;
|
|
103
103
|
}
|
|
104
104
|
static _readConfig(dirname) {
|
|
105
105
|
const result = {};
|
|
106
|
-
const pkgJson = (0,
|
|
106
|
+
const pkgJson = (0, get_dirname_js_1.getPackageJson)(dirname);
|
|
107
107
|
if (pkgJson && typeof pkgJson.rman === 'object')
|
|
108
108
|
(0, putil_merge_1.default)(result, pkgJson.rman, { deep: true });
|
|
109
109
|
let filename = path_1.default.resolve(dirname, '.rman.yml');
|
package/cjs/index.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./core/repository"), exports);
|
|
17
|
+
__exportStar(require("./core/repository.js"), exports);
|
package/cjs/utils/exec.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.exec = void 0;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const signal_exit_1 = __importDefault(require("signal-exit"));
|
|
9
|
-
const
|
|
9
|
+
const npm_run_path_js_1 = require("./npm-run-path.js");
|
|
10
10
|
const runningChildren = new Map();
|
|
11
11
|
async function exec(command, options) {
|
|
12
12
|
const opts = {
|
|
@@ -15,7 +15,7 @@ async function exec(command, options) {
|
|
|
15
15
|
...options,
|
|
16
16
|
};
|
|
17
17
|
opts.env = {
|
|
18
|
-
...(0,
|
|
18
|
+
...(0, npm_run_path_js_1.npmRunPathEnv)({ cwd: opts.cwd }),
|
|
19
19
|
...opts.env
|
|
20
20
|
};
|
|
21
21
|
opts.cwd = opts.cwd || process.cwd();
|
package/cjs/utils/get-dirname.js
CHANGED
|
@@ -4,10 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getPackageJson = exports.getDirname = void 0;
|
|
7
|
-
// noinspection ES6UnusedImports
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
11
9
|
function getDirname() {
|
|
12
10
|
const pst = Error.prepareStackTrace;
|
|
13
11
|
Error.prepareStackTrace = function (_, stack) {
|
package/cjs/utils/git-utils.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GitHelper = void 0;
|
|
7
|
-
const exec_1 = require("./exec");
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const exec_js_1 = require("./exec.js");
|
|
9
9
|
class GitHelper {
|
|
10
10
|
constructor(options) {
|
|
11
11
|
this.cwd = options?.cwd || process.cwd();
|
|
12
12
|
}
|
|
13
13
|
async listDirtyFileStatus(options) {
|
|
14
|
-
const x = await (0,
|
|
14
|
+
const x = await (0, exec_js_1.exec)('git', {
|
|
15
15
|
cwd: this.cwd,
|
|
16
16
|
argv: ['status', '--porcelain']
|
|
17
17
|
});
|
|
@@ -32,7 +32,7 @@ class GitHelper {
|
|
|
32
32
|
return (await this.listDirtyFileStatus(options)).map(x => x.filename);
|
|
33
33
|
}
|
|
34
34
|
async listCommitSha() {
|
|
35
|
-
const x = await (0,
|
|
35
|
+
const x = await (0, exec_js_1.exec)('git', {
|
|
36
36
|
cwd: this.cwd,
|
|
37
37
|
argv: ['cherry']
|
|
38
38
|
});
|
|
@@ -49,7 +49,7 @@ class GitHelper {
|
|
|
49
49
|
: await this.listCommitSha();
|
|
50
50
|
let result = [];
|
|
51
51
|
for (const s of shaArr) {
|
|
52
|
-
const x = await (0,
|
|
52
|
+
const x = await (0, exec_js_1.exec)('git', {
|
|
53
53
|
cwd: this.cwd,
|
|
54
54
|
argv: ['show', s, '--name-only', '--pretty="format:"']
|
|
55
55
|
});
|
|
@@ -60,7 +60,7 @@ class GitHelper {
|
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
62
62
|
async readFileLastPublished(filePath, commitSha) {
|
|
63
|
-
const x = await (0,
|
|
63
|
+
const x = await (0, exec_js_1.exec)('git', {
|
|
64
64
|
cwd: this.cwd,
|
|
65
65
|
argv: ['show', (commitSha || 'HEAD') + ':"' + filePath + '"']
|
|
66
66
|
});
|
|
@@ -8,9 +8,9 @@ exports.npmRunPathEnv = exports.npmRunPath = void 0;
|
|
|
8
8
|
/**
|
|
9
9
|
* Inspired from [npm-run-path](https://github.com/sindresorhus/npm-run-path)
|
|
10
10
|
*/
|
|
11
|
-
const process_1 = __importDefault(require("process"));
|
|
12
11
|
const path_1 = __importDefault(require("path"));
|
|
13
12
|
const path_key_1 = __importDefault(require("path-key"));
|
|
13
|
+
const process_1 = __importDefault(require("process"));
|
|
14
14
|
/**
|
|
15
15
|
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
|
16
16
|
@returns The augmented path string.
|
package/cjs/utils/npm-utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NpmHelper = exports.PackageNotFoundError = void 0;
|
|
4
|
-
const
|
|
4
|
+
const exec_js_1 = require("./exec.js");
|
|
5
5
|
class PackageNotFoundError extends Error {
|
|
6
6
|
}
|
|
7
7
|
exports.PackageNotFoundError = PackageNotFoundError;
|
|
@@ -10,7 +10,7 @@ class NpmHelper {
|
|
|
10
10
|
this.cwd = options?.cwd || process.cwd();
|
|
11
11
|
}
|
|
12
12
|
async getPackageInfo(packageName) {
|
|
13
|
-
const x = await (0,
|
|
13
|
+
const x = await (0, exec_js_1.exec)('npm', {
|
|
14
14
|
cwd: this.cwd,
|
|
15
15
|
argv: ['view', packageName, '--json']
|
|
16
16
|
});
|
package/esm/cli.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs/promises';
|
|
3
|
-
import yargs from "yargs";
|
|
4
1
|
import chalk from 'chalk';
|
|
2
|
+
import fs from 'fs/promises';
|
|
5
3
|
import logger from 'npmlog';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
import { BuildCommand } from './commands/build-command.js';
|
|
7
|
+
import { ChangedCommand } from './commands/changed-command.js';
|
|
8
|
+
import { CleanInstallCommand } from './commands/ci-command.js';
|
|
9
|
+
import { ExecuteCommand } from './commands/execute-command.js';
|
|
10
|
+
import { InfoCommand } from './commands/info-command.js';
|
|
11
|
+
import { ListCommand } from './commands/list-command.js';
|
|
12
|
+
import { PublishCommand } from './commands/publish-command.js';
|
|
13
|
+
import { RunCommand } from './commands/run-command.js';
|
|
14
|
+
import { VersionCommand } from './commands/version-command.js';
|
|
15
|
+
import { Command } from './core/command.js';
|
|
16
|
+
import { Repository } from './core/repository.js';
|
|
6
17
|
import { getDirname } from './utils/get-dirname.js';
|
|
7
|
-
import { Repository } from './core/repository';
|
|
8
|
-
import { InfoCommand } from './commands/info-command';
|
|
9
|
-
import { Command } from './core/command';
|
|
10
|
-
import { ListCommand } from './commands/list-command';
|
|
11
|
-
import { ChangedCommand } from './commands/changed-command';
|
|
12
|
-
import { ExecuteCommand } from './commands/execute-command';
|
|
13
|
-
import { RunCommand } from './commands/run-command';
|
|
14
|
-
import { VersionCommand } from './commands/version-command';
|
|
15
|
-
import { PublishCommand } from './commands/publish-command';
|
|
16
|
-
import { CleanInstallCommand } from './commands/ci-command';
|
|
17
|
-
import { BuildCommand } from './commands/build-command';
|
|
18
18
|
export async function runCli(options) {
|
|
19
19
|
try {
|
|
20
20
|
const s = path.resolve(getDirname(), '../package.json');
|
|
@@ -33,6 +33,7 @@ export async function runCli(options) {
|
|
|
33
33
|
const text = (msg
|
|
34
34
|
? msg + '\n\n' + chalk.whiteBright('Run with --help for available options')
|
|
35
35
|
: (err ? err.message : ''));
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
36
37
|
console.log('\n' + chalk.red(text));
|
|
37
38
|
throw msg;
|
|
38
39
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import yargs from 'yargs';
|
|
2
|
-
import { Repository } from '../core/repository';
|
|
3
|
-
import { RunCommand } from './run-command';
|
|
2
|
+
import { Repository } from '../core/repository.js';
|
|
3
|
+
import { RunCommand } from './run-command.js';
|
|
4
4
|
export declare class BuildCommand extends RunCommand<any> {
|
|
5
5
|
readonly repository: Repository;
|
|
6
6
|
static commandName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Command } from '../core/command';
|
|
2
|
-
import { RunCommand } from './run-command';
|
|
1
|
+
import { Command } from '../core/command.js';
|
|
2
|
+
import { RunCommand } from './run-command.js';
|
|
3
3
|
export class BuildCommand extends RunCommand {
|
|
4
4
|
constructor(repository, options) {
|
|
5
5
|
super(repository, 'build', options);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import yargs from 'yargs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Package } from '../core/package.js';
|
|
3
|
+
import { Repository } from '../core/repository.js';
|
|
4
|
+
import { ListCommand } from './list-command.js';
|
|
5
5
|
export declare class ChangedCommand extends ListCommand {
|
|
6
6
|
readonly repository: Repository;
|
|
7
7
|
static commandName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Command } from '../core/command.js';
|
|
2
|
+
import { ListCommand } from './list-command.js';
|
|
3
3
|
export class ChangedCommand extends ListCommand {
|
|
4
4
|
constructor(repository, options) {
|
|
5
5
|
super(repository, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import { Task } from 'power-tasks';
|
|
3
|
-
import
|
|
4
|
-
import { Package } from '../core/package';
|
|
5
|
-
import {
|
|
6
|
-
import { ExecuteCommandResult } from '../utils/exec';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Package } from '../core/package.js';
|
|
4
|
+
import { Repository } from '../core/repository.js';
|
|
5
|
+
import { ExecuteCommandResult } from '../utils/exec.js';
|
|
6
|
+
import { RunCommand } from './run-command.js';
|
|
7
7
|
export declare class CleanInstallCommand extends RunCommand<CleanInstallCommand.Options> {
|
|
8
8
|
readonly repository: Repository;
|
|
9
9
|
static commandName: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Task } from 'power-tasks';
|
|
2
1
|
import chalk from 'chalk';
|
|
3
2
|
import logger from 'npmlog';
|
|
4
|
-
import { Command } from '../core/command';
|
|
5
|
-
import { RunCommand } from './run-command';
|
|
6
|
-
import { fsDelete, fsExists } from '../utils/file-utils';
|
|
7
3
|
import path from 'path';
|
|
4
|
+
import { Task } from 'power-tasks';
|
|
5
|
+
import { Command } from '../core/command.js';
|
|
6
|
+
import { fsDelete, fsExists } from '../utils/file-utils.js';
|
|
7
|
+
import { RunCommand } from './run-command.js';
|
|
8
8
|
export class CleanInstallCommand extends RunCommand {
|
|
9
9
|
constructor(repository, options) {
|
|
10
10
|
super(repository, 'clean_', options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
|
-
import { Repository } from '../core/repository';
|
|
3
|
-
import { MultiTaskCommand } from './multi-task-command';
|
|
4
1
|
import { Task } from 'power-tasks';
|
|
5
|
-
import
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Package } from '../core/package.js';
|
|
4
|
+
import { Repository } from '../core/repository.js';
|
|
5
|
+
import { MultiTaskCommand } from './multi-task-command.js';
|
|
6
6
|
export declare class ExecuteCommand extends MultiTaskCommand<ExecuteCommand.Options> {
|
|
7
7
|
readonly repository: Repository;
|
|
8
8
|
cmd: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import logger from 'npmlog';
|
|
2
1
|
import chalk from 'chalk';
|
|
3
|
-
import
|
|
2
|
+
import logger from 'npmlog';
|
|
4
3
|
import { Task } from 'power-tasks';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Command } from '../core/command.js';
|
|
5
|
+
import { exec } from '../utils/exec.js';
|
|
6
|
+
import { MultiTaskCommand } from './multi-task-command.js';
|
|
7
7
|
export class ExecuteCommand extends MultiTaskCommand {
|
|
8
8
|
constructor(repository, cmd, argv, options) {
|
|
9
9
|
super(repository, options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import yargs from 'yargs';
|
|
2
|
-
import { Command } from '../core/command';
|
|
3
|
-
import { Repository } from '../core/repository';
|
|
2
|
+
import { Command } from '../core/command.js';
|
|
3
|
+
import { Repository } from '../core/repository.js';
|
|
4
4
|
export declare class InfoCommand extends Command {
|
|
5
5
|
static commandName: string;
|
|
6
6
|
protected _execute(): Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import envinfo from 'envinfo';
|
|
3
3
|
import semver from 'semver';
|
|
4
|
-
import { Command } from '../core/command';
|
|
4
|
+
import { Command } from '../core/command.js';
|
|
5
5
|
export class InfoCommand extends Command {
|
|
6
6
|
async _execute() {
|
|
7
7
|
const systemInfo = JSON.parse(await envinfo.run({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import EasyTable from 'easy-table';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Package } from '../core/package';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Command } from '../core/command.js';
|
|
4
|
+
import { Package } from '../core/package.js';
|
|
5
|
+
import { Repository } from '../core/repository.js';
|
|
6
6
|
export declare class ListCommand<TOptions extends ListCommand.Options = ListCommand.Options> extends Command<TOptions> {
|
|
7
7
|
readonly repository: Repository;
|
|
8
8
|
static commandName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import chalk from 'chalk';
|
|
3
2
|
import EasyTable from 'easy-table';
|
|
4
3
|
import logger from 'npmlog';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { Command } from '../core/command.js';
|
|
6
|
+
import { GitHelper } from '../utils/git-utils.js';
|
|
7
7
|
export class ListCommand extends Command {
|
|
8
8
|
constructor(repository, options) {
|
|
9
9
|
super(options);
|
|
@@ -83,6 +83,7 @@ export class ListCommand extends Command {
|
|
|
83
83
|
}
|
|
84
84
|
else if (table.rows.length) {
|
|
85
85
|
logger.output('', '%s', table.toString().trim());
|
|
86
|
+
// eslint-disable-next-line no-console
|
|
86
87
|
console.log('');
|
|
87
88
|
logger.info('list', '%i Package(s) found', count);
|
|
88
89
|
return arr;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import { Task } from 'power-tasks';
|
|
3
|
-
import
|
|
4
|
-
import { Command } from '../core/command';
|
|
5
|
-
import { Package } from '../core/package';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Command } from '../core/command.js';
|
|
4
|
+
import { Package } from '../core/package.js';
|
|
5
|
+
import { Repository } from '../core/repository.js';
|
|
6
6
|
export declare abstract class MultiTaskCommand<TOptions extends MultiTaskCommand.Options = MultiTaskCommand.Options> extends Command<TOptions> {
|
|
7
7
|
readonly repository: Repository;
|
|
8
8
|
protected _task?: Task;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import { Task } from 'power-tasks';
|
|
3
3
|
import { toNumber } from 'putil-varhelpers';
|
|
4
|
-
import { Command } from '../core/command';
|
|
5
|
-
import { isTTY } from '../core/constants';
|
|
4
|
+
import { Command } from '../core/command.js';
|
|
5
|
+
import { isTTY } from '../core/constants.js';
|
|
6
6
|
export class MultiTaskCommand extends Command {
|
|
7
7
|
constructor(repository, options) {
|
|
8
8
|
super(options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import { Task } from 'power-tasks';
|
|
3
|
-
import
|
|
4
|
-
import { Package } from '../core/package';
|
|
5
|
-
import {
|
|
6
|
-
import { ExecuteCommandResult } from '../utils/exec';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Package } from '../core/package.js';
|
|
4
|
+
import { Repository } from '../core/repository.js';
|
|
5
|
+
import { ExecuteCommandResult } from '../utils/exec.js';
|
|
6
|
+
import { RunCommand } from './run-command.js';
|
|
7
7
|
export declare class PublishCommand extends RunCommand<PublishCommand.Options> {
|
|
8
8
|
readonly repository: Repository;
|
|
9
9
|
static commandName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import logger from 'npmlog';
|
|
3
|
-
import { Command } from '../core/command';
|
|
4
|
-
import { RunCommand } from './run-command';
|
|
5
3
|
import path from 'path';
|
|
6
|
-
import {
|
|
4
|
+
import { Command } from '../core/command.js';
|
|
5
|
+
import { NpmHelper } from '../utils/npm-utils.js';
|
|
6
|
+
import { RunCommand } from './run-command.js';
|
|
7
7
|
export class PublishCommand extends RunCommand {
|
|
8
8
|
constructor(repository, options) {
|
|
9
9
|
super(repository, 'publish', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import { Task } from 'power-tasks';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Package } from '../core/package.js';
|
|
4
|
+
import { Repository } from '../core/repository.js';
|
|
5
|
+
import { ExecuteCommandResult } from '../utils/exec.js';
|
|
6
|
+
import { MultiTaskCommand } from './multi-task-command.js';
|
|
7
7
|
export declare class RunCommand<TOptions extends RunCommand.Options> extends MultiTaskCommand<TOptions> {
|
|
8
8
|
readonly repository: Repository;
|
|
9
9
|
script: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
1
2
|
import logger from 'npmlog';
|
|
2
3
|
import { Task } from 'power-tasks';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
4
|
import parseNpmScript from '@netlify/parse-npm-script';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Command } from '../core/command.js';
|
|
6
|
+
import { exec } from '../utils/exec.js';
|
|
7
|
+
import { MultiTaskCommand } from './multi-task-command.js';
|
|
8
8
|
export class RunCommand extends MultiTaskCommand {
|
|
9
9
|
constructor(repository, script, options) {
|
|
10
10
|
super(repository, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
import { Task } from 'power-tasks';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ExecuteCommandResult } from '../utils/exec';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { Package } from '../core/package.js';
|
|
4
|
+
import { Repository } from '../core/repository.js';
|
|
5
|
+
import { ExecuteCommandResult } from '../utils/exec.js';
|
|
6
|
+
import { RunCommand } from './run-command.js';
|
|
7
7
|
export declare class VersionCommand extends RunCommand<VersionCommand.Options> {
|
|
8
8
|
readonly repository: Repository;
|
|
9
9
|
bump: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import chalk from 'chalk';
|
|
3
|
-
import
|
|
2
|
+
import fs from 'fs/promises';
|
|
4
3
|
import logger from 'npmlog';
|
|
5
|
-
import
|
|
4
|
+
import path from 'path';
|
|
6
5
|
import { Task } from 'power-tasks';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Command } from '../core/command';
|
|
10
|
-
import
|
|
6
|
+
import semver from 'semver';
|
|
7
|
+
import stripColor from 'strip-color';
|
|
8
|
+
import { Command } from '../core/command.js';
|
|
9
|
+
import { GitHelper } from '../utils/git-utils.js';
|
|
10
|
+
import { RunCommand } from './run-command.js';
|
|
11
11
|
export class VersionCommand extends RunCommand {
|
|
12
12
|
constructor(repository, bump, options) {
|
|
13
13
|
super(repository, 'version', options);
|
package/esm/core/command.d.ts
CHANGED
package/esm/core/command.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import npmlog from 'npmlog';
|
|
3
|
-
import isCi from 'is-ci';
|
|
4
|
-
import merge from 'putil-merge';
|
|
5
|
-
import './logger';
|
|
6
|
-
import { isTTY } from './constants';
|
|
1
|
+
import './logger.js';
|
|
7
2
|
import chalk from 'chalk';
|
|
8
3
|
import figures from 'figures';
|
|
4
|
+
import isCi from 'is-ci';
|
|
5
|
+
import npmlog from 'npmlog';
|
|
6
|
+
import merge from 'putil-merge';
|
|
7
|
+
import { AsyncEventEmitter, TypedEventEmitterClass } from 'strict-typed-events';
|
|
8
|
+
import { isTTY } from './constants.js';
|
|
9
9
|
const noOp = () => void (0);
|
|
10
10
|
export class Command extends TypedEventEmitterClass(AsyncEventEmitter) {
|
|
11
11
|
constructor(options) {
|
package/esm/core/constants.d.ts
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const DOTS = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
1
|
+
// export const DOTS = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
2
2
|
export const isTTY = process.stdout.isTTY && process.env.TERM !== 'dumb';
|
package/esm/core/repository.d.ts
CHANGED
package/esm/core/repository.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import glob from 'fast-glob';
|
|
1
2
|
import fs from 'fs';
|
|
3
|
+
import yaml from 'js-yaml';
|
|
2
4
|
import path from 'path';
|
|
3
|
-
import glob from 'fast-glob';
|
|
4
5
|
import merge from 'putil-merge';
|
|
5
|
-
import
|
|
6
|
-
import { Package } from './package';
|
|
7
|
-
import { getPackageJson } from '../utils/get-dirname';
|
|
6
|
+
import { getPackageJson } from '../utils/get-dirname.js';
|
|
7
|
+
import { Package } from './package.js';
|
|
8
8
|
export class Repository extends Package {
|
|
9
9
|
constructor(dirname, config, packages) {
|
|
10
10
|
super(dirname);
|
package/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './core/repository';
|
|
1
|
+
export * from './core/repository.js';
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './core/repository';
|
|
1
|
+
export * from './core/repository.js';
|
package/esm/utils/exec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import onExit from 'signal-exit';
|
|
3
|
-
import { npmRunPathEnv } from './npm-run-path';
|
|
3
|
+
import { npmRunPathEnv } from './npm-run-path.js';
|
|
4
4
|
const runningChildren = new Map();
|
|
5
5
|
export async function exec(command, options) {
|
|
6
6
|
const opts = {
|
package/esm/utils/get-dirname.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
// noinspection ES6UnusedImports
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
-
import path from 'path';
|
|
4
1
|
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
5
3
|
export function getDirname() {
|
|
6
4
|
const pst = Error.prepareStackTrace;
|
|
7
5
|
Error.prepareStackTrace = function (_, stack) {
|
package/esm/utils/git-utils.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Inspired from [npm-run-path](https://github.com/sindresorhus/npm-run-path)
|
|
4
4
|
*/
|
|
5
|
-
import process from 'process';
|
|
6
5
|
import path from 'path';
|
|
7
6
|
import pathKey from 'path-key';
|
|
7
|
+
import process from 'process';
|
|
8
8
|
/**
|
|
9
9
|
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
|
10
10
|
@returns The augmented path string.
|
package/esm/utils/npm-utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rman",
|
|
3
3
|
"description": "Monorepo repository manager",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"contributors": [
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "cjs/index.js",
|
|
27
|
-
"module": "esm/index.
|
|
27
|
+
"module": "esm/index.js",
|
|
28
28
|
"types": "esm/index.d.ts",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": "./cjs/index.js",
|
|
31
31
|
"./cjs": "./cjs/index.js",
|
|
32
|
-
"./esm": "./esm/index.
|
|
32
|
+
"./esm": "./esm/index.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@netlify/parse-npm-script": "^0.1.2",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
],
|
|
97
97
|
"scripts": {
|
|
98
98
|
"compile": "tsc -b tsconfig.json",
|
|
99
|
-
"lint": "eslint
|
|
99
|
+
"lint": "eslint .",
|
|
100
100
|
"clean": "npm run clean:src && npm run clean:dist",
|
|
101
101
|
"clean:dist": "rimraf cjs esm coverage",
|
|
102
102
|
"clean:src": "ts-cleanup -s src --all | ts-cleanup -s test",
|
package/cjs/core/types.js
DELETED
package/cjs/debug.js
DELETED
package/esm/core/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface IWorkspaceProvider {
|
|
2
|
-
parse: (root: string) => IWorkspaceInfo | undefined;
|
|
3
|
-
}
|
|
4
|
-
export interface IWorkspaceInfo {
|
|
5
|
-
dirname: string;
|
|
6
|
-
pkgJson: any;
|
|
7
|
-
packages: string[];
|
|
8
|
-
}
|
|
9
|
-
export interface Logger {
|
|
10
|
-
info: (message?: any, ...optionalParams: any[]) => void;
|
|
11
|
-
error: (message?: any, ...optionalParams: any[]) => void;
|
|
12
|
-
log: (message?: any, ...optionalParams: any[]) => void;
|
|
13
|
-
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
14
|
-
}
|
package/esm/core/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/debug.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/debug.js
DELETED