Skip to content

Commit cdf7ebd

Browse files
committed
feat(presets): enhance preset system with user presets and improved UX
- Add new `presets` subcommand to create-vuetify, create-vuetify0, and vuetify CLI - Support loading user presets by display name or slug from ~/.vuetify/create/presets/ - Add interactive preset selection when creating projects without --preset flag - Move preset utilities to shared package for reuse across CLI tools - Update i18n strings for better preset usage guidance - Add test for loading user preset by display name - Fix tsconfig vueCompilerOptions update to preserve formatting
1 parent 1cd7441 commit cdf7ebd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1341
-196
lines changed

packages/cli/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import tab from '@bomb.sh/tab/citty'
22
import { createBanner, registerProjectArgsCompletion } from '@vuetify/cli-shared'
3-
import { add } from '@vuetify/cli-shared/commands'
3+
import { add, createPresetsCommand } from '@vuetify/cli-shared/commands'
44
import { i18n } from '@vuetify/cli-shared/i18n'
55

66
import { defineCommand, runMain, showUsage } from 'citty'
@@ -11,6 +11,8 @@ import { init } from './commands/init'
1111
import { update } from './commands/update'
1212
import { upgrade } from './commands/upgrade'
1313

14+
const presets = createPresetsCommand({ version, type: 'vuetify' })
15+
1416
export const main = defineCommand({
1517
meta: {
1618
name: 'vuetify',
@@ -19,6 +21,7 @@ export const main = defineCommand({
1921
},
2022
subCommands: {
2123
init,
24+
presets,
2225
add,
2326
update,
2427
docs,
@@ -41,6 +44,10 @@ await tab(main).then(completion => {
4144
if (initCommand) {
4245
registerProjectArgsCompletion(initCommand)
4346
}
47+
const presetsCommand = completion.commands.get('presets')
48+
if (presetsCommand) {
49+
registerProjectArgsCompletion(presetsCommand)
50+
}
4451
})
4552

4653
runMain(main)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Vuetify (Default)
2+
3+
This is the official scaffolding tool for Vuetify, designed to give you a head start in building your new Vuetify application. It sets up a base template with all the necessary configurations and standard directory structure, enabling you to begin development without the hassle of setting up the project from scratch.
4+
5+
## ❗️ Important Links
6+
7+
- 📄 [Docs](https://vuetifyjs.com/)
8+
- 🚨 [Issues](https://issues.vuetifyjs.com/)
9+
- 🏬 [Store](https://store.vuetifyjs.com/)
10+
- 🎮 [Playground](https://play.vuetifyjs.com/)
11+
- 💬 [Discord](https://community.vuetifyjs.com)
12+
13+
## 💿 Install
14+
15+
Set up your project using your preferred package manager. Use the corresponding command to install the dependencies:
16+
17+
| Package Manager | Command |
18+
|---------------------------------------------------------------|----------------|
19+
| [yarn](https://yarnpkg.com/getting-started) | `yarn install` |
20+
| [npm](https://docs.npmjs.com/cli/v7/commands/npm-install) | `npm install` |
21+
| [pnpm](https://pnpm.io/installation) | `pnpm install` |
22+
| [bun](https://bun.sh/#getting-started) | `bun install` |
23+
24+
After completing the installation, your environment is ready for Vuetify development.
25+
26+
## ✨ Features
27+
28+
- 🖼️ **Optimized Front-End Stack**: Leverage the latest Vue 3 and Vuetify 4 for a modern, reactive UI development experience. [Vue 3](https://v3.vuejs.org/) | [Vuetify 4](https://vuetifyjs.com/en/)
29+
- 🗃️ **State Management**: Integrated with [Pinia](https://pinia.vuejs.org/), the intuitive, modular state management solution for Vue.
30+
- 🚦 **Routing and Layouts**: Utilizes Vue Router for SPA navigation and vite-plugin-vue-layouts-next for organizing Vue file layouts. [Vue Router](https://router.vuejs.org/) | [vite-plugin-vue-layouts-next](https://github.com/loicduong/vite-plugin-vue-layouts-next)
31+
- 💻 **Enhanced Development Experience**: Benefit from TypeScript's static type checking and the ESLint plugin suite for Vue, ensuring code quality and consistency. [TypeScript](https://www.typescriptlang.org/) | [ESLint Plugin Vue](https://eslint.vuejs.org/)
32+
-**Next-Gen Tooling**: Powered by Vite, experience fast cold starts and instant HMR (Hot Module Replacement). [Vite](https://vitejs.dev/)
33+
- 🧩 **Automated Component Importing**: Streamline your workflow with unplugin-vue-components, automatically importing components as you use them. [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)
34+
- 🛠️ **Strongly-Typed Vue**: Use vue-tsc for type-checking your Vue components, and enjoy a robust development experience. [vue-tsc](https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc)
35+
36+
These features are curated to provide a seamless development experience from setup to deployment, ensuring that your Vuetify application is both powerful and maintainable.
37+
38+
## 💡 Usage
39+
40+
This section covers how to start the development server and build your project for production.
41+
42+
### Starting the Development Server
43+
44+
To start the development server with hot-reload, run the following command. The server will be accessible at [http://localhost:3000](http://localhost:3000):
45+
46+
```bash
47+
yarn dev
48+
```
49+
50+
(Repeat for npm, pnpm, and bun with respective commands.)
51+
52+
> Add NODE_OPTIONS='--no-warnings' to suppress the JSON import warnings that happen as part of the Vuetify import mapping. If you are on Node [v21.3.0](https://nodejs.org/en/blog/release/v21.3.0) or higher, you can change this to NODE_OPTIONS='--disable-warning=5401'. If you don't mind the warning, you can remove this from your package.json dev script.
53+
54+
### Building for Production
55+
56+
To build your project for production, use:
57+
58+
```bash
59+
yarn build
60+
```
61+
62+
(Repeat for npm, pnpm, and bun with respective commands.)
63+
64+
Once the build process is completed, your application will be ready for deployment in a production environment.
65+
66+
## 💪 Support Vuetify Development
67+
68+
This project is built with [Vuetify](https://vuetifyjs.com/en/), a UI Library with a comprehensive collection of Vue components. Vuetify is an MIT licensed Open Source project that has been made possible due to the generous contributions by our [sponsors and backers](https://vuetifyjs.com/introduction/sponsors-and-backers/). If you are interested in supporting this project, please consider:
69+
70+
- [Requesting Enterprise Support](https://support.vuetifyjs.com/)
71+
- [Sponsoring John on Github](https://github.com/users/johnleider/sponsorship)
72+
- [Sponsoring Kael on Github](https://github.com/users/kaelwd/sponsorship)
73+
- [Supporting the team on Open Collective](https://opencollective.com/vuetify)
74+
- [Becoming a sponsor on Patreon](https://www.patreon.com/vuetify)
75+
- [Becoming a subscriber on Tidelift](https://tidelift.com/subscription/npm/vuetify)
76+
- [Making a one-time donation with Paypal](https://paypal.me/vuetify)
77+
78+
## 📑 License
79+
[MIT](http://opensource.org/licenses/MIT)
80+
81+
Copyright (c) 2016-present Vuetify, LLC
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="vite/client" />
2+
/// <reference types="vite-plugin-vue-layouts-next/client" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import vuetify from 'eslint-config-vuetify'
2+
3+
export default vuetify()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Welcome to Vuetify 4</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "debug-nuxt",
3+
"private": true,
4+
"type": "module",
5+
"version": "0.0.0",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "run-p type-check \"build-only {@}\" --",
9+
"preview": "vite preview",
10+
"build-only": "vite build",
11+
"type-check": "vue-tsc --build --force"
12+
},
13+
"dependencies": {
14+
"@fontsource/roboto": "^5.2.9",
15+
"@mdi/font": "7.4.47",
16+
"vue": "^3.5.26",
17+
"vuetify": "^4.0.0"
18+
},
19+
"devDependencies": {
20+
"@tsconfig/node22": "^22.0.5",
21+
"@types/node": "^22.0.5",
22+
"@vitejs/plugin-vue": "^6.0.5",
23+
"@vue/tsconfig": "^0.9.0",
24+
"npm-run-all2": "^8.0.4",
25+
"sass-embedded": "^1.97.1",
26+
"typescript": "~5.9.3",
27+
"unplugin-fonts": "^1.4.0",
28+
"vite": "^8.0.0",
29+
"vite-plugin-vuetify": "^2.1.3",
30+
"vue-tsc": "^3.2.0"
31+
},
32+
"overrides": {
33+
"unplugin-fonts": {
34+
"vite": "^8.0.0"
35+
}
36+
}
37+
}
15 KB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<v-app>
3+
<v-main>
4+
<HelloWorld />
5+
</v-main>
6+
<v-btn
7+
class="ma-2"
8+
icon="mdi-theme-light-dark"
9+
location="top right"
10+
position="absolute"
11+
@click="$vuetify.theme.cycle()"
12+
/>
13+
</v-app>
14+
</template>
15+
16+
<script lang="ts" setup>
17+
import HelloWorld from '@/components/HelloWorld.vue'
18+
</script>
11.7 KB
Loading
Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)