Skip to content

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

Merged
johnleider merged 12 commits into
mainfrom
feat/add-registry
Aug 8, 2026
Merged

feat(add): write v0 examples into a project from the registry#27
johnleider merged 12 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.
Remove ru.json and always run the CLI on the en catalog so new commands
do not require a second incomplete translation.
English-only setup no longer reads process/navigator locale.
Keep English-only i18n; drop ru.json conflict from main.
@johnleider
johnleider marked this pull request as ready for review August 8, 2026 01:40
@johnleider
johnleider merged commit fbe3bb7 into main Aug 8, 2026
1 check passed
@johnleider

Copy link
Copy Markdown
Member Author

Merged (squash → fbe3bb7).

Still open (vuetifyjs/0)

PR What Check
#789 Playground: Open example + ?example= from /registry/* Against live registry
#794 Docs: CLI guide for add / list / generate / diff / refresh / registry After this CLI ships (or note “latest CLI”)

Done

PR Status
vuetifyjs/0#721 Merged — prod seed live
vuetifyjs/cli#27 Merged — this PR

Suggested smoke after release

pnpm add -g @vuetify/cli@latest   # once published
vuetify add dialog --yes
vuetify list
vuetify add use-theme --yes

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