@getvitops/cli 1.0.0 → 2.0.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,219 @@
1
1
  # @getvitops/cli
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bf453b0: Anywhere the toolchain takes a config, that file may now be a `design-system.json` **or** the larger
8
+ site config that embeds one.
9
+
10
+ If you keep your tokens inside a `company.json` / `site.json`, you had to maintain a second file for
11
+ the tooling's sake — or duplicate your whole token set, because a site config must carry a complete
12
+ `designSystem`. Now you point the same option at the file you already have:
13
+
14
+ ```js
15
+ // astro.config.mjs
16
+ getvitops({ css: { input: 'company.json', format: 'css' } });
17
+ ```
18
+
19
+ ```
20
+ vitops generate --input company.json --format css --out dist
21
+ vitops lint --input company.json --src src
22
+ ```
23
+
24
+ The design system is taken from `designSystem.themes[theme]` with its `extends` chain resolved —
25
+ `defaultTheme`, else `default`, else whatever `--theme` / the `theme` option names. Nothing changes
26
+ for a plain `design-system.json`; the two are told apart by shape, not by filename, so you can call
27
+ the file anything.
28
+
29
+ **A site config also supplies the site-level facts generation reads**, so the path is declared once
30
+ rather than per option:
31
+ - `designSystem.defaultColorScheme: "system"` — emits the `prefers-color-scheme` block, which is
32
+ what makes `<color-scheme-toggle>`'s System position do anything.
33
+ - `legal.*.enabled` — renders the documents. `legal: {}` is now the whole declaration; `legal.input`
34
+ is optional.
35
+ - `icons.sprite` — builds `icons.svg`.
36
+ - `fonts` — `fonts: true` reads the families from it.
37
+
38
+ Each of those is already gated on a field in that config, so nothing new appears unless the config
39
+ asks for it. An explicit `site` option still wins when the two are genuinely different files.
40
+
41
+ Also:
42
+ - **`vitops validate` routes on the file's shape.** Pointed at a site config it used to report a
43
+ single `unrecognized_keys` for `designSystem` and nothing about the file's actual contents — a
44
+ wrong answer that reads like a right one. It now validates a site config as one, including the
45
+ cross-field integrity JSON Schema can't express, and checks every theme resolves to a complete
46
+ design system (`validateSite` only checked that the `extends` chain resolved, not what it resolved
47
+ to).
48
+ - **`generate()` gained `theme` and `siteEnv`.** The A/B variant for `siteEnv` is applied before the
49
+ theme is selected, so a variant can override tokens.
50
+ - **The theme editor's Save to source follows the design system into a site config.** Its patch is
51
+ design-system-relative, so the dev server merges into that subtree and writes only the surrounding
52
+ file whole. It locates the subtree in the raw on-disk object rather than the normalised one, so an
53
+ author who wrote either `designSystem` shorthand still gets their own keys edited.
54
+
55
+ - 04a51d8: Icons: one semantic vocabulary across icon sets, with the bundle derived from your source.
56
+
57
+ Name icons by meaning — `<Icon name="menu" />` resolves to `fa7-solid:bars`, `ph:list` or
58
+ `lucide:menu` depending on the set you configure, so swapping sets is a config edit rather than a
59
+ find-and-replace. A name containing `:` still passes through untouched, which is the escape hatch
60
+ for a set-specific glyph.
61
+
62
+ **New `icons` option on `getvitops()`.** Configures the sets once per site and, under
63
+ `output: 'server'`, derives astro-icon's `include` map by scanning your source — the list most
64
+ projects end up maintaining by hand. On a static build no `include` is passed at all, because
65
+ astro-icon is already zero-config there and a list could only drop a glyph the scan couldn't see.
66
+ Names you declare that don't resolve fail the build; names only the scan found just warn; names
67
+ computed at runtime are reported with file and line so you can declare them.
68
+
69
+ **New `<Icon />` component**, and a real fix with it: `Popover`, `Details` and `Drawer` imported
70
+ `astro-icon/components` at module scope, so the _optional_ peer was resolved whether or not an icon
71
+ ever rendered — hard-failing anyone who hadn't installed it. Engines now load dynamically. The
72
+ per-component `iconResolver` prop still works but is deprecated in favour of the integration option.
73
+
74
+ **New SVG sprite** (`icons.sprite: true` in your site config) for consumers that can't run an icon
75
+ integration — Bricks/WordPress, EmDash renderers, plain HTML. `<use href="…/icons.svg#ph--list">`,
76
+ no JavaScript and no icon-API request. Every semantic name also gets a set-independent `icon-<name>`
77
+ alias, so sprite markup survives an icon-set change. WordPress gets `vitops_icon()`, a
78
+ `[vitops_icon]` shortcode and a **Vitops → Icon** Bricks element.
79
+
80
+ **New `vitops icons`** command: reports which icons your source uses, which names couldn't be
81
+ resolved, and which are computed at runtime; `--sprite` builds the sprite, `--json` for CI.
82
+
83
+ **Renamed, and completed to all four directions.** Chevrons and arrows are the
84
+ one family whose _meaning is_ its direction, and that direction is physical, not
85
+ logical — a chevron in a details marker points down in every writing mode. So they
86
+ are named for where they point: `expand-more`/`expand-less` →
87
+ `chevron-down`/`chevron-up`, and `arrow-forward`/`arrow-back` →
88
+ `arrow-right`/`arrow-left`. `chevron-left`/`chevron-right` keep their names.
89
+ `arrow-up`/`arrow-down` are new, so both families now cover all four directions.
90
+ `lightning` is new.
91
+
92
+ If you passed any of the old names to `<Icon />`, `resolveIcon` or an `icons`
93
+ config, update them. They fail loudly rather than silently: an unresolvable
94
+ declared name throws, and `vitops icons` reports scanned ones.
95
+
96
+ **Fixed three Font Awesome mappings that named no real glyph** and so rendered an
97
+ empty box: `login`/`logout` were mapped to `login`/`logout` (Font Awesome calls
98
+ them `right-to-bracket`/`right-from-bracket`) and `backup` to `backup`
99
+ (`cloud-arrow-up`). Every value in all four UI sets is now checked against the
100
+ installed collection.
101
+
102
+ **Phosphor (`ph`) joins the semantic map**, with all 83 names verified against the real icon set.
103
+ Phosphor keeps every weight in one collection and varies the name (`list`, `list-bold`), unlike Font
104
+ Awesome's per-weight collections, so `resolveIcon` and `generateIconInclude` gained a `weight`
105
+ option for sets shaped that way.
106
+
107
+ Fixes: `site.icons` was a closed object, so any icon collection not in its hand-written key list was
108
+ silently dropped during validation — your config passed and the icons never bundled. It accepts any
109
+ collection name now.
110
+
111
+ - bf453b0: `vitops lint` now catches hand-written CSS that re-implements a framework primitive.
112
+
113
+ The existing linter finds classes that resolve to nothing — you named something and it isn't there.
114
+ This is the costlier inverse, where the code **works**: a centred container written by hand, a
115
+ two-column split behind a media query, a flex row. Nothing is broken, so nothing ever surfaces it,
116
+ and the design system quietly stops being where those decisions live.
117
+
118
+ Three rules to start, each requiring the combination that makes the intent unambiguous
119
+ (`margin-inline: auto` alone is not a centred track):
120
+
121
+ | Found | Suggested |
122
+ | ----------------------------------------------------------- | ------------------------------------------------------------------------- |
123
+ | `max-inline-size: var(--width-*)` + `margin-inline: auto` | `.centered`, widening a child with `breakout` / `spotlight` / `fullbleed` |
124
+ | `grid-template-columns: 1fr 2fr` inside a `min-width` query | `md-split-1-2` — or `@md:split-1-2` in the tailwind format |
125
+ | `display: flex` + `align-items: center` | `flex items-center`, or `.cluster-start` |
126
+
127
+ **Findings now carry a severity, and suggestions do not fail the command.** These are judgement
128
+ calls, and a reuse hint that broke CI on the day it shipped would be a worse defect than the drift it
129
+ reports. `--strict` promotes them for anyone who wants the ratchet. Everything the linter reported
130
+ before is an `error` and still exits 1.
131
+
132
+ `.css` files and `<style>` blocks are now read (the class linter only ever looked at markup). The
133
+ generated stylesheet is skipped by its `GENERATED … do not edit by hand` banner rather than by path —
134
+ the `css` format writes `styles.css` into `src/styles`, squarely inside what `--src` scans, and
135
+ linting it made the framework report `.split` as reinventing `.split`.
136
+
137
+ Two other gaps closed:
138
+ - **The format-spelling check ran in one direction only.** `md-split-1-2` in a tailwind project was
139
+ caught; `@md:split-1-2` in a css/bricks project was not, because variant stripping removed the
140
+ `@md:` regardless of format and left a bare class that matched nothing. The same silent no-op, in
141
+ the other direction, unreported. Stripping is format-aware now.
142
+ - **`grid-auto` and the whole `m-*` rhythm family were missing from the tailwind format entirely** —
143
+ not dropped via `TW_CLASH`, just never re-emitted when `layout.css` is skipped and a subset
144
+ re-emitted in its place. Unlike the `<bp>-` classes they have no Tailwind equivalent, and unlike a
145
+ misspelt class the linter cannot flag them, because they aren't anchored to your config. They emit
146
+ as `@utility` definitions now, keyed to the same `--rhythm-*` variables as the css format.
147
+
148
+ Run against this repo's own docs site, the rules found one real instance on the first pass; it is
149
+ fixed in the same change.
150
+
151
+ - bf453b0: Maskable favicons are now opaque, so they stop rendering as a logo in a black box.
152
+
153
+ `icon-mask.png` is declared `purpose: "maskable"` and `apple-touch-icon.png` is linked on every
154
+ page. Both sit a deliberately-inset logo on a larger canvas — that inset **is** the maskable safe
155
+ zone and was always correct — but the canvas was filled with `alpha: 0`. From any transparent
156
+ source that left 36% of `icon-mask.png` and 40% of `apple-touch-icon.png` transparent, on two files
157
+ whose entire contract is full bleed: the OS crops them to its own shape and composites the rest onto
158
+ whatever it likes, usually black. iOS discards alpha on the apple-touch-icon outright.
159
+
160
+ `backgroundColor` was already the obvious input for this and already plumbed — as far as the web
161
+ manifest, and no further. So the raster and the manifest disagreed about the very colour meant to
162
+ sit behind the icon.
163
+
164
+ Now:
165
+ - those two outputs are composited onto `backgroundColor`, defaulting to `#ffffff` — the same
166
+ default the manifest's `background_color` already used;
167
+ - `favicon.svg`, `icon-{16,32,192,512}.png` and `favicon.ico` keep the source's transparency, since
168
+ none of them is maskable;
169
+ - a transparent source with no `backgroundColor` set now warns, rather than silently inheriting
170
+ white — a dark logo would lose against it;
171
+ - `icon-192`/`icon-512` declare `purpose: "any"` explicitly. Omitting it was legal (unset means
172
+ "any"), but with a maskable present and nothing claiming "any", some launchers picked the maskable
173
+ — the one with the safe-zone inset — for slots that wanted a plain icon.
174
+
175
+ `vitops favicon` gained `--background <hex>`; it previously had no way to set this at all.
176
+ `getvitops({ favicon })` and the Vite plugin now forward the option they were already accepting.
177
+
178
+ ### Patch Changes
179
+
180
+ - bf453b0: Say plainly that `fonts` in `design-system.json` is stacks only and loads nothing.
181
+
182
+ The field's description was complete and self-consistent — "raw font stacks by name, emitted as
183
+ `--font-<name>` tokens" — and told you nothing about where the `@font-face` comes from. Following
184
+ it literally leads to installing a `@fontsource*` package and importing its CSS in a layout, which
185
+ renders correctly and silently gives up subsetting, preload, and the `size-adjust` /
186
+ `ascent-override` fallback metrics: a CLS regression that looks like a working setup.
187
+
188
+ The field is unchanged. What changed is that four surfaces now name the boundary and point at the
189
+ fix — declare the family in Astro's `fonts:` config and point the token at its `cssVariable`:
190
+ - the `fonts` description in the JSON Schema, and therefore `vitops docs authoring`
191
+ - `SKILL.md`, which previously never mentioned fonts at all
192
+ - the generated `tailwind.css` header and its `@theme` fonts comment
193
+ - the generated `type-tokens.css` header (css format)
194
+
195
+ - Updated dependencies [4756788]
196
+ - Updated dependencies [bf453b0]
197
+ - Updated dependencies [bf453b0]
198
+ - Updated dependencies [bf453b0]
199
+ - Updated dependencies [bf453b0]
200
+ - Updated dependencies [bf453b0]
201
+ - Updated dependencies [bf453b0]
202
+ - Updated dependencies [bf453b0]
203
+ - Updated dependencies [bf453b0]
204
+ - Updated dependencies [04a51d8]
205
+ - Updated dependencies [bf453b0]
206
+ - Updated dependencies [bf453b0]
207
+ - Updated dependencies [bf453b0]
208
+ - Updated dependencies [bf453b0]
209
+ - Updated dependencies [bf453b0]
210
+ - Updated dependencies [bf453b0]
211
+ - Updated dependencies [bf453b0]
212
+ - Updated dependencies [bf453b0]
213
+ - Updated dependencies [bf453b0]
214
+ - @getvitops/generator@2.0.0
215
+ - @getvitops/utils@2.0.0
216
+
3
217
  ## 1.0.0
4
218
 
5
219
  ### Major Changes
package/README.md CHANGED
@@ -26,6 +26,11 @@ npx vitops generate --format bricks,css --out dist
26
26
  | `vitops agents [-o AGENTS.md] [--docs-dir <dir>]` | link the agent skill + AGENTS.md pointer |
27
27
  | `vitops docs [topic] [--all]` | print live reference docs to stdout |
28
28
 
29
+ Every `--input` takes a `design-system.json` **or** the larger site config that embeds one
30
+ (`company.json` / `site.json`) — told apart by shape, so name the file whatever you like. Add
31
+ `--theme <name>` to build a `designSystem.themes` entry other than the default. `vitops validate`
32
+ routes the same way and checks a site config as a site config.
33
+
29
34
  ## Using the output
30
35
 
31
36
  **Tailwind / Astro (EmDash).** Generate into your styles dir and import it (Tailwind v4):