@getvitops/vite 8.2.0-alpha.0 → 8.2.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,12 +1,135 @@
1
1
  # @getvitops/vite
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Patch Changes
6
+
7
+ - c3c1bcb: **New: the design-system editor, mounted inside the EmDash admin.** `vitopsEmdash({
8
+ designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import config from
9
+ './site.json' with { type: 'json' }`) adds a `/design-system` admin page mounting
10
+ `<wc-theme-editor>` — the same live token editor `@getvitops/vite`'s dev server has always
11
+ offered, now usable by the client directly, no dev server required. An edit is visible
12
+ site-wide immediately (a runtime `:root` override, served via a new plugin API route and
13
+ `page:fragments`) and — once `site.deployment.repo`/`branch` and a `VITOPS_GITHUB_TOKEN`
14
+ secret are set (see the scaffold's `SETUP.html`) — auto-commits to your `dev` branch, so it
15
+ reaches the git-tracked `site.json` through your repo's normal review path rather than
16
+ becoming a second, unreviewed source of truth. Until that's configured, the live half still
17
+ works; only the auto-commit half is skipped (and says so in the admin page). The save route
18
+ runs the exact same accessibility (APCA contrast) gate `generate()` enforces at build time,
19
+ synchronously, before persisting — nothing non-compliant ever goes live even momentarily.
20
+
21
+ Requires `@astrojs/react` + `react` + `react-dom` (already scaffold dependencies, for
22
+ EmDash's own admin) and `@getvitops/core` (added as a new scaffold dependency this release).
23
+ Declares two new plugin capabilities when enabled: `network:request` (for the GitHub
24
+ auto-commit) and `hooks.page-fragments:register` (for the live override) — reviewed once at
25
+ plugin-install time.
26
+
27
+ **Breaking for `@getvitops/emdash`**: `vitopsEmdash()`'s `hooks.page-fragments:register`
28
+ capability is now also granted whenever `designSystemEditor` is set, independent of the
29
+ existing `scripts: 'fragments'` option (which governs something unrelated — web-component
30
+ script delivery). No change if you don't use `designSystemEditor`.
31
+
32
+ Also new, supporting the above:
33
+
34
+ - `@getvitops/generator`: `validateColorContract()` and `buildReverseIndex()` (both
35
+ `/tokens` subpath, Worker-safe) — the monotonicity/contrast gate and the
36
+ `design-manifest.json` reverse-index, each extracted from `generate()`'s `build()` into
37
+ standalone, non-throwing functions. `patchToOverrideCss()` turns a design-system patch
38
+ into the `:root` override `<style>` block. `designSystemPath`/`getAt`/`setAt`/
39
+ `mergePatch`/`formatConfig` moved from `@getvitops/vite` into `@getvitops/generator/config`
40
+ (re-exported from `@getvitops/vite` unchanged) — one "patch a config file's design-system
41
+ subtree" implementation shared by the dev endpoint and the new plugin route. New
42
+ `site.deployment.repo`/`branch` config fields.
43
+ - `@getvitops/utils`: new `/git` subpath — `commitFile()`, a Worker-safe (fetch-only)
44
+ wrapper over GitHub's Contents API.
45
+ - `@getvitops/core`: `<wc-theme-editor>` gains a `save-endpoint` attribute (default
46
+ unchanged — `/__vitops/design-system`) so the same element can target the new plugin
47
+ route instead of the dev-only Vite endpoint.
48
+
49
+ - 0574388: Bump `emdash`/`@emdash-cms/cloudflare` peers to `>=1.0.0 <2` and `vite-plus` to `^1.0.0`, following
50
+ both projects' GA releases.
51
+
52
+ **Breaking for `@getvitops/emdash` consumers on EmDash 0.x**: the peer range no longer admits
53
+ `emdash@0.31.x`/`@emdash-cms/cloudflare@0.31.x`. Upgrade `emdash` and `@emdash-cms/cloudflare` to
54
+ `^1.0.1` first — nothing in `@getvitops/emdash`'s own plugin surface (`admin.portableTextBlocks`,
55
+ the `hooks.page-fragments:register` capability, `definePlugin()`) changed against EmDash 1.0, so no
56
+ code here needed to change, only the declared range.
57
+
58
+ The `emdash` scaffold template (`vp create @getvitops:emdash`) picks up several fixes alongside
59
+ the version bump:
60
+
61
+ - `tailwindcss`/`@tailwindcss/vite` are now real dependencies — the template selected
62
+ `css.format: 'tailwind'` without installing either, which threw on build.
63
+ - `site.json` now sets `site.icons.sprite: true` plus the full `semantic` list the
64
+ `vitops.actionLink` block's icon picker offers — previously its sprite icons pointed at a file
65
+ the build never generated.
66
+ - `astro.config.mjs` sets `migrations: { runtime: 'check', dev: 'auto' }`, and
67
+ `site-deploy-emdash.yml` runs EmDash 1.0's documented `build → status → apply → deploy → check`
68
+ migration sequence explicitly, rather than relying solely on first-request auto-migration. This
69
+ needs a new GitHub Environment variable, `EMDASH_TARGET_FINGERPRINT` (one per environment),
70
+ which only a human can set — run `emdash migrate --status` against the real deployed database,
71
+ review the printed identity, then `gh variable set EMDASH_TARGET_FINGERPRINT --env <env> --body
72
+ <value>`. Deploys fail clearly on the migration-apply step until it's set.
73
+ - `lint.options.typeAware`/`typeCheck` in the template's own `vite.config.ts` are commented out,
74
+ not deleted: vite-plus 1.0 only honours that option in a project's actual root config, and hard
75
+ errors on it in a nested one (which this file is, sitting inside the `design-system` monorepo).
76
+ Uncomment it once scaffolded into its own repo.
77
+
78
+ No config schema changes. `@getvitops/generator` also switches from the `zod/mini` subpath import
79
+ to the standalone `@zod/mini` package (zod 4.5+; same API) and fixes `validateConfig()` silently
80
+ losing the offending key name on an `unrecognized_keys` error (e.g. a typo'd `site.ads` platform
81
+ now names the bad key instead of reporting a bare "Invalid input").
82
+
83
+ Also fixed: `vp check`'s `tsconfig-error` for `packages/create/templates/emdash/tsconfig.json`
84
+ (`extends: "astro/tsconfigs/strict"`, unresolvable from inside this monorepo since the template
85
+ has no `node_modules` of its own — a pre-existing, structural gap, newly surfaced as a hard error
86
+ by oxlint 1.85's deeper config discovery, and blocking on every commit since this repo's pre-commit
87
+ hook runs `vp check --fix`). Fixed with a new `scripts/link-template-deps.mjs`, wired as the root
88
+ `postinstall` script: symlinks `astro`/`emdash`/`@emdash-cms/cloudflare` into the template's own
89
+ `node_modules/` (resolved fresh from sibling packages that already depend on them for real, not a
90
+ hardcoded `.pnpm` hash) and writes a minimal `astro:content` ambient shim at `.astro/types.d.ts`
91
+ (the same path `astro sync` would generate for real). Both are gitignored and only ever exist
92
+ inside this monorepo's copy of the template — a real scaffold installs its own real copies instead.
93
+ Considered and rejected first: inlining astro's strict preset (drift risk against astro's own
94
+ evolving default) and making the template a real pnpm workspace member (would change how its
95
+ `@getvitops/*: "latest"` deps resolve locally, which `templates.test.ts` exists to protect).
96
+
97
+ **Known gap, not fixed here**: `packages/astro/src/components/container.test.ts` (the
98
+ `AstroContainer`-based render tests) fails to even load under vite-plus 1.0's Vite 8 — direct
99
+ `.astro` imports in a Vitest file need the Astro Vite plugin registered, which nothing in this
100
+ repo's test config actually does (Astro's own docs call for `getViteConfig()`, which doesn't
101
+ compose with vite-plus's own `defineConfig`). A type-level shim
102
+ (`packages/astro/src/components/astro-modules.d.ts`) fixes `vp check`'s type-aware pass, but the
103
+ runtime `vp test` failure for this one file is still open.
104
+
105
+ - Updated dependencies [65a13cc]
106
+ - Updated dependencies [67e2088]
107
+ - Updated dependencies [89265af]
108
+ - Updated dependencies [0574388]
109
+ - Updated dependencies [c3c1bcb]
110
+ - Updated dependencies [0574388]
111
+ - Updated dependencies [1a8231d]
112
+ - Updated dependencies [779d22e]
113
+ - Updated dependencies [0574388]
114
+ - Updated dependencies [8d8aad7]
115
+ - Updated dependencies [0574388]
116
+ - Updated dependencies [1a3e811]
117
+ - Updated dependencies [0574388]
118
+ - Updated dependencies [dde3df3]
119
+ - Updated dependencies [d9f213b]
120
+ - Updated dependencies [7f4f50e]
121
+ - Updated dependencies [7fd5f8f]
122
+ - Updated dependencies [ceb8310]
123
+ - @getvitops/generator@8.2.0
124
+ - @getvitops/utils@8.2.0
125
+
3
126
  ## 8.2.0-alpha.0
4
127
 
5
128
  ### Patch Changes
6
129
 
7
130
  - c3c1bcb: **New: the design-system editor, mounted inside the EmDash admin.** `vitopsEmdash({
8
- designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import config from
9
- './site.json' with { type: 'json' }`) adds a `/design-system` admin page mounting
131
+ designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import config from
132
+ './site.json' with { type: 'json' }`) adds a `/design-system` admin page mounting
10
133
  `<wc-theme-editor>` — the same live token editor `@getvitops/vite`'s dev server has always
11
134
  offered, now usable by the client directly, no dev server required. An edit is visible
12
135
  site-wide immediately (a runtime `:root` override, served via a new plugin API route and
@@ -67,7 +190,7 @@ designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import c
67
190
  needs a new GitHub Environment variable, `EMDASH_TARGET_FINGERPRINT` (one per environment),
68
191
  which only a human can set — run `emdash migrate --status` against the real deployed database,
69
192
  review the printed identity, then `gh variable set EMDASH_TARGET_FINGERPRINT --env <env> --body
70
- <value>`. Deploys fail clearly on the migration-apply step until it's set.
193
+ <value>`. Deploys fail clearly on the migration-apply step until it's set.
71
194
  - `lint.options.typeAware`/`typeCheck` in the template's own `vite.config.ts` are commented out,
72
195
  not deleted: vite-plus 1.0 only honours that option in a project's actual root config, and hard
73
196
  errors on it in a nested one (which this file is, sitting inside the `design-system` monorepo).
@@ -458,28 +581,20 @@ options, watch behaviour and dev-server endpoints are unchanged.
458
581
  {
459
582
  "designSystem": {
460
583
  "themes": {
461
- "default": {
462
- /* … */
463
- },
584
+ "default": {/* … */},
464
585
  },
465
586
  },
466
587
  "organization": {
467
588
  "name": "Acme",
468
589
  "contact": "hq",
469
590
  "locations": {
470
- "hq": {
471
- /* … */
472
- },
591
+ "hq": {/* … */},
473
592
  },
474
593
  },
475
594
  "site": {
476
595
  "defaultLocale": "en",
477
- "domains": {
478
- /* … */
479
- },
480
- "analytics": {
481
- /* … */
482
- },
596
+ "domains": {/* … */},
597
+ "analytics": {/* … */},
483
598
  },
484
599
  }
485
600
  ```
@@ -559,7 +674,7 @@ options, watch behaviour and dev-server endpoints are unchanged.
559
674
  toolchain bump. Use `--force` when you mean to re-encode.
560
675
 
561
676
  **`ffmpeg` is an external tool, not an npm dependency** — install it yourself (`brew install
562
- ffmpeg`, `apt install ffmpeg`, `winget install Gyan.FFmpeg`). The command fails without it rather
677
+ ffmpeg`, `apt install ffmpeg`, `winget install Gyan.FFmpeg`). The command fails without it rather
563
678
  than skipping: a page referencing a video that was never encoded is broken, not degraded.
564
679
 
565
680
  Two defaults worth knowing about. The MP4 exists because older iOS and the in-app webviews inside
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Format, LegalOutput, designSystemPath, getAt, setAt } from "@getvitops/generator";
2
2
  import { OutputKind } from "@getvitops/utils/media";
3
3
  import { Plugin } from "vite";
4
- //#region src/index.d.ts
5
4
  export interface VitopsMediaOptions {
6
5
  /** Directory of unprocessed video, walked recursively. Default: 'raw'. */
7
6
  raw?: string;
@@ -142,6 +141,5 @@ export interface VitopsLegalOptions {
142
141
  siteEnv?: string;
143
142
  }
144
143
  export default function vitops(options?: VitopsPluginOptions): Plugin;
145
- //#endregion
146
144
  export { designSystemPath, getAt, setAt };
147
145
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;iBA6CiB;;EAEf;;;;;;;EAOA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,UAAU;;EAEV;;iBAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;iBAGe;;;;;;;;;EASf;;;;;;;EAOA;;EAEA,SAAS;;EAET;;EAEA,UAAU;;;;;;;;;;;;;;;;;EAiBV,QAAQ;;;;;;;EAOR;;;;;;;;EAQA;;;;;;;;;EASA,QAAQ;;;;;;;;;;EAUR,OAAO;;;;;;EAMP;;iBAGe;;EAEf;;EAEA;;iBAGe;;;;;EAKf;;EAEA;;EAEA,SAAS;;EAET;;wBAGsB,OAAO,UAAS,sBAA2B"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;iBA6CiB;;EAEf;;;;;;;EAOA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,UAAU;;EAEV;;iBAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;iBAGe;;;;;;;;;EASf;;;;;;;EAOA;;EAEA,SAAS;;EAET;;EAEA,UAAU;;;;;;;;;;;;;;;;;EAiBV,QAAQ;;;;;;;EAOR;;;;;;;;EAQA;;;;;;;;;EASA,QAAQ;;;;;;;;;;EAUR,OAAO;;;;;;EAMP;;iBAGe;;EAEf;;EAEA;;iBAGe;;;;;EAKf;;EAEA;;EAEA,SAAS;;EAET;;wBAGsB,OAAO,UAAS,sBAA2B"}
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { designSystemPath, designSystemPath as designSystemPath$1, formatConfig,
4
4
  import { generateFavicons, writeFaviconManifest } from "@getvitops/utils";
5
5
  import { MEDIA_MANIFEST_PATH, processMedia } from "@getvitops/utils/media";
6
6
 
7
- //#region src/index.ts
7
+ // src/index.ts
8
8
  /**
9
9
  * @getvitops/vite — a Vite plugin that generates Vitops design-system output from a
10
10
  * `design-system.json` (or from the larger site config that embeds one) during a
@@ -167,6 +167,5 @@ function vitops(options = {}) {
167
167
  };
168
168
  }
169
169
 
170
- //#endregion
171
170
  export { vitops as default, designSystemPath, getAt, setAt };
172
171
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/vite",
3
- "version": "8.2.0-alpha.0",
3
+ "version": "8.2.0",
4
4
  "description": "Vite plugin that generates Vitops design-system outputs from a design-system.json during a Vite/Astro build.",
5
5
  "homepage": "https://docs.vitops.ca",
6
6
  "bugs": "https://github.com/getvitops/design-system/issues",
@@ -26,11 +26,11 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@getvitops/generator": "8.2.0-alpha.0",
30
- "@getvitops/utils": "8.2.0-alpha.0"
29
+ "@getvitops/generator": "8.2.0",
30
+ "@getvitops/utils": "8.2.0"
31
31
  },
32
32
  "devDependencies": {
33
- "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0"
33
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "vite": ">=5"