create-vuetify 3.1.5-beta.2 → 3.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 +369 -174
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -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
|
|
|
@@ -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 = {}) {
|
|
@@ -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
|
}
|
|
@@ -30861,6 +30964,181 @@ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
30861
30964
|
//#region ../shared/src/utils/updateCheck.ts
|
|
30862
30965
|
var import_semver = /* @__PURE__ */ __toESM(require_semver());
|
|
30863
30966
|
const blue$2 = ansi256(33);
|
|
30967
|
+
async function getLatestVersion(packageName) {
|
|
30968
|
+
const timeout = new Promise((resolve) => setTimeout(() => resolve(null), 800));
|
|
30969
|
+
return await Promise.race([getNpmPackageVersion(packageName), timeout]);
|
|
30970
|
+
}
|
|
30971
|
+
function getLocalInstallType(pkg, packageName) {
|
|
30972
|
+
if (!pkg) return null;
|
|
30973
|
+
if (pkg.dependencies && pkg.dependencies[packageName]) return "dependencies";
|
|
30974
|
+
if (pkg.devDependencies && pkg.devDependencies[packageName]) return "devDependencies";
|
|
30975
|
+
return null;
|
|
30976
|
+
}
|
|
30977
|
+
function resolveLocalInstallCommand(agent, packageName, installType) {
|
|
30978
|
+
const target = `${packageName}@latest`;
|
|
30979
|
+
const dev = installType === "devDependencies";
|
|
30980
|
+
if (agent === "pnpm") return {
|
|
30981
|
+
command: "pnpm",
|
|
30982
|
+
args: [
|
|
30983
|
+
"add",
|
|
30984
|
+
...dev ? ["-D"] : [],
|
|
30985
|
+
target
|
|
30986
|
+
]
|
|
30987
|
+
};
|
|
30988
|
+
if (agent === "yarn") return {
|
|
30989
|
+
command: "yarn",
|
|
30990
|
+
args: [
|
|
30991
|
+
"add",
|
|
30992
|
+
...dev ? ["-D"] : [],
|
|
30993
|
+
target
|
|
30994
|
+
]
|
|
30995
|
+
};
|
|
30996
|
+
if (agent === "bun") return {
|
|
30997
|
+
command: "bun",
|
|
30998
|
+
args: [
|
|
30999
|
+
"add",
|
|
31000
|
+
...dev ? ["-d"] : [],
|
|
31001
|
+
target
|
|
31002
|
+
]
|
|
31003
|
+
};
|
|
31004
|
+
return {
|
|
31005
|
+
command: "npm",
|
|
31006
|
+
args: [
|
|
31007
|
+
"install",
|
|
31008
|
+
...dev ? ["-D"] : [],
|
|
31009
|
+
target
|
|
31010
|
+
]
|
|
31011
|
+
};
|
|
31012
|
+
}
|
|
31013
|
+
async function promptLocalUpdateToContinue(options) {
|
|
31014
|
+
const packageName = options.packageName;
|
|
31015
|
+
const currentVersion = options.currentVersion;
|
|
31016
|
+
const startCwd = process.cwd();
|
|
31017
|
+
const cwd = options.cwd || startCwd;
|
|
31018
|
+
if (!process.stdout.isTTY || !process.stdin.isTTY) return;
|
|
31019
|
+
try {
|
|
31020
|
+
process.chdir(cwd);
|
|
31021
|
+
} catch {
|
|
31022
|
+
return;
|
|
31023
|
+
}
|
|
31024
|
+
try {
|
|
31025
|
+
const latestVersion = await getLatestVersion(packageName);
|
|
31026
|
+
if (!latestVersion || !import_semver.default.gt(latestVersion, currentVersion)) return;
|
|
31027
|
+
const installType = getLocalInstallType(await getProjectPackageJSON().catch(() => null), packageName);
|
|
31028
|
+
if (!installType) return;
|
|
31029
|
+
Tt(`${yellow(bold(i18n$1.t("utils.update_check.available")))}\n\n${currentVersion} -> ${latestVersion}\n`, "", { withGuide: false });
|
|
31030
|
+
if (await Mt({
|
|
31031
|
+
message: i18n$1.t("utils.update_check.update_to_continue"),
|
|
31032
|
+
initialValue: true
|
|
31033
|
+
}) !== true) return;
|
|
31034
|
+
const pmResult = await getPackageManager().catch(() => null);
|
|
31035
|
+
const { command, args } = resolveLocalInstallCommand(pmResult?.agent || pmResult?.name || "npm", packageName, installType);
|
|
31036
|
+
R.info(i18n$1.t("utils.update_check.updating"));
|
|
31037
|
+
await x(command, args);
|
|
31038
|
+
R.success(i18n$1.t("utils.update_check.updated"));
|
|
31039
|
+
R.info(i18n$1.t("utils.update_check.rerun"));
|
|
31040
|
+
return true;
|
|
31041
|
+
} finally {
|
|
31042
|
+
process.chdir(startCwd);
|
|
31043
|
+
}
|
|
31044
|
+
}
|
|
31045
|
+
|
|
31046
|
+
//#endregion
|
|
31047
|
+
//#region ../shared/src/commands/presets.ts
|
|
31048
|
+
const blue$1 = ansi256(33);
|
|
31049
|
+
function createPresetsCommand(options) {
|
|
31050
|
+
return defineCommand({
|
|
31051
|
+
meta: {
|
|
31052
|
+
name: "presets",
|
|
31053
|
+
description: i18n$1.t("commands.presets.description")
|
|
31054
|
+
},
|
|
31055
|
+
args: {
|
|
31056
|
+
...projectArgs({ exclude: ["type"] }),
|
|
31057
|
+
list: {
|
|
31058
|
+
type: "boolean",
|
|
31059
|
+
description: "List available presets",
|
|
31060
|
+
alias: "l",
|
|
31061
|
+
default: false
|
|
31062
|
+
}
|
|
31063
|
+
},
|
|
31064
|
+
run: async ({ args }) => {
|
|
31065
|
+
Nt(i18n$1.t("commands.presets.intro"));
|
|
31066
|
+
const systemPresets = Object.entries(standardPresets).filter(([, preset]) => !options.filterType || preset.type === options.filterType).map(([key, preset]) => {
|
|
31067
|
+
const name = preset.meta.displayName;
|
|
31068
|
+
const type = capitalize(preset.type);
|
|
31069
|
+
const platform = capitalize(preset.platform);
|
|
31070
|
+
const features = preset.features || [];
|
|
31071
|
+
return {
|
|
31072
|
+
key,
|
|
31073
|
+
name,
|
|
31074
|
+
formattedLine: `${name} ${dim("(")}${blue$1(type)} + ${green(platform)}${features.length > 0 ? ` ${dim("|")} ${features.join(",")}` : ""}${dim(")")}`,
|
|
31075
|
+
invalid: false
|
|
31076
|
+
};
|
|
31077
|
+
});
|
|
31078
|
+
const userPresets = listUserPresets().map((p) => {
|
|
31079
|
+
if (p.invalid) return {
|
|
31080
|
+
name: p.displayName,
|
|
31081
|
+
invalid: true
|
|
31082
|
+
};
|
|
31083
|
+
const preset = p.preset || {};
|
|
31084
|
+
const rawType = preset.type || "vuetify";
|
|
31085
|
+
const type = capitalize(preset.type || "vuetify");
|
|
31086
|
+
const platform = capitalize(preset.platform || "vue");
|
|
31087
|
+
const features = preset.features || [];
|
|
31088
|
+
const formattedLine = `${p.displayName} ${dim("(")}${blue$1(type)} + ${green(platform)} ${dim("|")} ${features.join(",")}${dim(")")}`;
|
|
31089
|
+
return {
|
|
31090
|
+
name: p.displayName,
|
|
31091
|
+
invalid: false,
|
|
31092
|
+
file: p.file,
|
|
31093
|
+
slug: p.slug,
|
|
31094
|
+
type: rawType,
|
|
31095
|
+
formattedLine
|
|
31096
|
+
};
|
|
31097
|
+
}).filter((p) => {
|
|
31098
|
+
if (p.invalid) return true;
|
|
31099
|
+
return !options.filterType || p.type === options.filterType;
|
|
31100
|
+
});
|
|
31101
|
+
if (args.list) {
|
|
31102
|
+
R.message(dim("System Presets"));
|
|
31103
|
+
for (const p of systemPresets) R.success(p.formattedLine);
|
|
31104
|
+
const invalidUser = userPresets.filter((p) => p.invalid);
|
|
31105
|
+
const validUser = userPresets.filter((p) => !p.invalid);
|
|
31106
|
+
if (invalidUser.length > 0 || validUser.length > 0) {
|
|
31107
|
+
R.message(dim("User Presets"));
|
|
31108
|
+
for (const p of invalidUser) R.error(`${p.name} ${dim("(invalid)")}`);
|
|
31109
|
+
for (const p of validUser) R.success(p.formattedLine);
|
|
31110
|
+
}
|
|
31111
|
+
Wt(i18n$1.t("commands.presets.done"));
|
|
31112
|
+
return;
|
|
31113
|
+
}
|
|
31114
|
+
const selectionOptions = [...systemPresets.map((p) => ({
|
|
31115
|
+
label: p.formattedLine,
|
|
31116
|
+
value: p
|
|
31117
|
+
})), ...userPresets.filter((p) => !p.invalid).map((p) => ({
|
|
31118
|
+
label: p.formattedLine,
|
|
31119
|
+
value: p
|
|
31120
|
+
}))];
|
|
31121
|
+
const preset = await qt({
|
|
31122
|
+
message: i18n$1.t("commands.presets.select"),
|
|
31123
|
+
options: selectionOptions
|
|
31124
|
+
});
|
|
31125
|
+
if (!preset || typeof preset === "symbol") {
|
|
31126
|
+
R.warn(i18n$1.t("commands.presets.cancel"));
|
|
31127
|
+
Wt(i18n$1.t("commands.presets.done"));
|
|
31128
|
+
return;
|
|
31129
|
+
}
|
|
31130
|
+
R.success(i18n$1.t("commands.presets.selected", { name: preset.name }));
|
|
31131
|
+
const run = await Mt({ message: i18n$1.t("commands.presets.use") });
|
|
31132
|
+
if (run && typeof run !== "symbol") await createVuetify({
|
|
31133
|
+
...args,
|
|
31134
|
+
preset: preset.key || preset.slug,
|
|
31135
|
+
type: options.type,
|
|
31136
|
+
version: options.version
|
|
31137
|
+
}, { intro: false });
|
|
31138
|
+
else Wt(i18n$1.t("commands.presets.done"));
|
|
31139
|
+
}
|
|
31140
|
+
});
|
|
31141
|
+
}
|
|
30864
31142
|
|
|
30865
31143
|
//#endregion
|
|
30866
31144
|
//#region ../shared/src/commands/update.ts
|
|
@@ -30987,7 +31265,10 @@ function commandUpgradeFabric(pkgName) {
|
|
|
30987
31265
|
name: "upgrade",
|
|
30988
31266
|
description: i18n$1.t("commands.upgrade.description", { pkg: pkgName })
|
|
30989
31267
|
},
|
|
30990
|
-
run: () =>
|
|
31268
|
+
run: async () => {
|
|
31269
|
+
R.warning(i18n$1.t("commands.upgrade.deprecated"));
|
|
31270
|
+
await upgradeSelf(pkgName);
|
|
31271
|
+
}
|
|
30991
31272
|
});
|
|
30992
31273
|
}
|
|
30993
31274
|
|
|
@@ -31022,106 +31303,11 @@ function registerProjectArgsCompletion(completion) {
|
|
|
31022
31303
|
|
|
31023
31304
|
//#endregion
|
|
31024
31305
|
//#region ../shared/src/reporters/console.ts
|
|
31025
|
-
const blue
|
|
31306
|
+
const blue = ansi256(33);
|
|
31026
31307
|
|
|
31027
31308
|
//#endregion
|
|
31028
31309
|
//#region package.json
|
|
31029
|
-
var version = "3.1.5
|
|
31030
|
-
|
|
31031
|
-
//#endregion
|
|
31032
|
-
//#region src/commands/presets.ts
|
|
31033
|
-
const blue = ansi256(33);
|
|
31034
|
-
const presets = defineCommand({
|
|
31035
|
-
meta: {
|
|
31036
|
-
name: "presets",
|
|
31037
|
-
description: i18n$1.t("commands.presets.description")
|
|
31038
|
-
},
|
|
31039
|
-
args: {
|
|
31040
|
-
...projectArgs({ exclude: ["type"] }),
|
|
31041
|
-
list: {
|
|
31042
|
-
type: "boolean",
|
|
31043
|
-
description: "List available presets",
|
|
31044
|
-
alias: "l",
|
|
31045
|
-
default: false
|
|
31046
|
-
}
|
|
31047
|
-
},
|
|
31048
|
-
run: async ({ args }) => {
|
|
31049
|
-
const presetsDir = join$1(homedir(), ".vuetify", "create", "presets");
|
|
31050
|
-
Nt(i18n$1.t("commands.presets.intro"));
|
|
31051
|
-
const files = existsSync(presetsDir) ? readdirSync(presetsDir).filter((f) => f.endsWith(".json")) : [];
|
|
31052
|
-
const systemPresets = [];
|
|
31053
|
-
const userPresets = [];
|
|
31054
|
-
for (const file of files) try {
|
|
31055
|
-
const content = readFileSync(join$1(presetsDir, file), "utf8");
|
|
31056
|
-
const preset = JSON.parse(content);
|
|
31057
|
-
const name = preset.meta?.displayName || file.replace(".json", "");
|
|
31058
|
-
const type = capitalize(preset.type || "vuetify");
|
|
31059
|
-
const platform = capitalize(preset.platform || "vue");
|
|
31060
|
-
const features = preset.features || [];
|
|
31061
|
-
const formattedLine = `${name} ${dim(`(`)}${blue(type)} + ${green(platform)} ${dim(`|`)} ${features.join(",")}${dim(`)`)}`;
|
|
31062
|
-
userPresets.push({
|
|
31063
|
-
name,
|
|
31064
|
-
invalid: false,
|
|
31065
|
-
formattedLine,
|
|
31066
|
-
file
|
|
31067
|
-
});
|
|
31068
|
-
} catch {
|
|
31069
|
-
userPresets.push({
|
|
31070
|
-
name: file.replace(".json", ""),
|
|
31071
|
-
invalid: true
|
|
31072
|
-
});
|
|
31073
|
-
}
|
|
31074
|
-
for (const [key, preset] of Object.entries(standardPresets)) {
|
|
31075
|
-
const name = preset.meta.displayName;
|
|
31076
|
-
const type = capitalize(preset.type);
|
|
31077
|
-
const platform = capitalize(preset.platform);
|
|
31078
|
-
const features = preset.features || [];
|
|
31079
|
-
const formattedLine = `${name} ${dim(`(`)}${blue(type)} + ${green(platform)}${features.length > 0 ? ` ${dim(`|`)} ${features.join(",")}` : ""}${dim(`)`)}`;
|
|
31080
|
-
systemPresets.push({
|
|
31081
|
-
name,
|
|
31082
|
-
invalid: false,
|
|
31083
|
-
formattedLine,
|
|
31084
|
-
key
|
|
31085
|
-
});
|
|
31086
|
-
}
|
|
31087
|
-
if (args.list) {
|
|
31088
|
-
R.message(dim("System Presets"));
|
|
31089
|
-
for (const p of systemPresets) R.success(p.formattedLine);
|
|
31090
|
-
if (userPresets.length > 0) {
|
|
31091
|
-
R.message(dim("User Presets"));
|
|
31092
|
-
for (const p of userPresets) p.invalid ? R.error(`${p.name} ${dim("(invalid)")}`) : R.success(p.formattedLine);
|
|
31093
|
-
}
|
|
31094
|
-
Wt(i18n$1.t("commands.presets.done"));
|
|
31095
|
-
} else {
|
|
31096
|
-
const options = [...systemPresets.map((p) => ({
|
|
31097
|
-
label: p.formattedLine,
|
|
31098
|
-
value: p
|
|
31099
|
-
})), ...userPresets.filter((p) => !p.invalid).map((p) => ({
|
|
31100
|
-
label: p.formattedLine,
|
|
31101
|
-
value: p
|
|
31102
|
-
}))];
|
|
31103
|
-
const preset = await qt({
|
|
31104
|
-
message: i18n$1.t("commands.presets.select"),
|
|
31105
|
-
options
|
|
31106
|
-
});
|
|
31107
|
-
if (!preset || typeof preset === "symbol") {
|
|
31108
|
-
R.warn(i18n$1.t("commands.presets.cancel"));
|
|
31109
|
-
Wt(i18n$1.t("commands.presets.done"));
|
|
31110
|
-
return;
|
|
31111
|
-
}
|
|
31112
|
-
R.success(i18n$1.t("commands.presets.selected", { name: preset.name }));
|
|
31113
|
-
const run = await Mt({ message: i18n$1.t("commands.presets.use") });
|
|
31114
|
-
if (run && typeof run !== "symbol") await createVuetify({
|
|
31115
|
-
...args,
|
|
31116
|
-
preset: preset.key || join$1(presetsDir, preset.file),
|
|
31117
|
-
type: "vuetify",
|
|
31118
|
-
version
|
|
31119
|
-
}, { intro: false });
|
|
31120
|
-
else Wt(i18n$1.t("commands.presets.done"));
|
|
31121
|
-
}
|
|
31122
|
-
process.exit(0);
|
|
31123
|
-
}
|
|
31124
|
-
});
|
|
31310
|
+
var version = "3.1.5";
|
|
31125
31311
|
|
|
31126
31312
|
//#endregion
|
|
31127
31313
|
//#region src/commands/upgrade.ts
|
|
@@ -31129,6 +31315,10 @@ const upgrade = commandUpgradeFabric("create-vuetify");
|
|
|
31129
31315
|
|
|
31130
31316
|
//#endregion
|
|
31131
31317
|
//#region src/index.ts
|
|
31318
|
+
const presets = createPresetsCommand({
|
|
31319
|
+
version,
|
|
31320
|
+
type: "vuetify"
|
|
31321
|
+
});
|
|
31132
31322
|
const main = defineCommand({
|
|
31133
31323
|
meta: {
|
|
31134
31324
|
name: "create-vuetify",
|
|
@@ -31144,6 +31334,11 @@ const main = defineCommand({
|
|
|
31144
31334
|
},
|
|
31145
31335
|
run: async ({ args }) => {
|
|
31146
31336
|
if (args._[0] === "complete" || args._[0] === "presets") return;
|
|
31337
|
+
if (await promptLocalUpdateToContinue({
|
|
31338
|
+
packageName: "create-vuetify",
|
|
31339
|
+
currentVersion: version,
|
|
31340
|
+
cwd: typeof args.cwd === "string" ? args.cwd : void 0
|
|
31341
|
+
})) return;
|
|
31147
31342
|
await createVuetify({
|
|
31148
31343
|
...args,
|
|
31149
31344
|
type: "vuetify",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuetify",
|
|
3
|
-
"version": "3.1.5
|
|
3
|
+
"version": "3.1.5",
|
|
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": "1.1.5
|
|
41
|
+
"@vuetify/cli-shared": "1.1.5"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": "./dist/index.mjs",
|