create-wervt 0.2.5 → 0.2.7

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.
Files changed (37) hide show
  1. package/index.js +50 -2
  2. package/package.json +1 -1
  3. package/template/.claude/skills/nuxt-ui/SKILL.md +334 -0
  4. package/template/.claude/skills/nuxt-ui/references/components.md +377 -0
  5. package/template/.claude/skills/nuxt-ui/references/composables.md +127 -0
  6. package/template/.claude/skills/nuxt-ui/references/layouts/chat.md +195 -0
  7. package/template/.claude/skills/nuxt-ui/references/layouts/dashboard.md +220 -0
  8. package/template/.claude/skills/nuxt-ui/references/layouts/docs.md +141 -0
  9. package/template/.claude/skills/nuxt-ui/references/layouts/editor.md +167 -0
  10. package/template/.claude/skills/nuxt-ui/references/layouts/page.md +260 -0
  11. package/template/.claude/skills/nuxt-ui/references/theming.md +427 -0
  12. package/template/.claude/skills/nuxt-ui-mobile/SKILL.md +92 -0
  13. package/template/.claude/skills/nuxt-ui-mobile/examples/app/composables/useDemoItems.ts +18 -0
  14. package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/index.vue +121 -0
  15. package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/items/[id].vue +77 -0
  16. package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/settings/index.vue +71 -0
  17. package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/settings/sort.vue +23 -0
  18. package/template/.claude/skills/nuxt-ui-mobile/references/patterns.md +212 -0
  19. package/template/.claude/skills/nuxt-ui-mobile/references/review-checklist.md +49 -0
  20. package/template/.claude/skills/nuxt-ui-mobile/references/tokens.md +86 -0
  21. package/template/.claude/skills/nuxt-ui-mobile/scripts/gen-palette.mjs +58 -0
  22. package/template/.claude/skills/nuxt-ui-mobile/template/app/app.config.ts +298 -0
  23. package/template/.claude/skills/nuxt-ui-mobile/template/app/app.vue +8 -0
  24. package/template/.claude/skills/nuxt-ui-mobile/template/app/assets/css/main.css +331 -0
  25. package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ActionSheet.vue +47 -0
  26. package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListRow.vue +73 -0
  27. package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListSection.vue +26 -0
  28. package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/NavBar.vue +88 -0
  29. package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/TabBar.vue +45 -0
  30. package/template/.claude/skills/nuxt-ui-mobile/template/app/layouts/default.vue +16 -0
  31. package/template/.claude/skills/nuxt-ui-mobile/template/app/layouts/plain.vue +6 -0
  32. package/template/.claude/skills/nuxt-ui-mobile/template/nuxt.config.ts +27 -0
  33. package/template/AGENTS.md +26 -5
  34. package/template/_gitignore +2 -0
  35. package/template/package.json +2 -2
  36. package/template/pnpm-workspace.yaml +6 -0
  37. package/template/vite.config.ts +3 -1
package/index.js CHANGED
@@ -12,6 +12,39 @@ import { installDependencies } from 'nypm'
12
12
  const BUNDLED_TEMPLATE = new URL('./template', import.meta.url).pathname
13
13
  const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/
14
14
 
15
+ // Without a terminal (CI logs, agent shells), clack's spinner prints every frame as text.
16
+ const interactive = process.stdout.isTTY === true && !process.env.CI
17
+
18
+ function progress() {
19
+ if (interactive) return p.spinner()
20
+ return { start: (message) => p.log.step(message), stop: (message) => p.log.success(message) }
21
+ }
22
+
23
+ // `--empty`: the todo example's files, and what replaces the ones an app always has.
24
+ const EXAMPLE_FILES = [
25
+ 'server/api/todos.post.ts',
26
+ 'server/api/todos',
27
+ 'server/api/shapes/todos.get.ts',
28
+ 'drizzle',
29
+ ]
30
+ const EMPTY_SCHEMA = `// Tables are declared without a schema: on wervt the app's database role only sees
31
+ // its own schema. Run \`pnpm db:generate\` after changing this file.
32
+ //
33
+ // import { pgTable, serial, text } from 'drizzle-orm/pg-core'
34
+ //
35
+ // export const notes = pgTable('notes', {
36
+ // id: serial().primaryKey(),
37
+ // text: text().notNull(),
38
+ // })
39
+ export {}
40
+ `
41
+ const EMPTY_APP = `<template>
42
+ <main>
43
+ <h1>Hello from wervt</h1>
44
+ </main>
45
+ </template>
46
+ `
47
+
15
48
  /**
16
49
  * The newest version of a package on npm. Releases of @wervt/nuxt and @wervt/cli don't release
17
50
  * this package, so new apps ask the registry instead of keeping the versions bundled at pack
@@ -57,6 +90,11 @@ const main = defineCommand({
57
90
  },
58
91
  install: { type: 'boolean', default: true, description: 'Install dependencies' },
59
92
  force: { type: 'boolean', default: false, description: 'Overwrite an existing directory' },
93
+ empty: {
94
+ type: 'boolean',
95
+ default: false,
96
+ description: 'Without the todo example (no API routes, table or migration)',
97
+ },
60
98
  },
61
99
  async run({ args }) {
62
100
  p.intro('create-wervt')
@@ -78,7 +116,7 @@ const main = defineCommand({
78
116
  if (existsSync(dir) && !args.force)
79
117
  throw new Error(`${relative(process.cwd(), dir) || dir} already exists (use --force)`)
80
118
 
81
- const spinner = p.spinner()
119
+ const spinner = progress()
82
120
  spinner.start('Creating app')
83
121
  if (args.template) {
84
122
  await downloadTemplate(args.template, { dir, force: args.force })
@@ -89,6 +127,12 @@ const main = defineCommand({
89
127
  await rename(join(dir, '_gitignore'), join(dir, '.gitignore'))
90
128
  }
91
129
 
130
+ if (args.empty) {
131
+ for (const file of EXAMPLE_FILES) await rm(join(dir, file), { recursive: true, force: true })
132
+ await writeFile(join(dir, 'server/db/schema.ts'), EMPTY_SCHEMA)
133
+ await writeFile(join(dir, 'app.vue'), EMPTY_APP)
134
+ }
135
+
92
136
  const pkgPath = join(dir, 'package.json')
93
137
  const pkg = JSON.parse(await readFile(pkgPath, 'utf8'))
94
138
  pkg.name = name
@@ -100,6 +144,8 @@ const main = defineCommand({
100
144
  await rm(join(dir, 'vite.config.ts'), { force: true })
101
145
  // Apps in the repo are deployed from the repo, not by their own workflow.
102
146
  await rm(join(dir, '.github'), { recursive: true, force: true })
147
+ // The repo's own pnpm-workspace.yaml covers the app; its own would split it off.
148
+ await rm(join(dir, 'pnpm-workspace.yaml'), { force: true })
103
149
  } else {
104
150
  for (const [deps, name] of [
105
151
  ['dependencies', '@wervt/nuxt'],
@@ -134,7 +180,9 @@ const main = defineCommand({
134
180
  .join('\n'),
135
181
  'Next steps',
136
182
  )
137
- p.outro('Agents: read AGENTS.md before writing code.')
183
+ // clack's outro ends with blank lines; without a terminal the last line is the message.
184
+ if (interactive) p.outro('Agents: read AGENTS.md before writing code.')
185
+ else console.log('Agents: read AGENTS.md before writing code.')
138
186
  },
139
187
  })
140
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wervt",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Create a new wervt app: Nuxt 5, Postgres with Drizzle, live data with Electric.",
5
5
  "homepage": "https://wervt.app",
6
6
  "license": "MIT",
@@ -0,0 +1,334 @@
1
+ ---
2
+ name: nuxt-ui
3
+ description: Build UIs with @nuxt/ui v4 — 125+ accessible Vue components with Tailwind CSS theming. Use when creating interfaces, customizing themes to match a brand, building forms, or composing layouts like dashboards, docs sites, and chat interfaces.
4
+ ---
5
+
6
+ # Nuxt UI
7
+
8
+ Vue component library built on [Reka UI](https://reka-ui.com/) + [Tailwind CSS](https://tailwindcss.com/) + [Tailwind Variants](https://www.tailwind-variants.org/). Works with Nuxt, Vue (Vite), Laravel (Inertia), and AdonisJS (Inertia).
9
+
10
+ ## Installation
11
+
12
+ ### Nuxt
13
+
14
+ ```bash
15
+ pnpm add @nuxt/ui tailwindcss
16
+ ```
17
+
18
+ ```ts
19
+ // nuxt.config.ts
20
+ export default defineNuxtConfig({
21
+ modules: ['@nuxt/ui'],
22
+ css: ['~/assets/css/main.css']
23
+ })
24
+ ```
25
+
26
+ ```css
27
+ /* app/assets/css/main.css */
28
+ @import "tailwindcss";
29
+ @import "@nuxt/ui";
30
+ ```
31
+
32
+ ```vue
33
+ <!-- app.vue -->
34
+ <template>
35
+ <UApp>
36
+ <NuxtPage />
37
+ </UApp>
38
+ </template>
39
+ ```
40
+
41
+ ### Vue (Vite)
42
+
43
+ ```bash
44
+ pnpm add @nuxt/ui tailwindcss
45
+ ```
46
+
47
+ ```ts
48
+ // vite.config.ts
49
+ import { defineConfig } from 'vite'
50
+ import vue from '@vitejs/plugin-vue'
51
+ import ui from '@nuxt/ui/vite'
52
+
53
+ export default defineConfig({
54
+ plugins: [
55
+ vue(),
56
+ ui()
57
+ ]
58
+ })
59
+ ```
60
+
61
+ ```ts
62
+ // src/main.ts
63
+ import './assets/main.css'
64
+ import { createApp } from 'vue'
65
+ import { createRouter, createWebHistory } from 'vue-router'
66
+ import ui from '@nuxt/ui/vue-plugin'
67
+ import App from './App.vue'
68
+
69
+ const app = createApp(App)
70
+
71
+ const router = createRouter({
72
+ routes: [],
73
+ history: createWebHistory()
74
+ })
75
+
76
+ app.use(router)
77
+ app.use(ui)
78
+ app.mount('#app')
79
+ ```
80
+
81
+ ```css
82
+ /* assets/main.css */
83
+ @import "tailwindcss";
84
+ @import "@nuxt/ui";
85
+ ```
86
+
87
+ ```vue
88
+ <!-- src/App.vue -->
89
+ <template>
90
+ <UApp>
91
+ <RouterView />
92
+ </UApp>
93
+ </template>
94
+ ```
95
+
96
+ > **Vue**: Add `class="isolate"` to your root `<div id="app">` in `index.html`.
97
+
98
+ > **Vue + Inertia**: Use `ui({ router: 'inertia' })` in `vite.config.ts`.
99
+
100
+ ### UApp
101
+
102
+ Wrapping your app in `UApp` is **required** — it provides global config for toasts, tooltips, and programmatic overlays. It also accepts a `locale` prop for i18n (see [composables reference](references/composables.md)).
103
+
104
+ ## Icons
105
+
106
+ Nuxt UI uses [Iconify](https://iconify.design/) for 200,000+ icons. In Nuxt, `@nuxt/icon` is auto-registered. In Vue, icons work out of the box via the Vite plugin.
107
+
108
+ ### Naming convention
109
+
110
+ Icons use the format `i-{collection}-{name}`:
111
+
112
+ ```vue
113
+ <UIcon name="i-lucide-sun" class="size-5" />
114
+ <UButton icon="i-lucide-plus" label="Add" />
115
+ <UAlert icon="i-lucide-info" title="Heads up" />
116
+ ```
117
+
118
+ > Browse all icons at [icones.js.org](https://icones.js.org). The `lucide` collection is used throughout Nuxt UI defaults.
119
+
120
+ ### Install icon collections locally
121
+
122
+ ```bash
123
+ pnpm i @iconify-json/lucide
124
+ pnpm i @iconify-json/simple-icons
125
+ ```
126
+
127
+ ### Custom local collections (Nuxt)
128
+
129
+ ```ts
130
+ // nuxt.config.ts
131
+ export default defineNuxtConfig({
132
+ icon: {
133
+ customCollections: [{
134
+ prefix: 'custom',
135
+ dir: './app/assets/icons'
136
+ }]
137
+ }
138
+ })
139
+ ```
140
+
141
+ ```vue
142
+ <UIcon name="i-custom-my-icon" />
143
+ ```
144
+
145
+ ## Theming & Branding
146
+
147
+ Nuxt UI ships with a default look. The goal is to adapt it to your brand so every app looks unique.
148
+
149
+ **Always use semantic utilities** (`text-default`, `bg-elevated`, `border-muted`), never raw Tailwind palette colors. See [references/theming.md](references/theming.md) for the full list.
150
+
151
+ ### Colors
152
+
153
+ 7 semantic colors (`primary`, `secondary`, `success`, `info`, `warning`, `error`, `neutral`) configurable at runtime:
154
+
155
+ ```ts
156
+ // Nuxt — app.config.ts
157
+ export default defineAppConfig({
158
+ ui: { colors: { primary: 'indigo', neutral: 'zinc' } }
159
+ })
160
+ ```
161
+
162
+ ```ts
163
+ // Vue — vite.config.ts
164
+ import { defineConfig } from 'vite'
165
+ import vue from '@vitejs/plugin-vue'
166
+ import ui from '@nuxt/ui/vite'
167
+
168
+ export default defineConfig({
169
+ plugins: [
170
+ vue(),
171
+ ui({
172
+ ui: { colors: { primary: 'indigo', neutral: 'zinc' } }
173
+ })
174
+ ]
175
+ })
176
+ ```
177
+
178
+ ### Customizing components
179
+
180
+ **Override priority** (highest wins): `ui` prop / `class` prop > global config > theme defaults.
181
+
182
+ The `ui` prop overrides a component's **slots** after variants are computed — it wins over everything:
183
+
184
+ ```vue
185
+ <UButton :ui="{ base: 'rounded-none', trailingIcon: 'size-3 rotate-90' }" />
186
+ <UCard :ui="{ header: 'bg-muted', body: 'p-8' }" />
187
+ ```
188
+
189
+ **Read the generated theme file** to find slot names for any component:
190
+
191
+ - **Nuxt**: `.nuxt/ui/<component>.ts`
192
+ - **Vue**: `node_modules/.nuxt-ui/ui/<component>.ts`
193
+
194
+ > For CSS variables, custom colors, global config, compound variants, and a **full brand customization playbook**, see [references/theming.md](references/theming.md)
195
+
196
+ ## Composables
197
+
198
+ ```ts
199
+ // Notifications
200
+ const toast = useToast()
201
+ toast.add({ title: 'Saved', color: 'success', icon: 'i-lucide-check' })
202
+
203
+ // Programmatic overlays
204
+ const overlay = useOverlay()
205
+ const modal = overlay.create(MyModal)
206
+ const { result } = modal.open({ title: 'Confirm' })
207
+ await result
208
+
209
+ // Keyboard shortcuts
210
+ defineShortcuts({
211
+ meta_k: () => openSearch(),
212
+ escape: () => close()
213
+ })
214
+ ```
215
+
216
+ > For full composable reference, see [references/composables.md](references/composables.md)
217
+
218
+ ## Form validation
219
+
220
+ Uses Standard Schema — works with Zod, Valibot, Yup, or Joi.
221
+
222
+ ```vue
223
+ <script setup lang="ts">
224
+ import { z } from 'zod'
225
+
226
+ const schema = z.object({
227
+ email: z.string().email('Invalid email'),
228
+ password: z.string().min(8, 'Min 8 characters')
229
+ })
230
+
231
+ type Schema = z.output<typeof schema>
232
+ const state = reactive<Partial<Schema>>({ email: '', password: '' })
233
+
234
+ function onSubmit() {
235
+ // UForm validates before emitting @submit — state is valid here
236
+ }
237
+ </script>
238
+
239
+ <template>
240
+ <UForm :schema="schema" :state="state" @submit="onSubmit">
241
+ <UFormField name="email" label="Email" required>
242
+ <UInput v-model="state.email" type="email" />
243
+ </UFormField>
244
+
245
+ <UFormField name="password" label="Password" required>
246
+ <UInput v-model="state.password" type="password" />
247
+ </UFormField>
248
+
249
+ <UButton type="submit">Sign in</UButton>
250
+ </UForm>
251
+ </template>
252
+ ```
253
+
254
+ > For all form components and validation patterns, see [references/components.md](references/components.md#form)
255
+
256
+ ## Overlays
257
+
258
+ ```vue
259
+ <!-- Modal -->
260
+ <UModal v-model:open="isOpen" title="Edit" description="Edit your profile">
261
+ <template #body>Content</template>
262
+ <template #footer>
263
+ <UButton variant="ghost" @click="isOpen = false">Cancel</UButton>
264
+ <UButton @click="save">Save</UButton>
265
+ </template>
266
+ </UModal>
267
+
268
+ <!-- Slideover (side panel) -->
269
+ <USlideover v-model:open="isOpen" title="Settings" side="right">
270
+ <template #body>Content</template>
271
+ </USlideover>
272
+
273
+ <!-- Dropdown menu (flat array) -->
274
+ <UDropdownMenu :items="[
275
+ { label: 'Edit', icon: 'i-lucide-pencil' },
276
+ { type: 'separator' },
277
+ { label: 'Delete', icon: 'i-lucide-trash', color: 'error' }
278
+ ]">
279
+ <UButton icon="i-lucide-ellipsis-vertical" variant="ghost" />
280
+ </UDropdownMenu>
281
+
282
+ <!-- Dropdown menu (nested array — groups with automatic separators) -->
283
+ <UDropdownMenu :items="[
284
+ [{ label: 'Edit', icon: 'i-lucide-pencil' }, { label: 'Duplicate', icon: 'i-lucide-copy' }],
285
+ [{ label: 'Delete', icon: 'i-lucide-trash', color: 'error' }]
286
+ ]">
287
+ <UButton icon="i-lucide-ellipsis-vertical" variant="ghost" />
288
+ </UDropdownMenu>
289
+ ```
290
+
291
+ > For all overlay components, see [references/components.md](references/components.md#overlay)
292
+
293
+ ## Layouts
294
+
295
+ Nuxt UI provides components to compose full page layouts. Load the reference matching your use case:
296
+
297
+ | Layout | Description | Reference |
298
+ |---|---|---|
299
+ | Page | Landing, blog, changelog, pricing — public-facing pages | [layouts/page.md](references/layouts/page.md) |
300
+ | Dashboard | Admin UI with resizable sidebar and panels | [layouts/dashboard.md](references/layouts/dashboard.md) |
301
+ | Docs | Documentation with sidebar nav and TOC | [layouts/docs.md](references/layouts/docs.md) |
302
+ | Chat | AI chat with messages and prompt | [layouts/chat.md](references/layouts/chat.md) |
303
+ | Editor | Rich text editor with toolbars | [layouts/editor.md](references/layouts/editor.md) |
304
+
305
+ ## Templates
306
+
307
+ Official starter templates at [github.com/nuxt-ui-templates](https://github.com/nuxt-ui-templates):
308
+
309
+ | Template | Framework | GitHub |
310
+ |---|---|---|
311
+ | Starter | Nuxt | [nuxt-ui-templates/starter](https://github.com/nuxt-ui-templates/starter) |
312
+ | Starter | Vue | [nuxt-ui-templates/starter-vue](https://github.com/nuxt-ui-templates/starter-vue) |
313
+ | Dashboard | Nuxt | [nuxt-ui-templates/dashboard](https://github.com/nuxt-ui-templates/dashboard) |
314
+ | Dashboard | Vue | [nuxt-ui-templates/dashboard-vue](https://github.com/nuxt-ui-templates/dashboard-vue) |
315
+ | SaaS | Nuxt | [nuxt-ui-templates/saas](https://github.com/nuxt-ui-templates/saas) |
316
+ | Landing | Nuxt | [nuxt-ui-templates/landing](https://github.com/nuxt-ui-templates/landing) |
317
+ | Docs | Nuxt | [nuxt-ui-templates/docs](https://github.com/nuxt-ui-templates/docs) |
318
+ | Portfolio | Nuxt | [nuxt-ui-templates/portfolio](https://github.com/nuxt-ui-templates/portfolio) |
319
+ | Chat | Nuxt | [nuxt-ui-templates/chat](https://github.com/nuxt-ui-templates/chat) |
320
+ | Editor | Nuxt | [nuxt-ui-templates/editor](https://github.com/nuxt-ui-templates/editor) |
321
+ | Changelog | Nuxt | [nuxt-ui-templates/changelog](https://github.com/nuxt-ui-templates/changelog) |
322
+ | Starter | Laravel | [nuxt-ui-templates/starter-laravel](https://github.com/nuxt-ui-templates/starter-laravel) |
323
+ | Starter | AdonisJS | [nuxt-ui-templates/starter-adonis](https://github.com/nuxt-ui-templates/starter-adonis) |
324
+
325
+ > When starting a new project, clone the matching template instead of setting up from scratch.
326
+
327
+ ## Additional references
328
+
329
+ Load based on your task — **do not load all at once**:
330
+
331
+ - [references/theming.md](references/theming.md) — CSS variables, custom colors, component theme overrides
332
+ - [references/components.md](references/components.md) — all 125+ components by category with props and usage
333
+ - [references/composables.md](references/composables.md) — useToast, useOverlay, defineShortcuts
334
+ - Generated theme files — all slots, variants, and default classes for any component (Nuxt: `.nuxt/ui/<component>.ts`, Vue: `node_modules/.nuxt-ui/ui/<component>.ts`)