@cparkerwebm/webmonterey 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/README.md +6 -0
  3. package/dist/webm.mjs +445 -61
  4. package/package.json +5 -3
  5. package/skills/launch/SKILL.md +57 -9
  6. package/skills/start/SKILL.md +66 -12
  7. package/skills/traps/SKILL.md +17 -0
  8. package/src/assets/opengraph-webmaster.png +0 -0
  9. package/src/cli/audit.test.ts +120 -0
  10. package/src/cli/audit.ts +323 -0
  11. package/src/cli/checks.test.ts +46 -6
  12. package/src/cli/checks.ts +52 -12
  13. package/src/cli/doctor.ts +78 -2
  14. package/src/cli/scaffold.test.ts +9 -0
  15. package/src/cli/scaffold.ts +12 -30
  16. package/src/cli/settings.ts +106 -0
  17. package/src/cli/sync.test.ts +61 -0
  18. package/src/cli/sync.ts +64 -1
  19. package/src/emails/footer.ts +3 -3
  20. package/src/includes/cloudflare/r2/media.ts +1 -1
  21. package/src/includes/webmonterey/config.test.ts +51 -0
  22. package/src/includes/webmonterey/config.ts +49 -0
  23. package/src/includes/webmonterey/copy-defaults.ts +20 -0
  24. package/src/includes/webmonterey/webmaster/Webmaster.astro +52 -0
  25. package/src/includes/webmonterey/webmaster/webmaster.test.ts +74 -0
  26. package/src/includes/webmonterey/webmaster/webmaster.ts +89 -0
  27. package/src/integration/index.ts +91 -4
  28. package/src/integration/virtual.d.ts +19 -1
  29. package/src/layouts/base.astro +31 -8
  30. package/src/package.test.ts +20 -0
  31. package/src/pages/robots.txt.ts +14 -0
  32. package/src/pages/webmaster-og.png.ts +31 -0
  33. package/src/pages/webmaster.astro +121 -0
  34. package/template/public/opengraph.png +0 -0
  35. package/template/scripts/test-hooks.mjs +1 -1
  36. package/template/site/CLAUDE.md +25 -2
  37. package/src/includes/webmonterey/credits/Credit.astro +0 -80
  38. package/src/includes/webmonterey/credits/credit.test.ts +0 -111
  39. package/src/includes/webmonterey/credits/credit.ts +0 -59
  40. package/template/public/open-graph.png +0 -0
  41. /package/template/assets/{open-graph.png → opengraph.png} +0 -0
package/CHANGELOG.md CHANGED
@@ -11,6 +11,110 @@ build. See `/webm:upgrade`.
11
11
 
12
12
  ---
13
13
 
14
+ ## 1.3.0 — 2026-09-02
15
+
16
+ ### Changed
17
+
18
+ - **A staging site is a preview build everywhere.** `environment: "staging"` in webmonterey.json
19
+ now makes every build a preview — every page noindex with no canonical, no sitemap, `robots.txt`
20
+ `Disallow: /`, no Google Tag Manager — on every hostname and in every build: a feature branch,
21
+ `main` on Workers Builds, a laptop. Until now only a non-production branch was a preview, so a
22
+ site that had not launched was crawlable on its `workers.dev` URL the moment `main` deployed.
23
+ The branch rule stays: a feature branch of a launched site is still a preview. An unset
24
+ `environment` is production, as everywhere else, so a site predating the field builds as before.
25
+ The decision is one pure function, `isPreviewBuild`; the build log says which signal made a
26
+ build a preview, and `virtual:webm/build` carries it as `reason`.
27
+
28
+ **A launched site whose webmonterey.json still says `"staging"` disappears from search after
29
+ this update:** every page goes noindex and the sitemap is gone. `/webm:launch` sets
30
+ `"environment": "production"` and `launched` together; `webm doctor` already fails a launched
31
+ site still declared staging, and its message now names this consequence. Flipping `environment`
32
+ is what makes a site indexable, so it must not happen before the custom domain is live —
33
+ `/webm:start` and `/webm:launch` both say so.
34
+
35
+ - **`/webm:start` creates the Worker.** Step 5 is now one deploy from the laptop — `npm run build
36
+ && npx wrangler deploy`, guarded by `wrangler deployments list` so a re-run skips it — and step 6
37
+ connects the repo to the Worker that now exists (Settings → Builds), a smaller dashboard step
38
+ than importing a repository and typing the Worker name in by hand. The skill used to stop and
39
+ ask for the Worker to be made in the dashboard; on one site it was not, and the result was a
40
+ repo, a database and nothing serving. That laptop deploy is the only one a site ever gets: once
41
+ the repo is connected, a laptop deploy is a version no build produced, which the next push
42
+ reverts. The adapter's auto-provisioned `<slug>-session` KV namespace is expected and stays out
43
+ of wrangler.jsonc. The scaffolded README's deploy note says the same.
44
+
45
+ ### Added
46
+
47
+ - **`webm doctor` checks that the Worker exists.** It asks wrangler for the deployments of the
48
+ Worker named in wrangler.jsonc and warns when there are none — the silent failure above. It skips
49
+ with a note when wrangler is not installed or not logged in, so CI and a fresh laptop are not
50
+ failed for being unable to ask.
51
+
52
+ - **Hard rule 12 in a site's CLAUDE.md: a session in a client repo never edits the package.** Not
53
+ in `node_modules`, and not in the package's checkout when it sits on the same machine. The
54
+ deliverable for an upstream problem is a description of the fix — what, where, expected
55
+ behaviour, how to verify — as a prompt for a session opened in the package repo; the site takes
56
+ the fix with `npm update`. Enforced as far as Claude Code's rules reach: `.claude/settings.json`
57
+ denies `Edit(**/node_modules/**)`, and **`webm sync` now merges the package's deny rules into a
58
+ site's settings on every install** — adding what is missing, leaving the site's own rules alone,
59
+ and dropping the two `Write(...)` rules 1.2.0 scaffolded, which Claude Code never consults and
60
+ warns about at startup. The docs have no rule syntax for "any path outside this project", so
61
+ that half stays prose.
62
+
63
+ **On an existing site:** the settings arrive with the next install. `CLAUDE.md` is the site's
64
+ own file, so copy rule 12 in from
65
+ `node_modules/@cparkerwebm/webmonterey/template/site/CLAUDE.md`.
66
+
67
+ ---
68
+
69
+ ## 1.2.0 — 2026-09-02
70
+
71
+ ### Added
72
+
73
+ - **Every site has a `/webmaster` page.** Injected by the integration, rendered with the site's
74
+ own chrome, indexable and in the sitemap. It says who designed, built and manages the site and
75
+ who to contact when something is wrong, carries its own share image (served from the package at
76
+ `/webmaster/og.png`, so a redesign reaches every site on `npm update`) and its own structured
77
+ data — a `WebPage` about the agency's `Organization`, using the same `@id` the agency's own site
78
+ declares. Every word is overridable through `copy.webmaster`. Off switch: `webmaster: false` on
79
+ the integration.
80
+
81
+ - **`webm audit`** — the pre-launch checks only a build can answer: images with no `alt`
82
+ attribute (an explicit `alt=""` is fine), internal links that land on no page or Worker route,
83
+ and a sitemap that is missing, unadvertised, or lists a page that was not built. External links
84
+ are probed and reported as warnings. `/webm:launch` runs it and says how to act on each finding.
85
+
86
+ - **Branch previews are a different build.** On any Workers Builds branch other than the
87
+ production one (`main`, or `productionBranch` on the integration), every page is noindex with
88
+ no canonical, there is no sitemap, `robots.txt` disallows everything, Google Tag Manager does
89
+ not load, and `/webmaster` emits no graph. Detected from the `WORKERS_CI_BRANCH` variable
90
+ Workers Builds injects; a local build is production. Mail on previews was already redirected by
91
+ the `workers.dev` hostname. Nothing to do on a site.
92
+
93
+ - **`/webm:launch` asks two questions out loud** before the flip: is Google Tag Manager
94
+ configured and published for this site, and has the launch annotation been added in Google
95
+ Analytics. Neither is knowable from the repo, so the skill waits for the answer.
96
+
97
+ ### Changed
98
+
99
+ - **The default share image is `public/opengraph.png`** (was `open-graph.png`). `webm new` seeds
100
+ the WebMonterey artwork there - the same image the `/webmaster` page uses - and a client replaces
101
+ it with their own; `webm doctor` flags the seed until they do. **On an existing site:** rename
102
+ `public/open-graph.png` to `public/opengraph.png`, or every page's `og:image` points at a file
103
+ that is not there.
104
+
105
+ - **The footer credit is an internal link.** `Powered by WebMonterey` now goes to the site's own
106
+ `/webmaster` page instead of leaving the site; that page carries the one outbound link, with
107
+ the UTM parameters (`utm_campaign=webmaster`). The email footer keeps the outbound link — an
108
+ email cannot usefully point at a page on the site it is about.
109
+
110
+ **On an existing site:** the import moves —
111
+ `@cparkerwebm/webmonterey/webmonterey/credits/Credit.astro` is now
112
+ `@cparkerwebm/webmonterey/webmonterey/webmaster/Webmaster.astro`, and the module
113
+ `webmonterey/credits` is `webmonterey/webmaster`. The doctor check is `webmaster-credit`. The
114
+ site's `structuredData` component is not rendered on `/webmaster`; the page emits its own.
115
+
116
+ ---
117
+
14
118
  ## 1.1.0 — 2026-09-02
15
119
 
16
120
  ### Changed
package/README.md CHANGED
@@ -20,6 +20,12 @@ the reset, the Cloudflare includes, the consent system, the form pipeline, the r
20
20
  It ships **zero visible components**. Every block a visitor sees is built per client, in that
21
21
  client's repo. Every default has a documented way to opt out of it.
22
22
 
23
+ **The package is edited in this repo, and only here.** A session in a client site that finds a
24
+ package bug does not reach into `node_modules` or into this checkout; its deliverable is a
25
+ description of the fix, run later in a session opened here, and the site takes the result with
26
+ `npm update`. That is rule 12 of the site's `CLAUDE.md`, with an `Edit` deny on `node_modules`
27
+ behind it that `webm sync` keeps in place. The inverse holds: nothing here edits a client site.
28
+
23
29
  ## Creating a client site
24
30
 
25
31
  ```sh