@getvitops/create 0.5.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 +44 -5
- package/README.md +7 -0
- package/package.json +18 -2
- package/templates/emdash/.agents/skills/setup/SKILL.md +61 -0
- package/templates/emdash/.env +1 -0
- package/templates/emdash/.github/workflows/ci.yml +12 -0
- package/templates/emdash/.github/workflows/deploy-dev.yml +17 -19
- package/templates/emdash/.github/workflows/deploy-prod.yml +17 -21
- package/templates/emdash/.github/workflows/promote.yml +8 -36
- package/templates/emdash/.mcp.json +4 -0
- package/templates/emdash/.nvmrc +1 -0
- package/templates/emdash/AGENTS.md +23 -11
- package/templates/emdash/README.md +44 -42
- package/templates/emdash/SETUP.html +526 -0
- package/templates/emdash/_gitignore +3 -0
- package/templates/emdash/astro.config.mjs +7 -1
- package/templates/emdash/package.json +6 -4
- package/templates/emdash/seed/seed.json +1 -1
- package/templates/emdash/site.json +228 -0
- package/templates/emdash/src/assets/placeholder/wireframe-400x400.png +0 -0
- package/templates/emdash/src/assets/placeholder/wireframe-400x400.svg +1 -0
- package/templates/emdash/src/assets/placeholder/wireframe-400x600.png +0 -0
- package/templates/emdash/src/assets/placeholder/wireframe-400x600.svg +1 -0
- package/templates/emdash/src/assets/placeholder/wireframe-600x400.png +0 -0
- package/templates/emdash/src/assets/placeholder/wireframe-600x400.svg +1 -0
- package/templates/emdash/vite.config.ts +1 -1
- package/templates/emdash/wrangler.jsonc +8 -3
- package/templates/static/.agents/skills/setup/SKILL.md +61 -0
- package/templates/static/.env +1 -0
- package/templates/static/.github/workflows/ci.yml +12 -0
- package/templates/static/.github/workflows/deploy-dev.yml +33 -0
- package/templates/static/.github/workflows/deploy-prod.yml +29 -0
- package/templates/static/.github/workflows/promote.yml +16 -0
- package/templates/static/.nvmrc +1 -0
- package/templates/static/AGENTS.md +64 -0
- package/templates/static/README.md +80 -0
- package/templates/static/SETUP.html +526 -0
- package/templates/static/_gitignore +27 -0
- package/templates/static/astro.config.mjs +23 -0
- package/templates/{emdash → static}/design-system.json +1 -1
- package/templates/static/package.json +41 -0
- package/templates/static/scripts/dev-wrangler-config.mjs +28 -0
- package/templates/static/site.json +228 -0
- package/templates/static/src/assets/placeholder/wireframe-400x400.png +0 -0
- package/templates/static/src/assets/placeholder/wireframe-400x400.svg +1 -0
- package/templates/static/src/assets/placeholder/wireframe-400x600.png +0 -0
- package/templates/static/src/assets/placeholder/wireframe-400x600.svg +1 -0
- package/templates/static/src/assets/placeholder/wireframe-600x400.png +0 -0
- package/templates/static/src/assets/placeholder/wireframe-600x400.svg +1 -0
- package/templates/static/src/layouts/Layout.astro +26 -0
- package/templates/static/src/pages/404.astro +11 -0
- package/templates/static/src/pages/index.astro +13 -0
- package/templates/static/tsconfig.json +5 -0
- package/templates/static/wrangler.jsonc +22 -0
- package/templates/emdash/scripts/init-github.mjs +0 -102
- package/templates/emdash/scripts/init-hosting.mjs +0 -150
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
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
|
+
|
|
34
|
+
## 0.6.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- Scaffolded `static` and `emdash` projects now ship neutral placeholder wireframe images under
|
|
39
|
+
`src/assets/placeholder/` (square, portrait, landscape; SVG + PNG) for layout work before real
|
|
40
|
+
imagery exists. Delete the directory once real assets land.
|
|
41
|
+
|
|
3
42
|
## 0.5.0
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
|
@@ -227,15 +266,15 @@
|
|
|
227
266
|
which `@getvitops/astro` re-exports wholesale. So from `astro.config.mjs`:
|
|
228
267
|
|
|
229
268
|
```js
|
|
230
|
-
import { generateIconInclude } from
|
|
231
|
-
import icon from
|
|
269
|
+
import { generateIconInclude } from "@getvitops/astro";
|
|
270
|
+
import icon from "astro-icon";
|
|
232
271
|
|
|
233
272
|
integrations: [
|
|
234
273
|
icon({
|
|
235
274
|
include: generateIconInclude({
|
|
236
|
-
ui:
|
|
237
|
-
brand:
|
|
238
|
-
semantic: [
|
|
275
|
+
ui: "fa7-solid",
|
|
276
|
+
brand: "simple-icons",
|
|
277
|
+
semantic: ["menu", "close", "search", "github"],
|
|
239
278
|
}),
|
|
240
279
|
}),
|
|
241
280
|
];
|
package/README.md
CHANGED
|
@@ -73,6 +73,13 @@ provisions the D1/R2 resources on first deploy).
|
|
|
73
73
|
Template dependencies must use concrete npm ranges (no `workspace:*` /
|
|
74
74
|
`catalog:` — the scaffolded project lives outside this monorepo).
|
|
75
75
|
|
|
76
|
+
`assets/` (this package root, unpublished) is the source of truth for
|
|
77
|
+
placeholder imagery shared across templates — `vp create` copies only the
|
|
78
|
+
one directory a template names, so there's no step that could copy a
|
|
79
|
+
sibling `assets/` for you. Mirror any new file into each template's
|
|
80
|
+
`src/assets/placeholder/` by hand; `templates.test.ts` asserts every mirror
|
|
81
|
+
stays byte-identical to the source.
|
|
82
|
+
|
|
76
83
|
## Changelog
|
|
77
84
|
|
|
78
85
|
This package's history: [`CHANGELOG.md`](./CHANGELOG.md) (shipped in the npm tarball, so it
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getvitops/create",
|
|
3
|
-
"version": "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
|
+
"homepage": "https://docs.vitops.ca",
|
|
6
|
+
"bugs": "https://github.com/getvitops/design-system/issues",
|
|
5
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/getvitops/design-system.git",
|
|
11
|
+
"directory": "packages/create"
|
|
12
|
+
},
|
|
6
13
|
"files": [
|
|
7
14
|
"templates",
|
|
8
15
|
"CHANGELOG.md"
|
|
@@ -12,10 +19,19 @@
|
|
|
12
19
|
"access": "public"
|
|
13
20
|
},
|
|
14
21
|
"devDependencies": {
|
|
15
|
-
"vitest": "
|
|
22
|
+
"vitest": "4.1.9",
|
|
23
|
+
"@getvitops/generator": "8.1.0"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=24"
|
|
16
27
|
},
|
|
17
28
|
"createConfig": {
|
|
18
29
|
"templates": [
|
|
30
|
+
{
|
|
31
|
+
"name": "static",
|
|
32
|
+
"description": "Static Astro website on Cloudflare Workers static assets with the Vitops design system pre-wired",
|
|
33
|
+
"template": "./templates/static"
|
|
34
|
+
},
|
|
19
35
|
{
|
|
20
36
|
"name": "emdash",
|
|
21
37
|
"description": "EmDash CMS website on Cloudflare Workers (D1 + R2) with the Vitops design system pre-wired",
|
|
@@ -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).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Runs on every PR: typecheck + design-lint + build. deploy-dev.yml /
|
|
2
|
+
# deploy-prod.yml call the same reusable `site-ci.yml` themselves before they
|
|
3
|
+
# deploy, so this is what gives a PR the identical signal before it's even
|
|
4
|
+
# merged to `dev` — a broken build never reaches the dev worker.
|
|
5
|
+
name: CI
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
ci:
|
|
12
|
+
uses: getvitops/design-system/.github/workflows/site-ci.yml@v1
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
# `dev` is the integration branch — every push here refreshes the review site.
|
|
4
4
|
# Promote to production with the "Promote dev → main" workflow (promote.yml).
|
|
5
5
|
#
|
|
6
|
+
# Deploys via the vitops toolchain's reusable EmDash deploy workflow — see
|
|
7
|
+
# https://github.com/getvitops/design-system/blob/main/.github/workflows/site-deploy-emdash.yml
|
|
8
|
+
# for what it does. Pinned to @v1 so a fix there reaches this repo without a
|
|
9
|
+
# manual re-paste; bump the tag deliberately if you want to pick up a change.
|
|
10
|
+
#
|
|
6
11
|
# Required repo secrets:
|
|
7
12
|
# CLOUDFLARE_API_TOKEN — token with Workers + D1 + R2 edit on this account
|
|
8
13
|
# CLOUDFLARE_ACCOUNT_ID — the Cloudflare account id
|
|
@@ -14,28 +19,21 @@ on:
|
|
|
14
19
|
push:
|
|
15
20
|
branches: [dev]
|
|
16
21
|
|
|
17
|
-
permissions:
|
|
18
|
-
contents: read
|
|
19
|
-
|
|
20
22
|
concurrency:
|
|
21
23
|
group: deploy-dev
|
|
22
24
|
cancel-in-progress: true
|
|
23
25
|
|
|
24
26
|
jobs:
|
|
25
27
|
deploy:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
env:
|
|
39
|
-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
40
|
-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
41
|
-
DEV_D1_ID: ${{ secrets.DEV_D1_ID }}
|
|
28
|
+
uses: getvitops/design-system/.github/workflows/site-deploy-emdash.yml@v1
|
|
29
|
+
with:
|
|
30
|
+
environment: dev
|
|
31
|
+
is-dev: true
|
|
32
|
+
# Set this to your dev worker's URL (or dev.<domain>) once known, so a
|
|
33
|
+
# bad migration fails the deploy instead of surfacing to the first
|
|
34
|
+
# visitor — see the reusable workflow's docblock.
|
|
35
|
+
health-check-url: ''
|
|
36
|
+
secrets:
|
|
37
|
+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
38
|
+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
39
|
+
DEV_D1_ID: ${{ secrets.DEV_D1_ID }}
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
# Deploys `main` to production.
|
|
2
2
|
# `main` should be branch-protected — it then only advances via the Promote
|
|
3
|
-
# workflow (promote.yml), so a push here always represents promoted code.
|
|
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
|
|
5
|
+
# required reviewers restricted to admins, so this PAUSES for approval before
|
|
6
|
+
# deploying.
|
|
4
7
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
8
|
+
# Deploys via the vitops toolchain's reusable EmDash deploy workflow — see
|
|
9
|
+
# https://github.com/getvitops/design-system/blob/main/.github/workflows/site-deploy-emdash.yml
|
|
10
|
+
#
|
|
11
|
+
# Required repo secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
|
|
7
12
|
name: Deploy prod
|
|
8
13
|
|
|
9
14
|
on:
|
|
10
15
|
push:
|
|
11
16
|
branches: [main]
|
|
12
17
|
|
|
13
|
-
permissions:
|
|
14
|
-
contents: read
|
|
15
|
-
|
|
16
18
|
concurrency:
|
|
17
19
|
group: deploy-prod
|
|
18
20
|
cancel-in-progress: false
|
|
19
21
|
|
|
20
22
|
jobs:
|
|
21
23
|
deploy:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- run: pnpm install --frozen-lockfile
|
|
32
|
-
- name: Build + deploy prod worker
|
|
33
|
-
run: pnpm run deploy
|
|
34
|
-
env:
|
|
35
|
-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
36
|
-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
24
|
+
uses: getvitops/design-system/.github/workflows/site-deploy-emdash.yml@v1
|
|
25
|
+
with:
|
|
26
|
+
environment: production
|
|
27
|
+
is-dev: false
|
|
28
|
+
# Set this to your production URL once known.
|
|
29
|
+
health-check-url: ''
|
|
30
|
+
secrets:
|
|
31
|
+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
32
|
+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
@@ -2,48 +2,20 @@
|
|
|
2
2
|
# Opens a PR from dev into the protected `main` branch and enables auto-merge;
|
|
3
3
|
# the merge triggers Deploy prod.
|
|
4
4
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
# (b) set repo secret PROMOTE_TOKEN to a PAT / GitHub App token allowed to
|
|
9
|
-
# bypass protection, for hands-off promotion.
|
|
10
|
-
# The default GITHUB_TOKEN cannot approve its own PR, so with required reviews
|
|
11
|
-
# the PR waits for a human — which is usually what you want for a prod promotion.
|
|
5
|
+
# Deploys via the vitops toolchain's reusable promote workflow — see
|
|
6
|
+
# https://github.com/getvitops/design-system/blob/main/.github/workflows/site-promote.yml
|
|
7
|
+
# for the branch-protection / PROMOTE_TOKEN options.
|
|
12
8
|
#
|
|
13
|
-
# Schema/content promotion is deliberately NOT here — the content model lives
|
|
14
|
-
# the EmDash database, not git. Apply schema changes to prod via the admin
|
|
15
|
-
# the site's MCP server, additive changes before the code deploy that uses
|
|
9
|
+
# Schema/content promotion is deliberately NOT here — the content model lives
|
|
10
|
+
# in the EmDash database, not git. Apply schema changes to prod via the admin
|
|
11
|
+
# or the site's MCP server, additive changes before the code deploy that uses
|
|
16
12
|
# them, removals after the code that stops using them.
|
|
17
13
|
name: Promote dev → main
|
|
18
14
|
|
|
19
15
|
on:
|
|
20
16
|
workflow_dispatch:
|
|
21
17
|
|
|
22
|
-
permissions:
|
|
23
|
-
contents: write
|
|
24
|
-
pull-requests: write
|
|
25
|
-
|
|
26
18
|
jobs:
|
|
27
19
|
promote:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- uses: actions/checkout@v4
|
|
31
|
-
with:
|
|
32
|
-
fetch-depth: 0
|
|
33
|
-
- name: Open promotion PR and enable auto-merge
|
|
34
|
-
env:
|
|
35
|
-
GH_TOKEN: ${{ secrets.PROMOTE_TOKEN || github.token }}
|
|
36
|
-
run: |
|
|
37
|
-
set -euo pipefail
|
|
38
|
-
if gh pr view dev --base main --json number >/dev/null 2>&1; then
|
|
39
|
-
echo "Promotion PR already open; ensuring auto-merge is enabled."
|
|
40
|
-
else
|
|
41
|
-
# printf, not a multi-line string: an unindented continuation line
|
|
42
|
-
# would end this YAML block and break the whole workflow file.
|
|
43
|
-
gh pr create --base main --head dev \
|
|
44
|
-
--title "Promote dev → main" \
|
|
45
|
-
--body "$(printf '%s\n\n%s' \
|
|
46
|
-
"Automated code promotion from \`dev\`. Merging deploys to production." \
|
|
47
|
-
"Remember: schema/content changes live in the EmDash database, not git — promote them separately if this release changes the content model.")"
|
|
48
|
-
fi
|
|
49
|
-
gh pr merge dev --auto --merge
|
|
20
|
+
uses: getvitops/design-system/.github/workflows/site-promote.yml@v1
|
|
21
|
+
secrets: inherit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24
|
|
@@ -3,10 +3,18 @@ styled by the Vitops design system.
|
|
|
3
3
|
|
|
4
4
|
## Ground rules
|
|
5
5
|
|
|
6
|
-
- `
|
|
7
|
-
(colors, type, spacing, patterns, animations)
|
|
8
|
-
`src/styles/tailwind.css` — it is
|
|
9
|
-
`vitops()` integration on every dev/build
|
|
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.)
|
|
14
|
+
- `src/assets/placeholder/` holds neutral wireframe stand-ins (square,
|
|
15
|
+
portrait, landscape; SVG + PNG) for layout work before real imagery
|
|
16
|
+
exists. Delete the directory once real assets land — it's separate from
|
|
17
|
+
`src/assets/logo.svg`, the actual brand asset.
|
|
10
18
|
- Content lives in the EmDash database, not in the repo. Query it with
|
|
11
19
|
`getEmDashCollection` / `getEmDashEntry` from `emdash`; render Portable Text
|
|
12
20
|
with `<PortableText />` from `emdash/ui` (the Vitops blocks from
|
|
@@ -70,6 +78,10 @@ styled by the Vitops design system.
|
|
|
70
78
|
d1/r2/sqlite there. Switch targets via `vitopsHosting({ target })` or the
|
|
71
79
|
`HOSTING` env var (see README "Hosting"); the `node` target needs
|
|
72
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).
|
|
73
85
|
|
|
74
86
|
## Branch model
|
|
75
87
|
|
|
@@ -86,12 +98,12 @@ styled by the Vitops design system.
|
|
|
86
98
|
and obviously unfinished; do not "improve" them into something that reads as
|
|
87
99
|
a finished policy, because the risk here is a plausible-looking document
|
|
88
100
|
getting shipped unread.
|
|
89
|
-
To replace them properly,
|
|
90
|
-
`npx vitops legal --format portable-text --out ./legal`, then
|
|
91
|
-
document's blocks into the page in the admin. That renders a real
|
|
92
|
-
what the site actually does — the analytics provider it uses,
|
|
93
|
-
forms collect, where it deploys — rather than from guesses.
|
|
94
|
-
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.
|
|
95
107
|
|
|
96
108
|
## Docs MCP servers
|
|
97
109
|
|
|
@@ -108,4 +120,4 @@ searching them over pre-trained knowledge for Astro/EmDash questions.
|
|
|
108
120
|
dev default). Only run when the user asks to set up GitHub.
|
|
109
121
|
- `pnpm run init:hosting` — one-time: provision the hosting platform (dev
|
|
110
122
|
D1/R2 + repo secrets on cloudflare). Only run when the user asks for it.
|
|
111
|
-
- `npx vitops validate
|
|
123
|
+
- `npx vitops validate site.json` — schema-check the site config
|
|
@@ -10,12 +10,16 @@ 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
|
-
|
|
15
|
-
|
|
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
|
|
|
19
|
+
`src/assets/placeholder/` ships neutral wireframe images for layout work
|
|
20
|
+
before real imagery exists — delete once real assets land (separate from
|
|
21
|
+
`src/assets/logo.svg`, the brand asset).
|
|
22
|
+
|
|
19
23
|
## Local development
|
|
20
24
|
|
|
21
25
|
```bash
|
|
@@ -38,7 +42,7 @@ Until then the home route shows a friendly empty state. Unknown paths render
|
|
|
38
42
|
`src/pages/404.astro`.
|
|
39
43
|
|
|
40
44
|
The two legal pages are placeholders. To generate real ones from what your site
|
|
41
|
-
actually does,
|
|
45
|
+
actually does, fill in `site.json`'s `organization`/`site.legal` fields and run:
|
|
42
46
|
|
|
43
47
|
```sh
|
|
44
48
|
npx vitops legal --format portable-text --out ./legal
|
|
@@ -78,22 +82,18 @@ The repo ships a two-environment flow modeled on branch = environment:
|
|
|
78
82
|
into `main` with auto-merge enabled. With required reviews on `main`, a
|
|
79
83
|
human approves the PR; merging deploys prod.
|
|
80
84
|
|
|
81
|
-
One-time setup:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<https://dash.cloudflare.com/profile/api-tokens>; tokens can't be created
|
|
94
|
-
via CLI) and `gh secret set CLOUDFLARE_API_TOKEN`. Optionally
|
|
95
|
-
`PROMOTE_TOKEN` (a PAT allowed to bypass protection) for hands-off
|
|
96
|
-
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).
|
|
97
97
|
|
|
98
98
|
`pnpm deploy:dev` reproduces the dev deploy locally: it rewrites the
|
|
99
99
|
adapter-generated wrangler config (`scripts/build-dev-wrangler.mjs`) so the
|
|
@@ -142,8 +142,10 @@ and media in the storage backend (bucket/directory copy).
|
|
|
142
142
|
|
|
143
143
|
## The design system
|
|
144
144
|
|
|
145
|
-
`
|
|
146
|
-
shadows, patterns, and animations
|
|
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
|
|
147
149
|
`src/styles/tailwind.css` from it on dev/build (the file is gitignored — edit
|
|
148
150
|
the JSON, not the CSS). `Layout.astro` imports the stylesheet so the admin
|
|
149
151
|
routes stay unstyled by it.
|
|
@@ -151,27 +153,27 @@ routes stay unstyled by it.
|
|
|
151
153
|
Useful commands (via `@getvitops/cli`):
|
|
152
154
|
|
|
153
155
|
```bash
|
|
154
|
-
npx vitops validate
|
|
155
|
-
npx vitops agents
|
|
156
|
-
pnpm build:css
|
|
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
|
|
157
159
|
```
|
|
158
160
|
|
|
159
161
|
## Project map
|
|
160
162
|
|
|
161
|
-
| Path | Purpose
|
|
162
|
-
| -------------------------------- |
|
|
163
|
-
| `
|
|
164
|
-
| `seed/seed.json` | First-boot content model + starter content
|
|
165
|
-
| `src/worker.ts` | Worker entry (fetch + EmDash scheduled handler)
|
|
166
|
-
| `src/live.config.ts` | Astro live content collections wiring for EmDash
|
|
167
|
-
| `src/layouts/Layout.astro` | Site chrome: EmDash + Vitops head tags, nav from the CMS menu
|
|
168
|
-
| `src/pages/index.astro` | Home — renders the `home` page entry
|
|
169
|
-
| `src/pages/[...slug].astro` | Catch-all — renders any `pages` entry at its slug
|
|
170
|
-
| `src/pages/404.astro` | Not-found page (the catch-all rewrites here)
|
|
171
|
-
| `wrangler.jsonc` | Cloudflare bindings (D1/R2) + cron trigger
|
|
172
|
-
| `scripts/build-dev-wrangler.mjs` | Rewrites the built wrangler config for the isolated dev worker
|
|
173
|
-
| `
|
|
174
|
-
| `.github/workflows/` | deploy-dev (push to `dev`), deploy-prod (push to `main`), promote
|
|
175
|
-
| `.agents/skills/promote/` | Agent skill: dispatch the dev → main promotion
|
|
176
|
-
| `.mcp.json` | Astro + EmDash docs MCP servers for coding agents
|
|
177
|
-
| `.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 |
|