@modern-js/router-v5-generator 3.0.5 → 3.0.6
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/README.md +14 -18
- package/dist/index.js +158 -173
- package/package.json +8 -8
- package/src/index.ts +45 -12
package/README.md
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
|
|
4
3
|
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Modern.js</h1>
|
|
6
|
+
|
|
5
7
|
<p align="center">
|
|
6
|
-
|
|
7
|
-
<br/>
|
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
|
9
|
-
modernjs.dev
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
|
8
|
+
A Progressive React Framework for modern web development.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
|
11
|
+
## Getting Started
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Documentation
|
|
23
16
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
|
18
|
+
- [中文文档](https://modernjs.dev)
|
|
27
19
|
|
|
28
20
|
## Contributing
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
package/dist/index.js
CHANGED
|
@@ -70780,12 +70780,12 @@ var require_figures = __commonJS({
|
|
|
70780
70780
|
var require_separator = __commonJS({
|
|
70781
70781
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
|
70782
70782
|
"use strict";
|
|
70783
|
-
var
|
|
70783
|
+
var chalk2 = require_chalk();
|
|
70784
70784
|
var figures = require_figures();
|
|
70785
70785
|
var Separator = class {
|
|
70786
70786
|
constructor(line) {
|
|
70787
70787
|
this.type = "separator";
|
|
70788
|
-
this.line =
|
|
70788
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
|
70789
70789
|
}
|
|
70790
70790
|
toString() {
|
|
70791
70791
|
return this.line;
|
|
@@ -90203,7 +90203,7 @@ var require_ora2 = __commonJS({
|
|
|
90203
90203
|
"../../../../node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js"(exports, module2) {
|
|
90204
90204
|
"use strict";
|
|
90205
90205
|
var readline = require("readline");
|
|
90206
|
-
var
|
|
90206
|
+
var chalk2 = require_chalk();
|
|
90207
90207
|
var cliCursor = require_cli_cursor();
|
|
90208
90208
|
var cliSpinners = require_cli_spinners();
|
|
90209
90209
|
var logSymbols = require_browser2();
|
|
@@ -90399,7 +90399,7 @@ var require_ora2 = __commonJS({
|
|
|
90399
90399
|
const { frames } = this.spinner;
|
|
90400
90400
|
let frame = frames[this.frameIndex];
|
|
90401
90401
|
if (this.color) {
|
|
90402
|
-
frame =
|
|
90402
|
+
frame = chalk2[this.color](frame);
|
|
90403
90403
|
}
|
|
90404
90404
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
90405
90405
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
|
@@ -90648,7 +90648,7 @@ var require_base3 = __commonJS({
|
|
|
90648
90648
|
defaults: require_defaults2(),
|
|
90649
90649
|
clone: require_clone()
|
|
90650
90650
|
};
|
|
90651
|
-
var
|
|
90651
|
+
var chalk2 = require_chalk();
|
|
90652
90652
|
var runAsync = require_run_async();
|
|
90653
90653
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
|
90654
90654
|
var Choices = require_choices();
|
|
@@ -90666,7 +90666,7 @@ var require_base3 = __commonJS({
|
|
|
90666
90666
|
filteringText: "",
|
|
90667
90667
|
when: () => true,
|
|
90668
90668
|
suffix: "",
|
|
90669
|
-
prefix:
|
|
90669
|
+
prefix: chalk2.green("?")
|
|
90670
90670
|
});
|
|
90671
90671
|
if (!this.opt.name) {
|
|
90672
90672
|
this.throwParamError("name");
|
|
@@ -90739,12 +90739,12 @@ var require_base3 = __commonJS({
|
|
|
90739
90739
|
return value;
|
|
90740
90740
|
}
|
|
90741
90741
|
getQuestion() {
|
|
90742
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
|
90742
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
|
90743
90743
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
|
90744
90744
|
if (this.opt.type === "password") {
|
|
90745
|
-
message +=
|
|
90745
|
+
message += chalk2.italic.dim("[hidden] ");
|
|
90746
90746
|
} else {
|
|
90747
|
-
message +=
|
|
90747
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
|
90748
90748
|
}
|
|
90749
90749
|
}
|
|
90750
90750
|
return message;
|
|
@@ -90806,7 +90806,7 @@ var require_events = __commonJS({
|
|
|
90806
90806
|
var require_paginator = __commonJS({
|
|
90807
90807
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/utils/paginator.js"(exports, module2) {
|
|
90808
90808
|
"use strict";
|
|
90809
|
-
var
|
|
90809
|
+
var chalk2 = require_chalk();
|
|
90810
90810
|
var Paginator = class {
|
|
90811
90811
|
constructor(screen, options = {}) {
|
|
90812
90812
|
const { isInfinite = true } = options;
|
|
@@ -90827,7 +90827,7 @@ var require_paginator = __commonJS({
|
|
|
90827
90827
|
}
|
|
90828
90828
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
|
90829
90829
|
this.lastIndex = active;
|
|
90830
|
-
return visibleLines.join("\n") + "\n" +
|
|
90830
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
|
90831
90831
|
}
|
|
90832
90832
|
getInfiniteLines(lines, active, pageSize) {
|
|
90833
90833
|
if (this.pointer === void 0) {
|
|
@@ -90883,7 +90883,7 @@ var require_incrementListIndex = __commonJS({
|
|
|
90883
90883
|
var require_list2 = __commonJS({
|
|
90884
90884
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/list.js"(exports, module2) {
|
|
90885
90885
|
"use strict";
|
|
90886
|
-
var
|
|
90886
|
+
var chalk2 = require_chalk();
|
|
90887
90887
|
var figures = require_figures();
|
|
90888
90888
|
var cliCursor = require_cli_cursor();
|
|
90889
90889
|
var runAsync = require_run_async();
|
|
@@ -90932,10 +90932,10 @@ var require_list2 = __commonJS({
|
|
|
90932
90932
|
render() {
|
|
90933
90933
|
let message = this.getQuestion();
|
|
90934
90934
|
if (this.firstRender) {
|
|
90935
|
-
message +=
|
|
90935
|
+
message += chalk2.dim("(Use arrow keys)");
|
|
90936
90936
|
}
|
|
90937
90937
|
if (this.status === "answered") {
|
|
90938
|
-
message +=
|
|
90938
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
90939
90939
|
} else {
|
|
90940
90940
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
|
90941
90941
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -91004,7 +91004,7 @@ var require_list2 = __commonJS({
|
|
|
91004
91004
|
const isSelected = i - separatorOffset === pointer;
|
|
91005
91005
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
|
91006
91006
|
if (isSelected) {
|
|
91007
|
-
line =
|
|
91007
|
+
line = chalk2.cyan(line);
|
|
91008
91008
|
}
|
|
91009
91009
|
output2 += line + " \n";
|
|
91010
91010
|
});
|
|
@@ -91018,7 +91018,7 @@ var require_list2 = __commonJS({
|
|
|
91018
91018
|
var require_input = __commonJS({
|
|
91019
91019
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
|
91020
91020
|
"use strict";
|
|
91021
|
-
var
|
|
91021
|
+
var chalk2 = require_chalk();
|
|
91022
91022
|
var { map: map2, takeUntil } = require_operators();
|
|
91023
91023
|
var Base = require_base3();
|
|
91024
91024
|
var observe2 = require_events();
|
|
@@ -91048,10 +91048,10 @@ var require_input = __commonJS({
|
|
|
91048
91048
|
if (transformer) {
|
|
91049
91049
|
message += transformer(appendContent, this.answers, { isFinal });
|
|
91050
91050
|
} else {
|
|
91051
|
-
message += isFinal ?
|
|
91051
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
|
91052
91052
|
}
|
|
91053
91053
|
if (error) {
|
|
91054
|
-
bottomContent =
|
|
91054
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
91055
91055
|
}
|
|
91056
91056
|
this.screen.render(message, bottomContent);
|
|
91057
91057
|
}
|
|
@@ -91107,7 +91107,7 @@ var require_number = __commonJS({
|
|
|
91107
91107
|
var require_confirm = __commonJS({
|
|
91108
91108
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/confirm.js"(exports, module2) {
|
|
91109
91109
|
"use strict";
|
|
91110
|
-
var
|
|
91110
|
+
var chalk2 = require_chalk();
|
|
91111
91111
|
var { take, takeUntil } = require_operators();
|
|
91112
91112
|
var Base = require_base3();
|
|
91113
91113
|
var observe2 = require_events();
|
|
@@ -91140,7 +91140,7 @@ var require_confirm = __commonJS({
|
|
|
91140
91140
|
render(answer) {
|
|
91141
91141
|
let message = this.getQuestion();
|
|
91142
91142
|
if (typeof answer === "boolean") {
|
|
91143
|
-
message +=
|
|
91143
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
|
91144
91144
|
} else {
|
|
91145
91145
|
message += this.rl.line;
|
|
91146
91146
|
}
|
|
@@ -91166,7 +91166,7 @@ var require_confirm = __commonJS({
|
|
|
91166
91166
|
var require_rawlist = __commonJS({
|
|
91167
91167
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/rawlist.js"(exports, module2) {
|
|
91168
91168
|
"use strict";
|
|
91169
|
-
var
|
|
91169
|
+
var chalk2 = require_chalk();
|
|
91170
91170
|
var { map: map2, takeUntil } = require_operators();
|
|
91171
91171
|
var Base = require_base3();
|
|
91172
91172
|
var Separator = require_separator();
|
|
@@ -91220,7 +91220,7 @@ var require_rawlist = __commonJS({
|
|
|
91220
91220
|
let message = this.getQuestion();
|
|
91221
91221
|
let bottomContent = "";
|
|
91222
91222
|
if (this.status === "answered") {
|
|
91223
|
-
message +=
|
|
91223
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
91224
91224
|
} else {
|
|
91225
91225
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
|
91226
91226
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
|
@@ -91228,7 +91228,7 @@ var require_rawlist = __commonJS({
|
|
|
91228
91228
|
}
|
|
91229
91229
|
message += this.rl.line;
|
|
91230
91230
|
if (error) {
|
|
91231
|
-
bottomContent = "\n" +
|
|
91231
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
91232
91232
|
}
|
|
91233
91233
|
this.screen.render(message, bottomContent);
|
|
91234
91234
|
}
|
|
@@ -91295,7 +91295,7 @@ var require_rawlist = __commonJS({
|
|
|
91295
91295
|
const index = i - separatorOffset;
|
|
91296
91296
|
let display = index + 1 + ") " + choice.name;
|
|
91297
91297
|
if (index === pointer) {
|
|
91298
|
-
display =
|
|
91298
|
+
display = chalk2.cyan(display);
|
|
91299
91299
|
}
|
|
91300
91300
|
output2 += display;
|
|
91301
91301
|
});
|
|
@@ -91309,7 +91309,7 @@ var require_rawlist = __commonJS({
|
|
|
91309
91309
|
var require_expand2 = __commonJS({
|
|
91310
91310
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/expand.js"(exports, module2) {
|
|
91311
91311
|
"use strict";
|
|
91312
|
-
var
|
|
91312
|
+
var chalk2 = require_chalk();
|
|
91313
91313
|
var { map: map2, takeUntil } = require_operators();
|
|
91314
91314
|
var Base = require_base3();
|
|
91315
91315
|
var Separator = require_separator();
|
|
@@ -91352,7 +91352,7 @@ var require_expand2 = __commonJS({
|
|
|
91352
91352
|
let message = this.getQuestion();
|
|
91353
91353
|
let bottomContent = "";
|
|
91354
91354
|
if (this.status === "answered") {
|
|
91355
|
-
message +=
|
|
91355
|
+
message += chalk2.cyan(this.answer);
|
|
91356
91356
|
} else if (this.status === "expanded") {
|
|
91357
91357
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
|
91358
91358
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
|
@@ -91360,10 +91360,10 @@ var require_expand2 = __commonJS({
|
|
|
91360
91360
|
}
|
|
91361
91361
|
message += this.rl.line;
|
|
91362
91362
|
if (error) {
|
|
91363
|
-
bottomContent =
|
|
91363
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
91364
91364
|
}
|
|
91365
91365
|
if (hint) {
|
|
91366
|
-
bottomContent =
|
|
91366
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
|
91367
91367
|
}
|
|
91368
91368
|
this.screen.render(message, bottomContent);
|
|
91369
91369
|
}
|
|
@@ -91387,7 +91387,7 @@ var require_expand2 = __commonJS({
|
|
|
91387
91387
|
}
|
|
91388
91388
|
let choiceStr = choice.key + ") " + choice.name;
|
|
91389
91389
|
if (this.selectedKey === choice.key) {
|
|
91390
|
-
choiceStr =
|
|
91390
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
91391
91391
|
}
|
|
91392
91392
|
output2 += choiceStr;
|
|
91393
91393
|
});
|
|
@@ -91473,7 +91473,7 @@ var require_expand2 = __commonJS({
|
|
|
91473
91473
|
}
|
|
91474
91474
|
let choiceStr = choice.key + ") " + choice.name;
|
|
91475
91475
|
if (pointer === choice.key) {
|
|
91476
|
-
choiceStr =
|
|
91476
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
91477
91477
|
}
|
|
91478
91478
|
output2 += choiceStr;
|
|
91479
91479
|
});
|
|
@@ -91487,7 +91487,7 @@ var require_expand2 = __commonJS({
|
|
|
91487
91487
|
var require_checkbox = __commonJS({
|
|
91488
91488
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/checkbox.js"(exports, module2) {
|
|
91489
91489
|
"use strict";
|
|
91490
|
-
var
|
|
91490
|
+
var chalk2 = require_chalk();
|
|
91491
91491
|
var cliCursor = require_cli_cursor();
|
|
91492
91492
|
var figures = require_figures();
|
|
91493
91493
|
var { map: map2, takeUntil } = require_operators();
|
|
@@ -91536,10 +91536,10 @@ var require_checkbox = __commonJS({
|
|
|
91536
91536
|
let message = this.getQuestion();
|
|
91537
91537
|
let bottomContent = "";
|
|
91538
91538
|
if (!this.dontShowHints) {
|
|
91539
|
-
message += "(Press " +
|
|
91539
|
+
message += "(Press " + chalk2.cyan.bold("<space>") + " to select, " + chalk2.cyan.bold("<a>") + " to toggle all, " + chalk2.cyan.bold("<i>") + " to invert selection, and " + chalk2.cyan.bold("<enter>") + " to proceed)";
|
|
91540
91540
|
}
|
|
91541
91541
|
if (this.status === "answered") {
|
|
91542
|
-
message +=
|
|
91542
|
+
message += chalk2.cyan(this.selection.join(", "));
|
|
91543
91543
|
} else {
|
|
91544
91544
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
|
91545
91545
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -91562,7 +91562,7 @@ var require_checkbox = __commonJS({
|
|
|
91562
91562
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
|
91563
91563
|
}
|
|
91564
91564
|
if (error) {
|
|
91565
|
-
bottomContent =
|
|
91565
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
91566
91566
|
}
|
|
91567
91567
|
this.screen.render(message, bottomContent);
|
|
91568
91568
|
}
|
|
@@ -91645,7 +91645,7 @@ var require_checkbox = __commonJS({
|
|
|
91645
91645
|
} else {
|
|
91646
91646
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
|
91647
91647
|
if (i - separatorOffset === pointer) {
|
|
91648
|
-
output2 +=
|
|
91648
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
|
91649
91649
|
} else {
|
|
91650
91650
|
output2 += " " + line;
|
|
91651
91651
|
}
|
|
@@ -91655,7 +91655,7 @@ var require_checkbox = __commonJS({
|
|
|
91655
91655
|
return output2.replace(/\n$/, "");
|
|
91656
91656
|
}
|
|
91657
91657
|
function getCheckbox(checked) {
|
|
91658
|
-
return checked ?
|
|
91658
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
|
91659
91659
|
}
|
|
91660
91660
|
module2.exports = CheckboxPrompt;
|
|
91661
91661
|
}
|
|
@@ -91665,7 +91665,7 @@ var require_checkbox = __commonJS({
|
|
|
91665
91665
|
var require_password = __commonJS({
|
|
91666
91666
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
|
91667
91667
|
"use strict";
|
|
91668
|
-
var
|
|
91668
|
+
var chalk2 = require_chalk();
|
|
91669
91669
|
var { map: map2, takeUntil } = require_operators();
|
|
91670
91670
|
var Base = require_base3();
|
|
91671
91671
|
var observe2 = require_events();
|
|
@@ -91698,15 +91698,15 @@ var require_password = __commonJS({
|
|
|
91698
91698
|
message += this.getMaskedValue(this.rl.line || "");
|
|
91699
91699
|
}
|
|
91700
91700
|
if (error) {
|
|
91701
|
-
bottomContent = "\n" +
|
|
91701
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
91702
91702
|
}
|
|
91703
91703
|
this.screen.render(message, bottomContent);
|
|
91704
91704
|
}
|
|
91705
91705
|
getMaskedValue(value) {
|
|
91706
91706
|
if (this.status === "answered") {
|
|
91707
|
-
return this.opt.mask ?
|
|
91707
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
|
91708
91708
|
}
|
|
91709
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
|
91709
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
|
91710
91710
|
}
|
|
91711
91711
|
getSpinningValue(value) {
|
|
91712
91712
|
return this.getMaskedValue(value);
|
|
@@ -101214,7 +101214,7 @@ var require_main = __commonJS({
|
|
|
101214
101214
|
var require_editor = __commonJS({
|
|
101215
101215
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
|
101216
101216
|
"use strict";
|
|
101217
|
-
var
|
|
101217
|
+
var chalk2 = require_chalk();
|
|
101218
101218
|
var { editAsync } = require_main();
|
|
101219
101219
|
var Base = require_base3();
|
|
101220
101220
|
var observe2 = require_events();
|
|
@@ -101237,12 +101237,12 @@ var require_editor = __commonJS({
|
|
|
101237
101237
|
let bottomContent = "";
|
|
101238
101238
|
let message = this.getQuestion();
|
|
101239
101239
|
if (this.status === "answered") {
|
|
101240
|
-
message +=
|
|
101240
|
+
message += chalk2.dim("Received");
|
|
101241
101241
|
} else {
|
|
101242
|
-
message +=
|
|
101242
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
|
101243
101243
|
}
|
|
101244
101244
|
if (error) {
|
|
101245
|
-
bottomContent =
|
|
101245
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
101246
101246
|
}
|
|
101247
101247
|
this.screen.render(message, bottomContent);
|
|
101248
101248
|
}
|
|
@@ -101786,12 +101786,12 @@ var require_node7 = __commonJS({
|
|
|
101786
101786
|
var require_separator2 = __commonJS({
|
|
101787
101787
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
|
101788
101788
|
"use strict";
|
|
101789
|
-
var
|
|
101789
|
+
var chalk2 = require_chalk();
|
|
101790
101790
|
var figures = require_figures();
|
|
101791
101791
|
var Separator = class {
|
|
101792
101792
|
constructor(line) {
|
|
101793
101793
|
this.type = "separator";
|
|
101794
|
-
this.line =
|
|
101794
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
|
101795
101795
|
}
|
|
101796
101796
|
toString() {
|
|
101797
101797
|
return this.line;
|
|
@@ -102780,7 +102780,7 @@ var require_base4 = __commonJS({
|
|
|
102780
102780
|
defaults: require_defaults2(),
|
|
102781
102781
|
clone: require_clone()
|
|
102782
102782
|
};
|
|
102783
|
-
var
|
|
102783
|
+
var chalk2 = require_chalk();
|
|
102784
102784
|
var runAsync = require_run_async();
|
|
102785
102785
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
|
102786
102786
|
var Choices = require_choices2();
|
|
@@ -102798,7 +102798,7 @@ var require_base4 = __commonJS({
|
|
|
102798
102798
|
filteringText: "",
|
|
102799
102799
|
when: () => true,
|
|
102800
102800
|
suffix: "",
|
|
102801
|
-
prefix:
|
|
102801
|
+
prefix: chalk2.green("?")
|
|
102802
102802
|
});
|
|
102803
102803
|
if (!this.opt.name) {
|
|
102804
102804
|
this.throwParamError("name");
|
|
@@ -102871,12 +102871,12 @@ var require_base4 = __commonJS({
|
|
|
102871
102871
|
return value;
|
|
102872
102872
|
}
|
|
102873
102873
|
getQuestion() {
|
|
102874
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
|
102874
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
|
102875
102875
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
|
102876
102876
|
if (this.opt.type === "password") {
|
|
102877
|
-
message +=
|
|
102877
|
+
message += chalk2.italic.dim("[hidden] ");
|
|
102878
102878
|
} else {
|
|
102879
|
-
message +=
|
|
102879
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
|
102880
102880
|
}
|
|
102881
102881
|
}
|
|
102882
102882
|
return message;
|
|
@@ -102971,7 +102971,7 @@ var require_paginator2 = __commonJS({
|
|
|
102971
102971
|
sum: require_sum(),
|
|
102972
102972
|
flatten: require_flatten()
|
|
102973
102973
|
};
|
|
102974
|
-
var
|
|
102974
|
+
var chalk2 = require_chalk();
|
|
102975
102975
|
var Paginator = class {
|
|
102976
102976
|
constructor(screen, options = {}) {
|
|
102977
102977
|
const { isInfinite = true } = options;
|
|
@@ -102992,7 +102992,7 @@ var require_paginator2 = __commonJS({
|
|
|
102992
102992
|
}
|
|
102993
102993
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
|
102994
102994
|
this.lastIndex = active;
|
|
102995
|
-
return visibleLines.join("\n") + "\n" +
|
|
102995
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
|
102996
102996
|
}
|
|
102997
102997
|
getInfiniteLines(lines, active, pageSize) {
|
|
102998
102998
|
if (this.pointer === void 0) {
|
|
@@ -103053,7 +103053,7 @@ var require_list3 = __commonJS({
|
|
|
103053
103053
|
findIndex: require_findIndex2(),
|
|
103054
103054
|
isString: require_isString()
|
|
103055
103055
|
};
|
|
103056
|
-
var
|
|
103056
|
+
var chalk2 = require_chalk();
|
|
103057
103057
|
var figures = require_figures();
|
|
103058
103058
|
var cliCursor = require_cli_cursor();
|
|
103059
103059
|
var runAsync = require_run_async();
|
|
@@ -103105,10 +103105,10 @@ var require_list3 = __commonJS({
|
|
|
103105
103105
|
render() {
|
|
103106
103106
|
let message = this.getQuestion();
|
|
103107
103107
|
if (this.firstRender) {
|
|
103108
|
-
message +=
|
|
103108
|
+
message += chalk2.dim("(Use arrow keys)");
|
|
103109
103109
|
}
|
|
103110
103110
|
if (this.status === "answered") {
|
|
103111
|
-
message +=
|
|
103111
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
103112
103112
|
} else {
|
|
103113
103113
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
|
103114
103114
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -103177,7 +103177,7 @@ var require_list3 = __commonJS({
|
|
|
103177
103177
|
const isSelected = i - separatorOffset === pointer;
|
|
103178
103178
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
|
103179
103179
|
if (isSelected) {
|
|
103180
|
-
line =
|
|
103180
|
+
line = chalk2.cyan(line);
|
|
103181
103181
|
}
|
|
103182
103182
|
output2 += line + " \n";
|
|
103183
103183
|
});
|
|
@@ -103191,7 +103191,7 @@ var require_list3 = __commonJS({
|
|
|
103191
103191
|
var require_input2 = __commonJS({
|
|
103192
103192
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
|
103193
103193
|
"use strict";
|
|
103194
|
-
var
|
|
103194
|
+
var chalk2 = require_chalk();
|
|
103195
103195
|
var { map: map2, takeUntil } = require_operators();
|
|
103196
103196
|
var Base = require_base4();
|
|
103197
103197
|
var observe2 = require_events2();
|
|
@@ -103221,10 +103221,10 @@ var require_input2 = __commonJS({
|
|
|
103221
103221
|
if (transformer) {
|
|
103222
103222
|
message += transformer(appendContent, this.answers, { isFinal });
|
|
103223
103223
|
} else {
|
|
103224
|
-
message += isFinal ?
|
|
103224
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
|
103225
103225
|
}
|
|
103226
103226
|
if (error) {
|
|
103227
|
-
bottomContent =
|
|
103227
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
103228
103228
|
}
|
|
103229
103229
|
this.screen.render(message, bottomContent);
|
|
103230
103230
|
}
|
|
@@ -103297,7 +103297,7 @@ var require_confirm2 = __commonJS({
|
|
|
103297
103297
|
extend: require_extend(),
|
|
103298
103298
|
isBoolean: require_isBoolean()
|
|
103299
103299
|
};
|
|
103300
|
-
var
|
|
103300
|
+
var chalk2 = require_chalk();
|
|
103301
103301
|
var { take, takeUntil } = require_operators();
|
|
103302
103302
|
var Base = require_base4();
|
|
103303
103303
|
var observe2 = require_events2();
|
|
@@ -103330,7 +103330,7 @@ var require_confirm2 = __commonJS({
|
|
|
103330
103330
|
render(answer) {
|
|
103331
103331
|
let message = this.getQuestion();
|
|
103332
103332
|
if (typeof answer === "boolean") {
|
|
103333
|
-
message +=
|
|
103333
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
|
103334
103334
|
} else {
|
|
103335
103335
|
message += this.rl.line;
|
|
103336
103336
|
}
|
|
@@ -103361,7 +103361,7 @@ var require_rawlist2 = __commonJS({
|
|
|
103361
103361
|
isNumber: require_isNumber(),
|
|
103362
103362
|
findIndex: require_findIndex2()
|
|
103363
103363
|
};
|
|
103364
|
-
var
|
|
103364
|
+
var chalk2 = require_chalk();
|
|
103365
103365
|
var { map: map2, takeUntil } = require_operators();
|
|
103366
103366
|
var Base = require_base4();
|
|
103367
103367
|
var Separator = require_separator2();
|
|
@@ -103416,7 +103416,7 @@ var require_rawlist2 = __commonJS({
|
|
|
103416
103416
|
let message = this.getQuestion();
|
|
103417
103417
|
let bottomContent = "";
|
|
103418
103418
|
if (this.status === "answered") {
|
|
103419
|
-
message +=
|
|
103419
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
103420
103420
|
} else {
|
|
103421
103421
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
|
103422
103422
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
|
@@ -103424,7 +103424,7 @@ var require_rawlist2 = __commonJS({
|
|
|
103424
103424
|
}
|
|
103425
103425
|
message += this.rl.line;
|
|
103426
103426
|
if (error) {
|
|
103427
|
-
bottomContent = "\n" +
|
|
103427
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
103428
103428
|
}
|
|
103429
103429
|
this.screen.render(message, bottomContent);
|
|
103430
103430
|
}
|
|
@@ -103482,7 +103482,7 @@ var require_rawlist2 = __commonJS({
|
|
|
103482
103482
|
const index = i - separatorOffset;
|
|
103483
103483
|
let display = index + 1 + ") " + choice.name;
|
|
103484
103484
|
if (index === pointer) {
|
|
103485
|
-
display =
|
|
103485
|
+
display = chalk2.cyan(display);
|
|
103486
103486
|
}
|
|
103487
103487
|
output2 += display;
|
|
103488
103488
|
});
|
|
@@ -103657,7 +103657,7 @@ var require_expand3 = __commonJS({
|
|
|
103657
103657
|
isNumber: require_isNumber(),
|
|
103658
103658
|
findIndex: require_findIndex2()
|
|
103659
103659
|
};
|
|
103660
|
-
var
|
|
103660
|
+
var chalk2 = require_chalk();
|
|
103661
103661
|
var { map: map2, takeUntil } = require_operators();
|
|
103662
103662
|
var Base = require_base4();
|
|
103663
103663
|
var Separator = require_separator2();
|
|
@@ -103700,7 +103700,7 @@ var require_expand3 = __commonJS({
|
|
|
103700
103700
|
let message = this.getQuestion();
|
|
103701
103701
|
let bottomContent = "";
|
|
103702
103702
|
if (this.status === "answered") {
|
|
103703
|
-
message +=
|
|
103703
|
+
message += chalk2.cyan(this.answer);
|
|
103704
103704
|
} else if (this.status === "expanded") {
|
|
103705
103705
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
|
103706
103706
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
|
@@ -103708,10 +103708,10 @@ var require_expand3 = __commonJS({
|
|
|
103708
103708
|
}
|
|
103709
103709
|
message += this.rl.line;
|
|
103710
103710
|
if (error) {
|
|
103711
|
-
bottomContent =
|
|
103711
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
103712
103712
|
}
|
|
103713
103713
|
if (hint) {
|
|
103714
|
-
bottomContent =
|
|
103714
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
|
103715
103715
|
}
|
|
103716
103716
|
this.screen.render(message, bottomContent);
|
|
103717
103717
|
}
|
|
@@ -103735,7 +103735,7 @@ var require_expand3 = __commonJS({
|
|
|
103735
103735
|
}
|
|
103736
103736
|
let choiceStr = choice.key + ") " + choice.name;
|
|
103737
103737
|
if (this.selectedKey === choice.key) {
|
|
103738
|
-
choiceStr =
|
|
103738
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
103739
103739
|
}
|
|
103740
103740
|
output2 += choiceStr;
|
|
103741
103741
|
});
|
|
@@ -103824,7 +103824,7 @@ var require_expand3 = __commonJS({
|
|
|
103824
103824
|
}
|
|
103825
103825
|
let choiceStr = choice.key + ") " + choice.name;
|
|
103826
103826
|
if (pointer === choice.key) {
|
|
103827
|
-
choiceStr =
|
|
103827
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
103828
103828
|
}
|
|
103829
103829
|
output2 += choiceStr;
|
|
103830
103830
|
});
|
|
@@ -103843,7 +103843,7 @@ var require_checkbox2 = __commonJS({
|
|
|
103843
103843
|
map: require_map2(),
|
|
103844
103844
|
isString: require_isString()
|
|
103845
103845
|
};
|
|
103846
|
-
var
|
|
103846
|
+
var chalk2 = require_chalk();
|
|
103847
103847
|
var cliCursor = require_cli_cursor();
|
|
103848
103848
|
var figures = require_figures();
|
|
103849
103849
|
var { map: map2, takeUntil } = require_operators();
|
|
@@ -103892,10 +103892,10 @@ var require_checkbox2 = __commonJS({
|
|
|
103892
103892
|
let message = this.getQuestion();
|
|
103893
103893
|
let bottomContent = "";
|
|
103894
103894
|
if (!this.spaceKeyPressed) {
|
|
103895
|
-
message += "(Press " +
|
|
103895
|
+
message += "(Press " + chalk2.cyan.bold("<space>") + " to select, " + chalk2.cyan.bold("<a>") + " to toggle all, " + chalk2.cyan.bold("<i>") + " to invert selection)";
|
|
103896
103896
|
}
|
|
103897
103897
|
if (this.status === "answered") {
|
|
103898
|
-
message +=
|
|
103898
|
+
message += chalk2.cyan(this.selection.join(", "));
|
|
103899
103899
|
} else {
|
|
103900
103900
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
|
103901
103901
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -103918,7 +103918,7 @@ var require_checkbox2 = __commonJS({
|
|
|
103918
103918
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
|
103919
103919
|
}
|
|
103920
103920
|
if (error) {
|
|
103921
|
-
bottomContent =
|
|
103921
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
103922
103922
|
}
|
|
103923
103923
|
this.screen.render(message, bottomContent);
|
|
103924
103924
|
}
|
|
@@ -104002,7 +104002,7 @@ var require_checkbox2 = __commonJS({
|
|
|
104002
104002
|
} else {
|
|
104003
104003
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
|
104004
104004
|
if (i - separatorOffset === pointer) {
|
|
104005
|
-
output2 +=
|
|
104005
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
|
104006
104006
|
} else {
|
|
104007
104007
|
output2 += " " + line;
|
|
104008
104008
|
}
|
|
@@ -104012,7 +104012,7 @@ var require_checkbox2 = __commonJS({
|
|
|
104012
104012
|
return output2.replace(/\n$/, "");
|
|
104013
104013
|
}
|
|
104014
104014
|
function getCheckbox(checked) {
|
|
104015
|
-
return checked ?
|
|
104015
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
|
104016
104016
|
}
|
|
104017
104017
|
module2.exports = CheckboxPrompt;
|
|
104018
104018
|
}
|
|
@@ -104022,7 +104022,7 @@ var require_checkbox2 = __commonJS({
|
|
|
104022
104022
|
var require_password2 = __commonJS({
|
|
104023
104023
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
|
104024
104024
|
"use strict";
|
|
104025
|
-
var
|
|
104025
|
+
var chalk2 = require_chalk();
|
|
104026
104026
|
var { map: map2, takeUntil } = require_operators();
|
|
104027
104027
|
var Base = require_base4();
|
|
104028
104028
|
var observe2 = require_events2();
|
|
@@ -104055,15 +104055,15 @@ var require_password2 = __commonJS({
|
|
|
104055
104055
|
message += this.getMaskedValue(this.rl.line || "");
|
|
104056
104056
|
}
|
|
104057
104057
|
if (error) {
|
|
104058
|
-
bottomContent = "\n" +
|
|
104058
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
104059
104059
|
}
|
|
104060
104060
|
this.screen.render(message, bottomContent);
|
|
104061
104061
|
}
|
|
104062
104062
|
getMaskedValue(value) {
|
|
104063
104063
|
if (this.status === "answered") {
|
|
104064
|
-
return this.opt.mask ?
|
|
104064
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
|
104065
104065
|
}
|
|
104066
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
|
104066
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
|
104067
104067
|
}
|
|
104068
104068
|
getSpinningValue(value) {
|
|
104069
104069
|
return this.getMaskedValue(value);
|
|
@@ -104099,7 +104099,7 @@ var require_password2 = __commonJS({
|
|
|
104099
104099
|
var require_editor2 = __commonJS({
|
|
104100
104100
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
|
104101
104101
|
"use strict";
|
|
104102
|
-
var
|
|
104102
|
+
var chalk2 = require_chalk();
|
|
104103
104103
|
var { editAsync } = require_main();
|
|
104104
104104
|
var Base = require_base4();
|
|
104105
104105
|
var observe2 = require_events2();
|
|
@@ -104122,12 +104122,12 @@ var require_editor2 = __commonJS({
|
|
|
104122
104122
|
let bottomContent = "";
|
|
104123
104123
|
let message = this.getQuestion();
|
|
104124
104124
|
if (this.status === "answered") {
|
|
104125
|
-
message +=
|
|
104125
|
+
message += chalk2.dim("Received");
|
|
104126
104126
|
} else {
|
|
104127
|
-
message +=
|
|
104127
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
|
104128
104128
|
}
|
|
104129
104129
|
if (error) {
|
|
104130
|
-
bottomContent =
|
|
104130
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
104131
104131
|
}
|
|
104132
104132
|
this.screen.render(message, bottomContent);
|
|
104133
104133
|
}
|
|
@@ -134212,12 +134212,14 @@ var require_node_env2 = __commonJS({
|
|
|
134212
134212
|
"../../../toolkit/utils/dist/is/node-env.js"(exports) {
|
|
134213
134213
|
"use strict";
|
|
134214
134214
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
134215
|
-
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = void 0;
|
|
134216
|
-
var
|
|
134215
|
+
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = exports.getNodeEnv = void 0;
|
|
134216
|
+
var getNodeEnv = () => process.env.NODE_ENV || "development";
|
|
134217
|
+
exports.getNodeEnv = getNodeEnv;
|
|
134218
|
+
var isDev = () => (0, exports.getNodeEnv)() === "development";
|
|
134217
134219
|
exports.isDev = isDev;
|
|
134218
|
-
var isProd = () =>
|
|
134220
|
+
var isProd = () => (0, exports.getNodeEnv)() === "production";
|
|
134219
134221
|
exports.isProd = isProd;
|
|
134220
|
-
var isTest = () =>
|
|
134222
|
+
var isTest = () => (0, exports.getNodeEnv)() === "test";
|
|
134221
134223
|
exports.isTest = isTest;
|
|
134222
134224
|
var isProdProfile = () => (0, exports.isProd)() && process.argv.includes("--profile");
|
|
134223
134225
|
exports.isProdProfile = isProdProfile;
|
|
@@ -134360,10 +134362,10 @@ var require_is2 = __commonJS({
|
|
|
134360
134362
|
|
|
134361
134363
|
// ../../../toolkit/utils/dist/compatRequire.js
|
|
134362
134364
|
var require_compatRequire2 = __commonJS({
|
|
134363
|
-
"../../../toolkit/utils/dist/compatRequire.js"(exports) {
|
|
134365
|
+
"../../../toolkit/utils/dist/compatRequire.js"(exports, module2) {
|
|
134364
134366
|
"use strict";
|
|
134365
134367
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
134366
|
-
exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
|
134368
|
+
exports.deleteRequireCache = exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
|
134367
134369
|
var findExists_1 = require_findExists2();
|
|
134368
134370
|
var compatRequire = (filePath, interop = true) => {
|
|
134369
134371
|
const mod = require(filePath);
|
|
@@ -134390,6 +134392,15 @@ var require_compatRequire2 = __commonJS({
|
|
|
134390
134392
|
});
|
|
134391
134393
|
};
|
|
134392
134394
|
exports.cleanRequireCache = cleanRequireCache;
|
|
134395
|
+
function deleteRequireCache(path3) {
|
|
134396
|
+
if (require.cache[path3]) {
|
|
134397
|
+
delete require.cache[path3];
|
|
134398
|
+
}
|
|
134399
|
+
if (module2.children) {
|
|
134400
|
+
module2.children = module2.children.filter((item) => item.filename !== path3);
|
|
134401
|
+
}
|
|
134402
|
+
}
|
|
134403
|
+
exports.deleteRequireCache = deleteRequireCache;
|
|
134393
134404
|
}
|
|
134394
134405
|
});
|
|
134395
134406
|
|
|
@@ -136213,7 +136224,7 @@ var ZH_LOCALE = {
|
|
|
136213
136224
|
var EN_LOCALE = {
|
|
136214
136225
|
solution: {
|
|
136215
136226
|
self: "Please select the solution you want to create",
|
|
136216
|
-
mwa: "
|
|
136227
|
+
mwa: "Web App Solution",
|
|
136217
136228
|
module: "Module Solution",
|
|
136218
136229
|
monorepo: "Monorepo Solution",
|
|
136219
136230
|
custom: "Custom Solution",
|
|
@@ -136224,10 +136235,10 @@ var EN_LOCALE = {
|
|
|
136224
136235
|
},
|
|
136225
136236
|
sub_solution: {
|
|
136226
136237
|
self: "Please select the solution you want to create",
|
|
136227
|
-
mwa: "
|
|
136228
|
-
mwa_test: "
|
|
136238
|
+
mwa: "Web App Solution",
|
|
136239
|
+
mwa_test: "Web App Solution (Test)",
|
|
136229
136240
|
module: "Module Solution",
|
|
136230
|
-
inner_module: "Module Solution(Inner)",
|
|
136241
|
+
inner_module: "Module Solution (Inner)",
|
|
136231
136242
|
monorepo: "Monorepo Solution"
|
|
136232
136243
|
},
|
|
136233
136244
|
action: {
|
|
@@ -136384,78 +136395,16 @@ function getModernConfigFile(appDir) {
|
|
|
136384
136395
|
|
|
136385
136396
|
// src/locale/zh.ts
|
|
136386
136397
|
var ZH_LOCALE2 = {
|
|
136387
|
-
|
|
136388
|
-
|
|
136389
|
-
|
|
136390
|
-
|
|
136391
|
-
module.exports = {
|
|
136392
|
-
...,
|
|
136393
|
-
runtime: {
|
|
136394
|
-
...,
|
|
136395
|
-
router: {
|
|
136396
|
-
mode: 'react-router-5',
|
|
136397
|
-
},
|
|
136398
|
-
},
|
|
136399
|
-
plugins: [..., {pluginName}()],
|
|
136400
|
-
};
|
|
136401
|
-
|
|
136402
|
-
添加完成后,你将在当前项目中使用 React Router v5,请使用 React Router v5 相关 API 并从 '@modern-js/runtime/router-v5' 导入。
|
|
136403
|
-
`,
|
|
136404
|
-
successTs: `安装插件依赖成功!请添加如下代码至 {configFile} 中:
|
|
136405
|
-
|
|
136406
|
-
import {pluginName} from '{pluginDependence}';
|
|
136407
|
-
|
|
136408
|
-
export default defineConfig({
|
|
136409
|
-
...,
|
|
136410
|
-
runtime: {
|
|
136411
|
-
...,
|
|
136412
|
-
router: {
|
|
136413
|
-
mode: 'react-router-5',
|
|
136414
|
-
},
|
|
136415
|
-
},
|
|
136416
|
-
plugins: [..., {pluginName}()],
|
|
136417
|
-
});
|
|
136418
|
-
|
|
136419
|
-
添加完成后,你将在当前项目中使用 React Router v5,请使用 React Router v5 相关 API 并从 '@modern-js/runtime/router-v5' 导入。
|
|
136420
|
-
`
|
|
136398
|
+
success: `安装插件依赖成功!请添加如下代码至`,
|
|
136399
|
+
successTooltip: `添加完成后,你将在当前项目中使用 React Router v5,请使用 React Router v5 相关 API 并从`,
|
|
136400
|
+
successTooltipSuffix: "导入。"
|
|
136421
136401
|
};
|
|
136422
136402
|
|
|
136423
136403
|
// src/locale/en.ts
|
|
136424
136404
|
var EN_LOCALE2 = {
|
|
136425
|
-
|
|
136426
|
-
|
|
136427
|
-
|
|
136428
|
-
|
|
136429
|
-
module.exports = {
|
|
136430
|
-
...,
|
|
136431
|
-
runtime: {
|
|
136432
|
-
...,
|
|
136433
|
-
router: {
|
|
136434
|
-
mode: 'react-router-5',
|
|
136435
|
-
},
|
|
136436
|
-
},
|
|
136437
|
-
plugins: [..., {pluginName}()],
|
|
136438
|
-
};
|
|
136439
|
-
|
|
136440
|
-
After add code, you will use React Router v5 in your project, please use React Router v5 API from '@modern-js/runtime/router-v5'.
|
|
136441
|
-
`,
|
|
136442
|
-
successTs: `Plugin dependency installed successfully! Please add the following code to {configFile}:
|
|
136443
|
-
|
|
136444
|
-
import {pluginName} from '{pluginDependence}';
|
|
136445
|
-
|
|
136446
|
-
export default defineConfig({
|
|
136447
|
-
...,
|
|
136448
|
-
runtime: {
|
|
136449
|
-
...,
|
|
136450
|
-
router: {
|
|
136451
|
-
mode: 'react-router-5',
|
|
136452
|
-
},
|
|
136453
|
-
},
|
|
136454
|
-
plugins: [..., {pluginName}()],
|
|
136455
|
-
});
|
|
136456
|
-
|
|
136457
|
-
After add code, you will use React Router v5 in your project, please use React Router v5 API from '@modern-js/runtime/router-v5'.
|
|
136458
|
-
`
|
|
136405
|
+
success: `Plugin dependency installed successfully! Please add the following code to`,
|
|
136406
|
+
successTooltip: `After add code, you will use React Router v5 in your project, please use React Router v5 API from`,
|
|
136407
|
+
successTooltipSuffix: "."
|
|
136459
136408
|
};
|
|
136460
136409
|
|
|
136461
136410
|
// src/locale/index.ts
|
|
@@ -136509,6 +136458,7 @@ var src_default = (context, generator) => __async(void 0, null, function* () {
|
|
|
136509
136458
|
const { locale } = context.config;
|
|
136510
136459
|
i18n.changeLanguage({ locale });
|
|
136511
136460
|
appApi.i18n.changeLanguage({ locale });
|
|
136461
|
+
i18n2.changeLanguage(locale);
|
|
136512
136462
|
if (!(yield appApi.checkEnvironment())) {
|
|
136513
136463
|
process.exit(1);
|
|
136514
136464
|
}
|
|
@@ -136523,15 +136473,50 @@ var src_default = (context, generator) => __async(void 0, null, function* () {
|
|
|
136523
136473
|
} else {
|
|
136524
136474
|
const appDir = context.materials.default.basePath;
|
|
136525
136475
|
const configFile = yield getModernConfigFile(appDir);
|
|
136526
|
-
|
|
136527
|
-
|
|
136528
|
-
|
|
136529
|
-
|
|
136530
|
-
|
|
136531
|
-
|
|
136532
|
-
|
|
136533
|
-
|
|
136534
|
-
|
|
136476
|
+
const isTS = configFile.endsWith("ts");
|
|
136477
|
+
const { pluginName, pluginDependence } = context.config;
|
|
136478
|
+
console.info(
|
|
136479
|
+
import_utils4.chalk.green(`
|
|
136480
|
+
[INFO]`),
|
|
136481
|
+
`${i18n2.t(localeKeys2.success)}`,
|
|
136482
|
+
import_utils4.chalk.yellow.bold(`${configFile}`),
|
|
136483
|
+
":",
|
|
136484
|
+
"\n"
|
|
136485
|
+
);
|
|
136486
|
+
console.info(
|
|
136487
|
+
import_utils4.chalk.yellow.bold(`import ${pluginName} from '${pluginDependence}';`)
|
|
136488
|
+
);
|
|
136489
|
+
if (isTS) {
|
|
136490
|
+
console.info(`
|
|
136491
|
+
export default defineConfig({
|
|
136492
|
+
...,
|
|
136493
|
+
runtime: {
|
|
136494
|
+
...,
|
|
136495
|
+
router: {
|
|
136496
|
+
${import_utils4.chalk.yellow.bold(`mode: 'react-router-5'`)},
|
|
136497
|
+
},
|
|
136498
|
+
},
|
|
136499
|
+
plugins: [..., ${import_utils4.chalk.yellow.bold(`${pluginName}()`)}],
|
|
136500
|
+
});
|
|
136501
|
+
`);
|
|
136502
|
+
} else {
|
|
136503
|
+
console.info(`
|
|
136504
|
+
module.exports = {
|
|
136505
|
+
...,
|
|
136506
|
+
runtime: {
|
|
136507
|
+
...,
|
|
136508
|
+
router: {
|
|
136509
|
+
${import_utils4.chalk.yellow.bold(`mode: 'react-router-5'`)},
|
|
136510
|
+
},
|
|
136511
|
+
},
|
|
136512
|
+
plugins: [..., ${import_utils4.chalk.yellow.bold(`${pluginName}()`)}],
|
|
136513
|
+
};
|
|
136514
|
+
`);
|
|
136515
|
+
}
|
|
136516
|
+
console.info(
|
|
136517
|
+
`${i18n2.t(localeKeys2.successTooltip)} ${import_utils4.chalk.yellow.bold(
|
|
136518
|
+
`@modern-js/runtime/router-v5`
|
|
136519
|
+
)} ${i18n2.t(localeKeys2.successTooltipSuffix)}`
|
|
136535
136520
|
);
|
|
136536
136521
|
}
|
|
136537
136522
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/router-v5-generator",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "3.0.
|
|
14
|
+
"version": "3.0.6",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"files": [
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"@types/node": "^14",
|
|
27
27
|
"jest": "^27",
|
|
28
28
|
"typescript": "^4",
|
|
29
|
-
"@modern-js/generator-
|
|
30
|
-
"@modern-js/
|
|
31
|
-
"@modern-js/
|
|
32
|
-
"@modern-js/dependence-generator": "3.0.
|
|
33
|
-
"@scripts/build": "2.
|
|
34
|
-
"@scripts/jest-config": "2.
|
|
29
|
+
"@modern-js/generator-common": "3.0.6",
|
|
30
|
+
"@modern-js/generator-utils": "3.0.6",
|
|
31
|
+
"@modern-js/plugin-i18n": "2.4.0",
|
|
32
|
+
"@modern-js/dependence-generator": "3.0.6",
|
|
33
|
+
"@scripts/build": "2.4.0",
|
|
34
|
+
"@scripts/jest-config": "2.4.0"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
3
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
|
4
|
-
import { fs, getModernConfigFile } from '@modern-js/generator-utils';
|
|
4
|
+
import { fs, chalk, getModernConfigFile } from '@modern-js/generator-utils';
|
|
5
5
|
import {
|
|
6
6
|
DependenceGenerator,
|
|
7
7
|
i18n as commonI18n,
|
|
@@ -65,6 +65,7 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
|
65
65
|
const { locale } = context.config;
|
|
66
66
|
commonI18n.changeLanguage({ locale });
|
|
67
67
|
appApi.i18n.changeLanguage({ locale });
|
|
68
|
+
i18n.changeLanguage(locale);
|
|
68
69
|
|
|
69
70
|
if (!(await appApi.checkEnvironment())) {
|
|
70
71
|
// eslint-disable-next-line no-process-exit
|
|
@@ -84,17 +85,49 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
|
84
85
|
} else {
|
|
85
86
|
const appDir = context.materials.default.basePath;
|
|
86
87
|
const configFile = await getModernConfigFile(appDir);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
),
|
|
88
|
+
const isTS = configFile.endsWith('ts');
|
|
89
|
+
const { pluginName, pluginDependence } = context.config;
|
|
90
|
+
console.info(
|
|
91
|
+
chalk.green(`\n[INFO]`),
|
|
92
|
+
`${i18n.t(localeKeys.success)}`,
|
|
93
|
+
chalk.yellow.bold(`${configFile}`),
|
|
94
|
+
':',
|
|
95
|
+
'\n',
|
|
96
|
+
);
|
|
97
|
+
console.info(
|
|
98
|
+
chalk.yellow.bold(`import ${pluginName} from '${pluginDependence}';`),
|
|
99
|
+
);
|
|
100
|
+
if (isTS) {
|
|
101
|
+
console.info(`
|
|
102
|
+
export default defineConfig({
|
|
103
|
+
...,
|
|
104
|
+
runtime: {
|
|
105
|
+
...,
|
|
106
|
+
router: {
|
|
107
|
+
${chalk.yellow.bold(`mode: 'react-router-5'`)},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
plugins: [..., ${chalk.yellow.bold(`${pluginName}()`)}],
|
|
111
|
+
});
|
|
112
|
+
`);
|
|
113
|
+
} else {
|
|
114
|
+
console.info(`
|
|
115
|
+
module.exports = {
|
|
116
|
+
...,
|
|
117
|
+
runtime: {
|
|
118
|
+
...,
|
|
119
|
+
router: {
|
|
120
|
+
${chalk.yellow.bold(`mode: 'react-router-5'`)},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
plugins: [..., ${chalk.yellow.bold(`${pluginName}()`)}],
|
|
124
|
+
};
|
|
125
|
+
`);
|
|
126
|
+
}
|
|
127
|
+
console.info(
|
|
128
|
+
`${i18n.t(localeKeys.successTooltip)} ${chalk.yellow.bold(
|
|
129
|
+
`@modern-js/runtime/router-v5`,
|
|
130
|
+
)} ${i18n.t(localeKeys.successTooltipSuffix)}`,
|
|
98
131
|
);
|
|
99
132
|
}
|
|
100
133
|
}
|