@modern-js/packages-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 +154 -122
- package/package.json +6 -6
- package/src/index.ts +68 -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
|
@@ -35750,7 +35750,7 @@ var require_nodeEnv = __commonJS({
|
|
|
35750
35750
|
});
|
|
35751
35751
|
}
|
|
35752
35752
|
exports.canUseNpm = canUseNpm;
|
|
35753
|
-
function
|
|
35753
|
+
function canUseYarn2() {
|
|
35754
35754
|
return __async(this, null, function* () {
|
|
35755
35755
|
try {
|
|
35756
35756
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
|
@@ -35760,7 +35760,7 @@ var require_nodeEnv = __commonJS({
|
|
|
35760
35760
|
}
|
|
35761
35761
|
});
|
|
35762
35762
|
}
|
|
35763
|
-
exports.canUseYarn =
|
|
35763
|
+
exports.canUseYarn = canUseYarn2;
|
|
35764
35764
|
function canUsePnpm() {
|
|
35765
35765
|
return __async(this, null, function* () {
|
|
35766
35766
|
try {
|
|
@@ -44398,7 +44398,7 @@ var require_env = __commonJS({
|
|
|
44398
44398
|
exports.canUseNpm = canUseNpm;
|
|
44399
44399
|
exports.canUseNvm = canUseNvm;
|
|
44400
44400
|
exports.canUsePnpm = canUsePnpm;
|
|
44401
|
-
exports.canUseYarn =
|
|
44401
|
+
exports.canUseYarn = canUseYarn2;
|
|
44402
44402
|
var _utils = require_dist();
|
|
44403
44403
|
function canUseNvm() {
|
|
44404
44404
|
return __async(this, null, function* () {
|
|
@@ -44425,7 +44425,7 @@ var require_env = __commonJS({
|
|
|
44425
44425
|
}
|
|
44426
44426
|
});
|
|
44427
44427
|
}
|
|
44428
|
-
function
|
|
44428
|
+
function canUseYarn2() {
|
|
44429
44429
|
return __async(this, null, function* () {
|
|
44430
44430
|
try {
|
|
44431
44431
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
|
@@ -45461,14 +45461,14 @@ var require_packageManager = __commonJS({
|
|
|
45461
45461
|
value: true
|
|
45462
45462
|
});
|
|
45463
45463
|
exports.canUsePnpm = canUsePnpm;
|
|
45464
|
-
exports.canUseYarn =
|
|
45464
|
+
exports.canUseYarn = canUseYarn2;
|
|
45465
45465
|
exports.runInstall = runInstall;
|
|
45466
45466
|
var _path = _interopRequireDefault(require("path"));
|
|
45467
45467
|
var _utils = require_dist();
|
|
45468
45468
|
function _interopRequireDefault(obj) {
|
|
45469
45469
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
45470
45470
|
}
|
|
45471
|
-
function
|
|
45471
|
+
function canUseYarn2() {
|
|
45472
45472
|
return __async(this, null, function* () {
|
|
45473
45473
|
try {
|
|
45474
45474
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
|
@@ -45515,7 +45515,7 @@ var require_packageManager = __commonJS({
|
|
|
45515
45515
|
params.push(`--registry=${registryUrl}`);
|
|
45516
45516
|
}
|
|
45517
45517
|
yield (0, _utils.execa)("pnpm", params, options);
|
|
45518
|
-
} else if (yield
|
|
45518
|
+
} else if (yield canUseYarn2()) {
|
|
45519
45519
|
const params = ["install", "--production", "--silent", "--ignore-scripts"];
|
|
45520
45520
|
if (registryUrl) {
|
|
45521
45521
|
params.push(`--registry=${registryUrl}`);
|
|
@@ -71824,14 +71824,14 @@ var require_templates = __commonJS({
|
|
|
71824
71824
|
}
|
|
71825
71825
|
return results;
|
|
71826
71826
|
}
|
|
71827
|
-
function buildStyle(
|
|
71827
|
+
function buildStyle(chalk2, styles) {
|
|
71828
71828
|
const enabled = {};
|
|
71829
71829
|
for (const layer of styles) {
|
|
71830
71830
|
for (const style of layer.styles) {
|
|
71831
71831
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
71832
71832
|
}
|
|
71833
71833
|
}
|
|
71834
|
-
let current =
|
|
71834
|
+
let current = chalk2;
|
|
71835
71835
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
71836
71836
|
if (!Array.isArray(styles2)) {
|
|
71837
71837
|
continue;
|
|
@@ -71843,7 +71843,7 @@ var require_templates = __commonJS({
|
|
|
71843
71843
|
}
|
|
71844
71844
|
return current;
|
|
71845
71845
|
}
|
|
71846
|
-
module2.exports = (
|
|
71846
|
+
module2.exports = (chalk2, temporary) => {
|
|
71847
71847
|
const styles = [];
|
|
71848
71848
|
const chunks = [];
|
|
71849
71849
|
let chunk = [];
|
|
@@ -71853,13 +71853,13 @@ var require_templates = __commonJS({
|
|
|
71853
71853
|
} else if (style) {
|
|
71854
71854
|
const string = chunk.join("");
|
|
71855
71855
|
chunk = [];
|
|
71856
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
71856
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
71857
71857
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
71858
71858
|
} else if (close) {
|
|
71859
71859
|
if (styles.length === 0) {
|
|
71860
71860
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
71861
71861
|
}
|
|
71862
|
-
chunks.push(buildStyle(
|
|
71862
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
71863
71863
|
chunk = [];
|
|
71864
71864
|
styles.pop();
|
|
71865
71865
|
} else {
|
|
@@ -71907,16 +71907,16 @@ var require_source = __commonJS({
|
|
|
71907
71907
|
}
|
|
71908
71908
|
};
|
|
71909
71909
|
var chalkFactory = (options) => {
|
|
71910
|
-
const
|
|
71911
|
-
applyOptions(
|
|
71912
|
-
|
|
71913
|
-
Object.setPrototypeOf(
|
|
71914
|
-
Object.setPrototypeOf(
|
|
71915
|
-
|
|
71910
|
+
const chalk3 = {};
|
|
71911
|
+
applyOptions(chalk3, options);
|
|
71912
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
71913
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
71914
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
71915
|
+
chalk3.template.constructor = () => {
|
|
71916
71916
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
71917
71917
|
};
|
|
71918
|
-
|
|
71919
|
-
return
|
|
71918
|
+
chalk3.template.Instance = ChalkClass;
|
|
71919
|
+
return chalk3.template;
|
|
71920
71920
|
};
|
|
71921
71921
|
function Chalk(options) {
|
|
71922
71922
|
return chalkFactory(options);
|
|
@@ -72026,7 +72026,7 @@ var require_source = __commonJS({
|
|
|
72026
72026
|
return openAll + string + closeAll;
|
|
72027
72027
|
};
|
|
72028
72028
|
var template;
|
|
72029
|
-
var chalkTag = (
|
|
72029
|
+
var chalkTag = (chalk3, ...strings) => {
|
|
72030
72030
|
const [firstString] = strings;
|
|
72031
72031
|
if (!isArray3(firstString) || !isArray3(firstString.raw)) {
|
|
72032
72032
|
return strings.join(" ");
|
|
@@ -72042,14 +72042,14 @@ var require_source = __commonJS({
|
|
|
72042
72042
|
if (template === void 0) {
|
|
72043
72043
|
template = require_templates();
|
|
72044
72044
|
}
|
|
72045
|
-
return template(
|
|
72045
|
+
return template(chalk3, parts.join(""));
|
|
72046
72046
|
};
|
|
72047
72047
|
Object.defineProperties(Chalk.prototype, styles);
|
|
72048
|
-
var
|
|
72049
|
-
|
|
72050
|
-
|
|
72051
|
-
|
|
72052
|
-
module2.exports =
|
|
72048
|
+
var chalk2 = Chalk();
|
|
72049
|
+
chalk2.supportsColor = stdoutColor;
|
|
72050
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
72051
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
72052
|
+
module2.exports = chalk2;
|
|
72053
72053
|
}
|
|
72054
72054
|
});
|
|
72055
72055
|
|
|
@@ -72217,12 +72217,12 @@ var require_figures = __commonJS({
|
|
|
72217
72217
|
var require_separator = __commonJS({
|
|
72218
72218
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
|
72219
72219
|
"use strict";
|
|
72220
|
-
var
|
|
72220
|
+
var chalk2 = require_source();
|
|
72221
72221
|
var figures = require_figures();
|
|
72222
72222
|
var Separator = class {
|
|
72223
72223
|
constructor(line) {
|
|
72224
72224
|
this.type = "separator";
|
|
72225
|
-
this.line =
|
|
72225
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
|
72226
72226
|
}
|
|
72227
72227
|
toString() {
|
|
72228
72228
|
return this.line;
|
|
@@ -91640,7 +91640,7 @@ var require_ora2 = __commonJS({
|
|
|
91640
91640
|
"../../../../node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js"(exports, module2) {
|
|
91641
91641
|
"use strict";
|
|
91642
91642
|
var readline = require("readline");
|
|
91643
|
-
var
|
|
91643
|
+
var chalk2 = require_source();
|
|
91644
91644
|
var cliCursor = require_cli_cursor();
|
|
91645
91645
|
var cliSpinners = require_cli_spinners();
|
|
91646
91646
|
var logSymbols = require_browser3();
|
|
@@ -91836,7 +91836,7 @@ var require_ora2 = __commonJS({
|
|
|
91836
91836
|
const { frames } = this.spinner;
|
|
91837
91837
|
let frame = frames[this.frameIndex];
|
|
91838
91838
|
if (this.color) {
|
|
91839
|
-
frame =
|
|
91839
|
+
frame = chalk2[this.color](frame);
|
|
91840
91840
|
}
|
|
91841
91841
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
91842
91842
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
|
@@ -92085,7 +92085,7 @@ var require_base3 = __commonJS({
|
|
|
92085
92085
|
defaults: require_defaults2(),
|
|
92086
92086
|
clone: require_clone()
|
|
92087
92087
|
};
|
|
92088
|
-
var
|
|
92088
|
+
var chalk2 = require_source();
|
|
92089
92089
|
var runAsync = require_run_async();
|
|
92090
92090
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
|
92091
92091
|
var Choices = require_choices();
|
|
@@ -92103,7 +92103,7 @@ var require_base3 = __commonJS({
|
|
|
92103
92103
|
filteringText: "",
|
|
92104
92104
|
when: () => true,
|
|
92105
92105
|
suffix: "",
|
|
92106
|
-
prefix:
|
|
92106
|
+
prefix: chalk2.green("?")
|
|
92107
92107
|
});
|
|
92108
92108
|
if (!this.opt.name) {
|
|
92109
92109
|
this.throwParamError("name");
|
|
@@ -92176,12 +92176,12 @@ var require_base3 = __commonJS({
|
|
|
92176
92176
|
return value;
|
|
92177
92177
|
}
|
|
92178
92178
|
getQuestion() {
|
|
92179
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
|
92179
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
|
92180
92180
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
|
92181
92181
|
if (this.opt.type === "password") {
|
|
92182
|
-
message +=
|
|
92182
|
+
message += chalk2.italic.dim("[hidden] ");
|
|
92183
92183
|
} else {
|
|
92184
|
-
message +=
|
|
92184
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
|
92185
92185
|
}
|
|
92186
92186
|
}
|
|
92187
92187
|
return message;
|
|
@@ -92243,7 +92243,7 @@ var require_events = __commonJS({
|
|
|
92243
92243
|
var require_paginator = __commonJS({
|
|
92244
92244
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/utils/paginator.js"(exports, module2) {
|
|
92245
92245
|
"use strict";
|
|
92246
|
-
var
|
|
92246
|
+
var chalk2 = require_source();
|
|
92247
92247
|
var Paginator = class {
|
|
92248
92248
|
constructor(screen, options = {}) {
|
|
92249
92249
|
const { isInfinite = true } = options;
|
|
@@ -92264,7 +92264,7 @@ var require_paginator = __commonJS({
|
|
|
92264
92264
|
}
|
|
92265
92265
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
|
92266
92266
|
this.lastIndex = active;
|
|
92267
|
-
return visibleLines.join("\n") + "\n" +
|
|
92267
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
|
92268
92268
|
}
|
|
92269
92269
|
getInfiniteLines(lines, active, pageSize) {
|
|
92270
92270
|
if (this.pointer === void 0) {
|
|
@@ -92320,7 +92320,7 @@ var require_incrementListIndex = __commonJS({
|
|
|
92320
92320
|
var require_list2 = __commonJS({
|
|
92321
92321
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/list.js"(exports, module2) {
|
|
92322
92322
|
"use strict";
|
|
92323
|
-
var
|
|
92323
|
+
var chalk2 = require_source();
|
|
92324
92324
|
var figures = require_figures();
|
|
92325
92325
|
var cliCursor = require_cli_cursor();
|
|
92326
92326
|
var runAsync = require_run_async();
|
|
@@ -92369,10 +92369,10 @@ var require_list2 = __commonJS({
|
|
|
92369
92369
|
render() {
|
|
92370
92370
|
let message = this.getQuestion();
|
|
92371
92371
|
if (this.firstRender) {
|
|
92372
|
-
message +=
|
|
92372
|
+
message += chalk2.dim("(Use arrow keys)");
|
|
92373
92373
|
}
|
|
92374
92374
|
if (this.status === "answered") {
|
|
92375
|
-
message +=
|
|
92375
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
92376
92376
|
} else {
|
|
92377
92377
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
|
92378
92378
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -92441,7 +92441,7 @@ var require_list2 = __commonJS({
|
|
|
92441
92441
|
const isSelected = i - separatorOffset === pointer;
|
|
92442
92442
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
|
92443
92443
|
if (isSelected) {
|
|
92444
|
-
line =
|
|
92444
|
+
line = chalk2.cyan(line);
|
|
92445
92445
|
}
|
|
92446
92446
|
output2 += line + " \n";
|
|
92447
92447
|
});
|
|
@@ -92455,7 +92455,7 @@ var require_list2 = __commonJS({
|
|
|
92455
92455
|
var require_input = __commonJS({
|
|
92456
92456
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
|
92457
92457
|
"use strict";
|
|
92458
|
-
var
|
|
92458
|
+
var chalk2 = require_source();
|
|
92459
92459
|
var { map: map2, takeUntil } = require_operators();
|
|
92460
92460
|
var Base = require_base3();
|
|
92461
92461
|
var observe2 = require_events();
|
|
@@ -92485,10 +92485,10 @@ var require_input = __commonJS({
|
|
|
92485
92485
|
if (transformer) {
|
|
92486
92486
|
message += transformer(appendContent, this.answers, { isFinal });
|
|
92487
92487
|
} else {
|
|
92488
|
-
message += isFinal ?
|
|
92488
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
|
92489
92489
|
}
|
|
92490
92490
|
if (error) {
|
|
92491
|
-
bottomContent =
|
|
92491
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
92492
92492
|
}
|
|
92493
92493
|
this.screen.render(message, bottomContent);
|
|
92494
92494
|
}
|
|
@@ -92544,7 +92544,7 @@ var require_number = __commonJS({
|
|
|
92544
92544
|
var require_confirm = __commonJS({
|
|
92545
92545
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/confirm.js"(exports, module2) {
|
|
92546
92546
|
"use strict";
|
|
92547
|
-
var
|
|
92547
|
+
var chalk2 = require_source();
|
|
92548
92548
|
var { take, takeUntil } = require_operators();
|
|
92549
92549
|
var Base = require_base3();
|
|
92550
92550
|
var observe2 = require_events();
|
|
@@ -92577,7 +92577,7 @@ var require_confirm = __commonJS({
|
|
|
92577
92577
|
render(answer) {
|
|
92578
92578
|
let message = this.getQuestion();
|
|
92579
92579
|
if (typeof answer === "boolean") {
|
|
92580
|
-
message +=
|
|
92580
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
|
92581
92581
|
} else {
|
|
92582
92582
|
message += this.rl.line;
|
|
92583
92583
|
}
|
|
@@ -92603,7 +92603,7 @@ var require_confirm = __commonJS({
|
|
|
92603
92603
|
var require_rawlist = __commonJS({
|
|
92604
92604
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/rawlist.js"(exports, module2) {
|
|
92605
92605
|
"use strict";
|
|
92606
|
-
var
|
|
92606
|
+
var chalk2 = require_source();
|
|
92607
92607
|
var { map: map2, takeUntil } = require_operators();
|
|
92608
92608
|
var Base = require_base3();
|
|
92609
92609
|
var Separator = require_separator();
|
|
@@ -92657,7 +92657,7 @@ var require_rawlist = __commonJS({
|
|
|
92657
92657
|
let message = this.getQuestion();
|
|
92658
92658
|
let bottomContent = "";
|
|
92659
92659
|
if (this.status === "answered") {
|
|
92660
|
-
message +=
|
|
92660
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
92661
92661
|
} else {
|
|
92662
92662
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
|
92663
92663
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
|
@@ -92665,7 +92665,7 @@ var require_rawlist = __commonJS({
|
|
|
92665
92665
|
}
|
|
92666
92666
|
message += this.rl.line;
|
|
92667
92667
|
if (error) {
|
|
92668
|
-
bottomContent = "\n" +
|
|
92668
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
92669
92669
|
}
|
|
92670
92670
|
this.screen.render(message, bottomContent);
|
|
92671
92671
|
}
|
|
@@ -92732,7 +92732,7 @@ var require_rawlist = __commonJS({
|
|
|
92732
92732
|
const index = i - separatorOffset;
|
|
92733
92733
|
let display = index + 1 + ") " + choice.name;
|
|
92734
92734
|
if (index === pointer) {
|
|
92735
|
-
display =
|
|
92735
|
+
display = chalk2.cyan(display);
|
|
92736
92736
|
}
|
|
92737
92737
|
output2 += display;
|
|
92738
92738
|
});
|
|
@@ -92746,7 +92746,7 @@ var require_rawlist = __commonJS({
|
|
|
92746
92746
|
var require_expand2 = __commonJS({
|
|
92747
92747
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/expand.js"(exports, module2) {
|
|
92748
92748
|
"use strict";
|
|
92749
|
-
var
|
|
92749
|
+
var chalk2 = require_source();
|
|
92750
92750
|
var { map: map2, takeUntil } = require_operators();
|
|
92751
92751
|
var Base = require_base3();
|
|
92752
92752
|
var Separator = require_separator();
|
|
@@ -92789,7 +92789,7 @@ var require_expand2 = __commonJS({
|
|
|
92789
92789
|
let message = this.getQuestion();
|
|
92790
92790
|
let bottomContent = "";
|
|
92791
92791
|
if (this.status === "answered") {
|
|
92792
|
-
message +=
|
|
92792
|
+
message += chalk2.cyan(this.answer);
|
|
92793
92793
|
} else if (this.status === "expanded") {
|
|
92794
92794
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
|
92795
92795
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
|
@@ -92797,10 +92797,10 @@ var require_expand2 = __commonJS({
|
|
|
92797
92797
|
}
|
|
92798
92798
|
message += this.rl.line;
|
|
92799
92799
|
if (error) {
|
|
92800
|
-
bottomContent =
|
|
92800
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
92801
92801
|
}
|
|
92802
92802
|
if (hint) {
|
|
92803
|
-
bottomContent =
|
|
92803
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
|
92804
92804
|
}
|
|
92805
92805
|
this.screen.render(message, bottomContent);
|
|
92806
92806
|
}
|
|
@@ -92824,7 +92824,7 @@ var require_expand2 = __commonJS({
|
|
|
92824
92824
|
}
|
|
92825
92825
|
let choiceStr = choice.key + ") " + choice.name;
|
|
92826
92826
|
if (this.selectedKey === choice.key) {
|
|
92827
|
-
choiceStr =
|
|
92827
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
92828
92828
|
}
|
|
92829
92829
|
output2 += choiceStr;
|
|
92830
92830
|
});
|
|
@@ -92910,7 +92910,7 @@ var require_expand2 = __commonJS({
|
|
|
92910
92910
|
}
|
|
92911
92911
|
let choiceStr = choice.key + ") " + choice.name;
|
|
92912
92912
|
if (pointer === choice.key) {
|
|
92913
|
-
choiceStr =
|
|
92913
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
92914
92914
|
}
|
|
92915
92915
|
output2 += choiceStr;
|
|
92916
92916
|
});
|
|
@@ -92924,7 +92924,7 @@ var require_expand2 = __commonJS({
|
|
|
92924
92924
|
var require_checkbox = __commonJS({
|
|
92925
92925
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/checkbox.js"(exports, module2) {
|
|
92926
92926
|
"use strict";
|
|
92927
|
-
var
|
|
92927
|
+
var chalk2 = require_source();
|
|
92928
92928
|
var cliCursor = require_cli_cursor();
|
|
92929
92929
|
var figures = require_figures();
|
|
92930
92930
|
var { map: map2, takeUntil } = require_operators();
|
|
@@ -92973,10 +92973,10 @@ var require_checkbox = __commonJS({
|
|
|
92973
92973
|
let message = this.getQuestion();
|
|
92974
92974
|
let bottomContent = "";
|
|
92975
92975
|
if (!this.dontShowHints) {
|
|
92976
|
-
message += "(Press " +
|
|
92976
|
+
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)";
|
|
92977
92977
|
}
|
|
92978
92978
|
if (this.status === "answered") {
|
|
92979
|
-
message +=
|
|
92979
|
+
message += chalk2.cyan(this.selection.join(", "));
|
|
92980
92980
|
} else {
|
|
92981
92981
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
|
92982
92982
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -92999,7 +92999,7 @@ var require_checkbox = __commonJS({
|
|
|
92999
92999
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
|
93000
93000
|
}
|
|
93001
93001
|
if (error) {
|
|
93002
|
-
bottomContent =
|
|
93002
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
93003
93003
|
}
|
|
93004
93004
|
this.screen.render(message, bottomContent);
|
|
93005
93005
|
}
|
|
@@ -93082,7 +93082,7 @@ var require_checkbox = __commonJS({
|
|
|
93082
93082
|
} else {
|
|
93083
93083
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
|
93084
93084
|
if (i - separatorOffset === pointer) {
|
|
93085
|
-
output2 +=
|
|
93085
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
|
93086
93086
|
} else {
|
|
93087
93087
|
output2 += " " + line;
|
|
93088
93088
|
}
|
|
@@ -93092,7 +93092,7 @@ var require_checkbox = __commonJS({
|
|
|
93092
93092
|
return output2.replace(/\n$/, "");
|
|
93093
93093
|
}
|
|
93094
93094
|
function getCheckbox(checked) {
|
|
93095
|
-
return checked ?
|
|
93095
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
|
93096
93096
|
}
|
|
93097
93097
|
module2.exports = CheckboxPrompt;
|
|
93098
93098
|
}
|
|
@@ -93102,7 +93102,7 @@ var require_checkbox = __commonJS({
|
|
|
93102
93102
|
var require_password = __commonJS({
|
|
93103
93103
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
|
93104
93104
|
"use strict";
|
|
93105
|
-
var
|
|
93105
|
+
var chalk2 = require_source();
|
|
93106
93106
|
var { map: map2, takeUntil } = require_operators();
|
|
93107
93107
|
var Base = require_base3();
|
|
93108
93108
|
var observe2 = require_events();
|
|
@@ -93135,15 +93135,15 @@ var require_password = __commonJS({
|
|
|
93135
93135
|
message += this.getMaskedValue(this.rl.line || "");
|
|
93136
93136
|
}
|
|
93137
93137
|
if (error) {
|
|
93138
|
-
bottomContent = "\n" +
|
|
93138
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
93139
93139
|
}
|
|
93140
93140
|
this.screen.render(message, bottomContent);
|
|
93141
93141
|
}
|
|
93142
93142
|
getMaskedValue(value) {
|
|
93143
93143
|
if (this.status === "answered") {
|
|
93144
|
-
return this.opt.mask ?
|
|
93144
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
|
93145
93145
|
}
|
|
93146
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
|
93146
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
|
93147
93147
|
}
|
|
93148
93148
|
getSpinningValue(value) {
|
|
93149
93149
|
return this.getMaskedValue(value);
|
|
@@ -102651,7 +102651,7 @@ var require_main = __commonJS({
|
|
|
102651
102651
|
var require_editor = __commonJS({
|
|
102652
102652
|
"../../../../node_modules/.pnpm/inquirer@8.2.2/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
|
102653
102653
|
"use strict";
|
|
102654
|
-
var
|
|
102654
|
+
var chalk2 = require_source();
|
|
102655
102655
|
var { editAsync } = require_main();
|
|
102656
102656
|
var Base = require_base3();
|
|
102657
102657
|
var observe2 = require_events();
|
|
@@ -102674,12 +102674,12 @@ var require_editor = __commonJS({
|
|
|
102674
102674
|
let bottomContent = "";
|
|
102675
102675
|
let message = this.getQuestion();
|
|
102676
102676
|
if (this.status === "answered") {
|
|
102677
|
-
message +=
|
|
102677
|
+
message += chalk2.dim("Received");
|
|
102678
102678
|
} else {
|
|
102679
|
-
message +=
|
|
102679
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
|
102680
102680
|
}
|
|
102681
102681
|
if (error) {
|
|
102682
|
-
bottomContent =
|
|
102682
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
102683
102683
|
}
|
|
102684
102684
|
this.screen.render(message, bottomContent);
|
|
102685
102685
|
}
|
|
@@ -103223,12 +103223,12 @@ var require_node7 = __commonJS({
|
|
|
103223
103223
|
var require_separator2 = __commonJS({
|
|
103224
103224
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/objects/separator.js"(exports, module2) {
|
|
103225
103225
|
"use strict";
|
|
103226
|
-
var
|
|
103226
|
+
var chalk2 = require_source();
|
|
103227
103227
|
var figures = require_figures();
|
|
103228
103228
|
var Separator = class {
|
|
103229
103229
|
constructor(line) {
|
|
103230
103230
|
this.type = "separator";
|
|
103231
|
-
this.line =
|
|
103231
|
+
this.line = chalk2.dim(line || new Array(15).join(figures.line));
|
|
103232
103232
|
}
|
|
103233
103233
|
toString() {
|
|
103234
103234
|
return this.line;
|
|
@@ -104217,7 +104217,7 @@ var require_base4 = __commonJS({
|
|
|
104217
104217
|
defaults: require_defaults2(),
|
|
104218
104218
|
clone: require_clone()
|
|
104219
104219
|
};
|
|
104220
|
-
var
|
|
104220
|
+
var chalk2 = require_source();
|
|
104221
104221
|
var runAsync = require_run_async();
|
|
104222
104222
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
|
104223
104223
|
var Choices = require_choices2();
|
|
@@ -104235,7 +104235,7 @@ var require_base4 = __commonJS({
|
|
|
104235
104235
|
filteringText: "",
|
|
104236
104236
|
when: () => true,
|
|
104237
104237
|
suffix: "",
|
|
104238
|
-
prefix:
|
|
104238
|
+
prefix: chalk2.green("?")
|
|
104239
104239
|
});
|
|
104240
104240
|
if (!this.opt.name) {
|
|
104241
104241
|
this.throwParamError("name");
|
|
@@ -104308,12 +104308,12 @@ var require_base4 = __commonJS({
|
|
|
104308
104308
|
return value;
|
|
104309
104309
|
}
|
|
104310
104310
|
getQuestion() {
|
|
104311
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
|
104311
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk2.bold(this.opt.message) + this.opt.suffix + chalk2.reset(" ");
|
|
104312
104312
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
|
104313
104313
|
if (this.opt.type === "password") {
|
|
104314
|
-
message +=
|
|
104314
|
+
message += chalk2.italic.dim("[hidden] ");
|
|
104315
104315
|
} else {
|
|
104316
|
-
message +=
|
|
104316
|
+
message += chalk2.dim("(" + this.opt.default + ") ");
|
|
104317
104317
|
}
|
|
104318
104318
|
}
|
|
104319
104319
|
return message;
|
|
@@ -104408,7 +104408,7 @@ var require_paginator2 = __commonJS({
|
|
|
104408
104408
|
sum: require_sum(),
|
|
104409
104409
|
flatten: require_flatten()
|
|
104410
104410
|
};
|
|
104411
|
-
var
|
|
104411
|
+
var chalk2 = require_source();
|
|
104412
104412
|
var Paginator = class {
|
|
104413
104413
|
constructor(screen, options = {}) {
|
|
104414
104414
|
const { isInfinite = true } = options;
|
|
@@ -104429,7 +104429,7 @@ var require_paginator2 = __commonJS({
|
|
|
104429
104429
|
}
|
|
104430
104430
|
const visibleLines = this.isInfinite ? this.getInfiniteLines(lines, active, pageSize) : this.getFiniteLines(lines, active, pageSize);
|
|
104431
104431
|
this.lastIndex = active;
|
|
104432
|
-
return visibleLines.join("\n") + "\n" +
|
|
104432
|
+
return visibleLines.join("\n") + "\n" + chalk2.dim("(Move up and down to reveal more choices)");
|
|
104433
104433
|
}
|
|
104434
104434
|
getInfiniteLines(lines, active, pageSize) {
|
|
104435
104435
|
if (this.pointer === void 0) {
|
|
@@ -104490,7 +104490,7 @@ var require_list3 = __commonJS({
|
|
|
104490
104490
|
findIndex: require_findIndex2(),
|
|
104491
104491
|
isString: require_isString()
|
|
104492
104492
|
};
|
|
104493
|
-
var
|
|
104493
|
+
var chalk2 = require_source();
|
|
104494
104494
|
var figures = require_figures();
|
|
104495
104495
|
var cliCursor = require_cli_cursor();
|
|
104496
104496
|
var runAsync = require_run_async();
|
|
@@ -104542,10 +104542,10 @@ var require_list3 = __commonJS({
|
|
|
104542
104542
|
render() {
|
|
104543
104543
|
let message = this.getQuestion();
|
|
104544
104544
|
if (this.firstRender) {
|
|
104545
|
-
message +=
|
|
104545
|
+
message += chalk2.dim("(Use arrow keys)");
|
|
104546
104546
|
}
|
|
104547
104547
|
if (this.status === "answered") {
|
|
104548
|
-
message +=
|
|
104548
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
104549
104549
|
} else {
|
|
104550
104550
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
|
104551
104551
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -104614,7 +104614,7 @@ var require_list3 = __commonJS({
|
|
|
104614
104614
|
const isSelected = i - separatorOffset === pointer;
|
|
104615
104615
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
|
104616
104616
|
if (isSelected) {
|
|
104617
|
-
line =
|
|
104617
|
+
line = chalk2.cyan(line);
|
|
104618
104618
|
}
|
|
104619
104619
|
output2 += line + " \n";
|
|
104620
104620
|
});
|
|
@@ -104628,7 +104628,7 @@ var require_list3 = __commonJS({
|
|
|
104628
104628
|
var require_input2 = __commonJS({
|
|
104629
104629
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/input.js"(exports, module2) {
|
|
104630
104630
|
"use strict";
|
|
104631
|
-
var
|
|
104631
|
+
var chalk2 = require_source();
|
|
104632
104632
|
var { map: map2, takeUntil } = require_operators();
|
|
104633
104633
|
var Base = require_base4();
|
|
104634
104634
|
var observe2 = require_events2();
|
|
@@ -104658,10 +104658,10 @@ var require_input2 = __commonJS({
|
|
|
104658
104658
|
if (transformer) {
|
|
104659
104659
|
message += transformer(appendContent, this.answers, { isFinal });
|
|
104660
104660
|
} else {
|
|
104661
|
-
message += isFinal ?
|
|
104661
|
+
message += isFinal ? chalk2.cyan(appendContent) : appendContent;
|
|
104662
104662
|
}
|
|
104663
104663
|
if (error) {
|
|
104664
|
-
bottomContent =
|
|
104664
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
104665
104665
|
}
|
|
104666
104666
|
this.screen.render(message, bottomContent);
|
|
104667
104667
|
}
|
|
@@ -104734,7 +104734,7 @@ var require_confirm2 = __commonJS({
|
|
|
104734
104734
|
extend: require_extend(),
|
|
104735
104735
|
isBoolean: require_isBoolean()
|
|
104736
104736
|
};
|
|
104737
|
-
var
|
|
104737
|
+
var chalk2 = require_source();
|
|
104738
104738
|
var { take, takeUntil } = require_operators();
|
|
104739
104739
|
var Base = require_base4();
|
|
104740
104740
|
var observe2 = require_events2();
|
|
@@ -104767,7 +104767,7 @@ var require_confirm2 = __commonJS({
|
|
|
104767
104767
|
render(answer) {
|
|
104768
104768
|
let message = this.getQuestion();
|
|
104769
104769
|
if (typeof answer === "boolean") {
|
|
104770
|
-
message +=
|
|
104770
|
+
message += chalk2.cyan(answer ? "Yes" : "No");
|
|
104771
104771
|
} else {
|
|
104772
104772
|
message += this.rl.line;
|
|
104773
104773
|
}
|
|
@@ -104798,7 +104798,7 @@ var require_rawlist2 = __commonJS({
|
|
|
104798
104798
|
isNumber: require_isNumber(),
|
|
104799
104799
|
findIndex: require_findIndex2()
|
|
104800
104800
|
};
|
|
104801
|
-
var
|
|
104801
|
+
var chalk2 = require_source();
|
|
104802
104802
|
var { map: map2, takeUntil } = require_operators();
|
|
104803
104803
|
var Base = require_base4();
|
|
104804
104804
|
var Separator = require_separator2();
|
|
@@ -104853,7 +104853,7 @@ var require_rawlist2 = __commonJS({
|
|
|
104853
104853
|
let message = this.getQuestion();
|
|
104854
104854
|
let bottomContent = "";
|
|
104855
104855
|
if (this.status === "answered") {
|
|
104856
|
-
message +=
|
|
104856
|
+
message += chalk2.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
104857
104857
|
} else {
|
|
104858
104858
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
|
104859
104859
|
message += "\n" + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
|
@@ -104861,7 +104861,7 @@ var require_rawlist2 = __commonJS({
|
|
|
104861
104861
|
}
|
|
104862
104862
|
message += this.rl.line;
|
|
104863
104863
|
if (error) {
|
|
104864
|
-
bottomContent = "\n" +
|
|
104864
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
104865
104865
|
}
|
|
104866
104866
|
this.screen.render(message, bottomContent);
|
|
104867
104867
|
}
|
|
@@ -104919,7 +104919,7 @@ var require_rawlist2 = __commonJS({
|
|
|
104919
104919
|
const index = i - separatorOffset;
|
|
104920
104920
|
let display = index + 1 + ") " + choice.name;
|
|
104921
104921
|
if (index === pointer) {
|
|
104922
|
-
display =
|
|
104922
|
+
display = chalk2.cyan(display);
|
|
104923
104923
|
}
|
|
104924
104924
|
output2 += display;
|
|
104925
104925
|
});
|
|
@@ -105094,7 +105094,7 @@ var require_expand3 = __commonJS({
|
|
|
105094
105094
|
isNumber: require_isNumber(),
|
|
105095
105095
|
findIndex: require_findIndex2()
|
|
105096
105096
|
};
|
|
105097
|
-
var
|
|
105097
|
+
var chalk2 = require_source();
|
|
105098
105098
|
var { map: map2, takeUntil } = require_operators();
|
|
105099
105099
|
var Base = require_base4();
|
|
105100
105100
|
var Separator = require_separator2();
|
|
@@ -105137,7 +105137,7 @@ var require_expand3 = __commonJS({
|
|
|
105137
105137
|
let message = this.getQuestion();
|
|
105138
105138
|
let bottomContent = "";
|
|
105139
105139
|
if (this.status === "answered") {
|
|
105140
|
-
message +=
|
|
105140
|
+
message += chalk2.cyan(this.answer);
|
|
105141
105141
|
} else if (this.status === "expanded") {
|
|
105142
105142
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
|
105143
105143
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
|
@@ -105145,10 +105145,10 @@ var require_expand3 = __commonJS({
|
|
|
105145
105145
|
}
|
|
105146
105146
|
message += this.rl.line;
|
|
105147
105147
|
if (error) {
|
|
105148
|
-
bottomContent =
|
|
105148
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
105149
105149
|
}
|
|
105150
105150
|
if (hint) {
|
|
105151
|
-
bottomContent =
|
|
105151
|
+
bottomContent = chalk2.cyan(">> ") + hint;
|
|
105152
105152
|
}
|
|
105153
105153
|
this.screen.render(message, bottomContent);
|
|
105154
105154
|
}
|
|
@@ -105172,7 +105172,7 @@ var require_expand3 = __commonJS({
|
|
|
105172
105172
|
}
|
|
105173
105173
|
let choiceStr = choice.key + ") " + choice.name;
|
|
105174
105174
|
if (this.selectedKey === choice.key) {
|
|
105175
|
-
choiceStr =
|
|
105175
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
105176
105176
|
}
|
|
105177
105177
|
output2 += choiceStr;
|
|
105178
105178
|
});
|
|
@@ -105261,7 +105261,7 @@ var require_expand3 = __commonJS({
|
|
|
105261
105261
|
}
|
|
105262
105262
|
let choiceStr = choice.key + ") " + choice.name;
|
|
105263
105263
|
if (pointer === choice.key) {
|
|
105264
|
-
choiceStr =
|
|
105264
|
+
choiceStr = chalk2.cyan(choiceStr);
|
|
105265
105265
|
}
|
|
105266
105266
|
output2 += choiceStr;
|
|
105267
105267
|
});
|
|
@@ -105280,7 +105280,7 @@ var require_checkbox2 = __commonJS({
|
|
|
105280
105280
|
map: require_map2(),
|
|
105281
105281
|
isString: require_isString()
|
|
105282
105282
|
};
|
|
105283
|
-
var
|
|
105283
|
+
var chalk2 = require_source();
|
|
105284
105284
|
var cliCursor = require_cli_cursor();
|
|
105285
105285
|
var figures = require_figures();
|
|
105286
105286
|
var { map: map2, takeUntil } = require_operators();
|
|
@@ -105329,10 +105329,10 @@ var require_checkbox2 = __commonJS({
|
|
|
105329
105329
|
let message = this.getQuestion();
|
|
105330
105330
|
let bottomContent = "";
|
|
105331
105331
|
if (!this.spaceKeyPressed) {
|
|
105332
|
-
message += "(Press " +
|
|
105332
|
+
message += "(Press " + chalk2.cyan.bold("<space>") + " to select, " + chalk2.cyan.bold("<a>") + " to toggle all, " + chalk2.cyan.bold("<i>") + " to invert selection)";
|
|
105333
105333
|
}
|
|
105334
105334
|
if (this.status === "answered") {
|
|
105335
|
-
message +=
|
|
105335
|
+
message += chalk2.cyan(this.selection.join(", "));
|
|
105336
105336
|
} else {
|
|
105337
105337
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
|
105338
105338
|
const indexPosition = this.opt.choices.indexOf(
|
|
@@ -105355,7 +105355,7 @@ var require_checkbox2 = __commonJS({
|
|
|
105355
105355
|
message += "\n" + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
|
105356
105356
|
}
|
|
105357
105357
|
if (error) {
|
|
105358
|
-
bottomContent =
|
|
105358
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
105359
105359
|
}
|
|
105360
105360
|
this.screen.render(message, bottomContent);
|
|
105361
105361
|
}
|
|
@@ -105439,7 +105439,7 @@ var require_checkbox2 = __commonJS({
|
|
|
105439
105439
|
} else {
|
|
105440
105440
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
|
105441
105441
|
if (i - separatorOffset === pointer) {
|
|
105442
|
-
output2 +=
|
|
105442
|
+
output2 += chalk2.cyan(figures.pointer + line);
|
|
105443
105443
|
} else {
|
|
105444
105444
|
output2 += " " + line;
|
|
105445
105445
|
}
|
|
@@ -105449,7 +105449,7 @@ var require_checkbox2 = __commonJS({
|
|
|
105449
105449
|
return output2.replace(/\n$/, "");
|
|
105450
105450
|
}
|
|
105451
105451
|
function getCheckbox(checked) {
|
|
105452
|
-
return checked ?
|
|
105452
|
+
return checked ? chalk2.green(figures.radioOn) : figures.radioOff;
|
|
105453
105453
|
}
|
|
105454
105454
|
module2.exports = CheckboxPrompt;
|
|
105455
105455
|
}
|
|
@@ -105459,7 +105459,7 @@ var require_checkbox2 = __commonJS({
|
|
|
105459
105459
|
var require_password2 = __commonJS({
|
|
105460
105460
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/password.js"(exports, module2) {
|
|
105461
105461
|
"use strict";
|
|
105462
|
-
var
|
|
105462
|
+
var chalk2 = require_source();
|
|
105463
105463
|
var { map: map2, takeUntil } = require_operators();
|
|
105464
105464
|
var Base = require_base4();
|
|
105465
105465
|
var observe2 = require_events2();
|
|
@@ -105492,15 +105492,15 @@ var require_password2 = __commonJS({
|
|
|
105492
105492
|
message += this.getMaskedValue(this.rl.line || "");
|
|
105493
105493
|
}
|
|
105494
105494
|
if (error) {
|
|
105495
|
-
bottomContent = "\n" +
|
|
105495
|
+
bottomContent = "\n" + chalk2.red(">> ") + error;
|
|
105496
105496
|
}
|
|
105497
105497
|
this.screen.render(message, bottomContent);
|
|
105498
105498
|
}
|
|
105499
105499
|
getMaskedValue(value) {
|
|
105500
105500
|
if (this.status === "answered") {
|
|
105501
|
-
return this.opt.mask ?
|
|
105501
|
+
return this.opt.mask ? chalk2.cyan(mask(value, this.opt.mask)) : chalk2.italic.dim("[hidden]");
|
|
105502
105502
|
}
|
|
105503
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
|
105503
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk2.italic.dim("[input is hidden] ");
|
|
105504
105504
|
}
|
|
105505
105505
|
getSpinningValue(value) {
|
|
105506
105506
|
return this.getMaskedValue(value);
|
|
@@ -105536,7 +105536,7 @@ var require_password2 = __commonJS({
|
|
|
105536
105536
|
var require_editor2 = __commonJS({
|
|
105537
105537
|
"../../../../node_modules/.pnpm/inquirer@8.1.3/node_modules/inquirer/lib/prompts/editor.js"(exports, module2) {
|
|
105538
105538
|
"use strict";
|
|
105539
|
-
var
|
|
105539
|
+
var chalk2 = require_source();
|
|
105540
105540
|
var { editAsync } = require_main();
|
|
105541
105541
|
var Base = require_base4();
|
|
105542
105542
|
var observe2 = require_events2();
|
|
@@ -105559,12 +105559,12 @@ var require_editor2 = __commonJS({
|
|
|
105559
105559
|
let bottomContent = "";
|
|
105560
105560
|
let message = this.getQuestion();
|
|
105561
105561
|
if (this.status === "answered") {
|
|
105562
|
-
message +=
|
|
105562
|
+
message += chalk2.dim("Received");
|
|
105563
105563
|
} else {
|
|
105564
|
-
message +=
|
|
105564
|
+
message += chalk2.dim("Press <enter> to launch your preferred editor.");
|
|
105565
105565
|
}
|
|
105566
105566
|
if (error) {
|
|
105567
|
-
bottomContent =
|
|
105567
|
+
bottomContent = chalk2.red(">> ") + error;
|
|
105568
105568
|
}
|
|
105569
105569
|
this.screen.render(message, bottomContent);
|
|
105570
105570
|
}
|
|
@@ -136245,6 +136245,26 @@ var require_compiled2 = __commonJS({
|
|
|
136245
136245
|
}
|
|
136246
136246
|
});
|
|
136247
136247
|
|
|
136248
|
+
// ../../../toolkit/utils/dist/commands.js
|
|
136249
|
+
var require_commands = __commonJS({
|
|
136250
|
+
"../../../toolkit/utils/dist/commands.js"(exports) {
|
|
136251
|
+
"use strict";
|
|
136252
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136253
|
+
exports.isDevCommand = exports.getCommand = void 0;
|
|
136254
|
+
var getCommand = () => {
|
|
136255
|
+
const args = process.argv.slice(2);
|
|
136256
|
+
const command = args[0];
|
|
136257
|
+
return command;
|
|
136258
|
+
};
|
|
136259
|
+
exports.getCommand = getCommand;
|
|
136260
|
+
var isDevCommand = () => {
|
|
136261
|
+
const command = (0, exports.getCommand)();
|
|
136262
|
+
return command === "dev" || command === "start";
|
|
136263
|
+
};
|
|
136264
|
+
exports.isDevCommand = isDevCommand;
|
|
136265
|
+
}
|
|
136266
|
+
});
|
|
136267
|
+
|
|
136248
136268
|
// ../../../toolkit/utils/dist/format.js
|
|
136249
136269
|
var require_format2 = __commonJS({
|
|
136250
136270
|
"../../../toolkit/utils/dist/format.js"(exports) {
|
|
@@ -136620,12 +136640,14 @@ var require_node_env2 = __commonJS({
|
|
|
136620
136640
|
"../../../toolkit/utils/dist/is/node-env.js"(exports) {
|
|
136621
136641
|
"use strict";
|
|
136622
136642
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136623
|
-
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = void 0;
|
|
136624
|
-
var
|
|
136643
|
+
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = exports.getNodeEnv = void 0;
|
|
136644
|
+
var getNodeEnv = () => process.env.NODE_ENV || "development";
|
|
136645
|
+
exports.getNodeEnv = getNodeEnv;
|
|
136646
|
+
var isDev = () => (0, exports.getNodeEnv)() === "development";
|
|
136625
136647
|
exports.isDev = isDev;
|
|
136626
|
-
var isProd = () =>
|
|
136648
|
+
var isProd = () => (0, exports.getNodeEnv)() === "production";
|
|
136627
136649
|
exports.isProd = isProd;
|
|
136628
|
-
var isTest = () =>
|
|
136650
|
+
var isTest = () => (0, exports.getNodeEnv)() === "test";
|
|
136629
136651
|
exports.isTest = isTest;
|
|
136630
136652
|
var isProdProfile = () => (0, exports.isProd)() && process.argv.includes("--profile");
|
|
136631
136653
|
exports.isProdProfile = isProdProfile;
|
|
@@ -136768,10 +136790,10 @@ var require_is2 = __commonJS({
|
|
|
136768
136790
|
|
|
136769
136791
|
// ../../../toolkit/utils/dist/compatRequire.js
|
|
136770
136792
|
var require_compatRequire2 = __commonJS({
|
|
136771
|
-
"../../../toolkit/utils/dist/compatRequire.js"(exports) {
|
|
136793
|
+
"../../../toolkit/utils/dist/compatRequire.js"(exports, module2) {
|
|
136772
136794
|
"use strict";
|
|
136773
136795
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136774
|
-
exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
|
136796
|
+
exports.deleteRequireCache = exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
|
136775
136797
|
var findExists_1 = require_findExists2();
|
|
136776
136798
|
var compatRequire = (filePath, interop = true) => {
|
|
136777
136799
|
const mod = require(filePath);
|
|
@@ -136798,6 +136820,15 @@ var require_compatRequire2 = __commonJS({
|
|
|
136798
136820
|
});
|
|
136799
136821
|
};
|
|
136800
136822
|
exports.cleanRequireCache = cleanRequireCache;
|
|
136823
|
+
function deleteRequireCache(path2) {
|
|
136824
|
+
if (require.cache[path2]) {
|
|
136825
|
+
delete require.cache[path2];
|
|
136826
|
+
}
|
|
136827
|
+
if (module2.children) {
|
|
136828
|
+
module2.children = module2.children.filter((item) => item.filename !== path2);
|
|
136829
|
+
}
|
|
136830
|
+
}
|
|
136831
|
+
exports.deleteRequireCache = deleteRequireCache;
|
|
136801
136832
|
}
|
|
136802
136833
|
});
|
|
136803
136834
|
|
|
@@ -136819,7 +136850,7 @@ var require_constants6 = __commonJS({
|
|
|
136819
136850
|
exports.SERVER_DIR = "server";
|
|
136820
136851
|
exports.SHARED_DIR = "shared";
|
|
136821
136852
|
exports.CONFIG_CACHE_DIR = "./node_modules/.cache/node-bundle-require";
|
|
136822
|
-
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".
|
|
136853
|
+
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
|
136823
136854
|
exports.OUTPUT_CONFIG_FILE = "modern.config.json";
|
|
136824
136855
|
exports.DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
|
136825
136856
|
exports.ROUTE_MINIFEST_FILE = "routes-manifest.json";
|
|
@@ -137310,7 +137341,7 @@ var require_nodeEnv2 = __commonJS({
|
|
|
137310
137341
|
});
|
|
137311
137342
|
}
|
|
137312
137343
|
exports.canUseNpm = canUseNpm;
|
|
137313
|
-
function
|
|
137344
|
+
function canUseYarn2() {
|
|
137314
137345
|
return __async(this, null, function* () {
|
|
137315
137346
|
try {
|
|
137316
137347
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
|
@@ -137320,7 +137351,7 @@ var require_nodeEnv2 = __commonJS({
|
|
|
137320
137351
|
}
|
|
137321
137352
|
});
|
|
137322
137353
|
}
|
|
137323
|
-
exports.canUseYarn =
|
|
137354
|
+
exports.canUseYarn = canUseYarn2;
|
|
137324
137355
|
function canUsePnpm() {
|
|
137325
137356
|
return __async(this, null, function* () {
|
|
137326
137357
|
try {
|
|
@@ -138399,6 +138430,7 @@ var require_dist3 = __commonJS({
|
|
|
138399
138430
|
};
|
|
138400
138431
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
138401
138432
|
__exportStar(require_compiled2(), exports);
|
|
138433
|
+
__exportStar(require_commands(), exports);
|
|
138402
138434
|
__exportStar(require_format2(), exports);
|
|
138403
138435
|
__exportStar(require_FileSizeReporter2(), exports);
|
|
138404
138436
|
__exportStar(require_printBuildError2(), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/packages-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": [
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@types/node": "^14",
|
|
28
28
|
"jest": "^27",
|
|
29
29
|
"typescript": "^4",
|
|
30
|
-
"@
|
|
31
|
-
"@modern-js/generator-
|
|
32
|
-
"@
|
|
33
|
-
"@scripts/
|
|
30
|
+
"@scripts/build": "2.4.0",
|
|
31
|
+
"@modern-js/generator-common": "3.0.6",
|
|
32
|
+
"@modern-js/generator-utils": "3.0.6",
|
|
33
|
+
"@scripts/jest-config": "2.4.0"
|
|
34
34
|
},
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"publishConfig": {
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
3
|
+
import { AppAPI } from '@modern-js/codesmith-api-app';
|
|
4
|
+
import { JsonAPI } from '@modern-js/codesmith-api-json';
|
|
5
|
+
import { PackageManager } from '@modern-js/generator-common';
|
|
6
|
+
import { fs } from '@modern-js/generator-utils';
|
|
7
|
+
|
|
8
|
+
const handleTemplateFile = async (
|
|
9
|
+
context: GeneratorContext,
|
|
10
|
+
generator: GeneratorCore,
|
|
11
|
+
) => {
|
|
12
|
+
const { packageManager, packagesInfo } = context.config;
|
|
13
|
+
const jsonAPI = new JsonAPI(generator);
|
|
14
|
+
if (packageManager === PackageManager.Pnpm) {
|
|
15
|
+
const update: Record<string, string> = {};
|
|
16
|
+
Object.entries(packagesInfo || {}).forEach(([name, version]) => {
|
|
17
|
+
update[`pnpm.overrides.${name}`] = version as string;
|
|
18
|
+
});
|
|
19
|
+
await jsonAPI.update(context.materials.default.get('package.json'), {
|
|
20
|
+
query: {},
|
|
21
|
+
update: {
|
|
22
|
+
$set: update,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
const pkgInfo = fs.readJSONSync(
|
|
27
|
+
path.join(context.materials.default.basePath, 'package.json'),
|
|
28
|
+
'utf-8',
|
|
29
|
+
);
|
|
30
|
+
const { dependencies = {}, devDependencies = {} } = pkgInfo;
|
|
31
|
+
|
|
32
|
+
const update: Record<string, string> = {};
|
|
33
|
+
Object.entries(packagesInfo || {}).forEach(([name, version]) => {
|
|
34
|
+
update[`resolutions.${name}`] = version as string;
|
|
35
|
+
if (dependencies[name]) {
|
|
36
|
+
update[`dependencies.${name}`] = version as string;
|
|
37
|
+
}
|
|
38
|
+
if (devDependencies[name]) {
|
|
39
|
+
update[`devDependencies.${name}`] = version as string;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
await jsonAPI.update(context.materials.default.get('package.json'), {
|
|
43
|
+
query: {},
|
|
44
|
+
update: {
|
|
45
|
+
$set: update,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
52
|
+
const appApi = new AppAPI(context, generator);
|
|
53
|
+
const { locale } = context.config;
|
|
54
|
+
appApi.i18n.changeLanguage({ locale });
|
|
55
|
+
|
|
56
|
+
if (!(await appApi.checkEnvironment())) {
|
|
57
|
+
// eslint-disable-next-line no-process-exit
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
generator.logger.debug(`start run @modern-js/packages-generator`);
|
|
62
|
+
generator.logger.debug(`context=${JSON.stringify(context)}`);
|
|
63
|
+
generator.logger.debug(`context.data=${JSON.stringify(context.data)}`);
|
|
64
|
+
|
|
65
|
+
await handleTemplateFile(context, generator);
|
|
66
|
+
|
|
67
|
+
generator.logger.debug(`forge @modern-js/packages-generator succeed `);
|
|
68
|
+
};
|