@vuetify/cli 0.0.13-beta.9 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1471 -1431
- package/dist/{prompt-DvFu_Zdt.mjs → prompt-BCBYX8qb.mjs} +18 -18
- package/package.json +7 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import g$1, { stdin, stdout } from "node:process";
|
|
3
3
|
import { WriteStream } from "node:tty";
|
|
4
|
-
import
|
|
4
|
+
import c from "node:readline";
|
|
5
5
|
|
|
6
6
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
|
|
7
7
|
function getDefaultExportFromCjs(x$1) {
|
|
@@ -400,7 +400,7 @@ function G(t, u$1, F$1) {
|
|
|
400
400
|
`).map((e$1) => oD(e$1, u$1, F$1)).join(`
|
|
401
401
|
`);
|
|
402
402
|
}
|
|
403
|
-
const c = {
|
|
403
|
+
const c$1 = {
|
|
404
404
|
actions: new Set([
|
|
405
405
|
"up",
|
|
406
406
|
"down",
|
|
@@ -420,7 +420,7 @@ const c = {
|
|
|
420
420
|
])
|
|
421
421
|
};
|
|
422
422
|
function k$1(t, u$1) {
|
|
423
|
-
if (typeof t == "string") return c.aliases.get(t) === u$1;
|
|
423
|
+
if (typeof t == "string") return c$1.aliases.get(t) === u$1;
|
|
424
424
|
for (const F$1 of t) if (F$1 !== void 0 && k$1(F$1, u$1)) return true;
|
|
425
425
|
return false;
|
|
426
426
|
}
|
|
@@ -482,13 +482,13 @@ var x = class {
|
|
|
482
482
|
const e$1 = new WriteStream(0);
|
|
483
483
|
e$1._write = (s, i, D) => {
|
|
484
484
|
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
485
|
-
}, this.input.pipe(e$1), this.rl =
|
|
485
|
+
}, this.input.pipe(e$1), this.rl = c.createInterface({
|
|
486
486
|
input: this.input,
|
|
487
487
|
output: e$1,
|
|
488
488
|
tabSize: 2,
|
|
489
489
|
prompt: "",
|
|
490
490
|
escapeCodeTimeout: 50
|
|
491
|
-
}),
|
|
491
|
+
}), c.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), d$1(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
492
492
|
this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u$1(this.value);
|
|
493
493
|
}), this.once("cancel", () => {
|
|
494
494
|
this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u$1(S);
|
|
@@ -496,7 +496,7 @@ var x = class {
|
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
onKeypress(u$1, F$1) {
|
|
499
|
-
if (this.state === "error" && (this.state = "active"), F$1?.name && (!this._track && c.aliases.has(F$1.name) && this.emit("cursor", c.aliases.get(F$1.name)), c.actions.has(F$1.name) && this.emit("cursor", F$1.name)), u$1 && (u$1.toLowerCase() === "y" || u$1.toLowerCase() === "n") && this.emit("confirm", u$1.toLowerCase() === "y"), u$1 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$1 && this.emit("key", u$1.toLowerCase()), F$1?.name === "return") {
|
|
499
|
+
if (this.state === "error" && (this.state = "active"), F$1?.name && (!this._track && c$1.aliases.has(F$1.name) && this.emit("cursor", c$1.aliases.get(F$1.name)), c$1.actions.has(F$1.name) && this.emit("cursor", F$1.name)), u$1 && (u$1.toLowerCase() === "y" || u$1.toLowerCase() === "n") && this.emit("confirm", u$1.toLowerCase() === "y"), u$1 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$1 && this.emit("key", u$1.toLowerCase()), F$1?.name === "return") {
|
|
500
500
|
if (this.opts.validate) {
|
|
501
501
|
const e$1 = this.opts.validate(this.value);
|
|
502
502
|
e$1 && (this.error = e$1 instanceof Error ? e$1.message : e$1, this.state = "error", this.rl?.write(this.value));
|
|
@@ -646,9 +646,9 @@ var PD = class extends x {
|
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
648
|
function ce() {
|
|
649
|
-
return
|
|
649
|
+
return g$1.platform !== "win32" ? g$1.env.TERM !== "linux" : !!g$1.env.CI || !!g$1.env.WT_SESSION || !!g$1.env.TERMINUS_SUBLIME || g$1.env.ConEmuTask === "{cmd::Cmder}" || g$1.env.TERM_PROGRAM === "Terminus-Sublime" || g$1.env.TERM_PROGRAM === "vscode" || g$1.env.TERM === "xterm-256color" || g$1.env.TERM === "alacritty" || g$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
650
650
|
}
|
|
651
|
-
const V = ce(), u = (t, n) => V ? t : n, le = u("❯", ">"), L = u("■", "x"), W = u("▲", "x"), C = u("✔", "√"), o = u(""), d = u(""), k = u("●", ">"), P
|
|
651
|
+
const V = ce(), u = (t, n) => V ? t : n, le = u("❯", ">"), L = u("■", "x"), W = u("▲", "x"), C = u("✔", "√"), o = u(""), d = u(""), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), w = (t) => {
|
|
652
652
|
switch (t) {
|
|
653
653
|
case "initial":
|
|
654
654
|
case "active": return e.cyan(le);
|
|
@@ -657,11 +657,11 @@ const V = ce(), u = (t, n) => V ? t : n, le = u("❯", ">"), L = u("■", "x"),
|
|
|
657
657
|
case "submit": return e.green(C);
|
|
658
658
|
}
|
|
659
659
|
}, B = (t) => {
|
|
660
|
-
const { cursor: n, options: s, style: r$1 } = t, i = t.maxItems ?? Number.POSITIVE_INFINITY, a = Math.max(process.stdout.rows - 4, 0), c$
|
|
660
|
+
const { cursor: n, options: s, style: r$1 } = t, i = t.maxItems ?? Number.POSITIVE_INFINITY, a = Math.max(process.stdout.rows - 4, 0), c$2 = Math.min(a, Math.max(i, 5));
|
|
661
661
|
let l = 0;
|
|
662
|
-
n >= l + c$
|
|
663
|
-
const $ = c$
|
|
664
|
-
return s.slice(l, l + c$
|
|
662
|
+
n >= l + c$2 - 3 ? l = Math.max(Math.min(n - c$2 + 3, s.length - c$2), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
|
|
663
|
+
const $ = c$2 < s.length && l > 0, p = c$2 < s.length && l + c$2 < s.length;
|
|
664
|
+
return s.slice(l, l + c$2).map((M, v$1, x$1) => {
|
|
665
665
|
const j = v$1 === 0 && $, E = v$1 === x$1.length - 1 && p;
|
|
666
666
|
return j || E ? e.dim("...") : r$1(M, v$1 + l === n);
|
|
667
667
|
});
|
|
@@ -701,7 +701,7 @@ ${w(this.state)} ${t.message}
|
|
|
701
701
|
case "submit": return `${r$1}${e.gray(o)} ${e.dim(i)}`;
|
|
702
702
|
case "cancel": return `${r$1}${e.gray(o)} ${e.strikethrough(e.dim(i))}
|
|
703
703
|
${e.gray(o)}`;
|
|
704
|
-
default: return `${r$1}${e.cyan(o)} ${this.value ? `${e.green(k)} ${n}` : `${e.dim(P
|
|
704
|
+
default: return `${r$1}${e.cyan(o)} ${this.value ? `${e.green(k)} ${n}` : `${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value ? `${e.dim(P)} ${e.dim(s)}` : `${e.green(k)} ${s}`}
|
|
705
705
|
${e.cyan(d)}
|
|
706
706
|
`;
|
|
707
707
|
}
|
|
@@ -714,7 +714,7 @@ ${e.cyan(d)}
|
|
|
714
714
|
case "selected": return `${e.dim(i)}`;
|
|
715
715
|
case "active": return `${e.green(k)} ${i} ${s.hint ? e.dim(`(${s.hint})`) : ""}`;
|
|
716
716
|
case "cancelled": return `${e.strikethrough(e.dim(i))}`;
|
|
717
|
-
default: return `${e.dim(P
|
|
717
|
+
default: return `${e.dim(P)} ${e.dim(i)}`;
|
|
718
718
|
}
|
|
719
719
|
};
|
|
720
720
|
return new jD({
|
|
@@ -758,8 +758,8 @@ ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e
|
|
|
758
758
|
const s = `${e.gray(o)}
|
|
759
759
|
${w(this.state)} ${t.message}
|
|
760
760
|
`, r$1 = (i, a) => {
|
|
761
|
-
const c$
|
|
762
|
-
return a && c$
|
|
761
|
+
const c$2 = this.value.includes(i.value);
|
|
762
|
+
return a && c$2 ? n(i, "active-selected") : c$2 ? n(i, "selected") : n(i, a ? "active" : "inactive");
|
|
763
763
|
};
|
|
764
764
|
switch (this.state) {
|
|
765
765
|
case "submit": return `${s}${e.gray(o)} ${this.options.filter(({ value: i }) => this.value.includes(i)).map((i) => n(i, "submitted")).join(e.dim(", ")) || e.dim("none")}`;
|
|
@@ -770,7 +770,7 @@ ${e.gray(o)}` : ""}`;
|
|
|
770
770
|
}
|
|
771
771
|
case "error": {
|
|
772
772
|
const i = this.error.split(`
|
|
773
|
-
`).map((a, c$
|
|
773
|
+
`).map((a, c$2) => c$2 === 0 ? `${e.yellow(d)} ${e.yellow(a)}` : ` ${a}`).join(`
|
|
774
774
|
`);
|
|
775
775
|
return `${s + e.yellow(o)} ${B({
|
|
776
776
|
options: this.options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Vuetify CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
],
|
|
21
21
|
"author": "Andrey Yolkin <andreyyolkin@gmail.com>",
|
|
22
22
|
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/vuetifyjs/cli.git",
|
|
26
|
+
"directory": "packages/cli"
|
|
27
|
+
},
|
|
23
28
|
"devDependencies": {
|
|
24
29
|
"@bomb.sh/tab": "^0.0.11",
|
|
25
30
|
"@clack/prompts": "^1.0.0-alpha.9",
|
|
@@ -30,7 +35,7 @@
|
|
|
30
35
|
"open": "^11.0.0",
|
|
31
36
|
"pathe": "^2.0.3",
|
|
32
37
|
"tsdown": "^0.16.8",
|
|
33
|
-
"@vuetify/cli-shared": "0.0.
|
|
38
|
+
"@vuetify/cli-shared": "0.0.14"
|
|
34
39
|
},
|
|
35
40
|
"dependencies": {
|
|
36
41
|
"@typescript-eslint/parser": "^8.53.0"
|