@modern-js/repo-generator 0.0.0-canary-20221102031626 → 0.0.0-canary-20221104083314
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/dist/index.js +1126 -882
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1962,8 +1962,8 @@ var require_lodash = __commonJSMin((exports, module2) => {
|
|
|
1962
1962
|
if (result2 instanceof LazyWrapper) {
|
|
1963
1963
|
result2 = result2.value();
|
|
1964
1964
|
}
|
|
1965
|
-
return arrayReduce(actions, function(result3,
|
|
1966
|
-
return
|
|
1965
|
+
return arrayReduce(actions, function(result3, action3) {
|
|
1966
|
+
return action3.func.apply(action3.thisArg, arrayPush([result3], action3.args));
|
|
1967
1967
|
}, result2);
|
|
1968
1968
|
}
|
|
1969
1969
|
function baseXor(arrays, iteratee2, comparator) {
|
|
@@ -34589,6 +34589,7 @@ var require_logger = __commonJSMin((exports) => {
|
|
|
34589
34589
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34590
34590
|
exports.logger = exports.Logger = void 0;
|
|
34591
34591
|
var chalk_1 = __importDefault(require_chalk());
|
|
34592
|
+
var { grey, underline } = chalk_1.default;
|
|
34592
34593
|
var LOG_LEVEL = {
|
|
34593
34594
|
error: 0,
|
|
34594
34595
|
warn: 1,
|
|
@@ -34603,18 +34604,13 @@ var require_logger = __commonJSMin((exports) => {
|
|
|
34603
34604
|
level: "error"
|
|
34604
34605
|
},
|
|
34605
34606
|
info: {
|
|
34606
|
-
color: "
|
|
34607
|
+
color: "blue",
|
|
34607
34608
|
label: "info",
|
|
34608
34609
|
level: "info"
|
|
34609
34610
|
},
|
|
34610
|
-
success: {
|
|
34611
|
-
color: "green",
|
|
34612
|
-
label: "Success",
|
|
34613
|
-
level: "info"
|
|
34614
|
-
},
|
|
34615
34611
|
warn: {
|
|
34616
34612
|
color: "yellow",
|
|
34617
|
-
label: "
|
|
34613
|
+
label: "warning",
|
|
34618
34614
|
level: "warn"
|
|
34619
34615
|
},
|
|
34620
34616
|
debug: {
|
|
@@ -34626,10 +34622,13 @@ var require_logger = __commonJSMin((exports) => {
|
|
|
34626
34622
|
};
|
|
34627
34623
|
var DEFAULT_CONFIG = {
|
|
34628
34624
|
displayLabel: true,
|
|
34625
|
+
underlineLabel: true,
|
|
34629
34626
|
uppercaseLabel: false
|
|
34630
34627
|
};
|
|
34631
34628
|
var Logger = class {
|
|
34632
34629
|
constructor(options3 = {}) {
|
|
34630
|
+
this.logCount = 200;
|
|
34631
|
+
this.history = {};
|
|
34633
34632
|
this.level = options3.level || LOG_TYPES.log.level;
|
|
34634
34633
|
this.config = { ...DEFAULT_CONFIG, ...options3.config || {} };
|
|
34635
34634
|
this.types = {
|
|
@@ -34641,46 +34640,77 @@ var require_logger = __commonJSMin((exports) => {
|
|
|
34641
34640
|
this[type] = this._log.bind(this, type);
|
|
34642
34641
|
});
|
|
34643
34642
|
}
|
|
34643
|
+
retainLog(type, message) {
|
|
34644
|
+
if (!this.history[type]) {
|
|
34645
|
+
this.history[type] = [];
|
|
34646
|
+
}
|
|
34647
|
+
this.history[type].push(message);
|
|
34648
|
+
while (this.history[type].length > this.logCount) {
|
|
34649
|
+
this.history[type].shift();
|
|
34650
|
+
}
|
|
34651
|
+
}
|
|
34644
34652
|
_log(type, message, ...args) {
|
|
34645
|
-
if (message === void 0
|
|
34653
|
+
if (message === void 0) {
|
|
34646
34654
|
console.log();
|
|
34647
34655
|
return;
|
|
34648
34656
|
}
|
|
34649
34657
|
if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
|
|
34650
34658
|
return;
|
|
34651
34659
|
}
|
|
34652
|
-
let
|
|
34660
|
+
let label21 = "";
|
|
34653
34661
|
let text = "";
|
|
34654
34662
|
const logType = this.types[type];
|
|
34655
34663
|
if (this.config.displayLabel && logType.label) {
|
|
34656
|
-
|
|
34657
|
-
|
|
34658
|
-
|
|
34664
|
+
label21 = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
|
|
34665
|
+
if (this.config.underlineLabel) {
|
|
34666
|
+
label21 = underline(label21).padEnd(this.longestUnderlinedLabel.length + 1);
|
|
34667
|
+
} else {
|
|
34668
|
+
label21 = label21.padEnd(this.longestLabel.length + 1);
|
|
34669
|
+
}
|
|
34670
|
+
label21 = logType.color ? chalk_1.default[logType.color](label21) : label21;
|
|
34659
34671
|
}
|
|
34660
34672
|
if (message instanceof Error) {
|
|
34661
34673
|
if (message.stack) {
|
|
34662
34674
|
const [name5, ...rest] = message.stack.split("\n");
|
|
34663
34675
|
text = `${name5}
|
|
34664
|
-
${
|
|
34676
|
+
${grey(rest.join("\n"))}`;
|
|
34665
34677
|
} else {
|
|
34666
34678
|
text = message.message;
|
|
34667
34679
|
}
|
|
34668
34680
|
} else {
|
|
34669
34681
|
text = `${message}`;
|
|
34670
34682
|
}
|
|
34671
|
-
|
|
34683
|
+
if (logType.level === "warn" || logType.level === "error") {
|
|
34684
|
+
this.retainLog(type, text);
|
|
34685
|
+
}
|
|
34686
|
+
const log = label21.length > 0 ? `${label21} ${text}` : text;
|
|
34672
34687
|
console.log(log, ...args);
|
|
34673
34688
|
}
|
|
34674
34689
|
getLongestLabel() {
|
|
34675
34690
|
let longestLabel = "";
|
|
34676
34691
|
Object.keys(this.types).forEach((type) => {
|
|
34677
|
-
const { label = "" } = this.types[type];
|
|
34678
|
-
if (
|
|
34679
|
-
longestLabel =
|
|
34692
|
+
const { label: label21 = "" } = this.types[type];
|
|
34693
|
+
if (label21.length > longestLabel.length) {
|
|
34694
|
+
longestLabel = label21;
|
|
34680
34695
|
}
|
|
34681
34696
|
});
|
|
34682
34697
|
return longestLabel;
|
|
34683
34698
|
}
|
|
34699
|
+
get longestUnderlinedLabel() {
|
|
34700
|
+
return underline(this.longestLabel);
|
|
34701
|
+
}
|
|
34702
|
+
getRetainedLogs(type) {
|
|
34703
|
+
return this.history[type] || [];
|
|
34704
|
+
}
|
|
34705
|
+
clearRetainedLogs(type) {
|
|
34706
|
+
if (type) {
|
|
34707
|
+
if (this.history[type]) {
|
|
34708
|
+
this.history[type] = [];
|
|
34709
|
+
}
|
|
34710
|
+
} else {
|
|
34711
|
+
this.history = {};
|
|
34712
|
+
}
|
|
34713
|
+
}
|
|
34684
34714
|
};
|
|
34685
34715
|
exports.Logger = Logger;
|
|
34686
34716
|
var logger = new Logger();
|
|
@@ -35340,13 +35370,10 @@ var require_getPort = __commonJSMin((exports) => {
|
|
|
35340
35370
|
var net_1 = __importDefault(__require("net"));
|
|
35341
35371
|
var compiled_1 = require_compiled();
|
|
35342
35372
|
var logger_1 = require_logger();
|
|
35343
|
-
var getPort = async (port,
|
|
35373
|
+
var getPort = async (port, tryLimits = 20) => {
|
|
35344
35374
|
if (typeof port === "string") {
|
|
35345
35375
|
port = parseInt(port, 10);
|
|
35346
35376
|
}
|
|
35347
|
-
if (strictPort) {
|
|
35348
|
-
tryLimits = 1;
|
|
35349
|
-
}
|
|
35350
35377
|
const original = port;
|
|
35351
35378
|
let found = false;
|
|
35352
35379
|
let attempts = 0;
|
|
@@ -35373,11 +35400,7 @@ var require_getPort = __commonJSMin((exports) => {
|
|
|
35373
35400
|
}
|
|
35374
35401
|
}
|
|
35375
35402
|
if (port !== original) {
|
|
35376
|
-
|
|
35377
|
-
throw new Error(`Port "${original}" is occupied, please choose another one.`);
|
|
35378
|
-
} else {
|
|
35379
|
-
logger_1.logger.info(`Something is already running on port ${original}. ${compiled_1.chalk.yellow(`Use port ${port} instead.`)}`);
|
|
35380
|
-
}
|
|
35403
|
+
logger_1.logger.info(compiled_1.chalk.red(`Something is already running on port ${original}. ${compiled_1.chalk.yellow(`Use port ${port} instead.`)}`));
|
|
35381
35404
|
}
|
|
35382
35405
|
return port;
|
|
35383
35406
|
};
|
|
@@ -36189,20 +36212,15 @@ var require_chainId = __commonJSMin((exports) => {
|
|
|
36189
36212
|
}
|
|
36190
36213
|
};
|
|
36191
36214
|
});
|
|
36192
|
-
var
|
|
36215
|
+
var require_reactVersion = __commonJSMin((exports) => {
|
|
36193
36216
|
"use strict";
|
|
36194
36217
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
36195
36218
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
36196
36219
|
};
|
|
36197
36220
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36198
|
-
exports.isReact18 =
|
|
36221
|
+
exports.isReact18 = void 0;
|
|
36199
36222
|
var path_1 = __importDefault(__require("path"));
|
|
36200
36223
|
var compiled_1 = require_compiled();
|
|
36201
|
-
async function getPnpmVersion() {
|
|
36202
|
-
const { stdout } = await (0, compiled_1.execa)("pnpm", ["--version"]);
|
|
36203
|
-
return stdout;
|
|
36204
|
-
}
|
|
36205
|
-
exports.getPnpmVersion = getPnpmVersion;
|
|
36206
36224
|
var isReact18 = (cwd) => {
|
|
36207
36225
|
const pkgPath = path_1.default.join(cwd, "package.json");
|
|
36208
36226
|
if (!compiled_1.fs.existsSync(pkgPath)) {
|
|
@@ -36279,7 +36297,7 @@ var require_dist = __commonJSMin((exports) => {
|
|
|
36279
36297
|
__exportStar(require_tryResolve(), exports);
|
|
36280
36298
|
__exportStar(require_analyzeProject(), exports);
|
|
36281
36299
|
__exportStar(require_chainId(), exports);
|
|
36282
|
-
__exportStar(
|
|
36300
|
+
__exportStar(require_reactVersion(), exports);
|
|
36283
36301
|
});
|
|
36284
36302
|
var require_esprima = __commonJSMin((exports, module2) => {
|
|
36285
36303
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -37401,9 +37419,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
|
|
|
37401
37419
|
}();
|
|
37402
37420
|
exports2.BlockStatement = BlockStatement;
|
|
37403
37421
|
var BreakStatement = function() {
|
|
37404
|
-
function BreakStatement2(
|
|
37422
|
+
function BreakStatement2(label21) {
|
|
37405
37423
|
this.type = syntax_1.Syntax.BreakStatement;
|
|
37406
|
-
this.label =
|
|
37424
|
+
this.label = label21;
|
|
37407
37425
|
}
|
|
37408
37426
|
return BreakStatement2;
|
|
37409
37427
|
}();
|
|
@@ -37475,9 +37493,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
|
|
|
37475
37493
|
}();
|
|
37476
37494
|
exports2.ConditionalExpression = ConditionalExpression;
|
|
37477
37495
|
var ContinueStatement = function() {
|
|
37478
|
-
function ContinueStatement2(
|
|
37496
|
+
function ContinueStatement2(label21) {
|
|
37479
37497
|
this.type = syntax_1.Syntax.ContinueStatement;
|
|
37480
|
-
this.label =
|
|
37498
|
+
this.label = label21;
|
|
37481
37499
|
}
|
|
37482
37500
|
return ContinueStatement2;
|
|
37483
37501
|
}();
|
|
@@ -37668,9 +37686,9 @@ var require_esprima = __commonJSMin((exports, module2) => {
|
|
|
37668
37686
|
}();
|
|
37669
37687
|
exports2.ImportSpecifier = ImportSpecifier;
|
|
37670
37688
|
var LabeledStatement = function() {
|
|
37671
|
-
function LabeledStatement2(
|
|
37689
|
+
function LabeledStatement2(label21, body) {
|
|
37672
37690
|
this.type = syntax_1.Syntax.LabeledStatement;
|
|
37673
|
-
this.label =
|
|
37691
|
+
this.label = label21;
|
|
37674
37692
|
this.body = body;
|
|
37675
37693
|
}
|
|
37676
37694
|
return LabeledStatement2;
|
|
@@ -39817,38 +39835,38 @@ var require_esprima = __commonJSMin((exports, module2) => {
|
|
|
39817
39835
|
Parser3.prototype.parseContinueStatement = function() {
|
|
39818
39836
|
var node = this.createNode();
|
|
39819
39837
|
this.expectKeyword("continue");
|
|
39820
|
-
var
|
|
39838
|
+
var label21 = null;
|
|
39821
39839
|
if (this.lookahead.type === 3 && !this.hasLineTerminator) {
|
|
39822
39840
|
var id = this.parseVariableIdentifier();
|
|
39823
|
-
|
|
39841
|
+
label21 = id;
|
|
39824
39842
|
var key = "$" + id.name;
|
|
39825
39843
|
if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
|
|
39826
39844
|
this.throwError(messages_1.Messages.UnknownLabel, id.name);
|
|
39827
39845
|
}
|
|
39828
39846
|
}
|
|
39829
39847
|
this.consumeSemicolon();
|
|
39830
|
-
if (
|
|
39848
|
+
if (label21 === null && !this.context.inIteration) {
|
|
39831
39849
|
this.throwError(messages_1.Messages.IllegalContinue);
|
|
39832
39850
|
}
|
|
39833
|
-
return this.finalize(node, new Node.ContinueStatement(
|
|
39851
|
+
return this.finalize(node, new Node.ContinueStatement(label21));
|
|
39834
39852
|
};
|
|
39835
39853
|
Parser3.prototype.parseBreakStatement = function() {
|
|
39836
39854
|
var node = this.createNode();
|
|
39837
39855
|
this.expectKeyword("break");
|
|
39838
|
-
var
|
|
39856
|
+
var label21 = null;
|
|
39839
39857
|
if (this.lookahead.type === 3 && !this.hasLineTerminator) {
|
|
39840
39858
|
var id = this.parseVariableIdentifier();
|
|
39841
39859
|
var key = "$" + id.name;
|
|
39842
39860
|
if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
|
|
39843
39861
|
this.throwError(messages_1.Messages.UnknownLabel, id.name);
|
|
39844
39862
|
}
|
|
39845
|
-
|
|
39863
|
+
label21 = id;
|
|
39846
39864
|
}
|
|
39847
39865
|
this.consumeSemicolon();
|
|
39848
|
-
if (
|
|
39866
|
+
if (label21 === null && !this.context.inIteration && !this.context.inSwitch) {
|
|
39849
39867
|
this.throwError(messages_1.Messages.IllegalBreak);
|
|
39850
39868
|
}
|
|
39851
|
-
return this.finalize(node, new Node.BreakStatement(
|
|
39869
|
+
return this.finalize(node, new Node.BreakStatement(label21));
|
|
39852
39870
|
};
|
|
39853
39871
|
Parser3.prototype.parseReturnStatement = function() {
|
|
39854
39872
|
if (!this.context.inFunctionBody) {
|
|
@@ -43327,7 +43345,7 @@ var require_array = __commonJSMin((exports, module2) => {
|
|
|
43327
43345
|
splice(...args) {
|
|
43328
43346
|
const { length } = this;
|
|
43329
43347
|
const ret = super.splice(...args);
|
|
43330
|
-
let [begin, deleteCount, ...
|
|
43348
|
+
let [begin, deleteCount, ...items5] = args;
|
|
43331
43349
|
if (begin < 0) {
|
|
43332
43350
|
begin += length;
|
|
43333
43351
|
}
|
|
@@ -43338,7 +43356,7 @@ var require_array = __commonJSMin((exports, module2) => {
|
|
|
43338
43356
|
}
|
|
43339
43357
|
const {
|
|
43340
43358
|
length: item_length
|
|
43341
|
-
} =
|
|
43359
|
+
} = items5;
|
|
43342
43360
|
const offset = item_length - deleteCount;
|
|
43343
43361
|
const start = begin + deleteCount;
|
|
43344
43362
|
const count = length - start;
|
|
@@ -43365,12 +43383,12 @@ var require_array = __commonJSMin((exports, module2) => {
|
|
|
43365
43383
|
move_comments(array, this, begin, before - begin, -begin);
|
|
43366
43384
|
return array;
|
|
43367
43385
|
}
|
|
43368
|
-
unshift(...
|
|
43386
|
+
unshift(...items5) {
|
|
43369
43387
|
const { length } = this;
|
|
43370
|
-
const ret = super.unshift(...
|
|
43388
|
+
const ret = super.unshift(...items5);
|
|
43371
43389
|
const {
|
|
43372
43390
|
length: items_length
|
|
43373
|
-
} =
|
|
43391
|
+
} = items5;
|
|
43374
43392
|
if (items_length > 0) {
|
|
43375
43393
|
move_comments(this, this, 0, length, items_length, true);
|
|
43376
43394
|
}
|
|
@@ -43393,14 +43411,14 @@ var require_array = __commonJSMin((exports, module2) => {
|
|
|
43393
43411
|
remove_comments(this, this.length);
|
|
43394
43412
|
return ret;
|
|
43395
43413
|
}
|
|
43396
|
-
concat(...
|
|
43414
|
+
concat(...items5) {
|
|
43397
43415
|
let { length } = this;
|
|
43398
|
-
const ret = super.concat(...
|
|
43399
|
-
if (!
|
|
43416
|
+
const ret = super.concat(...items5);
|
|
43417
|
+
if (!items5.length) {
|
|
43400
43418
|
return ret;
|
|
43401
43419
|
}
|
|
43402
43420
|
move_comments(ret, this, 0, this.length, 0);
|
|
43403
|
-
|
|
43421
|
+
items5.forEach((item) => {
|
|
43404
43422
|
const prev = length;
|
|
43405
43423
|
length += isArray4(item) ? item.length : 1;
|
|
43406
43424
|
if (!(item instanceof CommentArray)) {
|
|
@@ -54152,18 +54170,18 @@ var require_parser = __commonJSMin((exports, module2) => {
|
|
|
54152
54170
|
}
|
|
54153
54171
|
return token;
|
|
54154
54172
|
}
|
|
54155
|
-
var symbol, preErrorSymbol, state,
|
|
54173
|
+
var symbol, preErrorSymbol, state, action3, a, r, yyval = {}, p, len, newState, expected;
|
|
54156
54174
|
while (true) {
|
|
54157
54175
|
state = stack[stack.length - 1];
|
|
54158
54176
|
if (this.defaultActions[state]) {
|
|
54159
|
-
|
|
54177
|
+
action3 = this.defaultActions[state];
|
|
54160
54178
|
} else {
|
|
54161
54179
|
if (symbol === null || typeof symbol == "undefined") {
|
|
54162
54180
|
symbol = lex();
|
|
54163
54181
|
}
|
|
54164
|
-
|
|
54182
|
+
action3 = table[state] && table[state][symbol];
|
|
54165
54183
|
}
|
|
54166
|
-
if (typeof
|
|
54184
|
+
if (typeof action3 === "undefined" || !action3.length || !action3[0]) {
|
|
54167
54185
|
var errStr = "";
|
|
54168
54186
|
if (!recovering) {
|
|
54169
54187
|
expected = [];
|
|
@@ -54179,15 +54197,15 @@ var require_parser = __commonJSMin((exports, module2) => {
|
|
|
54179
54197
|
this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected });
|
|
54180
54198
|
}
|
|
54181
54199
|
}
|
|
54182
|
-
if (
|
|
54200
|
+
if (action3[0] instanceof Array && action3.length > 1) {
|
|
54183
54201
|
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
|
54184
54202
|
}
|
|
54185
|
-
switch (
|
|
54203
|
+
switch (action3[0]) {
|
|
54186
54204
|
case 1:
|
|
54187
54205
|
stack.push(symbol);
|
|
54188
54206
|
vstack.push(this.lexer.yytext);
|
|
54189
54207
|
lstack.push(this.lexer.yylloc);
|
|
54190
|
-
stack.push(
|
|
54208
|
+
stack.push(action3[1]);
|
|
54191
54209
|
symbol = null;
|
|
54192
54210
|
if (!preErrorSymbol) {
|
|
54193
54211
|
yyleng = this.lexer.yyleng;
|
|
@@ -54202,13 +54220,13 @@ var require_parser = __commonJSMin((exports, module2) => {
|
|
|
54202
54220
|
}
|
|
54203
54221
|
break;
|
|
54204
54222
|
case 2:
|
|
54205
|
-
len = this.productions_[
|
|
54223
|
+
len = this.productions_[action3[1]][1];
|
|
54206
54224
|
yyval.$ = vstack[vstack.length - len];
|
|
54207
54225
|
yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
|
|
54208
54226
|
if (ranges) {
|
|
54209
54227
|
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
|
54210
54228
|
}
|
|
54211
|
-
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy,
|
|
54229
|
+
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action3[1], vstack, lstack);
|
|
54212
54230
|
if (typeof r !== "undefined") {
|
|
54213
54231
|
return r;
|
|
54214
54232
|
}
|
|
@@ -54217,7 +54235,7 @@ var require_parser = __commonJSMin((exports, module2) => {
|
|
|
54217
54235
|
vstack = vstack.slice(0, -1 * len);
|
|
54218
54236
|
lstack = lstack.slice(0, -1 * len);
|
|
54219
54237
|
}
|
|
54220
|
-
stack.push(this.productions_[
|
|
54238
|
+
stack.push(this.productions_[action3[1]][0]);
|
|
54221
54239
|
vstack.push(yyval.$);
|
|
54222
54240
|
lstack.push(yyval._$);
|
|
54223
54241
|
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
@@ -57682,11 +57700,11 @@ var require_javascript_compiler = __commonJSMin((exports, module2) => {
|
|
|
57682
57700
|
var functionCall = this.source.functionCall(functionLookupCode, "call", helper.callParams);
|
|
57683
57701
|
this.push(functionCall);
|
|
57684
57702
|
},
|
|
57685
|
-
itemsSeparatedBy: function itemsSeparatedBy(
|
|
57703
|
+
itemsSeparatedBy: function itemsSeparatedBy(items5, separator) {
|
|
57686
57704
|
var result = [];
|
|
57687
|
-
result.push(
|
|
57688
|
-
for (var i = 1; i <
|
|
57689
|
-
result.push(separator,
|
|
57705
|
+
result.push(items5[0]);
|
|
57706
|
+
for (var i = 1; i < items5.length; i++) {
|
|
57707
|
+
result.push(separator, items5[i]);
|
|
57690
57708
|
}
|
|
57691
57709
|
return result;
|
|
57692
57710
|
},
|
|
@@ -64902,8 +64920,8 @@ var require_AsapAction = __commonJSMin((exports) => {
|
|
|
64902
64920
|
if (delay != null && delay > 0 || delay == null && this.delay > 0) {
|
|
64903
64921
|
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
|
64904
64922
|
}
|
|
64905
|
-
if (!scheduler.actions.some(function(
|
|
64906
|
-
return
|
|
64923
|
+
if (!scheduler.actions.some(function(action3) {
|
|
64924
|
+
return action3.id === id;
|
|
64907
64925
|
})) {
|
|
64908
64926
|
immediateProvider_1.immediateProvider.clearImmediate(id);
|
|
64909
64927
|
scheduler._scheduled = void 0;
|
|
@@ -64976,23 +64994,23 @@ var require_AsyncScheduler = __commonJSMin((exports) => {
|
|
|
64976
64994
|
_this._scheduled = void 0;
|
|
64977
64995
|
return _this;
|
|
64978
64996
|
}
|
|
64979
|
-
AsyncScheduler2.prototype.flush = function(
|
|
64997
|
+
AsyncScheduler2.prototype.flush = function(action3) {
|
|
64980
64998
|
var actions = this.actions;
|
|
64981
64999
|
if (this._active) {
|
|
64982
|
-
actions.push(
|
|
65000
|
+
actions.push(action3);
|
|
64983
65001
|
return;
|
|
64984
65002
|
}
|
|
64985
65003
|
var error;
|
|
64986
65004
|
this._active = true;
|
|
64987
65005
|
do {
|
|
64988
|
-
if (error =
|
|
65006
|
+
if (error = action3.execute(action3.state, action3.delay)) {
|
|
64989
65007
|
break;
|
|
64990
65008
|
}
|
|
64991
|
-
} while (
|
|
65009
|
+
} while (action3 = actions.shift());
|
|
64992
65010
|
this._active = false;
|
|
64993
65011
|
if (error) {
|
|
64994
|
-
while (
|
|
64995
|
-
|
|
65012
|
+
while (action3 = actions.shift()) {
|
|
65013
|
+
action3.unsubscribe();
|
|
64996
65014
|
}
|
|
64997
65015
|
throw error;
|
|
64998
65016
|
}
|
|
@@ -65032,22 +65050,22 @@ var require_AsapScheduler = __commonJSMin((exports) => {
|
|
|
65032
65050
|
function AsapScheduler2() {
|
|
65033
65051
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
65034
65052
|
}
|
|
65035
|
-
AsapScheduler2.prototype.flush = function(
|
|
65053
|
+
AsapScheduler2.prototype.flush = function(action3) {
|
|
65036
65054
|
this._active = true;
|
|
65037
65055
|
var flushId = this._scheduled;
|
|
65038
65056
|
this._scheduled = void 0;
|
|
65039
65057
|
var actions = this.actions;
|
|
65040
65058
|
var error;
|
|
65041
|
-
|
|
65059
|
+
action3 = action3 || actions.shift();
|
|
65042
65060
|
do {
|
|
65043
|
-
if (error =
|
|
65061
|
+
if (error = action3.execute(action3.state, action3.delay)) {
|
|
65044
65062
|
break;
|
|
65045
65063
|
}
|
|
65046
|
-
} while ((
|
|
65064
|
+
} while ((action3 = actions[0]) && action3.id === flushId && actions.shift());
|
|
65047
65065
|
this._active = false;
|
|
65048
65066
|
if (error) {
|
|
65049
|
-
while ((
|
|
65050
|
-
|
|
65067
|
+
while ((action3 = actions[0]) && action3.id === flushId && actions.shift()) {
|
|
65068
|
+
action3.unsubscribe();
|
|
65051
65069
|
}
|
|
65052
65070
|
throw error;
|
|
65053
65071
|
}
|
|
@@ -65234,8 +65252,8 @@ var require_AnimationFrameAction = __commonJSMin((exports) => {
|
|
|
65234
65252
|
if (delay != null && delay > 0 || delay == null && this.delay > 0) {
|
|
65235
65253
|
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
|
65236
65254
|
}
|
|
65237
|
-
if (!scheduler.actions.some(function(
|
|
65238
|
-
return
|
|
65255
|
+
if (!scheduler.actions.some(function(action3) {
|
|
65256
|
+
return action3.id === id;
|
|
65239
65257
|
})) {
|
|
65240
65258
|
animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
|
|
65241
65259
|
scheduler._scheduled = void 0;
|
|
@@ -65277,22 +65295,22 @@ var require_AnimationFrameScheduler = __commonJSMin((exports) => {
|
|
|
65277
65295
|
function AnimationFrameScheduler2() {
|
|
65278
65296
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
65279
65297
|
}
|
|
65280
|
-
AnimationFrameScheduler2.prototype.flush = function(
|
|
65298
|
+
AnimationFrameScheduler2.prototype.flush = function(action3) {
|
|
65281
65299
|
this._active = true;
|
|
65282
65300
|
var flushId = this._scheduled;
|
|
65283
65301
|
this._scheduled = void 0;
|
|
65284
65302
|
var actions = this.actions;
|
|
65285
65303
|
var error;
|
|
65286
|
-
|
|
65304
|
+
action3 = action3 || actions.shift();
|
|
65287
65305
|
do {
|
|
65288
|
-
if (error =
|
|
65306
|
+
if (error = action3.execute(action3.state, action3.delay)) {
|
|
65289
65307
|
break;
|
|
65290
65308
|
}
|
|
65291
|
-
} while ((
|
|
65309
|
+
} while ((action3 = actions[0]) && action3.id === flushId && actions.shift());
|
|
65292
65310
|
this._active = false;
|
|
65293
65311
|
if (error) {
|
|
65294
|
-
while ((
|
|
65295
|
-
|
|
65312
|
+
while ((action3 = actions[0]) && action3.id === flushId && actions.shift()) {
|
|
65313
|
+
action3.unsubscribe();
|
|
65296
65314
|
}
|
|
65297
65315
|
throw error;
|
|
65298
65316
|
}
|
|
@@ -65358,17 +65376,17 @@ var require_VirtualTimeScheduler = __commonJSMin((exports) => {
|
|
|
65358
65376
|
VirtualTimeScheduler2.prototype.flush = function() {
|
|
65359
65377
|
var _a2 = this, actions = _a2.actions, maxFrames = _a2.maxFrames;
|
|
65360
65378
|
var error;
|
|
65361
|
-
var
|
|
65362
|
-
while ((
|
|
65379
|
+
var action3;
|
|
65380
|
+
while ((action3 = actions[0]) && action3.delay <= maxFrames) {
|
|
65363
65381
|
actions.shift();
|
|
65364
|
-
this.frame =
|
|
65365
|
-
if (error =
|
|
65382
|
+
this.frame = action3.delay;
|
|
65383
|
+
if (error = action3.execute(action3.state, action3.delay)) {
|
|
65366
65384
|
break;
|
|
65367
65385
|
}
|
|
65368
65386
|
}
|
|
65369
65387
|
if (error) {
|
|
65370
|
-
while (
|
|
65371
|
-
|
|
65388
|
+
while (action3 = actions.shift()) {
|
|
65389
|
+
action3.unsubscribe();
|
|
65372
65390
|
}
|
|
65373
65391
|
throw error;
|
|
65374
65392
|
}
|
|
@@ -65400,9 +65418,9 @@ var require_VirtualTimeScheduler = __commonJSMin((exports) => {
|
|
|
65400
65418
|
return _super.prototype.schedule.call(this, state, delay);
|
|
65401
65419
|
}
|
|
65402
65420
|
this.active = false;
|
|
65403
|
-
var
|
|
65404
|
-
this.add(
|
|
65405
|
-
return
|
|
65421
|
+
var action3 = new VirtualAction2(this.scheduler, this.work);
|
|
65422
|
+
this.add(action3);
|
|
65423
|
+
return action3.schedule(state, delay);
|
|
65406
65424
|
} else {
|
|
65407
65425
|
return Subscription_1.Subscription.EMPTY;
|
|
65408
65426
|
}
|
|
@@ -79132,15 +79150,15 @@ var require_ora2 = __commonJSMin((exports, module2) => {
|
|
|
79132
79150
|
return new Ora(options3);
|
|
79133
79151
|
};
|
|
79134
79152
|
module2.exports = oraFactory;
|
|
79135
|
-
module2.exports.promise = (
|
|
79136
|
-
if (typeof
|
|
79153
|
+
module2.exports.promise = (action3, options3) => {
|
|
79154
|
+
if (typeof action3.then !== "function") {
|
|
79137
79155
|
throw new TypeError("Parameter `action` must be a Promise");
|
|
79138
79156
|
}
|
|
79139
79157
|
const spinner = new Ora(options3);
|
|
79140
79158
|
spinner.start();
|
|
79141
79159
|
(async () => {
|
|
79142
79160
|
try {
|
|
79143
|
-
await
|
|
79161
|
+
await action3;
|
|
79144
79162
|
spinner.succeed();
|
|
79145
79163
|
} catch {
|
|
79146
79164
|
spinner.fail();
|
|
@@ -79321,13 +79339,13 @@ var require_base3 = __commonJSMin((exports, module2) => {
|
|
|
79321
79339
|
}
|
|
79322
79340
|
handleSubmitEvents(submit) {
|
|
79323
79341
|
const self3 = this;
|
|
79324
|
-
const
|
|
79342
|
+
const validate5 = runAsync(this.opt.validate);
|
|
79325
79343
|
const asyncFilter = runAsync(this.opt.filter);
|
|
79326
79344
|
const validation = submit.pipe(flatMap((value) => {
|
|
79327
79345
|
this.startSpinner(value, this.opt.filteringText);
|
|
79328
79346
|
return asyncFilter(value, self3.answers).then((filteredValue) => {
|
|
79329
79347
|
this.startSpinner(filteredValue, this.opt.validatingText);
|
|
79330
|
-
return
|
|
79348
|
+
return validate5(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
|
|
79331
79349
|
}, (err) => ({ isValid: err }));
|
|
79332
79350
|
}), share());
|
|
79333
79351
|
const success = validation.pipe(filter3((state) => state.isValid === true), take(1));
|
|
@@ -97455,7 +97473,7 @@ var init_stateField = __esmMin(() => {
|
|
|
97455
97473
|
if (typeof value.action === "function") {
|
|
97456
97474
|
schema.state.value = {
|
|
97457
97475
|
effectedByFields: value.effectedByFields,
|
|
97458
|
-
action: function
|
|
97476
|
+
action: function action3(data, lastValue) {
|
|
97459
97477
|
return value.action(data, lastValue || initValue);
|
|
97460
97478
|
}
|
|
97461
97479
|
};
|
|
@@ -97773,8 +97791,8 @@ var init_checkSchema = __esmMin(() => {
|
|
|
97773
97791
|
};
|
|
97774
97792
|
checkRepeatItems = function checkRepeatItems2(schema, extra) {
|
|
97775
97793
|
if (schema.items && schema.items.length > 0) {
|
|
97776
|
-
var
|
|
97777
|
-
var keys =
|
|
97794
|
+
var items5 = getItems(schema, {}, extra);
|
|
97795
|
+
var keys = items5.map(function(x) {
|
|
97778
97796
|
return x.key;
|
|
97779
97797
|
});
|
|
97780
97798
|
var tmp = [];
|
|
@@ -97956,9 +97974,9 @@ var init_baseReader = __esmMin(() => {
|
|
|
97956
97974
|
initValues[_schema.key] = _this.getSchemaDefaultValue(_schema, brothers, isRoot);
|
|
97957
97975
|
}
|
|
97958
97976
|
if (_schema.items) {
|
|
97959
|
-
var
|
|
97960
|
-
|
|
97961
|
-
return readDefaultValue2(each2,
|
|
97977
|
+
var items5 = getItems(_schema, _this.data, _this.extra);
|
|
97978
|
+
items5.forEach(function(each2) {
|
|
97979
|
+
return readDefaultValue2(each2, items5.map(function(x) {
|
|
97962
97980
|
return x.key;
|
|
97963
97981
|
}), false);
|
|
97964
97982
|
});
|
|
@@ -97976,7 +97994,7 @@ var init_baseReader = __esmMin(() => {
|
|
|
97976
97994
|
if (!isEffectedValue(val)) {
|
|
97977
97995
|
return val;
|
|
97978
97996
|
}
|
|
97979
|
-
var _ref = val, _ref$effectedByFields = _ref.effectedByFields, effectedByFields = _ref$effectedByFields === void 0 ? [] : _ref$effectedByFields,
|
|
97997
|
+
var _ref = val, _ref$effectedByFields = _ref.effectedByFields, effectedByFields = _ref$effectedByFields === void 0 ? [] : _ref$effectedByFields, action3 = _ref.action, rest = _objectWithoutProperties(_ref, _excluded);
|
|
97980
97998
|
if (isRoot) {
|
|
97981
97999
|
throw Error("[".concat(schema.key, "] top level should not have effects"));
|
|
97982
98000
|
}
|
|
@@ -97988,7 +98006,7 @@ var init_baseReader = __esmMin(() => {
|
|
|
97988
98006
|
}
|
|
97989
98007
|
return _objectSpread2({
|
|
97990
98008
|
effectedByFields: curNodeEffectedByFields,
|
|
97991
|
-
action:
|
|
98009
|
+
action: action3
|
|
97992
98010
|
}, rest);
|
|
97993
98011
|
};
|
|
97994
98012
|
return handleEffects(state.value);
|
|
@@ -98972,7 +98990,7 @@ var require_utils10 = __commonJSMin((exports) => {
|
|
|
98972
98990
|
}, choices);
|
|
98973
98991
|
};
|
|
98974
98992
|
exports.getQuestion = getQuestion;
|
|
98975
|
-
var
|
|
98993
|
+
var when8 = (schema, answers, extra) => {
|
|
98976
98994
|
if (schema.when && typeof schema.when === "function") {
|
|
98977
98995
|
return schema.when(answers, extra);
|
|
98978
98996
|
}
|
|
@@ -98998,7 +99016,7 @@ var require_utils10 = __commonJSMin((exports) => {
|
|
|
98998
99016
|
});
|
|
98999
99017
|
return (answers) => {
|
|
99000
99018
|
try {
|
|
99001
|
-
if (!
|
|
99019
|
+
if (!when8(schema, answers, nodeInfo.extra)) {
|
|
99002
99020
|
return Promise.resolve(true);
|
|
99003
99021
|
}
|
|
99004
99022
|
const question = getQuestion({
|
|
@@ -99602,18 +99620,18 @@ var require_transformSchema = __commonJSMin((exports) => {
|
|
|
99602
99620
|
schemaItem.label = schemaItem.state.cliLabel;
|
|
99603
99621
|
}
|
|
99604
99622
|
const {
|
|
99605
|
-
when,
|
|
99606
|
-
validate:
|
|
99623
|
+
when: when8,
|
|
99624
|
+
validate: validate5
|
|
99607
99625
|
} = schemaItem;
|
|
99608
99626
|
schemaItem.when = (values, extra) => {
|
|
99609
99627
|
if (!(0, _lodash.isUndefined)(configValue[schemaItem.key])) {
|
|
99610
99628
|
return false;
|
|
99611
99629
|
}
|
|
99612
|
-
return
|
|
99630
|
+
return when8 ? when8(values, extra) : true;
|
|
99613
99631
|
};
|
|
99614
99632
|
schemaItem.validate = async (value, data, extra) => {
|
|
99615
|
-
if (
|
|
99616
|
-
const result = await
|
|
99633
|
+
if (validate5) {
|
|
99634
|
+
const result = await validate5(value, data, extra);
|
|
99617
99635
|
if (!result.success) {
|
|
99618
99636
|
return result;
|
|
99619
99637
|
}
|
|
@@ -101989,11 +102007,11 @@ var init_esm = __esmMin(() => {
|
|
|
101989
102007
|
return path6;
|
|
101990
102008
|
};
|
|
101991
102009
|
this.push = function() {
|
|
101992
|
-
var
|
|
102010
|
+
var items5 = [];
|
|
101993
102011
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
101994
|
-
|
|
102012
|
+
items5[_i] = arguments[_i];
|
|
101995
102013
|
}
|
|
101996
|
-
return _this.concat.apply(_this, __spreadArray([], __read(
|
|
102014
|
+
return _this.concat.apply(_this, __spreadArray([], __read(items5), false));
|
|
101997
102015
|
};
|
|
101998
102016
|
this.pop = function() {
|
|
101999
102017
|
if (_this.isMatchPattern || _this.isRegExp) {
|
|
@@ -102002,18 +102020,18 @@ var init_esm = __esmMin(() => {
|
|
|
102002
102020
|
return new Path2(_this.segments.slice(0, _this.segments.length - 1));
|
|
102003
102021
|
};
|
|
102004
102022
|
this.splice = function(start, deleteCount) {
|
|
102005
|
-
var
|
|
102023
|
+
var items5 = [];
|
|
102006
102024
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
102007
|
-
|
|
102025
|
+
items5[_i - 2] = arguments[_i];
|
|
102008
102026
|
}
|
|
102009
102027
|
if (_this.isMatchPattern || _this.isRegExp) {
|
|
102010
102028
|
throw new Error("".concat(_this.entire, " cannot be splice"));
|
|
102011
102029
|
}
|
|
102012
|
-
|
|
102030
|
+
items5 = items5.reduce(function(buf, item) {
|
|
102013
102031
|
return buf.concat(parseString(item));
|
|
102014
102032
|
}, []);
|
|
102015
102033
|
var segments_ = _this.segments.slice();
|
|
102016
|
-
segments_.splice.apply(segments_, __spreadArray([start, deleteCount], __read(
|
|
102034
|
+
segments_.splice.apply(segments_, __spreadArray([start, deleteCount], __read(items5), false));
|
|
102017
102035
|
return new Path2(segments_);
|
|
102018
102036
|
};
|
|
102019
102037
|
this.forEach = function(callback) {
|
|
@@ -107095,9 +107113,9 @@ var init_BaseField = __esmMin(() => {
|
|
|
107095
107113
|
return Path.parse(pattern).matchAliasGroup(_this.address, _this.path);
|
|
107096
107114
|
};
|
|
107097
107115
|
this.inject = function(actions) {
|
|
107098
|
-
each(actions, function(
|
|
107099
|
-
if (isFn(
|
|
107100
|
-
_this.actions[key] =
|
|
107116
|
+
each(actions, function(action3, key) {
|
|
107117
|
+
if (isFn(action3)) {
|
|
107118
|
+
_this.actions[key] = action3;
|
|
107101
107119
|
}
|
|
107102
107120
|
});
|
|
107103
107121
|
};
|
|
@@ -108109,16 +108127,16 @@ var init_ArrayField = __esmMin(() => {
|
|
|
108109
108127
|
var _this = _super.call(this, address, props, form, designable) || this;
|
|
108110
108128
|
_this.displayName = "ArrayField";
|
|
108111
108129
|
_this.push = function() {
|
|
108112
|
-
var
|
|
108130
|
+
var items5 = [];
|
|
108113
108131
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
108114
|
-
|
|
108132
|
+
items5[_i] = arguments[_i];
|
|
108115
108133
|
}
|
|
108116
108134
|
return action(function() {
|
|
108117
108135
|
var _a2;
|
|
108118
108136
|
if (!isArr(_this.value)) {
|
|
108119
108137
|
_this.value = [];
|
|
108120
108138
|
}
|
|
108121
|
-
(_a2 = _this.value).push.apply(_a2, __spreadArray6([], __read6(
|
|
108139
|
+
(_a2 = _this.value).push.apply(_a2, __spreadArray6([], __read6(items5), false));
|
|
108122
108140
|
return _this.onInput(_this.value);
|
|
108123
108141
|
});
|
|
108124
108142
|
};
|
|
@@ -108136,9 +108154,9 @@ var init_ArrayField = __esmMin(() => {
|
|
|
108136
108154
|
});
|
|
108137
108155
|
};
|
|
108138
108156
|
_this.insert = function(index) {
|
|
108139
|
-
var
|
|
108157
|
+
var items5 = [];
|
|
108140
108158
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
108141
|
-
|
|
108159
|
+
items5[_i - 1] = arguments[_i];
|
|
108142
108160
|
}
|
|
108143
108161
|
return action(function() {
|
|
108144
108162
|
var _a2;
|
|
@@ -108147,9 +108165,9 @@ var init_ArrayField = __esmMin(() => {
|
|
|
108147
108165
|
}
|
|
108148
108166
|
spliceArrayState(_this, {
|
|
108149
108167
|
startIndex: index,
|
|
108150
|
-
insertCount:
|
|
108168
|
+
insertCount: items5.length
|
|
108151
108169
|
});
|
|
108152
|
-
(_a2 = _this.value).splice.apply(_a2, __spreadArray6([index, 0], __read6(
|
|
108170
|
+
(_a2 = _this.value).splice.apply(_a2, __spreadArray6([index, 0], __read6(items5), false));
|
|
108153
108171
|
return _this.onInput(_this.value);
|
|
108154
108172
|
});
|
|
108155
108173
|
};
|
|
@@ -108174,9 +108192,9 @@ var init_ArrayField = __esmMin(() => {
|
|
|
108174
108192
|
});
|
|
108175
108193
|
};
|
|
108176
108194
|
_this.unshift = function() {
|
|
108177
|
-
var
|
|
108195
|
+
var items5 = [];
|
|
108178
108196
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
108179
|
-
|
|
108197
|
+
items5[_i] = arguments[_i];
|
|
108180
108198
|
}
|
|
108181
108199
|
return action(function() {
|
|
108182
108200
|
var _a2;
|
|
@@ -108185,9 +108203,9 @@ var init_ArrayField = __esmMin(() => {
|
|
|
108185
108203
|
}
|
|
108186
108204
|
spliceArrayState(_this, {
|
|
108187
108205
|
startIndex: 0,
|
|
108188
|
-
insertCount:
|
|
108206
|
+
insertCount: items5.length
|
|
108189
108207
|
});
|
|
108190
|
-
(_a2 = _this.value).unshift.apply(_a2, __spreadArray6([], __read6(
|
|
108208
|
+
(_a2 = _this.value).unshift.apply(_a2, __spreadArray6([], __read6(items5), false));
|
|
108191
108209
|
return _this.onInput(_this.value);
|
|
108192
108210
|
});
|
|
108193
108211
|
};
|
|
@@ -109226,7 +109244,7 @@ var init_transformer = __esmMin(() => {
|
|
|
109226
109244
|
if (isFn(reaction2)) {
|
|
109227
109245
|
return reaction2(field, baseScope);
|
|
109228
109246
|
}
|
|
109229
|
-
var
|
|
109247
|
+
var when8 = reaction2.when, fulfill = reaction2.fulfill, otherwise = reaction2.otherwise, target = reaction2.target, effects = reaction2.effects;
|
|
109230
109248
|
var run = function() {
|
|
109231
109249
|
var $deps = getDependencies(field, reaction2.dependencies);
|
|
109232
109250
|
var $dependencies = $deps;
|
|
@@ -109235,8 +109253,8 @@ var init_transformer = __esmMin(() => {
|
|
|
109235
109253
|
$deps,
|
|
109236
109254
|
$dependencies
|
|
109237
109255
|
});
|
|
109238
|
-
var compiledWhen = shallowCompile(
|
|
109239
|
-
var condition =
|
|
109256
|
+
var compiledWhen = shallowCompile(when8, scope);
|
|
109257
|
+
var condition = when8 ? compiledWhen : true;
|
|
109240
109258
|
var request = condition ? fulfill : otherwise;
|
|
109241
109259
|
var runner2 = condition ? fulfill === null || fulfill === void 0 ? void 0 : fulfill.run : otherwise === null || otherwise === void 0 ? void 0 : otherwise.run;
|
|
109242
109260
|
setSchemaFieldState({
|
|
@@ -109556,10 +109574,10 @@ var init_schema = __esmMin(() => {
|
|
|
109556
109574
|
}
|
|
109557
109575
|
return _this.items;
|
|
109558
109576
|
};
|
|
109559
|
-
this.setAdditionalItems = function(
|
|
109560
|
-
if (!
|
|
109577
|
+
this.setAdditionalItems = function(items5) {
|
|
109578
|
+
if (!items5)
|
|
109561
109579
|
return;
|
|
109562
|
-
_this.additionalItems = new Schema2(
|
|
109580
|
+
_this.additionalItems = new Schema2(items5, _this);
|
|
109563
109581
|
return _this.additionalItems;
|
|
109564
109582
|
};
|
|
109565
109583
|
this.findDefinitions = function(ref2) {
|
|
@@ -110233,13 +110251,13 @@ var require_base4 = __commonJSMin((exports, module2) => {
|
|
|
110233
110251
|
}
|
|
110234
110252
|
handleSubmitEvents(submit) {
|
|
110235
110253
|
const self3 = this;
|
|
110236
|
-
const
|
|
110254
|
+
const validate5 = runAsync(this.opt.validate);
|
|
110237
110255
|
const asyncFilter = runAsync(this.opt.filter);
|
|
110238
110256
|
const validation = submit.pipe(flatMap((value) => {
|
|
110239
110257
|
this.startSpinner(value, this.opt.filteringText);
|
|
110240
110258
|
return asyncFilter(value, self3.answers).then((filteredValue) => {
|
|
110241
110259
|
this.startSpinner(filteredValue, this.opt.validatingText);
|
|
110242
|
-
return
|
|
110260
|
+
return validate5(filteredValue, self3.answers).then((isValid5) => ({ isValid: isValid5, value: filteredValue }), (err) => ({ isValid: err, value: filteredValue }));
|
|
110243
110261
|
}, (err) => ({ isValid: err }));
|
|
110244
110262
|
}), share());
|
|
110245
110263
|
const success = validation.pipe(filter3((state) => state.isValid === true), take(1));
|
|
@@ -111293,7 +111311,7 @@ function getQuestionFromSchema(schema) {
|
|
|
111293
111311
|
return [];
|
|
111294
111312
|
}
|
|
111295
111313
|
var questions = fields.map(function(field) {
|
|
111296
|
-
var _field = properties[field], type = _field.type, title = _field.title, defaultValue = _field["default"],
|
|
111314
|
+
var _field = properties[field], type = _field.type, title = _field.title, defaultValue = _field["default"], items5 = _field["enum"], fieldValidate = _field["x-validate"], extra = _objectWithoutProperties(_field, _excluded2);
|
|
111297
111315
|
if (type === "void" || type === "object") {
|
|
111298
111316
|
return getQuestionFromSchema(properties[field], configValue, validateMap, initValue);
|
|
111299
111317
|
}
|
|
@@ -111351,16 +111369,16 @@ function getQuestionFromSchema(schema) {
|
|
|
111351
111369
|
message: title || field,
|
|
111352
111370
|
"default": initValue[field] || defaultValue,
|
|
111353
111371
|
origin: extra,
|
|
111354
|
-
validate: function
|
|
111372
|
+
validate: function validate5(input) {
|
|
111355
111373
|
return questionValidate(field, input);
|
|
111356
111374
|
},
|
|
111357
111375
|
when: !configValue[field]
|
|
111358
111376
|
};
|
|
111359
|
-
if (
|
|
111377
|
+
if (items5) {
|
|
111360
111378
|
if ((0, import_lodash.isArray)(defaultValue)) {
|
|
111361
111379
|
return _objectSpread2(_objectSpread2({}, result), {}, {
|
|
111362
111380
|
type: "checkbox",
|
|
111363
|
-
choices:
|
|
111381
|
+
choices: items5.map(function(item) {
|
|
111364
111382
|
return {
|
|
111365
111383
|
type: "choice",
|
|
111366
111384
|
name: (0, import_lodash.isObject)(item) ? item.label : item,
|
|
@@ -111371,7 +111389,7 @@ function getQuestionFromSchema(schema) {
|
|
|
111371
111389
|
}
|
|
111372
111390
|
return _objectSpread2(_objectSpread2({}, result), {}, {
|
|
111373
111391
|
type: "list",
|
|
111374
|
-
choices:
|
|
111392
|
+
choices: items5.map(function(item) {
|
|
111375
111393
|
return {
|
|
111376
111394
|
type: "choice",
|
|
111377
111395
|
name: (0, import_lodash.isObject)(item) ? item.label : item,
|
|
@@ -111500,7 +111518,7 @@ var init_prompt = __esmMin(() => {
|
|
|
111500
111518
|
return state;
|
|
111501
111519
|
};
|
|
111502
111520
|
handleXReactions = /* @__PURE__ */ function() {
|
|
111503
|
-
var _ref = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(xReactions, answers,
|
|
111521
|
+
var _ref = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(xReactions, answers, items5, item) {
|
|
111504
111522
|
var answer, _iterator, _step, _loop;
|
|
111505
111523
|
return _regeneratorRuntime().wrap(function _callee$(_context2) {
|
|
111506
111524
|
while (1) {
|
|
@@ -111537,12 +111555,12 @@ var init_prompt = __esmMin(() => {
|
|
|
111537
111555
|
value: answer[item.name]
|
|
111538
111556
|
}),
|
|
111539
111557
|
$values: answers,
|
|
111540
|
-
$target:
|
|
111558
|
+
$target: items5.find(function(it2) {
|
|
111541
111559
|
return it2.name === (xReaction === null || xReaction === void 0 ? void 0 : xReaction.target);
|
|
111542
111560
|
})
|
|
111543
111561
|
};
|
|
111544
111562
|
state = xReaction !== null && xReaction !== void 0 && xReaction.when && !compileRule(xReaction === null || xReaction === void 0 ? void 0 : xReaction.when, _scope) ? compileRule(xReaction === null || xReaction === void 0 ? void 0 : (_xReaction$otherwise = xReaction.otherwise) === null || _xReaction$otherwise === void 0 ? void 0 : _xReaction$otherwise.state, _scope) : compileRule(xReaction === null || xReaction === void 0 ? void 0 : (_xReaction$fulfill = xReaction.fulfill) === null || _xReaction$fulfill === void 0 ? void 0 : _xReaction$fulfill.state, _scope);
|
|
111545
|
-
_iterator2 = _createForOfIteratorHelper(
|
|
111563
|
+
_iterator2 = _createForOfIteratorHelper(items5);
|
|
111546
111564
|
_context.prev = 12;
|
|
111547
111565
|
_iterator2.s();
|
|
111548
111566
|
case 14:
|
|
@@ -111592,7 +111610,7 @@ var init_prompt = __esmMin(() => {
|
|
|
111592
111610
|
break;
|
|
111593
111611
|
}
|
|
111594
111612
|
dependencies3 = xReaction === null || xReaction === void 0 ? void 0 : xReaction.dependencies;
|
|
111595
|
-
$dependencies =
|
|
111613
|
+
$dependencies = items5.filter(function(it2) {
|
|
111596
111614
|
return dependencies3.includes(it2.name);
|
|
111597
111615
|
}).map(function(it2) {
|
|
111598
111616
|
return answers[it2.name];
|
|
@@ -112718,6 +112736,7 @@ var init_zh = __esmMin(() => {
|
|
|
112718
112736
|
sass: "\u542F\u7528 Sass \u652F\u6301",
|
|
112719
112737
|
bff: "\u542F\u7528\u300CBFF\u300D\u529F\u80FD",
|
|
112720
112738
|
micro_frontend: "\u542F\u7528\u300C\u5FAE\u524D\u7AEF\u300D\u6A21\u5F0F",
|
|
112739
|
+
electron: "\u542F\u7528\u300CElectron\u300D\u6A21\u5F0F",
|
|
112721
112740
|
i18n: "\u542F\u7528\u300C\u56FD\u9645\u5316\uFF08i18n\uFF09\u300D\u529F\u80FD",
|
|
112722
112741
|
test: "\u542F\u7528\u300C\u5355\u5143\u6D4B\u8BD5 / \u96C6\u6210\u6D4B\u8BD5\u300D\u529F\u80FD",
|
|
112723
112742
|
e2e_test: "\u542F\u7528\u300CE2E \u6D4B\u8BD5\u300D\u529F\u80FD",
|
|
@@ -112736,7 +112755,7 @@ var init_zh = __esmMin(() => {
|
|
|
112736
112755
|
},
|
|
112737
112756
|
refactor: {
|
|
112738
112757
|
self: "\u81EA\u52A8\u91CD\u6784",
|
|
112739
|
-
|
|
112758
|
+
bff_to_app: "BFF \u5207\u6362\u6846\u67B6\u6A21\u5F0F"
|
|
112740
112759
|
}
|
|
112741
112760
|
},
|
|
112742
112761
|
"boolean": {
|
|
@@ -112749,10 +112768,21 @@ var init_zh = __esmMin(() => {
|
|
|
112749
112768
|
packageManager: {
|
|
112750
112769
|
self: "\u8BF7\u9009\u62E9\u5305\u7BA1\u7406\u5DE5\u5177"
|
|
112751
112770
|
},
|
|
112771
|
+
runWay: {
|
|
112772
|
+
self: "\u662F\u5426\u9700\u8981\u652F\u6301\u4EE5\u4E0B\u7C7B\u578B\u5E94\u7528",
|
|
112773
|
+
no: "\u4E0D\u9700\u8981",
|
|
112774
|
+
electron: "Electron"
|
|
112775
|
+
},
|
|
112752
112776
|
entry: {
|
|
112753
112777
|
name: "\u8BF7\u586B\u5199\u5165\u53E3\u540D\u79F0",
|
|
112754
112778
|
no_empty: "\u5165\u53E3\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\uFF01",
|
|
112755
|
-
no_pages: '\u5165\u53E3\u540D\u79F0\u4E0D\u652F\u6301 "pages"\uFF01'
|
|
112779
|
+
no_pages: '\u5165\u53E3\u540D\u79F0\u4E0D\u652F\u6301 "pages"\uFF01',
|
|
112780
|
+
needModifyConfig: "\u662F\u5426\u9700\u8981\u8C03\u6574\u9ED8\u8BA4\u914D\u7F6E?",
|
|
112781
|
+
clientRoute: {
|
|
112782
|
+
self: "\u8BF7\u9009\u62E9\u5BA2\u6237\u7AEF\u8DEF\u7531\u65B9\u5F0F",
|
|
112783
|
+
selfControlRoute: "\u81EA\u63A7\u8DEF\u7531",
|
|
112784
|
+
conventionalRoute: "\u7EA6\u5B9A\u5F0F\u8DEF\u7531"
|
|
112785
|
+
}
|
|
112756
112786
|
},
|
|
112757
112787
|
packageName: {
|
|
112758
112788
|
self: "\u8BF7\u586B\u5199\u9879\u76EE\u540D\u79F0",
|
|
@@ -112811,6 +112841,7 @@ var init_en = __esmMin(() => {
|
|
|
112811
112841
|
sass: "Enable Sass",
|
|
112812
112842
|
bff: "Enable BFF",
|
|
112813
112843
|
micro_frontend: "Enable Micro Frontend",
|
|
112844
|
+
electron: "Enable Electron",
|
|
112814
112845
|
i18n: "Enable Internationalization (i18n)",
|
|
112815
112846
|
test: "Enable Unit Test / Integration Test",
|
|
112816
112847
|
e2e_test: "Enable E2E Test",
|
|
@@ -112829,7 +112860,7 @@ var init_en = __esmMin(() => {
|
|
|
112829
112860
|
},
|
|
112830
112861
|
refactor: {
|
|
112831
112862
|
self: "Automatic refactor",
|
|
112832
|
-
|
|
112863
|
+
bff_to_app: "Transform BFF to frame mode"
|
|
112833
112864
|
}
|
|
112834
112865
|
},
|
|
112835
112866
|
"boolean": {
|
|
@@ -112852,10 +112883,21 @@ var init_en = __esmMin(() => {
|
|
|
112852
112883
|
no_empty: "The package path cannot be empty!",
|
|
112853
112884
|
format: "Only lowercase letters, numbers and delimiters (-), and underscore (_), and directory delimiters (/) can be used in package path."
|
|
112854
112885
|
},
|
|
112886
|
+
runWay: {
|
|
112887
|
+
self: "Do you need to support the following types of applications",
|
|
112888
|
+
no: "Not Enabled",
|
|
112889
|
+
electron: "Electron"
|
|
112890
|
+
},
|
|
112855
112891
|
entry: {
|
|
112856
112892
|
name: "Entry name",
|
|
112857
112893
|
no_empty: "The entry name cannot be empty!",
|
|
112858
|
-
no_pages: 'The entry name cannot be "pages"!'
|
|
112894
|
+
no_pages: 'The entry name cannot be "pages"!',
|
|
112895
|
+
needModifyConfig: "Modify the Default Configuration?",
|
|
112896
|
+
clientRoute: {
|
|
112897
|
+
self: "Client Routing",
|
|
112898
|
+
selfControlRoute: "Self Control Route",
|
|
112899
|
+
conventionalRoute: "Conventional Route"
|
|
112900
|
+
}
|
|
112859
112901
|
},
|
|
112860
112902
|
framework: {
|
|
112861
112903
|
self: "Please select the framework you want to use",
|
|
@@ -112884,7 +112926,7 @@ var init_locale2 = __esmMin(() => {
|
|
|
112884
112926
|
en: EN_LOCALE
|
|
112885
112927
|
});
|
|
112886
112928
|
});
|
|
112887
|
-
var _BooleanConfigName, BooleanConfig, BooleanConfigName,
|
|
112929
|
+
var _BooleanConfigName, BooleanConfig, BooleanConfigName, BooleanSchemas;
|
|
112888
112930
|
var init_boolean = __esmMin(() => {
|
|
112889
112931
|
init_defineProperty();
|
|
112890
112932
|
init_locale2();
|
|
@@ -112897,15 +112939,13 @@ var init_boolean = __esmMin(() => {
|
|
|
112897
112939
|
}), _defineProperty(_BooleanConfigName, BooleanConfig.YES, function() {
|
|
112898
112940
|
return i18n.t(localeKeys["boolean"].yes);
|
|
112899
112941
|
}), _BooleanConfigName);
|
|
112900
|
-
|
|
112901
|
-
|
|
112902
|
-
|
|
112903
|
-
|
|
112904
|
-
|
|
112905
|
-
|
|
112906
|
-
|
|
112907
|
-
}];
|
|
112908
|
-
};
|
|
112942
|
+
BooleanSchemas = [{
|
|
112943
|
+
key: BooleanConfig.NO,
|
|
112944
|
+
label: BooleanConfigName[BooleanConfig.NO]
|
|
112945
|
+
}, {
|
|
112946
|
+
key: BooleanConfig.YES,
|
|
112947
|
+
label: BooleanConfigName[BooleanConfig.YES]
|
|
112948
|
+
}];
|
|
112909
112949
|
});
|
|
112910
112950
|
function getSolutionNameFromSubSolution(solution) {
|
|
112911
112951
|
if (solution === SubSolution.MWATest) {
|
|
@@ -112916,7 +112956,7 @@ function getSolutionNameFromSubSolution(solution) {
|
|
|
112916
112956
|
}
|
|
112917
112957
|
return solution;
|
|
112918
112958
|
}
|
|
112919
|
-
var _SolutionText, _SubSolutionText, _SolutionToolsMap, _SolutionGenerator, _SubSolutionGenerator, Solution, SubSolution, SolutionText, SubSolutionText, SolutionToolsMap,
|
|
112959
|
+
var _SolutionText, _SubSolutionText, _SolutionToolsMap, _SolutionGenerator, _SubSolutionGenerator, Solution, SubSolution, SolutionText, SubSolutionText, SolutionToolsMap, SolutionSchema, SubSolutionSchema, BaseGenerator, SolutionGenerator, SubSolutionGenerator, ChangesetGenerator, DependenceGenerator, EntryGenerator, ElectronGenerator, EslintGenerator;
|
|
112920
112960
|
var init_solution = __esmMin(() => {
|
|
112921
112961
|
init_toConsumableArray();
|
|
112922
112962
|
init_defineProperty();
|
|
@@ -112949,64 +112989,114 @@ var init_solution = __esmMin(() => {
|
|
|
112949
112989
|
return i18n.t(localeKeys.sub_solution.inner_module);
|
|
112950
112990
|
}), _SubSolutionText);
|
|
112951
112991
|
SolutionToolsMap = (_SolutionToolsMap = {}, _defineProperty(_SolutionToolsMap, Solution.MWA, "@modern-js/app-tools"), _defineProperty(_SolutionToolsMap, Solution.Module, "@modern-js/module-tools"), _defineProperty(_SolutionToolsMap, Solution.Monorepo, "@modern-js/monorepo-tools"), _SolutionToolsMap);
|
|
112952
|
-
|
|
112953
|
-
|
|
112954
|
-
|
|
112955
|
-
|
|
112956
|
-
|
|
112957
|
-
|
|
112958
|
-
|
|
112959
|
-
|
|
112960
|
-
|
|
112961
|
-
|
|
112962
|
-
|
|
112963
|
-
|
|
112964
|
-
|
|
112965
|
-
|
|
112966
|
-
|
|
112967
|
-
|
|
112968
|
-
|
|
112969
|
-
|
|
112970
|
-
|
|
112971
|
-
|
|
112972
|
-
|
|
112973
|
-
|
|
112974
|
-
|
|
112975
|
-
|
|
112976
|
-
|
|
112977
|
-
}()
|
|
112992
|
+
SolutionSchema = {
|
|
112993
|
+
key: "solution_schema",
|
|
112994
|
+
isObject: true,
|
|
112995
|
+
items: [{
|
|
112996
|
+
key: "solution",
|
|
112997
|
+
label: function label() {
|
|
112998
|
+
return i18n.t(localeKeys.solution.self);
|
|
112999
|
+
},
|
|
113000
|
+
type: ["string"],
|
|
113001
|
+
mutualExclusion: true,
|
|
113002
|
+
items: function items(_data, extra) {
|
|
113003
|
+
var _extra$customPlugin, _extra$customPlugin$c;
|
|
113004
|
+
var items5 = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values(Solution)).filter(function(solution) {
|
|
113005
|
+
return !(extra !== null && extra !== void 0 && extra.isSubProject && solution === Solution.Monorepo);
|
|
113006
|
+
}).map(function(solution) {
|
|
113007
|
+
return {
|
|
113008
|
+
key: solution,
|
|
113009
|
+
label: SolutionText[solution]
|
|
113010
|
+
};
|
|
113011
|
+
});
|
|
113012
|
+
if (extra !== null && extra !== void 0 && (_extra$customPlugin = extra.customPlugin) !== null && _extra$customPlugin !== void 0 && (_extra$customPlugin$c = _extra$customPlugin.custom) !== null && _extra$customPlugin$c !== void 0 && _extra$customPlugin$c.length) {
|
|
113013
|
+
return [].concat(_toConsumableArray(items5), [{
|
|
113014
|
+
key: "custom",
|
|
113015
|
+
label: i18n.t(localeKeys.solution.custom)
|
|
113016
|
+
}]);
|
|
112978
113017
|
}
|
|
113018
|
+
return items5;
|
|
112979
113019
|
}
|
|
112980
|
-
}
|
|
113020
|
+
}, {
|
|
113021
|
+
key: "scenes",
|
|
113022
|
+
label: function label2() {
|
|
113023
|
+
return i18n.t(localeKeys.scenes.self);
|
|
113024
|
+
},
|
|
113025
|
+
type: ["string"],
|
|
113026
|
+
mutualExclusion: true,
|
|
113027
|
+
when: function when(data, extra) {
|
|
113028
|
+
return (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[data.solution] && extra.customPlugin[data.solution].length > 0;
|
|
113029
|
+
},
|
|
113030
|
+
items: function items2(data, extra) {
|
|
113031
|
+
var items5 = (extra !== null && extra !== void 0 && extra.customPlugin ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[data.solution]) || [] : []).map(function(plugin) {
|
|
113032
|
+
return {
|
|
113033
|
+
key: plugin.key,
|
|
113034
|
+
label: plugin.name
|
|
113035
|
+
};
|
|
113036
|
+
});
|
|
113037
|
+
if (data.solution && data.solution !== "custom") {
|
|
113038
|
+
items5.unshift({
|
|
113039
|
+
key: data.solution,
|
|
113040
|
+
label: "".concat(SolutionText[data.solution](), "(").concat(i18n.t(localeKeys.solution["default"]), ")")
|
|
113041
|
+
});
|
|
113042
|
+
}
|
|
113043
|
+
return items5;
|
|
113044
|
+
}
|
|
113045
|
+
}]
|
|
112981
113046
|
};
|
|
112982
|
-
|
|
112983
|
-
|
|
112984
|
-
|
|
112985
|
-
|
|
112986
|
-
|
|
112987
|
-
|
|
112988
|
-
|
|
112989
|
-
|
|
112990
|
-
|
|
112991
|
-
|
|
112992
|
-
|
|
112993
|
-
|
|
112994
|
-
|
|
112995
|
-
|
|
112996
|
-
|
|
112997
|
-
|
|
112998
|
-
|
|
112999
|
-
|
|
113000
|
-
|
|
113001
|
-
|
|
113002
|
-
|
|
113003
|
-
|
|
113004
|
-
|
|
113005
|
-
return items;
|
|
113006
|
-
}()
|
|
113047
|
+
SubSolutionSchema = {
|
|
113048
|
+
key: "sub_solution_schema",
|
|
113049
|
+
isObject: true,
|
|
113050
|
+
items: [{
|
|
113051
|
+
key: "solution",
|
|
113052
|
+
label: function label3() {
|
|
113053
|
+
return i18n.t(localeKeys.sub_solution.self);
|
|
113054
|
+
},
|
|
113055
|
+
type: ["string"],
|
|
113056
|
+
mutualExclusion: true,
|
|
113057
|
+
items: function items3(_data, extra) {
|
|
113058
|
+
var _extra$customPlugin2, _extra$customPlugin2$;
|
|
113059
|
+
var items5 = Object.values(SubSolution).map(function(solution) {
|
|
113060
|
+
return {
|
|
113061
|
+
key: solution,
|
|
113062
|
+
label: SubSolutionText[solution]
|
|
113063
|
+
};
|
|
113064
|
+
});
|
|
113065
|
+
if (extra !== null && extra !== void 0 && (_extra$customPlugin2 = extra.customPlugin) !== null && _extra$customPlugin2 !== void 0 && (_extra$customPlugin2$ = _extra$customPlugin2.custom) !== null && _extra$customPlugin2$ !== void 0 && _extra$customPlugin2$.length) {
|
|
113066
|
+
return [].concat(_toConsumableArray(items5), [{
|
|
113067
|
+
key: "custom",
|
|
113068
|
+
label: i18n.t(localeKeys.solution.custom)
|
|
113069
|
+
}]);
|
|
113007
113070
|
}
|
|
113008
|
-
|
|
113009
|
-
|
|
113071
|
+
return items5;
|
|
113072
|
+
}
|
|
113073
|
+
}, {
|
|
113074
|
+
key: "scenes",
|
|
113075
|
+
label: function label4() {
|
|
113076
|
+
return i18n.t(localeKeys.scenes.self);
|
|
113077
|
+
},
|
|
113078
|
+
type: ["string"],
|
|
113079
|
+
mutualExclusion: true,
|
|
113080
|
+
when: function when2(data, extra) {
|
|
113081
|
+
return (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)] && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)].length > 0;
|
|
113082
|
+
},
|
|
113083
|
+
items: function items4(data, extra) {
|
|
113084
|
+
var solution = getSolutionNameFromSubSolution(data.solution);
|
|
113085
|
+
var items5 = (extra !== null && extra !== void 0 && extra.customPlugin ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map(function(plugin) {
|
|
113086
|
+
return {
|
|
113087
|
+
key: plugin.key,
|
|
113088
|
+
label: plugin.name
|
|
113089
|
+
};
|
|
113090
|
+
});
|
|
113091
|
+
if (data.solution && data.solution !== "custom") {
|
|
113092
|
+
items5.unshift({
|
|
113093
|
+
key: data.solution,
|
|
113094
|
+
label: "".concat(SubSolutionText[data.solution](), "(").concat(i18n.t(localeKeys.solution["default"]), ")")
|
|
113095
|
+
});
|
|
113096
|
+
}
|
|
113097
|
+
return items5;
|
|
113098
|
+
}
|
|
113099
|
+
}]
|
|
113010
113100
|
};
|
|
113011
113101
|
BaseGenerator = "@modern-js/base-generator";
|
|
113012
113102
|
SolutionGenerator = (_SolutionGenerator = {}, _defineProperty(_SolutionGenerator, Solution.MWA, "@modern-js/mwa-generator"), _defineProperty(_SolutionGenerator, Solution.Module, "@modern-js/module-generator"), _defineProperty(_SolutionGenerator, Solution.Monorepo, "@modern-js/monorepo-generator"), _SolutionGenerator);
|
|
@@ -113014,9 +113104,10 @@ var init_solution = __esmMin(() => {
|
|
|
113014
113104
|
ChangesetGenerator = "@modern-js/changeset-generator";
|
|
113015
113105
|
DependenceGenerator = "@modern-js/dependence-generator";
|
|
113016
113106
|
EntryGenerator = "@modern-js/entry-generator";
|
|
113107
|
+
ElectronGenerator = "@modern-js/electron-generator";
|
|
113017
113108
|
EslintGenerator = "@modern-js/eslint-generator";
|
|
113018
113109
|
});
|
|
113019
|
-
var _LanguageName, Language, LanguageName,
|
|
113110
|
+
var _LanguageName, Language, LanguageName, LanguageSchema;
|
|
113020
113111
|
var init_language = __esmMin(() => {
|
|
113021
113112
|
init_defineProperty();
|
|
113022
113113
|
init_locale2();
|
|
@@ -113024,22 +113115,27 @@ var init_language = __esmMin(() => {
|
|
|
113024
113115
|
Language2["TS"] = "ts";
|
|
113025
113116
|
Language2["JS"] = "js";
|
|
113026
113117
|
})(Language || (Language = {}));
|
|
113027
|
-
LanguageName = (_LanguageName = {}, _defineProperty(_LanguageName, Language.TS,
|
|
113028
|
-
|
|
113029
|
-
|
|
113030
|
-
return
|
|
113031
|
-
|
|
113032
|
-
|
|
113033
|
-
|
|
113034
|
-
|
|
113035
|
-
|
|
113036
|
-
|
|
113037
|
-
|
|
113038
|
-
|
|
113039
|
-
|
|
113118
|
+
LanguageName = (_LanguageName = {}, _defineProperty(_LanguageName, Language.TS, function() {
|
|
113119
|
+
return "TS";
|
|
113120
|
+
}), _defineProperty(_LanguageName, Language.JS, function() {
|
|
113121
|
+
return "ES6+";
|
|
113122
|
+
}), _LanguageName);
|
|
113123
|
+
LanguageSchema = {
|
|
113124
|
+
key: "language",
|
|
113125
|
+
type: ["string"],
|
|
113126
|
+
label: function label5() {
|
|
113127
|
+
return i18n.t(localeKeys.language.self);
|
|
113128
|
+
},
|
|
113129
|
+
mutualExclusion: true,
|
|
113130
|
+
items: Object.values(Language).map(function(language) {
|
|
113131
|
+
return {
|
|
113132
|
+
key: language,
|
|
113133
|
+
label: LanguageName[language]
|
|
113134
|
+
};
|
|
113135
|
+
})
|
|
113040
113136
|
};
|
|
113041
113137
|
});
|
|
113042
|
-
var _PackageManagerName, PackageManager, PackageManagerName,
|
|
113138
|
+
var _PackageManagerName, PackageManager, PackageManagerName, PackageManagerSchema;
|
|
113043
113139
|
var init_package_manager = __esmMin(() => {
|
|
113044
113140
|
init_defineProperty();
|
|
113045
113141
|
init_locale2();
|
|
@@ -113048,83 +113144,94 @@ var init_package_manager = __esmMin(() => {
|
|
|
113048
113144
|
PackageManager2["Yarn"] = "yarn";
|
|
113049
113145
|
PackageManager2["Npm"] = "npm";
|
|
113050
113146
|
})(PackageManager || (PackageManager = {}));
|
|
113051
|
-
PackageManagerName = (_PackageManagerName = {}, _defineProperty(_PackageManagerName, PackageManager.Pnpm,
|
|
113052
|
-
|
|
113053
|
-
|
|
113054
|
-
return
|
|
113055
|
-
|
|
113056
|
-
|
|
113057
|
-
|
|
113058
|
-
|
|
113059
|
-
|
|
113060
|
-
|
|
113061
|
-
|
|
113062
|
-
|
|
113063
|
-
|
|
113064
|
-
|
|
113065
|
-
|
|
113066
|
-
|
|
113067
|
-
|
|
113068
|
-
|
|
113069
|
-
|
|
113070
|
-
|
|
113071
|
-
|
|
113072
|
-
}
|
|
113073
|
-
}
|
|
113147
|
+
PackageManagerName = (_PackageManagerName = {}, _defineProperty(_PackageManagerName, PackageManager.Pnpm, function() {
|
|
113148
|
+
return "pnpm";
|
|
113149
|
+
}), _defineProperty(_PackageManagerName, PackageManager.Yarn, function() {
|
|
113150
|
+
return "Yarn";
|
|
113151
|
+
}), _defineProperty(_PackageManagerName, PackageManager.Npm, function() {
|
|
113152
|
+
return "npm";
|
|
113153
|
+
}), _PackageManagerName);
|
|
113154
|
+
PackageManagerSchema = {
|
|
113155
|
+
key: "packageManager",
|
|
113156
|
+
type: ["string"],
|
|
113157
|
+
label: function label6() {
|
|
113158
|
+
return i18n.t(localeKeys.packageManager.self);
|
|
113159
|
+
},
|
|
113160
|
+
mutualExclusion: true,
|
|
113161
|
+
when: function when3(_values, extra) {
|
|
113162
|
+
return !(extra !== null && extra !== void 0 && extra.isMonorepoSubProject) && !(extra !== null && extra !== void 0 && extra.isSubProject);
|
|
113163
|
+
},
|
|
113164
|
+
items: Object.values(PackageManager).map(function(packageManager) {
|
|
113165
|
+
return {
|
|
113166
|
+
key: packageManager,
|
|
113167
|
+
label: PackageManagerName[packageManager]
|
|
113168
|
+
};
|
|
113169
|
+
})
|
|
113074
113170
|
};
|
|
113075
113171
|
});
|
|
113076
|
-
var
|
|
113172
|
+
var PackageNameSchema;
|
|
113077
113173
|
var init_package_name = __esmMin(() => {
|
|
113078
113174
|
init_locale2();
|
|
113079
|
-
|
|
113080
|
-
|
|
113081
|
-
|
|
113082
|
-
|
|
113083
|
-
|
|
113084
|
-
|
|
113085
|
-
|
|
113086
|
-
|
|
113087
|
-
|
|
113088
|
-
|
|
113089
|
-
|
|
113090
|
-
|
|
113091
|
-
|
|
113092
|
-
|
|
113093
|
-
|
|
113094
|
-
return i18n.t(localeKeys.packageName.no_empty);
|
|
113095
|
-
}
|
|
113096
|
-
return "";
|
|
113175
|
+
PackageNameSchema = {
|
|
113176
|
+
key: "packageName",
|
|
113177
|
+
label: function label7(_, extra) {
|
|
113178
|
+
return extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? i18n.t(localeKeys.packageName.sub_name) : i18n.t(localeKeys.packageName.self);
|
|
113179
|
+
},
|
|
113180
|
+
type: ["string"],
|
|
113181
|
+
when: function when4(_, extra) {
|
|
113182
|
+
return Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra !== null && extra !== void 0 && extra.isMwa);
|
|
113183
|
+
},
|
|
113184
|
+
validate: function validate2(value) {
|
|
113185
|
+
if (!value) {
|
|
113186
|
+
return {
|
|
113187
|
+
success: false,
|
|
113188
|
+
error: i18n.t(localeKeys.packageName.no_empty)
|
|
113189
|
+
};
|
|
113097
113190
|
}
|
|
113098
|
-
|
|
113191
|
+
return {
|
|
113192
|
+
success: true
|
|
113193
|
+
};
|
|
113194
|
+
}
|
|
113099
113195
|
};
|
|
113100
113196
|
});
|
|
113101
|
-
var PackagePathRegex,
|
|
113197
|
+
var PackagePathRegex, PackagePathSchema;
|
|
113102
113198
|
var init_package_path = __esmMin(() => {
|
|
113103
113199
|
init_locale2();
|
|
113104
113200
|
PackagePathRegex = new RegExp("^[a-z0-9]*[-_/]?([a-z0-9]*[-_]?[a-z0-9]*)*[-_/]?[a-z0-9-_]+$");
|
|
113105
|
-
|
|
113106
|
-
|
|
113107
|
-
|
|
113108
|
-
|
|
113109
|
-
|
|
113110
|
-
|
|
113111
|
-
|
|
113112
|
-
|
|
113113
|
-
|
|
113114
|
-
|
|
113115
|
-
|
|
113116
|
-
|
|
113117
|
-
|
|
113118
|
-
|
|
113119
|
-
if (!value) {
|
|
113120
|
-
return i18n.t(localeKeys.packagePath.no_empty);
|
|
113121
|
-
}
|
|
113122
|
-
if (!PackagePathRegex.test(value)) {
|
|
113123
|
-
return i18n.t(localeKeys.packagePath.format);
|
|
113201
|
+
PackagePathSchema = {
|
|
113202
|
+
key: "packagePath",
|
|
113203
|
+
label: function label8() {
|
|
113204
|
+
return i18n.t(localeKeys.packagePath.self);
|
|
113205
|
+
},
|
|
113206
|
+
type: ["string"],
|
|
113207
|
+
when: function when5(_, extra) {
|
|
113208
|
+
return Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject);
|
|
113209
|
+
},
|
|
113210
|
+
state: {
|
|
113211
|
+
value: {
|
|
113212
|
+
effectedByFields: ["packageName"],
|
|
113213
|
+
action: function action2(data) {
|
|
113214
|
+
return "".concat(data.packageName || "");
|
|
113124
113215
|
}
|
|
113125
|
-
return "";
|
|
113126
113216
|
}
|
|
113127
|
-
}
|
|
113217
|
+
},
|
|
113218
|
+
validate: function validate3(value) {
|
|
113219
|
+
if (!value) {
|
|
113220
|
+
return {
|
|
113221
|
+
success: false,
|
|
113222
|
+
error: i18n.t(localeKeys.packagePath.no_empty)
|
|
113223
|
+
};
|
|
113224
|
+
}
|
|
113225
|
+
if (!PackagePathRegex.test(value)) {
|
|
113226
|
+
return {
|
|
113227
|
+
success: false,
|
|
113228
|
+
error: i18n.t(localeKeys.packagePath.format)
|
|
113229
|
+
};
|
|
113230
|
+
}
|
|
113231
|
+
return {
|
|
113232
|
+
success: true
|
|
113233
|
+
};
|
|
113234
|
+
}
|
|
113128
113235
|
};
|
|
113129
113236
|
});
|
|
113130
113237
|
var init_common = __esmMin(() => {
|
|
@@ -113135,17 +113242,14 @@ var init_common = __esmMin(() => {
|
|
|
113135
113242
|
init_package_name();
|
|
113136
113243
|
init_package_path();
|
|
113137
113244
|
});
|
|
113138
|
-
var
|
|
113245
|
+
var BaseSchemas, BaseSchema, BaseDefaultConfig;
|
|
113139
113246
|
var init_project = __esmMin(() => {
|
|
113140
113247
|
init_common();
|
|
113141
|
-
|
|
113142
|
-
|
|
113143
|
-
|
|
113144
|
-
|
|
113145
|
-
|
|
113146
|
-
packageManager: getPackageManagerSchema(extra)
|
|
113147
|
-
}
|
|
113148
|
-
};
|
|
113248
|
+
BaseSchemas = [PackageManagerSchema];
|
|
113249
|
+
BaseSchema = {
|
|
113250
|
+
key: "base",
|
|
113251
|
+
isObject: true,
|
|
113252
|
+
items: BaseSchemas
|
|
113149
113253
|
};
|
|
113150
113254
|
BaseDefaultConfig = {
|
|
113151
113255
|
packageManager: PackageManager.Pnpm
|
|
@@ -113154,23 +113258,14 @@ var init_project = __esmMin(() => {
|
|
|
113154
113258
|
var init_base = __esmMin(() => {
|
|
113155
113259
|
init_project();
|
|
113156
113260
|
});
|
|
113157
|
-
var
|
|
113261
|
+
var ModuleSchemas, ModuleSchema, ModuleDefaultConfig;
|
|
113158
113262
|
var init_project2 = __esmMin(() => {
|
|
113159
113263
|
init_common();
|
|
113160
|
-
|
|
113161
|
-
|
|
113162
|
-
|
|
113163
|
-
|
|
113164
|
-
|
|
113165
|
-
packageManager: getPackageManagerSchema(extra)
|
|
113166
|
-
};
|
|
113167
|
-
};
|
|
113168
|
-
getModuleSchema = function getModuleSchema2() {
|
|
113169
|
-
var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
113170
|
-
return {
|
|
113171
|
-
type: "object",
|
|
113172
|
-
properties: getModuleSchemaProperties(extra)
|
|
113173
|
-
};
|
|
113264
|
+
ModuleSchemas = [PackageNameSchema, PackagePathSchema, LanguageSchema, PackageManagerSchema];
|
|
113265
|
+
ModuleSchema = {
|
|
113266
|
+
key: "module",
|
|
113267
|
+
isObject: true,
|
|
113268
|
+
items: ModuleSchemas
|
|
113174
113269
|
};
|
|
113175
113270
|
ModuleDefaultConfig = {
|
|
113176
113271
|
language: Language.TS,
|
|
@@ -113180,17 +113275,20 @@ var init_project2 = __esmMin(() => {
|
|
|
113180
113275
|
var init_module = __esmMin(() => {
|
|
113181
113276
|
init_project2();
|
|
113182
113277
|
});
|
|
113183
|
-
var
|
|
113278
|
+
var MonorepoPackageManagerSchema, MonorepoSchemas, MonorepoSchema, MonorepoDefaultConfig;
|
|
113184
113279
|
var init_project3 = __esmMin(() => {
|
|
113280
|
+
init_objectSpread2();
|
|
113185
113281
|
init_common();
|
|
113186
|
-
|
|
113187
|
-
|
|
113188
|
-
|
|
113189
|
-
|
|
113190
|
-
|
|
113191
|
-
|
|
113192
|
-
|
|
113193
|
-
|
|
113282
|
+
MonorepoPackageManagerSchema = _objectSpread2(_objectSpread2({}, PackageManagerSchema), {}, {
|
|
113283
|
+
items: PackageManagerSchema.items.filter(function(item) {
|
|
113284
|
+
return item.key !== PackageManager.Npm;
|
|
113285
|
+
})
|
|
113286
|
+
});
|
|
113287
|
+
MonorepoSchemas = [MonorepoPackageManagerSchema];
|
|
113288
|
+
MonorepoSchema = {
|
|
113289
|
+
key: "monorepo",
|
|
113290
|
+
isObject: true,
|
|
113291
|
+
items: MonorepoSchemas
|
|
113194
113292
|
};
|
|
113195
113293
|
MonorepoDefaultConfig = {
|
|
113196
113294
|
packageManager: PackageManager.Pnpm
|
|
@@ -113199,77 +113297,153 @@ var init_project3 = __esmMin(() => {
|
|
|
113199
113297
|
var init_monorepo = __esmMin(() => {
|
|
113200
113298
|
init_project3();
|
|
113201
113299
|
});
|
|
113202
|
-
var _FrameworkAppendTypeC, Framework,
|
|
113300
|
+
var _FrameworkAppendTypeC, mwaConfigWhenFunc, RunWay, RunWaySchema, ClientRoute, ClientRouteSchema, NeedModifyMWAConfigSchema, Framework, FrameworkSchema, FrameworkAppendTypeContent;
|
|
113203
113301
|
var init_common2 = __esmMin(() => {
|
|
113204
113302
|
init_defineProperty();
|
|
113205
113303
|
init_locale2();
|
|
113304
|
+
init_boolean();
|
|
113305
|
+
mwaConfigWhenFunc = function mwaConfigWhenFunc2(values) {
|
|
113306
|
+
return values.needModifyMWAConfig === BooleanConfig.YES;
|
|
113307
|
+
};
|
|
113308
|
+
(function(RunWay2) {
|
|
113309
|
+
RunWay2["No"] = "no";
|
|
113310
|
+
RunWay2["Electron"] = "electron";
|
|
113311
|
+
})(RunWay || (RunWay = {}));
|
|
113312
|
+
RunWaySchema = {
|
|
113313
|
+
key: "runWay",
|
|
113314
|
+
type: ["string"],
|
|
113315
|
+
label: function label9() {
|
|
113316
|
+
return i18n.t(localeKeys.runWay.self);
|
|
113317
|
+
},
|
|
113318
|
+
mutualExclusion: true,
|
|
113319
|
+
when: function when6(_, extra) {
|
|
113320
|
+
return (extra === null || extra === void 0 ? void 0 : extra.isEmptySrc) === void 0 ? true : Boolean(extra === null || extra === void 0 ? void 0 : extra.isEmptySrc);
|
|
113321
|
+
},
|
|
113322
|
+
state: {
|
|
113323
|
+
value: RunWay.No
|
|
113324
|
+
},
|
|
113325
|
+
items: Object.values(RunWay).map(function(runWay) {
|
|
113326
|
+
return {
|
|
113327
|
+
key: runWay,
|
|
113328
|
+
label: function label21() {
|
|
113329
|
+
return i18n.t(localeKeys.runWay[runWay]);
|
|
113330
|
+
}
|
|
113331
|
+
};
|
|
113332
|
+
})
|
|
113333
|
+
};
|
|
113334
|
+
(function(ClientRoute2) {
|
|
113335
|
+
ClientRoute2["SelfControlRoute"] = "selfControlRoute";
|
|
113336
|
+
ClientRoute2["ConventionalRoute"] = "conventionalRoute";
|
|
113337
|
+
})(ClientRoute || (ClientRoute = {}));
|
|
113338
|
+
ClientRouteSchema = {
|
|
113339
|
+
key: "clientRoute",
|
|
113340
|
+
type: ["string"],
|
|
113341
|
+
label: function label10() {
|
|
113342
|
+
return i18n.t(localeKeys.entry.clientRoute.self);
|
|
113343
|
+
},
|
|
113344
|
+
mutualExclusion: true,
|
|
113345
|
+
when: mwaConfigWhenFunc,
|
|
113346
|
+
state: {
|
|
113347
|
+
value: ClientRoute.SelfControlRoute
|
|
113348
|
+
},
|
|
113349
|
+
items: Object.values(ClientRoute).map(function(clientRoute) {
|
|
113350
|
+
return {
|
|
113351
|
+
key: clientRoute,
|
|
113352
|
+
label: function label21() {
|
|
113353
|
+
return i18n.t(localeKeys.entry.clientRoute[clientRoute]);
|
|
113354
|
+
}
|
|
113355
|
+
};
|
|
113356
|
+
})
|
|
113357
|
+
};
|
|
113358
|
+
NeedModifyMWAConfigSchema = {
|
|
113359
|
+
key: "needModifyMWAConfig",
|
|
113360
|
+
label: function label11() {
|
|
113361
|
+
return i18n.t(localeKeys.entry.needModifyConfig);
|
|
113362
|
+
},
|
|
113363
|
+
type: ["string"],
|
|
113364
|
+
mutualExclusion: true,
|
|
113365
|
+
state: {
|
|
113366
|
+
value: BooleanConfig.NO
|
|
113367
|
+
},
|
|
113368
|
+
items: BooleanSchemas
|
|
113369
|
+
};
|
|
113206
113370
|
(function(Framework2) {
|
|
113207
113371
|
Framework2["Express"] = "express";
|
|
113208
113372
|
Framework2["Koa"] = "koa";
|
|
113209
113373
|
Framework2["Egg"] = "egg";
|
|
113210
113374
|
Framework2["Nest"] = "nest";
|
|
113211
113375
|
})(Framework || (Framework = {}));
|
|
113212
|
-
|
|
113213
|
-
|
|
113214
|
-
|
|
113215
|
-
|
|
113216
|
-
|
|
113217
|
-
|
|
113218
|
-
|
|
113219
|
-
|
|
113220
|
-
|
|
113221
|
-
|
|
113222
|
-
|
|
113223
|
-
|
|
113376
|
+
FrameworkSchema = {
|
|
113377
|
+
key: "framework",
|
|
113378
|
+
type: ["string"],
|
|
113379
|
+
label: function label12() {
|
|
113380
|
+
return i18n.t(localeKeys.framework.self);
|
|
113381
|
+
},
|
|
113382
|
+
mutualExclusion: true,
|
|
113383
|
+
items: Object.values(Framework).map(function(framework) {
|
|
113384
|
+
return {
|
|
113385
|
+
key: framework,
|
|
113386
|
+
label: function label21() {
|
|
113387
|
+
return i18n.t(localeKeys.framework[framework]);
|
|
113388
|
+
}
|
|
113389
|
+
};
|
|
113390
|
+
})
|
|
113224
113391
|
};
|
|
113225
113392
|
FrameworkAppendTypeContent = (_FrameworkAppendTypeC = {}, _defineProperty(_FrameworkAppendTypeC, Framework.Express, "/// <reference types='@modern-js/plugin-express/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Koa, "/// <reference types='@modern-js/plugin-koa/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Egg, "/// <reference types='@modern-js/plugin-egg/types' />"), _defineProperty(_FrameworkAppendTypeC, Framework.Nest, "/// <reference types='@modern-js/plugin-nest/types' />"), _FrameworkAppendTypeC);
|
|
113226
113393
|
});
|
|
113227
|
-
var
|
|
113394
|
+
var EntryNameSchema, EntrySchemas, EntrySchema, MWADefaultEntryConfig;
|
|
113228
113395
|
var init_entry = __esmMin(() => {
|
|
113229
113396
|
init_locale2();
|
|
113230
113397
|
init_common();
|
|
113231
|
-
|
|
113232
|
-
|
|
113233
|
-
|
|
113234
|
-
|
|
113235
|
-
|
|
113236
|
-
|
|
113237
|
-
|
|
113238
|
-
|
|
113239
|
-
|
|
113240
|
-
|
|
113241
|
-
|
|
113242
|
-
|
|
113243
|
-
|
|
113244
|
-
|
|
113245
|
-
|
|
113246
|
-
|
|
113247
|
-
|
|
113248
|
-
|
|
113249
|
-
|
|
113250
|
-
|
|
113251
|
-
|
|
113252
|
-
}
|
|
113253
|
-
}
|
|
113254
|
-
|
|
113255
|
-
|
|
113256
|
-
|
|
113257
|
-
|
|
113258
|
-
|
|
113259
|
-
|
|
113398
|
+
init_common2();
|
|
113399
|
+
EntryNameSchema = {
|
|
113400
|
+
key: "name",
|
|
113401
|
+
type: ["string"],
|
|
113402
|
+
label: function label13() {
|
|
113403
|
+
return i18n.t(localeKeys.entry.name);
|
|
113404
|
+
},
|
|
113405
|
+
state: {
|
|
113406
|
+
value: "entry"
|
|
113407
|
+
},
|
|
113408
|
+
validate: function validate4(value) {
|
|
113409
|
+
if (!value) {
|
|
113410
|
+
return {
|
|
113411
|
+
success: false,
|
|
113412
|
+
error: i18n.t(localeKeys.entry.no_empty)
|
|
113413
|
+
};
|
|
113414
|
+
}
|
|
113415
|
+
if (value === "pages") {
|
|
113416
|
+
return {
|
|
113417
|
+
success: false,
|
|
113418
|
+
error: i18n.t(localeKeys.entry.no_pages)
|
|
113419
|
+
};
|
|
113420
|
+
}
|
|
113421
|
+
return {
|
|
113422
|
+
success: true
|
|
113423
|
+
};
|
|
113424
|
+
},
|
|
113425
|
+
when: function when7(_values, extra) {
|
|
113426
|
+
if (extra !== null && extra !== void 0 && extra.isEmptySrc) {
|
|
113427
|
+
return false;
|
|
113428
|
+
}
|
|
113429
|
+
return true;
|
|
113430
|
+
}
|
|
113260
113431
|
};
|
|
113261
|
-
|
|
113262
|
-
|
|
113263
|
-
|
|
113264
|
-
|
|
113265
|
-
|
|
113266
|
-
}
|
|
113432
|
+
EntrySchemas = [EntryNameSchema, NeedModifyMWAConfigSchema, ClientRouteSchema];
|
|
113433
|
+
EntrySchema = {
|
|
113434
|
+
key: "entry",
|
|
113435
|
+
label: function label14() {
|
|
113436
|
+
return i18n.t(localeKeys.action.element.entry);
|
|
113437
|
+
},
|
|
113438
|
+
isObject: true,
|
|
113439
|
+
items: EntrySchemas
|
|
113267
113440
|
};
|
|
113268
113441
|
MWADefaultEntryConfig = {
|
|
113269
|
-
needModifyMWAConfig: BooleanConfig.NO
|
|
113442
|
+
needModifyMWAConfig: BooleanConfig.NO,
|
|
113443
|
+
clientRoute: ClientRoute.SelfControlRoute
|
|
113270
113444
|
};
|
|
113271
113445
|
});
|
|
113272
|
-
var BFFType,
|
|
113446
|
+
var BFFType, BFFTypeSchema, BFFSchemas, BFFSchema, MWADefaultBffConfig;
|
|
113273
113447
|
var init_bff = __esmMin(() => {
|
|
113274
113448
|
init_locale2();
|
|
113275
113449
|
init_common2();
|
|
@@ -113277,72 +113451,66 @@ var init_bff = __esmMin(() => {
|
|
|
113277
113451
|
BFFType2["Func"] = "func";
|
|
113278
113452
|
BFFType2["Framework"] = "framework";
|
|
113279
113453
|
})(BFFType || (BFFType = {}));
|
|
113280
|
-
|
|
113281
|
-
|
|
113282
|
-
|
|
113283
|
-
|
|
113284
|
-
|
|
113285
|
-
|
|
113286
|
-
|
|
113287
|
-
|
|
113288
|
-
|
|
113289
|
-
|
|
113290
|
-
|
|
113291
|
-
|
|
113292
|
-
|
|
113293
|
-
|
|
113294
|
-
|
|
113295
|
-
bffType: getBFFTypeSchema(extra),
|
|
113296
|
-
framework: getFrameworkSchema(extra)
|
|
113297
|
-
};
|
|
113454
|
+
BFFTypeSchema = {
|
|
113455
|
+
key: "bffType",
|
|
113456
|
+
type: ["string"],
|
|
113457
|
+
label: function label15() {
|
|
113458
|
+
return i18n.t(localeKeys.bff.bffType.self);
|
|
113459
|
+
},
|
|
113460
|
+
mutualExclusion: true,
|
|
113461
|
+
items: Object.values(BFFType).map(function(bffType) {
|
|
113462
|
+
return {
|
|
113463
|
+
key: bffType,
|
|
113464
|
+
label: function label21() {
|
|
113465
|
+
return i18n.t(localeKeys.bff.bffType[bffType]);
|
|
113466
|
+
}
|
|
113467
|
+
};
|
|
113468
|
+
})
|
|
113298
113469
|
};
|
|
113299
|
-
|
|
113300
|
-
|
|
113301
|
-
|
|
113302
|
-
|
|
113303
|
-
|
|
113304
|
-
}
|
|
113470
|
+
BFFSchemas = [BFFTypeSchema, FrameworkSchema];
|
|
113471
|
+
BFFSchema = {
|
|
113472
|
+
key: "bff",
|
|
113473
|
+
label: function label16() {
|
|
113474
|
+
return i18n.t(localeKeys.action["function"].bff);
|
|
113475
|
+
},
|
|
113476
|
+
isObject: true,
|
|
113477
|
+
items: BFFSchemas
|
|
113305
113478
|
};
|
|
113306
113479
|
MWADefaultBffConfig = {
|
|
113307
113480
|
bffType: BFFType.Func,
|
|
113308
113481
|
frameWork: Framework.Express
|
|
113309
113482
|
};
|
|
113310
113483
|
});
|
|
113311
|
-
var
|
|
113484
|
+
var MWASchemas, MWASchema, MWADefaultConfig;
|
|
113312
113485
|
var init_project4 = __esmMin(() => {
|
|
113313
113486
|
init_common();
|
|
113314
|
-
|
|
113315
|
-
|
|
113316
|
-
|
|
113317
|
-
|
|
113318
|
-
|
|
113319
|
-
|
|
113320
|
-
};
|
|
113321
|
-
};
|
|
113322
|
-
getMWASchema = function getMWASchema2() {
|
|
113323
|
-
var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
113324
|
-
return {
|
|
113325
|
-
type: "object",
|
|
113326
|
-
properties: getMWASchemaProperties(extra)
|
|
113327
|
-
};
|
|
113487
|
+
init_common2();
|
|
113488
|
+
MWASchemas = [PackageNameSchema, PackagePathSchema, LanguageSchema, PackageManagerSchema, RunWaySchema, NeedModifyMWAConfigSchema, ClientRouteSchema];
|
|
113489
|
+
MWASchema = {
|
|
113490
|
+
key: "mwa",
|
|
113491
|
+
isObject: true,
|
|
113492
|
+
items: MWASchemas
|
|
113328
113493
|
};
|
|
113329
113494
|
MWADefaultConfig = {
|
|
113330
113495
|
language: Language.TS,
|
|
113331
113496
|
packageManager: PackageManager.Pnpm,
|
|
113332
|
-
|
|
113497
|
+
runWay: RunWay.No,
|
|
113498
|
+
needModifyMWAConfig: BooleanConfig.NO,
|
|
113499
|
+
clientRoute: ClientRoute.SelfControlRoute
|
|
113333
113500
|
};
|
|
113334
113501
|
});
|
|
113335
|
-
var
|
|
113502
|
+
var ServerSchemas, ServerSchema, MWADefaultServerConfig;
|
|
113336
113503
|
var init_server = __esmMin(() => {
|
|
113504
|
+
init_locale2();
|
|
113337
113505
|
init_common2();
|
|
113338
|
-
|
|
113339
|
-
|
|
113340
|
-
|
|
113341
|
-
|
|
113342
|
-
|
|
113343
|
-
|
|
113344
|
-
|
|
113345
|
-
|
|
113506
|
+
ServerSchemas = [FrameworkSchema];
|
|
113507
|
+
ServerSchema = {
|
|
113508
|
+
key: "server",
|
|
113509
|
+
label: function label17() {
|
|
113510
|
+
return i18n.t(localeKeys.action.element.server);
|
|
113511
|
+
},
|
|
113512
|
+
isObject: true,
|
|
113513
|
+
items: ServerSchemas
|
|
113346
113514
|
};
|
|
113347
113515
|
MWADefaultServerConfig = {
|
|
113348
113516
|
framework: Framework.Express
|
|
@@ -113374,6 +113542,7 @@ var init_common3 = __esmMin(() => {
|
|
|
113374
113542
|
ActionFunction2["Sass"] = "sass";
|
|
113375
113543
|
ActionFunction2["BFF"] = "bff";
|
|
113376
113544
|
ActionFunction2["MicroFrontend"] = "micro_frontend";
|
|
113545
|
+
ActionFunction2["Electron"] = "electron";
|
|
113377
113546
|
ActionFunction2["I18n"] = "i18n";
|
|
113378
113547
|
ActionFunction2["Test"] = "test";
|
|
113379
113548
|
ActionFunction2["E2ETest"] = "e2e_test";
|
|
@@ -113385,7 +113554,7 @@ var init_common3 = __esmMin(() => {
|
|
|
113385
113554
|
ActionFunction2["Proxy"] = "proxy";
|
|
113386
113555
|
})(ActionFunction || (ActionFunction = {}));
|
|
113387
113556
|
(function(ActionRefactor2) {
|
|
113388
|
-
ActionRefactor2["
|
|
113557
|
+
ActionRefactor2["BFFToApp"] = "bff_to_app";
|
|
113389
113558
|
})(ActionRefactor || (ActionRefactor = {}));
|
|
113390
113559
|
ActionTypeText = (_ActionTypeText = {}, _defineProperty(_ActionTypeText, ActionType.Function, function() {
|
|
113391
113560
|
return i18n.t(localeKeys.action["function"].self);
|
|
@@ -113409,6 +113578,8 @@ var init_common3 = __esmMin(() => {
|
|
|
113409
113578
|
return i18n.t(localeKeys.action["function"].bff);
|
|
113410
113579
|
}), _defineProperty(_ActionFunctionText, ActionFunction.MicroFrontend, function() {
|
|
113411
113580
|
return i18n.t(localeKeys.action["function"].micro_frontend);
|
|
113581
|
+
}), _defineProperty(_ActionFunctionText, ActionFunction.Electron, function() {
|
|
113582
|
+
return i18n.t(localeKeys.action["function"].electron);
|
|
113412
113583
|
}), _defineProperty(_ActionFunctionText, ActionFunction.I18n, function() {
|
|
113413
113584
|
return i18n.t(localeKeys.action["function"].i18n);
|
|
113414
113585
|
}), _defineProperty(_ActionFunctionText, ActionFunction.Test, function() {
|
|
@@ -113428,17 +113599,20 @@ var init_common3 = __esmMin(() => {
|
|
|
113428
113599
|
}), _defineProperty(_ActionFunctionText, ActionFunction.Proxy, function() {
|
|
113429
113600
|
return i18n.t(localeKeys.action["function"].proxy);
|
|
113430
113601
|
}), _ActionFunctionText);
|
|
113431
|
-
ActionRefactorText = _defineProperty({}, ActionRefactor.
|
|
113432
|
-
return i18n.t(localeKeys.action.refactor.
|
|
113602
|
+
ActionRefactorText = _defineProperty({}, ActionRefactor.BFFToApp, function() {
|
|
113603
|
+
return i18n.t(localeKeys.action.refactor.bff_to_app);
|
|
113433
113604
|
});
|
|
113434
113605
|
ActionTypeTextMap = (_ActionTypeTextMap = {}, _defineProperty(_ActionTypeTextMap, ActionType.Element, ActionElementText), _defineProperty(_ActionTypeTextMap, ActionType.Function, ActionFunctionText), _defineProperty(_ActionTypeTextMap, ActionType.Refactor, ActionRefactorText), _ActionTypeTextMap);
|
|
113435
113606
|
});
|
|
113436
|
-
var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _MWAActionFunctionsAp, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap,
|
|
113607
|
+
var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _MWAActionFunctionsAp, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, MWASpecialSchemaMap, MWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
|
|
113437
113608
|
var init_mwa2 = __esmMin(() => {
|
|
113438
113609
|
init_defineProperty();
|
|
113439
113610
|
init_common3();
|
|
113440
113611
|
init_locale2();
|
|
113441
|
-
MWAActionTypes = [
|
|
113612
|
+
MWAActionTypes = [
|
|
113613
|
+
ActionType.Element,
|
|
113614
|
+
ActionType.Function
|
|
113615
|
+
];
|
|
113442
113616
|
MWAActionFunctions = [
|
|
113443
113617
|
ActionFunction.TailwindCSS,
|
|
113444
113618
|
ActionFunction.Less,
|
|
@@ -113446,104 +113620,53 @@ var init_mwa2 = __esmMin(() => {
|
|
|
113446
113620
|
ActionFunction.BFF,
|
|
113447
113621
|
ActionFunction.SSG,
|
|
113448
113622
|
ActionFunction.MicroFrontend,
|
|
113623
|
+
ActionFunction.Electron,
|
|
113449
113624
|
ActionFunction.Test,
|
|
113450
113625
|
ActionFunction.Storybook,
|
|
113451
113626
|
ActionFunction.Polyfill,
|
|
113452
113627
|
ActionFunction.Proxy
|
|
113453
113628
|
];
|
|
113454
113629
|
MWAActionElements = [ActionElement.Entry, ActionElement.Server];
|
|
113455
|
-
MWAActionReactors = [ActionRefactor.
|
|
113630
|
+
MWAActionReactors = [ActionRefactor.BFFToApp];
|
|
113456
113631
|
MWAActionTypesMap = (_MWAActionTypesMap = {}, _defineProperty(_MWAActionTypesMap, ActionType.Element, MWAActionElements), _defineProperty(_MWAActionTypesMap, ActionType.Function, MWAActionFunctions), _defineProperty(_MWAActionTypesMap, ActionType.Refactor, MWAActionReactors), _MWAActionTypesMap);
|
|
113457
|
-
|
|
113458
|
-
|
|
113459
|
-
|
|
113460
|
-
|
|
113461
|
-
|
|
113462
|
-
|
|
113463
|
-
|
|
113464
|
-
|
|
113465
|
-
|
|
113466
|
-
|
|
113467
|
-
|
|
113468
|
-
|
|
113469
|
-
|
|
113470
|
-
|
|
113471
|
-
|
|
113472
|
-
|
|
113473
|
-
|
|
113474
|
-
|
|
113475
|
-
|
|
113476
|
-
|
|
113477
|
-
|
|
113478
|
-
|
|
113479
|
-
|
|
113480
|
-
|
|
113481
|
-
|
|
113632
|
+
MWASpecialSchemaMap = _defineProperty({}, ActionFunction.Storybook, {
|
|
113633
|
+
key: ActionFunction.Storybook,
|
|
113634
|
+
label: function label18() {
|
|
113635
|
+
return i18n.t(localeKeys.action["function"].mwa_storybook);
|
|
113636
|
+
}
|
|
113637
|
+
});
|
|
113638
|
+
MWANewActionSchema = {
|
|
113639
|
+
key: "mwa_new_action",
|
|
113640
|
+
isObject: true,
|
|
113641
|
+
items: [{
|
|
113642
|
+
key: "actionType",
|
|
113643
|
+
label: function label19() {
|
|
113644
|
+
return i18n.t(localeKeys.action.self);
|
|
113645
|
+
},
|
|
113646
|
+
type: ["string"],
|
|
113647
|
+
mutualExclusion: true,
|
|
113648
|
+
items: MWAActionTypes.map(function(type) {
|
|
113649
|
+
return {
|
|
113650
|
+
key: type,
|
|
113651
|
+
label: ActionTypeText[type],
|
|
113652
|
+
type: ["string"],
|
|
113653
|
+
mutualExclusion: true,
|
|
113654
|
+
items: MWAActionTypesMap[type].map(function(item) {
|
|
113655
|
+
return MWASpecialSchemaMap[item] || {
|
|
113656
|
+
key: item,
|
|
113657
|
+
label: ActionTypeTextMap[type][item]
|
|
113482
113658
|
};
|
|
113483
113659
|
})
|
|
113484
|
-
}
|
|
113485
|
-
}
|
|
113486
|
-
|
|
113487
|
-
title: ActionTypeText[ActionType.Element](),
|
|
113488
|
-
"enum": MWAActionElements.map(function(element) {
|
|
113489
|
-
return {
|
|
113490
|
-
value: element,
|
|
113491
|
-
label: ActionElementText[element]()
|
|
113492
|
-
};
|
|
113493
|
-
}),
|
|
113494
|
-
"x-reactions": [{
|
|
113495
|
-
dependencies: ["actionType"],
|
|
113496
|
-
fulfill: {
|
|
113497
|
-
state: {
|
|
113498
|
-
visible: '{{$deps[0] === "element"}}'
|
|
113499
|
-
}
|
|
113500
|
-
}
|
|
113501
|
-
}]
|
|
113502
|
-
}), _defineProperty(_properties, ActionType.Function, {
|
|
113503
|
-
type: "string",
|
|
113504
|
-
title: ActionTypeText[ActionType.Function](),
|
|
113505
|
-
"enum": funcs.map(function(func) {
|
|
113506
|
-
return {
|
|
113507
|
-
value: func,
|
|
113508
|
-
label: func === ActionFunction.Storybook ? i18n.t(localeKeys.action["function"].mwa_storybook) : ActionFunctionText[func]()
|
|
113509
|
-
};
|
|
113510
|
-
}),
|
|
113511
|
-
"x-reactions": [{
|
|
113512
|
-
dependencies: ["actionType"],
|
|
113513
|
-
fulfill: {
|
|
113514
|
-
state: {
|
|
113515
|
-
visible: '{{$deps[0] === "function"}}'
|
|
113516
|
-
}
|
|
113517
|
-
}
|
|
113518
|
-
}]
|
|
113519
|
-
}), _defineProperty(_properties, ActionType.Refactor, {
|
|
113520
|
-
type: "string",
|
|
113521
|
-
title: ActionTypeText[ActionType.Refactor](),
|
|
113522
|
-
"enum": refactors.map(function(refactor) {
|
|
113523
|
-
return {
|
|
113524
|
-
value: refactor,
|
|
113525
|
-
label: ActionRefactorText[refactor]()
|
|
113526
|
-
};
|
|
113527
|
-
}),
|
|
113528
|
-
"x-reactions": [{
|
|
113529
|
-
dependencies: ["actionType"],
|
|
113530
|
-
fulfill: {
|
|
113531
|
-
state: {
|
|
113532
|
-
visible: '{{$deps[0] === "refactor"}}'
|
|
113533
|
-
}
|
|
113534
|
-
}
|
|
113535
|
-
}]
|
|
113536
|
-
}), _properties)
|
|
113537
|
-
};
|
|
113660
|
+
};
|
|
113661
|
+
})
|
|
113662
|
+
}]
|
|
113538
113663
|
};
|
|
113539
|
-
MWAActionFunctionsDevDependencies = (_MWAActionFunctionsDe = {}, _defineProperty(_MWAActionFunctionsDe, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.SSG, "@modern-js/plugin-ssg"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Test, "@modern-js/plugin-testing"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.E2ETest, "@modern-js/plugin-e2e"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Proxy, "@modern-js/plugin-proxy"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.TailwindCSS, "tailwindcss"), _MWAActionFunctionsDe);
|
|
113664
|
+
MWAActionFunctionsDevDependencies = (_MWAActionFunctionsDe = {}, _defineProperty(_MWAActionFunctionsDe, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.SSG, "@modern-js/plugin-ssg"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Test, "@modern-js/plugin-testing"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.E2ETest, "@modern-js/plugin-e2e"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Electron, "@modern-js/plugin-electron"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Proxy, "@modern-js/plugin-proxy"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.TailwindCSS, "tailwindcss"), _MWAActionFunctionsDe);
|
|
113540
113665
|
MWAActionFunctionsDependencies = (_MWAActionFunctionsDe2 = {}, _defineProperty(_MWAActionFunctionsDe2, ActionFunction.BFF, "@modern-js/plugin-bff"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.MicroFrontend, "@modern-js/plugin-garfish"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.I18n, "@modern-js/plugin-i18n"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.TailwindCSS, "@modern-js/plugin-tailwindcss"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.Polyfill, "@modern-js/plugin-polyfill"), _MWAActionFunctionsDe2);
|
|
113541
113666
|
MWAActionFunctionsAppendTypeContent = (_MWAActionFunctionsAp = {}, _defineProperty(_MWAActionFunctionsAp, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />"), _defineProperty(_MWAActionFunctionsAp, ActionFunction.Test, "/// <reference types='@modern-js/plugin-testing/types' />"), _MWAActionFunctionsAp);
|
|
113542
|
-
|
|
113543
|
-
MWAActionReactorAppendTypeContent = _defineProperty({}, ActionRefactor.ReactRouter5, "/// <reference types='@modern-js/plugin-router-legacy/types' />");
|
|
113544
|
-
MWANewActionGenerators = (_MWANewActionGenerato = {}, _defineProperty(_MWANewActionGenerato, ActionType.Element, (_ActionType$Element = {}, _defineProperty(_ActionType$Element, ActionElement.Entry, "@modern-js/entry-generator"), _defineProperty(_ActionType$Element, ActionElement.Server, "@modern-js/server-generator"), _ActionType$Element)), _defineProperty(_MWANewActionGenerato, ActionType.Function, (_ActionType$Function = {}, _defineProperty(_ActionType$Function, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.BFF, "@modern-js/bff-generator"), _defineProperty(_ActionType$Function, ActionFunction.MicroFrontend, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Test, "@modern-js/test-generator"), _defineProperty(_ActionType$Function, ActionFunction.E2ETest, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Storybook, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.SSG, "@modern-js/ssg-generator"), _defineProperty(_ActionType$Function, ActionFunction.Polyfill, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Proxy, "@modern-js/dependence-generator"), _ActionType$Function)), _defineProperty(_MWANewActionGenerato, ActionType.Refactor, _defineProperty({}, ActionRefactor.ReactRouter5, "@modern-js/router-legacy-generator")), _MWANewActionGenerato);
|
|
113667
|
+
MWANewActionGenerators = (_MWANewActionGenerato = {}, _defineProperty(_MWANewActionGenerato, ActionType.Element, (_ActionType$Element = {}, _defineProperty(_ActionType$Element, ActionElement.Entry, "@modern-js/entry-generator"), _defineProperty(_ActionType$Element, ActionElement.Server, "@modern-js/server-generator"), _ActionType$Element)), _defineProperty(_MWANewActionGenerato, ActionType.Function, (_ActionType$Function = {}, _defineProperty(_ActionType$Function, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.BFF, "@modern-js/bff-generator"), _defineProperty(_ActionType$Function, ActionFunction.MicroFrontend, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Electron, "@modern-js/electron-generator"), _defineProperty(_ActionType$Function, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Test, "@modern-js/test-generator"), _defineProperty(_ActionType$Function, ActionFunction.E2ETest, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Storybook, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.SSG, "@modern-js/ssg-generator"), _defineProperty(_ActionType$Function, ActionFunction.Polyfill, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Proxy, "@modern-js/dependence-generator"), _ActionType$Function)), _defineProperty(_MWANewActionGenerato, ActionType.Refactor, _defineProperty({}, ActionRefactor.BFFToApp, "@modern-js/bff-refactor-generator")), _MWANewActionGenerato);
|
|
113545
113668
|
});
|
|
113546
|
-
var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap,
|
|
113669
|
+
var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, ModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
|
|
113547
113670
|
var init_module2 = __esmMin(() => {
|
|
113548
113671
|
init_defineProperty();
|
|
113549
113672
|
init_common3();
|
|
@@ -113558,62 +113681,45 @@ var init_module2 = __esmMin(() => {
|
|
|
113558
113681
|
];
|
|
113559
113682
|
ModuleActionTypesMap = _defineProperty({}, ActionType.Function, ModuleActionFunctions);
|
|
113560
113683
|
ModuleSpecialSchemaMap = {};
|
|
113561
|
-
|
|
113562
|
-
|
|
113563
|
-
|
|
113564
|
-
|
|
113565
|
-
|
|
113566
|
-
|
|
113567
|
-
|
|
113568
|
-
|
|
113569
|
-
|
|
113570
|
-
|
|
113571
|
-
|
|
113572
|
-
|
|
113573
|
-
|
|
113574
|
-
|
|
113684
|
+
ModuleNewActionSchema = {
|
|
113685
|
+
key: "Module_new_action",
|
|
113686
|
+
isObject: true,
|
|
113687
|
+
items: [{
|
|
113688
|
+
key: "actionType",
|
|
113689
|
+
label: function label20() {
|
|
113690
|
+
return i18n.t(localeKeys.action.self);
|
|
113691
|
+
},
|
|
113692
|
+
type: ["string"],
|
|
113693
|
+
mutualExclusion: true,
|
|
113694
|
+
items: ModuleActionTypes.map(function(type) {
|
|
113695
|
+
return {
|
|
113696
|
+
key: type,
|
|
113697
|
+
label: ActionTypeText[type],
|
|
113698
|
+
type: ["string"],
|
|
113699
|
+
mutualExclusion: true,
|
|
113700
|
+
items: ModuleActionFunctions.map(function(func) {
|
|
113701
|
+
return ModuleSpecialSchemaMap[func] || {
|
|
113702
|
+
key: func,
|
|
113703
|
+
label: ActionFunctionText[func]
|
|
113575
113704
|
};
|
|
113576
113705
|
})
|
|
113577
|
-
}
|
|
113578
|
-
}, ActionType.Function, {
|
|
113579
|
-
type: "string",
|
|
113580
|
-
title: ActionTypeText[ActionType.Function](),
|
|
113581
|
-
"enum": ModuleActionFunctions.filter(function(func) {
|
|
113582
|
-
return !funcMap[func];
|
|
113583
|
-
}).map(function(func) {
|
|
113584
|
-
return {
|
|
113585
|
-
value: func,
|
|
113586
|
-
label: ActionFunctionText[func]()
|
|
113587
|
-
};
|
|
113588
|
-
}),
|
|
113589
|
-
"x-reactions": [{
|
|
113590
|
-
dependencies: ["actionType"],
|
|
113591
|
-
fulfill: {
|
|
113592
|
-
state: {
|
|
113593
|
-
visible: '{{$deps[0] === "function"}}'
|
|
113594
|
-
}
|
|
113595
|
-
}
|
|
113596
|
-
}]
|
|
113706
|
+
};
|
|
113597
113707
|
})
|
|
113598
|
-
}
|
|
113708
|
+
}]
|
|
113599
113709
|
};
|
|
113600
113710
|
ModuleActionFunctionsDevDependencies = (_ModuleActionFunction = {}, _defineProperty(_ModuleActionFunction, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_ModuleActionFunction, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_ModuleActionFunction, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_ModuleActionFunction, ActionFunction.RuntimeApi, "@modern-js/runtime"), _defineProperty(_ModuleActionFunction, ActionFunction.TailwindCSS, "tailwindcss"), _ModuleActionFunction);
|
|
113601
113711
|
ModuleActionFunctionsPeerDependencies = (_ModuleActionFunction2 = {}, _defineProperty(_ModuleActionFunction2, ActionFunction.RuntimeApi, "@modern-js/runtime"), _defineProperty(_ModuleActionFunction2, ActionFunction.TailwindCSS, "tailwindcss"), _ModuleActionFunction2);
|
|
113602
113712
|
ModuleActionFunctionsDependencies = (_ModuleActionFunction3 = {}, _defineProperty(_ModuleActionFunction3, ActionFunction.I18n, "@modern-js/plugin-i18n"), _defineProperty(_ModuleActionFunction3, ActionFunction.TailwindCSS, "@modern-js/plugin-tailwindcss"), _ModuleActionFunction3);
|
|
113603
113713
|
ModuleNewActionGenerators = _defineProperty({}, ActionType.Function, (_ActionType$Function2 = {}, _defineProperty(_ActionType$Function2, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Test, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function2, ActionFunction.Storybook, "@modern-js/storybook-generator"), _defineProperty(_ActionType$Function2, ActionFunction.RuntimeApi, "@modern-js/dependence-generator"), _ActionType$Function2));
|
|
113604
113714
|
});
|
|
113605
|
-
var _MonorepoNewActionCon,
|
|
113715
|
+
var _MonorepoNewActionCon, MonorepoNewActionSchema, MonorepoNewActionConfig;
|
|
113606
113716
|
var init_monorepo2 = __esmMin(() => {
|
|
113607
113717
|
init_defineProperty();
|
|
113608
113718
|
init_common();
|
|
113609
|
-
|
|
113610
|
-
|
|
113611
|
-
|
|
113612
|
-
|
|
113613
|
-
properties: {
|
|
113614
|
-
solution: getSolutionSchema(extra)
|
|
113615
|
-
}
|
|
113616
|
-
};
|
|
113719
|
+
MonorepoNewActionSchema = {
|
|
113720
|
+
key: "monorepo_new_action",
|
|
113721
|
+
isObject: true,
|
|
113722
|
+
items: [SubSolutionSchema]
|
|
113617
113723
|
};
|
|
113618
113724
|
MonorepoNewActionConfig = (_MonorepoNewActionCon = {}, _defineProperty(_MonorepoNewActionCon, SubSolution.MWA, {
|
|
113619
113725
|
isMonorepoSubProject: true,
|
|
@@ -113635,24 +113741,14 @@ var init_newAction = __esmMin(() => {
|
|
|
113635
113741
|
init_module2();
|
|
113636
113742
|
init_monorepo2();
|
|
113637
113743
|
});
|
|
113638
|
-
var
|
|
113744
|
+
var GeneratorSchemas, GeneratorSchema, GeneratorDefaultConfig;
|
|
113639
113745
|
var init_generator = __esmMin(() => {
|
|
113640
113746
|
init_common();
|
|
113641
|
-
|
|
113642
|
-
|
|
113643
|
-
|
|
113644
|
-
|
|
113645
|
-
|
|
113646
|
-
packageManager: getPackageManagerSchema(extra),
|
|
113647
|
-
language: getLanguageSchema(extra)
|
|
113648
|
-
};
|
|
113649
|
-
};
|
|
113650
|
-
getGeneratorSchema = function getGeneratorSchema2() {
|
|
113651
|
-
var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
113652
|
-
return {
|
|
113653
|
-
type: "object",
|
|
113654
|
-
properties: getGeneratorSchemaProperties(extra)
|
|
113655
|
-
};
|
|
113747
|
+
GeneratorSchemas = [PackageNameSchema, PackagePathSchema, PackageManagerSchema, LanguageSchema];
|
|
113748
|
+
GeneratorSchema = {
|
|
113749
|
+
key: "generator-generator",
|
|
113750
|
+
isObject: true,
|
|
113751
|
+
items: Object.values(GeneratorSchemas)
|
|
113656
113752
|
};
|
|
113657
113753
|
GeneratorDefaultConfig = {
|
|
113658
113754
|
packageManager: PackageManager.Pnpm,
|
|
@@ -113673,27 +113769,40 @@ __export2(treeshaking_exports5, {
|
|
|
113673
113769
|
ActionType: () => ActionType,
|
|
113674
113770
|
ActionTypeText: () => ActionTypeText,
|
|
113675
113771
|
ActionTypeTextMap: () => ActionTypeTextMap,
|
|
113772
|
+
BFFSchema: () => BFFSchema,
|
|
113773
|
+
BFFSchemas: () => BFFSchemas,
|
|
113676
113774
|
BFFType: () => BFFType,
|
|
113775
|
+
BFFTypeSchema: () => BFFTypeSchema,
|
|
113677
113776
|
BaseDefaultConfig: () => BaseDefaultConfig,
|
|
113678
113777
|
BaseGenerator: () => BaseGenerator,
|
|
113778
|
+
BaseSchema: () => BaseSchema,
|
|
113779
|
+
BaseSchemas: () => BaseSchemas,
|
|
113679
113780
|
BooleanConfig: () => BooleanConfig,
|
|
113680
113781
|
BooleanConfigName: () => BooleanConfigName,
|
|
113782
|
+
BooleanSchemas: () => BooleanSchemas,
|
|
113681
113783
|
ChangesetGenerator: () => ChangesetGenerator,
|
|
113784
|
+
ClientRoute: () => ClientRoute,
|
|
113785
|
+
ClientRouteSchema: () => ClientRouteSchema,
|
|
113682
113786
|
DependenceGenerator: () => DependenceGenerator,
|
|
113787
|
+
ElectronGenerator: () => ElectronGenerator,
|
|
113683
113788
|
EntryGenerator: () => EntryGenerator,
|
|
113789
|
+
EntrySchema: () => EntrySchema,
|
|
113790
|
+
EntrySchemas: () => EntrySchemas,
|
|
113684
113791
|
EslintGenerator: () => EslintGenerator,
|
|
113685
113792
|
Framework: () => Framework,
|
|
113686
113793
|
FrameworkAppendTypeContent: () => FrameworkAppendTypeContent,
|
|
113794
|
+
FrameworkSchema: () => FrameworkSchema,
|
|
113687
113795
|
GeneratorDefaultConfig: () => GeneratorDefaultConfig,
|
|
113796
|
+
GeneratorSchema: () => GeneratorSchema,
|
|
113688
113797
|
Language: () => Language,
|
|
113798
|
+
LanguageName: () => LanguageName,
|
|
113799
|
+
LanguageSchema: () => LanguageSchema,
|
|
113689
113800
|
MWAActionElements: () => MWAActionElements,
|
|
113690
113801
|
MWAActionFunctions: () => MWAActionFunctions,
|
|
113691
113802
|
MWAActionFunctionsAppendTypeContent: () => MWAActionFunctionsAppendTypeContent,
|
|
113692
113803
|
MWAActionFunctionsDependencies: () => MWAActionFunctionsDependencies,
|
|
113693
113804
|
MWAActionFunctionsDevDependencies: () => MWAActionFunctionsDevDependencies,
|
|
113694
|
-
MWAActionReactorAppendTypeContent: () => MWAActionReactorAppendTypeContent,
|
|
113695
113805
|
MWAActionReactors: () => MWAActionReactors,
|
|
113696
|
-
MWAActionRefactorDependencies: () => MWAActionRefactorDependencies,
|
|
113697
113806
|
MWAActionTypes: () => MWAActionTypes,
|
|
113698
113807
|
MWAActionTypesMap: () => MWAActionTypesMap,
|
|
113699
113808
|
MWADefaultBffConfig: () => MWADefaultBffConfig,
|
|
@@ -113701,6 +113810,10 @@ __export2(treeshaking_exports5, {
|
|
|
113701
113810
|
MWADefaultEntryConfig: () => MWADefaultEntryConfig,
|
|
113702
113811
|
MWADefaultServerConfig: () => MWADefaultServerConfig,
|
|
113703
113812
|
MWANewActionGenerators: () => MWANewActionGenerators,
|
|
113813
|
+
MWANewActionSchema: () => MWANewActionSchema,
|
|
113814
|
+
MWASchema: () => MWASchema,
|
|
113815
|
+
MWASchemas: () => MWASchemas,
|
|
113816
|
+
MWASpecialSchemaMap: () => MWASpecialSchemaMap,
|
|
113704
113817
|
ModuleActionFunctions: () => ModuleActionFunctions,
|
|
113705
113818
|
ModuleActionFunctionsDependencies: () => ModuleActionFunctionsDependencies,
|
|
113706
113819
|
ModuleActionFunctionsDevDependencies: () => ModuleActionFunctionsDevDependencies,
|
|
@@ -113709,49 +113822,40 @@ __export2(treeshaking_exports5, {
|
|
|
113709
113822
|
ModuleActionTypesMap: () => ModuleActionTypesMap,
|
|
113710
113823
|
ModuleDefaultConfig: () => ModuleDefaultConfig,
|
|
113711
113824
|
ModuleNewActionGenerators: () => ModuleNewActionGenerators,
|
|
113825
|
+
ModuleNewActionSchema: () => ModuleNewActionSchema,
|
|
113826
|
+
ModuleSchema: () => ModuleSchema,
|
|
113827
|
+
ModuleSchemas: () => ModuleSchemas,
|
|
113712
113828
|
ModuleSpecialSchemaMap: () => ModuleSpecialSchemaMap,
|
|
113713
113829
|
MonorepoDefaultConfig: () => MonorepoDefaultConfig,
|
|
113714
113830
|
MonorepoNewActionConfig: () => MonorepoNewActionConfig,
|
|
113831
|
+
MonorepoNewActionSchema: () => MonorepoNewActionSchema,
|
|
113832
|
+
MonorepoSchema: () => MonorepoSchema,
|
|
113833
|
+
MonorepoSchemas: () => MonorepoSchemas,
|
|
113834
|
+
NeedModifyMWAConfigSchema: () => NeedModifyMWAConfigSchema,
|
|
113715
113835
|
PackageManager: () => PackageManager,
|
|
113716
113836
|
PackageManagerName: () => PackageManagerName,
|
|
113837
|
+
PackageManagerSchema: () => PackageManagerSchema,
|
|
113838
|
+
PackageNameSchema: () => PackageNameSchema,
|
|
113839
|
+
PackagePathSchema: () => PackagePathSchema,
|
|
113840
|
+
RunWay: () => RunWay,
|
|
113841
|
+
RunWaySchema: () => RunWaySchema,
|
|
113842
|
+
ServerSchema: () => ServerSchema,
|
|
113843
|
+
ServerSchemas: () => ServerSchemas,
|
|
113717
113844
|
Solution: () => Solution,
|
|
113718
113845
|
SolutionDefaultConfig: () => SolutionDefaultConfig,
|
|
113719
113846
|
SolutionGenerator: () => SolutionGenerator,
|
|
113847
|
+
SolutionSchema: () => SolutionSchema,
|
|
113720
113848
|
SolutionSchemas: () => SolutionSchemas,
|
|
113721
113849
|
SolutionText: () => SolutionText,
|
|
113722
113850
|
SolutionToolsMap: () => SolutionToolsMap,
|
|
113723
113851
|
SubSolution: () => SubSolution,
|
|
113724
113852
|
SubSolutionGenerator: () => SubSolutionGenerator,
|
|
113853
|
+
SubSolutionSchema: () => SubSolutionSchema,
|
|
113725
113854
|
SubSolutionText: () => SubSolutionText,
|
|
113726
|
-
getBFFSchema: () => getBFFSchema,
|
|
113727
|
-
getBFFTypeSchema: () => getBFFTypeSchema,
|
|
113728
|
-
getBFFchemaProperties: () => getBFFchemaProperties,
|
|
113729
|
-
getBaseSchema: () => getBaseSchema,
|
|
113730
|
-
getBooleanSchemas: () => getBooleanSchemas,
|
|
113731
|
-
getEntryNameSchema: () => getEntryNameSchema,
|
|
113732
|
-
getEntrySchema: () => getEntrySchema,
|
|
113733
|
-
getEntrySchemaProperties: () => getEntrySchemaProperties,
|
|
113734
|
-
getFrameworkSchema: () => getFrameworkSchema,
|
|
113735
|
-
getGeneratorSchema: () => getGeneratorSchema,
|
|
113736
|
-
getGeneratorSchemaProperties: () => getGeneratorSchemaProperties,
|
|
113737
|
-
getLanguageSchema: () => getLanguageSchema,
|
|
113738
|
-
getMWANewActionSchema: () => getMWANewActionSchema,
|
|
113739
|
-
getMWASchema: () => getMWASchema,
|
|
113740
|
-
getMWASchemaProperties: () => getMWASchemaProperties,
|
|
113741
|
-
getModuleNewActionSchema: () => getModuleNewActionSchema,
|
|
113742
|
-
getModuleSchema: () => getModuleSchema,
|
|
113743
|
-
getModuleSchemaProperties: () => getModuleSchemaProperties,
|
|
113744
|
-
getMonorepoNewActionSchema: () => getMonorepoNewActionSchema,
|
|
113745
|
-
getMonorepoSchema: () => getMonorepoSchema,
|
|
113746
|
-
getPackageManagerSchema: () => getPackageManagerSchema,
|
|
113747
|
-
getPackageNameSchema: () => getPackageNameSchema,
|
|
113748
|
-
getPackagePathSchema: () => getPackagePathSchema,
|
|
113749
|
-
getScenesSchema: () => getScenesSchema,
|
|
113750
|
-
getServerSchema: () => getServerSchema,
|
|
113751
113855
|
getSolutionNameFromSubSolution: () => getSolutionNameFromSubSolution,
|
|
113752
|
-
getSolutionSchema: () => getSolutionSchema,
|
|
113753
113856
|
i18n: () => i18n,
|
|
113754
|
-
localeKeys: () => localeKeys
|
|
113857
|
+
localeKeys: () => localeKeys,
|
|
113858
|
+
mwaConfigWhenFunc: () => mwaConfigWhenFunc
|
|
113755
113859
|
});
|
|
113756
113860
|
var _SolutionDefaultConfi, _SolutionSchemas, SolutionDefaultConfig, SolutionSchemas;
|
|
113757
113861
|
var init_treeshaking5 = __esmMin(() => {
|
|
@@ -113770,7 +113874,7 @@ var init_treeshaking5 = __esmMin(() => {
|
|
|
113770
113874
|
init_expand();
|
|
113771
113875
|
init_base();
|
|
113772
113876
|
SolutionDefaultConfig = (_SolutionDefaultConfi = {}, _defineProperty(_SolutionDefaultConfi, Solution.MWA, MWADefaultConfig), _defineProperty(_SolutionDefaultConfi, Solution.Module, ModuleDefaultConfig), _defineProperty(_SolutionDefaultConfi, Solution.Monorepo, MonorepoDefaultConfig), _SolutionDefaultConfi);
|
|
113773
|
-
SolutionSchemas = (_SolutionSchemas = {}, _defineProperty(_SolutionSchemas, Solution.MWA,
|
|
113877
|
+
SolutionSchemas = (_SolutionSchemas = {}, _defineProperty(_SolutionSchemas, Solution.MWA, MWASchemas), _defineProperty(_SolutionSchemas, Solution.Module, ModuleSchemas), _defineProperty(_SolutionSchemas, Solution.Monorepo, MonorepoSchemas), _defineProperty(_SolutionSchemas, "custom", BaseSchemas), _SolutionSchemas);
|
|
113774
113878
|
});
|
|
113775
113879
|
var require_import_lazy2 = __commonJSMin((exports, module2) => {
|
|
113776
113880
|
(() => {
|
|
@@ -142950,13 +143054,13 @@ var require_logger4 = __commonJSMin((exports) => {
|
|
|
142950
143054
|
if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
|
|
142951
143055
|
return;
|
|
142952
143056
|
}
|
|
142953
|
-
let
|
|
143057
|
+
let label21 = "";
|
|
142954
143058
|
let text = "";
|
|
142955
143059
|
const logType = this.types[type];
|
|
142956
143060
|
if (this.config.displayLabel && logType.label) {
|
|
142957
|
-
|
|
142958
|
-
|
|
142959
|
-
|
|
143061
|
+
label21 = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
|
|
143062
|
+
label21 = label21.padEnd(this.longestLabel.length);
|
|
143063
|
+
label21 = chalk_1.default.bold(logType.color ? chalk_1.default[logType.color](label21) : label21);
|
|
142960
143064
|
}
|
|
142961
143065
|
if (message instanceof Error) {
|
|
142962
143066
|
if (message.stack) {
|
|
@@ -142969,15 +143073,15 @@ ${chalk_1.default.grey(rest.join("\n"))}`;
|
|
|
142969
143073
|
} else {
|
|
142970
143074
|
text = `${message}`;
|
|
142971
143075
|
}
|
|
142972
|
-
const log =
|
|
143076
|
+
const log = label21.length > 0 ? `${label21} ${text}` : text;
|
|
142973
143077
|
console.log(log, ...args);
|
|
142974
143078
|
}
|
|
142975
143079
|
getLongestLabel() {
|
|
142976
143080
|
let longestLabel = "";
|
|
142977
143081
|
Object.keys(this.types).forEach((type) => {
|
|
142978
|
-
const { label = "" } = this.types[type];
|
|
142979
|
-
if (
|
|
142980
|
-
longestLabel =
|
|
143082
|
+
const { label: label21 = "" } = this.types[type];
|
|
143083
|
+
if (label21.length > longestLabel.length) {
|
|
143084
|
+
longestLabel = label21;
|
|
142981
143085
|
}
|
|
142982
143086
|
});
|
|
142983
143087
|
return longestLabel;
|
|
@@ -143294,23 +143398,17 @@ var require_compatRequire2 = __commonJSMin((exports) => {
|
|
|
143294
143398
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
143295
143399
|
exports.cleanRequireCache = exports.requireExistModule = exports.compatRequire = void 0;
|
|
143296
143400
|
var findExists_1 = require_findExists2();
|
|
143297
|
-
var compatRequire = (filePath
|
|
143401
|
+
var compatRequire = (filePath) => {
|
|
143298
143402
|
const mod = __require(filePath);
|
|
143299
|
-
|
|
143300
|
-
return rtnESMDefault ? mod.default : mod;
|
|
143403
|
+
return (mod === null || mod === void 0 ? void 0 : mod.__esModule) ? mod.default : mod;
|
|
143301
143404
|
};
|
|
143302
143405
|
exports.compatRequire = compatRequire;
|
|
143303
|
-
var requireExistModule = (filename,
|
|
143304
|
-
const
|
|
143305
|
-
extensions: [".ts", ".js"],
|
|
143306
|
-
interop: true,
|
|
143307
|
-
...opt
|
|
143308
|
-
};
|
|
143309
|
-
const exist = (0, findExists_1.findExists)(final.extensions.map((ext) => `${filename}${ext}`));
|
|
143406
|
+
var requireExistModule = (filename, extensions = [".ts", ".js"]) => {
|
|
143407
|
+
const exist = (0, findExists_1.findExists)(extensions.map((ext) => `${filename}${ext}`));
|
|
143310
143408
|
if (!exist) {
|
|
143311
143409
|
return null;
|
|
143312
143410
|
}
|
|
143313
|
-
return (0, exports.compatRequire)(exist
|
|
143411
|
+
return (0, exports.compatRequire)(exist);
|
|
143314
143412
|
};
|
|
143315
143413
|
exports.requireExistModule = requireExistModule;
|
|
143316
143414
|
var cleanRequireCache = (filelist) => {
|
|
@@ -143323,7 +143421,7 @@ var require_compatRequire2 = __commonJSMin((exports) => {
|
|
|
143323
143421
|
var require_constants6 = __commonJSMin((exports) => {
|
|
143324
143422
|
"use strict";
|
|
143325
143423
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
143326
|
-
exports.PLUGIN_SCHEMAS = exports.
|
|
143424
|
+
exports.PLUGIN_SCHEMAS = exports.INTERNAL_PLUGINS = exports.DEFAULT_SERVER_CONFIG = exports.OUTPUT_CONFIG_FILE = exports.CONFIG_FILE_EXTENSIONS = exports.CONFIG_CACHE_DIR = exports.SHARED_DIR = exports.SERVER_DIR = exports.API_DIR = exports.LOADABLE_STATS_FILE = exports.SERVER_RENDER_FUNCTION_NAME = exports.ENTRY_NAME_PATTERN = exports.SERVER_BUNDLE_DIRECTORY = exports.LAUNCH_EDITOR_ENDPOINT = exports.MAIN_ENTRY_NAME = exports.ROUTE_SPEC_FILE = exports.HMR_SOCK_PATH = void 0;
|
|
143327
143425
|
exports.HMR_SOCK_PATH = "/webpack-hmr";
|
|
143328
143426
|
exports.ROUTE_SPEC_FILE = "route.json";
|
|
143329
143427
|
exports.MAIN_ENTRY_NAME = "main";
|
|
@@ -143339,39 +143437,53 @@ var require_constants6 = __commonJSMin((exports) => {
|
|
|
143339
143437
|
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".ejs", ".mjs"];
|
|
143340
143438
|
exports.OUTPUT_CONFIG_FILE = "modern.config.json";
|
|
143341
143439
|
exports.DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
|
143342
|
-
exports.
|
|
143343
|
-
"@modern-js/app-tools": "@modern-js/app-tools/cli",
|
|
143344
|
-
"@modern-js/monorepo-tools": "@modern-js/monorepo-tools/cli",
|
|
143345
|
-
"@modern-js/module-tools": "@modern-js/module-tools/cli",
|
|
143346
|
-
"@modern-js/
|
|
143347
|
-
"@modern-js/
|
|
143348
|
-
"@modern-js/plugin-
|
|
143349
|
-
"@modern-js/plugin-
|
|
143350
|
-
"@modern-js/plugin-
|
|
143351
|
-
"@modern-js/plugin-
|
|
143352
|
-
"@modern-js/plugin-
|
|
143353
|
-
|
|
143354
|
-
|
|
143355
|
-
|
|
143356
|
-
"@modern-js/plugin-
|
|
143357
|
-
"@modern-js/plugin-
|
|
143358
|
-
"@modern-js/plugin-
|
|
143359
|
-
"@modern-js/plugin-
|
|
143360
|
-
|
|
143361
|
-
|
|
143362
|
-
|
|
143363
|
-
"@modern-js/plugin-
|
|
143364
|
-
|
|
143365
|
-
|
|
143366
|
-
|
|
143367
|
-
|
|
143368
|
-
|
|
143369
|
-
|
|
143370
|
-
|
|
143371
|
-
"@modern-js/plugin-
|
|
143372
|
-
|
|
143373
|
-
|
|
143374
|
-
|
|
143440
|
+
exports.INTERNAL_PLUGINS = {
|
|
143441
|
+
"@modern-js/app-tools": { cli: "@modern-js/app-tools/cli" },
|
|
143442
|
+
"@modern-js/monorepo-tools": { cli: "@modern-js/monorepo-tools/cli" },
|
|
143443
|
+
"@modern-js/module-tools": { cli: "@modern-js/module-tools/cli" },
|
|
143444
|
+
"@modern-js/runtime": { cli: "@modern-js/runtime/cli" },
|
|
143445
|
+
"@modern-js/plugin-less": { cli: "@modern-js/plugin-less/cli" },
|
|
143446
|
+
"@modern-js/plugin-sass": { cli: "@modern-js/plugin-sass/cli" },
|
|
143447
|
+
"@modern-js/plugin-esbuild": { cli: "@modern-js/plugin-esbuild/cli" },
|
|
143448
|
+
"@modern-js/plugin-proxy": { cli: "@modern-js/plugin-proxy/cli" },
|
|
143449
|
+
"@modern-js/plugin-ssg": { cli: "@modern-js/plugin-ssg/cli" },
|
|
143450
|
+
"@modern-js/plugin-bff": {
|
|
143451
|
+
cli: "@modern-js/plugin-bff/cli",
|
|
143452
|
+
server: "@modern-js/plugin-bff/server"
|
|
143453
|
+
},
|
|
143454
|
+
"@modern-js/plugin-electron": { cli: "@modern-js/plugin-electron/cli" },
|
|
143455
|
+
"@modern-js/plugin-testing": { cli: "@modern-js/plugin-testing/cli" },
|
|
143456
|
+
"@modern-js/plugin-storybook": { cli: "@modern-js/plugin-storybook/cli" },
|
|
143457
|
+
"@modern-js/plugin-express": {
|
|
143458
|
+
cli: "@modern-js/plugin-express/cli",
|
|
143459
|
+
server: "@modern-js/plugin-express"
|
|
143460
|
+
},
|
|
143461
|
+
"@modern-js/plugin-egg": {
|
|
143462
|
+
cli: "@modern-js/plugin-egg/cli",
|
|
143463
|
+
server: "@modern-js/plugin-egg"
|
|
143464
|
+
},
|
|
143465
|
+
"@modern-js/plugin-koa": {
|
|
143466
|
+
cli: "@modern-js/plugin-koa/cli",
|
|
143467
|
+
server: "@modern-js/plugin-koa"
|
|
143468
|
+
},
|
|
143469
|
+
"@modern-js/plugin-nest": {
|
|
143470
|
+
cli: "@modern-js/plugin-nest/cli",
|
|
143471
|
+
server: "@modern-js/plugin-nest/server"
|
|
143472
|
+
},
|
|
143473
|
+
"@modern-js/plugin-unbundle": { cli: "@modern-js/plugin-unbundle" },
|
|
143474
|
+
"@modern-js/plugin-server": {
|
|
143475
|
+
cli: "@modern-js/plugin-server/cli",
|
|
143476
|
+
server: "@modern-js/plugin-server/server"
|
|
143477
|
+
},
|
|
143478
|
+
"@modern-js/plugin-garfish": {
|
|
143479
|
+
cli: "@modern-js/plugin-garfish/cli"
|
|
143480
|
+
},
|
|
143481
|
+
"@modern-js/plugin-tailwindcss": { cli: "@modern-js/plugin-tailwindcss/cli" },
|
|
143482
|
+
"@modern-js/plugin-polyfill": {
|
|
143483
|
+
cli: "@modern-js/plugin-polyfill/cli",
|
|
143484
|
+
server: "@modern-js/plugin-polyfill"
|
|
143485
|
+
},
|
|
143486
|
+
"@modern-js/plugin-nocode": { cli: "@modern-js/plugin-nocode/cli" }
|
|
143375
143487
|
};
|
|
143376
143488
|
exports.PLUGIN_SCHEMAS = {
|
|
143377
143489
|
"@modern-js/runtime": [
|
|
@@ -143438,6 +143550,27 @@ var require_constants6 = __commonJSMin((exports) => {
|
|
|
143438
143550
|
schema: { typeof: ["string", "object"] }
|
|
143439
143551
|
}
|
|
143440
143552
|
],
|
|
143553
|
+
"@modern-js/plugin-unbundle": [
|
|
143554
|
+
{
|
|
143555
|
+
target: "output.disableAutoImportStyle",
|
|
143556
|
+
schema: { type: "boolean" }
|
|
143557
|
+
},
|
|
143558
|
+
{
|
|
143559
|
+
target: "dev.unbundle",
|
|
143560
|
+
schema: {
|
|
143561
|
+
type: "object",
|
|
143562
|
+
properties: {
|
|
143563
|
+
ignore: {
|
|
143564
|
+
type: ["string", "array"],
|
|
143565
|
+
items: { type: "string" }
|
|
143566
|
+
},
|
|
143567
|
+
ignoreModuleCache: { type: "boolean" },
|
|
143568
|
+
clearPdnCache: { type: "boolean" },
|
|
143569
|
+
pdnHost: { type: "string" }
|
|
143570
|
+
}
|
|
143571
|
+
}
|
|
143572
|
+
}
|
|
143573
|
+
],
|
|
143441
143574
|
"@modern-js/plugin-ssg": [
|
|
143442
143575
|
{
|
|
143443
143576
|
target: "output.ssg",
|
|
@@ -144420,11 +144553,9 @@ var require_chainId2 = __commonJSMin((exports) => {
|
|
|
144420
144553
|
HTML: "html",
|
|
144421
144554
|
BABEL: "babel",
|
|
144422
144555
|
ESBUILD: "esbuild",
|
|
144423
|
-
SWC: "swc",
|
|
144424
144556
|
STYLE: "style-loader",
|
|
144425
144557
|
POSTCSS: "postcss",
|
|
144426
144558
|
MARKDOWN: "markdown",
|
|
144427
|
-
IGNORE_CSS: "ignore-css",
|
|
144428
144559
|
CSS_MODULES_TS: "css-modules-typescript",
|
|
144429
144560
|
MINI_CSS_EXTRACT: "mini-css-extract"
|
|
144430
144561
|
},
|
|
@@ -144455,8 +144586,7 @@ var require_chainId2 = __commonJSMin((exports) => {
|
|
|
144455
144586
|
MINIMIZER: {
|
|
144456
144587
|
JS: "js",
|
|
144457
144588
|
CSS: "css",
|
|
144458
|
-
ESBUILD: "js-css"
|
|
144459
|
-
SWC: "swc"
|
|
144589
|
+
ESBUILD: "js-css"
|
|
144460
144590
|
},
|
|
144461
144591
|
RESOLVE_PLUGIN: {
|
|
144462
144592
|
MODULE_SCOPE: "module-scope",
|
|
@@ -144464,7 +144594,7 @@ var require_chainId2 = __commonJSMin((exports) => {
|
|
|
144464
144594
|
}
|
|
144465
144595
|
};
|
|
144466
144596
|
});
|
|
144467
|
-
var
|
|
144597
|
+
var require_version = __commonJSMin((exports) => {
|
|
144468
144598
|
"use strict";
|
|
144469
144599
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
144470
144600
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
@@ -144495,32 +144625,6 @@ var require_version2 = __commonJSMin((exports) => {
|
|
|
144495
144625
|
};
|
|
144496
144626
|
exports.isReact18 = isReact18;
|
|
144497
144627
|
});
|
|
144498
|
-
var require_plugin = __commonJSMin((exports) => {
|
|
144499
|
-
"use strict";
|
|
144500
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
144501
|
-
exports.getInternalPlugins = void 0;
|
|
144502
|
-
var constants_1 = require_constants6();
|
|
144503
|
-
var is_1 = require_is2();
|
|
144504
|
-
function getInternalPlugins(appDirectory, internalPlugins = constants_1.INTERNAL_CLI_PLUGINS) {
|
|
144505
|
-
return [
|
|
144506
|
-
...Object.keys(internalPlugins).filter((name5) => {
|
|
144507
|
-
const config = internalPlugins[name5];
|
|
144508
|
-
if (typeof config !== "string" && config.forced === true) {
|
|
144509
|
-
return true;
|
|
144510
|
-
}
|
|
144511
|
-
return (0, is_1.isDepExists)(appDirectory, name5);
|
|
144512
|
-
}).map((name5) => {
|
|
144513
|
-
const config = internalPlugins[name5];
|
|
144514
|
-
if (typeof config !== "string") {
|
|
144515
|
-
return config.path;
|
|
144516
|
-
} else {
|
|
144517
|
-
return config;
|
|
144518
|
-
}
|
|
144519
|
-
})
|
|
144520
|
-
];
|
|
144521
|
-
}
|
|
144522
|
-
exports.getInternalPlugins = getInternalPlugins;
|
|
144523
|
-
});
|
|
144524
144628
|
var require_dist2 = __commonJSMin((exports) => {
|
|
144525
144629
|
"use strict";
|
|
144526
144630
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
@@ -144580,8 +144684,7 @@ var require_dist2 = __commonJSMin((exports) => {
|
|
|
144580
144684
|
__exportStar(require_tryResolve2(), exports);
|
|
144581
144685
|
__exportStar(require_analyzeProject2(), exports);
|
|
144582
144686
|
__exportStar(require_chainId2(), exports);
|
|
144583
|
-
__exportStar(
|
|
144584
|
-
__exportStar(require_plugin(), exports);
|
|
144687
|
+
__exportStar(require_version(), exports);
|
|
144585
144688
|
});
|
|
144586
144689
|
var require_strip_ansi4 = __commonJSMin((exports) => {
|
|
144587
144690
|
"use strict";
|
|
@@ -144920,7 +145023,7 @@ var require_node9 = __commonJSMin((exports) => {
|
|
|
144920
145023
|
}
|
|
144921
145024
|
async function getModernVersion(solution, registry2) {
|
|
144922
145025
|
const dep = _generatorCommon.SolutionToolsMap[solution];
|
|
144923
|
-
const modernVersion = await getPackageVersion(
|
|
145026
|
+
const modernVersion = await getPackageVersion(dep, registry2);
|
|
144924
145027
|
return modernVersion;
|
|
144925
145028
|
}
|
|
144926
145029
|
async function getModernPluginVersion(solution, packageName, options3 = {}) {
|
|
@@ -146001,23 +146104,23 @@ var require_utils15 = __commonJSMin((exports) => {
|
|
|
146001
146104
|
}
|
|
146002
146105
|
};
|
|
146003
146106
|
exports.readJson = readJson;
|
|
146004
|
-
function hasEnabledFunction(
|
|
146107
|
+
function hasEnabledFunction(action3, dependencies3, devDependencies3, peerDependencies, cwd) {
|
|
146005
146108
|
const packageJsonPath = _path.default.normalize(`${cwd}/package.json`);
|
|
146006
146109
|
const packageJson = readJson(packageJsonPath);
|
|
146007
|
-
if (!dependencies3[
|
|
146110
|
+
if (!dependencies3[action3] && !devDependencies3[action3]) {
|
|
146008
146111
|
return false;
|
|
146009
146112
|
}
|
|
146010
|
-
if (dependencies3[
|
|
146113
|
+
if (dependencies3[action3]) {
|
|
146011
146114
|
var _packageJson$dependen;
|
|
146012
|
-
return (_packageJson$dependen = packageJson.dependencies) === null || _packageJson$dependen === void 0 ? void 0 : _packageJson$dependen[dependencies3[
|
|
146115
|
+
return (_packageJson$dependen = packageJson.dependencies) === null || _packageJson$dependen === void 0 ? void 0 : _packageJson$dependen[dependencies3[action3]];
|
|
146013
146116
|
}
|
|
146014
|
-
if (peerDependencies[
|
|
146117
|
+
if (peerDependencies[action3]) {
|
|
146015
146118
|
var _packageJson$peerDepe;
|
|
146016
|
-
return (_packageJson$peerDepe = packageJson.peerDependencies) === null || _packageJson$peerDepe === void 0 ? void 0 : _packageJson$peerDepe[peerDependencies[
|
|
146119
|
+
return (_packageJson$peerDepe = packageJson.peerDependencies) === null || _packageJson$peerDepe === void 0 ? void 0 : _packageJson$peerDepe[peerDependencies[action3]];
|
|
146017
146120
|
}
|
|
146018
|
-
if (!peerDependencies[
|
|
146121
|
+
if (!peerDependencies[action3] && devDependencies3[action3]) {
|
|
146019
146122
|
var _packageJson$devDepen;
|
|
146020
|
-
return (_packageJson$devDepen = packageJson.devDependencies) === null || _packageJson$devDepen === void 0 ? void 0 : _packageJson$devDepen[devDependencies3[
|
|
146123
|
+
return (_packageJson$devDepen = packageJson.devDependencies) === null || _packageJson$devDepen === void 0 ? void 0 : _packageJson$devDepen[devDependencies3[action3]];
|
|
146021
146124
|
}
|
|
146022
146125
|
return false;
|
|
146023
146126
|
}
|
|
@@ -146042,35 +146145,6 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146042
146145
|
var _generatorCommon = (init_treeshaking5(), __toCommonJS2(treeshaking_exports5));
|
|
146043
146146
|
var _generatorUtils = require_node9();
|
|
146044
146147
|
var _utils = require_utils15();
|
|
146045
|
-
function ownKeys2(object, enumerableOnly) {
|
|
146046
|
-
var keys = Object.keys(object);
|
|
146047
|
-
if (Object.getOwnPropertySymbols) {
|
|
146048
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
146049
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
146050
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
146051
|
-
})), keys.push.apply(keys, symbols);
|
|
146052
|
-
}
|
|
146053
|
-
return keys;
|
|
146054
|
-
}
|
|
146055
|
-
function _objectSpread(target) {
|
|
146056
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
146057
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
146058
|
-
i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
|
|
146059
|
-
_defineProperty2(target, key, source[key]);
|
|
146060
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
|
|
146061
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
146062
|
-
});
|
|
146063
|
-
}
|
|
146064
|
-
return target;
|
|
146065
|
-
}
|
|
146066
|
-
function _defineProperty2(obj, key, value) {
|
|
146067
|
-
if (key in obj) {
|
|
146068
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
146069
|
-
} else {
|
|
146070
|
-
obj[key] = value;
|
|
146071
|
-
}
|
|
146072
|
-
return obj;
|
|
146073
|
-
}
|
|
146074
146148
|
var MWANewAction2 = async (options3) => {
|
|
146075
146149
|
const {
|
|
146076
146150
|
locale = "zh",
|
|
@@ -146107,23 +146181,19 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146107
146181
|
data: {},
|
|
146108
146182
|
current: null
|
|
146109
146183
|
}, mockGeneratorCore);
|
|
146110
|
-
const
|
|
146111
|
-
|
|
146112
|
-
|
|
146113
|
-
|
|
146114
|
-
|
|
146115
|
-
|
|
146116
|
-
|
|
146117
|
-
|
|
146118
|
-
refactorMap[refactor] = enable;
|
|
146184
|
+
const schema = (0, _codesmithApiApp.forEach)(_generatorCommon.MWANewActionSchema, (schemaItem) => {
|
|
146185
|
+
if (_generatorCommon.MWAActionFunctions.includes(schemaItem.key)) {
|
|
146186
|
+
const enable = (0, _utils.hasEnabledFunction)(schemaItem.key, _generatorCommon.MWAActionFunctionsDependencies, _generatorCommon.MWAActionFunctionsDevDependencies, {}, cwd);
|
|
146187
|
+
const {
|
|
146188
|
+
when: when8
|
|
146189
|
+
} = schemaItem;
|
|
146190
|
+
schemaItem.when = enable ? () => false : when8;
|
|
146191
|
+
}
|
|
146119
146192
|
});
|
|
146120
|
-
const ans = await appAPI.
|
|
146121
|
-
funcMap,
|
|
146122
|
-
refactorMap
|
|
146123
|
-
}));
|
|
146193
|
+
const ans = await appAPI.getInputBySchema(schema, UserConfig);
|
|
146124
146194
|
const actionType = ans.actionType;
|
|
146125
|
-
const
|
|
146126
|
-
const generator = (0, _utils.getGeneratorPath)(_generatorCommon.MWANewActionGenerators[actionType][
|
|
146195
|
+
const action3 = ans[actionType];
|
|
146196
|
+
const generator = (0, _utils.getGeneratorPath)(_generatorCommon.MWANewActionGenerators[actionType][action3], distTag);
|
|
146127
146197
|
if (!generator) {
|
|
146128
146198
|
throw new Error(`no valid option`);
|
|
146129
146199
|
}
|
|
@@ -146132,8 +146202,8 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146132
146202
|
registry: registry2
|
|
146133
146203
|
});
|
|
146134
146204
|
};
|
|
146135
|
-
const devDependency = _generatorCommon.MWAActionFunctionsDevDependencies[
|
|
146136
|
-
const dependency = _generatorCommon.MWAActionFunctionsDependencies[
|
|
146205
|
+
const devDependency = _generatorCommon.MWAActionFunctionsDevDependencies[action3];
|
|
146206
|
+
const dependency = _generatorCommon.MWAActionFunctionsDependencies[action3];
|
|
146137
146207
|
const finalConfig = (0, _lodash.merge)(UserConfig, ans, {
|
|
146138
146208
|
locale: UserConfig.locale || locale,
|
|
146139
146209
|
packageManager: UserConfig.packageManager || await (0, _generatorUtils.getPackageManager)(cwd)
|
|
@@ -146144,7 +146214,7 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146144
146214
|
dependencies: dependency ? {
|
|
146145
146215
|
[dependency]: `${await getMwaPluginVersion(dependency)}`
|
|
146146
146216
|
} : {},
|
|
146147
|
-
appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[
|
|
146217
|
+
appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[action3]
|
|
146148
146218
|
});
|
|
146149
146219
|
const task = [{
|
|
146150
146220
|
name: generator,
|
|
@@ -146172,35 +146242,6 @@ var require_module = __commonJSMin((exports) => {
|
|
|
146172
146242
|
var _generatorCommon = (init_treeshaking5(), __toCommonJS2(treeshaking_exports5));
|
|
146173
146243
|
var _generatorUtils = require_node9();
|
|
146174
146244
|
var _utils = require_utils15();
|
|
146175
|
-
function ownKeys2(object, enumerableOnly) {
|
|
146176
|
-
var keys = Object.keys(object);
|
|
146177
|
-
if (Object.getOwnPropertySymbols) {
|
|
146178
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
146179
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
146180
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
146181
|
-
})), keys.push.apply(keys, symbols);
|
|
146182
|
-
}
|
|
146183
|
-
return keys;
|
|
146184
|
-
}
|
|
146185
|
-
function _objectSpread(target) {
|
|
146186
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
146187
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
146188
|
-
i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
|
|
146189
|
-
_defineProperty2(target, key, source[key]);
|
|
146190
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
|
|
146191
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
146192
|
-
});
|
|
146193
|
-
}
|
|
146194
|
-
return target;
|
|
146195
|
-
}
|
|
146196
|
-
function _defineProperty2(obj, key, value) {
|
|
146197
|
-
if (key in obj) {
|
|
146198
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
146199
|
-
} else {
|
|
146200
|
-
obj[key] = value;
|
|
146201
|
-
}
|
|
146202
|
-
return obj;
|
|
146203
|
-
}
|
|
146204
146245
|
var ModuleNewAction2 = async (options3) => {
|
|
146205
146246
|
const {
|
|
146206
146247
|
locale = "zh",
|
|
@@ -146238,30 +146279,32 @@ var require_module = __commonJSMin((exports) => {
|
|
|
146238
146279
|
current: null
|
|
146239
146280
|
}, mockGeneratorCore);
|
|
146240
146281
|
let hasOption = false;
|
|
146241
|
-
const
|
|
146242
|
-
|
|
146243
|
-
|
|
146244
|
-
|
|
146245
|
-
|
|
146246
|
-
|
|
146282
|
+
const schema = (0, _codesmithApiApp.forEach)(_generatorCommon.ModuleNewActionSchema, (schemaItem) => {
|
|
146283
|
+
if (_generatorCommon.ModuleActionFunctions.includes(schemaItem.key)) {
|
|
146284
|
+
const enable = (0, _utils.hasEnabledFunction)(schemaItem.key, _generatorCommon.ModuleActionFunctionsDependencies, _generatorCommon.ModuleActionFunctionsDevDependencies, _generatorCommon.ModuleActionFunctionsPeerDependencies, cwd);
|
|
146285
|
+
const {
|
|
146286
|
+
when: when8
|
|
146287
|
+
} = schemaItem;
|
|
146288
|
+
schemaItem.when = enable ? () => false : when8;
|
|
146289
|
+
if (!enable) {
|
|
146290
|
+
hasOption = true;
|
|
146291
|
+
}
|
|
146247
146292
|
}
|
|
146248
146293
|
});
|
|
146249
146294
|
if (!hasOption) {
|
|
146250
146295
|
smith.logger.warn("no option can be enabled");
|
|
146251
146296
|
process.exit(1);
|
|
146252
146297
|
}
|
|
146253
|
-
const ans = await appAPI.
|
|
146254
|
-
funcMap
|
|
146255
|
-
}));
|
|
146298
|
+
const ans = await appAPI.getInputBySchema(schema, UserConfig);
|
|
146256
146299
|
const actionType = ans.actionType;
|
|
146257
|
-
const
|
|
146258
|
-
const generator = (0, _utils.getGeneratorPath)(_generatorCommon.ModuleNewActionGenerators[actionType][
|
|
146300
|
+
const action3 = ans[actionType];
|
|
146301
|
+
const generator = (0, _utils.getGeneratorPath)(_generatorCommon.ModuleNewActionGenerators[actionType][action3], distTag);
|
|
146259
146302
|
if (!generator) {
|
|
146260
146303
|
throw new Error(`no valid option`);
|
|
146261
146304
|
}
|
|
146262
|
-
const devDependency = _generatorCommon.ModuleActionFunctionsDevDependencies[
|
|
146263
|
-
const dependency = _generatorCommon.ModuleActionFunctionsDependencies[
|
|
146264
|
-
const peerDependency = _generatorCommon.ModuleActionFunctionsPeerDependencies[
|
|
146305
|
+
const devDependency = _generatorCommon.ModuleActionFunctionsDevDependencies[action3];
|
|
146306
|
+
const dependency = _generatorCommon.ModuleActionFunctionsDependencies[action3];
|
|
146307
|
+
const peerDependency = _generatorCommon.ModuleActionFunctionsPeerDependencies[action3];
|
|
146265
146308
|
const getModulePluginVersion = (packageName) => {
|
|
146266
146309
|
return (0, _generatorUtils.getModernPluginVersion)(_generatorCommon.Solution.Module, packageName, {
|
|
146267
146310
|
registry: registry2
|
|
@@ -147111,32 +147154,36 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
|
147111
147154
|
}]);
|
|
147112
147155
|
return PluginGitAPI2;
|
|
147113
147156
|
}();
|
|
147157
|
+
init_objectSpread2();
|
|
147114
147158
|
init_classCallCheck();
|
|
147115
147159
|
init_createClass();
|
|
147116
147160
|
init_defineProperty();
|
|
147117
147161
|
var import_lodash6 = __toESM2(require_lodash2());
|
|
147162
|
+
var InputType;
|
|
147163
|
+
(function(InputType2) {
|
|
147164
|
+
InputType2["Input"] = "input";
|
|
147165
|
+
InputType2["Radio"] = "radio";
|
|
147166
|
+
InputType2["Checkbox"] = "checkbox";
|
|
147167
|
+
})(InputType || (InputType = {}));
|
|
147118
147168
|
var PluginInputContext = /* @__PURE__ */ function() {
|
|
147119
|
-
function PluginInputContext2(
|
|
147169
|
+
function PluginInputContext2(inputs) {
|
|
147120
147170
|
_classCallCheck(this, PluginInputContext2);
|
|
147121
147171
|
_defineProperty(this, "inputValue", {});
|
|
147122
147172
|
_defineProperty(this, "defaultConfig", {});
|
|
147123
|
-
_defineProperty(this, "
|
|
147124
|
-
_defineProperty(this, "solutionSchema", {});
|
|
147173
|
+
_defineProperty(this, "inputs", []);
|
|
147125
147174
|
_defineProperty(this, "extendInputMap", {});
|
|
147126
|
-
this
|
|
147175
|
+
_defineProperty(this, "extendOptionMap", {});
|
|
147176
|
+
this.inputs = inputs;
|
|
147127
147177
|
}
|
|
147128
147178
|
_createClass(PluginInputContext2, [{
|
|
147129
|
-
key: "prepare",
|
|
147130
|
-
value: function prepare(inputData) {
|
|
147131
|
-
this.solutionSchema = this.solutionSchemaFunc(inputData).properties;
|
|
147132
|
-
}
|
|
147133
|
-
}, {
|
|
147134
147179
|
key: "context",
|
|
147135
147180
|
get: function get4() {
|
|
147136
147181
|
return {
|
|
147137
147182
|
addInputBefore: this.addInputBefore.bind(this),
|
|
147138
147183
|
addInputAfter: this.addInputAfter.bind(this),
|
|
147139
147184
|
setInput: this.setInput.bind(this),
|
|
147185
|
+
addOptionBefore: this.addOptionBefore.bind(this),
|
|
147186
|
+
addOptionAfter: this.addOptionAfter.bind(this),
|
|
147140
147187
|
setInputValue: this.setInputValue.bind(this),
|
|
147141
147188
|
setDefaultConfig: this.setDefualtConfig.bind(this)
|
|
147142
147189
|
};
|
|
@@ -147144,80 +147191,169 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
|
147144
147191
|
}, {
|
|
147145
147192
|
key: "validateInputKey",
|
|
147146
147193
|
value: function validateInputKey(inputKey) {
|
|
147147
|
-
if (!this.
|
|
147194
|
+
if (!this.inputs.find(function(item) {
|
|
147195
|
+
return item.key === inputKey;
|
|
147196
|
+
})) {
|
|
147148
147197
|
throw new Error("the input key ".concat(inputKey, " not found"));
|
|
147149
147198
|
}
|
|
147150
147199
|
}
|
|
147151
147200
|
}, {
|
|
147152
147201
|
key: "validateInput",
|
|
147153
|
-
value: function validateInput(
|
|
147202
|
+
value: function validateInput(input) {
|
|
147154
147203
|
var _this = this;
|
|
147155
|
-
if (this.
|
|
147156
|
-
|
|
147204
|
+
if (this.inputs.find(function(item) {
|
|
147205
|
+
return item.key === input.key;
|
|
147206
|
+
})) {
|
|
147207
|
+
throw new Error("the input key ".concat(input.key, " already exists"));
|
|
147157
147208
|
}
|
|
147158
147209
|
Object.keys(this.extendInputMap).forEach(function(key) {
|
|
147159
|
-
if (_this.extendInputMap[key].before
|
|
147160
|
-
|
|
147210
|
+
if (_this.extendInputMap[key].before.find(function(item) {
|
|
147211
|
+
return item.key === input.key;
|
|
147212
|
+
}) || _this.extendInputMap[key].after.find(function(item) {
|
|
147213
|
+
return item.key === input.key;
|
|
147214
|
+
})) {
|
|
147215
|
+
throw new Error("the input key ".concat(input.key, " is already added"));
|
|
147216
|
+
}
|
|
147217
|
+
});
|
|
147218
|
+
}
|
|
147219
|
+
}, {
|
|
147220
|
+
key: "validateOption",
|
|
147221
|
+
value: function validateOption(key, option) {
|
|
147222
|
+
var _input$items, _this2 = this;
|
|
147223
|
+
var input = this.inputs.find(function(item) {
|
|
147224
|
+
return item.key === key;
|
|
147225
|
+
});
|
|
147226
|
+
if (input && (_input$items = input.items) !== null && _input$items !== void 0 && _input$items.find(function(item) {
|
|
147227
|
+
return item.key === option.key;
|
|
147228
|
+
})) {
|
|
147229
|
+
throw new Error("the option key ".concat(option.key, " already exists"));
|
|
147230
|
+
}
|
|
147231
|
+
Object.keys(this.extendInputMap).forEach(function(inputKey) {
|
|
147232
|
+
var _beforeInput$options, _afterInput$options;
|
|
147233
|
+
var beforeInput = _this2.extendInputMap[inputKey].before.find(function(item) {
|
|
147234
|
+
return item.key === key;
|
|
147235
|
+
});
|
|
147236
|
+
var afterInput = _this2.extendInputMap[inputKey].after.find(function(item) {
|
|
147237
|
+
return item.key === key;
|
|
147238
|
+
});
|
|
147239
|
+
if (beforeInput && (_beforeInput$options = beforeInput.options) !== null && _beforeInput$options !== void 0 && _beforeInput$options.find(function(item) {
|
|
147240
|
+
return item.key === option.key;
|
|
147241
|
+
}) || afterInput && (_afterInput$options = afterInput.options) !== null && _afterInput$options !== void 0 && _afterInput$options.find(function(item) {
|
|
147242
|
+
return item.key === option.key;
|
|
147243
|
+
})) {
|
|
147244
|
+
throw new Error("the option key ".concat(option.key, " is already added"));
|
|
147161
147245
|
}
|
|
147162
147246
|
});
|
|
147163
147247
|
}
|
|
147248
|
+
}, {
|
|
147249
|
+
key: "validateOptionKey",
|
|
147250
|
+
value: function validateOptionKey(key, optionKey) {
|
|
147251
|
+
var _input$items2, _this3 = this;
|
|
147252
|
+
var input = this.inputs.find(function(item) {
|
|
147253
|
+
return item.key === key;
|
|
147254
|
+
});
|
|
147255
|
+
if (input && !((_input$items2 = input.items) !== null && _input$items2 !== void 0 && _input$items2.find(function(item) {
|
|
147256
|
+
return item.key === optionKey;
|
|
147257
|
+
}))) {
|
|
147258
|
+
throw new Error("the option key ".concat(optionKey, " is not found"));
|
|
147259
|
+
}
|
|
147260
|
+
var foundFlag = false;
|
|
147261
|
+
Object.keys(this.extendInputMap).forEach(function(inputKey) {
|
|
147262
|
+
var _beforeInput$options2, _afterInput$options2;
|
|
147263
|
+
var beforeInput = _this3.extendInputMap[inputKey].before.find(function(item) {
|
|
147264
|
+
return item.key === key;
|
|
147265
|
+
});
|
|
147266
|
+
var afterInput = _this3.extendInputMap[inputKey].after.find(function(item) {
|
|
147267
|
+
return item.key === key;
|
|
147268
|
+
});
|
|
147269
|
+
if (beforeInput || afterInput) {
|
|
147270
|
+
foundFlag = true;
|
|
147271
|
+
}
|
|
147272
|
+
if (beforeInput && !((_beforeInput$options2 = beforeInput.options) !== null && _beforeInput$options2 !== void 0 && _beforeInput$options2.find(function(item) {
|
|
147273
|
+
return item.key === optionKey;
|
|
147274
|
+
})) || afterInput && !((_afterInput$options2 = afterInput.options) !== null && _afterInput$options2 !== void 0 && _afterInput$options2.find(function(item) {
|
|
147275
|
+
return item.key === optionKey;
|
|
147276
|
+
}))) {
|
|
147277
|
+
throw new Error("the option key ".concat(optionKey, " is not found"));
|
|
147278
|
+
}
|
|
147279
|
+
});
|
|
147280
|
+
if (!input && !foundFlag) {
|
|
147281
|
+
throw new Error("the input key ".concat(key, " is not found"));
|
|
147282
|
+
}
|
|
147283
|
+
}
|
|
147164
147284
|
}, {
|
|
147165
147285
|
key: "addInputBefore",
|
|
147166
147286
|
value: function addInputBefore(key, input) {
|
|
147167
147287
|
this.validateInputKey(key);
|
|
147168
|
-
|
|
147169
|
-
|
|
147170
|
-
|
|
147171
|
-
|
|
147172
|
-
|
|
147173
|
-
|
|
147174
|
-
|
|
147175
|
-
|
|
147176
|
-
before: _defineProperty({}, inputKey, properties[inputKey]),
|
|
147177
|
-
after: {}
|
|
147178
|
-
};
|
|
147179
|
-
}
|
|
147288
|
+
this.validateInput(input);
|
|
147289
|
+
if (this.extendInputMap[key]) {
|
|
147290
|
+
this.extendInputMap[key].before.push(input);
|
|
147291
|
+
} else {
|
|
147292
|
+
this.extendInputMap[key] = {
|
|
147293
|
+
before: [input],
|
|
147294
|
+
after: []
|
|
147295
|
+
};
|
|
147180
147296
|
}
|
|
147181
147297
|
}
|
|
147182
147298
|
}, {
|
|
147183
147299
|
key: "addInputAfter",
|
|
147184
147300
|
value: function addInputAfter(key, input) {
|
|
147185
147301
|
this.validateInputKey(key);
|
|
147186
|
-
|
|
147187
|
-
|
|
147188
|
-
|
|
147189
|
-
|
|
147190
|
-
|
|
147191
|
-
|
|
147192
|
-
|
|
147193
|
-
|
|
147194
|
-
before: {},
|
|
147195
|
-
after: _defineProperty({}, inputKey, properties[inputKey])
|
|
147196
|
-
};
|
|
147197
|
-
}
|
|
147302
|
+
this.validateInput(input);
|
|
147303
|
+
if (this.extendInputMap[key]) {
|
|
147304
|
+
this.extendInputMap[key].after.push(input);
|
|
147305
|
+
} else {
|
|
147306
|
+
this.extendInputMap[key] = {
|
|
147307
|
+
before: [],
|
|
147308
|
+
after: [input]
|
|
147309
|
+
};
|
|
147198
147310
|
}
|
|
147199
147311
|
}
|
|
147200
147312
|
}, {
|
|
147201
147313
|
key: "setInput",
|
|
147202
147314
|
value: function setInput(key, field, value) {
|
|
147203
|
-
var
|
|
147204
|
-
|
|
147205
|
-
|
|
147315
|
+
var index = this.inputs.findIndex(function(item) {
|
|
147316
|
+
return item.key === key;
|
|
147317
|
+
});
|
|
147318
|
+
if (index !== -1) {
|
|
147319
|
+
var originInput = this.transformSchema(this.inputs[index]);
|
|
147320
|
+
var _input = this.getFinalInput(originInput);
|
|
147321
|
+
var targetValue = (0, import_lodash6.isFunction)(value) ? value(_input) : value;
|
|
147322
|
+
this.inputs[index] = this.transformInput(_objectSpread2(_objectSpread2({}, originInput), {}, _defineProperty({}, field, targetValue)));
|
|
147323
|
+
if (field === "options") {
|
|
147324
|
+
this.resetExtendOptionMap(key);
|
|
147325
|
+
}
|
|
147206
147326
|
return;
|
|
147207
147327
|
}
|
|
147208
147328
|
var findFlag = false;
|
|
147209
|
-
for (var
|
|
147210
|
-
var inputKey = _Object$
|
|
147211
|
-
var
|
|
147212
|
-
|
|
147329
|
+
for (var _i = 0, _Object$keys = Object.keys(this.extendInputMap); _i < _Object$keys.length; _i++) {
|
|
147330
|
+
var inputKey = _Object$keys[_i];
|
|
147331
|
+
var beforeIndex = this.extendInputMap[inputKey].before.findIndex(function(item) {
|
|
147332
|
+
return item.key === key;
|
|
147333
|
+
});
|
|
147334
|
+
var afterIndex = this.extendInputMap[inputKey].after.findIndex(function(item) {
|
|
147335
|
+
return item.key === key;
|
|
147336
|
+
});
|
|
147337
|
+
if (beforeIndex !== -1) {
|
|
147213
147338
|
findFlag = true;
|
|
147214
|
-
|
|
147339
|
+
var originBeforeInput = this.extendInputMap[inputKey].before[beforeIndex];
|
|
147340
|
+
var _input2 = this.getFinalInput(originBeforeInput);
|
|
147341
|
+
var _targetValue = (0, import_lodash6.isFunction)(value) ? value(_input2) : value;
|
|
147342
|
+
this.extendInputMap[inputKey].before[beforeIndex] = _objectSpread2(_objectSpread2({}, originBeforeInput), {}, _defineProperty({}, field, _targetValue));
|
|
147343
|
+
if (field === "options") {
|
|
147344
|
+
this.resetExtendOptionMap(key);
|
|
147345
|
+
}
|
|
147215
147346
|
break;
|
|
147216
147347
|
}
|
|
147217
|
-
|
|
147218
|
-
if (afterSchema) {
|
|
147348
|
+
if (afterIndex !== -1) {
|
|
147219
147349
|
findFlag = true;
|
|
147220
|
-
|
|
147350
|
+
var originAfterInput = this.extendInputMap[inputKey].after[afterIndex];
|
|
147351
|
+
var _input3 = this.getFinalInput(originAfterInput);
|
|
147352
|
+
var _targetValue2 = (0, import_lodash6.isFunction)(value) ? value(_input3) : value;
|
|
147353
|
+
this.extendInputMap[inputKey].after[afterIndex] = _objectSpread2(_objectSpread2({}, originAfterInput), {}, _defineProperty({}, field, _targetValue2));
|
|
147354
|
+
if (field === "options") {
|
|
147355
|
+
this.resetExtendOptionMap(key);
|
|
147356
|
+
}
|
|
147221
147357
|
break;
|
|
147222
147358
|
}
|
|
147223
147359
|
}
|
|
@@ -147225,26 +147361,135 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
|
147225
147361
|
throw new Error("the input ".concat(key, " not found"));
|
|
147226
147362
|
}
|
|
147227
147363
|
}
|
|
147364
|
+
}, {
|
|
147365
|
+
key: "transformInput",
|
|
147366
|
+
value: function transformInput(input) {
|
|
147367
|
+
var _input$options, _input$options2;
|
|
147368
|
+
var valueOption = (_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.find(function(option) {
|
|
147369
|
+
return option.isDefault;
|
|
147370
|
+
});
|
|
147371
|
+
return {
|
|
147372
|
+
key: input.key,
|
|
147373
|
+
label: input.name,
|
|
147374
|
+
type: ["string"],
|
|
147375
|
+
mutualExclusion: input.type === InputType.Radio,
|
|
147376
|
+
coexit: input.type === InputType.Checkbox,
|
|
147377
|
+
items: (_input$options2 = input.options) === null || _input$options2 === void 0 ? void 0 : _input$options2.map(function(option) {
|
|
147378
|
+
return {
|
|
147379
|
+
key: option.key,
|
|
147380
|
+
label: option.name,
|
|
147381
|
+
when: option.when
|
|
147382
|
+
};
|
|
147383
|
+
}),
|
|
147384
|
+
when: input.when,
|
|
147385
|
+
state: {
|
|
147386
|
+
value: valueOption ? valueOption.key : void 0
|
|
147387
|
+
},
|
|
147388
|
+
validate: input.validate
|
|
147389
|
+
};
|
|
147390
|
+
}
|
|
147391
|
+
}, {
|
|
147392
|
+
key: "transformSchema",
|
|
147393
|
+
value: function transformSchema(schema) {
|
|
147394
|
+
var _schema$items;
|
|
147395
|
+
return {
|
|
147396
|
+
key: schema.key,
|
|
147397
|
+
name: schema.label,
|
|
147398
|
+
type: schema.mutualExclusion ? InputType.Radio : schema.coexit ? InputType.Checkbox : InputType.Input,
|
|
147399
|
+
options: (_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.map(function(item) {
|
|
147400
|
+
var _schema$state;
|
|
147401
|
+
return {
|
|
147402
|
+
key: item.key,
|
|
147403
|
+
name: item.label,
|
|
147404
|
+
isDefault: item.key === ((_schema$state = schema.state) === null || _schema$state === void 0 ? void 0 : _schema$state.value)
|
|
147405
|
+
};
|
|
147406
|
+
}),
|
|
147407
|
+
when: schema.when,
|
|
147408
|
+
validate: schema.validate
|
|
147409
|
+
};
|
|
147410
|
+
}
|
|
147411
|
+
}, {
|
|
147412
|
+
key: "getFinalInput",
|
|
147413
|
+
value: function getFinalInput(input) {
|
|
147414
|
+
var _this4 = this;
|
|
147415
|
+
var extendOption = this.extendOptionMap[input.key];
|
|
147416
|
+
if (extendOption) {
|
|
147417
|
+
var _input$options3;
|
|
147418
|
+
var result = [];
|
|
147419
|
+
(_input$options3 = input.options) === null || _input$options3 === void 0 ? void 0 : _input$options3.forEach(function(option) {
|
|
147420
|
+
var _ref = extendOption[option.key] || {
|
|
147421
|
+
before: [],
|
|
147422
|
+
after: []
|
|
147423
|
+
}, before = _ref.before, after = _ref.after;
|
|
147424
|
+
before.forEach(function(item) {
|
|
147425
|
+
return result.push(item);
|
|
147426
|
+
});
|
|
147427
|
+
result.push(option);
|
|
147428
|
+
after.forEach(function(item) {
|
|
147429
|
+
return result.push(item);
|
|
147430
|
+
});
|
|
147431
|
+
_this4.extendOptionMap[input.key][option.key] = {
|
|
147432
|
+
before: [],
|
|
147433
|
+
after: []
|
|
147434
|
+
};
|
|
147435
|
+
});
|
|
147436
|
+
input.options = result;
|
|
147437
|
+
}
|
|
147438
|
+
return input;
|
|
147439
|
+
}
|
|
147228
147440
|
}, {
|
|
147229
147441
|
key: "getFinalInputs",
|
|
147230
147442
|
value: function getFinalInputs() {
|
|
147231
|
-
var
|
|
147232
|
-
var result =
|
|
147233
|
-
|
|
147234
|
-
var
|
|
147235
|
-
before:
|
|
147236
|
-
after:
|
|
147237
|
-
}, before =
|
|
147238
|
-
|
|
147239
|
-
return result
|
|
147240
|
-
});
|
|
147241
|
-
result
|
|
147242
|
-
|
|
147243
|
-
return result
|
|
147443
|
+
var _this5 = this;
|
|
147444
|
+
var result = [];
|
|
147445
|
+
this.inputs.forEach(function(input) {
|
|
147446
|
+
var _ref2 = _this5.extendInputMap[input.key] || {
|
|
147447
|
+
before: [],
|
|
147448
|
+
after: []
|
|
147449
|
+
}, before = _ref2.before, after = _ref2.after;
|
|
147450
|
+
before.forEach(function(item) {
|
|
147451
|
+
return result.push(_this5.transformInput(_this5.getFinalInput(item)));
|
|
147452
|
+
});
|
|
147453
|
+
result.push(_this5.transformInput(_this5.getFinalInput(_this5.transformSchema(input))));
|
|
147454
|
+
after.forEach(function(item) {
|
|
147455
|
+
return result.push(_this5.transformInput(_this5.getFinalInput(item)));
|
|
147244
147456
|
});
|
|
147245
147457
|
});
|
|
147246
147458
|
return result;
|
|
147247
147459
|
}
|
|
147460
|
+
}, {
|
|
147461
|
+
key: "initExtendOptionMap",
|
|
147462
|
+
value: function initExtendOptionMap(key, optionKey) {
|
|
147463
|
+
this.extendOptionMap[key] = this.extendOptionMap[key] || _defineProperty({}, key, _defineProperty({}, optionKey, {
|
|
147464
|
+
before: [],
|
|
147465
|
+
after: []
|
|
147466
|
+
}));
|
|
147467
|
+
this.extendOptionMap[key][optionKey] = this.extendOptionMap[key][optionKey] || {
|
|
147468
|
+
before: [],
|
|
147469
|
+
after: []
|
|
147470
|
+
};
|
|
147471
|
+
}
|
|
147472
|
+
}, {
|
|
147473
|
+
key: "resetExtendOptionMap",
|
|
147474
|
+
value: function resetExtendOptionMap(key) {
|
|
147475
|
+
this.extendOptionMap[key] = {};
|
|
147476
|
+
}
|
|
147477
|
+
}, {
|
|
147478
|
+
key: "addOptionBefore",
|
|
147479
|
+
value: function addOptionBefore(key, optionKey, option) {
|
|
147480
|
+
this.validateOptionKey(key, optionKey);
|
|
147481
|
+
this.validateOption(key, option);
|
|
147482
|
+
this.initExtendOptionMap(key, optionKey);
|
|
147483
|
+
this.extendOptionMap[key][optionKey].before.push(option);
|
|
147484
|
+
}
|
|
147485
|
+
}, {
|
|
147486
|
+
key: "addOptionAfter",
|
|
147487
|
+
value: function addOptionAfter(key, optionKey, option) {
|
|
147488
|
+
this.validateOptionKey(key, optionKey);
|
|
147489
|
+
this.validateOption(key, option);
|
|
147490
|
+
this.initExtendOptionMap(key, optionKey);
|
|
147491
|
+
this.extendOptionMap[key][optionKey].after.push(option);
|
|
147492
|
+
}
|
|
147248
147493
|
}, {
|
|
147249
147494
|
key: "setInputValue",
|
|
147250
147495
|
value: function setInputValue(value) {
|
|
@@ -147512,7 +147757,7 @@ var LifeCycle2;
|
|
|
147512
147757
|
LifeCycle3["AfterForged"] = "afterForged";
|
|
147513
147758
|
})(LifeCycle2 || (LifeCycle2 = {}));
|
|
147514
147759
|
var PluginContext = /* @__PURE__ */ function() {
|
|
147515
|
-
function PluginContext2(
|
|
147760
|
+
function PluginContext2(inputs, locale) {
|
|
147516
147761
|
var _defineProperty2;
|
|
147517
147762
|
_classCallCheck(this, PluginContext2);
|
|
147518
147763
|
_defineProperty(this, "generator", void 0);
|
|
@@ -147525,7 +147770,7 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
|
147525
147770
|
_defineProperty(this, "lifeCycleFuncMap", (_defineProperty2 = {}, _defineProperty(_defineProperty2, LifeCycle2.OnForged, function() {
|
|
147526
147771
|
}), _defineProperty(_defineProperty2, LifeCycle2.AfterForged, function() {
|
|
147527
147772
|
}), _defineProperty2));
|
|
147528
|
-
this.inputContext = new PluginInputContext(
|
|
147773
|
+
this.inputContext = new PluginInputContext(inputs);
|
|
147529
147774
|
this.gitAPI = new PluginGitAPI();
|
|
147530
147775
|
this.fileAPI = new PluginFileAPI();
|
|
147531
147776
|
this.locale = locale;
|
|
@@ -147821,13 +148066,13 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
|
147821
148066
|
}()
|
|
147822
148067
|
}, {
|
|
147823
148068
|
key: "getInputSchema",
|
|
147824
|
-
value: function getInputSchema() {
|
|
147825
|
-
var
|
|
148069
|
+
value: function getInputSchema(solution) {
|
|
148070
|
+
var items5 = [];
|
|
147826
148071
|
var _iterator = _createForOfIteratorHelper(this.plugins), _step;
|
|
147827
148072
|
try {
|
|
147828
148073
|
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
147829
148074
|
var info = _step.value;
|
|
147830
|
-
|
|
148075
|
+
items5 = [].concat(_toConsumableArray(items5), _toConsumableArray(info.context.inputContext.getFinalInputs()));
|
|
147831
148076
|
}
|
|
147832
148077
|
} catch (err) {
|
|
147833
148078
|
_iterator.e(err);
|
|
@@ -147835,8 +148080,9 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
|
147835
148080
|
_iterator.f();
|
|
147836
148081
|
}
|
|
147837
148082
|
return {
|
|
147838
|
-
|
|
147839
|
-
|
|
148083
|
+
key: "".concat(solution, "_plugin_schema"),
|
|
148084
|
+
isObject: true,
|
|
148085
|
+
items: items5
|
|
147840
148086
|
};
|
|
147841
148087
|
}
|
|
147842
148088
|
}, {
|
|
@@ -147904,7 +148150,6 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
|
147904
148150
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
|
|
147905
148151
|
info = _step4.value;
|
|
147906
148152
|
info.context = new PluginContext(SolutionSchemas[solution], inputData.locale);
|
|
147907
|
-
info.context.inputContext.prepare(inputData);
|
|
147908
148153
|
info.module(info.context.context);
|
|
147909
148154
|
}
|
|
147910
148155
|
} catch (err) {
|
|
@@ -148074,11 +148319,10 @@ var getNeedRunPlugin = (context, generatorPlugin) => {
|
|
|
148074
148319
|
};
|
|
148075
148320
|
var handleTemplateFile = async (context, generator, appApi, generatorPlugin) => {
|
|
148076
148321
|
const { isMonorepo } = context.config;
|
|
148077
|
-
const { solution } = await appApi.
|
|
148322
|
+
const { solution } = await appApi.getInputBySchema(isMonorepo ? MonorepoNewActionSchema : SolutionSchema, {
|
|
148078
148323
|
...context.config,
|
|
148079
148324
|
customPlugin: generatorPlugin?.customPlugin
|
|
148080
148325
|
});
|
|
148081
|
-
await appApi.getInputBySchemaFunc(getScenesSchema, context.config);
|
|
148082
148326
|
const solutionGenerator = solution === "custom" ? BaseGenerator : isMonorepo ? SubSolutionGenerator[solution] : SolutionGenerator[solution];
|
|
148083
148327
|
if (!solution || !solutionGenerator) {
|
|
148084
148328
|
generator.logger.error("solution is not valid ");
|