@teams-max/mwsp 1.0.2 → 2.0.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/bin/mwsp.js +2 -31
- package/es/cli/build.d.ts +0 -1
- package/es/cli/build.js +69 -61
- package/es/cli/cli.js +4 -12
- package/es/cli/start.d.ts +0 -1
- package/es/cli/start.js +48 -26
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/utils/chalk/LICENSE +9 -0
- package/es/utils/chalk/index.d.ts +416 -0
- package/es/utils/chalk/index.js +1719 -0
- package/es/utils/chalk/package.json +6 -0
- package/es/{cli/update.js → utils/changelog.js} +41 -34
- package/es/utils/cross-spawn/package.json +7 -0
- package/es/{internal → utils}/datetimeFormat.js +1 -3
- package/es/utils/defineConfig.js +20 -0
- package/es/{internal → utils}/exec.js +3 -2
- package/{lib/internal → es/utils}/execa/index.d.ts +41 -11
- package/es/utils/execa/package.json +11 -0
- package/es/utils/getPackages.js +9 -0
- package/es/{cli/dev.js → utils/git.js} +88 -36
- package/es/{internal/utils.js → utils/index.js} +270 -70
- package/es/utils/isNextVersion.js +3 -0
- package/{lib/internal → es/utils}/merge-stream/index.d.ts +3 -1
- package/es/utils/merge-stream/package.json +7 -0
- package/es/utils/parseDoc.js +33 -0
- package/es/utils/yargs-parser/index.d.ts +114 -0
- package/es/utils/yargs-parser/index.js +919 -0
- package/es/utils/yargs-parser/package.json +7 -0
- package/lib/cli/build.d.ts +0 -1
- package/lib/cli/build.js +54 -50
- package/lib/cli/cli.js +0 -8
- package/lib/cli/start.d.ts +0 -1
- package/lib/cli/start.js +25 -30
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/utils/chalk/LICENSE +9 -0
- package/lib/utils/chalk/index.d.ts +416 -0
- package/lib/utils/chalk/index.js +1538 -0
- package/lib/utils/chalk/package.json +6 -0
- package/lib/utils/changelog.js +21 -0
- package/lib/{internal → utils}/cross-spawn/index.js +9 -3
- package/lib/utils/cross-spawn/package.json +7 -0
- package/lib/{internal → utils}/datetimeFormat.js +14 -30
- package/lib/utils/defineConfig.js +26 -0
- package/lib/utils/exec.js +23 -0
- package/{es/internal → lib/utils}/execa/index.d.ts +41 -11
- package/lib/{internal → utils}/execa/index.js +76 -18
- package/lib/utils/execa/package.json +11 -0
- package/lib/utils/getPackages.js +8 -0
- package/lib/utils/git.js +31 -0
- package/lib/utils/index.js +183 -0
- package/lib/utils/isNextVersion.js +4 -0
- package/{es/internal → lib/utils}/merge-stream/index.d.ts +3 -1
- package/lib/{internal → utils}/merge-stream/index.js +1 -1
- package/lib/utils/merge-stream/package.json +7 -0
- package/lib/utils/parseDoc.js +30 -0
- package/lib/utils/yargs-parser/index.d.ts +114 -0
- package/lib/utils/yargs-parser/index.js +919 -0
- package/lib/utils/yargs-parser/package.json +7 -0
- package/package.json +7 -14
- package/es/cli/dev.d.ts +0 -1
- package/es/cli/update.d.ts +0 -2
- package/es/internal/buildNotify.d.ts +0 -10
- package/es/internal/buildNotify.js +0 -123
- package/es/internal/cross-spawn/package.json +0 -1
- package/es/internal/datetimeFormat.d.ts +0 -9
- package/es/internal/exec.d.ts +0 -1
- package/es/internal/execa/package.json +0 -1
- package/es/internal/merge-stream/package.json +0 -1
- package/es/internal/utils.d.ts +0 -14
- package/lib/cli/dev.d.ts +0 -1
- package/lib/cli/dev.js +0 -62
- package/lib/cli/update.d.ts +0 -2
- package/lib/cli/update.js +0 -50
- package/lib/internal/buildNotify.d.ts +0 -10
- package/lib/internal/buildNotify.js +0 -112
- package/lib/internal/cross-spawn/package.json +0 -1
- package/lib/internal/datetimeFormat.d.ts +0 -9
- package/lib/internal/exec.d.ts +0 -1
- package/lib/internal/exec.js +0 -60
- package/lib/internal/execa/package.json +0 -1
- package/lib/internal/merge-stream/package.json +0 -1
- package/lib/internal/utils.d.ts +0 -14
- package/lib/internal/utils.js +0 -100
- /package/es/{internal → utils}/cross-spawn/LICENSE +0 -0
- /package/es/{internal → utils}/cross-spawn/index.d.ts +0 -0
- /package/es/{internal → utils}/cross-spawn/index.js +0 -0
- /package/es/{internal → utils}/execa/LICENSE +0 -0
- /package/es/{internal → utils}/execa/index.js +0 -0
- /package/es/{internal → utils}/merge-stream/LICENSE +0 -0
- /package/es/{internal → utils}/merge-stream/index.js +0 -0
- /package/lib/{internal → utils}/cross-spawn/LICENSE +0 -0
- /package/lib/{internal → utils}/cross-spawn/index.d.ts +0 -0
- /package/lib/{internal → utils}/execa/LICENSE +0 -0
- /package/lib/{internal → utils}/merge-stream/LICENSE +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/utils/changelog.js
|
|
2
|
+
var { htmlEscape } = require("escape-goat");
|
|
3
|
+
var git = require("./git");
|
|
4
|
+
exports.getChangelog = async () => {
|
|
5
|
+
const repoUrl = "https://v.src.corp.qihoo.net/it_informatization/pro-teams";
|
|
6
|
+
const latest = await git.latestTagOrFirstCommit();
|
|
7
|
+
const log = await git.commitLogFromRevision(latest);
|
|
8
|
+
if (!log) {
|
|
9
|
+
throw new Error(`get changelog failed, no new commits was found.`);
|
|
10
|
+
}
|
|
11
|
+
const commits = log.split("\n").map((commit) => {
|
|
12
|
+
const splitIndex = commit.lastIndexOf(" ");
|
|
13
|
+
return {
|
|
14
|
+
message: commit.slice(0, splitIndex),
|
|
15
|
+
id: commit.slice(splitIndex + 1)
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
return (nextTag) => commits.map((commit) => `- ${htmlEscape(commit.message)} ${commit.id}`).join("\n") + `
|
|
19
|
+
|
|
20
|
+
${repoUrl}/compare/${latest}...${nextTag}`;
|
|
21
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/utils/cross-spawn/index.js
|
|
2
2
|
module.exports = (() => {
|
|
3
3
|
var t = {
|
|
4
4
|
746: (t2, e2, n) => {
|
|
@@ -182,7 +182,10 @@ module.exports = (() => {
|
|
|
182
182
|
}
|
|
183
183
|
let u;
|
|
184
184
|
try {
|
|
185
|
-
u = s.sync(t3.command, {
|
|
185
|
+
u = s.sync(t3.command, {
|
|
186
|
+
path: n2[o({ env: n2 })],
|
|
187
|
+
pathExt: e3 ? r.delimiter : void 0
|
|
188
|
+
});
|
|
186
189
|
} catch (t4) {
|
|
187
190
|
} finally {
|
|
188
191
|
if (a) {
|
|
@@ -356,7 +359,10 @@ module.exports = (() => {
|
|
|
356
359
|
const i = (t3) => Object.assign(new Error(`not found: ${t3}`), { code: "ENOENT" });
|
|
357
360
|
const a = (t3, e3) => {
|
|
358
361
|
const n2 = e3.colon || o;
|
|
359
|
-
const s2 = t3.match(/\//) || r && t3.match(/\\/) ? [""] : [
|
|
362
|
+
const s2 = t3.match(/\//) || r && t3.match(/\\/) ? [""] : [
|
|
363
|
+
...r ? [process.cwd()] : [],
|
|
364
|
+
...(e3.path || process.env.PATH || "").split(n2)
|
|
365
|
+
];
|
|
360
366
|
const c2 = r ? e3.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
361
367
|
const i2 = r ? c2.split(n2) : [""];
|
|
362
368
|
if (r) {
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/internal/datetimeFormat.ts
|
|
20
|
-
var datetimeFormat_exports = {};
|
|
21
|
-
__export(datetimeFormat_exports, {
|
|
22
|
-
default: () => datetimeFormat_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(datetimeFormat_exports);
|
|
1
|
+
// src/utils/datetimeFormat.js
|
|
25
2
|
function isValidDate(value) {
|
|
26
3
|
const date = new Date(value);
|
|
27
4
|
return date instanceof Date && !isNaN(date.valueOf());
|
|
@@ -80,7 +57,10 @@ function datetimeFormat(value, format, isCoerce) {
|
|
|
80
57
|
// 毫秒
|
|
81
58
|
};
|
|
82
59
|
if (/(y+)/.test(format)) {
|
|
83
|
-
format = format.replace(
|
|
60
|
+
format = format.replace(
|
|
61
|
+
RegExp.$1,
|
|
62
|
+
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
|
63
|
+
);
|
|
84
64
|
}
|
|
85
65
|
const week = {
|
|
86
66
|
0: "\u65E5",
|
|
@@ -92,15 +72,19 @@ function datetimeFormat(value, format, isCoerce) {
|
|
|
92
72
|
6: "\u516D"
|
|
93
73
|
};
|
|
94
74
|
if (/(E+)/.test(format)) {
|
|
95
|
-
format = format.replace(
|
|
75
|
+
format = format.replace(
|
|
76
|
+
RegExp.$1,
|
|
77
|
+
(RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "\u661F\u671F" : "\u5468" : "") + week[date.getDay() + ""]
|
|
78
|
+
);
|
|
96
79
|
}
|
|
97
80
|
for (const k in o) {
|
|
98
81
|
if (new RegExp("(" + k + ")").test(format)) {
|
|
99
|
-
format = format.replace(
|
|
82
|
+
format = format.replace(
|
|
83
|
+
RegExp.$1,
|
|
84
|
+
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
|
|
85
|
+
);
|
|
100
86
|
}
|
|
101
87
|
}
|
|
102
88
|
return format;
|
|
103
89
|
}
|
|
104
|
-
|
|
105
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
-
0 && (module.exports = {});
|
|
90
|
+
module.exports = datetimeFormat;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/utils/defineConfig.js
|
|
2
|
+
var path = require("path");
|
|
3
|
+
var { logStep, printErrorAndExit } = require("./index");
|
|
4
|
+
function defineConfig(config) {
|
|
5
|
+
if (!process.env.ASG_DIR) {
|
|
6
|
+
logStep("The Asgard directory does not exist, using default config...");
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
let iConfigFromPlugins = null;
|
|
10
|
+
try {
|
|
11
|
+
iConfigFromPlugins = require(path.join(
|
|
12
|
+
process.env.ASG_DIR,
|
|
13
|
+
"base",
|
|
14
|
+
"pluginConfig.js"
|
|
15
|
+
));
|
|
16
|
+
} catch (error) {
|
|
17
|
+
printErrorAndExit(
|
|
18
|
+
"The Asgard directory does not exist.",
|
|
19
|
+
`Reason: ${error.message}`
|
|
20
|
+
);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
logStep("The Asgard directory exists, using config from plugins...");
|
|
24
|
+
return iConfigFromPlugins(config);
|
|
25
|
+
}
|
|
26
|
+
module.exports = defineConfig;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/utils/exec.js
|
|
2
|
+
var { spawn } = require("child_process");
|
|
3
|
+
module.exports = function exec(command, args, opts) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const child = spawn(command, args, {
|
|
6
|
+
shell: true,
|
|
7
|
+
stdio: "inherit",
|
|
8
|
+
env: process.env,
|
|
9
|
+
...opts
|
|
10
|
+
});
|
|
11
|
+
child.once("error", (err) => {
|
|
12
|
+
console.log(err);
|
|
13
|
+
reject(err);
|
|
14
|
+
});
|
|
15
|
+
child.once("close", (code) => {
|
|
16
|
+
if (code === 1) {
|
|
17
|
+
process.exit(1);
|
|
18
|
+
} else {
|
|
19
|
+
resolve();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/// <reference types="node"/>
|
|
2
2
|
import { ChildProcess } from 'child_process';
|
|
3
|
-
import {
|
|
3
|
+
import { Readable as ReadableStream, Stream } from 'stream';
|
|
4
4
|
|
|
5
5
|
declare namespace execa {
|
|
6
|
-
type StdioOption =
|
|
6
|
+
type StdioOption =
|
|
7
|
+
| 'pipe'
|
|
8
|
+
| 'ipc'
|
|
9
|
+
| 'ignore'
|
|
10
|
+
| 'inherit'
|
|
11
|
+
| Stream
|
|
12
|
+
| number
|
|
13
|
+
| undefined;
|
|
7
14
|
|
|
8
15
|
interface CommonOptions<EncodingType> {
|
|
9
16
|
/**
|
|
@@ -220,7 +227,8 @@ declare namespace execa {
|
|
|
220
227
|
readonly input?: string | Buffer | ReadableStream;
|
|
221
228
|
}
|
|
222
229
|
|
|
223
|
-
interface SyncOptions<EncodingType = string>
|
|
230
|
+
interface SyncOptions<EncodingType = string>
|
|
231
|
+
extends CommonOptions<EncodingType> {
|
|
224
232
|
/**
|
|
225
233
|
Write some input to the `stdin` of your binary.
|
|
226
234
|
*/
|
|
@@ -347,7 +355,8 @@ declare namespace execa {
|
|
|
347
355
|
originalMessage?: string;
|
|
348
356
|
}
|
|
349
357
|
|
|
350
|
-
interface ExecaError<StdoutErrorType = string>
|
|
358
|
+
interface ExecaError<StdoutErrorType = string>
|
|
359
|
+
extends ExecaSyncError<StdoutErrorType> {
|
|
351
360
|
/**
|
|
352
361
|
The output of the process with `stdout` and `stderr` interleaved.
|
|
353
362
|
|
|
@@ -376,7 +385,9 @@ declare namespace execa {
|
|
|
376
385
|
|
|
377
386
|
interface ExecaChildPromise<StdoutErrorType> {
|
|
378
387
|
catch<ResultType = never>(
|
|
379
|
-
onRejected?: (
|
|
388
|
+
onRejected?: (
|
|
389
|
+
reason: ExecaError<StdoutErrorType>,
|
|
390
|
+
) => ResultType | PromiseLike<ResultType>,
|
|
380
391
|
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
|
|
381
392
|
|
|
382
393
|
/**
|
|
@@ -438,14 +449,21 @@ declare const execa: {
|
|
|
438
449
|
execa('echo', ['unicorns']).stdout.pipe(process.stdout);
|
|
439
450
|
```
|
|
440
451
|
*/
|
|
441
|
-
(
|
|
452
|
+
(
|
|
453
|
+
file: string,
|
|
454
|
+
arguments?: readonly string[],
|
|
455
|
+
options?: execa.Options,
|
|
456
|
+
): execa.ExecaChildProcess;
|
|
442
457
|
(
|
|
443
458
|
file: string,
|
|
444
459
|
arguments?: readonly string[],
|
|
445
460
|
options?: execa.Options<null>,
|
|
446
461
|
): execa.ExecaChildProcess<Buffer>;
|
|
447
462
|
(file: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
448
|
-
(
|
|
463
|
+
(
|
|
464
|
+
file: string,
|
|
465
|
+
options?: execa.Options<null>,
|
|
466
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
449
467
|
|
|
450
468
|
/**
|
|
451
469
|
Execute a file synchronously.
|
|
@@ -467,7 +485,10 @@ declare const execa: {
|
|
|
467
485
|
options?: execa.SyncOptions<null>,
|
|
468
486
|
): execa.ExecaSyncReturnValue<Buffer>;
|
|
469
487
|
sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
470
|
-
sync(
|
|
488
|
+
sync(
|
|
489
|
+
file: string,
|
|
490
|
+
options?: execa.SyncOptions<null>,
|
|
491
|
+
): execa.ExecaSyncReturnValue<Buffer>;
|
|
471
492
|
|
|
472
493
|
/**
|
|
473
494
|
Same as `execa()` except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.
|
|
@@ -491,7 +512,10 @@ declare const execa: {
|
|
|
491
512
|
```
|
|
492
513
|
*/
|
|
493
514
|
command(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
494
|
-
command(
|
|
515
|
+
command(
|
|
516
|
+
command: string,
|
|
517
|
+
options?: execa.Options<null>,
|
|
518
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
495
519
|
|
|
496
520
|
/**
|
|
497
521
|
Same as `execa.command()` but synchronous.
|
|
@@ -499,7 +523,10 @@ declare const execa: {
|
|
|
499
523
|
@param command - The program/script to execute and its arguments.
|
|
500
524
|
@returns A result `Object` with `stdout` and `stderr` properties.
|
|
501
525
|
*/
|
|
502
|
-
commandSync(
|
|
526
|
+
commandSync(
|
|
527
|
+
command: string,
|
|
528
|
+
options?: execa.SyncOptions,
|
|
529
|
+
): execa.ExecaSyncReturnValue;
|
|
503
530
|
commandSync(
|
|
504
531
|
command: string,
|
|
505
532
|
options?: execa.SyncOptions<null>,
|
|
@@ -528,7 +555,10 @@ declare const execa: {
|
|
|
528
555
|
options?: execa.Options<null>,
|
|
529
556
|
): execa.ExecaChildProcess<Buffer>;
|
|
530
557
|
node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
531
|
-
node(
|
|
558
|
+
node(
|
|
559
|
+
scriptPath: string,
|
|
560
|
+
options?: execa.Options<null>,
|
|
561
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
532
562
|
};
|
|
533
563
|
|
|
534
564
|
export = execa;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/utils/execa/index.js
|
|
2
2
|
module.exports = (() => {
|
|
3
3
|
var e = {
|
|
4
4
|
205: (e2, t2, r) => {
|
|
@@ -102,7 +102,12 @@ module.exports = (() => {
|
|
|
102
102
|
const c = r(82);
|
|
103
103
|
const u = r(187);
|
|
104
104
|
const d = r(166);
|
|
105
|
-
const {
|
|
105
|
+
const {
|
|
106
|
+
spawnedKill: l,
|
|
107
|
+
spawnedCancel: f,
|
|
108
|
+
setupTimeout: p,
|
|
109
|
+
setExitHandler: m
|
|
110
|
+
} = r(819);
|
|
106
111
|
const {
|
|
107
112
|
handleInput: x,
|
|
108
113
|
getSpawnedResult: b,
|
|
@@ -112,7 +117,13 @@ module.exports = (() => {
|
|
|
112
117
|
const { mergePromise: y, getSpawnedPromise: h } = r(814);
|
|
113
118
|
const { joinCommand: S, parseCommand: w } = r(286);
|
|
114
119
|
const I = 1e3 * 1e3 * 100;
|
|
115
|
-
const G = ({
|
|
120
|
+
const G = ({
|
|
121
|
+
env: e3,
|
|
122
|
+
extendEnv: t3,
|
|
123
|
+
preferLocal: r2,
|
|
124
|
+
localDir: n2,
|
|
125
|
+
execPath: o2
|
|
126
|
+
}) => {
|
|
116
127
|
const i2 = t3 ? { ...process.env, ...e3 } : e3;
|
|
117
128
|
if (r2) {
|
|
118
129
|
return a.env({ env: i2, cwd: n2, execPath: o2 });
|
|
@@ -185,11 +196,7 @@ module.exports = (() => {
|
|
|
185
196
|
a2.kill = l.bind(null, a2.kill.bind(a2));
|
|
186
197
|
a2.cancel = f.bind(null, a2, I2);
|
|
187
198
|
const G2 = async () => {
|
|
188
|
-
const [{ error: e4, exitCode: t4, signal: r3, timedOut: o2 }, i2, c2, d3] = await b(
|
|
189
|
-
a2,
|
|
190
|
-
n2.options,
|
|
191
|
-
w2
|
|
192
|
-
);
|
|
199
|
+
const [{ error: e4, exitCode: t4, signal: r3, timedOut: o2 }, i2, c2, d3] = await b(a2, n2.options, w2);
|
|
193
200
|
const l2 = E(n2.options, i2);
|
|
194
201
|
const f2 = E(n2.options, c2);
|
|
195
202
|
const p2 = E(n2.options, d3);
|
|
@@ -296,7 +303,10 @@ module.exports = (() => {
|
|
|
296
303
|
t3 = [];
|
|
297
304
|
}
|
|
298
305
|
const n2 = d.node(r2);
|
|
299
|
-
const {
|
|
306
|
+
const {
|
|
307
|
+
nodePath: o2 = process.execPath,
|
|
308
|
+
nodeOptions: i2 = process.execArgv
|
|
309
|
+
} = r2;
|
|
300
310
|
return C(o2, [...i2, e3, ...Array.isArray(t3) ? t3 : []], {
|
|
301
311
|
...r2,
|
|
302
312
|
stdin: void 0,
|
|
@@ -500,7 +510,12 @@ ${i2.message}` : b;
|
|
|
500
510
|
i2();
|
|
501
511
|
});
|
|
502
512
|
};
|
|
503
|
-
e2.exports = {
|
|
513
|
+
e2.exports = {
|
|
514
|
+
spawnedKill: s,
|
|
515
|
+
spawnedCancel: l,
|
|
516
|
+
setupTimeout: p,
|
|
517
|
+
setExitHandler: m
|
|
518
|
+
};
|
|
504
519
|
},
|
|
505
520
|
814: (e2) => {
|
|
506
521
|
"use strict";
|
|
@@ -642,10 +657,17 @@ ${i2.message}` : b;
|
|
|
642
657
|
};
|
|
643
658
|
const l = ({ input: e3 }) => {
|
|
644
659
|
if (n(e3)) {
|
|
645
|
-
throw new TypeError(
|
|
660
|
+
throw new TypeError(
|
|
661
|
+
"The `input` option cannot be a stream in sync mode"
|
|
662
|
+
);
|
|
646
663
|
}
|
|
647
664
|
};
|
|
648
|
-
e2.exports = {
|
|
665
|
+
e2.exports = {
|
|
666
|
+
handleInput: s,
|
|
667
|
+
makeAllStream: a,
|
|
668
|
+
getSpawnedResult: d,
|
|
669
|
+
validateInputSync: l
|
|
670
|
+
};
|
|
649
671
|
},
|
|
650
672
|
585: (e2, t2, r) => {
|
|
651
673
|
"use strict";
|
|
@@ -774,8 +796,20 @@ ${i2.message}` : b;
|
|
|
774
796
|
description: "Debugger breakpoint",
|
|
775
797
|
standard: "posix"
|
|
776
798
|
},
|
|
777
|
-
{
|
|
778
|
-
|
|
799
|
+
{
|
|
800
|
+
name: "SIGABRT",
|
|
801
|
+
number: 6,
|
|
802
|
+
action: "core",
|
|
803
|
+
description: "Aborted",
|
|
804
|
+
standard: "ansi"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: "SIGIOT",
|
|
808
|
+
number: 6,
|
|
809
|
+
action: "core",
|
|
810
|
+
description: "Aborted",
|
|
811
|
+
standard: "bsd"
|
|
812
|
+
},
|
|
779
813
|
{
|
|
780
814
|
name: "SIGBUS",
|
|
781
815
|
number: 7,
|
|
@@ -1010,7 +1044,15 @@ ${i2.message}` : b;
|
|
|
1010
1044
|
const e3 = (0, o.getSignals)();
|
|
1011
1045
|
return e3.reduce(a, {});
|
|
1012
1046
|
};
|
|
1013
|
-
const a = function(e3, {
|
|
1047
|
+
const a = function(e3, {
|
|
1048
|
+
name: t3,
|
|
1049
|
+
number: r2,
|
|
1050
|
+
description: n2,
|
|
1051
|
+
supported: o2,
|
|
1052
|
+
action: i2,
|
|
1053
|
+
forced: s2,
|
|
1054
|
+
standard: a2
|
|
1055
|
+
}) {
|
|
1014
1056
|
return {
|
|
1015
1057
|
...e3,
|
|
1016
1058
|
[t3]: {
|
|
@@ -1037,7 +1079,14 @@ ${i2.message}` : b;
|
|
|
1037
1079
|
if (r2 === void 0) {
|
|
1038
1080
|
return {};
|
|
1039
1081
|
}
|
|
1040
|
-
const {
|
|
1082
|
+
const {
|
|
1083
|
+
name: n2,
|
|
1084
|
+
description: o2,
|
|
1085
|
+
supported: i2,
|
|
1086
|
+
action: s2,
|
|
1087
|
+
forced: a2,
|
|
1088
|
+
standard: c2
|
|
1089
|
+
} = r2;
|
|
1041
1090
|
return {
|
|
1042
1091
|
[e3]: {
|
|
1043
1092
|
name: n2,
|
|
@@ -1144,7 +1193,12 @@ ${i2.message}` : b;
|
|
|
1144
1193
|
const n = r(622);
|
|
1145
1194
|
const o = r(278);
|
|
1146
1195
|
const i = (e3) => {
|
|
1147
|
-
e3 = {
|
|
1196
|
+
e3 = {
|
|
1197
|
+
cwd: process.cwd(),
|
|
1198
|
+
path: process.env[o()],
|
|
1199
|
+
execPath: process.execPath,
|
|
1200
|
+
...e3
|
|
1201
|
+
};
|
|
1148
1202
|
let t3;
|
|
1149
1203
|
let r2 = n.resolve(e3.cwd);
|
|
1150
1204
|
const i2 = [];
|
|
@@ -1359,7 +1413,11 @@ ${i2.message}` : b;
|
|
|
1359
1413
|
a.infinite = true;
|
|
1360
1414
|
}
|
|
1361
1415
|
e2.exports = function(e3, t3) {
|
|
1362
|
-
n.equal(
|
|
1416
|
+
n.equal(
|
|
1417
|
+
typeof e3,
|
|
1418
|
+
"function",
|
|
1419
|
+
"a callback must be provided for exit handler"
|
|
1420
|
+
);
|
|
1363
1421
|
if (u === false) {
|
|
1364
1422
|
load();
|
|
1365
1423
|
}
|
package/lib/utils/git.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/utils/git.js
|
|
2
|
+
var { execa, chalk, yParser } = require("./index");
|
|
3
|
+
exports.latestTag = async () => {
|
|
4
|
+
const { stdout } = await execa("git", ["describe", "--abbrev=0", "--tags"]);
|
|
5
|
+
return stdout;
|
|
6
|
+
};
|
|
7
|
+
var firstCommit = async () => {
|
|
8
|
+
const { stdout } = await execa("git", [
|
|
9
|
+
"rev-list",
|
|
10
|
+
"--max-parents=0",
|
|
11
|
+
"HEAD"
|
|
12
|
+
]);
|
|
13
|
+
return stdout;
|
|
14
|
+
};
|
|
15
|
+
exports.latestTagOrFirstCommit = async () => {
|
|
16
|
+
let latest;
|
|
17
|
+
try {
|
|
18
|
+
latest = await exports.latestTag();
|
|
19
|
+
} catch (_) {
|
|
20
|
+
latest = await firstCommit();
|
|
21
|
+
}
|
|
22
|
+
return latest;
|
|
23
|
+
};
|
|
24
|
+
exports.commitLogFromRevision = async (revision) => {
|
|
25
|
+
const { stdout } = await execa("git", [
|
|
26
|
+
"log",
|
|
27
|
+
"--format=%s %h",
|
|
28
|
+
`${revision}..HEAD`
|
|
29
|
+
]);
|
|
30
|
+
return stdout;
|
|
31
|
+
};
|