@modern-js/repo-generator 3.0.4 → 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 +138 -115
- package/package.json +12 -12
- package/src/index.ts +156 -0
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
@@ -35757,7 +35757,7 @@ var require_nodeEnv = __commonJS({
|
|
35757
35757
|
});
|
35758
35758
|
}
|
35759
35759
|
exports.canUseNpm = canUseNpm3;
|
35760
|
-
function
|
35760
|
+
function canUseYarn2() {
|
35761
35761
|
return __async(this, null, function* () {
|
35762
35762
|
try {
|
35763
35763
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
@@ -35767,7 +35767,7 @@ var require_nodeEnv = __commonJS({
|
|
35767
35767
|
}
|
35768
35768
|
});
|
35769
35769
|
}
|
35770
|
-
exports.canUseYarn =
|
35770
|
+
exports.canUseYarn = canUseYarn2;
|
35771
35771
|
function canUsePnpm3() {
|
35772
35772
|
return __async(this, null, function* () {
|
35773
35773
|
try {
|
@@ -44405,7 +44405,7 @@ var require_env = __commonJS({
|
|
44405
44405
|
exports.canUseNpm = canUseNpm3;
|
44406
44406
|
exports.canUseNvm = canUseNvm;
|
44407
44407
|
exports.canUsePnpm = canUsePnpm3;
|
44408
|
-
exports.canUseYarn =
|
44408
|
+
exports.canUseYarn = canUseYarn2;
|
44409
44409
|
var _utils = require_dist();
|
44410
44410
|
function canUseNvm() {
|
44411
44411
|
return __async(this, null, function* () {
|
@@ -44432,7 +44432,7 @@ var require_env = __commonJS({
|
|
44432
44432
|
}
|
44433
44433
|
});
|
44434
44434
|
}
|
44435
|
-
function
|
44435
|
+
function canUseYarn2() {
|
44436
44436
|
return __async(this, null, function* () {
|
44437
44437
|
try {
|
44438
44438
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
@@ -45468,14 +45468,14 @@ var require_packageManager = __commonJS({
|
|
45468
45468
|
value: true
|
45469
45469
|
});
|
45470
45470
|
exports.canUsePnpm = canUsePnpm3;
|
45471
|
-
exports.canUseYarn =
|
45471
|
+
exports.canUseYarn = canUseYarn2;
|
45472
45472
|
exports.runInstall = runInstall;
|
45473
45473
|
var _path = _interopRequireDefault(require("path"));
|
45474
45474
|
var _utils = require_dist();
|
45475
45475
|
function _interopRequireDefault(obj) {
|
45476
45476
|
return obj && obj.__esModule ? obj : { default: obj };
|
45477
45477
|
}
|
45478
|
-
function
|
45478
|
+
function canUseYarn2() {
|
45479
45479
|
return __async(this, null, function* () {
|
45480
45480
|
try {
|
45481
45481
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
@@ -45522,7 +45522,7 @@ var require_packageManager = __commonJS({
|
|
45522
45522
|
params.push(`--registry=${registryUrl}`);
|
45523
45523
|
}
|
45524
45524
|
yield (0, _utils.execa)("pnpm", params, options);
|
45525
|
-
} else if (yield
|
45525
|
+
} else if (yield canUseYarn2()) {
|
45526
45526
|
const params = ["install", "--production", "--silent", "--ignore-scripts"];
|
45527
45527
|
if (registryUrl) {
|
45528
45528
|
params.push(`--registry=${registryUrl}`);
|
@@ -70787,12 +70787,12 @@ var require_figures = __commonJS({
|
|
70787
70787
|
var require_separator = __commonJS({
|
70788
70788
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
70789
70789
|
"use strict";
|
70790
|
-
var
|
70790
|
+
var chalk2 = require_chalk();
|
70791
70791
|
var figures = require_figures();
|
70792
70792
|
var Separator = class {
|
70793
70793
|
constructor(line) {
|
70794
70794
|
this.type = "separator";
|
70795
|
-
this.line =
|
70795
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
70796
70796
|
}
|
70797
70797
|
toString() {
|
70798
70798
|
return this.line;
|
@@ -90210,7 +90210,7 @@ var require_ora2 = __commonJS({
|
|
90210
90210
|
"../../../../node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js"(exports, module2) {
|
90211
90211
|
"use strict";
|
90212
90212
|
var readline = require("readline");
|
90213
|
-
var
|
90213
|
+
var chalk2 = require_chalk();
|
90214
90214
|
var cliCursor = require_cli_cursor();
|
90215
90215
|
var cliSpinners = require_cli_spinners();
|
90216
90216
|
var logSymbols = require_browser2();
|
@@ -90406,7 +90406,7 @@ var require_ora2 = __commonJS({
|
|
90406
90406
|
const { frames } = this.spinner;
|
90407
90407
|
let frame = frames[this.frameIndex];
|
90408
90408
|
if (this.color) {
|
90409
|
-
frame =
|
90409
|
+
frame = chalk2[this.color](frame);
|
90410
90410
|
}
|
90411
90411
|
this.frameIndex = ++this.frameIndex % frames.length;
|
90412
90412
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
@@ -90655,7 +90655,7 @@ var require_base3 = __commonJS({
|
|
90655
90655
|
defaults: require_defaults2(),
|
90656
90656
|
clone: require_clone()
|
90657
90657
|
};
|
90658
|
-
var
|
90658
|
+
var chalk2 = require_chalk();
|
90659
90659
|
var runAsync = require_run_async();
|
90660
90660
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
90661
90661
|
var Choices = require_choices();
|
@@ -90673,7 +90673,7 @@ var require_base3 = __commonJS({
|
|
90673
90673
|
filteringText: "",
|
90674
90674
|
when: () => true,
|
90675
90675
|
suffix: "",
|
90676
|
-
prefix:
|
90676
|
+
prefix: chalk2.green("?")
|
90677
90677
|
});
|
90678
90678
|
if (!this.opt.name) {
|
90679
90679
|
this.throwParamError("name");
|
@@ -90746,12 +90746,12 @@ var require_base3 = __commonJS({
|
|
90746
90746
|
return value;
|
90747
90747
|
}
|
90748
90748
|
getQuestion() {
|
90749
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
90749
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
90750
90750
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
90751
90751
|
if (this.opt.type === "password") {
|
90752
|
-
message +=
|
90752
|
+
message += chalk2.italic.dim("[hidden] ");
|
90753
90753
|
} else {
|
90754
|
-
message +=
|
90754
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
90755
90755
|
}
|
90756
90756
|
}
|
90757
90757
|
return message;
|
@@ -90813,7 +90813,7 @@ var require_events = __commonJS({
|
|
90813
90813
|
var require_paginator = __commonJS({
|
90814
90814
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/utils/paginator.js"(exports, module2) {
|
90815
90815
|
"use strict";
|
90816
|
-
var
|
90816
|
+
var chalk2 = require_chalk();
|
90817
90817
|
var Paginator = class {
|
90818
90818
|
constructor(screen, options = {}) {
|
90819
90819
|
const { isInfinite = true } = options;
|
@@ -90834,7 +90834,7 @@ var require_paginator = __commonJS({
|
|
90834
90834
|
}
|
90835
90835
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
90836
90836
|
this.lastIndex = active;
|
90837
|
-
return visibleLines.join("\n") + "\n" +
|
90837
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
90838
90838
|
}
|
90839
90839
|
getInfiniteLines(lines, active, pageSize) {
|
90840
90840
|
if (this.pointer === void 0) {
|
@@ -90890,7 +90890,7 @@ var require_incrementListIndex = __commonJS({
|
|
90890
90890
|
var require_list2 = __commonJS({
|
90891
90891
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/list.js"(exports, module2) {
|
90892
90892
|
"use strict";
|
90893
|
-
var
|
90893
|
+
var chalk2 = require_chalk();
|
90894
90894
|
var figures = require_figures();
|
90895
90895
|
var cliCursor = require_cli_cursor();
|
90896
90896
|
var runAsync = require_run_async();
|
@@ -90939,10 +90939,10 @@ var require_list2 = __commonJS({
|
|
90939
90939
|
render() {
|
90940
90940
|
let message = this.getQuestion();
|
90941
90941
|
if (this.firstRender) {
|
90942
|
-
message +=
|
90942
|
+
message += chalk2.dim("(Use arrow keys)");
|
90943
90943
|
}
|
90944
90944
|
if (this.status === "answered") {
|
90945
|
-
message +=
|
90945
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
90946
90946
|
} else {
|
90947
90947
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
90948
90948
|
const indexPosition = this.opt.choices.indexOf(
|
@@ -91011,7 +91011,7 @@ var require_list2 = __commonJS({
|
|
91011
91011
|
const isSelected = i - separatorOffset === pointer;
|
91012
91012
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
91013
91013
|
if (isSelected) {
|
91014
|
-
line =
|
91014
|
+
line = chalk2.cyan(line);
|
91015
91015
|
}
|
91016
91016
|
output2 += line + " \n";
|
91017
91017
|
});
|
@@ -91025,7 +91025,7 @@ var require_list2 = __commonJS({
|
|
91025
91025
|
var require_input = __commonJS({
|
91026
91026
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
91027
91027
|
"use strict";
|
91028
|
-
var
|
91028
|
+
var chalk2 = require_chalk();
|
91029
91029
|
var { map: map2, takeUntil } = require_operators();
|
91030
91030
|
var Base = require_base3();
|
91031
91031
|
var observe2 = require_events();
|
@@ -91055,10 +91055,10 @@ var require_input = __commonJS({
|
|
91055
91055
|
if (transformer) {
|
91056
91056
|
message += transformer(appendContent, this.answers, { isFinal });
|
91057
91057
|
} else {
|
91058
|
-
message += isFinal ?
|
91058
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
91059
91059
|
}
|
91060
91060
|
if (error) {
|
91061
|
-
bottomContent =
|
91061
|
+
bottomContent = chalk2.red(">> ") + error;
|
91062
91062
|
}
|
91063
91063
|
this.screen.render(message, bottomContent);
|
91064
91064
|
}
|
@@ -91114,7 +91114,7 @@ var require_number = __commonJS({
|
|
91114
91114
|
var require_confirm = __commonJS({
|
91115
91115
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/confirm.js"(exports, module2) {
|
91116
91116
|
"use strict";
|
91117
|
-
var
|
91117
|
+
var chalk2 = require_chalk();
|
91118
91118
|
var { take, takeUntil } = require_operators();
|
91119
91119
|
var Base = require_base3();
|
91120
91120
|
var observe2 = require_events();
|
@@ -91147,7 +91147,7 @@ var require_confirm = __commonJS({
|
|
91147
91147
|
render(answer) {
|
91148
91148
|
let message = this.getQuestion();
|
91149
91149
|
if (typeof answer === "boolean") {
|
91150
|
-
message +=
|
91150
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
91151
91151
|
} else {
|
91152
91152
|
message += this.rl.line;
|
91153
91153
|
}
|
@@ -91173,7 +91173,7 @@ var require_confirm = __commonJS({
|
|
91173
91173
|
var require_rawlist = __commonJS({
|
91174
91174
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/rawlist.js"(exports, module2) {
|
91175
91175
|
"use strict";
|
91176
|
-
var
|
91176
|
+
var chalk2 = require_chalk();
|
91177
91177
|
var { map: map2, takeUntil } = require_operators();
|
91178
91178
|
var Base = require_base3();
|
91179
91179
|
var Separator = require_separator();
|
@@ -91227,7 +91227,7 @@ var require_rawlist = __commonJS({
|
|
91227
91227
|
let message = this.getQuestion();
|
91228
91228
|
let bottomContent = "";
|
91229
91229
|
if (this.status === "answered") {
|
91230
|
-
message +=
|
91230
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
91231
91231
|
} else {
|
91232
91232
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
91233
91233
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
@@ -91235,7 +91235,7 @@ var require_rawlist = __commonJS({
|
|
91235
91235
|
}
|
91236
91236
|
message += this.rl.line;
|
91237
91237
|
if (error) {
|
91238
|
-
bottomContent = "\n" +
|
91238
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
91239
91239
|
}
|
91240
91240
|
this.screen.render(message, bottomContent);
|
91241
91241
|
}
|
@@ -91302,7 +91302,7 @@ var require_rawlist = __commonJS({
|
|
91302
91302
|
const index = i - separatorOffset;
|
91303
91303
|
let display = index + 1 + ") " + choice.name;
|
91304
91304
|
if (index === pointer) {
|
91305
|
-
display =
|
91305
|
+
display = chalk2.cyan(display);
|
91306
91306
|
}
|
91307
91307
|
output2 += display;
|
91308
91308
|
});
|
@@ -91316,7 +91316,7 @@ var require_rawlist = __commonJS({
|
|
91316
91316
|
var require_expand2 = __commonJS({
|
91317
91317
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/expand.js"(exports, module2) {
|
91318
91318
|
"use strict";
|
91319
|
-
var
|
91319
|
+
var chalk2 = require_chalk();
|
91320
91320
|
var { map: map2, takeUntil } = require_operators();
|
91321
91321
|
var Base = require_base3();
|
91322
91322
|
var Separator = require_separator();
|
@@ -91359,7 +91359,7 @@ var require_expand2 = __commonJS({
|
|
91359
91359
|
let message = this.getQuestion();
|
91360
91360
|
let bottomContent = "";
|
91361
91361
|
if (this.status === "answered") {
|
91362
|
-
message +=
|
91362
|
+
message += chalk2.cyan(this.answer);
|
91363
91363
|
} else if (this.status === "expanded") {
|
91364
91364
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
91365
91365
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
@@ -91367,10 +91367,10 @@ var require_expand2 = __commonJS({
|
|
91367
91367
|
}
|
91368
91368
|
message += this.rl.line;
|
91369
91369
|
if (error) {
|
91370
|
-
bottomContent =
|
91370
|
+
bottomContent = chalk2.red(">> ") + error;
|
91371
91371
|
}
|
91372
91372
|
if (hint) {
|
91373
|
-
bottomContent =
|
91373
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
91374
91374
|
}
|
91375
91375
|
this.screen.render(message, bottomContent);
|
91376
91376
|
}
|
@@ -91394,7 +91394,7 @@ var require_expand2 = __commonJS({
|
|
91394
91394
|
}
|
91395
91395
|
let choiceStr = choice.key + ") " + choice.name;
|
91396
91396
|
if (this.selectedKey === choice.key) {
|
91397
|
-
choiceStr =
|
91397
|
+
choiceStr = chalk2.cyan(choiceStr);
|
91398
91398
|
}
|
91399
91399
|
output2 += choiceStr;
|
91400
91400
|
});
|
@@ -91480,7 +91480,7 @@ var require_expand2 = __commonJS({
|
|
91480
91480
|
}
|
91481
91481
|
let choiceStr = choice.key + ") " + choice.name;
|
91482
91482
|
if (pointer === choice.key) {
|
91483
|
-
choiceStr =
|
91483
|
+
choiceStr = chalk2.cyan(choiceStr);
|
91484
91484
|
}
|
91485
91485
|
output2 += choiceStr;
|
91486
91486
|
});
|
@@ -91494,7 +91494,7 @@ var require_expand2 = __commonJS({
|
|
91494
91494
|
var require_checkbox = __commonJS({
|
91495
91495
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/checkbox.js"(exports, module2) {
|
91496
91496
|
"use strict";
|
91497
|
-
var
|
91497
|
+
var chalk2 = require_chalk();
|
91498
91498
|
var cliCursor = require_cli_cursor();
|
91499
91499
|
var figures = require_figures();
|
91500
91500
|
var { map: map2, takeUntil } = require_operators();
|
@@ -91543,10 +91543,10 @@ var require_checkbox = __commonJS({
|
|
91543
91543
|
let message = this.getQuestion();
|
91544
91544
|
let bottomContent = "";
|
91545
91545
|
if (!this.dontShowHints) {
|
91546
|
-
message += "(Press " +
|
91546
|
+
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)";
|
91547
91547
|
}
|
91548
91548
|
if (this.status === "answered") {
|
91549
|
-
message +=
|
91549
|
+
message += chalk2.cyan(this.selection.join(", "));
|
91550
91550
|
} else {
|
91551
91551
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
91552
91552
|
const indexPosition = this.opt.choices.indexOf(
|
@@ -91569,7 +91569,7 @@ var require_checkbox = __commonJS({
|
|
91569
91569
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
91570
91570
|
}
|
91571
91571
|
if (error) {
|
91572
|
-
bottomContent =
|
91572
|
+
bottomContent = chalk2.red(">> ") + error;
|
91573
91573
|
}
|
91574
91574
|
this.screen.render(message, bottomContent);
|
91575
91575
|
}
|
@@ -91652,7 +91652,7 @@ var require_checkbox = __commonJS({
|
|
91652
91652
|
} else {
|
91653
91653
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
91654
91654
|
if (i - separatorOffset === pointer) {
|
91655
|
-
output2 +=
|
91655
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
91656
91656
|
} else {
|
91657
91657
|
output2 += " " + line;
|
91658
91658
|
}
|
@@ -91662,7 +91662,7 @@ var require_checkbox = __commonJS({
|
|
91662
91662
|
return output2.replace(/\n$/, "");
|
91663
91663
|
}
|
91664
91664
|
function getCheckbox(checked) {
|
91665
|
-
return checked ?
|
91665
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
91666
91666
|
}
|
91667
91667
|
module2.exports = CheckboxPrompt;
|
91668
91668
|
}
|
@@ -91672,7 +91672,7 @@ var require_checkbox = __commonJS({
|
|
91672
91672
|
var require_password = __commonJS({
|
91673
91673
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
91674
91674
|
"use strict";
|
91675
|
-
var
|
91675
|
+
var chalk2 = require_chalk();
|
91676
91676
|
var { map: map2, takeUntil } = require_operators();
|
91677
91677
|
var Base = require_base3();
|
91678
91678
|
var observe2 = require_events();
|
@@ -91705,15 +91705,15 @@ var require_password = __commonJS({
|
|
91705
91705
|
message += this.getMaskedValue(this.rl.line || "");
|
91706
91706
|
}
|
91707
91707
|
if (error) {
|
91708
|
-
bottomContent = "\n" +
|
91708
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
91709
91709
|
}
|
91710
91710
|
this.screen.render(message, bottomContent);
|
91711
91711
|
}
|
91712
91712
|
getMaskedValue(value) {
|
91713
91713
|
if (this.status === "answered") {
|
91714
|
-
return this.opt.mask ?
|
91714
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
91715
91715
|
}
|
91716
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
91716
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
91717
91717
|
}
|
91718
91718
|
getSpinningValue(value) {
|
91719
91719
|
return this.getMaskedValue(value);
|
@@ -101221,7 +101221,7 @@ var require_main = __commonJS({
|
|
101221
101221
|
var require_editor = __commonJS({
|
101222
101222
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
101223
101223
|
"use strict";
|
101224
|
-
var
|
101224
|
+
var chalk2 = require_chalk();
|
101225
101225
|
var { editAsync } = require_main();
|
101226
101226
|
var Base = require_base3();
|
101227
101227
|
var observe2 = require_events();
|
@@ -101244,12 +101244,12 @@ var require_editor = __commonJS({
|
|
101244
101244
|
let bottomContent = "";
|
101245
101245
|
let message = this.getQuestion();
|
101246
101246
|
if (this.status === "answered") {
|
101247
|
-
message +=
|
101247
|
+
message += chalk2.dim("Received");
|
101248
101248
|
} else {
|
101249
|
-
message +=
|
101249
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
101250
101250
|
}
|
101251
101251
|
if (error) {
|
101252
|
-
bottomContent =
|
101252
|
+
bottomContent = chalk2.red(">> ") + error;
|
101253
101253
|
}
|
101254
101254
|
this.screen.render(message, bottomContent);
|
101255
101255
|
}
|
@@ -101793,12 +101793,12 @@ var require_node7 = __commonJS({
|
|
101793
101793
|
var require_separator2 = __commonJS({
|
101794
101794
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
101795
101795
|
"use strict";
|
101796
|
-
var
|
101796
|
+
var chalk2 = require_chalk();
|
101797
101797
|
var figures = require_figures();
|
101798
101798
|
var Separator = class {
|
101799
101799
|
constructor(line) {
|
101800
101800
|
this.type = "separator";
|
101801
|
-
this.line =
|
101801
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
101802
101802
|
}
|
101803
101803
|
toString() {
|
101804
101804
|
return this.line;
|
@@ -102787,7 +102787,7 @@ var require_base4 = __commonJS({
|
|
102787
102787
|
defaults: require_defaults2(),
|
102788
102788
|
clone: require_clone()
|
102789
102789
|
};
|
102790
|
-
var
|
102790
|
+
var chalk2 = require_chalk();
|
102791
102791
|
var runAsync = require_run_async();
|
102792
102792
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
102793
102793
|
var Choices = require_choices2();
|
@@ -102805,7 +102805,7 @@ var require_base4 = __commonJS({
|
|
102805
102805
|
filteringText: "",
|
102806
102806
|
when: () => true,
|
102807
102807
|
suffix: "",
|
102808
|
-
prefix:
|
102808
|
+
prefix: chalk2.green("?")
|
102809
102809
|
});
|
102810
102810
|
if (!this.opt.name) {
|
102811
102811
|
this.throwParamError("name");
|
@@ -102878,12 +102878,12 @@ var require_base4 = __commonJS({
|
|
102878
102878
|
return value;
|
102879
102879
|
}
|
102880
102880
|
getQuestion() {
|
102881
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
102881
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
102882
102882
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
102883
102883
|
if (this.opt.type === "password") {
|
102884
|
-
message +=
|
102884
|
+
message += chalk2.italic.dim("[hidden] ");
|
102885
102885
|
} else {
|
102886
|
-
message +=
|
102886
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
102887
102887
|
}
|
102888
102888
|
}
|
102889
102889
|
return message;
|
@@ -102978,7 +102978,7 @@ var require_paginator2 = __commonJS({
|
|
102978
102978
|
sum: require_sum(),
|
102979
102979
|
flatten: require_flatten()
|
102980
102980
|
};
|
102981
|
-
var
|
102981
|
+
var chalk2 = require_chalk();
|
102982
102982
|
var Paginator = class {
|
102983
102983
|
constructor(screen, options = {}) {
|
102984
102984
|
const { isInfinite = true } = options;
|
@@ -102999,7 +102999,7 @@ var require_paginator2 = __commonJS({
|
|
102999
102999
|
}
|
103000
103000
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
103001
103001
|
this.lastIndex = active;
|
103002
|
-
return visibleLines.join("\n") + "\n" +
|
103002
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
103003
103003
|
}
|
103004
103004
|
getInfiniteLines(lines, active, pageSize) {
|
103005
103005
|
if (this.pointer === void 0) {
|
@@ -103060,7 +103060,7 @@ var require_list3 = __commonJS({
|
|
103060
103060
|
findIndex: require_findIndex2(),
|
103061
103061
|
isString: require_isString()
|
103062
103062
|
};
|
103063
|
-
var
|
103063
|
+
var chalk2 = require_chalk();
|
103064
103064
|
var figures = require_figures();
|
103065
103065
|
var cliCursor = require_cli_cursor();
|
103066
103066
|
var runAsync = require_run_async();
|
@@ -103112,10 +103112,10 @@ var require_list3 = __commonJS({
|
|
103112
103112
|
render() {
|
103113
103113
|
let message = this.getQuestion();
|
103114
103114
|
if (this.firstRender) {
|
103115
|
-
message +=
|
103115
|
+
message += chalk2.dim("(Use arrow keys)");
|
103116
103116
|
}
|
103117
103117
|
if (this.status === "answered") {
|
103118
|
-
message +=
|
103118
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
103119
103119
|
} else {
|
103120
103120
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
103121
103121
|
const indexPosition = this.opt.choices.indexOf(
|
@@ -103184,7 +103184,7 @@ var require_list3 = __commonJS({
|
|
103184
103184
|
const isSelected = i - separatorOffset === pointer;
|
103185
103185
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
103186
103186
|
if (isSelected) {
|
103187
|
-
line =
|
103187
|
+
line = chalk2.cyan(line);
|
103188
103188
|
}
|
103189
103189
|
output2 += line + " \n";
|
103190
103190
|
});
|
@@ -103198,7 +103198,7 @@ var require_list3 = __commonJS({
|
|
103198
103198
|
var require_input2 = __commonJS({
|
103199
103199
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
103200
103200
|
"use strict";
|
103201
|
-
var
|
103201
|
+
var chalk2 = require_chalk();
|
103202
103202
|
var { map: map2, takeUntil } = require_operators();
|
103203
103203
|
var Base = require_base4();
|
103204
103204
|
var observe2 = require_events2();
|
@@ -103228,10 +103228,10 @@ var require_input2 = __commonJS({
|
|
103228
103228
|
if (transformer) {
|
103229
103229
|
message += transformer(appendContent, this.answers, { isFinal });
|
103230
103230
|
} else {
|
103231
|
-
message += isFinal ?
|
103231
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
103232
103232
|
}
|
103233
103233
|
if (error) {
|
103234
|
-
bottomContent =
|
103234
|
+
bottomContent = chalk2.red(">> ") + error;
|
103235
103235
|
}
|
103236
103236
|
this.screen.render(message, bottomContent);
|
103237
103237
|
}
|
@@ -103304,7 +103304,7 @@ var require_confirm2 = __commonJS({
|
|
103304
103304
|
extend: require_extend(),
|
103305
103305
|
isBoolean: require_isBoolean()
|
103306
103306
|
};
|
103307
|
-
var
|
103307
|
+
var chalk2 = require_chalk();
|
103308
103308
|
var { take, takeUntil } = require_operators();
|
103309
103309
|
var Base = require_base4();
|
103310
103310
|
var observe2 = require_events2();
|
@@ -103337,7 +103337,7 @@ var require_confirm2 = __commonJS({
|
|
103337
103337
|
render(answer) {
|
103338
103338
|
let message = this.getQuestion();
|
103339
103339
|
if (typeof answer === "boolean") {
|
103340
|
-
message +=
|
103340
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
103341
103341
|
} else {
|
103342
103342
|
message += this.rl.line;
|
103343
103343
|
}
|
@@ -103368,7 +103368,7 @@ var require_rawlist2 = __commonJS({
|
|
103368
103368
|
isNumber: require_isNumber(),
|
103369
103369
|
findIndex: require_findIndex2()
|
103370
103370
|
};
|
103371
|
-
var
|
103371
|
+
var chalk2 = require_chalk();
|
103372
103372
|
var { map: map2, takeUntil } = require_operators();
|
103373
103373
|
var Base = require_base4();
|
103374
103374
|
var Separator = require_separator2();
|
@@ -103423,7 +103423,7 @@ var require_rawlist2 = __commonJS({
|
|
103423
103423
|
let message = this.getQuestion();
|
103424
103424
|
let bottomContent = "";
|
103425
103425
|
if (this.status === "answered") {
|
103426
|
-
message +=
|
103426
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
103427
103427
|
} else {
|
103428
103428
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
103429
103429
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
@@ -103431,7 +103431,7 @@ var require_rawlist2 = __commonJS({
|
|
103431
103431
|
}
|
103432
103432
|
message += this.rl.line;
|
103433
103433
|
if (error) {
|
103434
|
-
bottomContent = "\n" +
|
103434
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
103435
103435
|
}
|
103436
103436
|
this.screen.render(message, bottomContent);
|
103437
103437
|
}
|
@@ -103489,7 +103489,7 @@ var require_rawlist2 = __commonJS({
|
|
103489
103489
|
const index = i - separatorOffset;
|
103490
103490
|
let display = index + 1 + ") " + choice.name;
|
103491
103491
|
if (index === pointer) {
|
103492
|
-
display =
|
103492
|
+
display = chalk2.cyan(display);
|
103493
103493
|
}
|
103494
103494
|
output2 += display;
|
103495
103495
|
});
|
@@ -103664,7 +103664,7 @@ var require_expand3 = __commonJS({
|
|
103664
103664
|
isNumber: require_isNumber(),
|
103665
103665
|
findIndex: require_findIndex2()
|
103666
103666
|
};
|
103667
|
-
var
|
103667
|
+
var chalk2 = require_chalk();
|
103668
103668
|
var { map: map2, takeUntil } = require_operators();
|
103669
103669
|
var Base = require_base4();
|
103670
103670
|
var Separator = require_separator2();
|
@@ -103707,7 +103707,7 @@ var require_expand3 = __commonJS({
|
|
103707
103707
|
let message = this.getQuestion();
|
103708
103708
|
let bottomContent = "";
|
103709
103709
|
if (this.status === "answered") {
|
103710
|
-
message +=
|
103710
|
+
message += chalk2.cyan(this.answer);
|
103711
103711
|
} else if (this.status === "expanded") {
|
103712
103712
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
103713
103713
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
@@ -103715,10 +103715,10 @@ var require_expand3 = __commonJS({
|
|
103715
103715
|
}
|
103716
103716
|
message += this.rl.line;
|
103717
103717
|
if (error) {
|
103718
|
-
bottomContent =
|
103718
|
+
bottomContent = chalk2.red(">> ") + error;
|
103719
103719
|
}
|
103720
103720
|
if (hint) {
|
103721
|
-
bottomContent =
|
103721
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
103722
103722
|
}
|
103723
103723
|
this.screen.render(message, bottomContent);
|
103724
103724
|
}
|
@@ -103742,7 +103742,7 @@ var require_expand3 = __commonJS({
|
|
103742
103742
|
}
|
103743
103743
|
let choiceStr = choice.key + ") " + choice.name;
|
103744
103744
|
if (this.selectedKey === choice.key) {
|
103745
|
-
choiceStr =
|
103745
|
+
choiceStr = chalk2.cyan(choiceStr);
|
103746
103746
|
}
|
103747
103747
|
output2 += choiceStr;
|
103748
103748
|
});
|
@@ -103831,7 +103831,7 @@ var require_expand3 = __commonJS({
|
|
103831
103831
|
}
|
103832
103832
|
let choiceStr = choice.key + ") " + choice.name;
|
103833
103833
|
if (pointer === choice.key) {
|
103834
|
-
choiceStr =
|
103834
|
+
choiceStr = chalk2.cyan(choiceStr);
|
103835
103835
|
}
|
103836
103836
|
output2 += choiceStr;
|
103837
103837
|
});
|
@@ -103850,7 +103850,7 @@ var require_checkbox2 = __commonJS({
|
|
103850
103850
|
map: require_map2(),
|
103851
103851
|
isString: require_isString()
|
103852
103852
|
};
|
103853
|
-
var
|
103853
|
+
var chalk2 = require_chalk();
|
103854
103854
|
var cliCursor = require_cli_cursor();
|
103855
103855
|
var figures = require_figures();
|
103856
103856
|
var { map: map2, takeUntil } = require_operators();
|
@@ -103899,10 +103899,10 @@ var require_checkbox2 = __commonJS({
|
|
103899
103899
|
let message = this.getQuestion();
|
103900
103900
|
let bottomContent = "";
|
103901
103901
|
if (!this.spaceKeyPressed) {
|
103902
|
-
message += "(Press " +
|
103902
|
+
message += "(Press " + chalk2.cyan.bold("<space>") + " to select, " + chalk2.cyan.bold("<a>") + " to toggle all, " + chalk2.cyan.bold("<i>") + " to invert selection)";
|
103903
103903
|
}
|
103904
103904
|
if (this.status === "answered") {
|
103905
|
-
message +=
|
103905
|
+
message += chalk2.cyan(this.selection.join(", "));
|
103906
103906
|
} else {
|
103907
103907
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
103908
103908
|
const indexPosition = this.opt.choices.indexOf(
|
@@ -103925,7 +103925,7 @@ var require_checkbox2 = __commonJS({
|
|
103925
103925
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
103926
103926
|
}
|
103927
103927
|
if (error) {
|
103928
|
-
bottomContent =
|
103928
|
+
bottomContent = chalk2.red(">> ") + error;
|
103929
103929
|
}
|
103930
103930
|
this.screen.render(message, bottomContent);
|
103931
103931
|
}
|
@@ -104009,7 +104009,7 @@ var require_checkbox2 = __commonJS({
|
|
104009
104009
|
} else {
|
104010
104010
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
104011
104011
|
if (i - separatorOffset === pointer) {
|
104012
|
-
output2 +=
|
104012
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
104013
104013
|
} else {
|
104014
104014
|
output2 += " " + line;
|
104015
104015
|
}
|
@@ -104019,7 +104019,7 @@ var require_checkbox2 = __commonJS({
|
|
104019
104019
|
return output2.replace(/\n$/, "");
|
104020
104020
|
}
|
104021
104021
|
function getCheckbox(checked) {
|
104022
|
-
return checked ?
|
104022
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
104023
104023
|
}
|
104024
104024
|
module2.exports = CheckboxPrompt;
|
104025
104025
|
}
|
@@ -104029,7 +104029,7 @@ var require_checkbox2 = __commonJS({
|
|
104029
104029
|
var require_password2 = __commonJS({
|
104030
104030
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
104031
104031
|
"use strict";
|
104032
|
-
var
|
104032
|
+
var chalk2 = require_chalk();
|
104033
104033
|
var { map: map2, takeUntil } = require_operators();
|
104034
104034
|
var Base = require_base4();
|
104035
104035
|
var observe2 = require_events2();
|
@@ -104062,15 +104062,15 @@ var require_password2 = __commonJS({
|
|
104062
104062
|
message += this.getMaskedValue(this.rl.line || "");
|
104063
104063
|
}
|
104064
104064
|
if (error) {
|
104065
|
-
bottomContent = "\n" +
|
104065
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
104066
104066
|
}
|
104067
104067
|
this.screen.render(message, bottomContent);
|
104068
104068
|
}
|
104069
104069
|
getMaskedValue(value) {
|
104070
104070
|
if (this.status === "answered") {
|
104071
|
-
return this.opt.mask ?
|
104071
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
104072
104072
|
}
|
104073
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
104073
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
104074
104074
|
}
|
104075
104075
|
getSpinningValue(value) {
|
104076
104076
|
return this.getMaskedValue(value);
|
@@ -104106,7 +104106,7 @@ var require_password2 = __commonJS({
|
|
104106
104106
|
var require_editor2 = __commonJS({
|
104107
104107
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
104108
104108
|
"use strict";
|
104109
|
-
var
|
104109
|
+
var chalk2 = require_chalk();
|
104110
104110
|
var { editAsync } = require_main();
|
104111
104111
|
var Base = require_base4();
|
104112
104112
|
var observe2 = require_events2();
|
@@ -104129,12 +104129,12 @@ var require_editor2 = __commonJS({
|
|
104129
104129
|
let bottomContent = "";
|
104130
104130
|
let message = this.getQuestion();
|
104131
104131
|
if (this.status === "answered") {
|
104132
|
-
message +=
|
104132
|
+
message += chalk2.dim("Received");
|
104133
104133
|
} else {
|
104134
|
-
message +=
|
104134
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
104135
104135
|
}
|
104136
104136
|
if (error) {
|
104137
|
-
bottomContent =
|
104137
|
+
bottomContent = chalk2.red(">> ") + error;
|
104138
104138
|
}
|
104139
104139
|
this.screen.render(message, bottomContent);
|
104140
104140
|
}
|
@@ -133817,6 +133817,26 @@ var require_compiled2 = __commonJS({
|
|
133817
133817
|
}
|
133818
133818
|
});
|
133819
133819
|
|
133820
|
+
// ../../../toolkit/utils/dist/commands.js
|
133821
|
+
var require_commands = __commonJS({
|
133822
|
+
"../../../toolkit/utils/dist/commands.js"(exports) {
|
133823
|
+
"use strict";
|
133824
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
133825
|
+
exports.isDevCommand = exports.getCommand = void 0;
|
133826
|
+
var getCommand = () => {
|
133827
|
+
const args = process.argv.slice(2);
|
133828
|
+
const command = args[0];
|
133829
|
+
return command;
|
133830
|
+
};
|
133831
|
+
exports.getCommand = getCommand;
|
133832
|
+
var isDevCommand = () => {
|
133833
|
+
const command = (0, exports.getCommand)();
|
133834
|
+
return command === "dev" || command === "start";
|
133835
|
+
};
|
133836
|
+
exports.isDevCommand = isDevCommand;
|
133837
|
+
}
|
133838
|
+
});
|
133839
|
+
|
133820
133840
|
// ../../../toolkit/utils/dist/format.js
|
133821
133841
|
var require_format2 = __commonJS({
|
133822
133842
|
"../../../toolkit/utils/dist/format.js"(exports) {
|
@@ -134192,12 +134212,14 @@ var require_node_env2 = __commonJS({
|
|
134192
134212
|
"../../../toolkit/utils/dist/is/node-env.js"(exports) {
|
134193
134213
|
"use strict";
|
134194
134214
|
Object.defineProperty(exports, "__esModule", { value: true });
|
134195
|
-
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = void 0;
|
134196
|
-
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";
|
134197
134219
|
exports.isDev = isDev;
|
134198
|
-
var isProd = () =>
|
134220
|
+
var isProd = () => (0, exports.getNodeEnv)() === "production";
|
134199
134221
|
exports.isProd = isProd;
|
134200
|
-
var isTest = () =>
|
134222
|
+
var isTest = () => (0, exports.getNodeEnv)() === "test";
|
134201
134223
|
exports.isTest = isTest;
|
134202
134224
|
var isProdProfile = () => (0, exports.isProd)() && process.argv.includes("--profile");
|
134203
134225
|
exports.isProdProfile = isProdProfile;
|
@@ -134340,10 +134362,10 @@ var require_is2 = __commonJS({
|
|
134340
134362
|
|
134341
134363
|
// ../../../toolkit/utils/dist/compatRequire.js
|
134342
134364
|
var require_compatRequire2 = __commonJS({
|
134343
|
-
"../../../toolkit/utils/dist/compatRequire.js"(exports) {
|
134365
|
+
"../../../toolkit/utils/dist/compatRequire.js"(exports, module2) {
|
134344
134366
|
"use strict";
|
134345
134367
|
Object.defineProperty(exports, "__esModule", { value: true });
|
134346
|
-
exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
134368
|
+
exports.deleteRequireCache = exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
134347
134369
|
var findExists_1 = require_findExists2();
|
134348
134370
|
var compatRequire = (filePath, interop = true) => {
|
134349
134371
|
const mod = require(filePath);
|
@@ -134370,6 +134392,15 @@ var require_compatRequire2 = __commonJS({
|
|
134370
134392
|
});
|
134371
134393
|
};
|
134372
134394
|
exports.cleanRequireCache = cleanRequireCache;
|
134395
|
+
function deleteRequireCache(path9) {
|
134396
|
+
if (require.cache[path9]) {
|
134397
|
+
delete require.cache[path9];
|
134398
|
+
}
|
134399
|
+
if (module2.children) {
|
134400
|
+
module2.children = module2.children.filter((item) => item.filename !== path9);
|
134401
|
+
}
|
134402
|
+
}
|
134403
|
+
exports.deleteRequireCache = deleteRequireCache;
|
134373
134404
|
}
|
134374
134405
|
});
|
134375
134406
|
|
@@ -134391,7 +134422,7 @@ var require_constants6 = __commonJS({
|
|
134391
134422
|
exports.SERVER_DIR = "server";
|
134392
134423
|
exports.SHARED_DIR = "shared";
|
134393
134424
|
exports.CONFIG_CACHE_DIR = "./node_modules/.cache/node-bundle-require";
|
134394
|
-
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".
|
134425
|
+
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
134395
134426
|
exports.OUTPUT_CONFIG_FILE = "modern.config.json";
|
134396
134427
|
exports.DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
134397
134428
|
exports.ROUTE_MINIFEST_FILE = "routes-manifest.json";
|
@@ -134882,7 +134913,7 @@ var require_nodeEnv2 = __commonJS({
|
|
134882
134913
|
});
|
134883
134914
|
}
|
134884
134915
|
exports.canUseNpm = canUseNpm3;
|
134885
|
-
function
|
134916
|
+
function canUseYarn2() {
|
134886
134917
|
return __async(this, null, function* () {
|
134887
134918
|
try {
|
134888
134919
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
@@ -134892,7 +134923,7 @@ var require_nodeEnv2 = __commonJS({
|
|
134892
134923
|
}
|
134893
134924
|
});
|
134894
134925
|
}
|
134895
|
-
exports.canUseYarn =
|
134926
|
+
exports.canUseYarn = canUseYarn2;
|
134896
134927
|
function canUsePnpm3() {
|
134897
134928
|
return __async(this, null, function* () {
|
134898
134929
|
try {
|
@@ -135971,6 +136002,7 @@ var require_dist2 = __commonJS({
|
|
135971
136002
|
};
|
135972
136003
|
Object.defineProperty(exports, "__esModule", { value: true });
|
135973
136004
|
__exportStar(require_compiled2(), exports);
|
136005
|
+
__exportStar(require_commands(), exports);
|
135974
136006
|
__exportStar(require_format2(), exports);
|
135975
136007
|
__exportStar(require_FileSizeReporter2(), exports);
|
135976
136008
|
__exportStar(require_printBuildError2(), exports);
|
@@ -137180,7 +137212,7 @@ var ZH_LOCALE = {
|
|
137180
137212
|
var EN_LOCALE = {
|
137181
137213
|
solution: {
|
137182
137214
|
self: "Please select the solution you want to create",
|
137183
|
-
mwa: "
|
137215
|
+
mwa: "Web App Solution",
|
137184
137216
|
module: "Module Solution",
|
137185
137217
|
monorepo: "Monorepo Solution",
|
137186
137218
|
custom: "Custom Solution",
|
@@ -137191,10 +137223,10 @@ var EN_LOCALE = {
|
|
137191
137223
|
},
|
137192
137224
|
sub_solution: {
|
137193
137225
|
self: "Please select the solution you want to create",
|
137194
|
-
mwa: "
|
137195
|
-
mwa_test: "
|
137226
|
+
mwa: "Web App Solution",
|
137227
|
+
mwa_test: "Web App Solution (Test)",
|
137196
137228
|
module: "Module Solution",
|
137197
|
-
inner_module: "Module Solution(Inner)",
|
137229
|
+
inner_module: "Module Solution (Inner)",
|
137198
137230
|
monorepo: "Monorepo Solution"
|
137199
137231
|
},
|
137200
137232
|
action: {
|
@@ -138100,15 +138132,6 @@ function getPackageVersion(packageName, registry2) {
|
|
138100
138132
|
spinner.stop();
|
138101
138133
|
return stripAnsi2(result.stdout);
|
138102
138134
|
}
|
138103
|
-
if (yield (0, import_utils3.canUseYarn)()) {
|
138104
|
-
const args = ["info", packageName, "version", "--silent"];
|
138105
|
-
if (registry2) {
|
138106
|
-
args.push(`--registry=${registry2}`);
|
138107
|
-
}
|
138108
|
-
const result = yield (0, import_utils3.execa)("yarn", args);
|
138109
|
-
spinner.stop();
|
138110
|
-
return stripAnsi2(result.stdout);
|
138111
|
-
}
|
138112
138135
|
if (yield (0, import_utils3.canUseNpm)()) {
|
138113
138136
|
const args = ["view", packageName, "version"];
|
138114
138137
|
if (registry2) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modern-js/repo-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,16 +26,16 @@
|
|
26
26
|
"@types/node": "^14",
|
27
27
|
"jest": "^27",
|
28
28
|
"typescript": "^4",
|
29
|
-
"@modern-js/generator-common": "3.0.
|
30
|
-
"@modern-js/
|
31
|
-
"@modern-js/
|
32
|
-
"@modern-js/
|
33
|
-
"@modern-js/mwa-generator": "3.0.
|
34
|
-
"@modern-js/utils": "2.
|
35
|
-
"@modern-js/generator-utils": "3.0.
|
36
|
-
"@modern-js/generator
|
37
|
-
"@scripts/jest-config": "2.
|
38
|
-
"@scripts/build": "2.
|
29
|
+
"@modern-js/generator-common": "3.0.6",
|
30
|
+
"@modern-js/generator-plugin": "3.0.6",
|
31
|
+
"@modern-js/module-generator": "3.0.6",
|
32
|
+
"@modern-js/monorepo-generator": "3.0.6",
|
33
|
+
"@modern-js/mwa-generator": "3.0.6",
|
34
|
+
"@modern-js/utils": "2.4.0",
|
35
|
+
"@modern-js/generator-utils": "3.0.6",
|
36
|
+
"@modern-js/base-generator": "3.0.6",
|
37
|
+
"@scripts/jest-config": "2.4.0",
|
38
|
+
"@scripts/build": "2.4.0"
|
39
39
|
},
|
40
40
|
"sideEffects": false,
|
41
41
|
"publishConfig": {
|
package/src/index.ts
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
import path from 'path';
|
2
|
+
import { merge } from '@modern-js/utils/lodash';
|
3
|
+
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
4
|
+
import { AppAPI } from '@modern-js/codesmith-api-app';
|
5
|
+
import {
|
6
|
+
i18n,
|
7
|
+
getSolutionSchema,
|
8
|
+
SolutionGenerator,
|
9
|
+
Solution,
|
10
|
+
SolutionDefaultConfig,
|
11
|
+
BaseGenerator,
|
12
|
+
getMonorepoNewActionSchema,
|
13
|
+
SubSolution,
|
14
|
+
SubSolutionGenerator,
|
15
|
+
MonorepoNewActionConfig,
|
16
|
+
getSolutionNameFromSubSolution,
|
17
|
+
getScenesSchema,
|
18
|
+
} from '@modern-js/generator-common';
|
19
|
+
import { GeneratorPlugin } from '@modern-js/generator-plugin';
|
20
|
+
|
21
|
+
const getGeneratorPath = (generator: string, distTag: string) => {
|
22
|
+
if (process.env.CODESMITH_ENV === 'development') {
|
23
|
+
return path.dirname(require.resolve(generator));
|
24
|
+
} else if (distTag) {
|
25
|
+
return `${generator}@${distTag}`;
|
26
|
+
}
|
27
|
+
return generator;
|
28
|
+
};
|
29
|
+
|
30
|
+
const mergeDefaultConfig = (context: GeneratorContext) => {
|
31
|
+
const { defaultSolution } = context.config;
|
32
|
+
|
33
|
+
if (defaultSolution) {
|
34
|
+
merge(
|
35
|
+
context.config,
|
36
|
+
{ solution: defaultSolution },
|
37
|
+
SolutionDefaultConfig[defaultSolution as Solution],
|
38
|
+
);
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
const getNeedRunPlugin = (
|
43
|
+
context: GeneratorContext,
|
44
|
+
generatorPlugin?: GeneratorPlugin,
|
45
|
+
): boolean => {
|
46
|
+
if (!generatorPlugin) {
|
47
|
+
return false;
|
48
|
+
}
|
49
|
+
const { extendPlugin, customPlugin } = generatorPlugin;
|
50
|
+
const { isMonorepo, solution, scenes } = context.config;
|
51
|
+
const pluginSolution = isMonorepo
|
52
|
+
? getSolutionNameFromSubSolution(solution)
|
53
|
+
: solution;
|
54
|
+
if (!scenes || scenes === pluginSolution) {
|
55
|
+
return (
|
56
|
+
extendPlugin?.[pluginSolution] && extendPlugin[pluginSolution].length > 0
|
57
|
+
);
|
58
|
+
}
|
59
|
+
return Boolean(
|
60
|
+
customPlugin[pluginSolution]?.find(plugin => plugin.key === scenes),
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
const handleTemplateFile = async (
|
65
|
+
context: GeneratorContext,
|
66
|
+
generator: GeneratorCore,
|
67
|
+
appApi: AppAPI,
|
68
|
+
generatorPlugin?: GeneratorPlugin,
|
69
|
+
) => {
|
70
|
+
const { isMonorepo } = context.config;
|
71
|
+
|
72
|
+
const { solution } = await appApi.getInputBySchemaFunc(
|
73
|
+
isMonorepo ? getMonorepoNewActionSchema : getSolutionSchema,
|
74
|
+
{
|
75
|
+
...context.config,
|
76
|
+
customPlugin: generatorPlugin?.customPlugin,
|
77
|
+
},
|
78
|
+
);
|
79
|
+
|
80
|
+
await appApi.getInputBySchemaFunc(getScenesSchema, context.config);
|
81
|
+
|
82
|
+
const solutionGenerator =
|
83
|
+
// eslint-disable-next-line no-nested-ternary
|
84
|
+
solution === 'custom'
|
85
|
+
? BaseGenerator
|
86
|
+
: isMonorepo
|
87
|
+
? SubSolutionGenerator[solution as SubSolution]
|
88
|
+
: SolutionGenerator[solution as Solution];
|
89
|
+
|
90
|
+
if (!solution || !solutionGenerator) {
|
91
|
+
generator.logger.error('solution is not valid ');
|
92
|
+
}
|
93
|
+
|
94
|
+
await appApi.runSubGenerator(
|
95
|
+
getGeneratorPath(solutionGenerator, context.config.distTag),
|
96
|
+
undefined,
|
97
|
+
{
|
98
|
+
...(isMonorepo
|
99
|
+
? MonorepoNewActionConfig[solution as SubSolution] || {}
|
100
|
+
: {}),
|
101
|
+
...context.config,
|
102
|
+
hasPlugin: getNeedRunPlugin(context, generatorPlugin),
|
103
|
+
generatorPlugin,
|
104
|
+
},
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
const handlePlugin = async (
|
109
|
+
context: GeneratorContext,
|
110
|
+
generator: GeneratorCore,
|
111
|
+
) => {
|
112
|
+
const { plugins, registry, locale } = context.config;
|
113
|
+
const generatorPlugin = new GeneratorPlugin(
|
114
|
+
generator.logger,
|
115
|
+
generator.event,
|
116
|
+
locale,
|
117
|
+
);
|
118
|
+
await generatorPlugin.setupPlugin(plugins, registry);
|
119
|
+
return generatorPlugin;
|
120
|
+
};
|
121
|
+
|
122
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
123
|
+
process.setMaxListeners(20);
|
124
|
+
|
125
|
+
const appApi = new AppAPI(context, generator);
|
126
|
+
|
127
|
+
const { locale } = context.config;
|
128
|
+
i18n.changeLanguage({ locale });
|
129
|
+
appApi.i18n.changeLanguage({ locale });
|
130
|
+
|
131
|
+
if (!(await appApi.checkEnvironment())) {
|
132
|
+
// eslint-disable-next-line no-process-exit
|
133
|
+
process.exit(1);
|
134
|
+
}
|
135
|
+
|
136
|
+
generator.logger.debug(`start run @modern-js/repo-generator`);
|
137
|
+
generator.logger.debug(`context=${JSON.stringify(context)}`);
|
138
|
+
generator.logger.debug(`context.data=${JSON.stringify(context.data)}`);
|
139
|
+
|
140
|
+
mergeDefaultConfig(context);
|
141
|
+
|
142
|
+
let generatorPlugin;
|
143
|
+
if (context.config.plugins?.length > 0) {
|
144
|
+
generatorPlugin = await handlePlugin(context, generator);
|
145
|
+
}
|
146
|
+
|
147
|
+
try {
|
148
|
+
await handleTemplateFile(context, generator, appApi, generatorPlugin);
|
149
|
+
} catch (e) {
|
150
|
+
generator.logger.error(e);
|
151
|
+
// eslint-disable-next-line no-process-exit
|
152
|
+
process.exit(1);
|
153
|
+
}
|
154
|
+
|
155
|
+
generator.logger.debug(`forge @modern-js/repo-generator succeed `);
|
156
|
+
};
|