create-vue 3.18.3 → 3.18.4
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/LICENSE +0 -29
- package/bundle.js +218 -432
- package/package.json +5 -6
- package/template/base/package.json +3 -3
- package/template/config/cypress/package.json +1 -1
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/jsx/package.json +3 -3
- package/template/config/nightwatch/package.json +4 -4
- package/template/config/nightwatch-ct/package.json +1 -1
- package/template/config/pinia/package.json +1 -1
- package/template/config/router/package.json +2 -2
- package/template/config/typescript/package.json +3 -3
- package/template/config/vitest/package.json +3 -3
- package/template/formatting/oxfmt/.vscode/settings.json +14 -0
- package/template/formatting/oxfmt/_oxfmtrc.jsonc +5 -0
- package/template/formatting/oxfmt/_prettierrc.json +7 -0
- package/template/formatting/oxfmt/package.json +13 -0
- package/template/formatting/prettier/.vscode/extensions.json +3 -0
- package/template/formatting/prettier/.vscode/settings.json +4 -0
- package/template/{config → formatting}/prettier/package.json +1 -1
- package/template/linting/base/_editorconfig +8 -0
- package/template/linting/base/package.json +9 -0
- package/template/linting/core/js/eslint.config.js.data.mjs +15 -0
- package/template/linting/core/js/eslint.config.js.ejs +27 -0
- package/template/linting/core/js/package.json +8 -0
- package/template/linting/core/ts/eslint.config.js.data.mjs +15 -0
- package/template/linting/core/ts/eslint.config.js.ejs +24 -0
- package/template/linting/core/ts/package.json +9 -0
- package/template/linting/cypress/eslint.config.js.data.mjs +19 -0
- package/template/linting/cypress/package.json +5 -0
- package/template/linting/cypress-ct/eslint.config.js.data.mjs +25 -0
- package/template/linting/oxlint/.vscode/extensions.json +3 -0
- package/template/linting/oxlint/_ oxlintrc.json +10 -0
- package/template/linting/oxlint/eslint.config.js.data.mjs +12 -0
- package/template/linting/oxlint/package.json +12 -0
- package/template/linting/playwright/eslint.config.js.data.mjs +16 -0
- package/template/linting/playwright/package.json +5 -0
- package/template/linting/prettier/eslint.config.js.data.mjs +12 -0
- package/template/linting/prettier/package.json +6 -0
- package/template/linting/vitest/eslint.config.js.data.mjs +16 -0
- package/template/linting/vitest/package.json +5 -0
- package/template/config/prettier/.vscode/extensions.json +0 -3
- package/template/config/prettier/.vscode/settings.json +0 -4
- package/template/eslint/package.json +0 -7
- /package/template/{config/oxlint → formatting/oxfmt}/.vscode/extensions.json +0 -0
- /package/template/{config → formatting}/prettier/_prettierrc.json +0 -0
- /package/template/{config/eslint → linting/base}/.vscode/extensions.json +0 -0
- /package/template/{config/eslint → linting/base}/.vscode/settings.json +0 -0
- /package/template/{config/prettier → linting/base}/_gitattributes +0 -0
package/bundle.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.18.
|
|
2
|
+
/*! create-vue v3.18.4 | MIT */
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
|
-
import * as path from "node:path";
|
|
5
|
+
import * as path$1 from "node:path";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import { parseArgs, stripVTControlCharacters } from "node:util";
|
|
8
8
|
import y, { stdin, stdout } from "node:process";
|
|
9
9
|
import * as g from "node:readline";
|
|
10
10
|
import O from "node:readline";
|
|
11
11
|
import { Writable } from "node:stream";
|
|
12
|
-
import * as path
|
|
12
|
+
import * as path from "path";
|
|
13
13
|
|
|
14
14
|
//#region rolldown:runtime
|
|
15
15
|
var __create = Object.create;
|
|
@@ -99,20 +99,20 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
101
101
|
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
102
|
-
let p
|
|
103
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p
|
|
102
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
103
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
104
104
|
let formatter = (open, close, replace = open) => (input) => {
|
|
105
105
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
106
106
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
107
107
|
};
|
|
108
108
|
let replaceClose = (string, close, replace, index) => {
|
|
109
|
-
let result = "", cursor
|
|
109
|
+
let result = "", cursor = 0;
|
|
110
110
|
do {
|
|
111
|
-
result += string.substring(cursor
|
|
112
|
-
cursor
|
|
113
|
-
index = string.indexOf(close, cursor
|
|
111
|
+
result += string.substring(cursor, index) + replace;
|
|
112
|
+
cursor = index + close.length;
|
|
113
|
+
index = string.indexOf(close, cursor);
|
|
114
114
|
} while (~index);
|
|
115
|
-
return result + string.substring(cursor
|
|
115
|
+
return result + string.substring(cursor);
|
|
116
116
|
};
|
|
117
117
|
let createColors = (enabled = isColorSupported) => {
|
|
118
118
|
let f = enabled ? formatter : () => String;
|
|
@@ -167,8 +167,8 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
167
167
|
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
|
|
170
|
-
var import_src
|
|
171
|
-
var import_picocolors
|
|
170
|
+
var import_src = require_src();
|
|
171
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
172
172
|
function DD({ onlyFirst: e$1 = !1 } = {}) {
|
|
173
173
|
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
174
174
|
return new RegExp(t, e$1 ? void 0 : "g");
|
|
@@ -486,7 +486,7 @@ function fD({ input: e$1 = stdin, output: u$1 = stdout, overwrite: t = !0, hideC
|
|
|
486
486
|
C$1,
|
|
487
487
|
n
|
|
488
488
|
], "cancel")) {
|
|
489
|
-
F$1 && u$1.write(import_src
|
|
489
|
+
F$1 && u$1.write(import_src.cursor.show), process.exit(0);
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
if (!t) return;
|
|
@@ -497,8 +497,8 @@ function fD({ input: e$1 = stdin, output: u$1 = stdout, overwrite: t = !0, hideC
|
|
|
497
497
|
});
|
|
498
498
|
});
|
|
499
499
|
};
|
|
500
|
-
return F$1 && u$1.write(import_src
|
|
501
|
-
e$1.off("keypress", i), F$1 && u$1.write(import_src
|
|
500
|
+
return F$1 && u$1.write(import_src.cursor.hide), e$1.once("keypress", i), () => {
|
|
501
|
+
e$1.off("keypress", i), F$1 && u$1.write(import_src.cursor.show), e$1.isTTY && !AD && e$1.setRawMode(!1), s.terminal = !1, s.close();
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
504
|
var gD = Object.defineProperty, vD = (e$1, u$1, t) => u$1 in e$1 ? gD(e$1, u$1, {
|
|
@@ -553,9 +553,9 @@ var x$1 = class {
|
|
|
553
553
|
escapeCodeTimeout: 50,
|
|
554
554
|
terminal: !0
|
|
555
555
|
}), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
556
|
-
this.output.write(import_src
|
|
556
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(this.value);
|
|
557
557
|
}), this.once("cancel", () => {
|
|
558
|
-
this.output.write(import_src
|
|
558
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(S);
|
|
559
559
|
});
|
|
560
560
|
});
|
|
561
561
|
}
|
|
@@ -580,32 +580,32 @@ var x$1 = class {
|
|
|
580
580
|
restoreCursor() {
|
|
581
581
|
const u$1 = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
|
|
582
582
|
`).length - 1;
|
|
583
|
-
this.output.write(import_src
|
|
583
|
+
this.output.write(import_src.cursor.move(-999, u$1 * -1));
|
|
584
584
|
}
|
|
585
585
|
render() {
|
|
586
586
|
const u$1 = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
|
|
587
587
|
if (u$1 !== this._prevFrame) {
|
|
588
|
-
if (this.state === "initial") this.output.write(import_src
|
|
588
|
+
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
589
589
|
else {
|
|
590
590
|
const t = BD(this._prevFrame, u$1);
|
|
591
591
|
if (this.restoreCursor(), t && t?.length === 1) {
|
|
592
592
|
const F$1 = t[0];
|
|
593
|
-
this.output.write(import_src
|
|
593
|
+
this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.lines(1));
|
|
594
594
|
const s = u$1.split(`
|
|
595
595
|
`);
|
|
596
|
-
this.output.write(s[F$1]), this._prevFrame = u$1, this.output.write(import_src
|
|
596
|
+
this.output.write(s[F$1]), this._prevFrame = u$1, this.output.write(import_src.cursor.move(0, s.length - F$1 - 1));
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
599
|
if (t && t?.length > 1) {
|
|
600
600
|
const F$1 = t[0];
|
|
601
|
-
this.output.write(import_src
|
|
601
|
+
this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.down());
|
|
602
602
|
const s = u$1.split(`
|
|
603
603
|
`).slice(F$1);
|
|
604
604
|
this.output.write(s.join(`
|
|
605
605
|
`)), this._prevFrame = u$1;
|
|
606
606
|
return;
|
|
607
607
|
}
|
|
608
|
-
this.output.write(import_src
|
|
608
|
+
this.output.write(import_src.erase.down());
|
|
609
609
|
}
|
|
610
610
|
this.output.write(u$1), this.state === "initial" && (this.state = "active"), this._prevFrame = u$1;
|
|
611
611
|
}
|
|
@@ -622,7 +622,7 @@ var dD = class extends x$1 {
|
|
|
622
622
|
super(u$1, !1), this.value = !!u$1.initialValue, this.on("value", () => {
|
|
623
623
|
this.value = this._value;
|
|
624
624
|
}), this.on("confirm", (t) => {
|
|
625
|
-
this.output.write(import_src
|
|
625
|
+
this.output.write(import_src.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
626
626
|
}), this.on("cursor", () => {
|
|
627
627
|
this.value = !this.value;
|
|
628
628
|
});
|
|
@@ -734,10 +734,10 @@ var MD = class extends x$1 {
|
|
|
734
734
|
super(t), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u$1 ?? "•", this.on("finalize", () => {
|
|
735
735
|
this.valueWithCursor = this.masked;
|
|
736
736
|
}), this.on("value", () => {
|
|
737
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors
|
|
737
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
738
738
|
else {
|
|
739
739
|
const F$1 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
740
|
-
this.valueWithCursor = `${F$1}${import_picocolors
|
|
740
|
+
this.valueWithCursor = `${F$1}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
}
|
|
@@ -799,7 +799,7 @@ var RD = class extends x$1 {
|
|
|
799
799
|
if (this.state === "submit") return this.value;
|
|
800
800
|
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
801
801
|
const u$1 = this.value.slice(0, this.cursor), [t, ...F$1] = this.value.slice(this.cursor);
|
|
802
|
-
return `${u$1}${import_picocolors
|
|
802
|
+
return `${u$1}${import_picocolors.default.inverse(t)}${F$1.join("")}`;
|
|
803
803
|
}
|
|
804
804
|
get cursor() {
|
|
805
805
|
return this._cursor;
|
|
@@ -813,27 +813,25 @@ var RD = class extends x$1 {
|
|
|
813
813
|
|
|
814
814
|
//#endregion
|
|
815
815
|
//#region node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
816
|
-
var import_picocolors$1 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
817
|
-
var import_src = require_src();
|
|
818
816
|
function ce() {
|
|
819
817
|
return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
820
818
|
}
|
|
821
819
|
const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), $e = u("▪", "•"), _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
|
|
822
820
|
switch (t) {
|
|
823
821
|
case "initial":
|
|
824
|
-
case "active": return import_picocolors
|
|
825
|
-
case "cancel": return import_picocolors
|
|
826
|
-
case "error": return import_picocolors
|
|
827
|
-
case "submit": return import_picocolors
|
|
822
|
+
case "active": return import_picocolors.default.cyan(le);
|
|
823
|
+
case "cancel": return import_picocolors.default.red(L);
|
|
824
|
+
case "error": return import_picocolors.default.yellow(W);
|
|
825
|
+
case "submit": return import_picocolors.default.green(C);
|
|
828
826
|
}
|
|
829
827
|
}, G = (t) => {
|
|
830
828
|
const { cursor: n, options: r$1, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
831
829
|
let l$1 = 0;
|
|
832
830
|
n >= l$1 + a - 3 ? l$1 = Math.max(Math.min(n - a + 3, r$1.length - a), 0) : n < l$1 + 2 && (l$1 = Math.max(n - 2, 0));
|
|
833
831
|
const $$1 = a < r$1.length && l$1 > 0, g$1 = a < r$1.length && l$1 + a < r$1.length;
|
|
834
|
-
return r$1.slice(l$1, l$1 + a).map((p$
|
|
832
|
+
return r$1.slice(l$1, l$1 + a).map((p$1, v$1, f) => {
|
|
835
833
|
const j = v$1 === 0 && $$1, E = v$1 === f.length - 1 && g$1;
|
|
836
|
-
return j || E ? import_picocolors
|
|
834
|
+
return j || E ? import_picocolors.default.dim("...") : i(p$1, v$1 + l$1 === n);
|
|
837
835
|
});
|
|
838
836
|
}, he = (t) => new RD({
|
|
839
837
|
validate: t.validate,
|
|
@@ -841,19 +839,19 @@ const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"),
|
|
|
841
839
|
defaultValue: t.defaultValue,
|
|
842
840
|
initialValue: t.initialValue,
|
|
843
841
|
render() {
|
|
844
|
-
const n = `${import_picocolors
|
|
842
|
+
const n = `${import_picocolors.default.gray(o)}
|
|
845
843
|
${b(this.state)} ${t.message}
|
|
846
|
-
`, r$1 = t.placeholder ? import_picocolors
|
|
844
|
+
`, r$1 = t.placeholder ? import_picocolors.default.inverse(t.placeholder[0]) + import_picocolors.default.dim(t.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), i = this.value ? this.valueWithCursor : r$1;
|
|
847
845
|
switch (this.state) {
|
|
848
846
|
case "error": return `${n.trim()}
|
|
849
|
-
${import_picocolors
|
|
850
|
-
${import_picocolors
|
|
847
|
+
${import_picocolors.default.yellow(o)} ${i}
|
|
848
|
+
${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
|
|
851
849
|
`;
|
|
852
|
-
case "submit": return `${n}${import_picocolors
|
|
853
|
-
case "cancel": return `${n}${import_picocolors
|
|
854
|
-
${import_picocolors
|
|
855
|
-
default: return `${n}${import_picocolors
|
|
856
|
-
${import_picocolors
|
|
850
|
+
case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
|
|
851
|
+
case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
852
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
853
|
+
default: return `${n}${import_picocolors.default.cyan(o)} ${i}
|
|
854
|
+
${import_picocolors.default.cyan(d)}
|
|
857
855
|
`;
|
|
858
856
|
}
|
|
859
857
|
}
|
|
@@ -861,19 +859,19 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
861
859
|
validate: t.validate,
|
|
862
860
|
mask: t.mask ?? $e,
|
|
863
861
|
render() {
|
|
864
|
-
const n = `${import_picocolors
|
|
862
|
+
const n = `${import_picocolors.default.gray(o)}
|
|
865
863
|
${b(this.state)} ${t.message}
|
|
866
864
|
`, r$1 = this.valueWithCursor, i = this.masked;
|
|
867
865
|
switch (this.state) {
|
|
868
866
|
case "error": return `${n.trim()}
|
|
869
|
-
${import_picocolors
|
|
870
|
-
${import_picocolors
|
|
867
|
+
${import_picocolors.default.yellow(o)} ${i}
|
|
868
|
+
${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
|
|
871
869
|
`;
|
|
872
|
-
case "submit": return `${n}${import_picocolors
|
|
873
|
-
case "cancel": return `${n}${import_picocolors
|
|
874
|
-
${import_picocolors
|
|
875
|
-
default: return `${n}${import_picocolors
|
|
876
|
-
${import_picocolors
|
|
870
|
+
case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(i)}`;
|
|
871
|
+
case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i ?? ""))}${i ? `
|
|
872
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
873
|
+
default: return `${n}${import_picocolors.default.cyan(o)} ${r$1}
|
|
874
|
+
${import_picocolors.default.cyan(d)}
|
|
877
875
|
`;
|
|
878
876
|
}
|
|
879
877
|
}
|
|
@@ -884,15 +882,15 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
884
882
|
inactive: r$1,
|
|
885
883
|
initialValue: t.initialValue ?? !0,
|
|
886
884
|
render() {
|
|
887
|
-
const i = `${import_picocolors
|
|
885
|
+
const i = `${import_picocolors.default.gray(o)}
|
|
888
886
|
${b(this.state)} ${t.message}
|
|
889
887
|
`, s = this.value ? n : r$1;
|
|
890
888
|
switch (this.state) {
|
|
891
|
-
case "submit": return `${i}${import_picocolors
|
|
892
|
-
case "cancel": return `${i}${import_picocolors
|
|
893
|
-
${import_picocolors
|
|
894
|
-
default: return `${i}${import_picocolors
|
|
895
|
-
${import_picocolors
|
|
889
|
+
case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
|
|
890
|
+
case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
|
|
891
|
+
${import_picocolors.default.gray(o)}`;
|
|
892
|
+
default: return `${i}${import_picocolors.default.cyan(o)} ${this.value ? `${import_picocolors.default.green(k)} ${n}` : `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(n)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(r$1)}` : `${import_picocolors.default.green(k)} ${r$1}`}
|
|
893
|
+
${import_picocolors.default.cyan(d)}
|
|
896
894
|
`;
|
|
897
895
|
}
|
|
898
896
|
}
|
|
@@ -901,31 +899,31 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
901
899
|
const n = (r$1, i) => {
|
|
902
900
|
const s = r$1.label ?? String(r$1.value);
|
|
903
901
|
switch (i) {
|
|
904
|
-
case "selected": return `${import_picocolors
|
|
905
|
-
case "active": return `${import_picocolors
|
|
906
|
-
case "cancelled": return `${import_picocolors
|
|
907
|
-
default: return `${import_picocolors
|
|
902
|
+
case "selected": return `${import_picocolors.default.dim(s)}`;
|
|
903
|
+
case "active": return `${import_picocolors.default.green(k)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}`;
|
|
904
|
+
case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
|
|
905
|
+
default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
|
|
908
906
|
}
|
|
909
907
|
};
|
|
910
908
|
return new LD({
|
|
911
909
|
options: t.options,
|
|
912
910
|
initialValue: t.initialValue,
|
|
913
911
|
render() {
|
|
914
|
-
const r$1 = `${import_picocolors
|
|
912
|
+
const r$1 = `${import_picocolors.default.gray(o)}
|
|
915
913
|
${b(this.state)} ${t.message}
|
|
916
914
|
`;
|
|
917
915
|
switch (this.state) {
|
|
918
|
-
case "submit": return `${r$1}${import_picocolors
|
|
919
|
-
case "cancel": return `${r$1}${import_picocolors
|
|
920
|
-
${import_picocolors
|
|
921
|
-
default: return `${r$1}${import_picocolors
|
|
916
|
+
case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
917
|
+
case "cancel": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
918
|
+
${import_picocolors.default.gray(o)}`;
|
|
919
|
+
default: return `${r$1}${import_picocolors.default.cyan(o)} ${G({
|
|
922
920
|
cursor: this.cursor,
|
|
923
921
|
options: this.options,
|
|
924
922
|
maxItems: t.maxItems,
|
|
925
923
|
style: (i, s) => n(i, s ? "active" : "inactive")
|
|
926
924
|
}).join(`
|
|
927
|
-
${import_picocolors
|
|
928
|
-
${import_picocolors
|
|
925
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
926
|
+
${import_picocolors.default.cyan(d)}
|
|
929
927
|
`;
|
|
930
928
|
}
|
|
931
929
|
}
|
|
@@ -933,22 +931,22 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
933
931
|
}, we = (t) => {
|
|
934
932
|
const n = (r$1, i = "inactive") => {
|
|
935
933
|
const s = r$1.label ?? String(r$1.value);
|
|
936
|
-
return i === "selected" ? `${import_picocolors
|
|
934
|
+
return i === "selected" ? `${import_picocolors.default.dim(s)}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active" ? `${import_picocolors.default.bgCyan(import_picocolors.default.gray(` ${r$1.value} `))} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${r$1.value} `)))} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}`;
|
|
937
935
|
};
|
|
938
936
|
return new ID({
|
|
939
937
|
options: t.options,
|
|
940
938
|
initialValue: t.initialValue,
|
|
941
939
|
render() {
|
|
942
|
-
const r$1 = `${import_picocolors
|
|
940
|
+
const r$1 = `${import_picocolors.default.gray(o)}
|
|
943
941
|
${b(this.state)} ${t.message}
|
|
944
942
|
`;
|
|
945
943
|
switch (this.state) {
|
|
946
|
-
case "submit": return `${r$1}${import_picocolors
|
|
947
|
-
case "cancel": return `${r$1}${import_picocolors
|
|
948
|
-
${import_picocolors
|
|
949
|
-
default: return `${r$1}${import_picocolors
|
|
950
|
-
${import_picocolors
|
|
951
|
-
${import_picocolors
|
|
944
|
+
case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
|
|
945
|
+
case "cancel": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[0], "cancelled")}
|
|
946
|
+
${import_picocolors.default.gray(o)}`;
|
|
947
|
+
default: return `${r$1}${import_picocolors.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
|
|
948
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
949
|
+
${import_picocolors.default.cyan(d)}
|
|
952
950
|
`;
|
|
953
951
|
}
|
|
954
952
|
}
|
|
@@ -956,7 +954,7 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
956
954
|
}, fe = (t) => {
|
|
957
955
|
const n = (r$1, i) => {
|
|
958
956
|
const s = r$1.label ?? String(r$1.value);
|
|
959
|
-
return i === "active" ? `${import_picocolors
|
|
957
|
+
return i === "active" ? `${import_picocolors.default.cyan(A)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s)} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active-selected" ? `${import_picocolors.default.green(T)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "submitted" ? `${import_picocolors.default.dim(s)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s)}`;
|
|
960
958
|
};
|
|
961
959
|
return new SD({
|
|
962
960
|
options: t.options,
|
|
@@ -965,63 +963,63 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
965
963
|
cursorAt: t.cursorAt,
|
|
966
964
|
validate(r$1) {
|
|
967
965
|
if (this.required && r$1.length === 0) return `Please select at least one option.
|
|
968
|
-
${import_picocolors
|
|
966
|
+
${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
|
|
969
967
|
},
|
|
970
968
|
render() {
|
|
971
|
-
const r$1 = `${import_picocolors
|
|
969
|
+
const r$1 = `${import_picocolors.default.gray(o)}
|
|
972
970
|
${b(this.state)} ${t.message}
|
|
973
971
|
`, i = (s, c) => {
|
|
974
972
|
const a = this.value.includes(s.value);
|
|
975
973
|
return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
|
|
976
974
|
};
|
|
977
975
|
switch (this.state) {
|
|
978
|
-
case "submit": return `${r$1}${import_picocolors
|
|
976
|
+
case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`;
|
|
979
977
|
case "cancel": {
|
|
980
|
-
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors
|
|
981
|
-
return `${r$1}${import_picocolors
|
|
982
|
-
${import_picocolors
|
|
978
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
|
|
979
|
+
return `${r$1}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
|
|
980
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
983
981
|
}
|
|
984
982
|
case "error": {
|
|
985
983
|
const s = this.error.split(`
|
|
986
|
-
`).map((c, a) => a === 0 ? `${import_picocolors
|
|
984
|
+
`).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
|
|
987
985
|
`);
|
|
988
|
-
return `${r$1 + import_picocolors
|
|
986
|
+
return `${r$1 + import_picocolors.default.yellow(o)} ${G({
|
|
989
987
|
options: this.options,
|
|
990
988
|
cursor: this.cursor,
|
|
991
989
|
maxItems: t.maxItems,
|
|
992
990
|
style: i
|
|
993
991
|
}).join(`
|
|
994
|
-
${import_picocolors
|
|
992
|
+
${import_picocolors.default.yellow(o)} `)}
|
|
995
993
|
${s}
|
|
996
994
|
`;
|
|
997
995
|
}
|
|
998
|
-
default: return `${r$1}${import_picocolors
|
|
996
|
+
default: return `${r$1}${import_picocolors.default.cyan(o)} ${G({
|
|
999
997
|
options: this.options,
|
|
1000
998
|
cursor: this.cursor,
|
|
1001
999
|
maxItems: t.maxItems,
|
|
1002
1000
|
style: i
|
|
1003
1001
|
}).join(`
|
|
1004
|
-
${import_picocolors
|
|
1005
|
-
${import_picocolors
|
|
1002
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
1003
|
+
${import_picocolors.default.cyan(d)}
|
|
1006
1004
|
`;
|
|
1007
1005
|
}
|
|
1008
1006
|
}
|
|
1009
1007
|
}).prompt();
|
|
1010
1008
|
}, be = (t) => {
|
|
1011
1009
|
const { selectableGroups: n = !0 } = t, r$1 = (i, s, c = []) => {
|
|
1012
|
-
const a = i.label ?? String(i.value), l$1 = typeof i.group == "string", $$1 = l$1 && (c[c.indexOf(i) + 1] ?? { group: !0 }), g$1 = l$1 && $$1.group === !0, p$
|
|
1013
|
-
if (s === "active") return `${import_picocolors
|
|
1014
|
-
if (s === "group-active") return `${p$
|
|
1015
|
-
if (s === "group-active-selected") return `${p$
|
|
1010
|
+
const a = i.label ?? String(i.value), l$1 = typeof i.group == "string", $$1 = l$1 && (c[c.indexOf(i) + 1] ?? { group: !0 }), g$1 = l$1 && $$1.group === !0, p$1 = l$1 ? n ? `${g$1 ? d : o} ` : " " : "";
|
|
1011
|
+
if (s === "active") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.cyan(A)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
|
|
1012
|
+
if (s === "group-active") return `${p$1}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a)}`;
|
|
1013
|
+
if (s === "group-active-selected") return `${p$1}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a)}`;
|
|
1016
1014
|
if (s === "selected") {
|
|
1017
|
-
const f = l$1 || n ? import_picocolors
|
|
1018
|
-
return `${import_picocolors
|
|
1015
|
+
const f = l$1 || n ? import_picocolors.default.green(T) : "";
|
|
1016
|
+
return `${import_picocolors.default.dim(p$1)}${f} ${import_picocolors.default.dim(a)} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
|
|
1019
1017
|
}
|
|
1020
|
-
if (s === "cancelled") return `${import_picocolors
|
|
1021
|
-
if (s === "active-selected") return `${import_picocolors
|
|
1022
|
-
if (s === "submitted") return `${import_picocolors
|
|
1023
|
-
const v$1 = l$1 || n ? import_picocolors
|
|
1024
|
-
return `${import_picocolors
|
|
1018
|
+
if (s === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
|
|
1019
|
+
if (s === "active-selected") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.green(T)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
|
|
1020
|
+
if (s === "submitted") return `${import_picocolors.default.dim(a)}`;
|
|
1021
|
+
const v$1 = l$1 || n ? import_picocolors.default.dim(F) : "";
|
|
1022
|
+
return `${import_picocolors.default.dim(p$1)}${v$1} ${import_picocolors.default.dim(a)}`;
|
|
1025
1023
|
};
|
|
1026
1024
|
return new _D({
|
|
1027
1025
|
options: t.options,
|
|
@@ -1031,37 +1029,37 @@ ${import_picocolors$1.default.cyan(d)}
|
|
|
1031
1029
|
selectableGroups: n,
|
|
1032
1030
|
validate(i) {
|
|
1033
1031
|
if (this.required && i.length === 0) return `Please select at least one option.
|
|
1034
|
-
${import_picocolors
|
|
1032
|
+
${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
|
|
1035
1033
|
},
|
|
1036
1034
|
render() {
|
|
1037
|
-
const i = `${import_picocolors
|
|
1035
|
+
const i = `${import_picocolors.default.gray(o)}
|
|
1038
1036
|
${b(this.state)} ${t.message}
|
|
1039
1037
|
`;
|
|
1040
1038
|
switch (this.state) {
|
|
1041
|
-
case "submit": return `${i}${import_picocolors
|
|
1039
|
+
case "submit": return `${i}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r$1(s, "submitted")).join(import_picocolors.default.dim(", "))}`;
|
|
1042
1040
|
case "cancel": {
|
|
1043
|
-
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r$1(c, "cancelled")).join(import_picocolors
|
|
1044
|
-
return `${i}${import_picocolors
|
|
1045
|
-
${import_picocolors
|
|
1041
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r$1(c, "cancelled")).join(import_picocolors.default.dim(", "));
|
|
1042
|
+
return `${i}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
|
|
1043
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
1046
1044
|
}
|
|
1047
1045
|
case "error": {
|
|
1048
1046
|
const s = this.error.split(`
|
|
1049
|
-
`).map((c, a) => a === 0 ? `${import_picocolors
|
|
1047
|
+
`).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
|
|
1050
1048
|
`);
|
|
1051
|
-
return `${i}${import_picocolors
|
|
1049
|
+
return `${i}${import_picocolors.default.yellow(o)} ${this.options.map((c, a, l$1) => {
|
|
1052
1050
|
const $$1 = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g$1 = a === this.cursor;
|
|
1053
1051
|
return !g$1 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r$1(c, $$1 ? "group-active-selected" : "group-active", l$1) : g$1 && $$1 ? r$1(c, "active-selected", l$1) : $$1 ? r$1(c, "selected", l$1) : r$1(c, g$1 ? "active" : "inactive", l$1);
|
|
1054
1052
|
}).join(`
|
|
1055
|
-
${import_picocolors
|
|
1053
|
+
${import_picocolors.default.yellow(o)} `)}
|
|
1056
1054
|
${s}
|
|
1057
1055
|
`;
|
|
1058
1056
|
}
|
|
1059
|
-
default: return `${i}${import_picocolors
|
|
1057
|
+
default: return `${i}${import_picocolors.default.cyan(o)} ${this.options.map((s, c, a) => {
|
|
1060
1058
|
const l$1 = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $$1 = c === this.cursor;
|
|
1061
1059
|
return !$$1 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r$1(s, l$1 ? "group-active-selected" : "group-active", a) : $$1 && l$1 ? r$1(s, "active-selected", a) : l$1 ? r$1(s, "selected", a) : r$1(s, $$1 ? "active" : "inactive", a);
|
|
1062
1060
|
}).join(`
|
|
1063
|
-
${import_picocolors
|
|
1064
|
-
${import_picocolors
|
|
1061
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
1062
|
+
${import_picocolors.default.cyan(d)}
|
|
1065
1063
|
`;
|
|
1066
1064
|
}
|
|
1067
1065
|
}
|
|
@@ -1073,58 +1071,58 @@ ${t}
|
|
|
1073
1071
|
`), i = stripVTControlCharacters(n).length, s = Math.max(r$1.reduce((a, l$1) => {
|
|
1074
1072
|
const $$1 = stripVTControlCharacters(l$1);
|
|
1075
1073
|
return $$1.length > a ? $$1.length : a;
|
|
1076
|
-
}, 0), i) + 2, c = r$1.map((a) => `${import_picocolors
|
|
1074
|
+
}, 0), i) + 2, c = r$1.map((a) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors.default.gray(o)}`).join(`
|
|
1077
1075
|
`);
|
|
1078
|
-
process.stdout.write(`${import_picocolors
|
|
1079
|
-
${import_picocolors
|
|
1076
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1077
|
+
${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
1080
1078
|
${c}
|
|
1081
|
-
${import_picocolors
|
|
1079
|
+
${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
|
|
1082
1080
|
`);
|
|
1083
1081
|
}, xe = (t = "") => {
|
|
1084
|
-
process.stdout.write(`${import_picocolors
|
|
1082
|
+
process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
|
|
1085
1083
|
|
|
1086
1084
|
`);
|
|
1087
1085
|
}, Ie = (t = "") => {
|
|
1088
|
-
process.stdout.write(`${import_picocolors
|
|
1086
|
+
process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
|
|
1089
1087
|
`);
|
|
1090
1088
|
}, Se = (t = "") => {
|
|
1091
|
-
process.stdout.write(`${import_picocolors
|
|
1092
|
-
${import_picocolors
|
|
1089
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1090
|
+
${import_picocolors.default.gray(d)} ${t}
|
|
1093
1091
|
|
|
1094
1092
|
`);
|
|
1095
1093
|
}, M = {
|
|
1096
|
-
message: (t = "", { symbol: n = import_picocolors
|
|
1097
|
-
const r$1 = [`${import_picocolors
|
|
1094
|
+
message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
1095
|
+
const r$1 = [`${import_picocolors.default.gray(o)}`];
|
|
1098
1096
|
if (t) {
|
|
1099
1097
|
const [i, ...s] = t.split(`
|
|
1100
1098
|
`);
|
|
1101
|
-
r$1.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors
|
|
1099
|
+
r$1.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
|
|
1102
1100
|
}
|
|
1103
1101
|
process.stdout.write(`${r$1.join(`
|
|
1104
1102
|
`)}
|
|
1105
1103
|
`);
|
|
1106
1104
|
},
|
|
1107
1105
|
info: (t) => {
|
|
1108
|
-
M.message(t, { symbol: import_picocolors
|
|
1106
|
+
M.message(t, { symbol: import_picocolors.default.blue(q) });
|
|
1109
1107
|
},
|
|
1110
1108
|
success: (t) => {
|
|
1111
|
-
M.message(t, { symbol: import_picocolors
|
|
1109
|
+
M.message(t, { symbol: import_picocolors.default.green(D) });
|
|
1112
1110
|
},
|
|
1113
1111
|
step: (t) => {
|
|
1114
|
-
M.message(t, { symbol: import_picocolors
|
|
1112
|
+
M.message(t, { symbol: import_picocolors.default.green(C) });
|
|
1115
1113
|
},
|
|
1116
1114
|
warn: (t) => {
|
|
1117
|
-
M.message(t, { symbol: import_picocolors
|
|
1115
|
+
M.message(t, { symbol: import_picocolors.default.yellow(U) });
|
|
1118
1116
|
},
|
|
1119
1117
|
warning: (t) => {
|
|
1120
1118
|
M.warn(t);
|
|
1121
1119
|
},
|
|
1122
1120
|
error: (t) => {
|
|
1123
|
-
M.message(t, { symbol: import_picocolors
|
|
1121
|
+
M.message(t, { symbol: import_picocolors.default.red(K) });
|
|
1124
1122
|
}
|
|
1125
|
-
}, J = `${import_picocolors
|
|
1126
|
-
message: async (t, { symbol: n = import_picocolors
|
|
1127
|
-
process.stdout.write(`${import_picocolors
|
|
1123
|
+
}, J = `${import_picocolors.default.gray(o)} `, x = {
|
|
1124
|
+
message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
1125
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1128
1126
|
${n} `);
|
|
1129
1127
|
let r$1 = 3;
|
|
1130
1128
|
for await (let i of t) {
|
|
@@ -1139,12 +1137,12 @@ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length
|
|
|
1139
1137
|
process.stdout.write(`
|
|
1140
1138
|
`);
|
|
1141
1139
|
},
|
|
1142
|
-
info: (t) => x.message(t, { symbol: import_picocolors
|
|
1143
|
-
success: (t) => x.message(t, { symbol: import_picocolors
|
|
1144
|
-
step: (t) => x.message(t, { symbol: import_picocolors
|
|
1145
|
-
warn: (t) => x.message(t, { symbol: import_picocolors
|
|
1140
|
+
info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
|
|
1141
|
+
success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
|
|
1142
|
+
step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
|
|
1143
|
+
warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
|
|
1146
1144
|
warning: (t) => x.warn(t),
|
|
1147
|
-
error: (t) => x.message(t, { symbol: import_picocolors
|
|
1145
|
+
error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
|
|
1148
1146
|
}, Y = ({ indicator: t = "dots" } = {}) => {
|
|
1149
1147
|
const n = V ? [
|
|
1150
1148
|
"◒",
|
|
@@ -1158,12 +1156,12 @@ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length
|
|
|
1158
1156
|
"0"
|
|
1159
1157
|
], r$1 = V ? 80 : 120, i = process.env.CI === "true";
|
|
1160
1158
|
let s, c, a = !1, l$1 = "", $$1, g$1 = performance.now();
|
|
1161
|
-
const p$
|
|
1159
|
+
const p$1 = (m$1) => {
|
|
1162
1160
|
a && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1163
|
-
}, v$1 = () => p$
|
|
1164
|
-
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p$
|
|
1161
|
+
}, v$1 = () => p$1(2), f = () => p$1(1), j = () => {
|
|
1162
|
+
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p$1);
|
|
1165
1163
|
}, E = () => {
|
|
1166
|
-
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p$
|
|
1164
|
+
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p$1);
|
|
1167
1165
|
}, B$1 = () => {
|
|
1168
1166
|
if ($$1 === void 0) return;
|
|
1169
1167
|
i && process.stdout.write(`
|
|
@@ -1175,13 +1173,13 @@ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length
|
|
|
1175
1173
|
const h$1 = (performance.now() - m$1) / 1e3, w$1 = Math.floor(h$1 / 60), I$1 = Math.floor(h$1 % 60);
|
|
1176
1174
|
return w$1 > 0 ? `[${w$1}m ${I$1}s]` : `[${I$1}s]`;
|
|
1177
1175
|
}, H$1 = (m$1 = "") => {
|
|
1178
|
-
a = !0, s = fD(), l$1 = R$1(m$1), g$1 = performance.now(), process.stdout.write(`${import_picocolors
|
|
1176
|
+
a = !0, s = fD(), l$1 = R$1(m$1), g$1 = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
1179
1177
|
`);
|
|
1180
1178
|
let h$1 = 0, w$1 = 0;
|
|
1181
1179
|
j(), c = setInterval(() => {
|
|
1182
1180
|
if (i && l$1 === $$1) return;
|
|
1183
1181
|
B$1(), $$1 = l$1;
|
|
1184
|
-
const I$1 = import_picocolors
|
|
1182
|
+
const I$1 = import_picocolors.default.magenta(n[h$1]);
|
|
1185
1183
|
if (i) process.stdout.write(`${I$1} ${l$1}...`);
|
|
1186
1184
|
else if (t === "timer") process.stdout.write(`${I$1} ${l$1} ${O$1(g$1)}`);
|
|
1187
1185
|
else {
|
|
@@ -1192,7 +1190,7 @@ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length
|
|
|
1192
1190
|
}, r$1);
|
|
1193
1191
|
}, N$1 = (m$1 = "", h$1 = 0) => {
|
|
1194
1192
|
a = !1, clearInterval(c), B$1();
|
|
1195
|
-
const w$1 = h$1 === 0 ? import_picocolors
|
|
1193
|
+
const w$1 = h$1 === 0 ? import_picocolors.default.green(C) : h$1 === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
|
|
1196
1194
|
l$1 = R$1(m$1 ?? l$1), t === "timer" ? process.stdout.write(`${w$1} ${l$1} ${O$1(g$1)}
|
|
1197
1195
|
`) : process.stdout.write(`${w$1} ${l$1}
|
|
1198
1196
|
`), E(), s();
|
|
@@ -1311,10 +1309,10 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1311
1309
|
*/
|
|
1312
1310
|
exports.shallowCopy = function(to, from) {
|
|
1313
1311
|
from = from || {};
|
|
1314
|
-
if (to !== null && to !== void 0) for (var p$
|
|
1315
|
-
if (!hasOwn(from, p$
|
|
1316
|
-
if (p$
|
|
1317
|
-
to[p$
|
|
1312
|
+
if (to !== null && to !== void 0) for (var p$1 in from) {
|
|
1313
|
+
if (!hasOwn(from, p$1)) continue;
|
|
1314
|
+
if (p$1 === "__proto__" || p$1 === "constructor") continue;
|
|
1315
|
+
to[p$1] = from[p$1];
|
|
1318
1316
|
}
|
|
1319
1317
|
return to;
|
|
1320
1318
|
};
|
|
@@ -1334,11 +1332,11 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1334
1332
|
list = list || [];
|
|
1335
1333
|
from = from || {};
|
|
1336
1334
|
if (to !== null && to !== void 0) for (var i = 0; i < list.length; i++) {
|
|
1337
|
-
var p$
|
|
1338
|
-
if (typeof from[p$
|
|
1339
|
-
if (!hasOwn(from, p$
|
|
1340
|
-
if (p$
|
|
1341
|
-
to[p$
|
|
1335
|
+
var p$1 = list[i];
|
|
1336
|
+
if (typeof from[p$1] != "undefined") {
|
|
1337
|
+
if (!hasOwn(from, p$1)) continue;
|
|
1338
|
+
if (p$1 === "__proto__" || p$1 === "constructor") continue;
|
|
1339
|
+
to[p$1] = from[p$1];
|
|
1342
1340
|
}
|
|
1343
1341
|
}
|
|
1344
1342
|
return to;
|
|
@@ -1399,7 +1397,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1399
1397
|
})();
|
|
1400
1398
|
exports.hasOwnOnlyObject = function(obj) {
|
|
1401
1399
|
var o$1 = exports.createNullProtoObjWherePossible();
|
|
1402
|
-
for (var p$
|
|
1400
|
+
for (var p$1 in obj) if (hasOwn(obj, p$1)) o$1[p$1] = obj[p$1];
|
|
1403
1401
|
return o$1;
|
|
1404
1402
|
};
|
|
1405
1403
|
}));
|
|
@@ -2113,30 +2111,30 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2113
2111
|
|
|
2114
2112
|
//#endregion
|
|
2115
2113
|
//#region utils/banners.ts
|
|
2116
|
-
var import_ejs
|
|
2114
|
+
var import_ejs = /* @__PURE__ */ __toESM(require_ejs(), 1);
|
|
2117
2115
|
const defaultBanner = "Vue.js - The Progressive JavaScript Framework";
|
|
2118
2116
|
const gradientBanner = "\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B[39m\x1B[38;2;66;211;146me\x1B[39m\x1B[38;2;66;211;146m.\x1B[39m\x1B[38;2;66;211;146mj\x1B[39m\x1B[38;2;67;209;149ms\x1B[39m \x1B[38;2;68;206;152m-\x1B[39m \x1B[38;2;69;204;155mT\x1B[39m\x1B[38;2;70;201;158mh\x1B[39m\x1B[38;2;71;199;162me\x1B[39m \x1B[38;2;72;196;165mP\x1B[39m\x1B[38;2;73;194;168mr\x1B[39m\x1B[38;2;74;192;171mo\x1B[39m\x1B[38;2;75;189;174mg\x1B[39m\x1B[38;2;76;187;177mr\x1B[39m\x1B[38;2;77;184;180me\x1B[39m\x1B[38;2;78;182;183ms\x1B[39m\x1B[38;2;79;179;186ms\x1B[39m\x1B[38;2;80;177;190mi\x1B[39m\x1B[38;2;81;175;193mv\x1B[39m\x1B[38;2;82;172;196me\x1B[39m \x1B[38;2;83;170;199mJ\x1B[39m\x1B[38;2;83;167;202ma\x1B[39m\x1B[38;2;84;165;205mv\x1B[39m\x1B[38;2;85;162;208ma\x1B[39m\x1B[38;2;86;160;211mS\x1B[39m\x1B[38;2;87;158;215mc\x1B[39m\x1B[38;2;88;155;218mr\x1B[39m\x1B[38;2;89;153;221mi\x1B[39m\x1B[38;2;90;150;224mp\x1B[39m\x1B[38;2;91;148;227mt\x1B[39m \x1B[38;2;92;145;230mF\x1B[39m\x1B[38;2;93;143;233mr\x1B[39m\x1B[38;2;94;141;236ma\x1B[39m\x1B[38;2;95;138;239mm\x1B[39m\x1B[38;2;96;136;243me\x1B[39m\x1B[38;2;97;133;246mw\x1B[39m\x1B[38;2;98;131;249mo\x1B[39m\x1B[38;2;99;128;252mr\x1B[39m\x1B[38;2;100;126;255mk\x1B[39m";
|
|
2119
2117
|
|
|
2120
2118
|
//#endregion
|
|
2121
2119
|
//#region utils/deepMerge.ts
|
|
2122
|
-
const isObject
|
|
2123
|
-
const mergeArrayWithDedupe
|
|
2120
|
+
const isObject = (val) => val && typeof val === "object";
|
|
2121
|
+
const mergeArrayWithDedupe = (a, b$2) => Array.from(new Set([...a, ...b$2]));
|
|
2124
2122
|
/**
|
|
2125
2123
|
* Recursively merge the content of the new object to the existing one
|
|
2126
2124
|
* @param {Object} target the existing object
|
|
2127
2125
|
* @param {Object} obj the new object
|
|
2128
2126
|
*/
|
|
2129
|
-
function deepMerge
|
|
2127
|
+
function deepMerge(target, obj) {
|
|
2130
2128
|
for (const key of Object.keys(obj)) {
|
|
2131
2129
|
const oldVal = target[key];
|
|
2132
2130
|
const newVal = obj[key];
|
|
2133
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) target[key] = mergeArrayWithDedupe
|
|
2134
|
-
else if (isObject
|
|
2131
|
+
if (Array.isArray(oldVal) && Array.isArray(newVal)) target[key] = mergeArrayWithDedupe(oldVal, newVal);
|
|
2132
|
+
else if (isObject(oldVal) && isObject(newVal)) target[key] = deepMerge(oldVal, newVal);
|
|
2135
2133
|
else target[key] = newVal;
|
|
2136
2134
|
}
|
|
2137
2135
|
return target;
|
|
2138
2136
|
}
|
|
2139
|
-
var deepMerge_default = deepMerge
|
|
2137
|
+
var deepMerge_default = deepMerge;
|
|
2140
2138
|
|
|
2141
2139
|
//#endregion
|
|
2142
2140
|
//#region utils/sortDependencies.ts
|
|
@@ -2172,12 +2170,12 @@ function sortDependencies(packageJson) {
|
|
|
2172
2170
|
*/
|
|
2173
2171
|
function renderTemplate(src, dest, callbacks) {
|
|
2174
2172
|
if (fs.statSync(src).isDirectory()) {
|
|
2175
|
-
if (path.basename(src) === "node_modules") return;
|
|
2173
|
+
if (path$1.basename(src) === "node_modules") return;
|
|
2176
2174
|
fs.mkdirSync(dest, { recursive: true });
|
|
2177
|
-
for (const file of fs.readdirSync(src)) renderTemplate(path.resolve(src, file), path.resolve(dest, file), callbacks);
|
|
2175
|
+
for (const file of fs.readdirSync(src)) renderTemplate(path$1.resolve(src, file), path$1.resolve(dest, file), callbacks);
|
|
2178
2176
|
return;
|
|
2179
2177
|
}
|
|
2180
|
-
const filename = path.basename(src);
|
|
2178
|
+
const filename = path$1.basename(src);
|
|
2181
2179
|
if (filename === "package.json" && fs.existsSync(dest)) {
|
|
2182
2180
|
const pkg = sortDependencies(deepMerge_default(JSON.parse(fs.readFileSync(dest, "utf8")), JSON.parse(fs.readFileSync(src, "utf8"))));
|
|
2183
2181
|
fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
|
|
@@ -2193,7 +2191,7 @@ function renderTemplate(src, dest, callbacks) {
|
|
|
2193
2191
|
fs.writeFileSync(dest, JSON.stringify(settings, null, 2) + "\n");
|
|
2194
2192
|
return;
|
|
2195
2193
|
}
|
|
2196
|
-
if (filename.startsWith("_")) dest = path.resolve(path.dirname(dest), filename.replace(/^_/, "."));
|
|
2194
|
+
if (filename.startsWith("_")) dest = path$1.resolve(path$1.dirname(dest), filename.replace(/^_/, "."));
|
|
2197
2195
|
if (filename === "_gitignore" && fs.existsSync(dest)) {
|
|
2198
2196
|
const existing = fs.readFileSync(dest, "utf8");
|
|
2199
2197
|
const newGitignore = fs.readFileSync(src, "utf8");
|
|
@@ -2217,7 +2215,7 @@ var renderTemplate_default = renderTemplate;
|
|
|
2217
2215
|
function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
2218
2216
|
for (const filename of fs.readdirSync(dir)) {
|
|
2219
2217
|
if (filename === ".git") continue;
|
|
2220
|
-
const fullpath = path.resolve(dir, filename);
|
|
2218
|
+
const fullpath = path$1.resolve(dir, filename);
|
|
2221
2219
|
if (fs.lstatSync(fullpath).isDirectory()) {
|
|
2222
2220
|
dirCallback(fullpath);
|
|
2223
2221
|
if (fs.existsSync(fullpath)) preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
@@ -2233,7 +2231,7 @@ function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
|
2233
2231
|
dotGitDirectoryState.hasDotGitDirectory = true;
|
|
2234
2232
|
continue;
|
|
2235
2233
|
}
|
|
2236
|
-
const fullpath = path.resolve(dir, filename);
|
|
2234
|
+
const fullpath = path$1.resolve(dir, filename);
|
|
2237
2235
|
if (fs.lstatSync(fullpath).isDirectory()) {
|
|
2238
2236
|
postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
2239
2237
|
dirCallback(fullpath);
|
|
@@ -2274,7 +2272,7 @@ This template should help get you started developing with Vue 3 in Vite.
|
|
|
2274
2272
|
## Recommended Browser Setup
|
|
2275
2273
|
|
|
2276
2274
|
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
|
2277
|
-
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
|
2275
|
+
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
|
2278
2276
|
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
|
2279
2277
|
- Firefox:
|
|
2280
2278
|
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
|
@@ -2434,219 +2432,11 @@ async function loadLanguageFile(filePath) {
|
|
|
2434
2432
|
}
|
|
2435
2433
|
async function getLanguage(localesRoot) {
|
|
2436
2434
|
const locale = getLocale();
|
|
2437
|
-
const languageFilePath = path.resolve(localesRoot, `${locale}.json`);
|
|
2438
|
-
const fallbackPath = path.resolve(localesRoot, "en-US.json");
|
|
2435
|
+
const languageFilePath = path$1.resolve(localesRoot, `${locale}.json`);
|
|
2436
|
+
const fallbackPath = path$1.resolve(localesRoot, "en-US.json");
|
|
2439
2437
|
return fs.existsSync(languageFilePath) ? await loadLanguageFile(languageFilePath) : await loadLanguageFile(fallbackPath);
|
|
2440
2438
|
}
|
|
2441
2439
|
|
|
2442
|
-
//#endregion
|
|
2443
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.13.1/node_modules/@vue/create-eslint-config/renderEjsFile.js
|
|
2444
|
-
const templates = {
|
|
2445
|
-
"./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]\ncharset = utf-8\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nend_of_line = lf\nmax_line_length = 100\n",
|
|
2446
|
-
"./templates/_gitattributes": "* text=auto eol=lf\n",
|
|
2447
|
-
"./templates/_prettierrc.json.ejs": "<%#\n The default style follows the one used in the vuejs/create-vue repository\n <https://github.com/vuejs/create-vue/blob/main/.prettierrc>\n%>\n{\n \"$schema\": \"https://json.schemastore.org/prettierrc\",\n \"semi\": false,\n \"singleQuote\": true,\n \"printWidth\": 100<%_ if (needsOxlint) { _%>,\n \"plugins\": [\n \"@prettier/plugin-oxc\"\n ]\n <%_ } _%>\n}\n",
|
|
2448
|
-
"./templates/eslint.config.js.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport { defineConfig, globalIgnores } from 'eslint/config'\nimport globals from 'globals'\nimport js from '@eslint/js'\nimport pluginVue from 'eslint-plugin-vue'\n<%_ for (const { importer } of configsAfterVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\n\nexport default defineConfig([\n {\n name: 'app/files-to-lint',\n files: ['**/*.{<%= fileExtensions.join(',') %>}'],\n },\n\n globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),\n\n {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n },\n },\n\n<%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n js.configs.recommended,\n ...pluginVue.configs['flat/essential'],\n<%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n])\n",
|
|
2449
|
-
"./templates/eslint.config.ts.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport { globalIgnores } from 'eslint/config'\nimport { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'\nimport pluginVue from 'eslint-plugin-vue'\n<%_ for (const { importer } of configsAfterVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\n\n// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:\n// import { configureVueProject } from '@vue/eslint-config-typescript'\n// configureVueProject({ scriptLangs: ['ts', 'tsx'] })\n// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup\n\nexport default defineConfigWithVueTs(\n {\n name: 'app/files-to-lint',\n files: ['**/*.{<%= fileExtensions.join(',') %>}'],\n },\n\n globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),\n\n<%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n pluginVue.configs['flat/essential'],\n vueTsConfigs.recommended,\n<%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n)\n"
|
|
2450
|
-
};
|
|
2451
|
-
function renderEjsFile(filePath, data) {
|
|
2452
|
-
return import_ejs$1.render(templates[filePath], data, {});
|
|
2453
|
-
}
|
|
2454
|
-
|
|
2455
|
-
//#endregion
|
|
2456
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.13.1/node_modules/@vue/create-eslint-config/package.json
|
|
2457
|
-
var devDependencies$1 = {
|
|
2458
|
-
"@eslint/js": "^9.39.1",
|
|
2459
|
-
"@prettier/plugin-oxc": "^0.0.5",
|
|
2460
|
-
"@types/node": "^22.19.1",
|
|
2461
|
-
"@vue/eslint-config-prettier": "^10.2.0",
|
|
2462
|
-
"@vue/eslint-config-typescript": "^14.6.0",
|
|
2463
|
-
"eslint": "^9.39.1",
|
|
2464
|
-
"eslint-plugin-oxlint": "~1.29.0",
|
|
2465
|
-
"eslint-plugin-vue": "~10.5.1",
|
|
2466
|
-
"globals": "^16.5.0",
|
|
2467
|
-
"jiti": "^2.6.1",
|
|
2468
|
-
"npm-run-all2": "^8.0.4",
|
|
2469
|
-
"oxlint": "~1.29.0",
|
|
2470
|
-
"prettier": "3.6.2",
|
|
2471
|
-
"typescript": "~5.9.0"
|
|
2472
|
-
};
|
|
2473
|
-
|
|
2474
|
-
//#endregion
|
|
2475
|
-
//#region node_modules/.pnpm/@vue+create-eslint-config@0.13.1/node_modules/@vue/create-eslint-config/index.js
|
|
2476
|
-
const versionMap = devDependencies$1;
|
|
2477
|
-
function createConfig({ styleGuide = "default", hasTypeScript = false, needsPrettier = false, needsOxlint = false, additionalConfigs = [] }) {
|
|
2478
|
-
const pickDependencies = (keys) => pickKeysFromObject(versionMap, keys);
|
|
2479
|
-
const pkg = {
|
|
2480
|
-
devDependencies: pickDependencies(["eslint", "eslint-plugin-vue"]),
|
|
2481
|
-
scripts: {}
|
|
2482
|
-
};
|
|
2483
|
-
const fileExtensions = ["vue"];
|
|
2484
|
-
if (hasTypeScript) {
|
|
2485
|
-
fileExtensions.unshift("ts", "mts", "tsx");
|
|
2486
|
-
additionalConfigs.unshift({ devDependencies: pickDependencies(["@vue/eslint-config-typescript", "jiti"]) });
|
|
2487
|
-
} else {
|
|
2488
|
-
fileExtensions.unshift("js", "mjs", "jsx");
|
|
2489
|
-
additionalConfigs.unshift({ devDependencies: pickDependencies(["@eslint/js", "globals"]) });
|
|
2490
|
-
}
|
|
2491
|
-
if (needsOxlint) {
|
|
2492
|
-
additionalConfigs.push({
|
|
2493
|
-
devDependencies: pickDependencies([
|
|
2494
|
-
"oxlint",
|
|
2495
|
-
"eslint-plugin-oxlint",
|
|
2496
|
-
"npm-run-all2"
|
|
2497
|
-
]),
|
|
2498
|
-
afterVuePlugin: [{
|
|
2499
|
-
importer: "import pluginOxlint from 'eslint-plugin-oxlint'",
|
|
2500
|
-
content: "...pluginOxlint.configs['flat/recommended'],"
|
|
2501
|
-
}]
|
|
2502
|
-
});
|
|
2503
|
-
pkg.scripts["lint:oxlint"] = "oxlint . --fix -D correctness --ignore-path .gitignore";
|
|
2504
|
-
pkg.scripts["lint:eslint"] = "eslint . --fix --cache";
|
|
2505
|
-
pkg.scripts.lint = "run-s lint:*";
|
|
2506
|
-
} else pkg.scripts.lint = "eslint . --fix --cache";
|
|
2507
|
-
if (needsPrettier) {
|
|
2508
|
-
additionalConfigs.push({
|
|
2509
|
-
devDependencies: pickDependencies(["prettier", "@vue/eslint-config-prettier"]),
|
|
2510
|
-
afterVuePlugin: [{
|
|
2511
|
-
importer: "import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'",
|
|
2512
|
-
content: "skipFormatting,"
|
|
2513
|
-
}]
|
|
2514
|
-
});
|
|
2515
|
-
pkg.scripts.format = "prettier --write src/";
|
|
2516
|
-
}
|
|
2517
|
-
if (needsOxlint && needsPrettier) additionalConfigs.push({ devDependencies: pickDependencies(["@prettier/plugin-oxc"]) });
|
|
2518
|
-
const configsBeforeVuePlugin = [], configsAfterVuePlugin = [];
|
|
2519
|
-
for (const config of additionalConfigs) {
|
|
2520
|
-
deepMerge(pkg.devDependencies, config.devDependencies ?? {});
|
|
2521
|
-
configsBeforeVuePlugin.push(...config.beforeVuePlugin ?? []);
|
|
2522
|
-
configsAfterVuePlugin.push(...config.afterVuePlugin ?? []);
|
|
2523
|
-
}
|
|
2524
|
-
const templateData = {
|
|
2525
|
-
styleGuide,
|
|
2526
|
-
needsOxlint,
|
|
2527
|
-
needsPrettier,
|
|
2528
|
-
fileExtensions,
|
|
2529
|
-
configsBeforeVuePlugin,
|
|
2530
|
-
configsAfterVuePlugin
|
|
2531
|
-
};
|
|
2532
|
-
const files = { ".editorconfig": renderEjsFile("./templates/_editorconfig.ejs", templateData) };
|
|
2533
|
-
if (hasTypeScript) files["eslint.config.ts"] = renderEjsFile("./templates/eslint.config.ts.ejs", templateData);
|
|
2534
|
-
else files["eslint.config.js"] = renderEjsFile("./templates/eslint.config.js.ejs", templateData);
|
|
2535
|
-
if (needsPrettier) files[".prettierrc.json"] = renderEjsFile("./templates/_prettierrc.json.ejs", templateData);
|
|
2536
|
-
files[".gitattributes"] = renderEjsFile("./templates/_gitattributes", {});
|
|
2537
|
-
return {
|
|
2538
|
-
pkg,
|
|
2539
|
-
files
|
|
2540
|
-
};
|
|
2541
|
-
}
|
|
2542
|
-
/**
|
|
2543
|
-
* Picks specified keys from an object.
|
|
2544
|
-
*
|
|
2545
|
-
* @param {Object} obj - The source object.
|
|
2546
|
-
* @param {string[]} keys - The keys to pick from the object.
|
|
2547
|
-
* @returns {Object} - A new object with the picked keys.
|
|
2548
|
-
*/
|
|
2549
|
-
function pickKeysFromObject(obj, keys) {
|
|
2550
|
-
return keys.reduce((acc, key) => {
|
|
2551
|
-
if (key in obj) acc[key] = obj[key];
|
|
2552
|
-
return acc;
|
|
2553
|
-
}, {});
|
|
2554
|
-
}
|
|
2555
|
-
const isObject = (val) => val && typeof val === "object";
|
|
2556
|
-
const mergeArrayWithDedupe = (a, b$2) => Array.from(new Set([...a, ...b$2]));
|
|
2557
|
-
/**
|
|
2558
|
-
* Recursively merge the content of the new object to the existing one
|
|
2559
|
-
* @param {object} target the existing object
|
|
2560
|
-
* @param {object} obj the new object
|
|
2561
|
-
*/
|
|
2562
|
-
function deepMerge(target, obj) {
|
|
2563
|
-
for (const key of Object.keys(obj)) {
|
|
2564
|
-
const oldVal = target[key];
|
|
2565
|
-
const newVal = obj[key];
|
|
2566
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) target[key] = mergeArrayWithDedupe(oldVal, newVal);
|
|
2567
|
-
else if (isObject(oldVal) && isObject(newVal)) target[key] = deepMerge(oldVal, newVal);
|
|
2568
|
-
else target[key] = newVal;
|
|
2569
|
-
}
|
|
2570
|
-
return target;
|
|
2571
|
-
}
|
|
2572
|
-
|
|
2573
|
-
//#endregion
|
|
2574
|
-
//#region template/eslint/package.json
|
|
2575
|
-
var devDependencies = {
|
|
2576
|
-
"@vitest/eslint-plugin": "^1.5.0",
|
|
2577
|
-
"eslint-plugin-cypress": "^5.2.0",
|
|
2578
|
-
"eslint-plugin-playwright": "^2.3.0"
|
|
2579
|
-
};
|
|
2580
|
-
|
|
2581
|
-
//#endregion
|
|
2582
|
-
//#region utils/renderEslint.ts
|
|
2583
|
-
const eslintDeps = devDependencies;
|
|
2584
|
-
function renderEslint(rootDir, { needsTypeScript, needsVitest, needsCypress, needsCypressCT, needsOxlint, needsPrettier, needsPlaywright }) {
|
|
2585
|
-
const { pkg, files } = createConfig({
|
|
2586
|
-
styleGuide: "default",
|
|
2587
|
-
hasTypeScript: needsTypeScript,
|
|
2588
|
-
needsOxlint,
|
|
2589
|
-
needsPrettier,
|
|
2590
|
-
additionalConfigs: getAdditionalConfigs({
|
|
2591
|
-
needsTypeScript,
|
|
2592
|
-
needsVitest,
|
|
2593
|
-
needsCypress,
|
|
2594
|
-
needsCypressCT,
|
|
2595
|
-
needsPlaywright
|
|
2596
|
-
})
|
|
2597
|
-
});
|
|
2598
|
-
const packageJsonPath = path.resolve(rootDir, "package.json");
|
|
2599
|
-
const updatedPkg = sortDependencies(deepMerge_default(JSON.parse(fs.readFileSync(packageJsonPath, "utf8")), pkg));
|
|
2600
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(updatedPkg, null, 2) + "\n", "utf8");
|
|
2601
|
-
for (const [fileName, content] of Object.entries(files)) {
|
|
2602
|
-
const fullPath = path.resolve(rootDir, fileName);
|
|
2603
|
-
fs.writeFileSync(fullPath, content, "utf8");
|
|
2604
|
-
}
|
|
2605
|
-
}
|
|
2606
|
-
function getAdditionalConfigs({ needsTypeScript, needsVitest, needsCypress, needsCypressCT, needsPlaywright }) {
|
|
2607
|
-
const additionalConfigs = [];
|
|
2608
|
-
if (needsVitest) additionalConfigs.push({
|
|
2609
|
-
devDependencies: { "@vitest/eslint-plugin": eslintDeps["@vitest/eslint-plugin"] },
|
|
2610
|
-
afterVuePlugin: [{
|
|
2611
|
-
importer: `import pluginVitest from '@vitest/eslint-plugin'`,
|
|
2612
|
-
content: `
|
|
2613
|
-
{
|
|
2614
|
-
...pluginVitest.configs.recommended,
|
|
2615
|
-
files: ['src/**/__tests__/*'],
|
|
2616
|
-
},`
|
|
2617
|
-
}]
|
|
2618
|
-
});
|
|
2619
|
-
if (needsCypress) additionalConfigs.push({
|
|
2620
|
-
devDependencies: { "eslint-plugin-cypress": eslintDeps["eslint-plugin-cypress"] },
|
|
2621
|
-
afterVuePlugin: [{
|
|
2622
|
-
importer: (needsTypeScript ? "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n" : "") + "import pluginCypress from 'eslint-plugin-cypress'",
|
|
2623
|
-
content: `
|
|
2624
|
-
{
|
|
2625
|
-
...pluginCypress.configs.recommended,
|
|
2626
|
-
files: [
|
|
2627
|
-
${[
|
|
2628
|
-
...needsCypressCT ? ["**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}"] : [],
|
|
2629
|
-
"cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}",
|
|
2630
|
-
"cypress/support/**/*.{js,ts,jsx,tsx}"
|
|
2631
|
-
].map(JSON.stringify.bind(JSON)).join(",\n ").replace(/"/g, "'")}
|
|
2632
|
-
],
|
|
2633
|
-
},`
|
|
2634
|
-
}]
|
|
2635
|
-
});
|
|
2636
|
-
if (needsPlaywright) additionalConfigs.push({
|
|
2637
|
-
devDependencies: { "eslint-plugin-playwright": eslintDeps["eslint-plugin-playwright"] },
|
|
2638
|
-
afterVuePlugin: [{
|
|
2639
|
-
importer: "import pluginPlaywright from 'eslint-plugin-playwright'",
|
|
2640
|
-
content: `
|
|
2641
|
-
{
|
|
2642
|
-
...pluginPlaywright.configs['flat/recommended'],
|
|
2643
|
-
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
|
|
2644
|
-
},`
|
|
2645
|
-
}]
|
|
2646
|
-
});
|
|
2647
|
-
return additionalConfigs;
|
|
2648
|
-
}
|
|
2649
|
-
|
|
2650
2440
|
//#endregion
|
|
2651
2441
|
//#region utils/trimBoilerplate.ts
|
|
2652
2442
|
function replaceContent(filepath, replacer) {
|
|
@@ -2654,7 +2444,7 @@ function replaceContent(filepath, replacer) {
|
|
|
2654
2444
|
fs.writeFileSync(filepath, replacer(content));
|
|
2655
2445
|
}
|
|
2656
2446
|
function trimBoilerplate(rootDir) {
|
|
2657
|
-
const srcDir = path
|
|
2447
|
+
const srcDir = path.resolve(rootDir, "src");
|
|
2658
2448
|
for (const filename of fs.readdirSync(srcDir)) {
|
|
2659
2449
|
if ([
|
|
2660
2450
|
"main.js",
|
|
@@ -2662,28 +2452,26 @@ function trimBoilerplate(rootDir) {
|
|
|
2662
2452
|
"router",
|
|
2663
2453
|
"stores"
|
|
2664
2454
|
].includes(filename)) continue;
|
|
2665
|
-
const fullpath = path
|
|
2455
|
+
const fullpath = path.resolve(srcDir, filename);
|
|
2666
2456
|
fs.rmSync(fullpath, { recursive: true });
|
|
2667
2457
|
}
|
|
2668
2458
|
}
|
|
2669
2459
|
function removeCSSImport(rootDir, needsTypeScript, needsCypressCT) {
|
|
2670
|
-
replaceContent(path
|
|
2671
|
-
if (needsCypressCT) replaceContent(path
|
|
2460
|
+
replaceContent(path.resolve(rootDir, needsTypeScript ? "src/main.ts" : "src/main.js"), (content) => content.replace("import './assets/main.css'\n\n", ""));
|
|
2461
|
+
if (needsCypressCT) replaceContent(path.resolve(rootDir, needsTypeScript ? "cypress/support/component.ts" : "cypress/support/component.js"), (content) => content.replace("import '@/assets/main.css'", "// import '@/assets/main.css'"));
|
|
2672
2462
|
}
|
|
2673
2463
|
function emptyRouterConfig(rootDir, needsTypeScript) {
|
|
2674
|
-
const srcDir = path
|
|
2675
|
-
replaceContent(path
|
|
2464
|
+
const srcDir = path.resolve(rootDir, "src");
|
|
2465
|
+
replaceContent(path.resolve(srcDir, needsTypeScript ? "router/index.ts" : "router/index.js"), (content) => content.replace(`import HomeView from '../views/HomeView.vue'\n`, "").replace(/routes:\s*\[[\s\S]*?\],/, "routes: [],"));
|
|
2676
2466
|
}
|
|
2677
2467
|
|
|
2678
2468
|
//#endregion
|
|
2679
2469
|
//#region package.json
|
|
2680
2470
|
var name = "create-vue";
|
|
2681
|
-
var version = "3.18.
|
|
2471
|
+
var version = "3.18.4";
|
|
2682
2472
|
|
|
2683
2473
|
//#endregion
|
|
2684
2474
|
//#region index.ts
|
|
2685
|
-
var import_picocolors = require_picocolors();
|
|
2686
|
-
var import_ejs = /* @__PURE__ */ __toESM(require_ejs(), 1);
|
|
2687
2475
|
const language = await getLanguage(fileURLToPath(new URL("./locales", import.meta.url)));
|
|
2688
2476
|
const FEATURE_FLAGS = [
|
|
2689
2477
|
"default",
|
|
@@ -2837,24 +2625,24 @@ async function init() {
|
|
|
2837
2625
|
"help",
|
|
2838
2626
|
"version"
|
|
2839
2627
|
];
|
|
2840
|
-
const { values: argv
|
|
2628
|
+
const { values: argv, positionals } = parseArgs({
|
|
2841
2629
|
args,
|
|
2842
2630
|
options: Object.fromEntries(flags.map((key) => [key, { type: "boolean" }])),
|
|
2843
2631
|
strict: true,
|
|
2844
2632
|
allowPositionals: true
|
|
2845
2633
|
});
|
|
2846
|
-
if (argv
|
|
2634
|
+
if (argv.help) {
|
|
2847
2635
|
console.log(helpMessage);
|
|
2848
2636
|
process.exit(0);
|
|
2849
2637
|
}
|
|
2850
|
-
if (argv
|
|
2638
|
+
if (argv.version) {
|
|
2851
2639
|
console.log(`${name} v${version}`);
|
|
2852
2640
|
process.exit(0);
|
|
2853
2641
|
}
|
|
2854
|
-
const isFeatureFlagsUsed = FEATURE_FLAGS.some((flag) => typeof argv
|
|
2642
|
+
const isFeatureFlagsUsed = FEATURE_FLAGS.some((flag) => typeof argv[flag] === "boolean");
|
|
2855
2643
|
let targetDir = positionals[0];
|
|
2856
2644
|
const defaultProjectName = targetDir || "vue-project";
|
|
2857
|
-
const forceOverwrite = argv
|
|
2645
|
+
const forceOverwrite = argv.force;
|
|
2858
2646
|
const result = {
|
|
2859
2647
|
projectName: defaultProjectName,
|
|
2860
2648
|
shouldOverwrite: forceOverwrite,
|
|
@@ -2921,28 +2709,28 @@ async function init() {
|
|
|
2921
2709
|
required: false
|
|
2922
2710
|
}));
|
|
2923
2711
|
}
|
|
2924
|
-
if (argv
|
|
2712
|
+
if (argv.bare) result.needsBareboneTemplates = true;
|
|
2925
2713
|
else if (!isFeatureFlagsUsed) result.needsBareboneTemplates = await unwrapPrompt(ye({
|
|
2926
2714
|
message: language.needsBareboneTemplates.message,
|
|
2927
2715
|
initialValue: false
|
|
2928
2716
|
}));
|
|
2929
2717
|
const { features, experimentFeatures, needsBareboneTemplates } = result;
|
|
2930
|
-
const needsTypeScript = argv
|
|
2931
|
-
const needsJsx = argv
|
|
2932
|
-
const needsRouter = argv
|
|
2933
|
-
const needsPinia = argv
|
|
2934
|
-
const needsVitest = argv
|
|
2935
|
-
const needsEslint = argv
|
|
2936
|
-
const needsPrettier = argv
|
|
2937
|
-
const needsOxlint = experimentFeatures.includes("oxlint") || argv
|
|
2938
|
-
const needsRolldownVite = experimentFeatures.includes("rolldown-vite") || argv
|
|
2718
|
+
const needsTypeScript = argv.ts || argv.typescript || features.includes("typescript");
|
|
2719
|
+
const needsJsx = argv.jsx || features.includes("jsx");
|
|
2720
|
+
const needsRouter = argv.router || argv["vue-router"] || features.includes("router");
|
|
2721
|
+
const needsPinia = argv.pinia || features.includes("pinia");
|
|
2722
|
+
const needsVitest = argv.vitest || argv.tests || features.includes("vitest");
|
|
2723
|
+
const needsEslint = argv.eslint || argv["eslint-with-prettier"] || features.includes("eslint");
|
|
2724
|
+
const needsPrettier = argv.prettier || argv["eslint-with-prettier"] || features.includes("prettier");
|
|
2725
|
+
const needsOxlint = experimentFeatures.includes("oxlint") || argv["oxlint"];
|
|
2726
|
+
const needsRolldownVite = experimentFeatures.includes("rolldown-vite") || argv["rolldown-vite"];
|
|
2939
2727
|
const { e2eFramework } = result;
|
|
2940
|
-
const needsCypress = argv
|
|
2728
|
+
const needsCypress = argv.cypress || argv.tests || e2eFramework === "cypress";
|
|
2941
2729
|
const needsCypressCT = needsCypress && !needsVitest;
|
|
2942
|
-
const needsNightwatch = argv
|
|
2730
|
+
const needsNightwatch = argv.nightwatch || e2eFramework === "nightwatch";
|
|
2943
2731
|
const needsNightwatchCT = needsNightwatch && !needsVitest;
|
|
2944
|
-
const needsPlaywright = argv
|
|
2945
|
-
const root = path.join(cwd, targetDir);
|
|
2732
|
+
const needsPlaywright = argv.playwright || e2eFramework === "playwright";
|
|
2733
|
+
const root = path$1.join(cwd, targetDir);
|
|
2946
2734
|
if (fs.existsSync(root) && result.shouldOverwrite) emptyDir(root);
|
|
2947
2735
|
else if (!fs.existsSync(root)) fs.mkdirSync(root);
|
|
2948
2736
|
console.log(`\n${language.infos.scaffolding} ${root}...`);
|
|
@@ -2950,17 +2738,17 @@ async function init() {
|
|
|
2950
2738
|
name: result.packageName,
|
|
2951
2739
|
version: "0.0.0"
|
|
2952
2740
|
};
|
|
2953
|
-
fs.writeFileSync(path.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
|
|
2741
|
+
fs.writeFileSync(path$1.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
|
|
2954
2742
|
const templateRoot = fileURLToPath(new URL("./template", import.meta.url));
|
|
2955
2743
|
const callbacks = [];
|
|
2956
2744
|
const render = function render$1(templateName) {
|
|
2957
|
-
renderTemplate_default(path.resolve(templateRoot, templateName), root, callbacks);
|
|
2745
|
+
renderTemplate_default(path$1.resolve(templateRoot, templateName), root, callbacks);
|
|
2958
2746
|
};
|
|
2959
2747
|
const replaceVite = () => {
|
|
2960
|
-
const content = fs.readFileSync(path.resolve(root, "package.json"), "utf-8");
|
|
2748
|
+
const content = fs.readFileSync(path$1.resolve(root, "package.json"), "utf-8");
|
|
2961
2749
|
const json = JSON.parse(content);
|
|
2962
2750
|
json.devDependencies.vite = "npm:rolldown-vite@latest";
|
|
2963
|
-
fs.writeFileSync(path.resolve(root, "package.json"), JSON.stringify(json, null, 2));
|
|
2751
|
+
fs.writeFileSync(path$1.resolve(root, "package.json"), JSON.stringify(json, null, 2));
|
|
2964
2752
|
};
|
|
2965
2753
|
render("base");
|
|
2966
2754
|
if (needsJsx) render("config/jsx");
|
|
@@ -2997,22 +2785,20 @@ async function init() {
|
|
|
2997
2785
|
rootTsConfig.references.push({ path: "./nightwatch/tsconfig.json" });
|
|
2998
2786
|
}
|
|
2999
2787
|
if (needsNightwatchCT) render("tsconfig/nightwatch-ct");
|
|
3000
|
-
fs.writeFileSync(path.resolve(root, "tsconfig.json"), JSON.stringify(rootTsConfig, null, 2) + "\n", "utf-8");
|
|
3001
|
-
}
|
|
3002
|
-
if (needsEslint
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
if (needsOxlint) render("config/oxlint");
|
|
3015
|
-
if (needsPrettier) render("config/prettier");
|
|
2788
|
+
fs.writeFileSync(path$1.resolve(root, "tsconfig.json"), JSON.stringify(rootTsConfig, null, 2) + "\n", "utf-8");
|
|
2789
|
+
}
|
|
2790
|
+
if (needsEslint) {
|
|
2791
|
+
render("linting/base");
|
|
2792
|
+
if (needsTypeScript) render("linting/core/ts");
|
|
2793
|
+
else render("linting/core/js");
|
|
2794
|
+
if (needsCypress) render("linting/cypress");
|
|
2795
|
+
if (needsCypressCT) render("linting/cypress-ct");
|
|
2796
|
+
if (needsPlaywright) render("linting/playwright");
|
|
2797
|
+
if (needsVitest) render("linting/vitest");
|
|
2798
|
+
if (needsPrettier) render("linting/prettier");
|
|
2799
|
+
if (needsOxlint) render("linting/oxlint");
|
|
2800
|
+
}
|
|
2801
|
+
if (needsPrettier) render("formatting/prettier");
|
|
3016
2802
|
if (needsRolldownVite) replaceVite();
|
|
3017
2803
|
render(`code/${(needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default")}`);
|
|
3018
2804
|
if (needsPinia && needsRouter) render("entry/router-and-pinia");
|
|
@@ -3040,13 +2826,13 @@ async function init() {
|
|
|
3040
2826
|
}
|
|
3041
2827
|
if (needsTypeScript) {
|
|
3042
2828
|
preOrderDirectoryTraverse(root, () => {}, (filepath) => {
|
|
3043
|
-
if (filepath.endsWith(".js")
|
|
2829
|
+
if (filepath.endsWith(".js")) {
|
|
3044
2830
|
const tsFilePath = filepath.replace(/\.js$/, ".ts");
|
|
3045
2831
|
if (fs.existsSync(tsFilePath)) fs.unlinkSync(filepath);
|
|
3046
2832
|
else fs.renameSync(filepath, tsFilePath);
|
|
3047
|
-
} else if (path.basename(filepath) === "jsconfig.json") fs.unlinkSync(filepath);
|
|
2833
|
+
} else if (path$1.basename(filepath) === "jsconfig.json") fs.unlinkSync(filepath);
|
|
3048
2834
|
});
|
|
3049
|
-
const indexHtmlPath = path.resolve(root, "index.html");
|
|
2835
|
+
const indexHtmlPath = path$1.resolve(root, "index.html");
|
|
3050
2836
|
const indexHtmlContent = fs.readFileSync(indexHtmlPath, "utf8");
|
|
3051
2837
|
fs.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
|
|
3052
2838
|
} else preOrderDirectoryTraverse(root, () => {}, (filepath) => {
|
|
@@ -3058,7 +2844,7 @@ async function init() {
|
|
|
3058
2844
|
}
|
|
3059
2845
|
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
3060
2846
|
const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : /bun/.test(userAgent) ? "bun" : "npm";
|
|
3061
|
-
fs.writeFileSync(path.resolve(root, "README.md"), generateReadme({
|
|
2847
|
+
fs.writeFileSync(path$1.resolve(root, "README.md"), generateReadme({
|
|
3062
2848
|
projectName: result.projectName ?? result.packageName ?? defaultProjectName,
|
|
3063
2849
|
packageManager,
|
|
3064
2850
|
needsTypeScript,
|
|
@@ -3072,7 +2858,7 @@ async function init() {
|
|
|
3072
2858
|
}));
|
|
3073
2859
|
let outroMessage = `${language.infos.done}\n\n`;
|
|
3074
2860
|
if (root !== cwd) {
|
|
3075
|
-
const cdProjectName = path.relative(cwd, root);
|
|
2861
|
+
const cdProjectName = path$1.relative(cwd, root);
|
|
3076
2862
|
outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(`cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`))}\n`;
|
|
3077
2863
|
}
|
|
3078
2864
|
outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "install")))}\n`;
|
|
@@ -3080,7 +2866,7 @@ async function init() {
|
|
|
3080
2866
|
outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "dev")))}\n`;
|
|
3081
2867
|
if (!dotGitDirectoryState.hasDotGitDirectory) outroMessage += `
|
|
3082
2868
|
${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
|
|
3083
|
-
|
|
2869
|
+
|
|
3084
2870
|
${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
|
|
3085
2871
|
Se(outroMessage);
|
|
3086
2872
|
}
|