@getvitops/create 0.7.0 → 0.8.1

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 (36) hide show
  1. package/CHANGELOG.md +443 -6
  2. package/package.json +2 -3
  3. package/templates/emdash/.agents/skills/promote/SKILL.md +24 -7
  4. package/templates/emdash/.astro/types.d.ts +3 -0
  5. package/templates/emdash/.claude/hooks/session-start.sh +0 -0
  6. package/templates/emdash/.github/workflows/backmerge.yml +18 -0
  7. package/templates/emdash/.github/workflows/deploy-prod.yml +1 -1
  8. package/templates/emdash/.github/workflows/refresh-dev.yml +25 -0
  9. package/templates/emdash/.node-version +1 -0
  10. package/templates/emdash/AGENTS.md +51 -9
  11. package/templates/emdash/README.md +15 -4
  12. package/templates/emdash/SETUP.html +103 -0
  13. package/templates/emdash/astro.config.mjs +47 -4
  14. package/templates/emdash/package.json +15 -11
  15. package/templates/emdash/pnpm-lock.yaml +183 -0
  16. package/templates/emdash/pnpm-workspace.yaml +1 -1
  17. package/templates/emdash/public/_headers +10 -0
  18. package/templates/emdash/scripts/build-dev-wrangler.mjs +6 -0
  19. package/templates/emdash/scripts/refresh-dev.mjs +182 -0
  20. package/templates/emdash/seed/seed.json +104 -5
  21. package/templates/emdash/site.json +77 -2
  22. package/templates/emdash/src/layouts/Layout.astro +7 -1
  23. package/templates/emdash/src/pages/404.astro +5 -0
  24. package/templates/emdash/src/pages/[...slug].astro +15 -2
  25. package/templates/emdash/src/pages/index.astro +15 -2
  26. package/templates/emdash/vite.config.ts +18 -4
  27. package/templates/emdash/wrangler.jsonc +4 -0
  28. package/templates/static/.github/workflows/backmerge.yml +18 -0
  29. package/templates/static/.github/workflows/deploy-prod.yml +1 -1
  30. package/templates/static/.node-version +1 -0
  31. package/templates/static/AGENTS.md +9 -9
  32. package/templates/static/SETUP.html +103 -0
  33. package/templates/static/package.json +6 -6
  34. package/templates/static/pnpm-workspace.yaml +21 -0
  35. package/templates/static/public/_headers +10 -0
  36. package/templates/static/site.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,443 @@
1
1
  # @getvitops/create
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Both templates pin Node by major only (`devEngines.runtime.version: "24"`), matching `.node-version`. The exact `24.18.0` pin disagreed with the floating `.node-version`, so `vp` warned in every fresh scaffold.
8
+
9
+ ## 0.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 226b1aa: **Content now lives in production; dev is a refreshed copy.** The `dev → main` flow is for code,
14
+ pages and `site.json`. EmDash content is edited on the production site (drafts, "Publish changes"
15
+ and preview links are the staging step), and the dev database is disposable and refreshed _from_
16
+ prod — never promoted back. Both templates gain a hotfix path back into `dev`.
17
+
18
+ - **New `refresh-dev.yml` (emdash template) + `scripts/refresh-dev.mjs`** — copies prod's D1
19
+ database into `<name>-dev` (weekly and on demand), and prod's R2 bucket too when the optional
20
+ `R2_ACCESS_KEY_ID` / `R2_SECRET_ACCESS_KEY` repo secrets are set. It drops every table in its
21
+ target, so it refuses a database that isn't `*-dev`, doesn't match `DEV_D1_ID`, or is
22
+ production's. **Overwrites everything in the dev database on each run** — content edited on dev
23
+ is lost by design.
24
+ - **New `backmerge.yml` (both templates)** — on every push to `main`, opens a `main → dev` PR when
25
+ merging would change `dev`, so a prod hotfix doesn't leave `dev` behind. The PR is left for a
26
+ human to merge unless a `BACKMERGE_TOKEN` secret (PAT / GitHub App token) is set: a merge made
27
+ with the default token triggers no workflows, so Deploy dev would not run.
28
+ - **Magic-link sign-in in the emdash template**: it now registers `cloudflareEmail()` and a
29
+ `send_email` binding named `EMAIL`. A passkey only works at the origin it was registered on, so a
30
+ refreshed dev site would otherwise lock editors out; the cloned users already exist, so the same
31
+ email signs in on both origins. **Existing sites:** templates are copied at scaffold time, so
32
+ nothing changes until you add both yourself, and magic link answers "Email is not configured"
33
+ until you do. Onboard the sender first (`npx vitops email setup send.<your-domain>`) and set
34
+ `from` to an address on that domain — the template ships a placeholder you must replace.
35
+ - **The dev worker no longer has a cron trigger** (`build-dev-wrangler.mjs`), since a refreshed
36
+ database carries prod's scheduled publishes and plugin jobs. Scheduled publishing can't be
37
+ exercised on dev. Set a different `EMDASH_PREVIEW_SECRET` on the dev worker, or prod preview
38
+ links will open drafts there.
39
+ - `SETUP.html` and the `promote` skill describe the new model; `SETUP.html` gains four items under
40
+ "3. Hosting resources" (the OAuth apps and preview secret are manual).
41
+
42
+ No consumer-facing change in `@getvitops/core`, `@getvitops/generator`, `@getvitops/utils`,
43
+ `@getvitops/cli`, `@getvitops/vite`, `@getvitops/astro` or `@getvitops/emdash`. The reusable
44
+ workflows (`site-refresh-dev.yml`, `site-backmerge.yml`) reach existing client repos only once the
45
+ `v1` tag is moved by `release-workflows.yml`; a client needs the new caller files above to use them.
46
+
47
+ - 0a4f64b: **EmDash template:** documents installing the EmDash agent skills per project
48
+ (`npx skills add emdash-cms/skills --skill '*' -a claude-code -y`, so they match the pinned `emdash`) in
49
+ the README and `AGENTS.md`, and lists the current blocks (hero, cards, accordion, gallery, marquee, …)
50
+ with `npx vitops docs blocks` as the full reference. Raises the dependency floors (`@astrojs/react`
51
+ 7.1, `@astrojs/check` 0.9.12, React 19.3.1) and both templates now pin `pnpm@12.16.1`.
52
+ - c3c1bcb: **New: the design-system editor, mounted inside the EmDash admin.** `vitopsEmdash({
53
+ designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import config from
54
+ './site.json' with { type: 'json' }`) adds a `/design-system` admin page mounting
55
+ `<wc-theme-editor>` — the same live token editor `@getvitops/vite`'s dev server has always
56
+ offered, now usable by the client directly, no dev server required. An edit is visible
57
+ site-wide immediately (a runtime `:root` override, served via a new plugin API route and
58
+ `page:fragments`) and — once `site.deployment.repo`/`branch` and a `VITOPS_GITHUB_TOKEN`
59
+ secret are set (see the scaffold's `SETUP.html`) — auto-commits to your `dev` branch, so it
60
+ reaches the git-tracked `site.json` through your repo's normal review path rather than
61
+ becoming a second, unreviewed source of truth. Until that's configured, the live half still
62
+ works; only the auto-commit half is skipped (and says so in the admin page). The save route
63
+ runs the exact same accessibility (APCA contrast) gate `generate()` enforces at build time,
64
+ synchronously, before persisting — nothing non-compliant ever goes live even momentarily.
65
+
66
+ Requires `@astrojs/react` + `react` + `react-dom` (already scaffold dependencies, for
67
+ EmDash's own admin) and `@getvitops/core` (added as a new scaffold dependency this release).
68
+ Declares two new plugin capabilities when enabled: `network:request` (for the GitHub
69
+ auto-commit) and `hooks.page-fragments:register` (for the live override) — reviewed once at
70
+ plugin-install time.
71
+
72
+ **Breaking for `@getvitops/emdash`**: `vitopsEmdash()`'s `hooks.page-fragments:register`
73
+ capability is now also granted whenever `designSystemEditor` is set, independent of the
74
+ existing `scripts: 'fragments'` option (which governs something unrelated — web-component
75
+ script delivery). No change if you don't use `designSystemEditor`.
76
+
77
+ Also new, supporting the above:
78
+
79
+ - `@getvitops/generator`: `validateColorContract()` and `buildReverseIndex()` (both
80
+ `/tokens` subpath, Worker-safe) — the monotonicity/contrast gate and the
81
+ `design-manifest.json` reverse-index, each extracted from `generate()`'s `build()` into
82
+ standalone, non-throwing functions. `patchToOverrideCss()` turns a design-system patch
83
+ into the `:root` override `<style>` block. `designSystemPath`/`getAt`/`setAt`/
84
+ `mergePatch`/`formatConfig` moved from `@getvitops/vite` into `@getvitops/generator/config`
85
+ (re-exported from `@getvitops/vite` unchanged) — one "patch a config file's design-system
86
+ subtree" implementation shared by the dev endpoint and the new plugin route. New
87
+ `site.deployment.repo`/`branch` config fields.
88
+ - `@getvitops/utils`: new `/git` subpath — `commitFile()`, a Worker-safe (fetch-only)
89
+ wrapper over GitHub's Contents API.
90
+ - `@getvitops/core`: `<wc-theme-editor>` gains a `save-endpoint` attribute (default
91
+ unchanged — `/__vitops/design-system`) so the same element can target the new plugin
92
+ route instead of the dev-only Vite endpoint.
93
+
94
+ - 2ef2d41: **Tested against EmDash 1.4.** `emdash` and `@emdash-cms/cloudflare` are now `^1.4.0` in the
95
+ `emdash` template, and `@getvitops/emdash`'s peer ranges for both moved from `>=1.0.0 <2` to
96
+ `>=1.3.0 <2` — **breaking for a site still on EmDash 1.0–1.2**: upgrade `emdash` and
97
+ `@emdash-cms/cloudflare` together (EmDash warns at build when the two differ) before upgrading
98
+ this package. 1.4 fixes a stored XSS in the visual-editing toolbar (an author's published content
99
+ could run script for a signed-in editor), so an existing client site should take it promptly.
100
+
101
+ - **`vitopsHosting()` coalesces D1 reads by default** — new `cloudflare.coalesce` option
102
+ (default `true`, passed to `d1({ coalesce })`). With `session: 'auto'`, EmDash 1.3 stops
103
+ preloading settings/menus/widgets for logged-out visitors unless reads are coalesced, so this
104
+ restores one round trip instead of several. It is experimental upstream: a read and a write
105
+ started together may run write-first, so `await` a read before a write that must not affect it.
106
+ Set `coalesce: false` to opt out. No effect without a session.
107
+ - **Template:** `AGENTS.md` gains an "EmDash 1.x behaviours" section (passkeys are bound to a
108
+ hostname so use _Change domain_ at cutover; admin-authored HTML blocks run JS and conflict with
109
+ Astro CSP; link by `entry.data.slug`, not `entry.id`; submit `/sitemap.xml`; clearing a stuck D1
110
+ lock with `emdash migrate --take-over-lock`).
111
+ - **Upstream behaviour changes to know about (no code change here):** `cacheHint.lastModified` is
112
+ no longer auto-populated and pages lose the implicit `Cache-Control: no-cache`; collection
113
+ sitemaps paginate at 2,000 entries; `entry.id` is always locale-prefixed on multilingual sites.
114
+
115
+ No consumer-facing change in `@getvitops/core`, `@getvitops/generator`, `@getvitops/utils`,
116
+ `@getvitops/cli` or `@getvitops/vite`. `@getvitops/astro` has one — see the scaffold changeset.
117
+
118
+ - ab451ae: **Scaffolds now pin Astro `^7.4.4` and ship a `.node-version`.** Both templates (`emdash`, `static`)
119
+ move from `astro: ^7.1.2` to `^7.4.4` — the newest release at least three days old when this was
120
+ chosen (7.4.5 was under a day old), matching what this repo builds and tests against — and add a
121
+ `.node-version` containing `24`, so version managers that read it (fnm, mise, asdf, Volta) agree with
122
+ the `.nvmrc` the reusable CI workflows read and the `devEngines` pin pnpm reads. `templates.test.ts`
123
+ now fails if those three disagree, or if a template's Astro range drifts from the repo's catalog.
124
+
125
+ Existing projects are not changed: bump `astro` yourself, and add `.node-version` if you want it.
126
+
127
+ Formats reached: none — no CSS change. Other packages in the `fixed` group: No consumer-facing change
128
+ in this package.
129
+
130
+ - b70c7f0: **Scaffolded projects now hold new releases for 3 days before installing them.** Both templates set
131
+ `minimumReleaseAge: 4320` (the `emdash` template was 1440; the `static` template had no
132
+ `pnpm-workspace.yaml` and so used pnpm's one-day default). The `static` template now ships a
133
+ `pnpm-workspace.yaml` carrying the cooldown, the build approvals, and the same toolchain exemptions as
134
+ `emdash` — `@getvitops/*` and the Vite+ / Oxc tools are exempt, since they release together.
135
+
136
+ If a fresh install in a scaffolded project is rejected for a dependency published in the last three
137
+ days, wait for it to age or add its exact version to `minimumReleaseAgeExclude`. Existing projects are
138
+ not changed.
139
+
140
+ Formats reached: none — no CSS change. Other packages in the `fixed` group: No consumer-facing change
141
+ in this package.
142
+
143
+ ### Patch Changes
144
+
145
+ - 0574388: Add `vitops email setup|check` — connect `site.notifications.email.from` to whether its domain is
146
+ actually onboarded onto an outbound email provider.
147
+
148
+ Before this, nothing checked that. `EMAIL.send()` throws `E_SENDER_NOT_VERIFIED` at runtime with no
149
+ build or deploy-time warning — the failure mode is silent and production-only.
150
+
151
+ `vitops email setup [domain]` onboards a sending domain (currently Cloudflare Email Sending only)
152
+ and polls DNS until its SPF/DKIM/DMARC records resolve or a timeout is reached; `vitops email
153
+ check` is the non-blocking deploy guard both `@getvitops/create` templates' `deploy`/`deploy:dev`
154
+ scripts now run first (`--strict` makes it a real gate; opt out per-site with
155
+ `site.notifications.email.verifySender: false`, or globally with `--skip` /
156
+ `VITOPS_SKIP_EMAIL_CHECK`).
157
+
158
+ Two things worth knowing before running it:
159
+
160
+ - **The onboarded entity is an exact name, and it is usually a subdomain**
161
+ (`send.yourdomain.com`), never the apex your `from` address names. When the exact domain isn't
162
+ onboarded but a sibling in the same zone already is, the command reports that as the fix — send
163
+ from the onboarded subdomain — rather than silently trying to onboard the apex, which rewrites
164
+ `_dmarc.<domain>` and can tighten DMARC policy on every other mail your domain sends.
165
+ - Candidates come from `site.notifications.email.from` (or its derived `noreply@<domains
166
+ .canonical>` default) first; a best-effort scan of `--src` only supplements it, and never guesses
167
+ at a computed `from` value.
168
+
169
+ New `@getvitops/utils/email` subpath and `site.notifications.email.verifySender` config field.
170
+ Needs `CLOUDFLARE_API_TOKEN` with an Email Sending scope in addition to the `Zone:Read` other
171
+ commands already use.
172
+
173
+ - 1a8231d: **EmDash blocks are now a tier of the component manifest, and there are four more of them.**
174
+
175
+ `@getvitops/emdash` adds `vitops.gallery`, `vitops.cards`, `vitops.accordion` and `vitops.marquee`
176
+ (each a thin adapter over the matching `@getvitops/astro` component), and `vitops.carousel` now edits
177
+ its slides as a **Slides repeater** instead of two newline-separated fields. Blocks saved before this
178
+ keep rendering: with no `slides`, the carousel still reads `images`/`alts`, and both legacy fields stay
179
+ in the editor, labelled as legacy. The editor's field type now admits `repeater` and `media_picker`.
180
+
181
+ - **New `blocks` plugin option** — `vitopsEmdash({ blocks: { include, exclude, extra } })`. `include` is
182
+ an allowlist, `exclude` drops blocks, `extra` adds the site's own **editor** definitions (the site
183
+ supplies their renderers via `<PortableText components={{ type }}>`, the same route that overrides a
184
+ `vitops.*` renderer). An unknown name or a colliding `type` throws at plugin construction.
185
+ - Link and image URLs in blocks with a scheme other than `http`, `https`, `mailto` or `tel` are
186
+ dropped (see the security entry).
187
+
188
+ `@getvitops/generator`: `TierEntry` gains an optional `emdash: string[]` (block `_type`s) and `Tier`
189
+ gains `'emdash'`, so `tierPatterns('emdash')` projects it. **Breaking only for code that exhaustively
190
+ switches on `Tier` or builds a `Record<Tier, …>`** — add an `emdash` case. The agent doc
191
+ `vitops docs components` gains an "EmDash blocks" table and the docsite a `components/emdash` page. The
192
+ guard that every block and every `emdash` entry agree lives in `@getvitops/emdash`'s `blocks.test.ts`,
193
+ because the generator cannot import the plugin.
194
+
195
+ `@getvitops/create`: the EmDash template's agent guidance explains the blocks, their limits (a block
196
+ cannot contain blocks; `vitops.*` blocks do not render inside EmDash's built-in `columns`) and the
197
+ `blocks` option.
198
+
199
+ Formats reached: none — no CSS change. Other packages in the `fixed` group: No consumer-facing change
200
+ in this package.
201
+
202
+ - 779d22e: Add a `vitops.hero` EmDash block (eyebrow, heading, text, two links, optional image; centered or split layout) built on the `.centered`/`.split` layout primitives. The EmDash template's home page now seeds one of each of hero, cards, accordion and marquee. `@getvitops/generator`: the `split` pattern lists the new block in `TIERS`.
203
+ - 0574388: Bump `emdash`/`@emdash-cms/cloudflare` peers to `>=1.0.0 <2` and `vite-plus` to `^1.0.0`, following
204
+ both projects' GA releases.
205
+
206
+ **Breaking for `@getvitops/emdash` consumers on EmDash 0.x**: the peer range no longer admits
207
+ `emdash@0.31.x`/`@emdash-cms/cloudflare@0.31.x`. Upgrade `emdash` and `@emdash-cms/cloudflare` to
208
+ `^1.0.1` first — nothing in `@getvitops/emdash`'s own plugin surface (`admin.portableTextBlocks`,
209
+ the `hooks.page-fragments:register` capability, `definePlugin()`) changed against EmDash 1.0, so no
210
+ code here needed to change, only the declared range.
211
+
212
+ The `emdash` scaffold template (`vp create @getvitops:emdash`) picks up several fixes alongside
213
+ the version bump:
214
+
215
+ - `tailwindcss`/`@tailwindcss/vite` are now real dependencies — the template selected
216
+ `css.format: 'tailwind'` without installing either, which threw on build.
217
+ - `site.json` now sets `site.icons.sprite: true` plus the full `semantic` list the
218
+ `vitops.actionLink` block's icon picker offers — previously its sprite icons pointed at a file
219
+ the build never generated.
220
+ - `astro.config.mjs` sets `migrations: { runtime: 'check', dev: 'auto' }`, and
221
+ `site-deploy-emdash.yml` runs EmDash 1.0's documented `build → status → apply → deploy → check`
222
+ migration sequence explicitly, rather than relying solely on first-request auto-migration. This
223
+ needs a new GitHub Environment variable, `EMDASH_TARGET_FINGERPRINT` (one per environment),
224
+ which only a human can set — run `emdash migrate --status` against the real deployed database,
225
+ review the printed identity, then `gh variable set EMDASH_TARGET_FINGERPRINT --env <env> --body
226
+ <value>`. Deploys fail clearly on the migration-apply step until it's set.
227
+ - `lint.options.typeAware`/`typeCheck` in the template's own `vite.config.ts` are commented out,
228
+ not deleted: vite-plus 1.0 only honours that option in a project's actual root config, and hard
229
+ errors on it in a nested one (which this file is, sitting inside the `design-system` monorepo).
230
+ Uncomment it once scaffolded into its own repo.
231
+
232
+ No config schema changes. `@getvitops/generator` also switches from the `zod/mini` subpath import
233
+ to the standalone `@zod/mini` package (zod 4.5+; same API) and fixes `validateConfig()` silently
234
+ losing the offending key name on an `unrecognized_keys` error (e.g. a typo'd `site.ads` platform
235
+ now names the bad key instead of reporting a bare "Invalid input").
236
+
237
+ Also fixed: `vp check`'s `tsconfig-error` for `packages/create/templates/emdash/tsconfig.json`
238
+ (`extends: "astro/tsconfigs/strict"`, unresolvable from inside this monorepo since the template
239
+ has no `node_modules` of its own — a pre-existing, structural gap, newly surfaced as a hard error
240
+ by oxlint 1.85's deeper config discovery, and blocking on every commit since this repo's pre-commit
241
+ hook runs `vp check --fix`). Fixed with a new `scripts/link-template-deps.mjs`, wired as the root
242
+ `postinstall` script: symlinks `astro`/`emdash`/`@emdash-cms/cloudflare` into the template's own
243
+ `node_modules/` (resolved fresh from sibling packages that already depend on them for real, not a
244
+ hardcoded `.pnpm` hash) and writes a minimal `astro:content` ambient shim at `.astro/types.d.ts`
245
+ (the same path `astro sync` would generate for real). Both are gitignored and only ever exist
246
+ inside this monorepo's copy of the template — a real scaffold installs its own real copies instead.
247
+ Considered and rejected first: inlining astro's strict preset (drift risk against astro's own
248
+ evolving default) and making the template a real pnpm workspace member (would change how its
249
+ `@getvitops/*: "latest"` deps resolve locally, which `templates.test.ts` exists to protect).
250
+
251
+ **Known gap, not fixed here**: `packages/astro/src/components/container.test.ts` (the
252
+ `AstroContainer`-based render tests) fails to even load under vite-plus 1.0's Vite 8 — direct
253
+ `.astro` imports in a Vitest file need the Astro Vite plugin registered, which nothing in this
254
+ repo's test config actually does (Astro's own docs call for `getViteConfig()`, which doesn't
255
+ compose with vite-plus's own `defineConfig`). A type-level shim
256
+ (`packages/astro/src/components/astro-modules.d.ts`) fixes `vp check`'s type-aware pass, but the
257
+ runtime `vp test` failure for this one file is still open.
258
+
259
+ - 0f8c018: **New: `resolveOrganizationName(config, locale?)`**, exported from `@getvitops/astro/routes`
260
+ alongside `toNotifyContext`/`toCrmConfig` — the same `organization.name` → `legalName` →
261
+ `undefined` fallback chain `toNotifyContext` already used for its `organizationName` field,
262
+ now usable standalone anywhere a build-time-only display name is needed (favicon generation,
263
+ a scaffold's `astro.config.mjs`, a `Layout.astro` fallback). `toNotifyContext` is unchanged —
264
+ it now delegates to this helper internally.
265
+
266
+ The emdash scaffold uses it to remove a three-way duplicated `'My EmDash Site'` string:
267
+ `astro.config.mjs`'s favicon `name` and `Layout.astro`'s title fallback both previously
268
+ hardcoded it independently of `site.json`'s `organization.name`. EmDash's own
269
+ `getSiteSettings().title` (set in the admin) still wins at render time when it's set — it's a
270
+ runtime-only fact that can't be read at build time at all — this only replaces the two
271
+ hardcoded _fallback_ strings.
272
+
273
+ - 2ef2d41: **`resolveOrganizationName()` accepts a plain `import site from './site.json'`.** It was typed
274
+ against the full `Config`, which a JSON import cannot satisfy — TypeScript widens its literals
275
+ (`colors.utilities` becomes `string[]`, not the schema's union) — so every scaffolded site's
276
+ `Layout.astro` failed `astro check`. It now takes `OrganizationNameSource`, the slice it actually
277
+ reads (`organization.name` / `legalName`, `site.defaultLocale`); a resolved `Config` still
278
+ satisfies it, so nothing that compiled before stops compiling.
279
+
280
+ **Both templates now typecheck and lint clean on a fresh scaffold**, found by the new `scaffold`
281
+ CI job (it installs each template against this checkout's packed packages):
282
+
283
+ - `site.json` declares `neutral` and `surface` as `{ "hue": "ink", "kind": "surface" }`. As bare
284
+ hue strings they were chromatic roles, which emit no bare `bg-neutral` and no
285
+ `text-neutral-muted`, so the template's own footer class resolved to nothing and `vitops lint
286
+ --strict` (run by the template's pre-commit hook) failed. **Existing sites are unaffected** —
287
+ this changes only what a new scaffold starts with; if your own `site.json` has the same two
288
+ lines and uses `text-neutral-*` or `bg-surface*`, change them the same way.
289
+ - The `emdash` template's `index.astro` and `[...slug].astro` cast `page.data.title`, which is
290
+ `unknown` until `emdash types` has run against a live site, so `astro check` passed only after
291
+ the first `pnpm dev`.
292
+
293
+ No consumer-facing change in `@getvitops/core`, `@getvitops/generator`, `@getvitops/utils`,
294
+ `@getvitops/cli` or `@getvitops/vite`.
295
+
296
+ - 80bbef1: Both templates ship `public/_headers` with a no-break security baseline (`X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`, `X-Frame-Options: SAMEORIGIN`), applied by Workers static assets. No CSP: `<Head />` emits inline scripts, so a policy needs per-site nonces or hashes. Note `_headers` covers static assets only; for the EmDash template's Worker-rendered pages, add headers in the Worker.
297
+
298
+ ## 0.8.0-alpha.0
299
+
300
+ ### Minor Changes
301
+
302
+ - c3c1bcb: **New: the design-system editor, mounted inside the EmDash admin.** `vitopsEmdash({
303
+ designSystemEditor: { config } })` (`config` is your `site.json`, e.g. `import config from
304
+ './site.json' with { type: 'json' }`) adds a `/design-system` admin page mounting
305
+ `<wc-theme-editor>` — the same live token editor `@getvitops/vite`'s dev server has always
306
+ offered, now usable by the client directly, no dev server required. An edit is visible
307
+ site-wide immediately (a runtime `:root` override, served via a new plugin API route and
308
+ `page:fragments`) and — once `site.deployment.repo`/`branch` and a `VITOPS_GITHUB_TOKEN`
309
+ secret are set (see the scaffold's `SETUP.html`) — auto-commits to your `dev` branch, so it
310
+ reaches the git-tracked `site.json` through your repo's normal review path rather than
311
+ becoming a second, unreviewed source of truth. Until that's configured, the live half still
312
+ works; only the auto-commit half is skipped (and says so in the admin page). The save route
313
+ runs the exact same accessibility (APCA contrast) gate `generate()` enforces at build time,
314
+ synchronously, before persisting — nothing non-compliant ever goes live even momentarily.
315
+
316
+ Requires `@astrojs/react` + `react` + `react-dom` (already scaffold dependencies, for
317
+ EmDash's own admin) and `@getvitops/core` (added as a new scaffold dependency this release).
318
+ Declares two new plugin capabilities when enabled: `network:request` (for the GitHub
319
+ auto-commit) and `hooks.page-fragments:register` (for the live override) — reviewed once at
320
+ plugin-install time.
321
+
322
+ **Breaking for `@getvitops/emdash`**: `vitopsEmdash()`'s `hooks.page-fragments:register`
323
+ capability is now also granted whenever `designSystemEditor` is set, independent of the
324
+ existing `scripts: 'fragments'` option (which governs something unrelated — web-component
325
+ script delivery). No change if you don't use `designSystemEditor`.
326
+
327
+ Also new, supporting the above:
328
+ - `@getvitops/generator`: `validateColorContract()` and `buildReverseIndex()` (both
329
+ `/tokens` subpath, Worker-safe) — the monotonicity/contrast gate and the
330
+ `design-manifest.json` reverse-index, each extracted from `generate()`'s `build()` into
331
+ standalone, non-throwing functions. `patchToOverrideCss()` turns a design-system patch
332
+ into the `:root` override `<style>` block. `designSystemPath`/`getAt`/`setAt`/
333
+ `mergePatch`/`formatConfig` moved from `@getvitops/vite` into `@getvitops/generator/config`
334
+ (re-exported from `@getvitops/vite` unchanged) — one "patch a config file's design-system
335
+ subtree" implementation shared by the dev endpoint and the new plugin route. New
336
+ `site.deployment.repo`/`branch` config fields.
337
+ - `@getvitops/utils`: new `/git` subpath — `commitFile()`, a Worker-safe (fetch-only)
338
+ wrapper over GitHub's Contents API.
339
+ - `@getvitops/core`: `<wc-theme-editor>` gains a `save-endpoint` attribute (default
340
+ unchanged — `/__vitops/design-system`) so the same element can target the new plugin
341
+ route instead of the dev-only Vite endpoint.
342
+
343
+ ### Patch Changes
344
+
345
+ - 0574388: Add `vitops email setup|check` — connect `site.notifications.email.from` to whether its domain is
346
+ actually onboarded onto an outbound email provider.
347
+
348
+ Before this, nothing checked that. `EMAIL.send()` throws `E_SENDER_NOT_VERIFIED` at runtime with no
349
+ build or deploy-time warning — the failure mode is silent and production-only.
350
+
351
+ `vitops email setup [domain]` onboards a sending domain (currently Cloudflare Email Sending only)
352
+ and polls DNS until its SPF/DKIM/DMARC records resolve or a timeout is reached; `vitops email
353
+ check` is the non-blocking deploy guard both `@getvitops/create` templates' `deploy`/`deploy:dev`
354
+ scripts now run first (`--strict` makes it a real gate; opt out per-site with
355
+ `site.notifications.email.verifySender: false`, or globally with `--skip` /
356
+ `VITOPS_SKIP_EMAIL_CHECK`).
357
+
358
+ Two things worth knowing before running it:
359
+ - **The onboarded entity is an exact name, and it is usually a subdomain**
360
+ (`send.yourdomain.com`), never the apex your `from` address names. When the exact domain isn't
361
+ onboarded but a sibling in the same zone already is, the command reports that as the fix — send
362
+ from the onboarded subdomain — rather than silently trying to onboard the apex, which rewrites
363
+ `_dmarc.<domain>` and can tighten DMARC policy on every other mail your domain sends.
364
+ - Candidates come from `site.notifications.email.from` (or its derived `noreply@<domains
365
+ .canonical>` default) first; a best-effort scan of `--src` only supplements it, and never guesses
366
+ at a computed `from` value.
367
+
368
+ New `@getvitops/utils/email` subpath and `site.notifications.email.verifySender` config field.
369
+ Needs `CLOUDFLARE_API_TOKEN` with an Email Sending scope in addition to the `Zone:Read` other
370
+ commands already use.
371
+
372
+ - 0574388: Bump `emdash`/`@emdash-cms/cloudflare` peers to `>=1.0.0 <2` and `vite-plus` to `^1.0.0`, following
373
+ both projects' GA releases.
374
+
375
+ **Breaking for `@getvitops/emdash` consumers on EmDash 0.x**: the peer range no longer admits
376
+ `emdash@0.31.x`/`@emdash-cms/cloudflare@0.31.x`. Upgrade `emdash` and `@emdash-cms/cloudflare` to
377
+ `^1.0.1` first — nothing in `@getvitops/emdash`'s own plugin surface (`admin.portableTextBlocks`,
378
+ the `hooks.page-fragments:register` capability, `definePlugin()`) changed against EmDash 1.0, so no
379
+ code here needed to change, only the declared range.
380
+
381
+ The `emdash` scaffold template (`vp create @getvitops:emdash`) picks up several fixes alongside
382
+ the version bump:
383
+ - `tailwindcss`/`@tailwindcss/vite` are now real dependencies — the template selected
384
+ `css.format: 'tailwind'` without installing either, which threw on build.
385
+ - `site.json` now sets `site.icons.sprite: true` plus the full `semantic` list the
386
+ `vitops.actionLink` block's icon picker offers — previously its sprite icons pointed at a file
387
+ the build never generated.
388
+ - `astro.config.mjs` sets `migrations: { runtime: 'check', dev: 'auto' }`, and
389
+ `site-deploy-emdash.yml` runs EmDash 1.0's documented `build → status → apply → deploy → check`
390
+ migration sequence explicitly, rather than relying solely on first-request auto-migration. This
391
+ needs a new GitHub Environment variable, `EMDASH_TARGET_FINGERPRINT` (one per environment),
392
+ which only a human can set — run `emdash migrate --status` against the real deployed database,
393
+ review the printed identity, then `gh variable set EMDASH_TARGET_FINGERPRINT --env <env> --body
394
+ <value>`. Deploys fail clearly on the migration-apply step until it's set.
395
+ - `lint.options.typeAware`/`typeCheck` in the template's own `vite.config.ts` are commented out,
396
+ not deleted: vite-plus 1.0 only honours that option in a project's actual root config, and hard
397
+ errors on it in a nested one (which this file is, sitting inside the `design-system` monorepo).
398
+ Uncomment it once scaffolded into its own repo.
399
+
400
+ No config schema changes. `@getvitops/generator` also switches from the `zod/mini` subpath import
401
+ to the standalone `@zod/mini` package (zod 4.5+; same API) and fixes `validateConfig()` silently
402
+ losing the offending key name on an `unrecognized_keys` error (e.g. a typo'd `site.ads` platform
403
+ now names the bad key instead of reporting a bare "Invalid input").
404
+
405
+ Also fixed: `vp check`'s `tsconfig-error` for `packages/create/templates/emdash/tsconfig.json`
406
+ (`extends: "astro/tsconfigs/strict"`, unresolvable from inside this monorepo since the template
407
+ has no `node_modules` of its own — a pre-existing, structural gap, newly surfaced as a hard error
408
+ by oxlint 1.85's deeper config discovery, and blocking on every commit since this repo's pre-commit
409
+ hook runs `vp check --fix`). Fixed with a new `scripts/link-template-deps.mjs`, wired as the root
410
+ `postinstall` script: symlinks `astro`/`emdash`/`@emdash-cms/cloudflare` into the template's own
411
+ `node_modules/` (resolved fresh from sibling packages that already depend on them for real, not a
412
+ hardcoded `.pnpm` hash) and writes a minimal `astro:content` ambient shim at `.astro/types.d.ts`
413
+ (the same path `astro sync` would generate for real). Both are gitignored and only ever exist
414
+ inside this monorepo's copy of the template — a real scaffold installs its own real copies instead.
415
+ Considered and rejected first: inlining astro's strict preset (drift risk against astro's own
416
+ evolving default) and making the template a real pnpm workspace member (would change how its
417
+ `@getvitops/*: "latest"` deps resolve locally, which `templates.test.ts` exists to protect).
418
+
419
+ **Known gap, not fixed here**: `packages/astro/src/components/container.test.ts` (the
420
+ `AstroContainer`-based render tests) fails to even load under vite-plus 1.0's Vite 8 — direct
421
+ `.astro` imports in a Vitest file need the Astro Vite plugin registered, which nothing in this
422
+ repo's test config actually does (Astro's own docs call for `getViteConfig()`, which doesn't
423
+ compose with vite-plus's own `defineConfig`). A type-level shim
424
+ (`packages/astro/src/components/astro-modules.d.ts`) fixes `vp check`'s type-aware pass, but the
425
+ runtime `vp test` failure for this one file is still open.
426
+
427
+ - 0f8c018: **New: `resolveOrganizationName(config, locale?)`**, exported from `@getvitops/astro/routes`
428
+ alongside `toNotifyContext`/`toCrmConfig` — the same `organization.name` → `legalName` →
429
+ `undefined` fallback chain `toNotifyContext` already used for its `organizationName` field,
430
+ now usable standalone anywhere a build-time-only display name is needed (favicon generation,
431
+ a scaffold's `astro.config.mjs`, a `Layout.astro` fallback). `toNotifyContext` is unchanged —
432
+ it now delegates to this helper internally.
433
+
434
+ The emdash scaffold uses it to remove a three-way duplicated `'My EmDash Site'` string:
435
+ `astro.config.mjs`'s favicon `name` and `Layout.astro`'s title fallback both previously
436
+ hardcoded it independently of `site.json`'s `organization.name`. EmDash's own
437
+ `getSiteSettings().title` (set in the admin) still wins at render time when it's set — it's a
438
+ runtime-only fact that can't be read at build time at all — this only replaces the two
439
+ hardcoded _fallback_ strings.
440
+
3
441
  ## 0.7.0
4
442
 
5
443
  ### Minor Changes
@@ -18,7 +456,6 @@
18
456
  `astro.config.mjs`. Not reachable by `vitops lint --fix` — this is the whole migration.
19
457
 
20
458
  Also new in both templates:
21
-
22
459
  - **`SETUP.html`** — a client-onboarding checklist (styled entirely with the framework's own
23
460
  classes, checkbox state in `localStorage`), generated a stylesheet for via the new
24
461
  `pnpm run sop` script.
@@ -266,15 +703,15 @@
266
703
  which `@getvitops/astro` re-exports wholesale. So from `astro.config.mjs`:
267
704
 
268
705
  ```js
269
- import { generateIconInclude } from "@getvitops/astro";
270
- import icon from "astro-icon";
706
+ import { generateIconInclude } from '@getvitops/astro';
707
+ import icon from 'astro-icon';
271
708
 
272
709
  integrations: [
273
710
  icon({
274
711
  include: generateIconInclude({
275
- ui: "fa7-solid",
276
- brand: "simple-icons",
277
- semantic: ["menu", "close", "search", "github"],
712
+ ui: 'fa7-solid',
713
+ brand: 'simple-icons',
714
+ semantic: ['menu', 'close', 'search', 'github'],
278
715
  }),
279
716
  }),
280
717
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/create",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Project templates for the Vitops design system — scaffold wired-up sites with `vp create @getvitops`.",
5
5
  "homepage": "https://docs.vitops.ca",
6
6
  "bugs": "https://github.com/getvitops/design-system/issues",
@@ -19,8 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "vitest": "4.1.9",
23
- "@getvitops/generator": "8.1.0"
22
+ "@getvitops/generator": "8.2.0"
24
23
  },
25
24
  "engines": {
26
25
  "node": ">=24"
@@ -59,12 +59,29 @@ So this skill's only job is to kick off the `dev → main` promotion. It does
59
59
  no further action.
60
60
  - Once `main` advances, **Deploy prod** runs automatically.
61
61
 
62
- ## Schema / content changes
62
+ ## Content is not promoted — it lives in prod
63
+
64
+ Content (entries, media, menus, settings) is edited on the **production** site,
65
+ using drafts, "Publish changes" and preview links as the staging step. The dev
66
+ database is a disposable copy of prod: the **Refresh dev from prod** workflow
67
+ (`refresh-dev.yml`) overwrites it, one direction only. Never try to carry dev
68
+ content to prod — a refresh would erase it anyway.
69
+
70
+ ## Schema changes
63
71
 
64
72
  If this release changes the content model, code promotion is **not** enough —
65
- the schema lives in the EmDash database, not git. Apply the same schema change
66
- to the prod site separately (via its admin at `/_emdash/admin` or its MCP
67
- server at `/_emdash/api/mcp`). Ordering: additive changes (new collection /
68
- optional field) **before** the code deploy that uses them; removals **after**
69
- the code that stops using them. Mention this to the user only if the release
70
- plausibly touched the schema.
73
+ the schema lives in the EmDash database, not git. Rehearse it first: run
74
+ **Refresh dev from prod**, apply the change to dev, check the site. Then apply the
75
+ same change to prod (admin at `/_emdash/admin`, or the MCP server at
76
+ `/_emdash/api/mcp`). Ordering: additive changes (new collection / optional
77
+ field) **before** the code deploy that uses them; removals **after** the code
78
+ that stops using them. Mention this to the user only if the release plausibly
79
+ touched the schema.
80
+
81
+ ## Hotfixing prod
82
+
83
+ A fix that can't wait for dev: branch off `main`, PR into `main`, deploy. The
84
+ **Back-merge main → dev** workflow then opens a `main → dev` PR so dev doesn't
85
+ drift (merge it — that is what triggers a dev deploy — unless
86
+ `BACKMERGE_TOKEN` is set, in which case it merges itself when clean). Conflicts
87
+ are left on the PR for a human.
@@ -0,0 +1,3 @@
1
+ declare module 'astro:content' {
2
+ export function defineLiveCollection(config: unknown): unknown;
3
+ }
File without changes
@@ -0,0 +1,18 @@
1
+ # Carry changes made directly on `main` (a hotfix) back into `dev`, so the
2
+ # integration branch doesn't silently drift from what is live. Runs on every
3
+ # push to `main`, including each promotion, and opens a PR only when merging
4
+ # main into dev would actually change dev.
5
+ #
6
+ # Deploys via the vitops toolchain's reusable workflow — see
7
+ # https://github.com/getvitops/design-system/blob/main/.github/workflows/site-backmerge.yml
8
+ # for why the PR is left for a human unless BACKMERGE_TOKEN is set.
9
+ name: Back-merge main → dev
10
+
11
+ on:
12
+ push:
13
+ branches: [main]
14
+
15
+ jobs:
16
+ backmerge:
17
+ uses: getvitops/design-system/.github/workflows/site-backmerge.yml@v1
18
+ secrets: inherit
@@ -1,7 +1,7 @@
1
1
  # Deploys `main` to production.
2
2
  # `main` should be branch-protected — it then only advances via the Promote
3
3
  # workflow (promote.yml), so a push here always represents promoted code. The
4
- # `production` GitHub Environment (set up by `scripts/init-github.mjs`) has
4
+ # `production` GitHub Environment (set up by `vitops setup repo`) has
5
5
  # required reviewers restricted to admins, so this PAUSES for approval before
6
6
  # deploying.
7
7
  #
@@ -0,0 +1,25 @@
1
+ # Refresh the dev site's database and media from PRODUCTION.
2
+ #
3
+ # Content is edited in prod (drafts + preview links are the staging step); dev
4
+ # holds a disposable copy so code and schema changes can be rehearsed against
5
+ # real data. This only ever copies prod → dev, and refuses to run against a
6
+ # database whose id is production's. Run it before testing a schema change, or
7
+ # let the weekly schedule keep dev from drifting.
8
+ #
9
+ # Deploys via the vitops toolchain's reusable workflow — see
10
+ # https://github.com/getvitops/design-system/blob/main/.github/workflows/site-refresh-dev.yml
11
+ #
12
+ # Required: the same CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID / DEV_D1_ID
13
+ # secrets Deploy dev uses. Optional, for copying media as well:
14
+ # R2_ACCESS_KEY_ID / R2_SECRET_ACCESS_KEY — an R2 API token (S3 credentials)
15
+ name: Refresh dev from prod
16
+
17
+ on:
18
+ workflow_dispatch:
19
+ schedule:
20
+ - cron: '0 6 * * 1'
21
+
22
+ jobs:
23
+ refresh:
24
+ uses: getvitops/design-system/.github/workflows/site-refresh-dev.yml@v1
25
+ secrets: inherit
@@ -0,0 +1 @@
1
+ 24