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