@getvitops/create 0.6.0 → 0.7.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,36 @@
1
1
  # @getvitops/create
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **Breaking (for scaffolds) — both templates now ship `site.json` instead of `design-system.json`.**
8
+
9
+ `design-system.json` is deleted from the `static` and `emdash` templates; its contents move under
10
+ `designSystem.themes.default` inside a new `site.json` (the umbrella `Config`), because a
11
+ scaffolded config can't merely reference a sibling design-system file — `ConfigSchema` requires
12
+ `designSystem` and there is no file-level `extends`. `astro.config.mjs`'s `css.input` (and
13
+ `site.input`, for emdash) now point at `site.json`; so do the `build:css`/`lint:design` scripts.
14
+
15
+ **Migration** for a project already scaffolded from an older version of this template: create
16
+ `site.json` with your existing `design-system.json`'s content under
17
+ `designSystem.themes.default`, delete `design-system.json`, and update `css.input`/`site.input` in
18
+ `astro.config.mjs`. Not reachable by `vitops lint --fix` — this is the whole migration.
19
+
20
+ Also new in both templates:
21
+
22
+ - **`SETUP.html`** — a client-onboarding checklist (styled entirely with the framework's own
23
+ classes, checkbox state in `localStorage`), generated a stylesheet for via the new
24
+ `pnpm run sop` script.
25
+ - **`.agents/skills/setup/SKILL.md`** — lets an AI agent work the same checklist autonomously,
26
+ stopping only at the steps that genuinely need a human (the Cloudflare API token, the
27
+ domain cutover, publishing generated legal documents).
28
+ - `scripts/init-github.mjs` and `scripts/init-hosting.mjs` are deleted; `pnpm run init:github` /
29
+ `init:hosting` / the new `setup` script now call `vitops setup repo` / `vitops setup hosting`
30
+ (from `@getvitops/cli`, requires the `minor` release in the same batch as this one) instead of
31
+ a template-local script, so the same capability now reaches any existing project, not just a
32
+ fresh scaffold.
33
+
3
34
  ## 0.6.0
4
35
 
5
36
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/create",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
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,7 +19,8 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "vitest": "4.1.9"
22
+ "vitest": "4.1.9",
23
+ "@getvitops/generator": "8.1.0"
23
24
  },
24
25
  "engines": {
25
26
  "node": ">=24"
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: setup
3
+ description: Work the client-onboarding checklist (SETUP.html) autonomously — GitHub repo + branch policy, hosting resources, Search Console/GCP/ads connections. Use when the user asks to set up, onboard, or provision this project (e.g. "run setup", "onboard this site", "get this ready to deploy"). Never run this as a side effect of unrelated work, and never on your own initiative without the user asking.
4
+ ---
5
+
6
+ # Setup (client onboarding)
7
+
8
+ `SETUP.html` is the canonical checklist — this skill adds only sequencing,
9
+ gates, and where to stop. It does not restate the steps; read `SETUP.html`
10
+ (or `npx vitops setup --help`) for what each stage actually does and why.
11
+
12
+ ## Steps
13
+
14
+ 1. **Preview the whole sequence first.**
15
+
16
+ ```bash
17
+ npx vitops setup all --dry
18
+ ```
19
+
20
+ Read the plan before doing anything. It names every step it would take and
21
+ why any step is blocked — a missing credential, a field not yet in
22
+ `site.json`, GitHub Pro/Team gating branch protection.
23
+
24
+ 2. **Run it.**
25
+
26
+ ```bash
27
+ npx vitops setup all
28
+ ```
29
+
30
+ Re-run `npx vitops setup --check` after each leg rather than retrying on
31
+ your own judgment — a step already done resolves to a no-op skip, so a
32
+ second run is safe, and `--check` tells you exactly what still needs doing
33
+ instead of you guessing from output.
34
+
35
+ 3. **Tick `SETUP.html` boxes only for what you actually completed.** Never
36
+ check a box for a step marked below as human-only, even if you did
37
+ everything up to it — the human still has to act.
38
+
39
+ ## Hard stops — ask the human, do not attempt
40
+
41
+ - **The Cloudflare API token.** No API can create one; there is no command to
42
+ run. Tell the user to create it at
43
+ <https://dash.cloudflare.com/profile/api-tokens> (Workers + D1 + R2 edit)
44
+ and run `gh secret set CLOUDFLARE_API_TOKEN`, then continue.
45
+ - **The domain cutover** (`vitops setup domain`, stage 4b in `SETUP.html`).
46
+ Uncommenting the custom-domain route and deploying overwrites the zone's DNS
47
+ record at that instant — it takes an existing live site down. `setup domain`
48
+ only ever plans and checks this; it never applies it, and neither should
49
+ you. Report the plan and hand the actual cutover to the user.
50
+ - **Publishing any generated legal document.** `vitops legal` renders a
51
+ starting point from the config, not a reviewed policy. Generate it, tell the
52
+ user it needs review, and stop — do not paste it into the admin or commit it
53
+ yourself.
54
+
55
+ ## If something is blocked
56
+
57
+ `vitops setup --check` names the field or credential and where to get it —
58
+ report that verbatim rather than guessing at a fix. A step reported as
59
+ "blocked" is not a failure to retry; it is waiting on one of the hard stops
60
+ above, or on a `site.json` field the user still needs to fill in (stage 5,
61
+ Configuration).
@@ -3,10 +3,14 @@ styled by the Vitops design system.
3
3
 
4
4
  ## Ground rules
5
5
 
6
- - `design-system.json` is the single source of truth for the design system
7
- (colors, type, spacing, patterns, animations). Never edit
8
- `src/styles/tailwind.css` — it is generated from the JSON by the
9
- `vitops()` integration on every dev/build and is gitignored.
6
+ - `site.json` is the single source of truth — organization + site facts, and
7
+ the design system (colors, type, spacing, patterns, animations) under
8
+ `designSystem.themes.default`. Never edit `src/styles/tailwind.css` — it is
9
+ generated from `site.json` by the `vitops()` integration on every dev/build
10
+ and is gitignored. (There is no separate `design-system.json`: a scaffolded
11
+ config can't merely reference a sibling file, so the token set lives inside
12
+ `site.json` — see `AGENTS.md`'s "Client onboarding" section in the toolchain
13
+ repo for why.)
10
14
  - `src/assets/placeholder/` holds neutral wireframe stand-ins (square,
11
15
  portrait, landscape; SVG + PNG) for layout work before real imagery
12
16
  exists. Delete the directory once real assets land — it's separate from
@@ -74,6 +78,10 @@ styled by the Vitops design system.
74
78
  d1/r2/sqlite there. Switch targets via `vitopsHosting({ target })` or the
75
79
  `HOSTING` env var (see README "Hosting"); the `node` target needs
76
80
  `@astrojs/node` + `better-sqlite3` installed first.
81
+ - **`SETUP.html` is the client-onboarding checklist.** When working it via the
82
+ `.agents/skills/setup/` skill, tick a box only for a step you actually
83
+ completed — never on the operator's behalf for a step marked human-only
84
+ (the Cloudflare API token, the domain cutover, publishing legal documents).
77
85
 
78
86
  ## Branch model
79
87
 
@@ -90,12 +98,12 @@ styled by the Vitops design system.
90
98
  and obviously unfinished; do not "improve" them into something that reads as
91
99
  a finished policy, because the risk here is a plausible-looking document
92
100
  getting shipped unread.
93
- To replace them properly, write a site config and run
94
- `npx vitops legal --format portable-text --out ./legal`, then paste each
95
- document's blocks into the page in the admin. That renders a real policy from
96
- what the site actually does — the analytics provider it uses, the fields its
97
- forms collect, where it deploys — rather than from guesses. It still needs
98
- review before launch.
101
+ To replace them properly, fill in `site.json`'s `organization`/`site.legal`
102
+ fields and run `npx vitops legal --format portable-text --out ./legal`, then
103
+ paste each document's blocks into the page in the admin. That renders a real
104
+ policy from what the site actually does — the analytics provider it uses,
105
+ the fields its forms collect, where it deploys — rather than from guesses.
106
+ It still needs review before launch.
99
107
 
100
108
  ## Docs MCP servers
101
109
 
@@ -112,4 +120,4 @@ searching them over pre-trained knowledge for Astro/EmDash questions.
112
120
  dev default). Only run when the user asks to set up GitHub.
113
121
  - `pnpm run init:hosting` — one-time: provision the hosting platform (dev
114
122
  D1/R2 + repo secrets on cloudflare). Only run when the user asks for it.
115
- - `npx vitops validate design-system.json` — schema-check the design config
123
+ - `npx vitops validate site.json` — schema-check the site config
@@ -10,9 +10,9 @@ Scaffolded from `vp create @getvitops:emdash`.
10
10
  - **Astro** (SSR) on **Cloudflare Workers** — D1 database, R2 media storage
11
11
  - **EmDash** — the admin lives at `/_emdash/admin`; content is queried with
12
12
  `getEmDashCollection` / `getEmDashEntry` (Astro live content collections)
13
- - **`@getvitops/astro`** — generates the design-system CSS from
14
- `design-system.json` (Tailwind v4 format), generates favicons/PWA assets
15
- from `src/assets/logo.svg`, and serves the web-component runtime
13
+ - **`@getvitops/astro`** — generates the design-system CSS from `site.json`
14
+ (Tailwind v4 format), generates favicons/PWA assets from
15
+ `src/assets/logo.svg`, and serves the web-component runtime
16
16
  - **`@getvitops/emdash`** — design-system Portable Text blocks in the editor
17
17
  slash menu: image compare, copy snippet, banner, disclosure, carousel
18
18
 
@@ -42,7 +42,7 @@ Until then the home route shows a friendly empty state. Unknown paths render
42
42
  `src/pages/404.astro`.
43
43
 
44
44
  The two legal pages are placeholders. To generate real ones from what your site
45
- actually does, describe it in a site config and run:
45
+ actually does, fill in `site.json`'s `organization`/`site.legal` fields and run:
46
46
 
47
47
  ```sh
48
48
  npx vitops legal --format portable-text --out ./legal
@@ -82,22 +82,18 @@ The repo ships a two-environment flow modeled on branch = environment:
82
82
  into `main` with auto-merge enabled. With required reviews on `main`, a
83
83
  human approves the PR; merging deploys prod.
84
84
 
85
- One-time setup:
86
-
87
- 1. `pnpm run init:github` — creates a GitHub repo named after this project
88
- (via the `gh` CLI; `-- --public` for a public repo), commits if needed,
89
- pushes `main` + `dev`, and makes `dev` the default branch. Idempotent;
90
- `-- --dry-run` previews. Then branch-protect `main` (require the promotion
91
- PR + review).
92
- 2. `pnpm run init:hosting` — provisions the hosting platform (after
93
- `npx wrangler login`): creates the isolated dev D1 + R2 and sets the
94
- `DEV_D1_ID` / `CLOUDFLARE_ACCOUNT_ID` repo secrets. Idempotent;
95
- `-- --dry-run` previews.
96
- 3. Create a Cloudflare API token (Workers + D1 + R2 edit —
97
- <https://dash.cloudflare.com/profile/api-tokens>; tokens can't be created
98
- via CLI) and `gh secret set CLOUDFLARE_API_TOKEN`. Optionally
99
- `PROMOTE_TOKEN` (a PAT allowed to bypass protection) for hands-off
100
- promotion. The first workflow runs fail until the secrets exist.
85
+ One-time setup — work through the checklist:
86
+
87
+ ```bash
88
+ pnpm run sop && open SETUP.html # or: xdg-open SETUP.html
89
+ ```
90
+
91
+ It covers host choice, GitHub + branch policy, hosting resources, going live
92
+ safely on `*.workers.dev` before any custom-domain cutover, configuration,
93
+ Search Console/GCP/ads connections, legal documents, and launch gates — one
94
+ command per step. An AI agent can work the same list autonomously via
95
+ `.agents/skills/setup/`; it stops at the steps that genuinely need a human
96
+ (the Cloudflare API token, the domain cutover, publishing legal documents).
101
97
 
102
98
  `pnpm deploy:dev` reproduces the dev deploy locally: it rewrites the
103
99
  adapter-generated wrangler config (`scripts/build-dev-wrangler.mjs`) so the
@@ -146,8 +142,10 @@ and media in the storage backend (bucket/directory copy).
146
142
 
147
143
  ## The design system
148
144
 
149
- `design-system.json` is the single source of truth for colors, type, spacing,
150
- shadows, patterns, and animations. The `vitops()` integration regenerates
145
+ `site.json`'s `designSystem.themes.default` is the single source of truth for
146
+ colors, type, spacing, shadows, patterns, and animations — there is no
147
+ separate `design-system.json`, since a scaffolded config can't merely
148
+ reference a sibling file. The `vitops()` integration regenerates
151
149
  `src/styles/tailwind.css` from it on dev/build (the file is gitignored — edit
152
150
  the JSON, not the CSS). `Layout.astro` imports the stylesheet so the admin
153
151
  routes stay unstyled by it.
@@ -155,27 +153,27 @@ routes stay unstyled by it.
155
153
  Useful commands (via `@getvitops/cli`):
156
154
 
157
155
  ```bash
158
- npx vitops validate design-system.json # check the config against the schema
159
- npx vitops agents # write the design-system reference into AGENTS.md
160
- pnpm build:css # regenerate the CSS manually
156
+ npx vitops validate site.json # check the config against the schema
157
+ npx vitops agents # write the design-system reference into AGENTS.md
158
+ pnpm build:css # regenerate the CSS manually
161
159
  ```
162
160
 
163
161
  ## Project map
164
162
 
165
- | Path | Purpose |
166
- | -------------------------------- | ----------------------------------------------------------------- |
167
- | `design-system.json` | Design tokens + patterns → generated CSS |
168
- | `seed/seed.json` | First-boot content model + starter content |
169
- | `src/worker.ts` | Worker entry (fetch + EmDash scheduled handler) |
170
- | `src/live.config.ts` | Astro live content collections wiring for EmDash |
171
- | `src/layouts/Layout.astro` | Site chrome: EmDash + Vitops head tags, nav from the CMS menu |
172
- | `src/pages/index.astro` | Home — renders the `home` page entry |
173
- | `src/pages/[...slug].astro` | Catch-all — renders any `pages` entry at its slug |
174
- | `src/pages/404.astro` | Not-found page (the catch-all rewrites here) |
175
- | `wrangler.jsonc` | Cloudflare bindings (D1/R2) + cron trigger |
176
- | `scripts/build-dev-wrangler.mjs` | Rewrites the built wrangler config for the isolated dev worker |
177
- | `scripts/init-github.mjs` | One-time: create + push the GitHub repo (`pnpm run init:github`) |
178
- | `.github/workflows/` | deploy-dev (push to `dev`), deploy-prod (push to `main`), promote |
179
- | `.agents/skills/promote/` | Agent skill: dispatch the dev → main promotion |
180
- | `.mcp.json` | Astro + EmDash docs MCP servers for coding agents |
181
- | `.claude/hooks/` | Claude Code web: Node 24 + pnpm setup on session start |
163
+ | Path | Purpose |
164
+ | -------------------------------- | ------------------------------------------------------------------------------------------ |
165
+ | `site.json` | Org + site config; design tokens/patterns at `designSystem.themes.default` → generated CSS |
166
+ | `seed/seed.json` | First-boot content model + starter content |
167
+ | `src/worker.ts` | Worker entry (fetch + EmDash scheduled handler) |
168
+ | `src/live.config.ts` | Astro live content collections wiring for EmDash |
169
+ | `src/layouts/Layout.astro` | Site chrome: EmDash + Vitops head tags, nav from the CMS menu |
170
+ | `src/pages/index.astro` | Home — renders the `home` page entry |
171
+ | `src/pages/[...slug].astro` | Catch-all — renders any `pages` entry at its slug |
172
+ | `src/pages/404.astro` | Not-found page (the catch-all rewrites here) |
173
+ | `wrangler.jsonc` | Cloudflare bindings (D1/R2) + cron trigger |
174
+ | `scripts/build-dev-wrangler.mjs` | Rewrites the built wrangler config for the isolated dev worker |
175
+ | `SETUP.html` | Client-onboarding checklist — run `pnpm run sop` first (see "One-time setup") |
176
+ | `.github/workflows/` | deploy-dev (push to `dev`), deploy-prod (push to `main`), promote |
177
+ | `.agents/skills/promote/` | Agent skill: dispatch the dev → main promotion |
178
+ | `.mcp.json` | Astro + EmDash docs MCP servers for coding agents |
179
+ | `.claude/hooks/` | Claude Code web: Node 24 + pnpm setup on session start |