Skip to content

feat(add): write v0 examples into a project from the registry - #27

Draft
johnleider wants to merge 9 commits into
mainfrom
feat/add-registry
Draft

feat(add): write v0 examples into a project from the registry#27
johnleider wants to merge 9 commits into
mainfrom
feat/add-registry

Conversation

@johnleider

@johnleider johnleider commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

vuetify add consumers for the docs registry seed, plus the local component-library lifecycle:

  • add / list / status — seed from registry, track in vuetify.json
  • install-first plugins — wire create*Plugin (registry install recipe preferred)
  • generate — scaffold local components (no origin)
  • diff / refresh — compare and re-fetch from origin
  • multi-registry@alias/name and --registry
  • registry build — emit a static registry from inventory for others to consume

Pairs with docs seed: vuetifyjs/0#721

Test plan

  • Against local docs registry: add dialog, add use-theme, list/status
  • generate MyCardregistry build → serve parent → add my-card --registry …
  • diff / refresh on tracked items
  • add @local/foo after alias in vuetify.json

`vuetify add` only handled integrations. It now also resolves a name against
the v0 registry, so `vuetify add dialog` copies a runnable, styled example in
instead of leaving the user to find it in the docs and paste it by hand.

It copies the example, not the primitive's source. v0 is a published package,
so ejecting `Dialog` itself would fork a consumer off the upgrade path for no
gain; the file they cannot get today is the one that actually renders.

The styling preflight is the part that makes this work at all. Examples style
themselves with semantic utilities (`bg-primary`, `text-on-surface`), which
need two layers: `createThemePlugin` to emit the `--v0-*` custom properties,
and an UnoCSS or Tailwind config to map them. Copying the markup without them
produces something that looks broken and reads as v0's fault, so `add` detects
both, offers the patch, and warns when the theme plugin is absent. The UnoCSS
config is edited through magicast — appending the block would leave the file
syntactically invalid — and existing colors are preserved.

Non-interactive runs stay unblocked and non-destructive: `--yes` picks the
canonical example, refuses to guess between ambiguous names, and skips
existing files rather than clobbering them, leaving `--overwrite` as the
explicit opt-in.

New strings are English-only; `enableFallback` covers ru until translated.
@johnleider johnleider added the enhancement New feature or request label Jul 27, 2026
@johnleider johnleider self-assigned this Jul 27, 2026
Phase 1 of the local component-library lifecycle: successful `vuetify add`
records origin, path, and files into project inventory, with `list` and
`status` commands for inspection and disk health checks.
Match the docs registry item shape so soft-deps can act on collections
without reverse-engineering utility class names.
User-facing warnings point at the docs/registry plugin (useTheme) so
`vuetify add use-theme` is the obvious next step. Detection still scans
for createThemePlugin in app code.
Use registry title (useTheme, Dialog, createDataTable) for interactive
option labels and suggestions; keep kebab name as the resolve value.
Insert disabled section headers so interactive select no longer mixes
component and composable families. Transformers get their own group.
Clack disabled options cannot be restyled as true headings; a light
── prefix makes section boundaries obvious in the picker.
Plugins like useTheme wire create*Plugin into the app (src/plugins +
main.ts/registerPlugins) instead of only seeding docs examples. Examples
are opt-in via --example or an interactive confirm; --yes installs only.
Complete the local component-library lifecycle on the CLI: scaffold
components, diff/refresh against registry origins, resolve @alias
registries, publish a local registry, and prefer install recipes from
registry JSON when present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant