@lerna-lite/core 1.15.1 → 1.16.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.
Files changed (152) hide show
  1. package/dist/child-process.d.ts +62 -62
  2. package/dist/child-process.js +164 -166
  3. package/dist/child-process.js.map +1 -1
  4. package/dist/command.d.ts +37 -37
  5. package/dist/command.js +269 -271
  6. package/dist/command.js.map +1 -1
  7. package/dist/constants.d.ts +1 -1
  8. package/dist/constants.js +4 -4
  9. package/dist/index.d.ts +10 -10
  10. package/dist/index.js +15 -28
  11. package/dist/index.js.map +1 -1
  12. package/dist/models/command-options.d.ts +345 -341
  13. package/dist/models/command-options.js +2 -2
  14. package/dist/models/index.d.ts +2 -2
  15. package/dist/models/index.js +5 -18
  16. package/dist/models/index.js.map +1 -1
  17. package/dist/models/interfaces.d.ts +175 -173
  18. package/dist/models/interfaces.js +2 -2
  19. package/dist/package-graph/index.d.ts +2 -2
  20. package/dist/package-graph/index.js +5 -18
  21. package/dist/package-graph/index.js.map +1 -1
  22. package/dist/package-graph/lib/cyclic-package-graph-node.d.ts +42 -42
  23. package/dist/package-graph/lib/cyclic-package-graph-node.js +97 -97
  24. package/dist/package-graph/lib/index.d.ts +3 -3
  25. package/dist/package-graph/lib/index.js +6 -19
  26. package/dist/package-graph/lib/index.js.map +1 -1
  27. package/dist/package-graph/lib/package-graph-node.d.ts +33 -33
  28. package/dist/package-graph/lib/package-graph-node.js +56 -58
  29. package/dist/package-graph/lib/package-graph-node.js.map +1 -1
  30. package/dist/package-graph/lib/report-cycles.d.ts +1 -1
  31. package/dist/package-graph/lib/report-cycles.js +17 -19
  32. package/dist/package-graph/lib/report-cycles.js.map +1 -1
  33. package/dist/package-graph/package-graph.d.ts +79 -79
  34. package/dist/package-graph/package-graph.js +269 -271
  35. package/dist/package-graph/package-graph.js.map +1 -1
  36. package/dist/package.d.ts +113 -113
  37. package/dist/package.js +352 -354
  38. package/dist/package.js.map +1 -1
  39. package/dist/project/index.d.ts +2 -2
  40. package/dist/project/index.js +5 -18
  41. package/dist/project/index.js.map +1 -1
  42. package/dist/project/lib/apply-extends.d.ts +10 -10
  43. package/dist/project/lib/apply-extends.js +36 -38
  44. package/dist/project/lib/apply-extends.js.map +1 -1
  45. package/dist/project/lib/index.d.ts +3 -3
  46. package/dist/project/lib/index.js +6 -19
  47. package/dist/project/lib/index.js.map +1 -1
  48. package/dist/project/lib/make-file-finder.d.ts +3 -3
  49. package/dist/project/lib/make-file-finder.js +69 -71
  50. package/dist/project/lib/make-file-finder.js.map +1 -1
  51. package/dist/project/lib/shallow-extend.d.ts +11 -11
  52. package/dist/project/lib/shallow-extend.js +24 -24
  53. package/dist/project/project.d.ts +46 -46
  54. package/dist/project/project.js +195 -197
  55. package/dist/project/project.js.map +1 -1
  56. package/dist/prompt.d.ts +23 -23
  57. package/dist/prompt.js +73 -75
  58. package/dist/prompt.js.map +1 -1
  59. package/dist/utils/check-working-tree.d.ts +9 -9
  60. package/dist/utils/check-working-tree.js +41 -41
  61. package/dist/utils/clean-stack.d.ts +5 -5
  62. package/dist/utils/clean-stack.js +18 -18
  63. package/dist/utils/collect-uncommitted.d.ts +17 -17
  64. package/dist/utils/collect-uncommitted.js +37 -39
  65. package/dist/utils/collect-uncommitted.js.map +1 -1
  66. package/dist/utils/collect-updates/__helpers__/build-graph.d.ts +3 -3
  67. package/dist/utils/collect-updates/__helpers__/build-graph.js +74 -74
  68. package/dist/utils/collect-updates/collect-updates.d.ts +11 -11
  69. package/dist/utils/collect-updates/collect-updates.js +89 -89
  70. package/dist/utils/collect-updates/collect-updates.js.map +1 -1
  71. package/dist/utils/collect-updates/index.d.ts +2 -2
  72. package/dist/utils/collect-updates/index.js +5 -18
  73. package/dist/utils/collect-updates/index.js.map +1 -1
  74. package/dist/utils/collect-updates/lib/collect-dependents.d.ts +11 -11
  75. package/dist/utils/collect-updates/lib/collect-dependents.js +45 -45
  76. package/dist/utils/collect-updates/lib/collect-packages.d.ts +13 -13
  77. package/dist/utils/collect-updates/lib/collect-packages.js +33 -33
  78. package/dist/utils/collect-updates/lib/get-packages-for-option.d.ts +5 -5
  79. package/dist/utils/collect-updates/lib/get-packages-for-option.js +30 -30
  80. package/dist/utils/collect-updates/lib/has-tags.d.ts +7 -7
  81. package/dist/utils/collect-updates/lib/has-tags.js +30 -32
  82. package/dist/utils/collect-updates/lib/has-tags.js.map +1 -1
  83. package/dist/utils/collect-updates/lib/index.d.ts +5 -5
  84. package/dist/utils/collect-updates/lib/index.js +8 -21
  85. package/dist/utils/collect-updates/lib/index.js.map +1 -1
  86. package/dist/utils/collect-updates/lib/make-diff-predicate.d.ts +9 -7
  87. package/dist/utils/collect-updates/lib/make-diff-predicate.js +74 -63
  88. package/dist/utils/collect-updates/lib/make-diff-predicate.js.map +1 -1
  89. package/dist/utils/conf.d.ts +25 -25
  90. package/dist/utils/conf.js +253 -255
  91. package/dist/utils/conf.js.map +1 -1
  92. package/dist/utils/defaults.d.ts +1 -1
  93. package/dist/utils/defaults.js +180 -182
  94. package/dist/utils/defaults.js.map +1 -1
  95. package/dist/utils/describe-ref.d.ts +13 -13
  96. package/dist/utils/describe-ref.js +86 -88
  97. package/dist/utils/describe-ref.js.map +1 -1
  98. package/dist/utils/env-replace.d.ts +1 -1
  99. package/dist/utils/env-replace.js +22 -22
  100. package/dist/utils/find-prefix.d.ts +2 -2
  101. package/dist/utils/find-prefix.js +46 -48
  102. package/dist/utils/find-prefix.js.map +1 -1
  103. package/dist/utils/index.d.ts +22 -22
  104. package/dist/utils/index.js +26 -39
  105. package/dist/utils/index.js.map +1 -1
  106. package/dist/utils/log-package-error.d.ts +5 -5
  107. package/dist/utils/log-package-error.js +33 -35
  108. package/dist/utils/log-package-error.js.map +1 -1
  109. package/dist/utils/nerf-dart.d.ts +1 -1
  110. package/dist/utils/nerf-dart.js +16 -18
  111. package/dist/utils/nerf-dart.js.map +1 -1
  112. package/dist/utils/npm-conf.d.ts +4 -4
  113. package/dist/utils/npm-conf.js +53 -78
  114. package/dist/utils/npm-conf.js.map +1 -1
  115. package/dist/utils/object-utils.d.ts +21 -21
  116. package/dist/utils/object-utils.js +51 -53
  117. package/dist/utils/object-utils.js.map +1 -1
  118. package/dist/utils/output.d.ts +1 -1
  119. package/dist/utils/output.js +11 -13
  120. package/dist/utils/output.js.map +1 -1
  121. package/dist/utils/parse-field.d.ts +1 -1
  122. package/dist/utils/parse-field.js +63 -65
  123. package/dist/utils/parse-field.js.map +1 -1
  124. package/dist/utils/prerelease-id-from-version.d.ts +5 -5
  125. package/dist/utils/prerelease-id-from-version.js +13 -15
  126. package/dist/utils/prerelease-id-from-version.js.map +1 -1
  127. package/dist/utils/pulse-till-done.d.ts +1 -1
  128. package/dist/utils/pulse-till-done.js +38 -40
  129. package/dist/utils/pulse-till-done.js.map +1 -1
  130. package/dist/utils/query-graph.d.ts +36 -36
  131. package/dist/utils/query-graph.js +77 -77
  132. package/dist/utils/run-lifecycle.d.ts +10 -10
  133. package/dist/utils/run-lifecycle.js +138 -140
  134. package/dist/utils/run-lifecycle.js.map +1 -1
  135. package/dist/utils/run-topologically.d.ts +12 -12
  136. package/dist/utils/run-topologically.js +34 -36
  137. package/dist/utils/run-topologically.js.map +1 -1
  138. package/dist/utils/string-utils.d.ts +2 -2
  139. package/dist/utils/string-utils.js +9 -9
  140. package/dist/utils/types.d.ts +128 -131
  141. package/dist/utils/types.js +136 -138
  142. package/dist/utils/types.js.map +1 -1
  143. package/dist/utils/warn-if-hanging.d.ts +1 -1
  144. package/dist/utils/warn-if-hanging.js +15 -17
  145. package/dist/utils/warn-if-hanging.js.map +1 -1
  146. package/dist/utils/write-log-file.d.ts +1 -1
  147. package/dist/utils/write-log-file.js +30 -32
  148. package/dist/utils/write-log-file.js.map +1 -1
  149. package/dist/validation-error.d.ts +4 -4
  150. package/dist/validation-error.js +16 -18
  151. package/dist/validation-error.js.map +1 -1
  152. package/package.json +4 -4
@@ -1,62 +1,62 @@
1
- import execa from 'execa';
2
- import { Package } from './package';
3
- /**
4
- * Execute a command asynchronously, piping stdio by default.
5
- * @param {string} command
6
- * @param {string[]} args
7
- * @param {import("execa").Options} [opts]
8
- */
9
- export declare function exec(command: string, args: string[], opts?: execa.Options & {
10
- pkg?: Package;
11
- }, dryRun?: boolean): Promise<any>;
12
- /**
13
- * Execute a command synchronously.
14
- * @param {string} command
15
- * @param {string[]} args
16
- * @param {import("execa").SyncOptions} [opts]
17
- */
18
- export declare function execSync(command: string, args?: string[], opts?: execa.SyncOptions<string>, dryRun?: boolean): string;
19
- /**
20
- * Spawn a command asynchronously, _always_ inheriting stdio.
21
- * @param {string} command
22
- * @param {string[]} args
23
- * @param {import("execa").Options} [opts]
24
- */
25
- export declare function spawn(command: string, args: string[], opts?: execa.Options & {
26
- pkg?: Package;
27
- }, dryRun?: boolean): Promise<any>;
28
- /**
29
- * Spawn a command asynchronously, streaming stdio with optional prefix.
30
- * @param {string} command
31
- * @param {string[]} args
32
- * @param {import("execa").Options} [opts]
33
- * @param {string} [prefix]
34
- */
35
- export declare function spawnStreaming(command: string, args: string[], opts?: execa.Options & {
36
- pkg?: Package;
37
- }, prefix?: string | boolean, dryRun?: boolean): Promise<any>;
38
- export declare function getChildProcessCount(): number;
39
- export declare function getExitCode(result: any): any;
40
- /**
41
- * @param {string} command
42
- * @param {string[]} args
43
- * @param {import("execa").Options} opts
44
- */
45
- export declare function spawnProcess(command: string, args: string[], opts: execa.Options & {
46
- pkg?: Package;
47
- }, dryRun?: boolean): any;
48
- /**
49
- * Spawn a command asynchronously, _always_ inheriting stdio.
50
- * @param {string} command
51
- * @param {string[]} args
52
- * @param {import("execa").Options} [opts]
53
- */
54
- export declare function wrapError(spawned: execa.ExecaChildProcess & {
55
- pkg?: Package;
56
- }): Promise<execa.ExecaReturnValue<string>>;
57
- /**
58
- * Log the child-process command and its arguments as dry-run (without executing the process)
59
- * @param {string} command
60
- * @param {string[]} args
61
- */
62
- export declare function logExecCommand(command: string, args?: string[]): string;
1
+ import execa from 'execa';
2
+ import { Package } from './package';
3
+ /**
4
+ * Execute a command asynchronously, piping stdio by default.
5
+ * @param {string} command
6
+ * @param {string[]} args
7
+ * @param {import("execa").Options} [opts]
8
+ */
9
+ export declare function exec(command: string, args: string[], opts?: execa.Options & {
10
+ pkg?: Package;
11
+ }, dryRun?: boolean): Promise<any>;
12
+ /**
13
+ * Execute a command synchronously.
14
+ * @param {string} command
15
+ * @param {string[]} args
16
+ * @param {import("execa").SyncOptions} [opts]
17
+ */
18
+ export declare function execSync(command: string, args?: string[], opts?: execa.SyncOptions<string>, dryRun?: boolean): string;
19
+ /**
20
+ * Spawn a command asynchronously, _always_ inheriting stdio.
21
+ * @param {string} command
22
+ * @param {string[]} args
23
+ * @param {import("execa").Options} [opts]
24
+ */
25
+ export declare function spawn(command: string, args: string[], opts?: execa.Options & {
26
+ pkg?: Package;
27
+ }, dryRun?: boolean): Promise<any>;
28
+ /**
29
+ * Spawn a command asynchronously, streaming stdio with optional prefix.
30
+ * @param {string} command
31
+ * @param {string[]} args
32
+ * @param {import("execa").Options} [opts]
33
+ * @param {string} [prefix]
34
+ */
35
+ export declare function spawnStreaming(command: string, args: string[], opts?: execa.Options & {
36
+ pkg?: Package;
37
+ }, prefix?: string | boolean, dryRun?: boolean): Promise<any>;
38
+ export declare function getChildProcessCount(): number;
39
+ export declare function getExitCode(result: any): any;
40
+ /**
41
+ * @param {string} command
42
+ * @param {string[]} args
43
+ * @param {import("execa").Options} opts
44
+ */
45
+ export declare function spawnProcess(command: string, args: string[], opts: execa.Options & {
46
+ pkg?: Package;
47
+ }, dryRun?: boolean): any;
48
+ /**
49
+ * Spawn a command asynchronously, _always_ inheriting stdio.
50
+ * @param {string} command
51
+ * @param {string[]} args
52
+ * @param {import("execa").Options} [opts]
53
+ */
54
+ export declare function wrapError(spawned: execa.ExecaChildProcess & {
55
+ pkg?: Package;
56
+ }): Promise<execa.ExecaReturnValue<string>>;
57
+ /**
58
+ * Log the child-process command and its arguments as dry-run (without executing the process)
59
+ * @param {string} command
60
+ * @param {string[]} args
61
+ */
62
+ export declare function logExecCommand(command: string, args?: string[]): string;
@@ -1,167 +1,165 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.logExecCommand = exports.wrapError = exports.spawnProcess = exports.getExitCode = exports.getChildProcessCount = exports.spawnStreaming = exports.spawn = exports.execSync = exports.exec = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const execa_1 = __importDefault(require("execa"));
9
- const npmlog_1 = __importDefault(require("npmlog"));
10
- const os_1 = __importDefault(require("os"));
11
- const strong_log_transformer_1 = __importDefault(require("strong-log-transformer"));
12
- // bookkeeping for spawned processes
13
- const children = new Set();
14
- // when streaming processes are spawned, use this color for prefix
15
- const colorWheel = ['cyan', 'magenta', 'blue', 'yellow', 'green', 'red'];
16
- const NUM_COLORS = colorWheel.length;
17
- // ever-increasing index ensures colors are always sequential
18
- let currentColor = 0;
19
- /**
20
- * Execute a command asynchronously, piping stdio by default.
21
- * @param {string} command
22
- * @param {string[]} args
23
- * @param {import("execa").Options} [opts]
24
- */
25
- function exec(command, args, opts, dryRun = false) {
26
- const options = Object.assign({ stdio: 'pipe' }, opts);
27
- const spawned = spawnProcess(command, args, options, dryRun);
28
- return dryRun ? Promise.resolve() : wrapError(spawned);
29
- }
30
- exports.exec = exec;
31
- /**
32
- * Execute a command synchronously.
33
- * @param {string} command
34
- * @param {string[]} args
35
- * @param {import("execa").SyncOptions} [opts]
36
- */
37
- function execSync(command, args, opts, dryRun = false) {
38
- // prettier-ignore
39
- return dryRun
40
- ? logExecCommand(command, args)
41
- : execa_1.default.sync(command, args, opts).stdout;
42
- }
43
- exports.execSync = execSync;
44
- /**
45
- * Spawn a command asynchronously, _always_ inheriting stdio.
46
- * @param {string} command
47
- * @param {string[]} args
48
- * @param {import("execa").Options} [opts]
49
- */
50
- function spawn(command, args, opts, dryRun = false) {
51
- const options = Object.assign({}, opts, { stdio: 'inherit' });
52
- const spawned = spawnProcess(command, args, options, dryRun);
53
- return wrapError(spawned);
54
- }
55
- exports.spawn = spawn;
56
- /**
57
- * Spawn a command asynchronously, streaming stdio with optional prefix.
58
- * @param {string} command
59
- * @param {string[]} args
60
- * @param {import("execa").Options} [opts]
61
- * @param {string} [prefix]
62
- */
63
- // istanbul ignore next
64
- function spawnStreaming(command, args, opts, prefix, dryRun = false) {
65
- const options = Object.assign({}, opts);
66
- options.stdio = ['ignore', 'pipe', 'pipe'];
67
- const spawned = spawnProcess(command, args, options, dryRun);
68
- const stdoutOpts = {};
69
- const stderrOpts = {}; // mergeMultiline causes escaped newlines :P
70
- if (prefix) {
71
- const colorName = colorWheel[currentColor % NUM_COLORS];
72
- const color = chalk_1.default[colorName];
73
- currentColor += 1;
74
- stdoutOpts.tag = `${color.bold(prefix)}:`;
75
- stderrOpts.tag = `${color(prefix)}:`;
76
- }
77
- // Avoid 'Possible EventEmitter memory leak detected' warning due to piped stdio
78
- if (children.size > process.stdout.listenerCount('close')) {
79
- process.stdout.setMaxListeners(children.size);
80
- process.stderr.setMaxListeners(children.size);
81
- }
82
- spawned.stdout.pipe((0, strong_log_transformer_1.default)(stdoutOpts)).pipe(process.stdout);
83
- spawned.stderr.pipe((0, strong_log_transformer_1.default)(stderrOpts)).pipe(process.stderr);
84
- return wrapError(spawned);
85
- }
86
- exports.spawnStreaming = spawnStreaming;
87
- function getChildProcessCount() {
88
- return children.size;
89
- }
90
- exports.getChildProcessCount = getChildProcessCount;
91
- function getExitCode(result) {
92
- var _a, _b, _c;
93
- // https://nodejs.org/docs/latest-v6.x/api/child_process.html#child_process_event_close
94
- if (typeof result.code === 'number' || typeof result.exitCode === 'number') {
95
- return (_a = result.code) !== null && _a !== void 0 ? _a : result.exitCode;
96
- }
97
- // https://nodejs.org/docs/latest-v6.x/api/errors.html#errors_error_code
98
- // istanbul ignore else
99
- if (typeof result.code === 'string' || typeof result.exitCode === 'string') {
100
- return os_1.default.constants.errno[(_b = result.code) !== null && _b !== void 0 ? _b : result.exitCode];
101
- }
102
- // istanbul ignore next: extremely weird
103
- throw new TypeError(`Received unexpected exit code value ${JSON.stringify((_c = result.code) !== null && _c !== void 0 ? _c : result.exitCode)}`);
104
- }
105
- exports.getExitCode = getExitCode;
106
- /**
107
- * @param {string} command
108
- * @param {string[]} args
109
- * @param {import("execa").Options} opts
110
- */
111
- function spawnProcess(command, args, opts, dryRun = false) {
112
- if (dryRun) {
113
- return logExecCommand(command, args);
114
- }
115
- const child = (0, execa_1.default)(command, args, opts);
116
- const drain = (_code, signal) => {
117
- children.delete(child);
118
- // don't run repeatedly if this is the error event
119
- if (signal === undefined) {
120
- child.removeListener('exit', drain);
121
- }
122
- };
123
- child.once('exit', drain);
124
- child.once('error', drain);
125
- if (opts.pkg) {
126
- child.pkg = opts.pkg;
127
- }
128
- children.add(child);
129
- return child;
130
- }
131
- exports.spawnProcess = spawnProcess;
132
- /**
133
- * Spawn a command asynchronously, _always_ inheriting stdio.
134
- * @param {string} command
135
- * @param {string[]} args
136
- * @param {import("execa").Options} [opts]
137
- */
138
- function wrapError(spawned) {
139
- if (spawned.pkg) {
140
- return spawned.catch((err) => {
141
- // ensure exit code is always a number
142
- err.exitCode = getExitCode(err);
143
- // log non-lerna error cleanly
144
- err.pkg = spawned.pkg;
145
- throw err;
146
- });
147
- }
148
- return spawned;
149
- }
150
- exports.wrapError = wrapError;
151
- /**
152
- * Log the child-process command and its arguments as dry-run (without executing the process)
153
- * @param {string} command
154
- * @param {string[]} args
155
- */
156
- function logExecCommand(command, args) {
157
- var _a;
158
- const argStr = (_a = (Array.isArray(args) ? args.join(' ') : args)) !== null && _a !== void 0 ? _a : '';
159
- const cmdList = [];
160
- for (const c of [command, argStr]) {
161
- cmdList.push(Array.isArray(c) ? c.join(' ') : c);
162
- }
163
- npmlog_1.default.info(chalk_1.default.bold.magenta('[dry-run] >'), cmdList.join(' '));
164
- return '';
165
- }
166
- exports.logExecCommand = logExecCommand;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logExecCommand = exports.wrapError = exports.spawnProcess = exports.getExitCode = exports.getChildProcessCount = exports.spawnStreaming = exports.spawn = exports.execSync = exports.exec = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const execa_1 = tslib_1.__importDefault(require("execa"));
7
+ const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
8
+ const os_1 = tslib_1.__importDefault(require("os"));
9
+ const strong_log_transformer_1 = tslib_1.__importDefault(require("strong-log-transformer"));
10
+ // bookkeeping for spawned processes
11
+ const children = new Set();
12
+ // when streaming processes are spawned, use this color for prefix
13
+ const colorWheel = ['cyan', 'magenta', 'blue', 'yellow', 'green', 'red'];
14
+ const NUM_COLORS = colorWheel.length;
15
+ // ever-increasing index ensures colors are always sequential
16
+ let currentColor = 0;
17
+ /**
18
+ * Execute a command asynchronously, piping stdio by default.
19
+ * @param {string} command
20
+ * @param {string[]} args
21
+ * @param {import("execa").Options} [opts]
22
+ */
23
+ function exec(command, args, opts, dryRun = false) {
24
+ const options = Object.assign({ stdio: 'pipe' }, opts);
25
+ const spawned = spawnProcess(command, args, options, dryRun);
26
+ return dryRun ? Promise.resolve() : wrapError(spawned);
27
+ }
28
+ exports.exec = exec;
29
+ /**
30
+ * Execute a command synchronously.
31
+ * @param {string} command
32
+ * @param {string[]} args
33
+ * @param {import("execa").SyncOptions} [opts]
34
+ */
35
+ function execSync(command, args, opts, dryRun = false) {
36
+ // prettier-ignore
37
+ return dryRun
38
+ ? logExecCommand(command, args)
39
+ : execa_1.default.sync(command, args, opts).stdout;
40
+ }
41
+ exports.execSync = execSync;
42
+ /**
43
+ * Spawn a command asynchronously, _always_ inheriting stdio.
44
+ * @param {string} command
45
+ * @param {string[]} args
46
+ * @param {import("execa").Options} [opts]
47
+ */
48
+ function spawn(command, args, opts, dryRun = false) {
49
+ const options = Object.assign({}, opts, { stdio: 'inherit' });
50
+ const spawned = spawnProcess(command, args, options, dryRun);
51
+ return wrapError(spawned);
52
+ }
53
+ exports.spawn = spawn;
54
+ /**
55
+ * Spawn a command asynchronously, streaming stdio with optional prefix.
56
+ * @param {string} command
57
+ * @param {string[]} args
58
+ * @param {import("execa").Options} [opts]
59
+ * @param {string} [prefix]
60
+ */
61
+ // istanbul ignore next
62
+ function spawnStreaming(command, args, opts, prefix, dryRun = false) {
63
+ const options = Object.assign({}, opts);
64
+ options.stdio = ['ignore', 'pipe', 'pipe'];
65
+ const spawned = spawnProcess(command, args, options, dryRun);
66
+ const stdoutOpts = {};
67
+ const stderrOpts = {}; // mergeMultiline causes escaped newlines :P
68
+ if (prefix) {
69
+ const colorName = colorWheel[currentColor % NUM_COLORS];
70
+ const color = chalk_1.default[colorName];
71
+ currentColor += 1;
72
+ stdoutOpts.tag = `${color.bold(prefix)}:`;
73
+ stderrOpts.tag = `${color(prefix)}:`;
74
+ }
75
+ // Avoid 'Possible EventEmitter memory leak detected' warning due to piped stdio
76
+ if (children.size > process.stdout.listenerCount('close')) {
77
+ process.stdout.setMaxListeners(children.size);
78
+ process.stderr.setMaxListeners(children.size);
79
+ }
80
+ spawned.stdout.pipe((0, strong_log_transformer_1.default)(stdoutOpts)).pipe(process.stdout);
81
+ spawned.stderr.pipe((0, strong_log_transformer_1.default)(stderrOpts)).pipe(process.stderr);
82
+ return wrapError(spawned);
83
+ }
84
+ exports.spawnStreaming = spawnStreaming;
85
+ function getChildProcessCount() {
86
+ return children.size;
87
+ }
88
+ exports.getChildProcessCount = getChildProcessCount;
89
+ function getExitCode(result) {
90
+ var _a, _b, _c;
91
+ // https://nodejs.org/docs/latest-v6.x/api/child_process.html#child_process_event_close
92
+ if (typeof result.code === 'number' || typeof result.exitCode === 'number') {
93
+ return (_a = result.code) !== null && _a !== void 0 ? _a : result.exitCode;
94
+ }
95
+ // https://nodejs.org/docs/latest-v6.x/api/errors.html#errors_error_code
96
+ // istanbul ignore else
97
+ if (typeof result.code === 'string' || typeof result.exitCode === 'string') {
98
+ return os_1.default.constants.errno[(_b = result.code) !== null && _b !== void 0 ? _b : result.exitCode];
99
+ }
100
+ // istanbul ignore next: extremely weird
101
+ throw new TypeError(`Received unexpected exit code value ${JSON.stringify((_c = result.code) !== null && _c !== void 0 ? _c : result.exitCode)}`);
102
+ }
103
+ exports.getExitCode = getExitCode;
104
+ /**
105
+ * @param {string} command
106
+ * @param {string[]} args
107
+ * @param {import("execa").Options} opts
108
+ */
109
+ function spawnProcess(command, args, opts, dryRun = false) {
110
+ if (dryRun) {
111
+ return logExecCommand(command, args);
112
+ }
113
+ const child = (0, execa_1.default)(command, args, opts);
114
+ const drain = (_code, signal) => {
115
+ children.delete(child);
116
+ // don't run repeatedly if this is the error event
117
+ if (signal === undefined) {
118
+ child.removeListener('exit', drain);
119
+ }
120
+ };
121
+ child.once('exit', drain);
122
+ child.once('error', drain);
123
+ if (opts.pkg) {
124
+ child.pkg = opts.pkg;
125
+ }
126
+ children.add(child);
127
+ return child;
128
+ }
129
+ exports.spawnProcess = spawnProcess;
130
+ /**
131
+ * Spawn a command asynchronously, _always_ inheriting stdio.
132
+ * @param {string} command
133
+ * @param {string[]} args
134
+ * @param {import("execa").Options} [opts]
135
+ */
136
+ function wrapError(spawned) {
137
+ if (spawned.pkg) {
138
+ return spawned.catch((err) => {
139
+ // ensure exit code is always a number
140
+ err.exitCode = getExitCode(err);
141
+ // log non-lerna error cleanly
142
+ err.pkg = spawned.pkg;
143
+ throw err;
144
+ });
145
+ }
146
+ return spawned;
147
+ }
148
+ exports.wrapError = wrapError;
149
+ /**
150
+ * Log the child-process command and its arguments as dry-run (without executing the process)
151
+ * @param {string} command
152
+ * @param {string[]} args
153
+ */
154
+ function logExecCommand(command, args) {
155
+ var _a;
156
+ const argStr = (_a = (Array.isArray(args) ? args.join(' ') : args)) !== null && _a !== void 0 ? _a : '';
157
+ const cmdList = [];
158
+ for (const c of [command, argStr]) {
159
+ cmdList.push(Array.isArray(c) ? c.join(' ') : c);
160
+ }
161
+ npmlog_1.default.info(chalk_1.default.bold.magenta('[dry-run] >'), cmdList.join(' '));
162
+ return '';
163
+ }
164
+ exports.logExecCommand = logExecCommand;
167
165
  //# sourceMappingURL=child-process.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../src/child-process.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kDAA0B;AAC1B,oDAAyB;AACzB,4CAAoB;AACpB,oFAAoD;AAIpD,oCAAoC;AACpC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;AAE3B,kEAAkE;AAClE,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;AAErC,6DAA6D;AAC7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;GAKG;AACH,SAAgB,IAAI,CAClB,OAAe,EACf,IAAc,EACd,IAAwC,EACxC,MAAM,GAAG,KAAK;IAEd,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE7D,OAAO,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACzD,CAAC;AAVD,oBAUC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,IAAe,EAAE,IAAgC,EAAE,MAAM,GAAG,KAAK;IACzG,kBAAkB;IAClB,OAAO,MAAM;QACX,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC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C,CAAC,CAAC,CAAC,CAAC;KAClD;IAED,gBAAG,CAAC,IAAI,CAAC,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,CAAC;AACZ,CAAC;AAVD,wCAUC"}
package/dist/command.d.ts CHANGED
@@ -1,37 +1,37 @@
1
- import { Logger } from 'npmlog';
2
- import { Project } from './project/project';
3
- import { ChangedCommandOption, CommandType, DiffCommandOption, ExecCommandOption, ExecOpts, InitCommandOption, ListCommandOption, ProjectConfig, PublishCommandOption, VersionCommandOption, WatchCommandOption } from './models';
4
- import { PackageGraph } from './package-graph/package-graph';
5
- type AvailableCommandOption = ChangedCommandOption | DiffCommandOption | ExecCommandOption | InitCommandOption | ListCommandOption | PublishCommandOption | VersionCommandOption | WatchCommandOption | ProjectConfig;
6
- export declare class Command<T extends AvailableCommandOption> {
7
- argv: any;
8
- concurrency: number;
9
- envDefaults: any;
10
- sort: any;
11
- toposort?: boolean;
12
- execOpts: ExecOpts;
13
- commandName: CommandType;
14
- composed: any;
15
- logger: Logger;
16
- options: T & ExecOpts & ProjectConfig;
17
- project: Project;
18
- packageGraph: PackageGraph;
19
- runner?: Promise<any>;
20
- constructor(_argv: AvailableCommandOption);
21
- then(onResolved: typeof Promise.resolve, onRejected: typeof Promise.reject): Promise<unknown> | undefined;
22
- catch(onRejected: typeof Promise.reject): Promise<any> | undefined;
23
- get requiresGit(): boolean;
24
- get otherCommandConfigs(): string[];
25
- configureEnvironment(): void;
26
- configureOptions(): void;
27
- configureProperties(): void;
28
- configureLogging(): void;
29
- enableProgressBar(): void;
30
- gitInitialized(): boolean;
31
- runValidations(): void;
32
- runPreparations(): Promise<any> | void;
33
- runCommand(): Promise<any>;
34
- initialize(): any | Promise<any>;
35
- execute(): any | Promise<any>;
36
- }
37
- export {};
1
+ import { Logger } from 'npmlog';
2
+ import { Project } from './project/project';
3
+ import { ChangedCommandOption, CommandType, DiffCommandOption, ExecCommandOption, ExecOpts, InitCommandOption, ListCommandOption, ProjectConfig, PublishCommandOption, VersionCommandOption, WatchCommandOption } from './models';
4
+ import { PackageGraph } from './package-graph/package-graph';
5
+ type AvailableCommandOption = ChangedCommandOption | DiffCommandOption | ExecCommandOption | InitCommandOption | ListCommandOption | PublishCommandOption | VersionCommandOption | WatchCommandOption | ProjectConfig;
6
+ export declare class Command<T extends AvailableCommandOption> {
7
+ argv: any;
8
+ concurrency: number;
9
+ envDefaults: any;
10
+ sort: any;
11
+ toposort?: boolean;
12
+ execOpts: ExecOpts;
13
+ commandName: CommandType;
14
+ composed: any;
15
+ logger: Logger;
16
+ options: T & ExecOpts & ProjectConfig;
17
+ project: Project;
18
+ packageGraph: PackageGraph;
19
+ runner?: Promise<any>;
20
+ constructor(_argv: AvailableCommandOption);
21
+ then(onResolved: typeof Promise.resolve, onRejected: typeof Promise.reject): Promise<unknown> | undefined;
22
+ catch(onRejected: typeof Promise.reject): Promise<any> | undefined;
23
+ get requiresGit(): boolean;
24
+ get otherCommandConfigs(): string[];
25
+ configureEnvironment(): void;
26
+ configureOptions(): void;
27
+ configureProperties(): void;
28
+ configureLogging(): void;
29
+ enableProgressBar(): void;
30
+ gitInitialized(): boolean;
31
+ runValidations(): void;
32
+ runPreparations(): Promise<any> | void;
33
+ runCommand(): Promise<any>;
34
+ initialize(): any | Promise<any>;
35
+ execute(): any | Promise<any>;
36
+ }
37
+ export {};