@getvitops/vite 4.0.0 → 5.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,132 @@
1
1
  # @getvitops/vite
2
2
 
3
+ ## 5.0.0
4
+
5
+ > **No consumer-facing change in this package.** `@getvitops/vite` has no source changes in 5.0.0 —
6
+ > it is majored because `core` / `generator` / `utils` / `cli` / `astro` / `vite` share one version
7
+ > and are only supported in matching sets. The notes below are the toolchain's, reproduced in every
8
+ > member's changelog; the behaviour they describe lives in `@getvitops/generator`. Upgrading this
9
+ > package needs no code edit of yours, but the generator changes it runs **do** apply — a config
10
+ > with a dangling `var(--…)` will now fail your build through this plugin.
11
+
12
+ ### Major Changes
13
+
14
+ - **Dangling token references are now a build failure.** `validate()` resolves every `var(--…)` a
15
+ config authors — in `patterns.defaults` / `radii` / `groups` / `items.*.{base,overrides,states}`,
16
+ `typography.roles` and `shadows` — against the tokens that config actually emits. A reference to a
17
+ token that does not exist used to validate, generate, minify and ship, then resolve to nothing in
18
+ the browser: one downstream config shipped a `.cta` whose `color` fell back to `inherit` on a brand
19
+ fill (unreadable text on every filled button), and two of its four dead references had been dead for
20
+ several releases with nothing ever reporting them.
21
+
22
+ The check is deliberately anchored to the namespaces the generator owns — `--color-*`, `--shadow-*`,
23
+ `--z-tier-*`, `--surface-glass`, `--overlay` — the same discipline `vitops lint` follows. A pattern
24
+ may legitimately reference a framework token from `@getvitops/core` or a hook of your own, and
25
+ enumerating "every valid token" would make those false positives. A reference carrying a fallback
26
+ (`var(--x, 0.25rem)`) is never flagged: that is you saying what happens when the token is absent.
27
+ Errors name the config path and suggest the nearest token that does exist.
28
+
29
+ Two related diagnostics ship with it:
30
+ - **Pre-1.0 colour-grammar references are reported as one rename table**, not as a dozen separate
31
+ "no such token" errors — the shape the 3.0 flat-config detector uses, applied to the 1.0 colour
32
+ change. It is built from your own role names, and it says to apply the renames _simultaneously_,
33
+ because several of them rotate (`--surface-bg` → `--color-bg-surface-muted`,
34
+ `--surface-bg-bold` → `--color-bg-surface`) and sequential replacement compounds them.
35
+ - **A surface-shaped role declared chromatic now warns.** A bare hue string is shorthand for
36
+ `kind: "chromatic"`, which emits no bare `--color-bg-<role>` and no `.bg-<role>` — so writing
37
+ `"surface": "ink"` silently removed `--color-bg-surface` and the 36 references the framework's own
38
+ CSS makes to it. Relatedly, `--surface-glass`, `--overlay` and `.glass` are no longer emitted when
39
+ `surface` is chromatic: they read `--color-bg-surface`, so emitting them pointed at nothing.
40
+
41
+ **`vitops lint --fix` is now the migration tool.** It reads `var(--…)` out of CSS and `<style>`
42
+ blocks (not just `class` attributes) and rewrites pre-1.0 token references in a **single pass**, so
43
+ the rotating renames cannot compound. Nothing else is rewritten — every other finding it reports is
44
+ a judgement call. Run it after a major bump.
45
+
46
+ **`--help` works on every subcommand.** `vitops lint --help` used to exit non-zero with
47
+ `Unknown option '--help'`; every leaf subcommand parsed its own argv strictly and none declared the
48
+ option. It is now answered before dispatch, so no command can forget it, and a drift guard fails the
49
+ build if a command has no documented options. (`validate`'s options were genuinely undocumented and
50
+ now are.)
51
+
52
+ **The Astro integration reads `site.tracking` and `site.legal.cookieConsent`.** These drive the
53
+ generated cookie notice, while `vitops({ consent, tracking })` drove the runtime — two hand-synced
54
+ declarations of the same fact with nothing comparing them, so a site could ship a notice naming
55
+ categories its banner never offered, or disclosing an `_ac` cookie no capture script ever wrote, and
56
+ the build was clean. The config blocks are now defaults (as `css` / `fonts` / `favicon` / `ads`
57
+ already were) and a genuine contradiction — `true` against `false` on the same fact — **fails the
58
+ build**, naming both sides. An absent option is not a contradiction; it just takes the config's
59
+ value.
60
+
61
+ Also fixed, each from a downstream report:
62
+ - **`@getvitops/astro/tracking`** re-exports `@getvitops/utils/tracking` (plus `TRACKING_ENDPOINT`),
63
+ so the documented conversion flow works with one install. Under strict pnpm app code cannot
64
+ resolve a transitive dependency, and the obvious workaround — importing the same symbols from the
65
+ package index — is the one that drags the integration's Node builtins toward a Worker bundle. This
66
+ entry and `./routes` are both clean.
67
+ - **`createConversionRoute`'s example was broken on every supported Astro.** It read the binding off
68
+ `locals.runtime.env`, removed in Astro v6, while the package peers on `>= 7` — and because the
69
+ throw precedes the response, Astro re-reads the request and reports a misleading "Body has already
70
+ been used". It also called a `toNotifyContext()` helper that does not exist. The example now uses
71
+ `import { env } from 'cloudflare:workers'` and a plain `NotifyContext`.
72
+ - **`/api/track` is exported as `TRACKING_ENDPOINT`**, and the integration warns at build when
73
+ tracking is on and no route answers it. It was a bare literal inside the inlined capture script:
74
+ name the route file anything else and every `tel:` beacon 404s, conversions vanish, and nothing
75
+ errors anywhere.
76
+ - **`describeEvent` no longer reports "from Unknown"** for forms that don't have a field literally
77
+ named `name`. It now falls back through `first_name`/`last_name`, `full_name`, and finally the
78
+ email address.
79
+ - **`sendEmail` takes `timeoutMs` (default 10s).** `binding.send()` had no deadline, so one hung
80
+ attempt hung the request that produced it — indefinitely, in the one module otherwise built on
81
+ always saying why. A timeout is retried, like any other transient failure.
82
+ - **`vitops search notify` warns when the sitemap's URLs aren't on the configured origin.** A 404
83
+ fails loudly; a well-formed sitemap belonging to someone else did not — a route collision served a
84
+ valid document listing another site's pages and the run reported a healthy submission. Surfaces at
85
+ `--dry`.
86
+ - **`require()` warns when the page has no `<wc-consent>`.** The demand can never be granted, so
87
+ whatever waited on it never runs — silently. Hit by rendering `<Tracking />` on pages where
88
+ `<CookieConsent />` wasn't.
89
+ - **`vitops agents` no longer writes a path it guessed.** It used to warn and then write "tokens
90
+ live in `design-system.json`" into a project whose tokens are in `company.json`, with the four
91
+ emitted `vitops generate` commands hard-coded to match — copy-paste-broken in exactly the projects
92
+ that most need the block to be right. It now finds the config by shape, interpolates the resolved
93
+ path into every emitted command, and fails rather than guessing when there is nothing to name.
94
+ - **`vitops search setup --dry` and `vitops ads setup --dry` run without credentials.** A dry run
95
+ that mutates nothing should not demand the token to mutate; with none set it plans from scratch
96
+ and says so. (`--check` still needs them — drift is a comparison against live state.) Both now
97
+ also mention that the Cloudflare token needs `Zone:Read` alongside `Zone:DNS:Edit` — the
98
+ zone-by-name lookup uses it, and its absence read as "the zone isn't in this account".
99
+ - **`vitops legal` names the files it wrote and flags new ones.** Enabling `cookieConsent` silently
100
+ produced a `cookie-notice` document that then needs a page, a route, a link and a `policyUrl`; the
101
+ command said only "3 files". The review reminder is also printed on the stdout path, where it was
102
+ missing entirely.
103
+ - **`vitops init` writes a versioned `$schema`** — `./node_modules/@getvitops/generator/schema.json`,
104
+ following wrangler — instead of an unpinned unpkg URL that resolved to whatever was newest, so an
105
+ editor validated a pinned project against a schema it wasn't built with.
106
+ - **`favicon.backgroundColor` and `favicon.name` are described accurately.** `backgroundColor` is
107
+ not manifest-only: it fills the opaque `apple-touch-icon.png` and `icon-mask.png`, which are
108
+ written whether or not a manifest is. `name` documents that it and `themeColor` **together** are
109
+ what make a site installable. The missing-background warning now also fires for a dark opaque mark,
110
+ not only a transparent source — `apple-touch-icon` insets the logo and fills the surround either
111
+ way.
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies
116
+ - Updated dependencies
117
+ - Updated dependencies
118
+ - @getvitops/generator@5.0.0
119
+ - @getvitops/utils@5.0.0
120
+
121
+ ## 4.1.0
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [2c890c0]
126
+ - Updated dependencies [e764090]
127
+ - @getvitops/generator@4.1.0
128
+ - @getvitops/utils@4.1.0
129
+
3
130
  ## 4.0.0
4
131
 
5
132
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/vite",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Vite plugin that generates Vitops design-system outputs from a design-system.json during a Vite/Astro build.",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -18,8 +18,8 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@getvitops/generator": "4.0.0",
22
- "@getvitops/utils": "4.0.0"
21
+ "@getvitops/generator": "5.0.0",
22
+ "@getvitops/utils": "5.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "vite": "^6.0.0",