@teams-max/mwsp 2.0.0 → 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 -2
- package/es/cli/build.js +1 -1
- package/es/utils/chalk/package.json +6 -1
- package/es/utils/cross-spawn/package.json +7 -1
- package/es/utils/execa/index.d.ts +41 -11
- package/es/utils/execa/package.json +11 -1
- package/es/utils/index.js +88 -44
- package/es/utils/merge-stream/index.d.ts +3 -1
- package/es/utils/merge-stream/package.json +7 -1
- package/es/utils/yargs-parser/index.d.ts +3 -1
- package/es/utils/yargs-parser/package.json +7 -1
- package/lib/cli/build.js +1 -1
- package/lib/utils/chalk/index.js +56 -13
- package/lib/utils/chalk/package.json +6 -1
- package/lib/utils/cross-spawn/index.js +8 -2
- package/lib/utils/cross-spawn/package.json +7 -1
- package/lib/utils/datetimeFormat.js +4 -1
- package/lib/utils/defineConfig.js +9 -2
- package/lib/utils/execa/index.d.ts +41 -11
- package/lib/utils/execa/index.js +75 -17
- package/lib/utils/execa/package.json +11 -1
- package/lib/utils/getPackages.js +3 -1
- package/lib/utils/git.js +10 -2
- package/lib/utils/index.js +43 -19
- package/lib/utils/merge-stream/index.d.ts +3 -1
- package/lib/utils/merge-stream/package.json +7 -1
- package/lib/utils/yargs-parser/index.d.ts +3 -1
- package/lib/utils/yargs-parser/index.js +17 -3
- package/lib/utils/yargs-parser/package.json +7 -1
- package/package.json +5 -5
package/bin/mwsp.js
CHANGED
package/es/cli/build.js
CHANGED
|
@@ -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 +1,11 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "execa",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Sindre Sorhus",
|
|
6
|
+
"email": "sindresorhus@gmail.com",
|
|
7
|
+
"url": "https://sindresorhus.com"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"types": "index.d.ts"
|
|
11
|
+
}
|
package/es/utils/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
3
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
11
|
var fs = require('fs');
|
|
@@ -35,6 +41,16 @@ function printErrorAndExit() {
|
|
|
35
41
|
printError(args);
|
|
36
42
|
process.exit(1);
|
|
37
43
|
}
|
|
44
|
+
function pickDependencies(dependencies, isDev) {
|
|
45
|
+
var pkgs = require(join(cwd, 'package.json'));
|
|
46
|
+
return dependencies.filter(function (p) {
|
|
47
|
+
if (isDev) {
|
|
48
|
+
return !pkgs.devDependencies[p];
|
|
49
|
+
} else {
|
|
50
|
+
return !pkgs.dependencies[p];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
38
54
|
function getCfg() {
|
|
39
55
|
var pkgs = require(join(cwd, 'package.json'));
|
|
40
56
|
var _pkgs$infra = pkgs.infra,
|
|
@@ -92,7 +108,7 @@ function fetchRemoteRepository() {
|
|
|
92
108
|
}
|
|
93
109
|
function _fetchRemoteRepository() {
|
|
94
110
|
_fetchRemoteRepository = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
95
|
-
var cfg, infra, directory, ASG_BRAHCH, JENKINS_BUILD, remoteUrl, doesExist, _yield$inquirer$promp, syncUp, infraBranchsOutput, infraBranchArray, filteredBranches, defaultBrancheIdx, questions;
|
|
111
|
+
var cfg, infra, directory, ASG_BRAHCH, JENKINS_BUILD, remoteUrl, doesExist, proDevDeps, proDeps, maxDevDeps, maxDeps, _yield$inquirer$promp, syncUp, infraBranchsOutput, infraBranchArray, filteredBranches, defaultBrancheIdx, questions;
|
|
96
112
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
97
113
|
while (1) switch (_context.prev = _context.next) {
|
|
98
114
|
case 0:
|
|
@@ -101,7 +117,7 @@ function _fetchRemoteRepository() {
|
|
|
101
117
|
remoteUrl = infra.url;
|
|
102
118
|
doesExist = checkDirectoryExistsSync(directory);
|
|
103
119
|
if (doesExist) {
|
|
104
|
-
_context.next =
|
|
120
|
+
_context.next = 36;
|
|
105
121
|
break;
|
|
106
122
|
}
|
|
107
123
|
logStep('Cloning the repository from GitHub...');
|
|
@@ -109,75 +125,103 @@ function _fetchRemoteRepository() {
|
|
|
109
125
|
logStep('Cloning completed.');
|
|
110
126
|
logStep('Installing dependencies...');
|
|
111
127
|
if (!((infra === null || infra === void 0 ? void 0 : infra.arch) === 'PRO')) {
|
|
112
|
-
_context.next =
|
|
128
|
+
_context.next = 22;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
proDevDeps = pickDependencies(['snb-mock-middleware', 'lodash-webpack-plugin'], true);
|
|
132
|
+
_context.t0 = !!proDevDeps.length;
|
|
133
|
+
if (!_context.t0) {
|
|
134
|
+
_context.next = 15;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
_context.next = 15;
|
|
138
|
+
return exec('yarn', ['add'].concat(_toConsumableArray(proDevDeps), ['-D']));
|
|
139
|
+
case 15:
|
|
140
|
+
proDeps = pickDependencies(['@teams-max/skynet', 'history']);
|
|
141
|
+
_context.t1 = !!proDeps.length;
|
|
142
|
+
if (!_context.t1) {
|
|
143
|
+
_context.next = 20;
|
|
113
144
|
break;
|
|
114
145
|
}
|
|
115
|
-
_context.next =
|
|
116
|
-
return exec('yarn', ['add'
|
|
117
|
-
case
|
|
118
|
-
_context.next =
|
|
119
|
-
return exec('yarn', ['add', '@teams-max/skynet', 'history']);
|
|
120
|
-
case 14:
|
|
121
|
-
_context.next = 21;
|
|
146
|
+
_context.next = 20;
|
|
147
|
+
return exec('yarn', ['add'].concat(_toConsumableArray(proDeps)));
|
|
148
|
+
case 20:
|
|
149
|
+
_context.next = 33;
|
|
122
150
|
break;
|
|
123
|
-
case
|
|
151
|
+
case 22:
|
|
124
152
|
if (!((infra === null || infra === void 0 ? void 0 : infra.arch) === 'MAX')) {
|
|
125
|
-
_context.next =
|
|
153
|
+
_context.next = 33;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
maxDevDeps = pickDependencies(['axios'], true);
|
|
157
|
+
_context.t2 = !!maxDevDeps.length;
|
|
158
|
+
if (!_context.t2) {
|
|
159
|
+
_context.next = 28;
|
|
126
160
|
break;
|
|
127
161
|
}
|
|
128
|
-
_context.next =
|
|
129
|
-
return exec('pnpm', ['add', '
|
|
130
|
-
case
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
162
|
+
_context.next = 28;
|
|
163
|
+
return exec('pnpm', ['add'].concat(_toConsumableArray(maxDevDeps), ['-D']));
|
|
164
|
+
case 28:
|
|
165
|
+
maxDeps = pickDependencies(['@teams-max/skynet', 'classnames', 'qs', 'uuid', 'react-draggable', 'lodash', 'moment', 'dayjs']);
|
|
166
|
+
_context.t3 = !!maxDeps.length;
|
|
167
|
+
if (!_context.t3) {
|
|
168
|
+
_context.next = 33;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
_context.next = 33;
|
|
172
|
+
return exec('pnpm', ['add'].concat(_toConsumableArray(maxDeps)));
|
|
173
|
+
case 33:
|
|
134
174
|
logStep('Installation completed.');
|
|
135
|
-
_context.next =
|
|
175
|
+
_context.next = 48;
|
|
136
176
|
break;
|
|
137
|
-
case
|
|
177
|
+
case 36:
|
|
138
178
|
if (!(JENKINS_BUILD && !ASG_BRAHCH)) {
|
|
139
|
-
_context.next =
|
|
179
|
+
_context.next = 41;
|
|
140
180
|
break;
|
|
141
181
|
}
|
|
142
182
|
logStep('Jenkins build detected. Skipping sync up.');
|
|
143
183
|
return _context.abrupt("return");
|
|
144
|
-
case
|
|
145
|
-
|
|
184
|
+
case 41:
|
|
185
|
+
if (JENKINS_BUILD) {
|
|
186
|
+
_context.next = 48;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
_context.next = 44;
|
|
146
190
|
return inquirer.prompt([{
|
|
147
191
|
type: 'confirm',
|
|
148
192
|
name: 'syncUp',
|
|
149
193
|
message: '同步远端仓库',
|
|
150
194
|
default: 'Y'
|
|
151
195
|
}]);
|
|
152
|
-
case
|
|
196
|
+
case 44:
|
|
153
197
|
_yield$inquirer$promp = _context.sent;
|
|
154
198
|
syncUp = _yield$inquirer$promp.syncUp;
|
|
155
199
|
if (syncUp) {
|
|
156
|
-
_context.next =
|
|
200
|
+
_context.next = 48;
|
|
157
201
|
break;
|
|
158
202
|
}
|
|
159
203
|
return _context.abrupt("return");
|
|
160
|
-
case
|
|
204
|
+
case 48:
|
|
161
205
|
if (!(!doesExist && JENKINS_BUILD && !ASG_BRAHCH)) {
|
|
162
|
-
_context.next =
|
|
206
|
+
_context.next = 51;
|
|
163
207
|
break;
|
|
164
208
|
}
|
|
165
209
|
printErrorAndExit('Jenkins build detected. The branch parameter is missing!');
|
|
166
210
|
return _context.abrupt("return");
|
|
167
|
-
case
|
|
211
|
+
case 51:
|
|
168
212
|
logStep('Synchronizing with the remote repository...');
|
|
169
213
|
process.chdir(directory);
|
|
170
|
-
_context.prev =
|
|
171
|
-
execa.sync('git', ['
|
|
214
|
+
_context.prev = 53;
|
|
215
|
+
execa.sync('git', ['fetch', 'origin', '--prune']);
|
|
172
216
|
if (!(JENKINS_BUILD && ASG_BRAHCH)) {
|
|
173
|
-
_context.next =
|
|
217
|
+
_context.next = 60;
|
|
174
218
|
break;
|
|
175
219
|
}
|
|
176
220
|
execa.sync('git', ['checkout', ASG_BRAHCH]);
|
|
177
221
|
logStep("Anto switched to branch:", ASG_BRAHCH);
|
|
178
|
-
_context.next =
|
|
222
|
+
_context.next = 70;
|
|
179
223
|
break;
|
|
180
|
-
case
|
|
224
|
+
case 60:
|
|
181
225
|
// 获取远程分支列表
|
|
182
226
|
infraBranchsOutput = execa.sync('git', ['branch', '-r']).stdout; // 处理分支列表
|
|
183
227
|
infraBranchArray = infraBranchsOutput.trim().split('\n');
|
|
@@ -197,7 +241,7 @@ function _fetchRemoteRepository() {
|
|
|
197
241
|
}
|
|
198
242
|
|
|
199
243
|
// 提示用户选择分支
|
|
200
|
-
_context.next =
|
|
244
|
+
_context.next = 68;
|
|
201
245
|
return inquirer.prompt([{
|
|
202
246
|
type: 'list',
|
|
203
247
|
name: 'branch',
|
|
@@ -210,7 +254,7 @@ function _fetchRemoteRepository() {
|
|
|
210
254
|
return true;
|
|
211
255
|
}
|
|
212
256
|
}]);
|
|
213
|
-
case
|
|
257
|
+
case 68:
|
|
214
258
|
questions = _context.sent;
|
|
215
259
|
// 切换分支,增加错误处理
|
|
216
260
|
try {
|
|
@@ -219,21 +263,21 @@ function _fetchRemoteRepository() {
|
|
|
219
263
|
} catch (error) {
|
|
220
264
|
printErrorAndExit("Failed to switch to branch '".concat(questions.branch, "'. Reason: ").concat(error.message));
|
|
221
265
|
}
|
|
222
|
-
case
|
|
223
|
-
_context.next =
|
|
266
|
+
case 70:
|
|
267
|
+
_context.next = 75;
|
|
224
268
|
break;
|
|
225
|
-
case
|
|
226
|
-
_context.prev =
|
|
227
|
-
_context.
|
|
269
|
+
case 72:
|
|
270
|
+
_context.prev = 72;
|
|
271
|
+
_context.t4 = _context["catch"](53);
|
|
228
272
|
// 获取分支列表时的错误处理
|
|
229
|
-
printErrorAndExit("An error occurred while fetching remote branches: ".concat(_context.
|
|
230
|
-
case
|
|
273
|
+
printErrorAndExit("An error occurred while fetching remote branches: ".concat(_context.t4.message));
|
|
274
|
+
case 75:
|
|
231
275
|
process.chdir(cwd);
|
|
232
|
-
case
|
|
276
|
+
case 76:
|
|
233
277
|
case "end":
|
|
234
278
|
return _context.stop();
|
|
235
279
|
}
|
|
236
|
-
}, _callee, null, [[
|
|
280
|
+
}, _callee, null, [[53, 72]]);
|
|
237
281
|
}));
|
|
238
282
|
return _fetchRemoteRepository.apply(this, arguments);
|
|
239
283
|
}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
/// <reference types="node"/>
|
|
10
10
|
|
|
11
11
|
interface MergedStream extends NodeJS.ReadWriteStream {
|
|
12
|
-
add(
|
|
12
|
+
add(
|
|
13
|
+
source: NodeJS.ReadableStream | ReadonlyArray<NodeJS.ReadableStream>,
|
|
14
|
+
): MergedStream;
|
|
13
15
|
isEmpty(): boolean;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "merge-stream",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"author": "Stephen Sugden <me@stephensugden.com>",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts"
|
|
7
|
+
}
|
|
@@ -74,7 +74,9 @@ declare namespace yargsParser {
|
|
|
74
74
|
* Indicate that keys should be parsed as an array and coerced to booleans / numbers:
|
|
75
75
|
* { array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.
|
|
76
76
|
*/
|
|
77
|
-
array?:
|
|
77
|
+
array?:
|
|
78
|
+
| string[]
|
|
79
|
+
| Array<{ key: string; boolean?: boolean; number?: boolean }>;
|
|
78
80
|
/** Arguments should be parsed as booleans: `{ boolean: ['x', 'y'] }`. */
|
|
79
81
|
boolean?: string[];
|
|
80
82
|
/** Indicate a key that represents a path to a configuration file (this file will be loaded and parsed). */
|
package/lib/cli/build.js
CHANGED
|
@@ -61,7 +61,7 @@ async function build() {
|
|
|
61
61
|
env.VUE_APP_TYPE = "pro";
|
|
62
62
|
env.VUE_JENKINS_BUILD = JENKINS_BUILD;
|
|
63
63
|
env.VUE_APP_KEY = appKey;
|
|
64
|
-
await exec("vue-cli-service", ["
|
|
64
|
+
await exec("vue-cli-service", ["build"], {
|
|
65
65
|
env
|
|
66
66
|
});
|
|
67
67
|
} else if ((infra == null ? void 0 : infra.arch) === "MAX") {
|
package/lib/utils/chalk/index.js
CHANGED
|
@@ -22,7 +22,11 @@ module.exports = (() => {
|
|
|
22
22
|
Object.defineProperty(e3, t3, {
|
|
23
23
|
get: () => {
|
|
24
24
|
const r2 = n2();
|
|
25
|
-
Object.defineProperty(e3, t3, {
|
|
25
|
+
Object.defineProperty(e3, t3, {
|
|
26
|
+
value: r2,
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
26
30
|
return r2;
|
|
27
31
|
},
|
|
28
32
|
enumerable: true,
|
|
@@ -119,7 +123,10 @@ module.exports = (() => {
|
|
|
119
123
|
i(t3.bgColor, "ansi16m", () => u(s, "rgb", c, true));
|
|
120
124
|
return t3;
|
|
121
125
|
}
|
|
122
|
-
Object.defineProperty(e2, "exports", {
|
|
126
|
+
Object.defineProperty(e2, "exports", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: assembleStyles
|
|
129
|
+
});
|
|
123
130
|
},
|
|
124
131
|
294: (e2, t2, n) => {
|
|
125
132
|
const r = n(510);
|
|
@@ -706,7 +713,11 @@ module.exports = (() => {
|
|
|
706
713
|
o2[2] = c;
|
|
707
714
|
}
|
|
708
715
|
i = (1 - n2) * r2;
|
|
709
|
-
return [
|
|
716
|
+
return [
|
|
717
|
+
(n2 * o2[0] + i) * 255,
|
|
718
|
+
(n2 * o2[1] + i) * 255,
|
|
719
|
+
(n2 * o2[2] + i) * 255
|
|
720
|
+
];
|
|
710
721
|
};
|
|
711
722
|
s.hcg.hsv = function(e3) {
|
|
712
723
|
const t3 = e3[1] / 100;
|
|
@@ -748,10 +759,18 @@ module.exports = (() => {
|
|
|
748
759
|
return [e3[0], o2 * 100, s2 * 100];
|
|
749
760
|
};
|
|
750
761
|
s.apple.rgb = function(e3) {
|
|
751
|
-
return [
|
|
762
|
+
return [
|
|
763
|
+
e3[0] / 65535 * 255,
|
|
764
|
+
e3[1] / 65535 * 255,
|
|
765
|
+
e3[2] / 65535 * 255
|
|
766
|
+
];
|
|
752
767
|
};
|
|
753
768
|
s.rgb.apple = function(e3) {
|
|
754
|
-
return [
|
|
769
|
+
return [
|
|
770
|
+
e3[0] / 255 * 65535,
|
|
771
|
+
e3[1] / 255 * 65535,
|
|
772
|
+
e3[2] / 255 * 65535
|
|
773
|
+
];
|
|
755
774
|
};
|
|
756
775
|
s.gray.rgb = function(e3) {
|
|
757
776
|
return [e3[0] / 100 * 255, e3[0] / 100 * 255, e3[0] / 100 * 255];
|
|
@@ -959,9 +978,14 @@ module.exports = (() => {
|
|
|
959
978
|
return 1;
|
|
960
979
|
}
|
|
961
980
|
if ("CI" in l) {
|
|
962
|
-
if ([
|
|
963
|
-
|
|
964
|
-
|
|
981
|
+
if ([
|
|
982
|
+
"TRAVIS",
|
|
983
|
+
"CIRCLECI",
|
|
984
|
+
"APPVEYOR",
|
|
985
|
+
"GITLAB_CI",
|
|
986
|
+
"GITHUB_ACTIONS",
|
|
987
|
+
"BUILDKITE"
|
|
988
|
+
].some((e4) => e4 in l) || l.CI_NAME === "codeship") {
|
|
965
989
|
return 1;
|
|
966
990
|
}
|
|
967
991
|
return n2;
|
|
@@ -984,7 +1008,9 @@ module.exports = (() => {
|
|
|
984
1008
|
if (/-256(color)?$/i.test(l.TERM)) {
|
|
985
1009
|
return 2;
|
|
986
1010
|
}
|
|
987
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
1011
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
1012
|
+
l.TERM
|
|
1013
|
+
)) {
|
|
988
1014
|
return 1;
|
|
989
1015
|
}
|
|
990
1016
|
if ("COLORTERM" in l) {
|
|
@@ -1012,7 +1038,9 @@ module.exports = (() => {
|
|
|
1012
1038
|
const u = /* @__PURE__ */ Object.create(null);
|
|
1013
1039
|
const f = (e3, t3 = {}) => {
|
|
1014
1040
|
if (t3.level && !(Number.isInteger(t3.level) && t3.level >= 0 && t3.level <= 3)) {
|
|
1015
|
-
throw new Error(
|
|
1041
|
+
throw new Error(
|
|
1042
|
+
"The `level` option should be an integer from 0 to 3"
|
|
1043
|
+
);
|
|
1016
1044
|
}
|
|
1017
1045
|
const n2 = o ? o.level : 0;
|
|
1018
1046
|
e3.level = t3.level === void 0 ? n2 : t3.level;
|
|
@@ -1055,7 +1083,16 @@ module.exports = (() => {
|
|
|
1055
1083
|
return e3;
|
|
1056
1084
|
}
|
|
1057
1085
|
};
|
|
1058
|
-
const g = [
|
|
1086
|
+
const g = [
|
|
1087
|
+
"rgb",
|
|
1088
|
+
"hex",
|
|
1089
|
+
"keyword",
|
|
1090
|
+
"hsl",
|
|
1091
|
+
"hsv",
|
|
1092
|
+
"hwb",
|
|
1093
|
+
"ansi",
|
|
1094
|
+
"ansi256"
|
|
1095
|
+
];
|
|
1059
1096
|
for (const e3 of g) {
|
|
1060
1097
|
u[e3] = {
|
|
1061
1098
|
get() {
|
|
@@ -1073,7 +1110,11 @@ module.exports = (() => {
|
|
|
1073
1110
|
get() {
|
|
1074
1111
|
const { level: t4 } = this;
|
|
1075
1112
|
return function(...n2) {
|
|
1076
|
-
const o2 = p(
|
|
1113
|
+
const o2 = p(
|
|
1114
|
+
r.bgColor[a[t4]][e3](...n2),
|
|
1115
|
+
r.bgColor.close,
|
|
1116
|
+
this._styler
|
|
1117
|
+
);
|
|
1077
1118
|
return d(this, o2, this._isEmpty);
|
|
1078
1119
|
};
|
|
1079
1120
|
}
|
|
@@ -1201,7 +1242,9 @@ module.exports = (() => {
|
|
|
1201
1242
|
} else if (l = t4.match(r)) {
|
|
1202
1243
|
n2.push(l[2].replace(o, (e4, t5, n3) => t5 ? unescape(t5) : n3));
|
|
1203
1244
|
} else {
|
|
1204
|
-
throw new Error(
|
|
1245
|
+
throw new Error(
|
|
1246
|
+
`Invalid Chalk template style argument: ${t4} (in style '${e3}')`
|
|
1247
|
+
);
|
|
1205
1248
|
}
|
|
1206
1249
|
}
|
|
1207
1250
|
return n2;
|
|
@@ -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) {
|
|
@@ -57,7 +57,10 @@ function datetimeFormat(value, format, isCoerce) {
|
|
|
57
57
|
// 毫秒
|
|
58
58
|
};
|
|
59
59
|
if (/(y+)/.test(format)) {
|
|
60
|
-
format = format.replace(
|
|
60
|
+
format = format.replace(
|
|
61
|
+
RegExp.$1,
|
|
62
|
+
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
|
63
|
+
);
|
|
61
64
|
}
|
|
62
65
|
const week = {
|
|
63
66
|
0: "\u65E5",
|
|
@@ -8,9 +8,16 @@ function defineConfig(config) {
|
|
|
8
8
|
}
|
|
9
9
|
let iConfigFromPlugins = null;
|
|
10
10
|
try {
|
|
11
|
-
iConfigFromPlugins = require(path.join(
|
|
11
|
+
iConfigFromPlugins = require(path.join(
|
|
12
|
+
process.env.ASG_DIR,
|
|
13
|
+
"base",
|
|
14
|
+
"pluginConfig.js"
|
|
15
|
+
));
|
|
12
16
|
} catch (error) {
|
|
13
|
-
printErrorAndExit(
|
|
17
|
+
printErrorAndExit(
|
|
18
|
+
"The Asgard directory does not exist.",
|
|
19
|
+
`Reason: ${error.message}`
|
|
20
|
+
);
|
|
14
21
|
return;
|
|
15
22
|
}
|
|
16
23
|
logStep("The Asgard directory exists, using config from plugins...");
|
|
@@ -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;
|
package/lib/utils/execa/index.js
CHANGED
|
@@ -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
|
}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "execa",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Sindre Sorhus",
|
|
6
|
+
"email": "sindresorhus@gmail.com",
|
|
7
|
+
"url": "https://sindresorhus.com"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"types": "index.d.ts"
|
|
11
|
+
}
|
package/lib/utils/getPackages.js
CHANGED
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
var { readdirSync } = require("fs");
|
|
3
3
|
var { join } = require("path");
|
|
4
4
|
module.exports = function getPackages() {
|
|
5
|
-
return readdirSync(join(__dirname, "../../packages")).filter(
|
|
5
|
+
return readdirSync(join(__dirname, "../../packages")).filter(
|
|
6
|
+
(pkg) => pkg.charAt(0) !== "."
|
|
7
|
+
);
|
|
6
8
|
};
|
package/lib/utils/git.js
CHANGED
|
@@ -5,7 +5,11 @@ exports.latestTag = async () => {
|
|
|
5
5
|
return stdout;
|
|
6
6
|
};
|
|
7
7
|
var firstCommit = async () => {
|
|
8
|
-
const { stdout } = await execa("git", [
|
|
8
|
+
const { stdout } = await execa("git", [
|
|
9
|
+
"rev-list",
|
|
10
|
+
"--max-parents=0",
|
|
11
|
+
"HEAD"
|
|
12
|
+
]);
|
|
9
13
|
return stdout;
|
|
10
14
|
};
|
|
11
15
|
exports.latestTagOrFirstCommit = async () => {
|
|
@@ -18,6 +22,10 @@ exports.latestTagOrFirstCommit = async () => {
|
|
|
18
22
|
return latest;
|
|
19
23
|
};
|
|
20
24
|
exports.commitLogFromRevision = async (revision) => {
|
|
21
|
-
const { stdout } = await execa("git", [
|
|
25
|
+
const { stdout } = await execa("git", [
|
|
26
|
+
"log",
|
|
27
|
+
"--format=%s %h",
|
|
28
|
+
`${revision}..HEAD`
|
|
29
|
+
]);
|
|
22
30
|
return stdout;
|
|
23
31
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -22,6 +22,16 @@ function printErrorAndExit(...args) {
|
|
|
22
22
|
printError(args);
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
|
+
function pickDependencies(dependencies, isDev) {
|
|
26
|
+
const pkgs = require(join(cwd, "package.json"));
|
|
27
|
+
return dependencies.filter((p) => {
|
|
28
|
+
if (isDev) {
|
|
29
|
+
return !pkgs.devDependencies[p];
|
|
30
|
+
} else {
|
|
31
|
+
return !pkgs.dependencies[p];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
25
35
|
function getCfg() {
|
|
26
36
|
const pkgs = require(join(cwd, "package.json"));
|
|
27
37
|
const { infra = {}, appKey } = pkgs;
|
|
@@ -79,43 +89,53 @@ async function fetchRemoteRepository() {
|
|
|
79
89
|
logStep("Cloning completed.");
|
|
80
90
|
logStep("Installing dependencies...");
|
|
81
91
|
if ((infra == null ? void 0 : infra.arch) === "PRO") {
|
|
82
|
-
|
|
83
|
-
await exec("yarn", ["add",
|
|
92
|
+
const proDevDeps = pickDependencies(["snb-mock-middleware", "lodash-webpack-plugin"], true);
|
|
93
|
+
!!proDevDeps.length && await exec("yarn", ["add", ...proDevDeps, "-D"]);
|
|
94
|
+
const proDeps = pickDependencies(["@teams-max/skynet", "history"]);
|
|
95
|
+
!!proDeps.length && await exec("yarn", ["add", ...proDeps]);
|
|
84
96
|
} else if ((infra == null ? void 0 : infra.arch) === "MAX") {
|
|
85
|
-
|
|
86
|
-
await exec("pnpm", ["add",
|
|
97
|
+
const maxDevDeps = pickDependencies(["axios"], true);
|
|
98
|
+
!!maxDevDeps.length && await exec("pnpm", ["add", ...maxDevDeps, "-D"]);
|
|
99
|
+
const maxDeps = pickDependencies(["@teams-max/skynet", "classnames", "qs", "uuid", "react-draggable", "lodash", "moment", "dayjs"]);
|
|
100
|
+
!!maxDeps.length && await exec("pnpm", ["add", ...maxDeps]);
|
|
87
101
|
}
|
|
88
102
|
logStep("Installation completed.");
|
|
89
103
|
} else if (JENKINS_BUILD && !ASG_BRAHCH) {
|
|
90
104
|
logStep("Jenkins build detected. Skipping sync up.");
|
|
91
105
|
return;
|
|
92
106
|
} else {
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
if (!JENKINS_BUILD) {
|
|
108
|
+
const { syncUp } = await inquirer.prompt([
|
|
109
|
+
{
|
|
110
|
+
type: "confirm",
|
|
111
|
+
name: "syncUp",
|
|
112
|
+
message: "\u540C\u6B65\u8FDC\u7AEF\u4ED3\u5E93",
|
|
113
|
+
default: "Y"
|
|
114
|
+
}
|
|
115
|
+
]);
|
|
116
|
+
if (!syncUp)
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
103
119
|
}
|
|
104
120
|
if (!doesExist && JENKINS_BUILD && !ASG_BRAHCH) {
|
|
105
|
-
printErrorAndExit(
|
|
121
|
+
printErrorAndExit(
|
|
122
|
+
"Jenkins build detected. The branch parameter is missing!"
|
|
123
|
+
);
|
|
106
124
|
return;
|
|
107
125
|
}
|
|
108
126
|
logStep("Synchronizing with the remote repository...");
|
|
109
127
|
process.chdir(directory);
|
|
110
128
|
try {
|
|
111
|
-
execa.sync("git", ["
|
|
129
|
+
execa.sync("git", ["fetch", "origin", "--prune"]);
|
|
112
130
|
if (JENKINS_BUILD && ASG_BRAHCH) {
|
|
113
131
|
execa.sync("git", ["checkout", ASG_BRAHCH]);
|
|
114
132
|
logStep(`Anto switched to branch:`, ASG_BRAHCH);
|
|
115
133
|
} else {
|
|
116
134
|
const infraBranchsOutput = execa.sync("git", ["branch", "-r"]).stdout;
|
|
117
135
|
const infraBranchArray = infraBranchsOutput.trim().split("\n");
|
|
118
|
-
const filteredBranches = infraBranchArray.map((b) => b.trim()).filter(
|
|
136
|
+
const filteredBranches = infraBranchArray.map((b) => b.trim()).filter(
|
|
137
|
+
(b) => !(b.startsWith("origin/HEA") || b.startsWith("origin/app-") || b.startsWith("app-"))
|
|
138
|
+
);
|
|
119
139
|
const defaultBrancheIdx = filteredBranches.indexOf("origin/feature-asg");
|
|
120
140
|
if (defaultBrancheIdx !== -1) {
|
|
121
141
|
filteredBranches.splice(defaultBrancheIdx, 1);
|
|
@@ -142,11 +162,15 @@ async function fetchRemoteRepository() {
|
|
|
142
162
|
execa.sync("git", ["checkout", "-q", questions.branch]);
|
|
143
163
|
logStep(`Switched to branch:`, questions.branch);
|
|
144
164
|
} catch (error) {
|
|
145
|
-
printErrorAndExit(
|
|
165
|
+
printErrorAndExit(
|
|
166
|
+
`Failed to switch to branch '${questions.branch}'. Reason: ${error.message}`
|
|
167
|
+
);
|
|
146
168
|
}
|
|
147
169
|
}
|
|
148
170
|
} catch (error) {
|
|
149
|
-
printErrorAndExit(
|
|
171
|
+
printErrorAndExit(
|
|
172
|
+
`An error occurred while fetching remote branches: ${error.message}`
|
|
173
|
+
);
|
|
150
174
|
}
|
|
151
175
|
process.chdir(cwd);
|
|
152
176
|
}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
/// <reference types="node"/>
|
|
10
10
|
|
|
11
11
|
interface MergedStream extends NodeJS.ReadWriteStream {
|
|
12
|
-
add(
|
|
12
|
+
add(
|
|
13
|
+
source: NodeJS.ReadableStream | ReadonlyArray<NodeJS.ReadableStream>,
|
|
14
|
+
): MergedStream;
|
|
13
15
|
isEmpty(): boolean;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "merge-stream",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"author": "Stephen Sugden <me@stephensugden.com>",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts"
|
|
7
|
+
}
|
|
@@ -74,7 +74,9 @@ declare namespace yargsParser {
|
|
|
74
74
|
* Indicate that keys should be parsed as an array and coerced to booleans / numbers:
|
|
75
75
|
* { array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.
|
|
76
76
|
*/
|
|
77
|
-
array?:
|
|
77
|
+
array?:
|
|
78
|
+
| string[]
|
|
79
|
+
| Array<{ key: string; boolean?: boolean; number?: boolean }>;
|
|
78
80
|
/** Arguments should be parsed as booleans: `{ boolean: ['x', 'y'] }`. */
|
|
79
81
|
boolean?: string[];
|
|
80
82
|
/** Indicate a key that represents a path to a configuration file (this file will be loaded and parsed). */
|
|
@@ -123,7 +123,11 @@ module.exports = (() => {
|
|
|
123
123
|
[].concat(n3.array).filter(Boolean).forEach(function(s4) {
|
|
124
124
|
const n4 = s4.key || s4;
|
|
125
125
|
const t3 = Object.keys(s4).map(function(s5) {
|
|
126
|
-
return {
|
|
126
|
+
return {
|
|
127
|
+
boolean: "bools",
|
|
128
|
+
string: "strings",
|
|
129
|
+
number: "numbers"
|
|
130
|
+
}[s5];
|
|
127
131
|
}).filter(Boolean).pop();
|
|
128
132
|
if (t3) {
|
|
129
133
|
O[t3][n4] = true;
|
|
@@ -778,10 +782,20 @@ module.exports = (() => {
|
|
|
778
782
|
function checkConfiguration() {
|
|
779
783
|
Object.keys(O.counts).find((s4) => {
|
|
780
784
|
if (checkAllAliases(s4, O.arrays)) {
|
|
781
|
-
_ = Error(
|
|
785
|
+
_ = Error(
|
|
786
|
+
b(
|
|
787
|
+
"Invalid configuration: %s, opts.count excludes opts.array.",
|
|
788
|
+
s4
|
|
789
|
+
)
|
|
790
|
+
);
|
|
782
791
|
return true;
|
|
783
792
|
} else if (checkAllAliases(s4, O.nargs)) {
|
|
784
|
-
_ = Error(
|
|
793
|
+
_ = Error(
|
|
794
|
+
b(
|
|
795
|
+
"Invalid configuration: %s, opts.count excludes opts.narg.",
|
|
796
|
+
s4
|
|
797
|
+
)
|
|
798
|
+
);
|
|
785
799
|
return true;
|
|
786
800
|
}
|
|
787
801
|
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teams-max/mwsp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "@teams-max/mwsp",
|
|
5
5
|
"homepage": "https://gitlab.daikuan.qihoo.net/efficacy-fe/teams-max/-/tree/master/packages/mwsp",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://gitlab.daikuan.qihoo.net/efficacy-fe/teams-max"
|
|
9
9
|
},
|
|
10
|
+
"license": "ISC",
|
|
10
11
|
"main": "lib/index.js",
|
|
11
12
|
"types": "lib/index.d.ts",
|
|
12
13
|
"bin": {
|
|
@@ -22,14 +23,13 @@
|
|
|
22
23
|
"build:deps": "max-scripts bundleDeps",
|
|
23
24
|
"dev": "max-scripts father dev"
|
|
24
25
|
},
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"license": "ISC",
|
|
29
26
|
"dependencies": {
|
|
30
27
|
"inquirer": "7.3.3",
|
|
31
28
|
"v8-compile-cache": "2.3.0"
|
|
32
29
|
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
33
|
"authors": [
|
|
34
34
|
"zhangxiaoyang <zhangxiaoyang-jk@360shuke.com> (https://v.src.corp.qihoo.net/j-zhangxiaoyang-jk)",
|
|
35
35
|
"liuxiangdong <liuxiangdong1-jk@360shuke.com> (https://v.src.corp.qihoo.net/j-liuxiangdong1-jk)"
|