@vuetify/cli 0.1.3 → 1.0.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 +244 -137
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -9840,7 +9840,7 @@ var en_default = {
|
|
|
9840
9840
|
"checking": "Checking for updates...",
|
|
9841
9841
|
"intro": "Checking for updates...",
|
|
9842
9842
|
"not_installed": "Vuetify is not installed in this project.",
|
|
9843
|
-
"deprecated_v2": "Vuetify 2 is deprecated. Please consider upgrading to Vuetify
|
|
9843
|
+
"deprecated_v2": "Vuetify 2 is deprecated. Please consider upgrading to Vuetify 4.",
|
|
9844
9844
|
"outdated_v1": "Vuetify 1 is out of date. Please upgrade.",
|
|
9845
9845
|
"updated": "Updated %{pkg}",
|
|
9846
9846
|
"failed": "Failed to update %{pkg}",
|
|
@@ -9915,15 +9915,22 @@ var en_default = {
|
|
|
9915
9915
|
"hint": "Headless Component Library"
|
|
9916
9916
|
}
|
|
9917
9917
|
},
|
|
9918
|
-
"vuetify_version": {
|
|
9919
|
-
"select": "Select Vuetify version:",
|
|
9920
|
-
"3_x": "Vuetify 3 (latest)",
|
|
9921
|
-
"4_x": "Vuetify 4 (beta)"
|
|
9922
|
-
},
|
|
9923
9918
|
"css_framework": {
|
|
9924
9919
|
"select": "Which CSS framework?",
|
|
9925
9920
|
"unocss": { "hint": "Instant on-demand atomic CSS engine" },
|
|
9926
|
-
"
|
|
9921
|
+
"unocss_wind4": {
|
|
9922
|
+
"label": "UnoCSS with Wind4 preset",
|
|
9923
|
+
"hint": "soon"
|
|
9924
|
+
},
|
|
9925
|
+
"unocss_vuetify": {
|
|
9926
|
+
"label": "UnoCSS with Vuetify preset",
|
|
9927
|
+
"hint": "soon"
|
|
9928
|
+
},
|
|
9929
|
+
"tailwindcss": {
|
|
9930
|
+
"label": "Tailwind CSS",
|
|
9931
|
+
"hint": "A utility-first CSS framework"
|
|
9932
|
+
},
|
|
9933
|
+
"status": { "not_supported": "CSS framework %{css} is not supported for %{vuetify} yet." },
|
|
9927
9934
|
"none": "None"
|
|
9928
9935
|
},
|
|
9929
9936
|
"typescript": { "use": "Use TypeScript?" },
|
|
@@ -9942,6 +9949,10 @@ var en_default = {
|
|
|
9942
9949
|
},
|
|
9943
9950
|
"features": {
|
|
9944
9951
|
"select": "Select features to install: %{hint}",
|
|
9952
|
+
"router": {
|
|
9953
|
+
"label": "Router",
|
|
9954
|
+
"hint": "Configure Vue Router"
|
|
9955
|
+
},
|
|
9945
9956
|
"pinia": { "label": "Pinia" },
|
|
9946
9957
|
"eslint": {
|
|
9947
9958
|
"label": "ESLint",
|
|
@@ -10022,8 +10033,7 @@ var en_default = {
|
|
|
10022
10033
|
"platform": { "description": "The framework to use" },
|
|
10023
10034
|
"verbose": { "description": "Output verbose logs" },
|
|
10024
10035
|
"version": { "description": "The Vuetify version to check documentation for" },
|
|
10025
|
-
"preset": { "description": "Path to a preset file to load" }
|
|
10026
|
-
"vuetifyVersion": { "description": "Vuetify version" }
|
|
10036
|
+
"preset": { "description": "Path to a preset file to load" }
|
|
10027
10037
|
},
|
|
10028
10038
|
cli: {
|
|
10029
10039
|
"main": { "description": "Unified CLI for Vuetify" },
|
|
@@ -10091,7 +10101,7 @@ var ru_default = {
|
|
|
10091
10101
|
"checking": "Проверка обновлений...",
|
|
10092
10102
|
"intro": "Проверка обновлений...",
|
|
10093
10103
|
"not_installed": "Vuetify не установлен в этом проекте.",
|
|
10094
|
-
"deprecated_v2": "Vuetify 2 устарел. Пожалуйста, рассмотрите возможность обновления до Vuetify
|
|
10104
|
+
"deprecated_v2": "Vuetify 2 устарел. Пожалуйста, рассмотрите возможность обновления до Vuetify 4.",
|
|
10095
10105
|
"outdated_v1": "Vuetify 1 устарел. Пожалуйста, обновитесь.",
|
|
10096
10106
|
"updated": "Обновлен %{pkg}",
|
|
10097
10107
|
"failed": "Не удалось обновить %{pkg}",
|
|
@@ -10161,11 +10171,6 @@ var ru_default = {
|
|
|
10161
10171
|
"hint": "Библиотека headless компонентов"
|
|
10162
10172
|
}
|
|
10163
10173
|
},
|
|
10164
|
-
"vuetify_version": {
|
|
10165
|
-
"select": "Выберите версию Vuetify:",
|
|
10166
|
-
"3_x": "Vuetify 3 (стабильная)",
|
|
10167
|
-
"4_x": "Vuetify 4 (бета)"
|
|
10168
|
-
},
|
|
10169
10174
|
"css_framework": {
|
|
10170
10175
|
"select": "Какой фреймворк CSS вы хотите использовать?",
|
|
10171
10176
|
"none": "Никакой",
|
|
@@ -10173,10 +10178,19 @@ var ru_default = {
|
|
|
10173
10178
|
"label": "UnoCSS",
|
|
10174
10179
|
"hint": "Быстрая и гибкая система стилей"
|
|
10175
10180
|
},
|
|
10181
|
+
"unocss_wind4": {
|
|
10182
|
+
"label": "UnoCSS с пресетом Wind4",
|
|
10183
|
+
"hint": "скоро"
|
|
10184
|
+
},
|
|
10185
|
+
"unocss_vuetify": {
|
|
10186
|
+
"label": "UnoCSS с пресетом Vuetify",
|
|
10187
|
+
"hint": "скоро"
|
|
10188
|
+
},
|
|
10176
10189
|
"tailwindcss": {
|
|
10177
10190
|
"label": "Tailwind CSS",
|
|
10178
10191
|
"hint": "Атомарный CSS-фреймворк"
|
|
10179
|
-
}
|
|
10192
|
+
},
|
|
10193
|
+
"status": { "not_supported": "CSS-фреймворк %{css} пока не поддерживается для %{vuetify}." }
|
|
10180
10194
|
},
|
|
10181
10195
|
"typescript": { "use": "Использовать TypeScript?" },
|
|
10182
10196
|
"router": {
|
|
@@ -10194,6 +10208,10 @@ var ru_default = {
|
|
|
10194
10208
|
},
|
|
10195
10209
|
"features": {
|
|
10196
10210
|
"select": "Выберите функции для установки: %{hint}",
|
|
10211
|
+
"router": {
|
|
10212
|
+
"label": "Роутер",
|
|
10213
|
+
"hint": "Добавить Vue Router"
|
|
10214
|
+
},
|
|
10197
10215
|
"pinia": { "label": "Pinia" },
|
|
10198
10216
|
"eslint": {
|
|
10199
10217
|
"label": "ESLint",
|
|
@@ -10269,8 +10287,7 @@ var ru_default = {
|
|
|
10269
10287
|
"platform": { "description": "Фреймворк для использования" },
|
|
10270
10288
|
"verbose": { "description": "Вывести подробные логи" },
|
|
10271
10289
|
"preset": { "description": "Путь к файлу пресета для загрузки" },
|
|
10272
|
-
"version": { "description": "Версия Vuetify для просмотра документации" }
|
|
10273
|
-
"vuetifyVersion": { "description": "Версия Vuetify" }
|
|
10290
|
+
"version": { "description": "Версия Vuetify для просмотра документации" }
|
|
10274
10291
|
},
|
|
10275
10292
|
cli: {
|
|
10276
10293
|
"main": { "description": "CLI для Vuetify" },
|
|
@@ -10372,10 +10389,6 @@ function projectArgs(options) {
|
|
|
10372
10389
|
preset: {
|
|
10373
10390
|
type: "string",
|
|
10374
10391
|
description: i18n$1.t("args.preset.description")
|
|
10375
|
-
},
|
|
10376
|
-
vuetifyVersion: {
|
|
10377
|
-
type: "string",
|
|
10378
|
-
description: i18n$1.t("args.vuetifyVersion.description")
|
|
10379
10392
|
}
|
|
10380
10393
|
};
|
|
10381
10394
|
if (options?.exclude) for (const key of options.exclude) delete args[key];
|
|
@@ -126306,35 +126319,31 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126306
126319
|
}]
|
|
126307
126320
|
});
|
|
126308
126321
|
},
|
|
126309
|
-
|
|
126310
|
-
|
|
126311
|
-
|
|
126312
|
-
if (
|
|
126313
|
-
|
|
126314
|
-
|
|
126315
|
-
|
|
126322
|
+
css: ({ results }) => {
|
|
126323
|
+
const type = results.type || args.type;
|
|
126324
|
+
const platform = results.platform || args.platform;
|
|
126325
|
+
if (args.css) if (type === "vuetify" && args.css.startsWith("unocss")) R$3.warn(i18n$1.t("prompts.css_framework.status.not_supported", {
|
|
126326
|
+
css: "UnoCSS",
|
|
126327
|
+
vuetify: "Vuetify"
|
|
126328
|
+
}));
|
|
126329
|
+
else return Promise.resolve(args.css);
|
|
126330
|
+
if (!args.interactive) return Promise.resolve("none");
|
|
126331
|
+
if (type === "vuetify" && platform === "nuxt") return qt({
|
|
126332
|
+
message: i18n$1.t("prompts.css_framework.select"),
|
|
126333
|
+
initialValue: "none",
|
|
126316
126334
|
options: [{
|
|
126317
|
-
label:
|
|
126318
|
-
value: "
|
|
126335
|
+
label: "Tailwind CSS",
|
|
126336
|
+
value: "tailwindcss",
|
|
126337
|
+
hint: i18n$1.t("prompts.css_framework.tailwindcss.hint")
|
|
126319
126338
|
}, {
|
|
126320
|
-
label: i18n$1.t("prompts.
|
|
126321
|
-
value: "
|
|
126339
|
+
label: i18n$1.t("prompts.css_framework.none"),
|
|
126340
|
+
value: "none"
|
|
126322
126341
|
}]
|
|
126323
126342
|
});
|
|
126324
|
-
},
|
|
126325
|
-
cssFramework: ({ results }) => {
|
|
126326
|
-
const type = results.type || args.type;
|
|
126327
|
-
if (type !== "vuetify0") return Promise.resolve("none");
|
|
126328
|
-
if (args.css) {
|
|
126329
|
-
if (args.css.includes("unocss")) return Promise.resolve("unocss");
|
|
126330
|
-
if (args.css.includes("tailwindcss")) return Promise.resolve("tailwindcss");
|
|
126331
|
-
return Promise.resolve("none");
|
|
126332
|
-
}
|
|
126333
|
-
if (!args.interactive) return Promise.resolve("none");
|
|
126334
126343
|
return qt({
|
|
126335
126344
|
message: i18n$1.t("prompts.css_framework.select"),
|
|
126336
126345
|
initialValue: type === "vuetify0" ? "unocss" : "none",
|
|
126337
|
-
options: [
|
|
126346
|
+
options: type === "vuetify0" ? [
|
|
126338
126347
|
{
|
|
126339
126348
|
label: "UnoCSS",
|
|
126340
126349
|
value: "unocss",
|
|
@@ -126349,43 +126358,40 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126349
126358
|
label: i18n$1.t("prompts.css_framework.none"),
|
|
126350
126359
|
value: "none"
|
|
126351
126360
|
}
|
|
126352
|
-
]
|
|
126353
|
-
});
|
|
126354
|
-
},
|
|
126355
|
-
typescript: ({ results }) => {
|
|
126356
|
-
if ((results.platform || args.platform) === "vue" && args.typescript === void 0) return Mt({
|
|
126357
|
-
message: i18n$1.t("prompts.typescript.use"),
|
|
126358
|
-
initialValue: true
|
|
126359
|
-
});
|
|
126360
|
-
return Promise.resolve(args.typescript ?? true);
|
|
126361
|
-
},
|
|
126362
|
-
router: ({ results }) => {
|
|
126363
|
-
if (args.router) return Promise.resolve(args.router);
|
|
126364
|
-
if ((results.platform || args.platform) !== "vue") return Promise.resolve("none");
|
|
126365
|
-
if (!args.interactive) return Promise.resolve("none");
|
|
126366
|
-
return qt({
|
|
126367
|
-
message: i18n$1.t("prompts.router.select"),
|
|
126368
|
-
initialValue: "router",
|
|
126369
|
-
options: [
|
|
126361
|
+
] : [
|
|
126370
126362
|
{
|
|
126371
|
-
label: i18n$1.t("prompts.
|
|
126363
|
+
label: i18n$1.t("prompts.css_framework.none"),
|
|
126372
126364
|
value: "none"
|
|
126373
126365
|
},
|
|
126374
126366
|
{
|
|
126375
|
-
label:
|
|
126376
|
-
value: "
|
|
126377
|
-
hint: i18n$1.t("prompts.
|
|
126367
|
+
label: "Tailwind CSS",
|
|
126368
|
+
value: "tailwindcss",
|
|
126369
|
+
hint: i18n$1.t("prompts.css_framework.tailwindcss.hint")
|
|
126378
126370
|
},
|
|
126379
126371
|
{
|
|
126380
|
-
label: i18n$1.t("prompts.
|
|
126381
|
-
|
|
126382
|
-
|
|
126372
|
+
label: i18n$1.t("prompts.css_framework.unocss_wind4.label"),
|
|
126373
|
+
disabled: true,
|
|
126374
|
+
value: "unocss-wind4",
|
|
126375
|
+
hint: i18n$1.t("prompts.css_framework.unocss_wind4.hint")
|
|
126376
|
+
},
|
|
126377
|
+
{
|
|
126378
|
+
label: i18n$1.t("prompts.css_framework.unocss_vuetify.label"),
|
|
126379
|
+
disabled: true,
|
|
126380
|
+
value: "unocss-vuetify",
|
|
126381
|
+
hint: i18n$1.t("prompts.css_framework.unocss_vuetify.hint")
|
|
126383
126382
|
}
|
|
126384
126383
|
]
|
|
126385
126384
|
});
|
|
126386
126385
|
},
|
|
126386
|
+
typescript: ({ results }) => {
|
|
126387
|
+
if ((results.platform || args.platform) === "vue" && args.typescript === void 0) return Mt({
|
|
126388
|
+
message: i18n$1.t("prompts.typescript.use"),
|
|
126389
|
+
initialValue: true
|
|
126390
|
+
});
|
|
126391
|
+
return Promise.resolve(args.typescript ?? true);
|
|
126392
|
+
},
|
|
126387
126393
|
features: ({ results }) => {
|
|
126388
|
-
if (args.features) return Promise.resolve(args.features
|
|
126394
|
+
if (args.features) return Promise.resolve(args.features);
|
|
126389
126395
|
if (!args.interactive) return Promise.resolve([]);
|
|
126390
126396
|
const platform = results.platform || args.platform;
|
|
126391
126397
|
const type = results.type || args.type;
|
|
@@ -126397,6 +126403,11 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126397
126403
|
value: "eslint",
|
|
126398
126404
|
hint: i18n$1.t("prompts.features.eslint.hint")
|
|
126399
126405
|
},
|
|
126406
|
+
{
|
|
126407
|
+
label: i18n$1.t("prompts.features.router.label"),
|
|
126408
|
+
value: "router",
|
|
126409
|
+
hint: i18n$1.t("prompts.features.router.hint")
|
|
126410
|
+
},
|
|
126400
126411
|
{
|
|
126401
126412
|
label: i18n$1.t("prompts.features.mcp.label"),
|
|
126402
126413
|
value: "mcp",
|
|
@@ -126448,6 +126459,32 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126448
126459
|
required: false
|
|
126449
126460
|
});
|
|
126450
126461
|
},
|
|
126462
|
+
router: ({ results }) => {
|
|
126463
|
+
if (args.router) return Promise.resolve(args.router);
|
|
126464
|
+
if ((results.platform || args.platform) !== "vue") return Promise.resolve("none");
|
|
126465
|
+
if (!(results.features || args.features || []).includes("router")) return Promise.resolve("none");
|
|
126466
|
+
if (!args.interactive) return Promise.resolve("router");
|
|
126467
|
+
return qt({
|
|
126468
|
+
message: i18n$1.t("prompts.router.select"),
|
|
126469
|
+
initialValue: "router",
|
|
126470
|
+
options: [
|
|
126471
|
+
{
|
|
126472
|
+
label: i18n$1.t("prompts.router.none"),
|
|
126473
|
+
value: "none"
|
|
126474
|
+
},
|
|
126475
|
+
{
|
|
126476
|
+
label: i18n$1.t("prompts.router.standard.label"),
|
|
126477
|
+
value: "router",
|
|
126478
|
+
hint: i18n$1.t("prompts.router.standard.hint")
|
|
126479
|
+
},
|
|
126480
|
+
{
|
|
126481
|
+
label: i18n$1.t("prompts.router.file.label"),
|
|
126482
|
+
value: "file-router",
|
|
126483
|
+
hint: i18n$1.t("prompts.router.file.hint")
|
|
126484
|
+
}
|
|
126485
|
+
]
|
|
126486
|
+
});
|
|
126487
|
+
},
|
|
126451
126488
|
clientHints: ({ results }) => {
|
|
126452
126489
|
if (args.clientHints !== void 0) return Promise.resolve(args.clientHints);
|
|
126453
126490
|
if (!args.interactive) return Promise.resolve(false);
|
|
@@ -126459,9 +126496,17 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126459
126496
|
});
|
|
126460
126497
|
return Promise.resolve(false);
|
|
126461
126498
|
},
|
|
126462
|
-
|
|
126499
|
+
install: () => {
|
|
126500
|
+
if (args.install !== void 0) return Promise.resolve(args.install);
|
|
126501
|
+
if (!args.interactive) return Promise.resolve(false);
|
|
126502
|
+
return Mt({
|
|
126503
|
+
message: i18n$1.t("prompts.install"),
|
|
126504
|
+
initialValue: true
|
|
126505
|
+
});
|
|
126506
|
+
},
|
|
126507
|
+
packageManager: ({ results }) => {
|
|
126463
126508
|
if (args.packageManager) return Promise.resolve(args.packageManager);
|
|
126464
|
-
if (args.install === false) return Promise.resolve("
|
|
126509
|
+
if ((results.install ?? args.install) === false) return Promise.resolve(getUserAgent() ?? "npm");
|
|
126465
126510
|
if (!args.interactive) return Promise.resolve(getUserAgent() ?? "npm");
|
|
126466
126511
|
return qt({
|
|
126467
126512
|
message: i18n$1.t("prompts.package_manager.select"),
|
|
@@ -126486,31 +126531,18 @@ async function prompt(args, cwd = process.cwd()) {
|
|
|
126486
126531
|
{
|
|
126487
126532
|
label: "bun",
|
|
126488
126533
|
value: "bun"
|
|
126489
|
-
},
|
|
126490
|
-
{
|
|
126491
|
-
label: "none",
|
|
126492
|
-
value: "none"
|
|
126493
126534
|
}
|
|
126494
126535
|
]
|
|
126495
126536
|
});
|
|
126496
|
-
},
|
|
126497
|
-
install: ({ results }) => {
|
|
126498
|
-
if (args.install !== void 0) return Promise.resolve(args.install);
|
|
126499
|
-
if (!args.interactive) return Promise.resolve(false);
|
|
126500
|
-
if ((results.packageManager || args.packageManager) === "none") return Promise.resolve(false);
|
|
126501
|
-
return Mt({
|
|
126502
|
-
message: i18n$1.t("prompts.install"),
|
|
126503
|
-
initialValue: true
|
|
126504
|
-
});
|
|
126505
126537
|
}
|
|
126506
126538
|
}, { onCancel: () => {
|
|
126507
126539
|
Pt(i18n$1.t("prompts.cancel"));
|
|
126508
126540
|
process.exit(0);
|
|
126509
126541
|
} });
|
|
126510
126542
|
const features = [
|
|
126511
|
-
...options.features,
|
|
126512
|
-
options.router,
|
|
126513
|
-
options.
|
|
126543
|
+
...(options.features || []).filter((f) => f !== "router"),
|
|
126544
|
+
options.router === "none" ? void 0 : options.router,
|
|
126545
|
+
options.type === "vuetify0" ? options.css === "none" ? "css-none" : options.css : options.css === "none" ? void 0 : options.css
|
|
126514
126546
|
].filter((f) => f && f !== "none");
|
|
126515
126547
|
return {
|
|
126516
126548
|
...options,
|
|
@@ -126787,8 +126819,8 @@ async function downloadTemplate(input, options = {}) {
|
|
|
126787
126819
|
const cssNone = {
|
|
126788
126820
|
name: "css-none",
|
|
126789
126821
|
apply: async ({ cwd, isNuxt }) => {
|
|
126790
|
-
const
|
|
126791
|
-
if (existsSync(
|
|
126822
|
+
const unocssConfigs = [join$1(cwd, "unocss.config.ts"), join$1(cwd, "uno.config.ts")];
|
|
126823
|
+
for (const configPath of unocssConfigs) if (existsSync(configPath)) rmSync(configPath);
|
|
126792
126824
|
const tailwindCss = isNuxt ? join$1(cwd, "app/assets/css/tailwind.css") : join$1(cwd, "src/tailwind.css");
|
|
126793
126825
|
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
126794
126826
|
}
|
|
@@ -147789,15 +147821,19 @@ var dependencies = {
|
|
|
147789
147821
|
"vue-router": "^4.6.4",
|
|
147790
147822
|
"vue-i18n": "^11.2.7",
|
|
147791
147823
|
"unplugin-vue-router": "^0.19.1",
|
|
147792
|
-
"vite-plugin-vuetify": "^2.1.
|
|
147824
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
147793
147825
|
"unocss": "^66.5.12",
|
|
147826
|
+
"@unocss/transformer-directives": "^66.6.0",
|
|
147794
147827
|
"@unocss/nuxt": "^66.5.12",
|
|
147828
|
+
"unocss-preset-vuetify": "^0.1.1",
|
|
147795
147829
|
"tailwindcss": "^4.1.18",
|
|
147796
147830
|
"@tailwindcss/vite": "^4.1.18",
|
|
147797
147831
|
"@nuxtjs/tailwindcss": "^7.0.0-beta.1",
|
|
147798
147832
|
"pathe": "^2.0.3",
|
|
147799
147833
|
"@vuetify/loader-shared": "^2.1.1",
|
|
147800
|
-
"@intellectronica/ruler": "^0.3.18"
|
|
147834
|
+
"@intellectronica/ruler": "^0.3.18",
|
|
147835
|
+
"@fontsource/roboto": "^5.2.9",
|
|
147836
|
+
"@fontsource/roboto-mono": "^5.2.8"
|
|
147801
147837
|
};
|
|
147802
147838
|
|
|
147803
147839
|
//#endregion
|
|
@@ -148054,7 +148090,7 @@ export const useAppStore = defineStore('app', {
|
|
|
148054
148090
|
|
|
148055
148091
|
//#endregion
|
|
148056
148092
|
//#region ../shared/package.json
|
|
148057
|
-
var version$1 = "0.1
|
|
148093
|
+
var version$1 = "1.0.1";
|
|
148058
148094
|
|
|
148059
148095
|
//#endregion
|
|
148060
148096
|
//#region ../shared/src/utils/getTemplateSource.ts
|
|
@@ -148194,9 +148230,10 @@ export default router
|
|
|
148194
148230
|
//#region ../shared/src/features/tailwindcss.ts
|
|
148195
148231
|
const tailwindcss = {
|
|
148196
148232
|
name: "tailwindcss",
|
|
148197
|
-
apply: async ({ cwd, pkg, isTypescript, isNuxt }) => {
|
|
148198
|
-
|
|
148199
|
-
|
|
148233
|
+
apply: async ({ cwd, pkg, isTypescript, isNuxt, type }) => {
|
|
148234
|
+
if (type === "vuetify" && !isNuxt) return;
|
|
148235
|
+
const unocssConfigs = [join$1(cwd, "unocss.config.ts"), join$1(cwd, "uno.config.ts")];
|
|
148236
|
+
for (const configPath of unocssConfigs) if (existsSync(configPath)) rmSync(configPath);
|
|
148200
148237
|
if (isNuxt) {
|
|
148201
148238
|
pkg.devDependencies = pkg.devDependencies || {};
|
|
148202
148239
|
pkg.devDependencies["tailwindcss"] = dependencies.tailwindcss;
|
|
@@ -148229,40 +148266,57 @@ const tailwindcss = {
|
|
|
148229
148266
|
|
|
148230
148267
|
//#endregion
|
|
148231
148268
|
//#region ../shared/src/features/unocss.ts
|
|
148269
|
+
async function applyUnocssBase({ cwd, pkg, isTypescript, isNuxt }, options = {}) {
|
|
148270
|
+
pkg.devDependencies = pkg.devDependencies || {};
|
|
148271
|
+
pkg.devDependencies["unocss"] = dependencies.unocss;
|
|
148272
|
+
pkg.devDependencies["@unocss/transformer-directives"] = dependencies["@unocss/transformer-directives"];
|
|
148273
|
+
if (options.presetVuetify) pkg.devDependencies["unocss-preset-vuetify"] = dependencies["unocss-preset-vuetify"];
|
|
148274
|
+
const tailwindCss = isNuxt ? join$1(cwd, "app/assets/css/tailwind.css") : join$1(cwd, "src/tailwind.css");
|
|
148275
|
+
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
148276
|
+
if (pkg.devDependencies) {
|
|
148277
|
+
delete pkg.devDependencies["tailwindcss"];
|
|
148278
|
+
delete pkg.devDependencies["@tailwindcss/vite"];
|
|
148279
|
+
delete pkg.devDependencies["@nuxtjs/tailwindcss"];
|
|
148280
|
+
}
|
|
148281
|
+
if (isNuxt) {
|
|
148282
|
+
pkg.devDependencies["@unocss/nuxt"] = dependencies["@unocss/nuxt"];
|
|
148283
|
+
const configPath = join$1(cwd, "nuxt.config.ts");
|
|
148284
|
+
const mod = await loadFile(configPath);
|
|
148285
|
+
addNuxtModule(mod, "@unocss/nuxt");
|
|
148286
|
+
await writeFile(configPath, mod.generate().code);
|
|
148287
|
+
return;
|
|
148288
|
+
}
|
|
148289
|
+
const viteConfigPath = join$1(cwd, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
148290
|
+
const mod = await loadFile(viteConfigPath);
|
|
148291
|
+
addVitePlugin(mod, {
|
|
148292
|
+
from: "unocss/vite",
|
|
148293
|
+
constructor: "UnoCSS"
|
|
148294
|
+
});
|
|
148295
|
+
await writeFile(viteConfigPath, mod.generate().code);
|
|
148296
|
+
for (const file of ["src/main.ts", "src/main.js"]) {
|
|
148297
|
+
const filePath = join$1(cwd, file);
|
|
148298
|
+
if (existsSync(filePath)) {
|
|
148299
|
+
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport 'virtual:uno.css'"));
|
|
148300
|
+
break;
|
|
148301
|
+
}
|
|
148302
|
+
}
|
|
148303
|
+
}
|
|
148232
148304
|
const unocss = {
|
|
148233
148305
|
name: "unocss",
|
|
148234
|
-
apply: async (
|
|
148235
|
-
|
|
148236
|
-
|
|
148237
|
-
|
|
148238
|
-
|
|
148239
|
-
|
|
148240
|
-
|
|
148241
|
-
|
|
148242
|
-
|
|
148243
|
-
|
|
148244
|
-
|
|
148245
|
-
|
|
148246
|
-
|
|
148247
|
-
|
|
148248
|
-
addNuxtModule(mod, "@unocss/nuxt");
|
|
148249
|
-
await writeFile(configPath, mod.generate().code);
|
|
148250
|
-
} else {
|
|
148251
|
-
const viteConfigPath = join$1(cwd, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
148252
|
-
const mod = await loadFile(viteConfigPath);
|
|
148253
|
-
addVitePlugin(mod, {
|
|
148254
|
-
from: "unocss/vite",
|
|
148255
|
-
constructor: "UnoCSS"
|
|
148256
|
-
});
|
|
148257
|
-
await writeFile(viteConfigPath, mod.generate().code);
|
|
148258
|
-
for (const file of ["src/main.ts", "src/main.js"]) {
|
|
148259
|
-
const filePath = join$1(cwd, file);
|
|
148260
|
-
if (existsSync(filePath)) {
|
|
148261
|
-
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport 'virtual:uno.css'"));
|
|
148262
|
-
break;
|
|
148263
|
-
}
|
|
148264
|
-
}
|
|
148265
|
-
}
|
|
148306
|
+
apply: async (ctx) => {
|
|
148307
|
+
await applyUnocssBase(ctx);
|
|
148308
|
+
}
|
|
148309
|
+
};
|
|
148310
|
+
const unocssWind4 = {
|
|
148311
|
+
name: "unocss-wind4",
|
|
148312
|
+
apply: async (ctx) => {
|
|
148313
|
+
await applyUnocssBase(ctx);
|
|
148314
|
+
}
|
|
148315
|
+
};
|
|
148316
|
+
const unocssVuetify = {
|
|
148317
|
+
name: "unocss-vuetify",
|
|
148318
|
+
apply: async (ctx) => {
|
|
148319
|
+
await applyUnocssBase(ctx, { presetVuetify: true });
|
|
148266
148320
|
}
|
|
148267
148321
|
};
|
|
148268
148322
|
|
|
@@ -148340,6 +148394,8 @@ const features = {
|
|
|
148340
148394
|
"vuetify-nuxt-module": vuetifyNuxtModule,
|
|
148341
148395
|
"vuetify-nuxt-manual": vuetifyNuxtManual,
|
|
148342
148396
|
unocss,
|
|
148397
|
+
"unocss-wind4": unocssWind4,
|
|
148398
|
+
"unocss-vuetify": unocssVuetify,
|
|
148343
148399
|
tailwindcss,
|
|
148344
148400
|
"css-none": cssNone
|
|
148345
148401
|
};
|
|
@@ -149336,8 +149392,59 @@ async function installDependencies(root = process.cwd(), manager = packageManage
|
|
|
149336
149392
|
|
|
149337
149393
|
//#endregion
|
|
149338
149394
|
//#region ../shared/src/functions/scaffold.ts
|
|
149395
|
+
function resolveTemplateName(templates, platform, type, features) {
|
|
149396
|
+
if (platform !== "vue" || type !== "vuetify") return templates[platform][type];
|
|
149397
|
+
if (features.includes("unocss-wind4")) return "vue/unocss-wind4";
|
|
149398
|
+
if (features.includes("unocss-vuetify")) return "vue/unocss-vuetify";
|
|
149399
|
+
if (features.includes("tailwindcss")) return "vue/tailwind";
|
|
149400
|
+
return templates[platform][type];
|
|
149401
|
+
}
|
|
149402
|
+
async function resolveSharedAssetsPath() {
|
|
149403
|
+
const templateName = "shared-assets";
|
|
149404
|
+
const envTemplatesPath = process.env.VUETIFY_CLI_TEMPLATES_PATH;
|
|
149405
|
+
if (envTemplatesPath) {
|
|
149406
|
+
const templatePath = join$1(envTemplatesPath, templateName);
|
|
149407
|
+
if (existsSync(templatePath)) return { path: templatePath };
|
|
149408
|
+
}
|
|
149409
|
+
const tempDir = fs.mkdtempSync(join$1(tmpdir(), "vuetify-cli-assets-"));
|
|
149410
|
+
await downloadTemplate(getTemplateSource(templateName), {
|
|
149411
|
+
dir: tempDir,
|
|
149412
|
+
force: true
|
|
149413
|
+
});
|
|
149414
|
+
return {
|
|
149415
|
+
path: tempDir,
|
|
149416
|
+
cleanup: () => rmSync(tempDir, {
|
|
149417
|
+
recursive: true,
|
|
149418
|
+
force: true
|
|
149419
|
+
})
|
|
149420
|
+
};
|
|
149421
|
+
}
|
|
149422
|
+
function copySharedAsset(sourcePath, targetPath) {
|
|
149423
|
+
if (!existsSync(sourcePath)) return;
|
|
149424
|
+
fs.mkdirSync(dirname$2(targetPath), { recursive: true });
|
|
149425
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
149426
|
+
}
|
|
149427
|
+
async function applySharedAssets(projectRoot, platform, type) {
|
|
149428
|
+
const needsFavicon = type === "vuetify" && (platform === "vue" || platform === "nuxt");
|
|
149429
|
+
const needsLogo = platform === "vue" || platform === "nuxt";
|
|
149430
|
+
const needsV0Badge = type === "vuetify0";
|
|
149431
|
+
if (!needsFavicon && !needsLogo && !needsV0Badge) return;
|
|
149432
|
+
const assets = await resolveSharedAssetsPath();
|
|
149433
|
+
if (!assets) return;
|
|
149434
|
+
try {
|
|
149435
|
+
if (needsFavicon) copySharedAsset(join$1(assets.path, "favicon.ico"), join$1(projectRoot, "public", "favicon.ico"));
|
|
149436
|
+
if (needsLogo) {
|
|
149437
|
+
const logoRoot = platform === "nuxt" ? join$1(projectRoot, "assets") : join$1(projectRoot, "src", "assets");
|
|
149438
|
+
copySharedAsset(join$1(assets.path, "logo.png"), join$1(logoRoot, "logo.png"));
|
|
149439
|
+
copySharedAsset(join$1(assets.path, "logo.svg"), join$1(logoRoot, "logo.svg"));
|
|
149440
|
+
}
|
|
149441
|
+
if (needsV0Badge) copySharedAsset(join$1(assets.path, "0.png"), join$1(projectRoot, "public", "0.png"));
|
|
149442
|
+
} finally {
|
|
149443
|
+
assets.cleanup?.();
|
|
149444
|
+
}
|
|
149445
|
+
}
|
|
149339
149446
|
async function scaffold(options, callbacks = {}) {
|
|
149340
|
-
const { cwd, name, platform, features, typescript, type,
|
|
149447
|
+
const { cwd, name, platform, features, typescript, type, packageManager, install, force, clientHints, debug: debugFlag } = options;
|
|
149341
149448
|
const debug = (...msg) => debugFlag && console.log("DEBUG:", ...msg);
|
|
149342
149449
|
const projectRoot = join$1(cwd, name);
|
|
149343
149450
|
debug("projectRoot=", projectRoot);
|
|
@@ -149345,16 +149452,16 @@ async function scaffold(options, callbacks = {}) {
|
|
|
149345
149452
|
recursive: true,
|
|
149346
149453
|
force: true
|
|
149347
149454
|
});
|
|
149348
|
-
const templateName = {
|
|
149455
|
+
const templateName = resolveTemplateName({
|
|
149349
149456
|
vue: {
|
|
149350
149457
|
vuetify0: "vuetify0/base",
|
|
149351
149458
|
vuetify: "vue/base"
|
|
149352
149459
|
},
|
|
149353
149460
|
nuxt: {
|
|
149354
149461
|
vuetify0: "vuetify0/nuxt",
|
|
149355
|
-
vuetify: "
|
|
149462
|
+
vuetify: "nuxt/base"
|
|
149356
149463
|
}
|
|
149357
|
-
}
|
|
149464
|
+
}, platform, type, features);
|
|
149358
149465
|
callbacks.onDownloadStart?.(templateName);
|
|
149359
149466
|
if (process.env.VUETIFY_CLI_TEMPLATES_PATH) {
|
|
149360
149467
|
const templatePath = join$1(process.env.VUETIFY_CLI_TEMPLATES_PATH, templateName);
|
|
@@ -149382,9 +149489,9 @@ async function scaffold(options, callbacks = {}) {
|
|
|
149382
149489
|
}
|
|
149383
149490
|
}
|
|
149384
149491
|
callbacks.onDownloadEnd?.();
|
|
149492
|
+
await applySharedAssets(projectRoot, platform, type);
|
|
149385
149493
|
let pkg;
|
|
149386
149494
|
pkg = await readPackageJSON$1(join$1(projectRoot, "package.json"));
|
|
149387
|
-
if (vuetifyVersion === "4.x" && pkg.dependencies && pkg.dependencies.vuetify) pkg.dependencies.vuetify = "^4.0.0-beta.1";
|
|
149388
149495
|
callbacks.onConfigStart?.();
|
|
149389
149496
|
if (features && features.length > 0) await applyFeatures(projectRoot, features, pkg, !!typescript, platform === "nuxt", clientHints, type);
|
|
149390
149497
|
if (platform === "nuxt" && type !== "vuetify0" && (!features || !features.includes("vuetify-nuxt-module"))) await vuetifyNuxtManual.apply({
|
|
@@ -149458,8 +149565,7 @@ async function createVuetify(options, commandOptions) {
|
|
|
149458
149565
|
platform: rawArgs.platform,
|
|
149459
149566
|
type: rawArgs.type,
|
|
149460
149567
|
css: rawArgs.css,
|
|
149461
|
-
router: rawArgs.router
|
|
149462
|
-
vuetifyVersion: args.vuetifyVersion
|
|
149568
|
+
router: rawArgs.router
|
|
149463
149569
|
}, cwd);
|
|
149464
149570
|
debug("context=", JSON.stringify(context, null, 2));
|
|
149465
149571
|
if (args.interactive && !args.preset) {
|
|
@@ -149507,7 +149613,6 @@ async function createVuetify(options, commandOptions) {
|
|
|
149507
149613
|
name: context.name,
|
|
149508
149614
|
platform: context.platform,
|
|
149509
149615
|
type: context.type,
|
|
149510
|
-
vuetifyVersion: context.vuetifyVersion,
|
|
149511
149616
|
features: context.features,
|
|
149512
149617
|
typescript: !!context.typescript,
|
|
149513
149618
|
packageManager: context.packageManager,
|
|
@@ -150868,6 +150973,8 @@ function registerProjectArgsCompletion(completion) {
|
|
|
150868
150973
|
const cssOption = completion.options.get("css");
|
|
150869
150974
|
if (cssOption) cssOption.handler = (complete) => {
|
|
150870
150975
|
complete("unocss", "UnoCSS");
|
|
150976
|
+
complete("unocss-wind4", "UnoCSS (Wind4)");
|
|
150977
|
+
complete("unocss-vuetify", "UnoCSS (Vuetify)");
|
|
150871
150978
|
complete("tailwindcss", "Tailwind CSS");
|
|
150872
150979
|
complete("none", "None");
|
|
150873
150980
|
};
|
|
@@ -150943,7 +151050,7 @@ const JsonReporter = { report: async (data, options) => {
|
|
|
150943
151050
|
|
|
150944
151051
|
//#endregion
|
|
150945
151052
|
//#region package.json
|
|
150946
|
-
var version = "0.1
|
|
151053
|
+
var version = "1.0.1";
|
|
150947
151054
|
|
|
150948
151055
|
//#endregion
|
|
150949
151056
|
//#region src/commands/analyze.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Vuetify CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"open": "^11.0.0",
|
|
36
36
|
"pathe": "^2.0.3",
|
|
37
37
|
"tsdown": "^0.20.3",
|
|
38
|
-
"@vuetify/cli-shared": "0.1
|
|
38
|
+
"@vuetify/cli-shared": "1.0.1"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@typescript-eslint/parser": "^8.54.0"
|