create-vuetify0 1.1.5-beta.2 → 1.1.5
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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as resolve$1$1, n as dirname$1$1, t as basename$1 } from "./nypm-
|
|
2
|
+
import { i as resolve$1$1, n as dirname$1$1, t as basename$1 } from "./nypm-CKSClFuH.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";
|
|
6
6
|
import P, { stdin, stdout } from "node:process";
|
|
7
7
|
import * as k$1 from "node:readline";
|
|
8
|
-
import
|
|
8
|
+
import ot from "node:readline";
|
|
9
9
|
import { ReadStream } from "node:tty";
|
|
10
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";
|
|
@@ -894,7 +894,7 @@ var o = class {
|
|
|
894
894
|
constructor(e, t, n, r, i, a) {
|
|
895
895
|
this.command = e, this.value = t, this.description = n, this.handler = r, this.alias = i, this.isBoolean = a;
|
|
896
896
|
}
|
|
897
|
-
}, c$
|
|
897
|
+
}, c$1 = class {
|
|
898
898
|
value;
|
|
899
899
|
description;
|
|
900
900
|
options = /* @__PURE__ */ new Map();
|
|
@@ -913,7 +913,7 @@ var o = class {
|
|
|
913
913
|
let r = new o(this, e, t, n);
|
|
914
914
|
return this.arguments.set(e, r), this;
|
|
915
915
|
}
|
|
916
|
-
}, l$1 = class extends c$
|
|
916
|
+
}, l$1 = class extends c$1 {
|
|
917
917
|
commands = /* @__PURE__ */ new Map();
|
|
918
918
|
completions = [];
|
|
919
919
|
directive = a.ShellCompDirectiveDefault;
|
|
@@ -921,7 +921,7 @@ var o = class {
|
|
|
921
921
|
super(``, ``);
|
|
922
922
|
}
|
|
923
923
|
command(e, t) {
|
|
924
|
-
let n = new c$
|
|
924
|
+
let n = new c$1(e, t);
|
|
925
925
|
return this.commands.set(e, n), n;
|
|
926
926
|
}
|
|
927
927
|
stripOptions(e) {
|
|
@@ -1501,7 +1501,7 @@ async function s(e) {
|
|
|
1501
1501
|
args: n
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
|
-
async function c
|
|
1504
|
+
async function c(e, t = ``) {
|
|
1505
1505
|
let n = await Promise.resolve(e.meta), r = await Promise.resolve(e.subCommands);
|
|
1506
1506
|
if (!n || !n.name) throw Error(`Command meta or name is missing`);
|
|
1507
1507
|
let i = {
|
|
@@ -1512,10 +1512,10 @@ async function c$1(e, t = ``) {
|
|
|
1512
1512
|
let { options: t, args: n } = await s(await Promise.resolve(e.args));
|
|
1513
1513
|
t.length > 0 && (i.options = t), n.length > 0 && (i.args = n);
|
|
1514
1514
|
}
|
|
1515
|
-
return r && (i.subcommands = await Promise.all(Object.entries(r).map(async ([e, t]) => c
|
|
1515
|
+
return r && (i.subcommands = await Promise.all(Object.entries(r).map(async ([e, t]) => c(await Promise.resolve(t), i.name)))), i;
|
|
1516
1516
|
}
|
|
1517
1517
|
async function l(e) {
|
|
1518
|
-
let t = await c
|
|
1518
|
+
let t = await c(e);
|
|
1519
1519
|
return JSON.stringify(t, null, 2);
|
|
1520
1520
|
}
|
|
1521
1521
|
function u(e) {
|
|
@@ -9878,7 +9878,8 @@ var en_default = {
|
|
|
9878
9878
|
"done": "Done!"
|
|
9879
9879
|
},
|
|
9880
9880
|
"upgrade": {
|
|
9881
|
-
"description": "Upgrade %{pkg} to latest version",
|
|
9881
|
+
"description": "[deprecated] Upgrade %{pkg} to latest version",
|
|
9882
|
+
"deprecated": "This command is deprecated and may be removed in a future release.",
|
|
9882
9883
|
"not_global": "%{pkg} is not installed globally.",
|
|
9883
9884
|
"start": "Upgrading %{pkg} globally using nypm...",
|
|
9884
9885
|
"success": "Successfully upgraded %{pkg} to latest.",
|
|
@@ -9914,7 +9915,13 @@ var en_default = {
|
|
|
9914
9915
|
"save": "Do you want to save these settings as a preset?",
|
|
9915
9916
|
"name": "Preset name (display name):",
|
|
9916
9917
|
"overwrite": "Preset \"%{name}\" already exists. Do you want to overwrite it?",
|
|
9917
|
-
"saved": "Preset saved to %{path}"
|
|
9918
|
+
"saved": "Preset saved to %{path}",
|
|
9919
|
+
"usage": "Next time you can use: --preset %{slug}\nTip: run the \"presets\" command to list and use saved presets.",
|
|
9920
|
+
"start_select": "Start from a preset?",
|
|
9921
|
+
"start_scratch": {
|
|
9922
|
+
"label": "Start from scratch",
|
|
9923
|
+
"hint": "Manually select options"
|
|
9924
|
+
}
|
|
9918
9925
|
},
|
|
9919
9926
|
"directory": {
|
|
9920
9927
|
"name": "Project name",
|
|
@@ -10053,7 +10060,7 @@ var en_default = {
|
|
|
10053
10060
|
"platform": { "description": "The framework to use" },
|
|
10054
10061
|
"verbose": { "description": "Output verbose logs" },
|
|
10055
10062
|
"version": { "description": "The Vuetify version to check documentation for" },
|
|
10056
|
-
"preset": { "description": "
|
|
10063
|
+
"preset": { "description": "Preset key/name or path to a preset file (see: presets)" }
|
|
10057
10064
|
},
|
|
10058
10065
|
cli: {
|
|
10059
10066
|
"main": { "description": "Unified CLI for Vuetify" },
|
|
@@ -10064,7 +10071,11 @@ var en_default = {
|
|
|
10064
10071
|
utils: { "update_check": {
|
|
10065
10072
|
"available": "Update available!",
|
|
10066
10073
|
"run_update": "Run %{command} to update",
|
|
10067
|
-
"run_with": "Run with %{command}"
|
|
10074
|
+
"run_with": "Run with %{command}",
|
|
10075
|
+
"update_to_continue": "Update now to continue?",
|
|
10076
|
+
"updating": "Updating...",
|
|
10077
|
+
"updated": "Updated.",
|
|
10078
|
+
"rerun": "Please re-run the command to continue."
|
|
10068
10079
|
} }
|
|
10069
10080
|
};
|
|
10070
10081
|
|
|
@@ -10129,7 +10140,8 @@ var ru_default = {
|
|
|
10129
10140
|
"done": "Готово!"
|
|
10130
10141
|
},
|
|
10131
10142
|
"upgrade": {
|
|
10132
|
-
"description": "Обновить %{pkg} до последней версии",
|
|
10143
|
+
"description": "[устарело] Обновить %{pkg} до последней версии",
|
|
10144
|
+
"deprecated": "Эта команда устарела и может быть удалена в будущих релизах.",
|
|
10133
10145
|
"not_global": "%{pkg} не установлен глобально.",
|
|
10134
10146
|
"start": "Обновляем %{pkg}",
|
|
10135
10147
|
"success": "Успешно обновлен %{pkg} до последней версии.",
|
|
@@ -10160,7 +10172,13 @@ var ru_default = {
|
|
|
10160
10172
|
"save": "Хотите сохранить эти настройки как пресет?",
|
|
10161
10173
|
"name": "Имя пресета (отображаемое имя):",
|
|
10162
10174
|
"overwrite": "Пресет \"%{name}\" уже существует. Перезаписать?",
|
|
10163
|
-
"saved": "Пресет сохранен в %{path}"
|
|
10175
|
+
"saved": "Пресет сохранен в %{path}",
|
|
10176
|
+
"usage": "В следующий раз можно использовать: --preset %{slug}\nПодсказка: команда \"presets\" покажет список сохранённых пресетов.",
|
|
10177
|
+
"start_select": "Начать с пресета?",
|
|
10178
|
+
"start_scratch": {
|
|
10179
|
+
"label": "Настроить вручную",
|
|
10180
|
+
"hint": "Выбрать параметры в мастере"
|
|
10181
|
+
}
|
|
10164
10182
|
},
|
|
10165
10183
|
"directory": {
|
|
10166
10184
|
"name": "Название проекта",
|
|
@@ -10302,7 +10320,7 @@ var ru_default = {
|
|
|
10302
10320
|
"type": { "description": "Версия Vuetify для использования" },
|
|
10303
10321
|
"platform": { "description": "Фреймворк для использования" },
|
|
10304
10322
|
"verbose": { "description": "Вывести подробные логи" },
|
|
10305
|
-
"preset": { "description": "
|
|
10323
|
+
"preset": { "description": "Ключ/имя пресета или путь к файлу пресета (см. presets)" },
|
|
10306
10324
|
"version": { "description": "Версия Vuetify для просмотра документации" }
|
|
10307
10325
|
},
|
|
10308
10326
|
cli: {
|
|
@@ -10314,7 +10332,11 @@ var ru_default = {
|
|
|
10314
10332
|
utils: { "update_check": {
|
|
10315
10333
|
"available": "Доступно обновление!",
|
|
10316
10334
|
"run_update": "Выполните %{command}, чтобы обновить",
|
|
10317
|
-
"run_with": "Выполните %{command}"
|
|
10335
|
+
"run_with": "Выполните %{command}",
|
|
10336
|
+
"update_to_continue": "Обновить сейчас, чтобы продолжить?",
|
|
10337
|
+
"updating": "Обновляю...",
|
|
10338
|
+
"updated": "Обновлено.",
|
|
10339
|
+
"rerun": "Перезапустите команду, чтобы продолжить."
|
|
10318
10340
|
} }
|
|
10319
10341
|
};
|
|
10320
10342
|
|
|
@@ -10828,7 +10850,7 @@ var x$2 = class {
|
|
|
10828
10850
|
this.state = "cancel", this.close();
|
|
10829
10851
|
}, { once: !0 });
|
|
10830
10852
|
}
|
|
10831
|
-
this.rl =
|
|
10853
|
+
this.rl = ot.createInterface({
|
|
10832
10854
|
input: this.input,
|
|
10833
10855
|
tabSize: 2,
|
|
10834
10856
|
prompt: "",
|
|
@@ -27099,7 +27121,7 @@ const black = kolorist(30, 39);
|
|
|
27099
27121
|
const red = kolorist(31, 39);
|
|
27100
27122
|
const green = kolorist(32, 39);
|
|
27101
27123
|
const yellow = kolorist(33, 39);
|
|
27102
|
-
const blue$
|
|
27124
|
+
const blue$5 = kolorist(34, 39);
|
|
27103
27125
|
const magenta = kolorist(35, 39);
|
|
27104
27126
|
const cyan = kolorist(36, 39);
|
|
27105
27127
|
const white = kolorist(97, 39);
|
|
@@ -27476,7 +27498,7 @@ const colorfulBanner = ` [38;5;8m [38;5;111m\`[38;5;111m$[38;5;111m$[38;5;1
|
|
|
27476
27498
|
[38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;25m [38;5;25m\`[38;5;25mT[38;5;33m:[38;5;33m [38;5;7m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;7m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m [38;5;8m
|
|
27477
27499
|
[0m`;
|
|
27478
27500
|
const unstyledBanner = stripColors(colorfulBanner);
|
|
27479
|
-
const coloredBanner = blue$
|
|
27501
|
+
const coloredBanner = blue$5(unstyledBanner);
|
|
27480
27502
|
function createBanner() {
|
|
27481
27503
|
if (!options.enabled) return unstyledBanner;
|
|
27482
27504
|
else if (options.supportLevel < 2) return coloredBanner;
|
|
@@ -27484,6 +27506,71 @@ function createBanner() {
|
|
|
27484
27506
|
}
|
|
27485
27507
|
const banner = createBanner();
|
|
27486
27508
|
|
|
27509
|
+
//#endregion
|
|
27510
|
+
//#region ../shared/src/utils/presets.ts
|
|
27511
|
+
function getCreatePresetsDir() {
|
|
27512
|
+
return join$1(homedir(), ".vuetify", "create", "presets");
|
|
27513
|
+
}
|
|
27514
|
+
function listUserPresets() {
|
|
27515
|
+
const presetsDir = getCreatePresetsDir();
|
|
27516
|
+
const files = existsSync(presetsDir) ? readdirSync(presetsDir).filter((f) => f.endsWith(".json")) : [];
|
|
27517
|
+
const entries = [];
|
|
27518
|
+
for (const file of files) {
|
|
27519
|
+
const path = join$1(presetsDir, file);
|
|
27520
|
+
const slug = file.replace(/\.json$/, "");
|
|
27521
|
+
try {
|
|
27522
|
+
const content = readFileSync(path, "utf8");
|
|
27523
|
+
const preset = JSON.parse(content);
|
|
27524
|
+
const displayName = preset.meta?.displayName || slug;
|
|
27525
|
+
entries.push({
|
|
27526
|
+
file,
|
|
27527
|
+
path,
|
|
27528
|
+
invalid: false,
|
|
27529
|
+
slug,
|
|
27530
|
+
displayName,
|
|
27531
|
+
preset
|
|
27532
|
+
});
|
|
27533
|
+
} catch {
|
|
27534
|
+
entries.push({
|
|
27535
|
+
file,
|
|
27536
|
+
path,
|
|
27537
|
+
invalid: true,
|
|
27538
|
+
slug,
|
|
27539
|
+
displayName: slug
|
|
27540
|
+
});
|
|
27541
|
+
}
|
|
27542
|
+
}
|
|
27543
|
+
return entries;
|
|
27544
|
+
}
|
|
27545
|
+
function resolvePresetPath(input) {
|
|
27546
|
+
const presetPath = resolve$1(input);
|
|
27547
|
+
if (existsSync(presetPath)) return presetPath;
|
|
27548
|
+
const home = homedir();
|
|
27549
|
+
const presetName = input.endsWith(".json") ? input : `${input}.json`;
|
|
27550
|
+
const createPresetsDir = join$1(home, ".vuetify", "create", "presets");
|
|
27551
|
+
const createPresetPath = join$1(createPresetsDir, presetName);
|
|
27552
|
+
if (existsSync(createPresetPath)) return createPresetPath;
|
|
27553
|
+
const slug = slugify(input);
|
|
27554
|
+
const createSlugPath = join$1(createPresetsDir, `${slug}.json`);
|
|
27555
|
+
if (existsSync(createSlugPath)) return createSlugPath;
|
|
27556
|
+
const legacyPresetsDir = join$1(home, ".vuetify", "presets");
|
|
27557
|
+
const legacyPresetPath = join$1(legacyPresetsDir, presetName);
|
|
27558
|
+
if (existsSync(legacyPresetPath)) return legacyPresetPath;
|
|
27559
|
+
const legacySlugPath = join$1(legacyPresetsDir, `${slug}.json`);
|
|
27560
|
+
if (existsSync(legacySlugPath)) return legacySlugPath;
|
|
27561
|
+
}
|
|
27562
|
+
function loadPreset(input) {
|
|
27563
|
+
if (standardPresets[input]) return standardPresets[input];
|
|
27564
|
+
const path = resolvePresetPath(input);
|
|
27565
|
+
if (!path) return;
|
|
27566
|
+
try {
|
|
27567
|
+
const content = readFileSync(path, "utf8");
|
|
27568
|
+
return JSON.parse(content);
|
|
27569
|
+
} catch {
|
|
27570
|
+
return;
|
|
27571
|
+
}
|
|
27572
|
+
}
|
|
27573
|
+
|
|
27487
27574
|
//#endregion
|
|
27488
27575
|
//#region ../../node_modules/.pnpm/giget@3.1.2/node_modules/giget/dist/_chunks/giget.mjs
|
|
27489
27576
|
async function download(url, filePath, options = {}) {
|
|
@@ -27710,7 +27797,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
27710
27797
|
debug(`Extracted to ${extractPath} in ${Date.now() - s}ms`);
|
|
27711
27798
|
if (options.install) {
|
|
27712
27799
|
debug("Installing dependencies...");
|
|
27713
|
-
const { installDependencies } = await import("./nypm-
|
|
27800
|
+
const { installDependencies } = await import("./nypm-5VB5YsHQ.mjs").then((n) => n.t);
|
|
27714
27801
|
await installDependencies({
|
|
27715
27802
|
cwd: extractPath,
|
|
27716
27803
|
silent: options.silent,
|
|
@@ -27724,6 +27811,37 @@ async function downloadTemplate(input, options = {}) {
|
|
|
27724
27811
|
};
|
|
27725
27812
|
}
|
|
27726
27813
|
|
|
27814
|
+
//#endregion
|
|
27815
|
+
//#region ../shared/src/features/client-hints.ts
|
|
27816
|
+
const nuxtClientHints = {
|
|
27817
|
+
name: "client-hints",
|
|
27818
|
+
apply: async ({ cwd, isNuxt }) => {
|
|
27819
|
+
if (!isNuxt) return;
|
|
27820
|
+
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
27821
|
+
const mod = await loadFile(configPath);
|
|
27822
|
+
const options = getDefaultExportOptions(mod);
|
|
27823
|
+
if (options) {
|
|
27824
|
+
options.vuetify ??= {};
|
|
27825
|
+
options.vuetify.moduleOptions ??= {};
|
|
27826
|
+
options.vuetify.moduleOptions.ssrClientHints = {
|
|
27827
|
+
reloadOnFirstRequest: false,
|
|
27828
|
+
viewportSize: true,
|
|
27829
|
+
prefersColorScheme: true,
|
|
27830
|
+
prefersReducedMotion: true,
|
|
27831
|
+
prefersColorSchemeOptions: { useBrowserThemeOnly: false }
|
|
27832
|
+
};
|
|
27833
|
+
options.vuetify.vuetifyOptions ??= {};
|
|
27834
|
+
options.vuetify.vuetifyOptions.theme ??= {};
|
|
27835
|
+
options.vuetify.vuetifyOptions.theme.defaultTheme = "dark";
|
|
27836
|
+
options.vuetify.vuetifyOptions.theme.themes = {
|
|
27837
|
+
light: {},
|
|
27838
|
+
dark: {}
|
|
27839
|
+
};
|
|
27840
|
+
}
|
|
27841
|
+
await writeFile(configPath, mod.generate().code);
|
|
27842
|
+
}
|
|
27843
|
+
};
|
|
27844
|
+
|
|
27727
27845
|
//#endregion
|
|
27728
27846
|
//#region ../shared/src/features/css-none.ts
|
|
27729
27847
|
const cssNone = {
|
|
@@ -27964,37 +28082,6 @@ const mcp = {
|
|
|
27964
28082
|
}
|
|
27965
28083
|
};
|
|
27966
28084
|
|
|
27967
|
-
//#endregion
|
|
27968
|
-
//#region ../shared/src/features/client-hints.ts
|
|
27969
|
-
const nuxtClientHints = {
|
|
27970
|
-
name: "client-hints",
|
|
27971
|
-
apply: async ({ cwd, isNuxt }) => {
|
|
27972
|
-
if (!isNuxt) return;
|
|
27973
|
-
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
27974
|
-
const mod = await loadFile(configPath);
|
|
27975
|
-
const options = getDefaultExportOptions(mod);
|
|
27976
|
-
if (options) {
|
|
27977
|
-
options.vuetify ??= {};
|
|
27978
|
-
options.vuetify.moduleOptions ??= {};
|
|
27979
|
-
options.vuetify.moduleOptions.ssrClientHints = {
|
|
27980
|
-
reloadOnFirstRequest: false,
|
|
27981
|
-
viewportSize: true,
|
|
27982
|
-
prefersColorScheme: true,
|
|
27983
|
-
prefersReducedMotion: true,
|
|
27984
|
-
prefersColorSchemeOptions: { useBrowserThemeOnly: false }
|
|
27985
|
-
};
|
|
27986
|
-
options.vuetify.vuetifyOptions ??= {};
|
|
27987
|
-
options.vuetify.vuetifyOptions.theme ??= {};
|
|
27988
|
-
options.vuetify.vuetifyOptions.theme.defaultTheme = "dark";
|
|
27989
|
-
options.vuetify.vuetifyOptions.theme.themes = {
|
|
27990
|
-
light: {},
|
|
27991
|
-
dark: {}
|
|
27992
|
-
};
|
|
27993
|
-
}
|
|
27994
|
-
await writeFile(configPath, mod.generate().code);
|
|
27995
|
-
}
|
|
27996
|
-
};
|
|
27997
|
-
|
|
27998
28085
|
//#endregion
|
|
27999
28086
|
//#region ../shared/src/features/pinia.ts
|
|
28000
28087
|
const pinia = {
|
|
@@ -28048,7 +28135,7 @@ export const useAppStore = defineStore('app', {
|
|
|
28048
28135
|
|
|
28049
28136
|
//#endregion
|
|
28050
28137
|
//#region ../shared/package.json
|
|
28051
|
-
var version$1 = "1.1.5
|
|
28138
|
+
var version$1 = "1.1.5";
|
|
28052
28139
|
|
|
28053
28140
|
//#endregion
|
|
28054
28141
|
//#region ../shared/src/utils/getTemplateSource.ts
|
|
@@ -28104,13 +28191,7 @@ const router = {
|
|
|
28104
28191
|
await writeFile(pluginsPath, mod.generate().code);
|
|
28105
28192
|
if (isTypescript) {
|
|
28106
28193
|
const tsConfigPath = join$1(cwd, "tsconfig.app.json");
|
|
28107
|
-
if (existsSync(tsConfigPath))
|
|
28108
|
-
const tsConfig = await loadFile(tsConfigPath);
|
|
28109
|
-
tsConfig.exports.vueCompilerOptions = tsConfig.exports.vueCompilerOptions || {};
|
|
28110
|
-
tsConfig.exports.vueCompilerOptions.plugins = tsConfig.exports.vueCompilerOptions.plugins || [];
|
|
28111
|
-
tsConfig.exports.vueCompilerOptions.plugins.push("vue-router/volar/sfc-typed-router", "vue-router/volar/sfc-route-blocks");
|
|
28112
|
-
await writeFile(tsConfigPath, tsConfig.generate().code);
|
|
28113
|
-
}
|
|
28194
|
+
if (existsSync(tsConfigPath)) await updateTsconfigVueCompilerPlugins(tsConfigPath, ["vue-router/volar/sfc-typed-router", "vue-router/volar/sfc-route-blocks"]);
|
|
28114
28195
|
}
|
|
28115
28196
|
}
|
|
28116
28197
|
};
|
|
@@ -28148,13 +28229,7 @@ const fileRouter = {
|
|
|
28148
28229
|
}
|
|
28149
28230
|
if (isTypescript) {
|
|
28150
28231
|
const tsConfigPath = join$1(cwd, "tsconfig.app.json");
|
|
28151
|
-
if (existsSync(tsConfigPath))
|
|
28152
|
-
const tsConfig = await loadFile(tsConfigPath);
|
|
28153
|
-
tsConfig.exports.vueCompilerOptions = tsConfig.exports.vueCompilerOptions || {};
|
|
28154
|
-
tsConfig.exports.vueCompilerOptions.plugins = tsConfig.exports.vueCompilerOptions.plugins || [];
|
|
28155
|
-
tsConfig.exports.vueCompilerOptions.plugins.push("vue-router/volar/sfc-typed-router", "vue-router/volar/sfc-route-blocks");
|
|
28156
|
-
await writeFile(tsConfigPath, tsConfig.generate().code);
|
|
28157
|
-
}
|
|
28232
|
+
if (existsSync(tsConfigPath)) await updateTsconfigVueCompilerPlugins(tsConfigPath, ["vue-router/volar/sfc-typed-router", "vue-router/volar/sfc-route-blocks"]);
|
|
28158
28233
|
}
|
|
28159
28234
|
}
|
|
28160
28235
|
};
|
|
@@ -28201,6 +28276,22 @@ const router = createRouter({
|
|
|
28201
28276
|
export default router
|
|
28202
28277
|
`;
|
|
28203
28278
|
}
|
|
28279
|
+
async function updateTsconfigVueCompilerPlugins(tsConfigPath, pluginsToAdd) {
|
|
28280
|
+
try {
|
|
28281
|
+
const raw = await readFile(tsConfigPath, "utf8");
|
|
28282
|
+
const config = JSON.parse(raw);
|
|
28283
|
+
const vueCompilerOptions = config.vueCompilerOptions || {};
|
|
28284
|
+
const current = Array.isArray(vueCompilerOptions.plugins) ? vueCompilerOptions.plugins : [];
|
|
28285
|
+
const plugins = Array.from(new Set([...current, ...pluginsToAdd]));
|
|
28286
|
+
config.vueCompilerOptions = {
|
|
28287
|
+
...vueCompilerOptions,
|
|
28288
|
+
plugins
|
|
28289
|
+
};
|
|
28290
|
+
await writeFile(tsConfigPath, JSON.stringify(config, null, 2) + "\n");
|
|
28291
|
+
} catch {
|
|
28292
|
+
return;
|
|
28293
|
+
}
|
|
28294
|
+
}
|
|
28204
28295
|
|
|
28205
28296
|
//#endregion
|
|
28206
28297
|
//#region ../shared/src/features/tailwindcss.ts
|
|
@@ -28835,28 +28926,38 @@ async function createVuetify(options, commandOptions) {
|
|
|
28835
28926
|
console.log(createBanner());
|
|
28836
28927
|
Nt(i18n$1.t("messages.create.intro", { version }));
|
|
28837
28928
|
}
|
|
28838
|
-
if (args.
|
|
28839
|
-
const
|
|
28840
|
-
|
|
28841
|
-
|
|
28842
|
-
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
28846
|
-
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28929
|
+
if (args.interactive && !args.preset) {
|
|
28930
|
+
const userPresets = listUserPresets().filter((p) => !p.invalid);
|
|
28931
|
+
const options = [
|
|
28932
|
+
{
|
|
28933
|
+
label: i18n$1.t("prompts.preset.start_scratch.label"),
|
|
28934
|
+
hint: i18n$1.t("prompts.preset.start_scratch.hint"),
|
|
28935
|
+
value: "__scratch__"
|
|
28936
|
+
},
|
|
28937
|
+
...Object.entries(standardPresets).map(([key, preset]) => ({
|
|
28938
|
+
label: preset.meta.displayName,
|
|
28939
|
+
value: key,
|
|
28940
|
+
hint: `${preset.type}/${preset.platform}${preset.features.length ? ` | ${preset.features.join(",")}` : ""}`
|
|
28941
|
+
})),
|
|
28942
|
+
...userPresets.map((p) => ({
|
|
28943
|
+
label: p.displayName,
|
|
28944
|
+
value: p.slug,
|
|
28945
|
+
hint: `${p.preset?.type || "vuetify"}/${p.preset?.platform || "vue"}${p.preset?.features?.length ? ` | ${p.preset.features.join(",")}` : ""}`
|
|
28946
|
+
}))
|
|
28947
|
+
];
|
|
28948
|
+
const choice = await qt({
|
|
28949
|
+
message: i18n$1.t("prompts.preset.start_select"),
|
|
28950
|
+
initialValue: "__scratch__",
|
|
28951
|
+
options
|
|
28952
|
+
});
|
|
28953
|
+
if (typeof choice === "string" && choice !== "__scratch__") args.preset = choice;
|
|
28954
|
+
}
|
|
28955
|
+
if (args.preset) {
|
|
28956
|
+
const preset = loadPreset(args.preset);
|
|
28957
|
+
if (preset) {
|
|
28855
28958
|
Object.assign(args, preset);
|
|
28856
28959
|
debug("loaded preset=", preset);
|
|
28857
|
-
}
|
|
28858
|
-
debug("failed to parse preset", error);
|
|
28859
|
-
}
|
|
28960
|
+
} else debug("failed to load preset=", args.preset);
|
|
28860
28961
|
}
|
|
28861
28962
|
const features = typeof args.features === "string" ? args.features.split(",").filter(Boolean) : args.features;
|
|
28862
28963
|
const rawArgs = args;
|
|
@@ -28871,7 +28972,7 @@ async function createVuetify(options, commandOptions) {
|
|
|
28871
28972
|
router: rawArgs.router
|
|
28872
28973
|
}, cwd);
|
|
28873
28974
|
debug("context=", JSON.stringify(context, null, 2));
|
|
28874
|
-
if (args.interactive
|
|
28975
|
+
if (args.interactive) {
|
|
28875
28976
|
if (await Mt({
|
|
28876
28977
|
message: i18n$1.t("prompts.preset.save"),
|
|
28877
28978
|
initialValue: false
|
|
@@ -28885,7 +28986,8 @@ async function createVuetify(options, commandOptions) {
|
|
|
28885
28986
|
if (typeof displayName === "string") {
|
|
28886
28987
|
const presetsDir = join$1(homedir(), ".vuetify", "create", "presets");
|
|
28887
28988
|
if (!existsSync(presetsDir)) mkdirSync(presetsDir, { recursive: true });
|
|
28888
|
-
const
|
|
28989
|
+
const slug = slugify(displayName);
|
|
28990
|
+
const presetPath = join$1(presetsDir, `${slug}.json`);
|
|
28889
28991
|
let shouldSave = true;
|
|
28890
28992
|
if (existsSync(presetPath)) shouldSave = await Mt({
|
|
28891
28993
|
message: i18n$1.t("prompts.preset.overwrite", { name: displayName }),
|
|
@@ -28903,6 +29005,7 @@ async function createVuetify(options, commandOptions) {
|
|
|
28903
29005
|
};
|
|
28904
29006
|
writeFileSync(presetPath, JSON.stringify(presetContent, null, 2));
|
|
28905
29007
|
R.step(i18n$1.t("prompts.preset.saved", { path: presetPath }));
|
|
29008
|
+
R.info(i18n$1.t("prompts.preset.usage", { slug }));
|
|
28906
29009
|
}
|
|
28907
29010
|
}
|
|
28908
29011
|
}
|
|
@@ -30587,8 +30690,8 @@ const LINKS = {
|
|
|
30587
30690
|
|
|
30588
30691
|
//#endregion
|
|
30589
30692
|
//#region ../shared/src/functions/eslint.ts
|
|
30590
|
-
const blue$
|
|
30591
|
-
const description$1 = i18n$1.t("commands.eslint.description", { configPkg: blue$
|
|
30693
|
+
const blue$4 = ansi256(33);
|
|
30694
|
+
const description$1 = i18n$1.t("commands.eslint.description", { configPkg: blue$4(ESLINT_CONFIG) });
|
|
30592
30695
|
async function getEslintStatus() {
|
|
30593
30696
|
const nuxtConfigPath = tryResolveFilePath("./nuxt.config", { extensions: [
|
|
30594
30697
|
".ts",
|
|
@@ -30711,8 +30814,8 @@ async function addEslint() {
|
|
|
30711
30814
|
//#endregion
|
|
30712
30815
|
//#region ../shared/src/functions/mcp.ts
|
|
30713
30816
|
const RULER_PKG = "@intellectronica/ruler";
|
|
30714
|
-
const blue$
|
|
30715
|
-
const description = i18n$1.t("commands.mcp.description", { pkg: blue$
|
|
30817
|
+
const blue$3 = ansi256(33);
|
|
30818
|
+
const description = i18n$1.t("commands.mcp.description", { pkg: blue$3(RULER_PKG) });
|
|
30716
30819
|
async function addMcp() {
|
|
30717
30820
|
Nt(description);
|
|
30718
30821
|
if (await tryResolvePackage(RULER_PKG)) R.info(i18n$1.t("messages.eslint.deps_already_installed"));
|
|
@@ -30853,10 +30956,111 @@ async function getNpmPackageVersion(packageName) {
|
|
|
30853
30956
|
}
|
|
30854
30957
|
}
|
|
30855
30958
|
|
|
30959
|
+
//#endregion
|
|
30960
|
+
//#region ../shared/src/utils/strings.ts
|
|
30961
|
+
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
30962
|
+
|
|
30856
30963
|
//#endregion
|
|
30857
30964
|
//#region ../shared/src/utils/updateCheck.ts
|
|
30858
30965
|
var import_semver = /* @__PURE__ */ __toESM(require_semver());
|
|
30966
|
+
const blue$2 = ansi256(33);
|
|
30967
|
+
|
|
30968
|
+
//#endregion
|
|
30969
|
+
//#region ../shared/src/commands/presets.ts
|
|
30859
30970
|
const blue$1 = ansi256(33);
|
|
30971
|
+
function createPresetsCommand(options) {
|
|
30972
|
+
return defineCommand({
|
|
30973
|
+
meta: {
|
|
30974
|
+
name: "presets",
|
|
30975
|
+
description: i18n$1.t("commands.presets.description")
|
|
30976
|
+
},
|
|
30977
|
+
args: {
|
|
30978
|
+
...projectArgs({ exclude: ["type"] }),
|
|
30979
|
+
list: {
|
|
30980
|
+
type: "boolean",
|
|
30981
|
+
description: "List available presets",
|
|
30982
|
+
alias: "l",
|
|
30983
|
+
default: false
|
|
30984
|
+
}
|
|
30985
|
+
},
|
|
30986
|
+
run: async ({ args }) => {
|
|
30987
|
+
Nt(i18n$1.t("commands.presets.intro"));
|
|
30988
|
+
const systemPresets = Object.entries(standardPresets).filter(([, preset]) => !options.filterType || preset.type === options.filterType).map(([key, preset]) => {
|
|
30989
|
+
const name = preset.meta.displayName;
|
|
30990
|
+
const type = capitalize(preset.type);
|
|
30991
|
+
const platform = capitalize(preset.platform);
|
|
30992
|
+
const features = preset.features || [];
|
|
30993
|
+
return {
|
|
30994
|
+
key,
|
|
30995
|
+
name,
|
|
30996
|
+
formattedLine: `${name} ${dim("(")}${blue$1(type)} + ${green(platform)}${features.length > 0 ? ` ${dim("|")} ${features.join(",")}` : ""}${dim(")")}`,
|
|
30997
|
+
invalid: false
|
|
30998
|
+
};
|
|
30999
|
+
});
|
|
31000
|
+
const userPresets = listUserPresets().map((p) => {
|
|
31001
|
+
if (p.invalid) return {
|
|
31002
|
+
name: p.displayName,
|
|
31003
|
+
invalid: true
|
|
31004
|
+
};
|
|
31005
|
+
const preset = p.preset || {};
|
|
31006
|
+
const rawType = preset.type || "vuetify";
|
|
31007
|
+
const type = capitalize(preset.type || "vuetify");
|
|
31008
|
+
const platform = capitalize(preset.platform || "vue");
|
|
31009
|
+
const features = preset.features || [];
|
|
31010
|
+
const formattedLine = `${p.displayName} ${dim("(")}${blue$1(type)} + ${green(platform)} ${dim("|")} ${features.join(",")}${dim(")")}`;
|
|
31011
|
+
return {
|
|
31012
|
+
name: p.displayName,
|
|
31013
|
+
invalid: false,
|
|
31014
|
+
file: p.file,
|
|
31015
|
+
slug: p.slug,
|
|
31016
|
+
type: rawType,
|
|
31017
|
+
formattedLine
|
|
31018
|
+
};
|
|
31019
|
+
}).filter((p) => {
|
|
31020
|
+
if (p.invalid) return true;
|
|
31021
|
+
return !options.filterType || p.type === options.filterType;
|
|
31022
|
+
});
|
|
31023
|
+
if (args.list) {
|
|
31024
|
+
R.message(dim("System Presets"));
|
|
31025
|
+
for (const p of systemPresets) R.success(p.formattedLine);
|
|
31026
|
+
const invalidUser = userPresets.filter((p) => p.invalid);
|
|
31027
|
+
const validUser = userPresets.filter((p) => !p.invalid);
|
|
31028
|
+
if (invalidUser.length > 0 || validUser.length > 0) {
|
|
31029
|
+
R.message(dim("User Presets"));
|
|
31030
|
+
for (const p of invalidUser) R.error(`${p.name} ${dim("(invalid)")}`);
|
|
31031
|
+
for (const p of validUser) R.success(p.formattedLine);
|
|
31032
|
+
}
|
|
31033
|
+
Wt(i18n$1.t("commands.presets.done"));
|
|
31034
|
+
return;
|
|
31035
|
+
}
|
|
31036
|
+
const selectionOptions = [...systemPresets.map((p) => ({
|
|
31037
|
+
label: p.formattedLine,
|
|
31038
|
+
value: p
|
|
31039
|
+
})), ...userPresets.filter((p) => !p.invalid).map((p) => ({
|
|
31040
|
+
label: p.formattedLine,
|
|
31041
|
+
value: p
|
|
31042
|
+
}))];
|
|
31043
|
+
const preset = await qt({
|
|
31044
|
+
message: i18n$1.t("commands.presets.select"),
|
|
31045
|
+
options: selectionOptions
|
|
31046
|
+
});
|
|
31047
|
+
if (!preset || typeof preset === "symbol") {
|
|
31048
|
+
R.warn(i18n$1.t("commands.presets.cancel"));
|
|
31049
|
+
Wt(i18n$1.t("commands.presets.done"));
|
|
31050
|
+
return;
|
|
31051
|
+
}
|
|
31052
|
+
R.success(i18n$1.t("commands.presets.selected", { name: preset.name }));
|
|
31053
|
+
const run = await Mt({ message: i18n$1.t("commands.presets.use") });
|
|
31054
|
+
if (run && typeof run !== "symbol") await createVuetify({
|
|
31055
|
+
...args,
|
|
31056
|
+
preset: preset.key || preset.slug,
|
|
31057
|
+
type: options.type,
|
|
31058
|
+
version: options.version
|
|
31059
|
+
}, { intro: false });
|
|
31060
|
+
else Wt(i18n$1.t("commands.presets.done"));
|
|
31061
|
+
}
|
|
31062
|
+
});
|
|
31063
|
+
}
|
|
30860
31064
|
|
|
30861
31065
|
//#endregion
|
|
30862
31066
|
//#region ../shared/src/commands/update.ts
|
|
@@ -30983,7 +31187,10 @@ function commandUpgradeFabric(pkgName) {
|
|
|
30983
31187
|
name: "upgrade",
|
|
30984
31188
|
description: i18n$1.t("commands.upgrade.description", { pkg: pkgName })
|
|
30985
31189
|
},
|
|
30986
|
-
run: () =>
|
|
31190
|
+
run: async () => {
|
|
31191
|
+
R.warning(i18n$1.t("commands.upgrade.deprecated"));
|
|
31192
|
+
await upgradeSelf(pkgName);
|
|
31193
|
+
}
|
|
30987
31194
|
});
|
|
30988
31195
|
}
|
|
30989
31196
|
|
|
@@ -31022,7 +31229,7 @@ const blue = ansi256(33);
|
|
|
31022
31229
|
|
|
31023
31230
|
//#endregion
|
|
31024
31231
|
//#region package.json
|
|
31025
|
-
var version = "1.1.5
|
|
31232
|
+
var version = "1.1.5";
|
|
31026
31233
|
|
|
31027
31234
|
//#endregion
|
|
31028
31235
|
//#region src/commands/upgrade.ts
|
|
@@ -31030,6 +31237,11 @@ const upgrade = commandUpgradeFabric("create-vuetify-v0");
|
|
|
31030
31237
|
|
|
31031
31238
|
//#endregion
|
|
31032
31239
|
//#region src/index.ts
|
|
31240
|
+
const presets = createPresetsCommand({
|
|
31241
|
+
version,
|
|
31242
|
+
type: "vuetify0",
|
|
31243
|
+
filterType: "vuetify0"
|
|
31244
|
+
});
|
|
31033
31245
|
const main = defineCommand({
|
|
31034
31246
|
meta: {
|
|
31035
31247
|
name: "create-vuetify0",
|
|
@@ -31044,14 +31256,17 @@ const main = defineCommand({
|
|
|
31044
31256
|
}
|
|
31045
31257
|
},
|
|
31046
31258
|
run: async ({ args }) => {
|
|
31047
|
-
if (args._[0] === "complete") return;
|
|
31259
|
+
if (args._[0] === "complete" || args._[0] === "presets") return;
|
|
31048
31260
|
await createVuetify({
|
|
31049
31261
|
...args,
|
|
31050
31262
|
version,
|
|
31051
31263
|
type: "vuetify0"
|
|
31052
31264
|
});
|
|
31053
31265
|
},
|
|
31054
|
-
subCommands: {
|
|
31266
|
+
subCommands: {
|
|
31267
|
+
presets,
|
|
31268
|
+
upgrade
|
|
31269
|
+
}
|
|
31055
31270
|
});
|
|
31056
31271
|
await v(main).then((completion) => {
|
|
31057
31272
|
registerProjectArgsCompletion(completion);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as __exportAll } from "./rolldown-runtime-DA-mFLXi.mjs";
|
|
3
3
|
import { cwd } from "node:process";
|
|
4
|
-
import
|
|
4
|
+
import ot from "node:readline";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
import { delimiter, dirname, join, normalize, resolve } from "node:path";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
@@ -465,7 +465,7 @@ var G = class {
|
|
|
465
465
|
if (!e) return;
|
|
466
466
|
let t = [];
|
|
467
467
|
this._streamErr && t.push(this._streamErr), this._streamOut && t.push(this._streamOut);
|
|
468
|
-
let n = w(t), r =
|
|
468
|
+
let n = w(t), r = ot.createInterface({ input: n });
|
|
469
469
|
for await (let e of r) yield e.toString();
|
|
470
470
|
if (await this._processClosed, e.removeAllListeners(), this._thrownError) throw this._thrownError;
|
|
471
471
|
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuetify0",
|
|
3
|
-
"version": "1.1.5
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Create a new Vuetify project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"nypm": "^0.6.5",
|
|
37
37
|
"pathe": "^2.0.3",
|
|
38
38
|
"tsdown": "^0.20.3",
|
|
39
|
-
"@vuetify/cli-shared": "1.1.5
|
|
39
|
+
"@vuetify/cli-shared": "1.1.5"
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
42
42
|
".": "./dist/index.mjs",
|