@vuetify/cli 0.0.10-beta.12 → 0.0.10-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +240 -4
- package/package.json +2 -2
- package/src/commands/init.ts +4 -0
package/dist/index.mjs
CHANGED
|
@@ -8320,6 +8320,12 @@ var en_default = {
|
|
|
8320
8320
|
"vuetify0": "Vuetify0 (alpha)",
|
|
8321
8321
|
"nuxt": "Nuxt"
|
|
8322
8322
|
},
|
|
8323
|
+
"css_framework": {
|
|
8324
|
+
"select": "Which CSS framework?",
|
|
8325
|
+
"unocss": { "hint": "Instant on-demand atomic CSS engine" },
|
|
8326
|
+
"tailwindcss": { "hint": "A utility-first CSS framework" },
|
|
8327
|
+
"none": "None"
|
|
8328
|
+
},
|
|
8323
8329
|
"typescript": { "use": "Use TypeScript?" },
|
|
8324
8330
|
"router": {
|
|
8325
8331
|
"conflict": "Cannot select both \"router\" and \"file-router\" features.",
|
|
@@ -8516,6 +8522,18 @@ var ru_default = {
|
|
|
8516
8522
|
"vuetify0": "Vuetify0 (alpha)",
|
|
8517
8523
|
"nuxt": "Nuxt"
|
|
8518
8524
|
},
|
|
8525
|
+
"css_framework": {
|
|
8526
|
+
"select": "Какой фреймворк CSS вы хотите использовать?",
|
|
8527
|
+
"none": "Никакой",
|
|
8528
|
+
"unocss": {
|
|
8529
|
+
"label": "UnoCSS",
|
|
8530
|
+
"hint": "Быстрая и гибкая система стилей"
|
|
8531
|
+
},
|
|
8532
|
+
"tailwindcss": {
|
|
8533
|
+
"label": "Tailwind CSS",
|
|
8534
|
+
"hint": "Атомарный CSS-фреймворк"
|
|
8535
|
+
}
|
|
8536
|
+
},
|
|
8519
8537
|
"typescript": { "use": "Использовать TypeScript?" },
|
|
8520
8538
|
"router": {
|
|
8521
8539
|
"conflict": "Нельзя выбрать одновременно 'router' и 'file-router'.",
|
|
@@ -12552,6 +12570,34 @@ async function prompt(args$2, cwd$2 = process.cwd()) {
|
|
|
12552
12570
|
}]
|
|
12553
12571
|
});
|
|
12554
12572
|
},
|
|
12573
|
+
cssFramework: ({ results }) => {
|
|
12574
|
+
if ((results.type || args$2.type) !== "vuetify0") return Promise.resolve("none");
|
|
12575
|
+
if (args$2.css) {
|
|
12576
|
+
if (args$2.css.includes("unocss")) return Promise.resolve("unocss");
|
|
12577
|
+
if (args$2.css.includes("tailwindcss")) return Promise.resolve("tailwindcss");
|
|
12578
|
+
}
|
|
12579
|
+
if (!args$2.interactive) return Promise.resolve("none");
|
|
12580
|
+
return qt({
|
|
12581
|
+
message: i18n.t("prompts.css_framework.select"),
|
|
12582
|
+
initialValue: "unocss",
|
|
12583
|
+
options: [
|
|
12584
|
+
{
|
|
12585
|
+
label: "UnoCSS",
|
|
12586
|
+
value: "unocss",
|
|
12587
|
+
hint: i18n.t("prompts.css_framework.unocss.hint")
|
|
12588
|
+
},
|
|
12589
|
+
{
|
|
12590
|
+
label: "Tailwind CSS",
|
|
12591
|
+
value: "tailwindcss",
|
|
12592
|
+
hint: i18n.t("prompts.css_framework.tailwindcss.hint")
|
|
12593
|
+
},
|
|
12594
|
+
{
|
|
12595
|
+
label: i18n.t("prompts.css_framework.none"),
|
|
12596
|
+
value: "none"
|
|
12597
|
+
}
|
|
12598
|
+
]
|
|
12599
|
+
});
|
|
12600
|
+
},
|
|
12555
12601
|
typescript: ({ results }) => {
|
|
12556
12602
|
if ((results.platform || args$2.platform) === "vue" && args$2.typescript === void 0) return Mt({
|
|
12557
12603
|
message: i18n.t("prompts.typescript.use"),
|
|
@@ -12570,6 +12616,7 @@ async function prompt(args$2, cwd$2 = process.cwd()) {
|
|
|
12570
12616
|
return Promise.resolve("none");
|
|
12571
12617
|
}
|
|
12572
12618
|
if ((results.platform || args$2.platform) !== "vue") return Promise.resolve("none");
|
|
12619
|
+
if (!args$2.interactive) return Promise.resolve("none");
|
|
12573
12620
|
return qt({
|
|
12574
12621
|
message: i18n.t("prompts.router.select"),
|
|
12575
12622
|
initialValue: "router",
|
|
@@ -12714,7 +12761,11 @@ async function prompt(args$2, cwd$2 = process.cwd()) {
|
|
|
12714
12761
|
Pt(i18n.t("prompts.cancel"));
|
|
12715
12762
|
process.exit(0);
|
|
12716
12763
|
} });
|
|
12717
|
-
const features$1 = [
|
|
12764
|
+
const features$1 = [
|
|
12765
|
+
...options$1.features,
|
|
12766
|
+
options$1.router,
|
|
12767
|
+
options$1.cssFramework === "none" ? "css-none" : options$1.cssFramework
|
|
12768
|
+
].filter((f$7) => f$7 && f$7 !== "none");
|
|
12718
12769
|
return {
|
|
12719
12770
|
...options$1,
|
|
12720
12771
|
features: features$1
|
|
@@ -31682,6 +31733,19 @@ async function downloadTemplate(input, options$1 = {}) {
|
|
|
31682
31733
|
};
|
|
31683
31734
|
}
|
|
31684
31735
|
|
|
31736
|
+
//#endregion
|
|
31737
|
+
//#region ../shared/src/features/css-none.ts
|
|
31738
|
+
const cssNone = {
|
|
31739
|
+
name: "css-none",
|
|
31740
|
+
apply: async ({ cwd: cwd$2 }) => {
|
|
31741
|
+
const isNuxt = existsSync(join(cwd$2, "nuxt.config.ts"));
|
|
31742
|
+
const unocssConfig = join(cwd$2, "unocss.config.ts");
|
|
31743
|
+
if (existsSync(unocssConfig)) rmSync(unocssConfig);
|
|
31744
|
+
const tailwindCss = isNuxt ? join(cwd$2, "app/assets/css/tailwind.css") : join(cwd$2, "src/tailwind.css");
|
|
31745
|
+
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
31746
|
+
}
|
|
31747
|
+
};
|
|
31748
|
+
|
|
31685
31749
|
//#endregion
|
|
31686
31750
|
//#region ../../node_modules/.pnpm/@babel+parser@7.28.5/node_modules/@babel/parser/lib/index.js
|
|
31687
31751
|
var require_lib = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/@babel+parser@7.28.5/node_modules/@babel/parser/lib/index.js": ((exports) => {
|
|
@@ -52597,13 +52661,94 @@ const builders = {
|
|
|
52597
52661
|
|
|
52598
52662
|
//#endregion
|
|
52599
52663
|
//#region ../../node_modules/.pnpm/magicast@0.5.1/node_modules/magicast/dist/helpers/index.js
|
|
52664
|
+
function deepMergeObject(magicast, object) {
|
|
52665
|
+
if (typeof object === "object" && object !== null) for (const key in object) {
|
|
52666
|
+
const magicastValue = magicast[key];
|
|
52667
|
+
const objectValue = object[key];
|
|
52668
|
+
if (magicastValue === objectValue) continue;
|
|
52669
|
+
if (typeof magicastValue === "object" && magicastValue !== null && typeof objectValue === "object" && objectValue !== null) deepMergeObject(magicastValue, objectValue);
|
|
52670
|
+
else magicast[key] = objectValue;
|
|
52671
|
+
}
|
|
52672
|
+
}
|
|
52600
52673
|
function getDefaultExportOptions(magicast) {
|
|
52601
52674
|
return configFromNode(magicast.exports.default);
|
|
52602
52675
|
}
|
|
52676
|
+
/**
|
|
52677
|
+
* Returns the vite config object from a variable declaration thats
|
|
52678
|
+
* exported as the default export.
|
|
52679
|
+
*
|
|
52680
|
+
* Example:
|
|
52681
|
+
*
|
|
52682
|
+
* ```js
|
|
52683
|
+
* const config = {};
|
|
52684
|
+
* export default config;
|
|
52685
|
+
* ```
|
|
52686
|
+
*
|
|
52687
|
+
* @param magicast the module
|
|
52688
|
+
*
|
|
52689
|
+
* @returns an object containing the proxified config object and the
|
|
52690
|
+
* declaration "parent" to attach the modified config to later.
|
|
52691
|
+
* If no config declaration is found, undefined is returned.
|
|
52692
|
+
*/
|
|
52693
|
+
function getConfigFromVariableDeclaration(magicast) {
|
|
52694
|
+
if (magicast.exports.default.$type !== "identifier") throw new MagicastError(`Not supported: Cannot modify this kind of default export (${magicast.exports.default.$type})`);
|
|
52695
|
+
const configDecalarationId = magicast.exports.default.$name;
|
|
52696
|
+
for (const node$2 of magicast.$ast.body) if (node$2.type === "VariableDeclaration") {
|
|
52697
|
+
for (const declaration of node$2.declarations) if (declaration.id.type === "Identifier" && declaration.id.name === configDecalarationId && declaration.init) {
|
|
52698
|
+
const code$1 = generateCode(declaration.init.type === "TSSatisfiesExpression" ? declaration.init.expression : declaration.init).code;
|
|
52699
|
+
return {
|
|
52700
|
+
declaration,
|
|
52701
|
+
config: configFromNode(parseExpression(code$1))
|
|
52702
|
+
};
|
|
52703
|
+
}
|
|
52704
|
+
}
|
|
52705
|
+
throw new MagicastError("Couldn't find config declaration");
|
|
52706
|
+
}
|
|
52603
52707
|
function configFromNode(node$2) {
|
|
52604
52708
|
if (node$2.$type === "function-call") return node$2.$args[0];
|
|
52605
52709
|
return node$2;
|
|
52606
52710
|
}
|
|
52711
|
+
function addNuxtModule(magicast, name, optionsKey, options$1) {
|
|
52712
|
+
const config = getDefaultExportOptions(magicast);
|
|
52713
|
+
config.modules ||= [];
|
|
52714
|
+
if (!config.modules.includes(name)) config.modules.push(name);
|
|
52715
|
+
if (optionsKey) {
|
|
52716
|
+
config[optionsKey] ||= {};
|
|
52717
|
+
deepMergeObject(config[optionsKey], options$1);
|
|
52718
|
+
}
|
|
52719
|
+
}
|
|
52720
|
+
function addVitePlugin(magicast, plugin) {
|
|
52721
|
+
const config = getDefaultExportOptions(magicast);
|
|
52722
|
+
if (config.$type === "identifier") insertPluginIntoVariableDeclarationConfig(magicast, plugin);
|
|
52723
|
+
else insertPluginIntoConfig(plugin, config);
|
|
52724
|
+
magicast.imports.$prepend({
|
|
52725
|
+
from: plugin.from,
|
|
52726
|
+
local: plugin.constructor,
|
|
52727
|
+
imported: plugin.imported || "default"
|
|
52728
|
+
});
|
|
52729
|
+
return true;
|
|
52730
|
+
}
|
|
52731
|
+
/**
|
|
52732
|
+
* Insert @param plugin into a config object that's declared as a variable in
|
|
52733
|
+
* the module (@param magicast).
|
|
52734
|
+
*/
|
|
52735
|
+
function insertPluginIntoVariableDeclarationConfig(magicast, plugin) {
|
|
52736
|
+
const { config: configObject, declaration } = getConfigFromVariableDeclaration(magicast);
|
|
52737
|
+
insertPluginIntoConfig(plugin, configObject);
|
|
52738
|
+
if (declaration.init) {
|
|
52739
|
+
if (declaration.init.type === "ObjectExpression") declaration.init = generateCode(configObject).code;
|
|
52740
|
+
else if (declaration.init.type === "CallExpression" && declaration.init.callee.type === "Identifier") declaration.init = generateCode(builders.functionCall(declaration.init.callee.name, configObject)).code;
|
|
52741
|
+
else if (declaration.init.type === "TSSatisfiesExpression") {
|
|
52742
|
+
if (declaration.init.expression.type === "ObjectExpression") declaration.init.expression = generateCode(configObject).code;
|
|
52743
|
+
if (declaration.init.expression.type === "CallExpression" && declaration.init.expression.callee.type === "Identifier") declaration.init.expression = generateCode(builders.functionCall(declaration.init.expression.callee.name, configObject)).code;
|
|
52744
|
+
}
|
|
52745
|
+
}
|
|
52746
|
+
}
|
|
52747
|
+
function insertPluginIntoConfig(plugin, config) {
|
|
52748
|
+
const insertionIndex = plugin.index ?? config.plugins?.length ?? 0;
|
|
52749
|
+
config.plugins ||= [];
|
|
52750
|
+
config.plugins.splice(insertionIndex, 0, plugin.options ? builders.functionCall(plugin.constructor, plugin.options) : builders.functionCall(plugin.constructor));
|
|
52751
|
+
}
|
|
52607
52752
|
|
|
52608
52753
|
//#endregion
|
|
52609
52754
|
//#region ../shared/src/features/dependencies/package.json
|
|
@@ -52619,6 +52764,11 @@ var dependencies = {
|
|
|
52619
52764
|
"vue-i18n": "^11.2.7",
|
|
52620
52765
|
"unplugin-vue-router": "^0.19.1",
|
|
52621
52766
|
"vite-plugin-vuetify": "^2.1.2",
|
|
52767
|
+
"unocss": "^66.5.12",
|
|
52768
|
+
"@unocss/nuxt": "^66.5.12",
|
|
52769
|
+
"tailwindcss": "^4.1.18",
|
|
52770
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
52771
|
+
"@nuxtjs/tailwindcss": "^7.0.0-beta.1",
|
|
52622
52772
|
"pathe": "^2.0.3",
|
|
52623
52773
|
"@vuetify/loader-shared": "^2.1.1",
|
|
52624
52774
|
"@intellectronica/ruler": "^0.3.18"
|
|
@@ -53001,6 +53151,84 @@ export default router
|
|
|
53001
53151
|
`;
|
|
53002
53152
|
}
|
|
53003
53153
|
|
|
53154
|
+
//#endregion
|
|
53155
|
+
//#region ../shared/src/features/tailwindcss.ts
|
|
53156
|
+
const tailwindcss = {
|
|
53157
|
+
name: "tailwindcss",
|
|
53158
|
+
apply: async ({ cwd: cwd$2, pkg, isTypescript }) => {
|
|
53159
|
+
const isNuxt = existsSync(join(cwd$2, "nuxt.config.ts"));
|
|
53160
|
+
const unocssConfig = join(cwd$2, "unocss.config.ts");
|
|
53161
|
+
if (existsSync(unocssConfig)) rmSync(unocssConfig);
|
|
53162
|
+
if (isNuxt) {
|
|
53163
|
+
pkg.devDependencies = pkg.devDependencies || {};
|
|
53164
|
+
pkg.devDependencies["tailwindcss"] = dependencies.tailwindcss;
|
|
53165
|
+
pkg.devDependencies["@nuxtjs/tailwindcss"] = dependencies["@nuxtjs/tailwindcss"];
|
|
53166
|
+
const configPath = join(cwd$2, "nuxt.config.ts");
|
|
53167
|
+
const mod = await loadFile(configPath);
|
|
53168
|
+
addNuxtModule(mod, "@nuxtjs/tailwindcss");
|
|
53169
|
+
await writeFile(configPath, mod.generate().code);
|
|
53170
|
+
} else {
|
|
53171
|
+
pkg.devDependencies = pkg.devDependencies || {};
|
|
53172
|
+
pkg.devDependencies["tailwindcss"] = dependencies.tailwindcss;
|
|
53173
|
+
pkg.devDependencies["@tailwindcss/vite"] = dependencies["@tailwindcss/vite"];
|
|
53174
|
+
const viteConfigPath = join(cwd$2, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
53175
|
+
const mod = await loadFile(viteConfigPath);
|
|
53176
|
+
addVitePlugin(mod, {
|
|
53177
|
+
from: "@tailwindcss/vite",
|
|
53178
|
+
constructor: "tailwindcss"
|
|
53179
|
+
});
|
|
53180
|
+
await writeFile(viteConfigPath, mod.generate().code);
|
|
53181
|
+
for (const file$1 of ["src/main.ts", "src/main.js"]) {
|
|
53182
|
+
const filePath = join(cwd$2, file$1);
|
|
53183
|
+
if (existsSync(filePath)) {
|
|
53184
|
+
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport './tailwind.css';"));
|
|
53185
|
+
break;
|
|
53186
|
+
}
|
|
53187
|
+
}
|
|
53188
|
+
}
|
|
53189
|
+
}
|
|
53190
|
+
};
|
|
53191
|
+
|
|
53192
|
+
//#endregion
|
|
53193
|
+
//#region ../shared/src/features/unocss.ts
|
|
53194
|
+
const unocss = {
|
|
53195
|
+
name: "unocss",
|
|
53196
|
+
apply: async ({ cwd: cwd$2, pkg, isTypescript }) => {
|
|
53197
|
+
const isNuxt = existsSync(join(cwd$2, "nuxt.config.ts"));
|
|
53198
|
+
pkg.devDependencies = pkg.devDependencies || {};
|
|
53199
|
+
pkg.devDependencies["unocss"] = dependencies.unocss;
|
|
53200
|
+
const tailwindCss = isNuxt ? join(cwd$2, "app/assets/css/tailwind.css") : join(cwd$2, "src/tailwind.css");
|
|
53201
|
+
if (existsSync(tailwindCss)) rmSync(tailwindCss);
|
|
53202
|
+
if (pkg.devDependencies) {
|
|
53203
|
+
delete pkg.devDependencies["tailwindcss"];
|
|
53204
|
+
delete pkg.devDependencies["@tailwindcss/vite"];
|
|
53205
|
+
delete pkg.devDependencies["@nuxtjs/tailwindcss"];
|
|
53206
|
+
}
|
|
53207
|
+
if (isNuxt) {
|
|
53208
|
+
pkg.devDependencies["@unocss/nuxt"] = dependencies["@unocss/nuxt"];
|
|
53209
|
+
const configPath = join(cwd$2, "nuxt.config.ts");
|
|
53210
|
+
const mod = await loadFile(configPath);
|
|
53211
|
+
addNuxtModule(mod, "@unocss/nuxt");
|
|
53212
|
+
await writeFile(configPath, mod.generate().code);
|
|
53213
|
+
} else {
|
|
53214
|
+
const viteConfigPath = join(cwd$2, `vite.config.m${isTypescript ? "ts" : "js"}`);
|
|
53215
|
+
const mod = await loadFile(viteConfigPath);
|
|
53216
|
+
addVitePlugin(mod, {
|
|
53217
|
+
from: "unocss/vite",
|
|
53218
|
+
constructor: "UnoCSS"
|
|
53219
|
+
});
|
|
53220
|
+
await writeFile(viteConfigPath, mod.generate().code);
|
|
53221
|
+
for (const file$1 of ["src/main.ts", "src/main.js"]) {
|
|
53222
|
+
const filePath = join(cwd$2, file$1);
|
|
53223
|
+
if (existsSync(filePath)) {
|
|
53224
|
+
await writeFile(filePath, (await readFile(filePath, "utf8")).replace(/\/\/ Styles/g, "// Styles\nimport 'virtual:uno.css'"));
|
|
53225
|
+
break;
|
|
53226
|
+
}
|
|
53227
|
+
}
|
|
53228
|
+
}
|
|
53229
|
+
}
|
|
53230
|
+
};
|
|
53231
|
+
|
|
53004
53232
|
//#endregion
|
|
53005
53233
|
//#region ../shared/src/features/vuetify-nuxt-module.ts
|
|
53006
53234
|
const vuetifyNuxtModule = {
|
|
@@ -53042,7 +53270,10 @@ const features = {
|
|
|
53042
53270
|
i18n: i18n$1,
|
|
53043
53271
|
eslint,
|
|
53044
53272
|
mcp,
|
|
53045
|
-
"vuetify-nuxt-module": vuetifyNuxtModule
|
|
53273
|
+
"vuetify-nuxt-module": vuetifyNuxtModule,
|
|
53274
|
+
unocss,
|
|
53275
|
+
tailwindcss,
|
|
53276
|
+
"css-none": cssNone
|
|
53046
53277
|
};
|
|
53047
53278
|
async function applyFeatures(cwd$2, featureNames, pkg, isTypescript, clientHints, type) {
|
|
53048
53279
|
for (const name of featureNames) {
|
|
@@ -53302,7 +53533,8 @@ async function createVuetify(options$1) {
|
|
|
53302
53533
|
features: features$1,
|
|
53303
53534
|
packageManager: packageManager$1,
|
|
53304
53535
|
platform: rawArgs.platform,
|
|
53305
|
-
type: rawArgs.type
|
|
53536
|
+
type: rawArgs.type,
|
|
53537
|
+
css: rawArgs.css
|
|
53306
53538
|
}, cwd$2);
|
|
53307
53539
|
debug$6("context=", JSON.stringify(context, null, 2));
|
|
53308
53540
|
const projectRoot = join(cwd$2, context.name);
|
|
@@ -56060,7 +56292,7 @@ function commandUpgradeFabric(pkgName) {
|
|
|
56060
56292
|
|
|
56061
56293
|
//#endregion
|
|
56062
56294
|
//#region package.json
|
|
56063
|
-
var version = "0.0.10-beta.
|
|
56295
|
+
var version = "0.0.10-beta.14";
|
|
56064
56296
|
|
|
56065
56297
|
//#endregion
|
|
56066
56298
|
//#region src/commands/docs.ts
|
|
@@ -56116,6 +56348,10 @@ const init = defineCommand({
|
|
|
56116
56348
|
description: "The Vuetify version to use (vuetify, vuetify0)",
|
|
56117
56349
|
default: "vuetify"
|
|
56118
56350
|
},
|
|
56351
|
+
css: {
|
|
56352
|
+
type: "string",
|
|
56353
|
+
description: "The CSS framework to use (unocss, tailwindcss, none)"
|
|
56354
|
+
},
|
|
56119
56355
|
platform: {
|
|
56120
56356
|
type: "string",
|
|
56121
56357
|
description: "The framework to use (vue, nuxt)",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/cli",
|
|
3
|
-
"version": "0.0.10-beta.
|
|
3
|
+
"version": "0.0.10-beta.14",
|
|
4
4
|
"description": "Vuetify CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"open": "^11.0.0",
|
|
19
19
|
"pathe": "^2.0.3",
|
|
20
20
|
"tsdown": "^0.16.6",
|
|
21
|
-
"@vuetify/cli-shared": "0.0.10-beta.
|
|
21
|
+
"@vuetify/cli-shared": "0.0.10-beta.14"
|
|
22
22
|
},
|
|
23
23
|
"main": "./dist/index.mjs",
|
|
24
24
|
"module": "./dist/index.mjs",
|
package/src/commands/init.ts
CHANGED
|
@@ -37,6 +37,10 @@ export const init = defineCommand({
|
|
|
37
37
|
description: 'The Vuetify version to use (vuetify, vuetify0)',
|
|
38
38
|
default: 'vuetify',
|
|
39
39
|
},
|
|
40
|
+
css: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'The CSS framework to use (unocss, tailwindcss, none)',
|
|
43
|
+
},
|
|
40
44
|
platform: {
|
|
41
45
|
type: 'string',
|
|
42
46
|
description: 'The framework to use (vue, nuxt)',
|