Commit 05aa9ea
authored
docs: publish a static registry for vuetify add (#721)
* docs: publish a static registry for vuetify add
v0 ships a real package, so a consumer can already install it — what they
cannot get is a working, styled file, because a bare import of a headless
primitive renders nothing. This publishes the docs examples as a registry a
CLI can read, so `vuetify add dialog` writes a runnable demo.
The source of truth is the `::: gn-example` directive already present on every
feature page: it declares an ordered file manifest, external `@import`
dependencies, a title, and prose. Building on it means the registry inherits
the curation instead of guessing from a directory listing, and it picks up the
supporting `.ts` files that `examples.json` drops today.
Emits `registry/index.json` (a 30 KB catalog, versus the 521 KB examples.json
blob, so resolving a name is cheap), `registry/{type}/{name}.json` per item,
and `registry/tokens.json` carrying the semantic token contract plus the
UnoCSS and Tailwind snippets that map it — one source of truth the CLI reads
rather than a copy that drifts.
Examples may only use tokens the create-vuetify0 templates map, since anything
else renders unstyled once copied out of the docs site. Generation now fails a
production build on a violation; `bg-accent` in two observer examples is
swapped for portable colors accordingly.
* refactor(theme): move the semantic color contract into packages/0
The list of semantic colors was declared in the docs registry builder, but the
guarantee is the theme layer's — those are the names `createThemePlugin` emits
and a consumer maps onto utility classes. Leaving it in `apps/docs/build`
implied the docs site owned it, when the docs site is one of three consumers
alongside the create-vuetify0 templates and the CLI, all synced by hand.
It moves to `packages/0/src/theme/tokens.ts`, imported by the builder the same
way `maturity.json` already is. The generation itself stays in `apps/docs` —
it reads `src/pages` and `src/examples`, so hoisting it into a package would
have a package reaching up into an app to read its content.
Deliberately not exported from `@vuetify/v0/theme`. Nothing outside this repo
consumes it, and making it public is a minor bump that belongs with the change
that gives the templates a reason to import it.
Emitted registry is unchanged: 93 items, 144 examples, 20 tokens.
* docs(registry): harden vuetify add portability
Warn on case-colliding basenames (fatal in prod), skip incomplete multi-file
blocks, invalidate the dev memo on page/example edits, and surface Uno icon
utilities as soft deps. Rename six PascalCase/entry pairs that collided on
case-insensitive filesystems.
* docs(registry): close review gaps in the add registry builder
Derive example ids and dirs from the entry file, join multi-line prose,
skip fence-local paths, confine reads to the examples root, reload
maturity/package.json per build, and broaden dev-cache invalidation.
* docs(registry): shape icons as collections for install soft-deps
Emit icons.collections (lucide, mdi, …) as the actionable install unit and
keep classes for audit. Frame the module as the official seed catalog for
the local component-library lifecycle.
* docs(registry): include Plugin and Transformer docs pages
features.category Plugin/Transformer were skipped (only Component/Composable
matched), so useTheme and the rest of the plugins family never entered the
seed catalog. Map them onto the composables bucket where their examples live.
* docs(registry): plugin install recipes and CORS for playground
Emit install recipes (factory/label/file) on plugin items so the CLI
can wire create*Plugin without a hard-coded map, include install-only
plugins with zero examples, and allow cross-origin /registry/* reads
from the playground.
* docs(registry): harden path confinement and install recipe shape
Reject path segments (..), resolve examples through realpath so git
symlinks cannot smuggle host files into the payload, validate feature
names and create*Plugin install recipes before emit, and restrict the
dev /registry middleware to GET (+ OPTIONS).
* docs(registry): tighten install label and catalog integrity
Sanitize plugin install labels to plain identifiers, warn on duplicate
type/name keys, align nginx CORS headers with the dev middleware, and
drop a stale comment about reflected 404 paths.1 parent 6b3c7e2 commit 05aa9ea
25 files changed
Lines changed: 1065 additions & 32 deletions
File tree
- apps/docs
- build
- src
- examples
- components
- carousel
- slider
- composables
- create-sortable
- use-mutation-observer
- use-resize-observer
- use-roving-focus
- use-virtual-focus
- pages
- components
- forms
- semantic
- composables
- data
- system
- packages/0/src/theme
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
0 commit comments