create-vuetify 3.1.1-next.1 → 3.1.1
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 +389 -286
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as resolve$1$1, n as dirname$1, t as basename$1 } from "./nypm-DFp9HL5N.mjs";
|
|
2
|
+
import { i as resolve$1$1, n as dirname$1$1, t as basename$1 } from "./nypm-DFp9HL5N.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import e from "node:assert";
|
|
5
5
|
import { format, inspect, parseArgs, promisify, stripVTControlCharacters } from "node:util";
|
|
@@ -7,7 +7,7 @@ import P, { stdin, stdout } from "node:process";
|
|
|
7
7
|
import * as k$1 from "node:readline";
|
|
8
8
|
import c from "node:readline";
|
|
9
9
|
import { ReadStream } from "node:tty";
|
|
10
|
-
import fs, { appendFileSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync,
|
|
10
|
+
import fs, { appendFileSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11
11
|
import path, { dirname, isAbsolute, join } from "node:path";
|
|
12
12
|
import fs$1, { constants, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
13
13
|
import { findPackage, readPackage, readPackageJSON, updatePackage, writePackageJSON } from "pkg-types";
|
|
@@ -9870,7 +9870,7 @@ var en_default = {
|
|
|
9870
9870
|
"checking": "Checking for updates...",
|
|
9871
9871
|
"intro": "Checking for updates...",
|
|
9872
9872
|
"not_installed": "Vuetify is not installed in this project.",
|
|
9873
|
-
"deprecated_v2": "Vuetify 2 is deprecated. Please consider upgrading to Vuetify
|
|
9873
|
+
"deprecated_v2": "Vuetify 2 is deprecated. Please consider upgrading to Vuetify 4.",
|
|
9874
9874
|
"outdated_v1": "Vuetify 1 is out of date. Please upgrade.",
|
|
9875
9875
|
"updated": "Updated %{pkg}",
|
|
9876
9876
|
"failed": "Failed to update %{pkg}",
|
|
@@ -9945,15 +9945,16 @@ var en_default = {
|
|
|
9945
9945
|
"hint": "Headless Component Library"
|
|
9946
9946
|
}
|
|
9947
9947
|
},
|
|
9948
|
-
"vuetify_version": {
|
|
9949
|
-
"select": "Select Vuetify version:",
|
|
9950
|
-
"3_x": "Vuetify 3 (latest)",
|
|
9951
|
-
"4_x": "Vuetify 4 (beta)"
|
|
9952
|
-
},
|
|
9953
9948
|
"css_framework": {
|
|
9954
9949
|
"select": "Which CSS framework?",
|
|
9955
9950
|
"unocss": { "hint": "Instant on-demand atomic CSS engine" },
|
|
9956
|
-
"
|
|
9951
|
+
"unocss_wind4": { "label": "UnoCSS with Wind4 preset" },
|
|
9952
|
+
"unocss_vuetify": { "label": "UnoCSS with Vuetify preset" },
|
|
9953
|
+
"tailwindcss": {
|
|
9954
|
+
"label": "Tailwind CSS",
|
|
9955
|
+
"hint": "A utility-first CSS framework"
|
|
9956
|
+
},
|
|
9957
|
+
"status": { "not_supported": "CSS framework %{css} is not supported for %{vuetify} yet." },
|
|
9957
9958
|
"none": "None"
|
|
9958
9959
|
},
|
|
9959
9960
|
"typescript": { "use": "Use TypeScript?" },
|
|
@@ -9972,16 +9973,16 @@ var en_default = {
|
|
|
9972
9973
|
},
|
|
9973
9974
|
"features": {
|
|
9974
9975
|
"select": "Select features to install: %{hint}",
|
|
9976
|
+
"router": {
|
|
9977
|
+
"label": "Router",
|
|
9978
|
+
"hint": "Configure Vue Router"
|
|
9979
|
+
},
|
|
9975
9980
|
"pinia": { "label": "Pinia" },
|
|
9976
9981
|
"eslint": {
|
|
9977
9982
|
"label": "ESLint",
|
|
9978
9983
|
"hint": "with eslint-config-vuetify"
|
|
9979
9984
|
},
|
|
9980
9985
|
"i18n": { "label": "I18n" },
|
|
9981
|
-
"vuetify_nuxt_module": {
|
|
9982
|
-
"label": "Vuetify Nuxt Module",
|
|
9983
|
-
"hint": "Use vuetify-nuxt-module instead of local plugin"
|
|
9984
|
-
},
|
|
9985
9986
|
"mcp": {
|
|
9986
9987
|
"label": "MCP",
|
|
9987
9988
|
"hint": "with @vuetify/mcp and @intellectronica/ruler"
|
|
@@ -10052,8 +10053,7 @@ var en_default = {
|
|
|
10052
10053
|
"platform": { "description": "The framework to use" },
|
|
10053
10054
|
"verbose": { "description": "Output verbose logs" },
|
|
10054
10055
|
"version": { "description": "The Vuetify version to check documentation for" },
|
|
10055
|
-
"preset": { "description": "Path to a preset file to load" }
|
|
10056
|
-
"vuetifyVersion": { "description": "Vuetify version" }
|
|
10056
|
+
"preset": { "description": "Path to a preset file to load" }
|
|
10057
10057
|
},
|
|
10058
10058
|
cli: {
|
|
10059
10059
|
"main": { "description": "Unified CLI for Vuetify" },
|
|
@@ -10121,7 +10121,7 @@ var ru_default = {
|
|
|
10121
10121
|
"checking": "Проверка обновлений...",
|
|
10122
10122
|
"intro": "Проверка обновлений...",
|
|
10123
10123
|
"not_installed": "Vuetify не установлен в этом проекте.",
|
|
10124
|
-
"deprecated_v2": "Vuetify 2 устарел. Пожалуйста, рассмотрите возможность обновления до Vuetify
|
|
10124
|
+
"deprecated_v2": "Vuetify 2 устарел. Пожалуйста, рассмотрите возможность обновления до Vuetify 4.",
|
|
10125
10125
|
"outdated_v1": "Vuetify 1 устарел. Пожалуйста, обновитесь.",
|
|
10126
10126
|
"updated": "Обновлен %{pkg}",
|
|
10127
10127
|
"failed": "Не удалось обновить %{pkg}",
|
|
@@ -10191,11 +10191,6 @@ var ru_default = {
|
|
|
10191
10191
|
"hint": "Библиотека headless компонентов"
|
|
10192
10192
|
}
|
|
10193
10193
|
},
|
|
10194
|
-
"vuetify_version": {
|
|
10195
|
-
"select": "Выберите версию Vuetify:",
|
|
10196
|
-
"3_x": "Vuetify 3 (стабильная)",
|
|
10197
|
-
"4_x": "Vuetify 4 (бета)"
|
|
10198
|
-
},
|
|
10199
10194
|
"css_framework": {
|
|
10200
10195
|
"select": "Какой фреймворк CSS вы хотите использовать?",
|
|
10201
10196
|
"none": "Никакой",
|
|
@@ -10203,10 +10198,19 @@ var ru_default = {
|
|
|
10203
10198
|
"label": "UnoCSS",
|
|
10204
10199
|
"hint": "Быстрая и гибкая система стилей"
|
|
10205
10200
|
},
|
|
10201
|
+
"unocss_wind4": {
|
|
10202
|
+
"label": "UnoCSS с пресетом Wind4",
|
|
10203
|
+
"hint": "скоро"
|
|
10204
|
+
},
|
|
10205
|
+
"unocss_vuetify": {
|
|
10206
|
+
"label": "UnoCSS с пресетом Vuetify",
|
|
10207
|
+
"hint": "скоро"
|
|
10208
|
+
},
|
|
10206
10209
|
"tailwindcss": {
|
|
10207
10210
|
"label": "Tailwind CSS",
|
|
10208
10211
|
"hint": "Атомарный CSS-фреймворк"
|
|
10209
|
-
}
|
|
10212
|
+
},
|
|
10213
|
+
"status": { "not_supported": "CSS-фреймворк %{css} пока не поддерживается для %{vuetify}." }
|
|
10210
10214
|
},
|
|
10211
10215
|
"typescript": { "use": "Использовать TypeScript?" },
|
|
10212
10216
|
"router": {
|
|
@@ -10224,16 +10228,16 @@ var ru_default = {
|
|
|
10224
10228
|
},
|
|
10225
10229
|
"features": {
|
|
10226
10230
|
"select": "Выберите функции для установки: %{hint}",
|
|
10231
|
+
"router": {
|
|
10232
|
+
"label": "Роутер",
|
|
10233
|
+
"hint": "Добавить Vue Router"
|
|
10234
|
+
},
|
|
10227
10235
|
"pinia": { "label": "Pinia" },
|
|
10228
10236
|
"eslint": {
|
|
10229
10237
|
"label": "ESLint",
|
|
10230
10238
|
"hint": "с eslint-config-vuetify"
|
|
10231
10239
|
},
|
|
10232
10240
|
"i18n": { "label": "I18n" },
|
|
10233
|
-
"vuetify_nuxt_module": {
|
|
10234
|
-
"label": "Vuetify Nuxt Module",
|
|
10235
|
-
"hint": "Использовать vuetify-nuxt-module вместо локального плагина"
|
|
10236
|
-
},
|
|
10237
10241
|
"mcp": {
|
|
10238
10242
|
"label": "MCP",
|
|
10239
10243
|
"hint": "с @vuetify/mcp и @intellectronica/ruler"
|
|
@@ -10299,8 +10303,7 @@ var ru_default = {
|
|
|
10299
10303
|
"platform": { "description": "Фреймворк для использования" },
|
|
10300
10304
|
"verbose": { "description": "Вывести подробные логи" },
|
|
10301
10305
|
"preset": { "description": "Путь к файлу пресета для загрузки" },
|
|
10302
|
-
"version": { "description": "Версия Vuetify для просмотра документации" }
|
|
10303
|
-
"vuetifyVersion": { "description": "Версия Vuetify" }
|
|
10306
|
+
"version": { "description": "Версия Vuetify для просмотра документации" }
|
|
10304
10307
|
},
|
|
10305
10308
|
cli: {
|
|
10306
10309
|
"main": { "description": "CLI для Vuetify" },
|
|
@@ -10325,6 +10328,7 @@ const i18n$2 = new import_require.I18n({
|
|
|
10325
10328
|
ru: ru_default
|
|
10326
10329
|
}, {
|
|
10327
10330
|
defaultLocale: "en",
|
|
10331
|
+
enableFallback: true,
|
|
10328
10332
|
locale: normalizeLocale$1(getCurrentLocale())
|
|
10329
10333
|
});
|
|
10330
10334
|
|
|
@@ -10365,7 +10369,7 @@ function projectArgs(options) {
|
|
|
10365
10369
|
css: {
|
|
10366
10370
|
type: "string",
|
|
10367
10371
|
description: i18n$1.t("args.css.description"),
|
|
10368
|
-
valueHint: "unocss | tailwindcss | none"
|
|
10372
|
+
valueHint: "unocss | unocss-wind4 | unocss-vuetify | tailwindcss | none"
|
|
10369
10373
|
},
|
|
10370
10374
|
packageManager: {
|
|
10371
10375
|
type: "string",
|
|
@@ -10402,10 +10406,6 @@ function projectArgs(options) {
|
|
|
10402
10406
|
preset: {
|
|
10403
10407
|
type: "string",
|
|
10404
10408
|
description: i18n$1.t("args.preset.description")
|
|
10405
|
-
},
|
|
10406
|
-
vuetifyVersion: {
|
|
10407
|
-
type: "string",
|
|
10408
|
-
description: i18n$1.t("args.vuetifyVersion.description")
|
|
10409
10409
|
}
|
|
10410
10410
|
};
|
|
10411
10411
|
if (options?.exclude) for (const key of options.exclude) delete args[key];
|
|
@@ -11205,7 +11205,7 @@ function ht() {
|
|
|
11205
11205
|
const ee = ht(), ue = () => process.env.CI === "true", Te = (e) => e.isTTY === !0, w = (e, r) => ee ? e : r, Me = w("◆", "*"), ce = w("■", "x"), de = w("▲", "x"), k = w("◇", "o"), $e = w("┌", "T"), h = w("│", "|"), x$1 = w("└", "—"), Re = w("┐", "T"), Oe = w("┘", "—"), Y = w("●", ">"), K = w("○", " "), te = w("◻", "[•]"), G = w("◼", "[+]"), z = w("◻", "[ ]"), Pe = w("▪", "•"), se = w("─", "-"), he = w("╮", "+"), Ne = w("├", "+"), me = w("╯", "+"), pe = w("╰", "+"), We = w("╭", "+"), ge = w("●", "•"), fe = w("◆", "*"), Fe = w("▲", "!"), ye = w("■", "x"), N = (e) => {
|
|
11206
11206
|
switch (e) {
|
|
11207
11207
|
case "initial":
|
|
11208
|
-
case "active": return import_picocolors.default.
|
|
11208
|
+
case "active": return import_picocolors.default.blue(Me);
|
|
11209
11209
|
case "cancel": return import_picocolors.default.red(ce);
|
|
11210
11210
|
case "error": return import_picocolors.default.yellow(de);
|
|
11211
11211
|
case "submit": return import_picocolors.default.green(k);
|
|
@@ -11213,7 +11213,7 @@ const ee = ht(), ue = () => process.env.CI === "true", Te = (e) => e.isTTY === !
|
|
|
11213
11213
|
}, Ee = (e) => {
|
|
11214
11214
|
switch (e) {
|
|
11215
11215
|
case "initial":
|
|
11216
|
-
case "active": return import_picocolors.default.
|
|
11216
|
+
case "active": return import_picocolors.default.blue(h);
|
|
11217
11217
|
case "cancel": return import_picocolors.default.red(h);
|
|
11218
11218
|
case "error": return import_picocolors.default.yellow(h);
|
|
11219
11219
|
case "submit": return import_picocolors.default.green(h);
|
|
@@ -11443,7 +11443,7 @@ ${import_picocolors.default.gray(h)}${l}`;
|
|
|
11443
11443
|
${import_picocolors.default.gray(h)}${u}`;
|
|
11444
11444
|
}
|
|
11445
11445
|
default: {
|
|
11446
|
-
const u = `${(this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.
|
|
11446
|
+
const u = `${(this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.blue)(h)} `, l = (this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.blue)(x$1);
|
|
11447
11447
|
let a = "";
|
|
11448
11448
|
if (this.isNavigating || o) {
|
|
11449
11449
|
const c = o ? n : s;
|
|
@@ -11499,7 +11499,7 @@ ${N(this.state)} ${e.message}
|
|
|
11499
11499
|
case "submit": return `${i}${import_picocolors.default.gray(h)} ${import_picocolors.default.dim(`${this.selectedValues.length} items selected`)}`;
|
|
11500
11500
|
case "cancel": return `${i}${import_picocolors.default.gray(h)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(n))}`;
|
|
11501
11501
|
default: {
|
|
11502
|
-
const g = this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.
|
|
11502
|
+
const g = this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.blue, E = [
|
|
11503
11503
|
`${import_picocolors.default.dim("↑/↓")} to navigate`,
|
|
11504
11504
|
`${import_picocolors.default.dim(this.isNavigating ? "Space/Tab:" : "Tab:")} select`,
|
|
11505
11505
|
`${import_picocolors.default.dim("Enter:")} confirm`,
|
|
@@ -11591,8 +11591,8 @@ ${N(this.state)} ${e.message}
|
|
|
11591
11591
|
case "submit": return `${i}${import_picocolors.default.gray(h)} ${import_picocolors.default.dim(n)}`;
|
|
11592
11592
|
case "cancel": return `${i}${import_picocolors.default.gray(h)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(n))}
|
|
11593
11593
|
${import_picocolors.default.gray(h)}`;
|
|
11594
|
-
default: return `${i}${import_picocolors.default.
|
|
11595
|
-
${import_picocolors.default.
|
|
11594
|
+
default: return `${i}${import_picocolors.default.blue(h)} ${this.value ? `${import_picocolors.default.green(Y)} ${r}` : `${import_picocolors.default.dim(K)} ${import_picocolors.default.dim(r)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(K)} ${import_picocolors.default.dim(s)}` : `${import_picocolors.default.green(Y)} ${s}`}
|
|
11595
|
+
${import_picocolors.default.blue(x$1)}
|
|
11596
11596
|
`;
|
|
11597
11597
|
}
|
|
11598
11598
|
}
|
|
@@ -11616,11 +11616,11 @@ ${import_picocolors.default.cyan(x$1)}
|
|
|
11616
11616
|
let y = "";
|
|
11617
11617
|
if (s > 0 && !d) {
|
|
11618
11618
|
const c = `
|
|
11619
|
-
${import_picocolors.default.
|
|
11619
|
+
${import_picocolors.default.blue(h)}`;
|
|
11620
11620
|
y = `${c.repeat(s - 1)}${c} `;
|
|
11621
11621
|
}
|
|
11622
|
-
if (u === "active") return `${y}${import_picocolors.default.dim(p)}${import_picocolors.default.
|
|
11623
|
-
if (u === "group-active") return `${y}${p}${import_picocolors.default.
|
|
11622
|
+
if (u === "active") return `${y}${import_picocolors.default.dim(p)}${import_picocolors.default.blue(te)} ${a}${o.hint ? ` ${import_picocolors.default.dim(`(${o.hint})`)}` : ""}`;
|
|
11623
|
+
if (u === "group-active") return `${y}${p}${import_picocolors.default.blue(te)} ${import_picocolors.default.dim(a)}`;
|
|
11624
11624
|
if (u === "group-active-selected") return `${y}${p}${import_picocolors.default.green(G)} ${import_picocolors.default.dim(a)}`;
|
|
11625
11625
|
if (u === "selected") {
|
|
11626
11626
|
const c = d || r ? import_picocolors.default.green(G) : "";
|
|
@@ -11678,10 +11678,10 @@ ${l}
|
|
|
11678
11678
|
return $ ? c = i(d, p ? "group-active-selected" : "group-active", E) : y && p ? c = i(d, "active-selected", E) : p ? c = i(d, "selected", E) : c = i(d, y ? "active" : "inactive", E), `${g !== 0 && !c.startsWith(`
|
|
11679
11679
|
`) ? " " : ""}${c}`;
|
|
11680
11680
|
}).join(`
|
|
11681
|
-
${import_picocolors.default.
|
|
11681
|
+
${import_picocolors.default.blue(h)}`), a = l.startsWith(`
|
|
11682
11682
|
`) ? "" : " ";
|
|
11683
|
-
return `${o}${import_picocolors.default.
|
|
11684
|
-
${import_picocolors.default.
|
|
11683
|
+
return `${o}${import_picocolors.default.blue(h)}${a}${l}
|
|
11684
|
+
${import_picocolors.default.blue(x$1)}
|
|
11685
11685
|
`;
|
|
11686
11686
|
}
|
|
11687
11687
|
}
|
|
@@ -11752,7 +11752,7 @@ ${import_picocolors.default.gray(x$1)} ${e}
|
|
|
11752
11752
|
`), Lt = (e) => {
|
|
11753
11753
|
const r = (i, n) => {
|
|
11754
11754
|
const o = i.label ?? String(i.value);
|
|
11755
|
-
return n === "disabled" ? `${import_picocolors.default.gray(z)} ${Q(o, (u) => import_picocolors.default.strikethrough(import_picocolors.default.gray(u)))}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors.default.
|
|
11755
|
+
return n === "disabled" ? `${import_picocolors.default.gray(z)} ${Q(o, (u) => import_picocolors.default.strikethrough(import_picocolors.default.gray(u)))}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors.default.blue(te)} ${o}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors.default.green(G)} ${Q(o, import_picocolors.default.dim)}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : n === "cancelled" ? `${Q(o, (u) => import_picocolors.default.strikethrough(import_picocolors.default.dim(u)))}` : n === "active-selected" ? `${import_picocolors.default.green(G)} ${o}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : n === "submitted" ? `${Q(o, import_picocolors.default.dim)}` : `${import_picocolors.default.dim(z)} ${Q(o, import_picocolors.default.dim)}`;
|
|
11756
11756
|
}, s = e.required ?? !0;
|
|
11757
11757
|
return new Mt$1({
|
|
11758
11758
|
options: e.options,
|
|
@@ -11805,7 +11805,7 @@ ${a}
|
|
|
11805
11805
|
`;
|
|
11806
11806
|
}
|
|
11807
11807
|
default: {
|
|
11808
|
-
const l = `${import_picocolors.default.
|
|
11808
|
+
const l = `${import_picocolors.default.blue(h)} `, a = n.split(`
|
|
11809
11809
|
`).length;
|
|
11810
11810
|
return `${n}${l}${J({
|
|
11811
11811
|
output: e.output,
|
|
@@ -11817,7 +11817,7 @@ ${a}
|
|
|
11817
11817
|
style: u
|
|
11818
11818
|
}).join(`
|
|
11819
11819
|
${l}`)}
|
|
11820
|
-
${import_picocolors.default.
|
|
11820
|
+
${import_picocolors.default.blue(x$1)}
|
|
11821
11821
|
`;
|
|
11822
11822
|
}
|
|
11823
11823
|
}
|
|
@@ -11873,8 +11873,8 @@ ${import_picocolors.default.yellow(x$1)} ${import_picocolors.default.yellow(thi
|
|
|
11873
11873
|
return `${r}${import_picocolors.default.gray(h)}${n}${i ? `
|
|
11874
11874
|
${import_picocolors.default.gray(h)}` : ""}`;
|
|
11875
11875
|
}
|
|
11876
|
-
default: return `${r}${import_picocolors.default.
|
|
11877
|
-
${import_picocolors.default.
|
|
11876
|
+
default: return `${r}${import_picocolors.default.blue(h)} ${s}
|
|
11877
|
+
${import_picocolors.default.blue(x$1)}
|
|
11878
11878
|
`;
|
|
11879
11879
|
}
|
|
11880
11880
|
}
|
|
@@ -12023,7 +12023,7 @@ ${n}
|
|
|
12023
12023
|
${import_picocolors.default.gray(h)}`;
|
|
12024
12024
|
}
|
|
12025
12025
|
default: {
|
|
12026
|
-
const u = `${import_picocolors.default.
|
|
12026
|
+
const u = `${import_picocolors.default.blue(h)} `, l = o.split(`
|
|
12027
12027
|
`).length;
|
|
12028
12028
|
return `${o}${u}${J({
|
|
12029
12029
|
output: e.output,
|
|
@@ -12035,7 +12035,7 @@ ${import_picocolors.default.gray(h)}`;
|
|
|
12035
12035
|
style: (a, d) => r(a, a.disabled ? "disabled" : d ? "active" : "inactive")
|
|
12036
12036
|
}).join(`
|
|
12037
12037
|
${u}`)}
|
|
12038
|
-
${import_picocolors.default.
|
|
12038
|
+
${import_picocolors.default.blue(x$1)}
|
|
12039
12039
|
`;
|
|
12040
12040
|
}
|
|
12041
12041
|
}
|
|
@@ -12068,10 +12068,10 @@ ${N(this.state)} ${e.message}
|
|
|
12068
12068
|
${import_picocolors.default.gray(h)}`;
|
|
12069
12069
|
}
|
|
12070
12070
|
default: {
|
|
12071
|
-
const i = `${import_picocolors.default.
|
|
12071
|
+
const i = `${import_picocolors.default.blue(h)} `;
|
|
12072
12072
|
return `${s}${this.options.map((o, u) => Bt$1(e.output, r(o, u === this.cursor ? "active" : "inactive"), i)).join(`
|
|
12073
12073
|
`)}
|
|
12074
|
-
${import_picocolors.default.
|
|
12074
|
+
${import_picocolors.default.blue(x$1)}
|
|
12075
12075
|
`;
|
|
12076
12076
|
}
|
|
12077
12077
|
}
|
|
@@ -12256,8 +12256,8 @@ ${a}${u}
|
|
|
12256
12256
|
return `${s}${l}${u}${o.trim() ? `
|
|
12257
12257
|
${l}` : ""}`;
|
|
12258
12258
|
}
|
|
12259
|
-
default: return `${s}${r ? `${import_picocolors.default.
|
|
12260
|
-
${r ? import_picocolors.default.
|
|
12259
|
+
default: return `${s}${r ? `${import_picocolors.default.blue(h)} ` : ""}${n}
|
|
12260
|
+
${r ? import_picocolors.default.blue(x$1) : ""}
|
|
12261
12261
|
`;
|
|
12262
12262
|
}
|
|
12263
12263
|
}
|
|
@@ -12389,6 +12389,11 @@ const relative = function(from, to) {
|
|
|
12389
12389
|
}
|
|
12390
12390
|
return [..._from.map(() => ".."), ..._to].join("/");
|
|
12391
12391
|
};
|
|
12392
|
+
const dirname$1 = function(p) {
|
|
12393
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
12394
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
12395
|
+
return segments.join("/") || (isAbsolute$1(p) ? "/" : ".");
|
|
12396
|
+
};
|
|
12392
12397
|
|
|
12393
12398
|
//#endregion
|
|
12394
12399
|
//#region ../../node_modules/.pnpm/eslint-visitor-keys@4.2.1/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs
|
|
@@ -27129,6 +27134,40 @@ function link(text, url) {
|
|
|
27129
27134
|
return options.enabled ? OSC + "8;;" + url + BEL + text + OSC + "8;;\x07" : `${text} (\u200B${url}\u200B)`;
|
|
27130
27135
|
}
|
|
27131
27136
|
|
|
27137
|
+
//#endregion
|
|
27138
|
+
//#region ../shared/src/constants/presets.ts
|
|
27139
|
+
const standardPresets = {
|
|
27140
|
+
base: {
|
|
27141
|
+
meta: { displayName: "Base" },
|
|
27142
|
+
type: "vuetify",
|
|
27143
|
+
platform: "vue",
|
|
27144
|
+
features: [],
|
|
27145
|
+
router: "none",
|
|
27146
|
+
typescript: true
|
|
27147
|
+
},
|
|
27148
|
+
full: {
|
|
27149
|
+
meta: { displayName: "Full" },
|
|
27150
|
+
type: "vuetify",
|
|
27151
|
+
platform: "vue",
|
|
27152
|
+
features: [
|
|
27153
|
+
"eslint",
|
|
27154
|
+
"pinia",
|
|
27155
|
+
"i18n",
|
|
27156
|
+
"mcp"
|
|
27157
|
+
],
|
|
27158
|
+
router: "router",
|
|
27159
|
+
typescript: true
|
|
27160
|
+
},
|
|
27161
|
+
v0: {
|
|
27162
|
+
meta: { displayName: "Vuetify0" },
|
|
27163
|
+
type: "vuetify0",
|
|
27164
|
+
platform: "vue",
|
|
27165
|
+
features: ["eslint"],
|
|
27166
|
+
router: "router",
|
|
27167
|
+
typescript: true
|
|
27168
|
+
}
|
|
27169
|
+
};
|
|
27170
|
+
|
|
27132
27171
|
//#endregion
|
|
27133
27172
|
//#region ../shared/src/prompts.ts
|
|
27134
27173
|
async function prompt(args, cwd = process.cwd()) {
|
|
@@ -27194,35 +27233,42 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27194
27233
|
}]
|
|
27195
27234
|
});
|
|
27196
27235
|
},
|
|
27197
|
-
|
|
27198
|
-
if ((results.type || args.type) !== "vuetify") return Promise.resolve(void 0);
|
|
27199
|
-
if (args.vuetifyVersion) return Promise.resolve(args.vuetifyVersion);
|
|
27200
|
-
if (!args.interactive) return Promise.resolve("3.x");
|
|
27201
|
-
return qt({
|
|
27202
|
-
message: i18n$1.t("prompts.vuetify_version.select"),
|
|
27203
|
-
initialValue: "3.x",
|
|
27204
|
-
options: [{
|
|
27205
|
-
label: i18n$1.t("prompts.vuetify_version.3_x"),
|
|
27206
|
-
value: "3.x"
|
|
27207
|
-
}, {
|
|
27208
|
-
label: i18n$1.t("prompts.vuetify_version.4_x"),
|
|
27209
|
-
value: "4.x"
|
|
27210
|
-
}]
|
|
27211
|
-
});
|
|
27212
|
-
},
|
|
27213
|
-
cssFramework: ({ results }) => {
|
|
27236
|
+
css: ({ results }) => {
|
|
27214
27237
|
const type = results.type || args.type;
|
|
27215
|
-
|
|
27238
|
+
const platform = results.platform || args.platform;
|
|
27216
27239
|
if (args.css) {
|
|
27217
|
-
if (args.css
|
|
27218
|
-
if (args.css.
|
|
27219
|
-
return Promise.resolve(
|
|
27240
|
+
if (type === "vuetify" && args.css === "unocss") return Promise.resolve("unocss-vuetify");
|
|
27241
|
+
if (type === "vuetify0" && args.css.startsWith("unocss-")) R.warn("v0 supports only --css with \"unocss | tailwindcss | none\", fallback to \"unocss\"");
|
|
27242
|
+
return Promise.resolve(args.css);
|
|
27220
27243
|
}
|
|
27221
27244
|
if (!args.interactive) return Promise.resolve("none");
|
|
27245
|
+
if (type === "vuetify" && platform === "nuxt") return qt({
|
|
27246
|
+
message: i18n$1.t("prompts.css_framework.select"),
|
|
27247
|
+
initialValue: "none",
|
|
27248
|
+
options: [
|
|
27249
|
+
{
|
|
27250
|
+
label: i18n$1.t("prompts.css_framework.none"),
|
|
27251
|
+
value: "none"
|
|
27252
|
+
},
|
|
27253
|
+
{
|
|
27254
|
+
label: "Tailwind CSS",
|
|
27255
|
+
value: "tailwindcss",
|
|
27256
|
+
hint: i18n$1.t("prompts.css_framework.tailwindcss.hint")
|
|
27257
|
+
},
|
|
27258
|
+
{
|
|
27259
|
+
label: i18n$1.t("prompts.css_framework.unocss_wind4.label"),
|
|
27260
|
+
value: "unocss-wind4"
|
|
27261
|
+
},
|
|
27262
|
+
{
|
|
27263
|
+
label: i18n$1.t("prompts.css_framework.unocss_vuetify.label"),
|
|
27264
|
+
value: "unocss-vuetify"
|
|
27265
|
+
}
|
|
27266
|
+
]
|
|
27267
|
+
});
|
|
27222
27268
|
return qt({
|
|
27223
27269
|
message: i18n$1.t("prompts.css_framework.select"),
|
|
27224
27270
|
initialValue: type === "vuetify0" ? "unocss" : "none",
|
|
27225
|
-
options: [
|
|
27271
|
+
options: type === "vuetify0" ? [
|
|
27226
27272
|
{
|
|
27227
27273
|
label: "UnoCSS",
|
|
27228
27274
|
value: "unocss",
|
|
@@ -27237,46 +27283,39 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27237
27283
|
label: i18n$1.t("prompts.css_framework.none"),
|
|
27238
27284
|
value: "none"
|
|
27239
27285
|
}
|
|
27240
|
-
]
|
|
27241
|
-
});
|
|
27242
|
-
},
|
|
27243
|
-
typescript: ({ results }) => {
|
|
27244
|
-
if ((results.platform || args.platform) === "vue" && args.typescript === void 0) return Mt({
|
|
27245
|
-
message: i18n$1.t("prompts.typescript.use"),
|
|
27246
|
-
initialValue: true
|
|
27247
|
-
});
|
|
27248
|
-
return Promise.resolve(args.typescript ?? true);
|
|
27249
|
-
},
|
|
27250
|
-
router: ({ results }) => {
|
|
27251
|
-
if (args.router) return Promise.resolve(args.router);
|
|
27252
|
-
if ((results.platform || args.platform) !== "vue") return Promise.resolve("none");
|
|
27253
|
-
if (!args.interactive) return Promise.resolve("none");
|
|
27254
|
-
return qt({
|
|
27255
|
-
message: i18n$1.t("prompts.router.select"),
|
|
27256
|
-
initialValue: "router",
|
|
27257
|
-
options: [
|
|
27286
|
+
] : [
|
|
27258
27287
|
{
|
|
27259
|
-
label: i18n$1.t("prompts.
|
|
27288
|
+
label: i18n$1.t("prompts.css_framework.none"),
|
|
27260
27289
|
value: "none"
|
|
27261
27290
|
},
|
|
27262
27291
|
{
|
|
27263
|
-
label:
|
|
27264
|
-
value: "
|
|
27265
|
-
hint: i18n$1.t("prompts.
|
|
27292
|
+
label: "Tailwind CSS",
|
|
27293
|
+
value: "tailwindcss",
|
|
27294
|
+
hint: i18n$1.t("prompts.css_framework.tailwindcss.hint")
|
|
27266
27295
|
},
|
|
27267
27296
|
{
|
|
27268
|
-
label: i18n$1.t("prompts.
|
|
27269
|
-
value: "
|
|
27270
|
-
|
|
27297
|
+
label: i18n$1.t("prompts.css_framework.unocss_wind4.label"),
|
|
27298
|
+
value: "unocss-wind4"
|
|
27299
|
+
},
|
|
27300
|
+
{
|
|
27301
|
+
label: i18n$1.t("prompts.css_framework.unocss_vuetify.label"),
|
|
27302
|
+
value: "unocss-vuetify"
|
|
27271
27303
|
}
|
|
27272
27304
|
]
|
|
27273
27305
|
});
|
|
27274
27306
|
},
|
|
27307
|
+
typescript: ({ results }) => {
|
|
27308
|
+
if ((results.platform || args.platform) === "vue" && args.typescript === void 0) return Mt({
|
|
27309
|
+
message: i18n$1.t("prompts.typescript.use"),
|
|
27310
|
+
initialValue: true
|
|
27311
|
+
});
|
|
27312
|
+
return Promise.resolve(args.typescript ?? true);
|
|
27313
|
+
},
|
|
27275
27314
|
features: ({ results }) => {
|
|
27276
|
-
if (args.features) return Promise.resolve(args.features
|
|
27315
|
+
if (args.features) return Promise.resolve(args.features);
|
|
27277
27316
|
if (!args.interactive) return Promise.resolve([]);
|
|
27278
27317
|
const platform = results.platform || args.platform;
|
|
27279
|
-
|
|
27318
|
+
results.type || args.type;
|
|
27280
27319
|
return platform === "vue" ? Lt({
|
|
27281
27320
|
message: i18n$1.t("prompts.features.select", { hint: dim("↑/↓ to navigate, space to select, a to toggle all, enter to confirm") }),
|
|
27282
27321
|
options: [
|
|
@@ -27285,6 +27324,11 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27285
27324
|
value: "eslint",
|
|
27286
27325
|
hint: i18n$1.t("prompts.features.eslint.hint")
|
|
27287
27326
|
},
|
|
27327
|
+
{
|
|
27328
|
+
label: i18n$1.t("prompts.features.router.label"),
|
|
27329
|
+
value: "router",
|
|
27330
|
+
hint: i18n$1.t("prompts.features.router.hint")
|
|
27331
|
+
},
|
|
27288
27332
|
{
|
|
27289
27333
|
label: i18n$1.t("prompts.features.mcp.label"),
|
|
27290
27334
|
value: "mcp",
|
|
@@ -27309,11 +27353,6 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27309
27353
|
value: "eslint",
|
|
27310
27354
|
hint: i18n$1.t("prompts.features.eslint.hint")
|
|
27311
27355
|
},
|
|
27312
|
-
...type === "vuetify0" ? [] : [{
|
|
27313
|
-
label: i18n$1.t("prompts.features.vuetify_nuxt_module.label"),
|
|
27314
|
-
value: "vuetify-nuxt-module",
|
|
27315
|
-
hint: i18n$1.t("prompts.features.vuetify_nuxt_module.hint")
|
|
27316
|
-
}],
|
|
27317
27356
|
{
|
|
27318
27357
|
label: i18n$1.t("prompts.features.mcp.label"),
|
|
27319
27358
|
value: "mcp",
|
|
@@ -27328,28 +27367,56 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27328
27367
|
value: "i18n"
|
|
27329
27368
|
}
|
|
27330
27369
|
],
|
|
27331
|
-
initialValues: [
|
|
27332
|
-
"eslint",
|
|
27333
|
-
...type === "vuetify0" ? [] : ["vuetify-nuxt-module"],
|
|
27334
|
-
"mcp"
|
|
27335
|
-
],
|
|
27370
|
+
initialValues: ["eslint", "mcp"],
|
|
27336
27371
|
required: false
|
|
27337
27372
|
});
|
|
27338
27373
|
},
|
|
27374
|
+
router: ({ results }) => {
|
|
27375
|
+
if (args.router) return Promise.resolve(args.router);
|
|
27376
|
+
if ((results.platform || args.platform) !== "vue") return Promise.resolve("none");
|
|
27377
|
+
if (!(results.features || args.features || []).includes("router")) return Promise.resolve("none");
|
|
27378
|
+
if (!args.interactive) return Promise.resolve("router");
|
|
27379
|
+
return qt({
|
|
27380
|
+
message: i18n$1.t("prompts.router.select"),
|
|
27381
|
+
initialValue: "router",
|
|
27382
|
+
options: [
|
|
27383
|
+
{
|
|
27384
|
+
label: i18n$1.t("prompts.router.none"),
|
|
27385
|
+
value: "none"
|
|
27386
|
+
},
|
|
27387
|
+
{
|
|
27388
|
+
label: i18n$1.t("prompts.router.standard.label"),
|
|
27389
|
+
value: "router",
|
|
27390
|
+
hint: i18n$1.t("prompts.router.standard.hint")
|
|
27391
|
+
},
|
|
27392
|
+
{
|
|
27393
|
+
label: i18n$1.t("prompts.router.file.label"),
|
|
27394
|
+
value: "file-router",
|
|
27395
|
+
hint: i18n$1.t("prompts.router.file.hint")
|
|
27396
|
+
}
|
|
27397
|
+
]
|
|
27398
|
+
});
|
|
27399
|
+
},
|
|
27339
27400
|
clientHints: ({ results }) => {
|
|
27340
27401
|
if (args.clientHints !== void 0) return Promise.resolve(args.clientHints);
|
|
27341
27402
|
if (!args.interactive) return Promise.resolve(false);
|
|
27342
|
-
|
|
27343
|
-
const features = results.features || args.features || [];
|
|
27344
|
-
if (platform === "nuxt" && features.includes("vuetify-nuxt-module")) return Mt({
|
|
27403
|
+
if ((results.platform || args.platform) === "nuxt") return Mt({
|
|
27345
27404
|
message: i18n$1.t("prompts.client_hints.enable"),
|
|
27346
27405
|
initialValue: false
|
|
27347
27406
|
});
|
|
27348
27407
|
return Promise.resolve(false);
|
|
27349
27408
|
},
|
|
27350
|
-
|
|
27409
|
+
install: () => {
|
|
27410
|
+
if (args.install !== void 0) return Promise.resolve(args.install);
|
|
27411
|
+
if (!args.interactive) return Promise.resolve(false);
|
|
27412
|
+
return Mt({
|
|
27413
|
+
message: i18n$1.t("prompts.install"),
|
|
27414
|
+
initialValue: true
|
|
27415
|
+
});
|
|
27416
|
+
},
|
|
27417
|
+
packageManager: ({ results }) => {
|
|
27351
27418
|
if (args.packageManager) return Promise.resolve(args.packageManager);
|
|
27352
|
-
if (args.install === false) return Promise.resolve("
|
|
27419
|
+
if ((results.install ?? args.install) === false) return Promise.resolve(getUserAgent() ?? "npm");
|
|
27353
27420
|
if (!args.interactive) return Promise.resolve(getUserAgent() ?? "npm");
|
|
27354
27421
|
return qt({
|
|
27355
27422
|
message: i18n$1.t("prompts.package_manager.select"),
|
|
@@ -27374,31 +27441,18 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
27374
27441
|
{
|
|
27375
27442
|
label: "bun",
|
|
27376
27443
|
value: "bun"
|
|
27377
|
-
},
|
|
27378
|
-
{
|
|
27379
|
-
label: "none",
|
|
27380
|
-
value: "none"
|
|
27381
27444
|
}
|
|
27382
27445
|
]
|
|
27383
27446
|
});
|
|
27384
|
-
},
|
|
27385
|
-
install: ({ results }) => {
|
|
27386
|
-
if (args.install !== void 0) return Promise.resolve(args.install);
|
|
27387
|
-
if (!args.interactive) return Promise.resolve(false);
|
|
27388
|
-
if ((results.packageManager || args.packageManager) === "none") return Promise.resolve(false);
|
|
27389
|
-
return Mt({
|
|
27390
|
-
message: i18n$1.t("prompts.install"),
|
|
27391
|
-
initialValue: true
|
|
27392
|
-
});
|
|
27393
27447
|
}
|
|
27394
27448
|
}, { onCancel: () => {
|
|
27395
27449
|
Pt(i18n$1.t("prompts.cancel"));
|
|
27396
27450
|
process.exit(0);
|
|
27397
27451
|
} });
|
|
27398
27452
|
const features = [
|
|
27399
|
-
...options.features,
|
|
27400
|
-
options.router,
|
|
27401
|
-
options.
|
|
27453
|
+
...(options.features || []).filter((f) => f !== "router"),
|
|
27454
|
+
options.router === "none" ? void 0 : options.router,
|
|
27455
|
+
options.type === "vuetify0" ? options.css === "none" ? "css-none" : options.css : options.css === "none" ? void 0 : options.css
|
|
27402
27456
|
].filter((f) => f && f !== "none");
|
|
27403
27457
|
return {
|
|
27404
27458
|
...options,
|
|
@@ -27621,7 +27675,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
27621
27675
|
const tarPath = resolve$1$1(resolve$1$1(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
|
|
27622
27676
|
if (options.preferOffline && existsSync(tarPath)) options.offline = true;
|
|
27623
27677
|
if (!options.offline) {
|
|
27624
|
-
await mkdir(dirname$1(tarPath), { recursive: true });
|
|
27678
|
+
await mkdir(dirname$1$1(tarPath), { recursive: true });
|
|
27625
27679
|
const s = Date.now();
|
|
27626
27680
|
await download(template.tar, tarPath, { headers: {
|
|
27627
27681
|
Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
|
|
@@ -27675,8 +27729,8 @@ async function downloadTemplate(input, options = {}) {
|
|
|
27675
27729
|
const cssNone = {
|
|
27676
27730
|
name: "css-none",
|
|
27677
27731
|
apply: async ({ cwd, isNuxt }) => {
|
|
27678
|
-
const
|
|
27679
|
-
if (existsSync(
|
|
27732
|
+
const unocssConfigs = [join$1(cwd, "unocss.config.ts"), join$1(cwd, "uno.config.ts")];
|
|
27733
|
+
for (const configPath of unocssConfigs) if (existsSync(configPath)) rmSync(configPath);
|
|
27680
27734
|
const tailwindCss = isNuxt ? join$1(cwd, "app/assets/css/tailwind.css") : join$1(cwd, "src/tailwind.css");
|
|
27681
27735
|
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
27682
27736
|
}
|
|
@@ -27695,15 +27749,19 @@ var dependencies = {
|
|
|
27695
27749
|
"vue-router": "^4.6.4",
|
|
27696
27750
|
"vue-i18n": "^11.2.7",
|
|
27697
27751
|
"unplugin-vue-router": "^0.19.1",
|
|
27698
|
-
"vite-plugin-vuetify": "^2.1.
|
|
27752
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
27699
27753
|
"unocss": "^66.5.12",
|
|
27754
|
+
"@unocss/transformer-directives": "^66.6.0",
|
|
27700
27755
|
"@unocss/nuxt": "^66.5.12",
|
|
27756
|
+
"unocss-preset-vuetify": "^0.2.1",
|
|
27701
27757
|
"tailwindcss": "^4.1.18",
|
|
27758
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
27702
27759
|
"@tailwindcss/vite": "^4.1.18",
|
|
27703
|
-
"@nuxtjs/tailwindcss": "^7.0.0-beta.1",
|
|
27704
27760
|
"pathe": "^2.0.3",
|
|
27705
27761
|
"@vuetify/loader-shared": "^2.1.1",
|
|
27706
|
-
"@intellectronica/ruler": "^0.3.18"
|
|
27762
|
+
"@intellectronica/ruler": "^0.3.18",
|
|
27763
|
+
"@fontsource/roboto": "^5.2.9",
|
|
27764
|
+
"@fontsource/roboto-mono": "^5.2.8"
|
|
27707
27765
|
};
|
|
27708
27766
|
|
|
27709
27767
|
//#endregion
|
|
@@ -27907,6 +27965,37 @@ const mcp = {
|
|
|
27907
27965
|
}
|
|
27908
27966
|
};
|
|
27909
27967
|
|
|
27968
|
+
//#endregion
|
|
27969
|
+
//#region ../shared/src/features/client-hints.ts
|
|
27970
|
+
const nuxtClientHints = {
|
|
27971
|
+
name: "client-hints",
|
|
27972
|
+
apply: async ({ cwd, isNuxt }) => {
|
|
27973
|
+
if (!isNuxt) return;
|
|
27974
|
+
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
27975
|
+
const mod = await loadFile(configPath);
|
|
27976
|
+
const options = getDefaultExportOptions(mod);
|
|
27977
|
+
if (options) {
|
|
27978
|
+
options.vuetify ??= {};
|
|
27979
|
+
options.vuetify.moduleOptions ??= {};
|
|
27980
|
+
options.vuetify.moduleOptions.ssrClientHints = {
|
|
27981
|
+
reloadOnFirstRequest: false,
|
|
27982
|
+
viewportSize: true,
|
|
27983
|
+
prefersColorScheme: true,
|
|
27984
|
+
prefersReducedMotion: true,
|
|
27985
|
+
prefersColorSchemeOptions: { useBrowserThemeOnly: false }
|
|
27986
|
+
};
|
|
27987
|
+
options.vuetify.vuetifyOptions ??= {};
|
|
27988
|
+
options.vuetify.vuetifyOptions.theme ??= {};
|
|
27989
|
+
options.vuetify.vuetifyOptions.theme.defaultTheme = "dark";
|
|
27990
|
+
options.vuetify.vuetifyOptions.theme.themes = {
|
|
27991
|
+
light: {},
|
|
27992
|
+
dark: {}
|
|
27993
|
+
};
|
|
27994
|
+
}
|
|
27995
|
+
await writeFile(configPath, mod.generate().code);
|
|
27996
|
+
}
|
|
27997
|
+
};
|
|
27998
|
+
|
|
27910
27999
|
//#endregion
|
|
27911
28000
|
//#region ../shared/src/features/pinia.ts
|
|
27912
28001
|
const pinia = {
|
|
@@ -27960,7 +28049,7 @@ export const useAppStore = defineStore('app', {
|
|
|
27960
28049
|
|
|
27961
28050
|
//#endregion
|
|
27962
28051
|
//#region ../shared/package.json
|
|
27963
|
-
var version$1 = "
|
|
28052
|
+
var version$1 = "1.1.1";
|
|
27964
28053
|
|
|
27965
28054
|
//#endregion
|
|
27966
28055
|
//#region ../shared/src/utils/getTemplateSource.ts
|
|
@@ -28100,17 +28189,14 @@ export default router
|
|
|
28100
28189
|
//#region ../shared/src/features/tailwindcss.ts
|
|
28101
28190
|
const tailwindcss = {
|
|
28102
28191
|
name: "tailwindcss",
|
|
28103
|
-
apply: async ({ cwd, pkg, isTypescript, isNuxt }) => {
|
|
28104
|
-
|
|
28105
|
-
|
|
28192
|
+
apply: async ({ cwd, pkg, isTypescript, isNuxt, type }) => {
|
|
28193
|
+
if (type === "vuetify" && !isNuxt) return;
|
|
28194
|
+
const unocssConfigs = [join$1(cwd, "unocss.config.ts"), join$1(cwd, "uno.config.ts")];
|
|
28195
|
+
for (const configPath of unocssConfigs) if (existsSync(configPath)) rmSync(configPath);
|
|
28106
28196
|
if (isNuxt) {
|
|
28107
28197
|
pkg.devDependencies = pkg.devDependencies || {};
|
|
28108
28198
|
pkg.devDependencies["tailwindcss"] = dependencies.tailwindcss;
|
|
28109
|
-
pkg.devDependencies["@
|
|
28110
|
-
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
28111
|
-
const mod = await loadFile(configPath);
|
|
28112
|
-
addNuxtModule(mod, "@nuxtjs/tailwindcss");
|
|
28113
|
-
await writeFile(configPath, mod.generate().code);
|
|
28199
|
+
pkg.devDependencies["@tailwindcss/postcss"] = dependencies["@tailwindcss/postcss"];
|
|
28114
28200
|
} else {
|
|
28115
28201
|
pkg.devDependencies = pkg.devDependencies || {};
|
|
28116
28202
|
pkg.devDependencies["tailwindcss"] = dependencies.tailwindcss;
|
|
@@ -28135,102 +28221,57 @@ const tailwindcss = {
|
|
|
28135
28221
|
|
|
28136
28222
|
//#endregion
|
|
28137
28223
|
//#region ../shared/src/features/unocss.ts
|
|
28224
|
+
async function applyUnocssBase({ cwd, pkg, isTypescript, isNuxt }, options = {}) {
|
|
28225
|
+
pkg.devDependencies = pkg.devDependencies || {};
|
|
28226
|
+
pkg.devDependencies["unocss"] = dependencies.unocss;
|
|
28227
|
+
pkg.devDependencies["@unocss/transformer-directives"] = dependencies["@unocss/transformer-directives"];
|
|
28228
|
+
if (options.presetVuetify) pkg.devDependencies["unocss-preset-vuetify"] = dependencies["unocss-preset-vuetify"];
|
|
28229
|
+
const tailwindCss = isNuxt ? join$1(cwd, "app/assets/css/tailwind.css") : join$1(cwd, "src/tailwind.css");
|
|
28230
|
+
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
28231
|
+
if (pkg.devDependencies) {
|
|
28232
|
+
delete pkg.devDependencies["tailwindcss"];
|
|
28233
|
+
delete pkg.devDependencies["@tailwindcss/vite"];
|
|
28234
|
+
delete pkg.devDependencies["@tailwindcss/postcss"];
|
|
28235
|
+
}
|
|
28236
|
+
if (isNuxt) {
|
|
28237
|
+
pkg.devDependencies["@unocss/nuxt"] = dependencies["@unocss/nuxt"];
|
|
28238
|
+
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
28239
|
+
const mod = await loadFile(configPath);
|
|
28240
|
+
addNuxtModule(mod, "@unocss/nuxt");
|
|
28241
|
+
await writeFile(configPath, mod.generate().code);
|
|
28242
|
+
return;
|
|
28243
|
+
}
|
|
28244
|
+
const viteConfigPath = join$1(cwd, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
28245
|
+
const mod = await loadFile(viteConfigPath);
|
|
28246
|
+
addVitePlugin(mod, {
|
|
28247
|
+
from: "unocss/vite",
|
|
28248
|
+
constructor: "UnoCSS"
|
|
28249
|
+
});
|
|
28250
|
+
await writeFile(viteConfigPath, mod.generate().code);
|
|
28251
|
+
for (const file of ["src/main.ts", "src/main.js"]) {
|
|
28252
|
+
const filePath = join$1(cwd, file);
|
|
28253
|
+
if (existsSync(filePath)) {
|
|
28254
|
+
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport 'virtual:uno.css'"));
|
|
28255
|
+
break;
|
|
28256
|
+
}
|
|
28257
|
+
}
|
|
28258
|
+
}
|
|
28138
28259
|
const unocss = {
|
|
28139
28260
|
name: "unocss",
|
|
28140
|
-
apply: async (
|
|
28141
|
-
|
|
28142
|
-
pkg.devDependencies["unocss"] = dependencies.unocss;
|
|
28143
|
-
const tailwindCss = isNuxt ? join$1(cwd, "app/assets/css/tailwind.css") : join$1(cwd, "src/tailwind.css");
|
|
28144
|
-
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
28145
|
-
if (pkg.devDependencies) {
|
|
28146
|
-
delete pkg.devDependencies["tailwindcss"];
|
|
28147
|
-
delete pkg.devDependencies["@tailwindcss/vite"];
|
|
28148
|
-
delete pkg.devDependencies["@nuxtjs/tailwindcss"];
|
|
28149
|
-
}
|
|
28150
|
-
if (isNuxt) {
|
|
28151
|
-
pkg.devDependencies["@unocss/nuxt"] = dependencies["@unocss/nuxt"];
|
|
28152
|
-
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
28153
|
-
const mod = await loadFile(configPath);
|
|
28154
|
-
addNuxtModule(mod, "@unocss/nuxt");
|
|
28155
|
-
await writeFile(configPath, mod.generate().code);
|
|
28156
|
-
} else {
|
|
28157
|
-
const viteConfigPath = join$1(cwd, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
28158
|
-
const mod = await loadFile(viteConfigPath);
|
|
28159
|
-
addVitePlugin(mod, {
|
|
28160
|
-
from: "unocss/vite",
|
|
28161
|
-
constructor: "UnoCSS"
|
|
28162
|
-
});
|
|
28163
|
-
await writeFile(viteConfigPath, mod.generate().code);
|
|
28164
|
-
for (const file of ["src/main.ts", "src/main.js"]) {
|
|
28165
|
-
const filePath = join$1(cwd, file);
|
|
28166
|
-
if (existsSync(filePath)) {
|
|
28167
|
-
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport 'virtual:uno.css'"));
|
|
28168
|
-
break;
|
|
28169
|
-
}
|
|
28170
|
-
}
|
|
28171
|
-
}
|
|
28261
|
+
apply: async (ctx) => {
|
|
28262
|
+
await applyUnocssBase(ctx);
|
|
28172
28263
|
}
|
|
28173
28264
|
};
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
name: "vuetify-nuxt-manual",
|
|
28179
|
-
apply: async ({ cwd, pkg, isNuxt }) => {
|
|
28180
|
-
if (!isNuxt) return;
|
|
28181
|
-
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
28182
|
-
pkg.devDependencies = pkg.devDependencies || {};
|
|
28183
|
-
pkg.devDependencies["vite-plugin-vuetify"] = dependencies["vite-plugin-vuetify"];
|
|
28184
|
-
pkg.devDependencies["@vuetify/loader-shared"] = dependencies["@vuetify/loader-shared"];
|
|
28185
|
-
pkg.devDependencies["pathe"] = dependencies.pathe;
|
|
28186
|
-
const mod = await loadFile(configPath);
|
|
28187
|
-
mod.imports.$prepend({
|
|
28188
|
-
from: "vite-plugin-vuetify",
|
|
28189
|
-
imported: "transformAssetUrls"
|
|
28190
|
-
});
|
|
28191
|
-
const options = getDefaultExportOptions(mod);
|
|
28192
|
-
if (options) {
|
|
28193
|
-
options.build ||= {};
|
|
28194
|
-
options.build.transpile ||= [];
|
|
28195
|
-
if (!options.build.transpile.includes("vuetify")) options.build.transpile.push("vuetify");
|
|
28196
|
-
options.vite ||= {};
|
|
28197
|
-
options.vite.vue ||= {};
|
|
28198
|
-
options.vite.vue.template ||= {};
|
|
28199
|
-
options.vite.vue.template.transformAssetUrls = builders.raw("transformAssetUrls");
|
|
28200
|
-
}
|
|
28201
|
-
await writeFile(configPath, mod.generate().code);
|
|
28265
|
+
const unocssWind4 = {
|
|
28266
|
+
name: "unocss-wind4",
|
|
28267
|
+
apply: async (ctx) => {
|
|
28268
|
+
await applyUnocssBase(ctx);
|
|
28202
28269
|
}
|
|
28203
28270
|
};
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
name: "vuetify-nuxt-module",
|
|
28209
|
-
apply: async ({ cwd, pkg, clientHints, isNuxt }) => {
|
|
28210
|
-
if (!isNuxt) return;
|
|
28211
|
-
pkg.dependencies = pkg.dependencies || {};
|
|
28212
|
-
pkg.dependencies["vuetify-nuxt-module"] = dependencies["vuetify-nuxt-module"];
|
|
28213
|
-
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
28214
|
-
const mod = await loadFile(configPath);
|
|
28215
|
-
const manualModulePath = join$1(cwd, "modules/vuetify.ts");
|
|
28216
|
-
if (existsSync(manualModulePath)) unlinkSync(manualModulePath);
|
|
28217
|
-
const options = getDefaultExportOptions(mod);
|
|
28218
|
-
if (options) {
|
|
28219
|
-
options.modules ||= [];
|
|
28220
|
-
options.modules.push("vuetify-nuxt-module");
|
|
28221
|
-
options.vuetify = {
|
|
28222
|
-
moduleOptions: {},
|
|
28223
|
-
vuetifyOptions: {}
|
|
28224
|
-
};
|
|
28225
|
-
if (clientHints) options.vuetify.moduleOptions.ssrClientHints = {
|
|
28226
|
-
reloadOnFirstRequest: false,
|
|
28227
|
-
viewportSize: true,
|
|
28228
|
-
prefersColorScheme: true,
|
|
28229
|
-
prefersReducedMotion: true,
|
|
28230
|
-
prefersColorSchemeOptions: { useBrowserThemeOnly: false }
|
|
28231
|
-
};
|
|
28232
|
-
}
|
|
28233
|
-
await writeFile(configPath, mod.generate().code);
|
|
28271
|
+
const unocssVuetify = {
|
|
28272
|
+
name: "unocss-vuetify",
|
|
28273
|
+
apply: async (ctx) => {
|
|
28274
|
+
await applyUnocssBase(ctx, { presetVuetify: true });
|
|
28234
28275
|
}
|
|
28235
28276
|
};
|
|
28236
28277
|
|
|
@@ -28243,13 +28284,14 @@ const features = {
|
|
|
28243
28284
|
i18n,
|
|
28244
28285
|
eslint,
|
|
28245
28286
|
mcp,
|
|
28246
|
-
"
|
|
28247
|
-
"vuetify-nuxt-manual": vuetifyNuxtManual,
|
|
28287
|
+
"client-hints": nuxtClientHints,
|
|
28248
28288
|
unocss,
|
|
28289
|
+
"unocss-wind4": unocssWind4,
|
|
28290
|
+
"unocss-vuetify": unocssVuetify,
|
|
28249
28291
|
tailwindcss,
|
|
28250
28292
|
"css-none": cssNone
|
|
28251
28293
|
};
|
|
28252
|
-
async function applyFeatures(cwd, featureNames, pkg, isTypescript, isNuxt,
|
|
28294
|
+
async function applyFeatures(cwd, featureNames, pkg, isTypescript, isNuxt, type) {
|
|
28253
28295
|
for (const name of featureNames) {
|
|
28254
28296
|
const feature = features[name];
|
|
28255
28297
|
if (feature) await feature.apply({
|
|
@@ -28257,7 +28299,6 @@ async function applyFeatures(cwd, featureNames, pkg, isTypescript, isNuxt, clien
|
|
|
28257
28299
|
pkg,
|
|
28258
28300
|
isTypescript,
|
|
28259
28301
|
isNuxt,
|
|
28260
|
-
clientHints,
|
|
28261
28302
|
type
|
|
28262
28303
|
});
|
|
28263
28304
|
}
|
|
@@ -28623,8 +28664,59 @@ async function installDependencies(root = process.cwd(), manager = packageManage
|
|
|
28623
28664
|
|
|
28624
28665
|
//#endregion
|
|
28625
28666
|
//#region ../shared/src/functions/scaffold.ts
|
|
28667
|
+
function resolveTemplateName(templates, platform, type, features) {
|
|
28668
|
+
if (type !== "vuetify") return templates[platform][type];
|
|
28669
|
+
if (features.includes("unocss-wind4")) return `${platform}/unocss-wind4`;
|
|
28670
|
+
if (features.includes("unocss-vuetify")) return `${platform}/unocss-vuetify`;
|
|
28671
|
+
if (features.includes("tailwindcss")) return `${platform}/tailwind`;
|
|
28672
|
+
return templates[platform][type];
|
|
28673
|
+
}
|
|
28674
|
+
async function resolveSharedAssetsPath() {
|
|
28675
|
+
const templateName = "shared-assets";
|
|
28676
|
+
const envTemplatesPath = process.env.VUETIFY_CLI_TEMPLATES_PATH;
|
|
28677
|
+
if (envTemplatesPath) {
|
|
28678
|
+
const templatePath = join$1(envTemplatesPath, templateName);
|
|
28679
|
+
if (existsSync(templatePath)) return { path: templatePath };
|
|
28680
|
+
}
|
|
28681
|
+
const tempDir = fs.mkdtempSync(join$1(tmpdir(), "vuetify-cli-assets-"));
|
|
28682
|
+
await downloadTemplate(getTemplateSource(templateName), {
|
|
28683
|
+
dir: tempDir,
|
|
28684
|
+
force: true
|
|
28685
|
+
});
|
|
28686
|
+
return {
|
|
28687
|
+
path: tempDir,
|
|
28688
|
+
cleanup: () => rmSync(tempDir, {
|
|
28689
|
+
recursive: true,
|
|
28690
|
+
force: true
|
|
28691
|
+
})
|
|
28692
|
+
};
|
|
28693
|
+
}
|
|
28694
|
+
function copySharedAsset(sourcePath, targetPath) {
|
|
28695
|
+
if (!existsSync(sourcePath)) return;
|
|
28696
|
+
fs.mkdirSync(dirname$1(targetPath), { recursive: true });
|
|
28697
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
28698
|
+
}
|
|
28699
|
+
async function applySharedAssets(projectRoot, platform, type) {
|
|
28700
|
+
const needsFavicon = type === "vuetify" && (platform === "vue" || platform === "nuxt");
|
|
28701
|
+
const needsLogo = platform === "vue" || platform === "nuxt";
|
|
28702
|
+
const needsV0Badge = type === "vuetify0";
|
|
28703
|
+
if (!needsFavicon && !needsLogo && !needsV0Badge) return;
|
|
28704
|
+
const assets = await resolveSharedAssetsPath();
|
|
28705
|
+
if (!assets) return;
|
|
28706
|
+
try {
|
|
28707
|
+
if (needsFavicon) copySharedAsset(join$1(assets.path, "favicon.ico"), join$1(projectRoot, "public", "favicon.ico"));
|
|
28708
|
+
if (needsLogo) {
|
|
28709
|
+
const logoRoot = platform === "nuxt" ? join$1(projectRoot, "app", "assets") : join$1(projectRoot, "src", "assets");
|
|
28710
|
+
copySharedAsset(join$1(assets.path, "logo.png"), join$1(logoRoot, "logo.png"));
|
|
28711
|
+
copySharedAsset(join$1(assets.path, "logo.svg"), join$1(logoRoot, "logo.svg"));
|
|
28712
|
+
}
|
|
28713
|
+
if (needsV0Badge) copySharedAsset(join$1(assets.path, "0.png"), join$1(projectRoot, "public", "0.png"));
|
|
28714
|
+
} finally {
|
|
28715
|
+
assets.cleanup?.();
|
|
28716
|
+
}
|
|
28717
|
+
}
|
|
28626
28718
|
async function scaffold(options, callbacks = {}) {
|
|
28627
|
-
const { cwd, name, platform, features, typescript, type,
|
|
28719
|
+
const { cwd, name, platform, features, typescript, type, packageManager, install, force, debug: debugFlag } = options;
|
|
28628
28720
|
const debug = (...msg) => debugFlag && console.log("DEBUG:", ...msg);
|
|
28629
28721
|
const projectRoot = join$1(cwd, name);
|
|
28630
28722
|
debug("projectRoot=", projectRoot);
|
|
@@ -28632,16 +28724,16 @@ async function scaffold(options, callbacks = {}) {
|
|
|
28632
28724
|
recursive: true,
|
|
28633
28725
|
force: true
|
|
28634
28726
|
});
|
|
28635
|
-
const templateName = {
|
|
28727
|
+
const templateName = resolveTemplateName({
|
|
28636
28728
|
vue: {
|
|
28637
28729
|
vuetify0: "vuetify0/base",
|
|
28638
28730
|
vuetify: "vue/base"
|
|
28639
28731
|
},
|
|
28640
28732
|
nuxt: {
|
|
28641
28733
|
vuetify0: "vuetify0/nuxt",
|
|
28642
|
-
vuetify: "
|
|
28734
|
+
vuetify: "nuxt/base"
|
|
28643
28735
|
}
|
|
28644
|
-
}
|
|
28736
|
+
}, platform, type, features);
|
|
28645
28737
|
callbacks.onDownloadStart?.(templateName);
|
|
28646
28738
|
if (process.env.VUETIFY_CLI_TEMPLATES_PATH) {
|
|
28647
28739
|
const templatePath = join$1(process.env.VUETIFY_CLI_TEMPLATES_PATH, templateName);
|
|
@@ -28669,17 +28761,11 @@ async function scaffold(options, callbacks = {}) {
|
|
|
28669
28761
|
}
|
|
28670
28762
|
}
|
|
28671
28763
|
callbacks.onDownloadEnd?.();
|
|
28764
|
+
await applySharedAssets(projectRoot, platform, type);
|
|
28672
28765
|
let pkg;
|
|
28673
28766
|
pkg = await readPackageJSON(join$1(projectRoot, "package.json"));
|
|
28674
|
-
if (vuetifyVersion === "4.x" && pkg.dependencies && pkg.dependencies.vuetify) pkg.dependencies.vuetify = "^4.0.0-beta.1";
|
|
28675
28767
|
callbacks.onConfigStart?.();
|
|
28676
|
-
if (features && features.length > 0) await applyFeatures(projectRoot, features, pkg, !!typescript, platform === "nuxt",
|
|
28677
|
-
if (platform === "nuxt" && type !== "vuetify0" && (!features || !features.includes("vuetify-nuxt-module"))) await vuetifyNuxtManual.apply({
|
|
28678
|
-
cwd: projectRoot,
|
|
28679
|
-
pkg,
|
|
28680
|
-
isTypescript: !!typescript,
|
|
28681
|
-
isNuxt: true
|
|
28682
|
-
});
|
|
28768
|
+
if (features && features.length > 0) await applyFeatures(projectRoot, features, pkg, !!typescript, platform === "nuxt", type);
|
|
28683
28769
|
callbacks.onConfigEnd?.();
|
|
28684
28770
|
const pkgPath = join$1(projectRoot, "package.json");
|
|
28685
28771
|
if (existsSync(pkgPath)) {
|
|
@@ -28712,7 +28798,11 @@ async function createVuetify(options, commandOptions) {
|
|
|
28712
28798
|
console.log(createBanner());
|
|
28713
28799
|
Nt(i18n$1.t("messages.create.intro", { version }));
|
|
28714
28800
|
}
|
|
28715
|
-
if (args.preset) {
|
|
28801
|
+
if (args.preset) if (standardPresets[args.preset]) {
|
|
28802
|
+
const preset = standardPresets[args.preset];
|
|
28803
|
+
Object.assign(args, preset);
|
|
28804
|
+
debug("loaded standard preset=", preset);
|
|
28805
|
+
} else {
|
|
28716
28806
|
const home = homedir();
|
|
28717
28807
|
const presetPath = resolve$1(args.preset);
|
|
28718
28808
|
const globalPresetPath = join$1(home, ".vuetify", "presets", args.preset.endsWith(".json") ? args.preset : `${args.preset}.json`);
|
|
@@ -28789,13 +28879,11 @@ async function createVuetify(options, commandOptions) {
|
|
|
28789
28879
|
name: context.name,
|
|
28790
28880
|
platform: context.platform,
|
|
28791
28881
|
type: context.type,
|
|
28792
|
-
|
|
28793
|
-
features: context.features,
|
|
28882
|
+
features: [...context.features, ...context.clientHints ? ["client-hints"] : []],
|
|
28794
28883
|
typescript: !!context.typescript,
|
|
28795
28884
|
packageManager: context.packageManager,
|
|
28796
28885
|
install: context.install,
|
|
28797
28886
|
force: context.force,
|
|
28798
|
-
clientHints: context.clientHints,
|
|
28799
28887
|
debug: args.debug
|
|
28800
28888
|
}, {
|
|
28801
28889
|
onDownloadStart: (templateName) => {
|
|
@@ -30888,6 +30976,8 @@ function registerProjectArgsCompletion(completion) {
|
|
|
30888
30976
|
const cssOption = completion.options.get("css");
|
|
30889
30977
|
if (cssOption) cssOption.handler = (complete) => {
|
|
30890
30978
|
complete("unocss", "UnoCSS");
|
|
30979
|
+
complete("unocss-wind4", "UnoCSS (Wind4)");
|
|
30980
|
+
complete("unocss-vuetify", "UnoCSS (Vuetify)");
|
|
30891
30981
|
complete("tailwindcss", "Tailwind CSS");
|
|
30892
30982
|
complete("none", "None");
|
|
30893
30983
|
};
|
|
@@ -30899,7 +30989,7 @@ const blue$1 = ansi256(33);
|
|
|
30899
30989
|
|
|
30900
30990
|
//#endregion
|
|
30901
30991
|
//#region package.json
|
|
30902
|
-
var version = "3.1.1
|
|
30992
|
+
var version = "3.1.1";
|
|
30903
30993
|
|
|
30904
30994
|
//#endregion
|
|
30905
30995
|
//#region src/commands/presets.ts
|
|
@@ -30910,7 +31000,7 @@ const presets = defineCommand({
|
|
|
30910
31000
|
description: i18n$1.t("commands.presets.description")
|
|
30911
31001
|
},
|
|
30912
31002
|
args: {
|
|
30913
|
-
...projectArgs(),
|
|
31003
|
+
...projectArgs({ exclude: ["type"] }),
|
|
30914
31004
|
list: {
|
|
30915
31005
|
type: "boolean",
|
|
30916
31006
|
description: "List available presets",
|
|
@@ -30921,20 +31011,9 @@ const presets = defineCommand({
|
|
|
30921
31011
|
run: async ({ args }) => {
|
|
30922
31012
|
const presetsDir = join$1(homedir(), ".vuetify", "create", "presets");
|
|
30923
31013
|
Nt(i18n$1.t("commands.presets.intro"));
|
|
30924
|
-
|
|
30925
|
-
|
|
30926
|
-
|
|
30927
|
-
Wt(i18n$1.t("commands.presets.done"));
|
|
30928
|
-
return;
|
|
30929
|
-
}
|
|
30930
|
-
const files = readdirSync(presetsDir).filter((f) => f.endsWith(".json"));
|
|
30931
|
-
if (files.length === 0) {
|
|
30932
|
-
R.warn(i18n$1.t("commands.presets.empty"));
|
|
30933
|
-
R.info(i18n$1.t("commands.presets.tip"));
|
|
30934
|
-
Wt(i18n$1.t("commands.presets.done"));
|
|
30935
|
-
return;
|
|
30936
|
-
}
|
|
30937
|
-
const presets = [];
|
|
31014
|
+
const files = existsSync(presetsDir) ? readdirSync(presetsDir).filter((f) => f.endsWith(".json")) : [];
|
|
31015
|
+
const systemPresets = [];
|
|
31016
|
+
const userPresets = [];
|
|
30938
31017
|
for (const file of files) try {
|
|
30939
31018
|
const content = readFileSync(join$1(presetsDir, file), "utf8");
|
|
30940
31019
|
const preset = JSON.parse(content);
|
|
@@ -30943,28 +31022,50 @@ const presets = defineCommand({
|
|
|
30943
31022
|
const platform = capitalize(preset.platform || "vue");
|
|
30944
31023
|
const features = preset.features || [];
|
|
30945
31024
|
const formattedLine = `${name} ${dim(`(`)}${blue(type)} + ${green(platform)} ${dim(`|`)} ${features.join(",")}${dim(`)`)}`;
|
|
30946
|
-
|
|
31025
|
+
userPresets.push({
|
|
30947
31026
|
name,
|
|
30948
31027
|
invalid: false,
|
|
30949
31028
|
formattedLine,
|
|
30950
31029
|
file
|
|
30951
31030
|
});
|
|
30952
31031
|
} catch {
|
|
30953
|
-
|
|
31032
|
+
userPresets.push({
|
|
30954
31033
|
name: file.replace(".json", ""),
|
|
30955
31034
|
invalid: true
|
|
30956
31035
|
});
|
|
30957
31036
|
}
|
|
31037
|
+
for (const [key, preset] of Object.entries(standardPresets)) {
|
|
31038
|
+
const name = preset.meta.displayName;
|
|
31039
|
+
const type = capitalize(preset.type);
|
|
31040
|
+
const platform = capitalize(preset.platform);
|
|
31041
|
+
const features = preset.features || [];
|
|
31042
|
+
const formattedLine = `${name} ${dim(`(`)}${blue(type)} + ${green(platform)}${features.length > 0 ? ` ${dim(`|`)} ${features.join(",")}` : ""}${dim(`)`)}`;
|
|
31043
|
+
systemPresets.push({
|
|
31044
|
+
name,
|
|
31045
|
+
invalid: false,
|
|
31046
|
+
formattedLine,
|
|
31047
|
+
key
|
|
31048
|
+
});
|
|
31049
|
+
}
|
|
30958
31050
|
if (args.list) {
|
|
30959
|
-
|
|
31051
|
+
R.message(dim("System Presets"));
|
|
31052
|
+
for (const p of systemPresets) R.success(p.formattedLine);
|
|
31053
|
+
if (userPresets.length > 0) {
|
|
31054
|
+
R.message(dim("User Presets"));
|
|
31055
|
+
for (const p of userPresets) p.invalid ? R.error(`${p.name} ${dim("(invalid)")}`) : R.success(p.formattedLine);
|
|
31056
|
+
}
|
|
30960
31057
|
Wt(i18n$1.t("commands.presets.done"));
|
|
30961
31058
|
} else {
|
|
31059
|
+
const options = [...systemPresets.map((p) => ({
|
|
31060
|
+
label: p.formattedLine,
|
|
31061
|
+
value: p
|
|
31062
|
+
})), ...userPresets.filter((p) => !p.invalid).map((p) => ({
|
|
31063
|
+
label: p.formattedLine,
|
|
31064
|
+
value: p
|
|
31065
|
+
}))];
|
|
30962
31066
|
const preset = await qt({
|
|
30963
31067
|
message: i18n$1.t("commands.presets.select"),
|
|
30964
|
-
options
|
|
30965
|
-
label: p.formattedLine,
|
|
30966
|
-
value: p
|
|
30967
|
-
}))
|
|
31068
|
+
options
|
|
30968
31069
|
});
|
|
30969
31070
|
if (!preset || typeof preset === "symbol") {
|
|
30970
31071
|
R.warn(i18n$1.t("commands.presets.cancel"));
|
|
@@ -30975,7 +31076,8 @@ const presets = defineCommand({
|
|
|
30975
31076
|
const run = await Mt({ message: i18n$1.t("commands.presets.use") });
|
|
30976
31077
|
if (run && typeof run !== "symbol") await createVuetify({
|
|
30977
31078
|
...args,
|
|
30978
|
-
preset: join$1(presetsDir, preset.file),
|
|
31079
|
+
preset: preset.key || join$1(presetsDir, preset.file),
|
|
31080
|
+
type: "vuetify",
|
|
30979
31081
|
version
|
|
30980
31082
|
}, { intro: false });
|
|
30981
31083
|
else Wt(i18n$1.t("commands.presets.done"));
|
|
@@ -30997,7 +31099,7 @@ const main = defineCommand({
|
|
|
30997
31099
|
description: i18n$1.t("cli.create.description")
|
|
30998
31100
|
},
|
|
30999
31101
|
args: {
|
|
31000
|
-
...projectArgs(),
|
|
31102
|
+
...projectArgs({ exclude: ["type"] }),
|
|
31001
31103
|
cwd: {
|
|
31002
31104
|
type: "string",
|
|
31003
31105
|
description: "The current working directory"
|
|
@@ -31007,6 +31109,7 @@ const main = defineCommand({
|
|
|
31007
31109
|
if (args._[0] === "complete" || args._[0] === "presets") return;
|
|
31008
31110
|
await createVuetify({
|
|
31009
31111
|
...args,
|
|
31112
|
+
type: "vuetify",
|
|
31010
31113
|
version
|
|
31011
31114
|
});
|
|
31012
31115
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuetify",
|
|
3
|
-
"version": "3.1.1
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Create a new Vuetify project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"pathe": "^2.0.3",
|
|
39
39
|
"tsdown": "^0.20.3",
|
|
40
40
|
"vitest": "^4.0.18",
|
|
41
|
-
"@vuetify/cli-shared": "
|
|
41
|
+
"@vuetify/cli-shared": "1.1.1"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": "./dist/index.mjs",
|