@zero2webmaster/starter-kit 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/README.md +2 -2
- package/dist/scaffolders/common.js +5 -0
- package/dist/scaffolders/nextjs.d.ts +1 -1
- package/dist/scaffolders/nextjs.js +176 -15
- package/dist/standards.d.ts +1 -1
- package/dist/standards.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# z2w-starter-kit
|
|
2
2
|
|
|
3
|
-
**Version:** 0.
|
|
3
|
+
**Version:** 0.7.0 | **Framework:** 2.13.0
|
|
4
4
|
|
|
5
5
|
> Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
|
|
6
6
|
|
|
@@ -99,4 +99,4 @@ For licensing inquiries: kerry@zero2webmaster.com.
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
*Scaffolded 2026-05-28 via the [[instantiate-z2w-project]] Claude Code skill v1; reconciled against the consolidated skill v1.1.0 (brief-first + Agent Coordination block) on 2026-05-29.*
|
|
102
|
-
*Version: 0.
|
|
102
|
+
*Version: 0.7.0 | Last Updated: 2026-07-30*
|
|
@@ -900,6 +900,11 @@ out/
|
|
|
900
900
|
.env
|
|
901
901
|
.env.local
|
|
902
902
|
.env*.local
|
|
903
|
+
# Vercel CLI local state. .vercel/project.json pins this checkout to ONE Vercel
|
|
904
|
+
# project id, so a committed copy makes a fork or a staging project silently
|
|
905
|
+
# deploy to the original. Note \`vercel link\` appends a bare \`.vercel\` line
|
|
906
|
+
# itself — if you see a duplicate, that is where it came from.
|
|
907
|
+
.vercel/
|
|
903
908
|
`,
|
|
904
909
|
"python-service": `.DS_Store
|
|
905
910
|
__pycache__/
|
|
@@ -6,4 +6,4 @@ export declare function scaffoldNextjs(inputs: ScaffoldInputs, opts?: Scaffolder
|
|
|
6
6
|
* they can assert / require the canonical SEO baseline file list without
|
|
7
7
|
* hardcoding the paths in two places.
|
|
8
8
|
*/
|
|
9
|
-
export declare const NEXTJS_SEO_BASELINE_PATHS: readonly ["app/layout.tsx", "app/page.tsx", "app/sitemap.ts", "app/robots.ts", "lib/seo/canonical-host.mjs", "app/opengraph-image.tsx", "lib/analytics/utm.ts", "lib/analytics/Analytics.tsx", "lib/analytics/RouteTracker.tsx", "SEO-CHECKLIST.md", ".env.example"];
|
|
9
|
+
export declare const NEXTJS_SEO_BASELINE_PATHS: readonly ["app/layout.tsx", "app/page.tsx", "app/sitemap.ts", "app/robots.ts", "lib/seo/canonical-host.mjs", "lib/seo/page-metadata.ts", "app/opengraph-image.tsx", "lib/analytics/utm.ts", "lib/analytics/Analytics.tsx", "lib/analytics/RouteTracker.tsx", "SEO-CHECKLIST.md", ".env.example"];
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
// 1. SSR/SSG — App Router pages are server-rendered by default.
|
|
7
7
|
// 2. Per-page metadata — root `metadata` in app/layout.tsx + per-page
|
|
8
8
|
// `metadata` in app/page.tsx with unique title, description, OG, Twitter.
|
|
9
|
+
// Built by the `pageMetadata()` helper in lib/seo/page-metadata.ts, because
|
|
10
|
+
// Next.js merges metadata SHALLOWLY per top-level key: a hand-written
|
|
11
|
+
// `openGraph: { title, description }` REPLACES the layout's whole openGraph
|
|
12
|
+
// object and silently deletes og:type / og:site_name, and the matching
|
|
13
|
+
// `twitter: {}` downgrades the card to a small square.
|
|
9
14
|
// 3. Exactly one <h1> per page + semantic HTML — app/page.tsx wires it.
|
|
10
15
|
// 4. Image alt text — the page template uses next/image with `alt=""` /
|
|
11
16
|
// descriptive alt where appropriate (placeholder content uses semantic
|
|
@@ -59,6 +64,7 @@ npm run build && npm start # production build
|
|
|
59
64
|
|
|
60
65
|
- \`app/layout.tsx\` — root \`metadata\` with \`title.template\`, \`title.default\`, \`description\`, \`openGraph\`, \`twitter\`, \`metadataBase\`; mounts \`<Analytics />\`; JSON-LD Organization schema.
|
|
61
66
|
- \`app/page.tsx\` — per-page \`metadata\` (unique title + description; never inherit defaults); exactly one \`<h1>\`; semantic HTML.
|
|
67
|
+
- \`lib/seo/page-metadata.ts\` — \`pageMetadata()\`, the ONE builder for every page's \`metadata\`. **Use it for every new page.** Next.js merges metadata shallowly per top-level key, so a hand-written partial \`openGraph\` replaces the layout's whole object and silently drops \`og:type\` / \`og:site_name\`, and a partial \`twitter\` downgrades the card to a small square.
|
|
62
68
|
- \`lib/analytics/{utm.ts,Analytics.tsx,RouteTracker.tsx}\` — Fathom (per [[fathom-analytics]]); the RouteTracker fires \`trackPageview()\` on route change + captures first-touch UTM. Gated on \`NEXT_PUBLIC_FATHOM_SITE_ID\`.
|
|
63
69
|
- \`app/sitemap.ts\` — sitemap generator; lists indexable pages. \`lastModified\` is deliberately omitted until you have a real content timestamp.
|
|
64
70
|
- \`app/robots.ts\` — robots generator. Indexable requires BOTH a production deployment AND a real canonical domain in \`NEXT_PUBLIC_SITE_URL\`; anything else emits \`Disallow: /\`. **Both files are prerendered at build time, so changing \`NEXT_PUBLIC_SITE_URL\` needs a redeploy.**
|
|
@@ -289,6 +295,135 @@ export const config = {
|
|
|
289
295
|
matcher: ["/((?!_next/|api/health).*)"],
|
|
290
296
|
};
|
|
291
297
|
`;
|
|
298
|
+
/**
|
|
299
|
+
* The `pageMetadata()` helper — one builder for every page's `metadata` export.
|
|
300
|
+
*
|
|
301
|
+
* Exists because Next.js merges metadata SHALLOWLY, per TOP-LEVEL KEY. A page
|
|
302
|
+
* that sets `openGraph: { title, description }` does not extend the layout's
|
|
303
|
+
* openGraph — it REPLACES the whole object, deleting `og:type` and
|
|
304
|
+
* `og:site_name`; the matching `twitter: {}` deletes
|
|
305
|
+
* `card: "summary_large_image"` so a 1200x630 image renders as a small square.
|
|
306
|
+
* Nothing warns: `next build` is happy and the source reads as if it composes.
|
|
307
|
+
* (Reported by `site-control` 2026-07-29, who introduced it while FIXING the
|
|
308
|
+
* `<title>Home</title>` defect in this same file pair and caught it only by
|
|
309
|
+
* re-diffing served HTML.)
|
|
310
|
+
*
|
|
311
|
+
* Two design choices worth not "tidying" away:
|
|
312
|
+
*
|
|
313
|
+
* 1. `title: { absolute: ... }`. The layout's `title.template` reaches CHILD
|
|
314
|
+
* segments only, never app/page.tsx — the exact asymmetry behind the
|
|
315
|
+
* `<title>Home</title>` defect. `absolute` opts out of the template
|
|
316
|
+
* everywhere, so a page built by this helper renders the same title whether
|
|
317
|
+
* it lives at the root or six segments deep. One code path, verified once.
|
|
318
|
+
* The template stays in the layout for pages that don't use the helper.
|
|
319
|
+
* 2. `openGraph.url` is the PAGE path, not the site root. Next resolves it
|
|
320
|
+
* against `metadataBase`. The pre-helper layout hardcoded the site URL, so
|
|
321
|
+
* every page shared one og:url.
|
|
322
|
+
*/
|
|
323
|
+
const PAGE_METADATA_MODULE_TEMPLATE = `// Build EVERY page's \`metadata\` export with pageMetadata(). Do not hand-write
|
|
324
|
+
// an \`openGraph\` or \`twitter\` object in a page.
|
|
325
|
+
//
|
|
326
|
+
// WHY: Next.js merges metadata SHALLOWLY, per top-level key. A page that sets
|
|
327
|
+
// \`openGraph: { title, description }\` REPLACES the root layout's whole
|
|
328
|
+
// openGraph object — og:type and og:site_name silently disappear — and a
|
|
329
|
+
// matching \`twitter: { title, description }\` drops
|
|
330
|
+
// \`card: "summary_large_image"\`, so a 1200x630 image renders as a small
|
|
331
|
+
// square. \`next build\` reports nothing; the source reads as if it composes.
|
|
332
|
+
// The only way to see it is to diff the served HTML.
|
|
333
|
+
|
|
334
|
+
import type { Metadata } from "next";
|
|
335
|
+
|
|
336
|
+
/** Brand name, appended to page titles and emitted as og:site_name. */
|
|
337
|
+
export const SITE_NAME = "{{brand_name}}";
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* The site-wide OG image, served by app/opengraph-image.tsx.
|
|
341
|
+
*
|
|
342
|
+
* Set explicitly on every page because declaring \`openGraph\` at all SUPPRESSES
|
|
343
|
+
* the inherited opengraph-image file convention. Verified against served HTML:
|
|
344
|
+
* a child page that declares openGraph and omits \`images\` ships NO og:image —
|
|
345
|
+
* so "just leave images out" silently costs every child page its social card.
|
|
346
|
+
* (A colocated opengraph-image.tsx in the SAME segment does survive, which is
|
|
347
|
+
* why the home page looked fine and hid this.)
|
|
348
|
+
*/
|
|
349
|
+
export const DEFAULT_OG_IMAGE = "/opengraph-image";
|
|
350
|
+
|
|
351
|
+
export type PageMetadataInput = {
|
|
352
|
+
/**
|
|
353
|
+
* The page-specific part of the title, e.g. "About" or "Frog Species Guide".
|
|
354
|
+
* " | " + SITE_NAME is appended for you — do NOT include the brand here
|
|
355
|
+
* unless you also pass \`brandSuffix: false\`.
|
|
356
|
+
*/
|
|
357
|
+
title: string;
|
|
358
|
+
/** Set false when \`title\` already carries the brand (the home page does). */
|
|
359
|
+
brandSuffix?: boolean;
|
|
360
|
+
/** Unique, page-specific. Never reuse the site description. */
|
|
361
|
+
description: string;
|
|
362
|
+
/** Root-relative path, e.g. "/" or "/about". Becomes the canonical URL. */
|
|
363
|
+
path: string;
|
|
364
|
+
/** "article" for posts and news; "website" for everything else. */
|
|
365
|
+
ogType?: "website" | "article";
|
|
366
|
+
/**
|
|
367
|
+
* A page-specific OG/Twitter image. Defaults to the site-wide
|
|
368
|
+
* DEFAULT_OG_IMAGE — do NOT omit it expecting inheritance, there is none
|
|
369
|
+
* (see DEFAULT_OG_IMAGE above).
|
|
370
|
+
*
|
|
371
|
+
* Pass \`null\` in the one case where that is wrong: this segment has its OWN
|
|
372
|
+
* colocated opengraph-image.tsx. An explicit \`images\` value REPLACES the file
|
|
373
|
+
* convention rather than adding to it, so without \`null\` the page would ship
|
|
374
|
+
* the site-wide image and silently ignore the one sitting next to it. (Not a
|
|
375
|
+
* duplicate — a substitution, which is harder to notice.)
|
|
376
|
+
*/
|
|
377
|
+
images?: NonNullable<Metadata["openGraph"]>["images"] | null;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export function pageMetadata({
|
|
381
|
+
title,
|
|
382
|
+
brandSuffix = true,
|
|
383
|
+
description,
|
|
384
|
+
path,
|
|
385
|
+
ogType = "website",
|
|
386
|
+
images = [DEFAULT_OG_IMAGE],
|
|
387
|
+
}: PageMetadataInput): Metadata {
|
|
388
|
+
const fullTitle = brandSuffix ? \`\${title} | \${SITE_NAME}\` : title;
|
|
389
|
+
|
|
390
|
+
// Shared between openGraph and twitter so the two can never drift apart.
|
|
391
|
+
const shared = {
|
|
392
|
+
title: fullTitle,
|
|
393
|
+
description,
|
|
394
|
+
// \`null\` means "this segment has its own opengraph-image.tsx" — omit the
|
|
395
|
+
// key so the colocated file convention supplies the image instead.
|
|
396
|
+
...(images === null ? {} : { images }),
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
return {
|
|
400
|
+
// \`absolute\` opts out of the layout's title.template. The template applies
|
|
401
|
+
// to CHILD segments only and never to app/page.tsx, so composing here
|
|
402
|
+
// instead is what makes root and nested pages behave identically.
|
|
403
|
+
title: { absolute: fullTitle },
|
|
404
|
+
description,
|
|
405
|
+
alternates: { canonical: path },
|
|
406
|
+
// Complete object, every time — this is the whole point of the helper.
|
|
407
|
+
openGraph: {
|
|
408
|
+
...shared,
|
|
409
|
+
// Written as a branch rather than \`type: ogType\` because Next's
|
|
410
|
+
// OpenGraph type is a discriminated union; a widened string does not
|
|
411
|
+
// typecheck.
|
|
412
|
+
...(ogType === "article" ? { type: "article" as const } : { type: "website" as const }),
|
|
413
|
+
siteName: SITE_NAME,
|
|
414
|
+
// Relative — Next resolves it against metadataBase, so each page gets its
|
|
415
|
+
// OWN og:url rather than the site root.
|
|
416
|
+
url: path,
|
|
417
|
+
},
|
|
418
|
+
twitter: {
|
|
419
|
+
...shared,
|
|
420
|
+
// Dropping this is the silent half of the shallow-merge trap: the card
|
|
421
|
+
// degrades from a 1200x630 banner to a small square.
|
|
422
|
+
card: "summary_large_image",
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
`;
|
|
292
427
|
const TSCONFIG_TEMPLATE = `{
|
|
293
428
|
"compilerOptions": {
|
|
294
429
|
"target": "ES2022",
|
|
@@ -314,6 +449,11 @@ const TSCONFIG_TEMPLATE = `{
|
|
|
314
449
|
const APP_LAYOUT_TEMPLATE = `// Root layout — SEO baseline wiring per Z2W standing org requirement
|
|
315
450
|
// 2026-05-30. Every indexable page MUST export its own \`metadata\`; do not
|
|
316
451
|
// rely on these defaults to fill in per-page values.
|
|
452
|
+
//
|
|
453
|
+
// ⚠️ These \`openGraph\` / \`twitter\` objects are DEFAULTS, not a base to extend.
|
|
454
|
+
// Next.js merges metadata shallowly per top-level key, so any page declaring a
|
|
455
|
+
// partial \`openGraph\` REPLACES the whole object below. Build page metadata with
|
|
456
|
+
// pageMetadata() from lib/seo/page-metadata.ts and this never comes up.
|
|
317
457
|
|
|
318
458
|
import type { Metadata, Viewport } from "next";
|
|
319
459
|
import { Analytics } from "@/lib/analytics/Analytics";
|
|
@@ -335,6 +475,10 @@ export const metadata: Metadata = {
|
|
|
335
475
|
title: "{{brand_name}} — {{slug}}",
|
|
336
476
|
description: "{{description}}",
|
|
337
477
|
type: "website",
|
|
478
|
+
// Present here as well as in pageMetadata(), so a hand-written page that
|
|
479
|
+
// sets no openGraph at all still inherits og:site_name. Verified missing
|
|
480
|
+
// from the served HTML of such a page before this line existed.
|
|
481
|
+
siteName: "{{brand_name}}",
|
|
338
482
|
url: siteUrl,
|
|
339
483
|
},
|
|
340
484
|
twitter: {
|
|
@@ -531,23 +675,28 @@ const APP_PAGE_TEMPLATE = `// Home page — per-page \`metadata\` is mandatory p
|
|
|
531
675
|
// the title + description with intentional, page-specific copy (do NOT
|
|
532
676
|
// inherit the root defaults).
|
|
533
677
|
//
|
|
534
|
-
// ⚠️
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
// the
|
|
542
|
-
//
|
|
678
|
+
// ⚠️ Build metadata with pageMetadata(). Do NOT hand-write an \`openGraph\` or
|
|
679
|
+
// \`twitter\` object here: Next.js merges metadata SHALLOWLY per top-level key,
|
|
680
|
+
// so a partial \`openGraph\` REPLACES the layout's whole object and silently
|
|
681
|
+
// deletes og:type / og:site_name, while a partial \`twitter\` drops
|
|
682
|
+
// \`card: "summary_large_image"\`. See lib/seo/page-metadata.ts.
|
|
683
|
+
//
|
|
684
|
+
// ⚠️ \`brandSuffix: false\` because this title already carries the brand. It has
|
|
685
|
+
// to: the root layout's \`title.template\` applies to CHILD segments ONLY, and
|
|
686
|
+
// app/page.tsx shares the ROOT segment with app/layout.tsx, so a bare fragment
|
|
687
|
+
// here (the old \`title: "Home"\`) rendered literally as \`<title>Home</title>\` on
|
|
688
|
+
// the most-linked page on the site — silently, with \`next build\` happy. Pages
|
|
689
|
+
// in CHILD segments pass a fragment and let pageMetadata() append the brand.
|
|
690
|
+
// (Both traps found by \`site-control\` dogfooding this scaffold, 2026-07-28/29.)
|
|
543
691
|
|
|
544
|
-
import
|
|
692
|
+
import { pageMetadata } from "@/lib/seo/page-metadata";
|
|
545
693
|
|
|
546
|
-
export const metadata
|
|
694
|
+
export const metadata = pageMetadata({
|
|
547
695
|
title: "{{brand_name}} — {{slug}}",
|
|
696
|
+
brandSuffix: false,
|
|
548
697
|
description: "{{description}}",
|
|
549
|
-
|
|
550
|
-
};
|
|
698
|
+
path: "/",
|
|
699
|
+
});
|
|
551
700
|
|
|
552
701
|
export default function HomePage() {
|
|
553
702
|
return (
|
|
@@ -682,7 +831,9 @@ Per Z2W standing org requirement 2026-05-30. Run before adding a new page AND be
|
|
|
682
831
|
## Per-page checklist (every new page)
|
|
683
832
|
|
|
684
833
|
- [ ] Page exports its own \`metadata\` — unique title, unique description, canonical URL
|
|
685
|
-
- [ ]
|
|
834
|
+
- [ ] Metadata built with \`pageMetadata()\` from \`lib/seo/page-metadata.ts\` — **never hand-write \`openGraph\` or \`twitter\` in a page.** Next.js merges metadata SHALLOWLY per top-level key: a partial \`openGraph: { title, description }\` REPLACES the layout's whole object (deleting \`og:type\` and \`og:site_name\`) and a partial \`twitter\` drops \`card: "summary_large_image"\`, so a 1200×630 image renders as a small square. Nothing warns — \`next build\` passes and the source reads as if it composes. Verify by diffing the served HTML, not the source.
|
|
835
|
+
- [ ] Title composition correct: a page in a CHILD segment passes a fragment (\`title: "About"\`) and lets \`pageMetadata()\` append the brand; \`app/page.tsx\` passes \`brandSuffix: false\` because the root layout's \`title.template\` cannot reach it
|
|
836
|
+
- [ ] OG image reaches the page. \`pageMetadata()\` sets it for you; the trap it closes is that declaring \`openGraph\` at all SUPPRESSES the inherited \`app/opengraph-image.tsx\`, so a child page that declares openGraph without \`images\` ships **no** \`og:image\`. If the segment has its own colocated \`opengraph-image.tsx\`, pass \`images: null\` — an explicit value replaces the file convention rather than adding to it, so the page would otherwise use the site-wide image and silently ignore the one next to it
|
|
686
837
|
- [ ] Page-specific OG image set if branding differs from default
|
|
687
838
|
- [ ] Exactly one \`<h1>\` stating the page's primary topic
|
|
688
839
|
- [ ] Heading hierarchy logical (H1 → H2 → H3, no skipped levels)
|
|
@@ -709,7 +860,8 @@ Per Z2W standing org requirement 2026-05-30. Run before adding a new page AND be
|
|
|
709
860
|
## Wired at instantiation by \`@zero2webmaster/starter-kit\`
|
|
710
861
|
|
|
711
862
|
- ✅ \`app/layout.tsx\` — root metadata + JSON-LD Organization
|
|
712
|
-
- ✅ \`app/page.tsx\` — per-page metadata template
|
|
863
|
+
- ✅ \`app/page.tsx\` — per-page metadata template, built with \`pageMetadata()\`
|
|
864
|
+
- ✅ \`lib/seo/page-metadata.ts\` — the one metadata builder; closes the shallow-merge trap by emitting a COMPLETE \`openGraph\` + \`twitter\` object on every page
|
|
713
865
|
- ✅ \`app/sitemap.ts\`
|
|
714
866
|
- ✅ \`app/robots.ts\` (indexable requires production **and** a real canonical domain — see \`lib/seo/canonical-host.mjs\`)
|
|
715
867
|
- ⚠️ \`robots.txt\` + \`sitemap.xml\` are PRERENDERED at build time. Until \`NEXT_PUBLIC_SITE_URL\` is your real domain this site is \`Disallow: /\` **by design**; setting the env var requires a **redeploy** to take effect. Verify with \`curl https://your-domain/robots.txt\`.
|
|
@@ -806,6 +958,10 @@ export function scaffoldNextjs(inputs, opts) {
|
|
|
806
958
|
path: "lib/seo/canonical-host.mjs",
|
|
807
959
|
content: sub(CANONICAL_HOST_MODULE_TEMPLATE, inputs, opts, spec),
|
|
808
960
|
},
|
|
961
|
+
{
|
|
962
|
+
path: "lib/seo/page-metadata.ts",
|
|
963
|
+
content: sub(PAGE_METADATA_MODULE_TEMPLATE, inputs, opts, spec),
|
|
964
|
+
},
|
|
809
965
|
{ path: "tsconfig.json", content: sub(TSCONFIG_TEMPLATE, inputs, opts, spec) },
|
|
810
966
|
{ path: "app/layout.tsx", content: sub(APP_LAYOUT_TEMPLATE, inputs, opts, spec) },
|
|
811
967
|
{ path: "app/page.tsx", content: sub(APP_PAGE_TEMPLATE, inputs, opts, spec) },
|
|
@@ -863,6 +1019,11 @@ export const NEXTJS_SEO_BASELINE_PATHS = [
|
|
|
863
1019
|
// indexability gate in app/robots.ts and the alias redirect in next.config.mjs
|
|
864
1020
|
// both read it — a scaffold missing it has no indexability gate at all.
|
|
865
1021
|
"lib/seo/canonical-host.mjs",
|
|
1022
|
+
// The one metadata builder. Part of the baseline because a scaffold without
|
|
1023
|
+
// it has no defence against Next's shallow per-top-level-key metadata merge —
|
|
1024
|
+
// the second page added to the project silently strips og:type / og:site_name
|
|
1025
|
+
// and downgrades the Twitter card.
|
|
1026
|
+
"lib/seo/page-metadata.ts",
|
|
866
1027
|
"app/opengraph-image.tsx",
|
|
867
1028
|
// Fathom (SEO baseline item 7) — the three-file pattern; the loader alone
|
|
868
1029
|
// (data-auto="false" with no RouteTracker) records zero pageviews.
|
package/dist/standards.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface StandardsResolution {
|
|
|
51
51
|
* family — the safe default for anything else with `has_web_ui=true`.
|
|
52
52
|
*/
|
|
53
53
|
export declare function fathomEnvVarFor(projectType: ProjectType): string;
|
|
54
|
-
export declare const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.
|
|
54
|
+
export declare const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.16";
|
|
55
55
|
/**
|
|
56
56
|
* Resolve which standards apply to `inputs` and render the standards markdown
|
|
57
57
|
* body suitable for `.replace()`-ing into the `<!-- STANDARDS_BLOCK -->`
|
package/dist/standards.js
CHANGED
|
@@ -309,7 +309,8 @@ const SENTRY_BODY = `### Sentry runtime-error tracking (customer-facing web app)
|
|
|
309
309
|
> 2. **DSN lives in config, NOT an env var.** The DSN is a publishable identifier (not a secret) — hard-code it in the Sentry config files the wizard generates; do NOT introduce a \`NEXT_PUBLIC_SENTRY_DSN\`. The one real secret is \`SENTRY_AUTH_TOKEN\` (build-time source-map upload) — scope it **Production-only** in Vercel and keep it out of the client bundle.
|
|
310
310
|
> 3. **Feature-flag defaults:** Tracing sample rate 1.0 (100%) at Z2W volume; Session Replay 10% of sessions / 100% of sessions-with-errors; Logs on; \`sendDefaultPii: true\` — with the caveat that a Sentry payload then carries user IP + request headers, so never forward it verbatim into a shared surface (e.g. the bulletin \`## Incidents\` pipe strips to summary + link + timestamp).
|
|
311
311
|
> 4. **Smoke it, then delete the smoke.** Add a throwaway auth-gated server-throw route (\`/api/boom\` style), confirm the error + replay land in Sentry and the alert email fires, then DELETE the route and the wizard's noisy example page (it's a honeypot that inflates your error count). Ship this cleanup as its own small commit.
|
|
312
|
-
> 5. **
|
|
312
|
+
> 5. **The wizard writes \`silent: !process.env.CI\`, so a missing \`SENTRY_AUTH_TOKEN\` is SILENT LOCALLY and LOUD ON CI.** Quiet on your machine is by configuration, not by design — \`CI\` is unset locally and Vercel sets \`CI=1\`, where the plugin warns **three times, once per runtime**. So do NOT conclude from a clean local build that source-map upload emits nothing: **grep the deployed build log for \`No auth token provided\`** — a free check that beats a manual dashboard visit. (Reported by \`site-control\` 2026-07-30 after documenting the opposite in five places from a local measurement. The general shape, which is worth more than the Sentry detail: **a fact established under one configuration silently changes meaning under another** — so print or fetch what actually resolved, in the environment that will run it.)
|
|
313
|
+
> 6. **2025 Sentry-UI quirks that waste time:** issue **alert rules** live at \`/alerts/rules/\` (NOT \`/monitors/alerts/\`); the "Test Notification" button does NOT auto-save the rule (save explicitly or it evaporates); the wizard's example page throws on every load until you remove it.
|
|
313
314
|
>
|
|
314
315
|
> **When to SKIP (do not wire Sentry):** WordPress sites (error tracking via Z2W Admin Suite Diagnostics + FluentSMTP logs); CLI libraries and protocol repos (no request surface); Cloudflare Workers / node-service / python-service that are API-only (the \`-i nextjs\` wizard doesn't fit — revisit per-runtime later); internal-only admin tools with a single operator who sees errors directly. The rule of thumb: wire it for any public-or-customer-facing Next.js / CF-Pages app that will have real users.
|
|
315
316
|
>
|
|
@@ -325,7 +326,7 @@ const NEON_CAREFUL_BODY = `### Neon-careful (Neon Postgres)
|
|
|
325
326
|
// `zero2webmaster/z2w-agent-coordination`'s AGENT_PROTOCOL.md when the embedded
|
|
326
327
|
// block's mechanics change (drift-detection Signal A greps for this exact token).
|
|
327
328
|
// When you sync a newer canonical block below, bump this to match its comment.
|
|
328
|
-
export const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.
|
|
329
|
+
export const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.16";
|
|
329
330
|
/**
|
|
330
331
|
* The Agent Coordination section, emitted as its own TOP-LEVEL `## Agent
|
|
331
332
|
* Coordination` section (NOT a `###` standards subsection). The bulk is the
|