rman 0.25.0 → 0.26.1

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 CHANGED
@@ -36,12 +36,16 @@ async function runCli(options) {
36
36
  .help('help').alias('help', 'h')
37
37
  .showHelpOnFail(false, 'Run with --help for available options')
38
38
  .fail((msg, err) => {
39
- const text = (msg
40
- ? msg + '\n\n' + chalk_1.default.whiteBright('Run with --help for available options')
41
- : (err ? err.message : ''));
42
- // eslint-disable-next-line no-console
43
- console.log('\n' + chalk_1.default.red(text));
44
- throw msg;
39
+ if (!err?.logged) {
40
+ const text = (msg
41
+ ? msg + '\n\n' + chalk_1.default.whiteBright('Run with --help for available options')
42
+ : (err ? err.message : ''));
43
+ // eslint-disable-next-line no-console
44
+ console.log('\n' + chalk_1.default.red(text));
45
+ throw msg;
46
+ }
47
+ else
48
+ process.exit(1);
45
49
  })
46
50
  // group options under "Global Options:" header
47
51
  .options(command_js_1.Command.globalOptions)
@@ -59,7 +63,7 @@ async function runCli(options) {
59
63
  program.showHelp();
60
64
  else
61
65
  await program.parseAsync()
62
- .catch(() => false);
66
+ .catch(() => process.exit(1));
63
67
  }
64
68
  catch (e) {
65
69
  npmlog_1.default.error('rman', e);
@@ -32,7 +32,7 @@ class MultiTaskCommand extends command_js_1.Command {
32
32
  concurrency: this.options.concurrency || os_1.default.cpus().length,
33
33
  bail: this.options.bail,
34
34
  });
35
- await this._task.toPromise().catch(() => void (0));
35
+ await this._task.toPromise();
36
36
  }
37
37
  async _getPackages() {
38
38
  return this.repository.getPackages({ toposort: !this.options.parallel });
@@ -73,6 +73,8 @@ class Command extends (0, strict_typed_events_1.TypedEventEmitterClass)(strict_t
73
73
  if (this.listenerCount('error'))
74
74
  await this.emitAsync('error', e).catch(noOp);
75
75
  this.logger.resume();
76
+ this.logger.error(this.commandName, this.logger.separator, e.message.trim());
77
+ e.logged = true;
76
78
  throw e;
77
79
  }
78
80
  finally {
package/esm/cli.js CHANGED
@@ -30,12 +30,16 @@ export async function runCli(options) {
30
30
  .help('help').alias('help', 'h')
31
31
  .showHelpOnFail(false, 'Run with --help for available options')
32
32
  .fail((msg, err) => {
33
- const text = (msg
34
- ? msg + '\n\n' + chalk.whiteBright('Run with --help for available options')
35
- : (err ? err.message : ''));
36
- // eslint-disable-next-line no-console
37
- console.log('\n' + chalk.red(text));
38
- throw msg;
33
+ if (!err?.logged) {
34
+ const text = (msg
35
+ ? msg + '\n\n' + chalk.whiteBright('Run with --help for available options')
36
+ : (err ? err.message : ''));
37
+ // eslint-disable-next-line no-console
38
+ console.log('\n' + chalk.red(text));
39
+ throw msg;
40
+ }
41
+ else
42
+ process.exit(1);
39
43
  })
40
44
  // group options under "Global Options:" header
41
45
  .options(Command.globalOptions)
@@ -53,7 +57,7 @@ export async function runCli(options) {
53
57
  program.showHelp();
54
58
  else
55
59
  await program.parseAsync()
56
- .catch(() => false);
60
+ .catch(() => process.exit(1));
57
61
  }
58
62
  catch (e) {
59
63
  logger.error('rman', e);
@@ -26,7 +26,7 @@ export class MultiTaskCommand extends Command {
26
26
  concurrency: this.options.concurrency || os.cpus().length,
27
27
  bail: this.options.bail,
28
28
  });
29
- await this._task.toPromise().catch(() => void (0));
29
+ await this._task.toPromise();
30
30
  }
31
31
  async _getPackages() {
32
32
  return this.repository.getPackages({ toposort: !this.options.parallel });
@@ -67,6 +67,8 @@ export class Command extends TypedEventEmitterClass(AsyncEventEmitter) {
67
67
  if (this.listenerCount('error'))
68
68
  await this.emitAsync('error', e).catch(noOp);
69
69
  this.logger.resume();
70
+ this.logger.error(this.commandName, this.logger.separator, e.message.trim());
71
+ e.logged = true;
70
72
  throw e;
71
73
  }
72
74
  finally {
@@ -16,7 +16,7 @@ export interface RunPathOptions {
16
16
  */
17
17
  readonly execPath?: string;
18
18
  }
19
- export declare type ProcessEnv = Record<string, string | undefined>;
19
+ export type ProcessEnv = Record<string, string | undefined>;
20
20
  export interface EnvOptions {
21
21
  /**
22
22
  The working directory.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Monorepo repository manager",
4
- "version": "0.25.0",
4
+ "version": "0.26.1",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "contributors": [
@@ -23,17 +23,18 @@
23
23
  "rman": "bin/rman.mjs"
24
24
  },
25
25
  "type": "module",
26
- "main": "cjs/index.js",
27
- "module": "esm/index.js",
28
26
  "types": "esm/index.d.ts",
29
27
  "exports": {
30
- ".": "./cjs/index.js",
28
+ ".": {
29
+ "require": "./cjs/index.js",
30
+ "default": "./esm/index.js"
31
+ },
31
32
  "./cjs": "./cjs/index.js",
32
33
  "./esm": "./esm/index.js"
33
34
  },
34
35
  "dependencies": {
35
36
  "@netlify/parse-npm-script": "^0.1.2",
36
- "chalk": "^5.1.1",
37
+ "chalk": "^5.1.2",
37
38
  "easy-table": "^1.2.0",
38
39
  "envinfo": "^7.8.1",
39
40
  "fast-glob": "^3.2.12",
@@ -41,47 +42,47 @@
41
42
  "ini": "^3.0.1",
42
43
  "is-ci": "^3.0.1",
43
44
  "js-yaml": "^4.1.0",
44
- "npmlog": "^6.0.2",
45
+ "npmlog": "^7.0.1",
45
46
  "path-key": "^4.0.0",
46
- "power-tasks": "^1.4.0",
47
+ "power-tasks": "^1.5.0",
47
48
  "putil-merge": "^3.9.0",
48
49
  "putil-varhelpers": "^1.6.4",
49
50
  "semver": "^7.3.8",
50
51
  "signal-exit": "^3.0.7",
51
52
  "strict-typed-events": "^2.3.1",
52
53
  "strip-color": "^0.1.0",
53
- "yargs": "^17.6.0"
54
+ "yargs": "^17.6.2"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@babel/eslint-parser": "^7.19.1",
57
58
  "@types/envinfo": "^7.8.1",
58
59
  "@types/ini": "^1.3.31",
59
60
  "@types/is-ci": "^3.0.0",
60
- "@types/jest": "^29.1.2",
61
+ "@types/jest": "^29.2.3",
61
62
  "@types/js-yaml": "^4.0.5",
62
- "@types/node": "^18.8.4",
63
+ "@types/node": "^18.11.9",
63
64
  "@types/npmlog": "^4.1.4",
64
- "@types/semver": "^7.3.12",
65
+ "@types/semver": "^7.3.13",
65
66
  "@types/signal-exit": "^3.0.1",
66
67
  "@types/strip-color": "^0.1.0",
67
- "@types/yargs": "^17.0.13",
68
- "@typescript-eslint/eslint-plugin": "^5.40.0",
69
- "@typescript-eslint/parser": "^5.40.0",
70
- "eslint": "8.25.0",
68
+ "@types/yargs": "^17.0.14",
69
+ "@typescript-eslint/eslint-plugin": "^5.44.0",
70
+ "@typescript-eslint/parser": "^5.44.0",
71
+ "eslint": "^8.28.0",
71
72
  "eslint-config-google": "^0.14.0",
72
73
  "eslint-plugin-import": "^2.26.0",
73
74
  "eslint-plugin-security": "^1.5.0",
74
75
  "eslint-plugin-simple-import-sort": "^8.0.0",
75
76
  "eslint-plugin-unused-imports": "^2.0.0",
76
- "jest": "^29.1.2",
77
- "prettier": "^2.7.1",
77
+ "jest": "^29.3.1",
78
+ "prettier": "^2.8.0",
78
79
  "ts-cleanup": "^0.2.5",
79
- "ts-gems": "^2.2.1",
80
+ "ts-gems": "^2.3.0",
80
81
  "ts-jest": "^29.0.3",
81
82
  "ts-loader": "^9.4.1",
82
83
  "ts-node": "^10.9.1",
83
84
  "tsconfig-paths": "^4.1.0",
84
- "typescript": "^4.8.4"
85
+ "typescript": "^4.9.3"
85
86
  },
86
87
  "engines": {
87
88
  "node": ">=14.0",