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