@forumone/create-throughline 0.4.0 → 1.0.0-next.2

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 (50) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/generator.d.ts.map +1 -1
  3. package/dist/generator.js +4 -3
  4. package/dist/generator.js.map +1 -1
  5. package/dist/post-install.d.ts.map +1 -1
  6. package/dist/post-install.js +6 -2
  7. package/dist/post-install.js.map +1 -1
  8. package/dist/templates/base/.env.example +22 -8
  9. package/dist/templates/base/CLAUDE.md +112 -0
  10. package/dist/templates/base/README.md +39 -8
  11. package/dist/templates/base/apps/web/e2e/site.ts +36 -0
  12. package/dist/templates/base/apps/web/e2e/smoke.spec.ts +52 -0
  13. package/dist/templates/base/apps/web/package.json.template +26 -25
  14. package/dist/templates/base/apps/web/playwright.config.ts +63 -0
  15. package/dist/templates/base/apps/web/src/access/anonymousAccess.test.ts +33 -0
  16. package/dist/templates/base/apps/web/src/app/api/inngest/route.ts.template +15 -79
  17. package/dist/templates/base/apps/web/src/instrumentation.ts +35 -0
  18. package/dist/templates/base/apps/web/src/lib/cache-tags.ts +23 -0
  19. package/dist/templates/base/apps/web/src/lib/inngest.ts.template +7 -0
  20. package/dist/templates/base/apps/web/src/payload.config.ts.template +138 -123
  21. package/dist/templates/base/apps/web/vitest.config.ts +56 -0
  22. package/dist/templates/base/claude/hooks/gate.sh +45 -0
  23. package/dist/templates/base/claude/settings.json +16 -0
  24. package/dist/templates/base/github/workflows/ci.yml +28 -3
  25. package/dist/templates/base/gitignore +9 -0
  26. package/dist/templates/base/package.json.template +1 -0
  27. package/dist/templates/base/scripts/check-tested-packages.ts +0 -2
  28. package/dist/templates/base/turbo.json +0 -1
  29. package/dist/templates/with-reference-ds/design-system/package.json.template +1 -1
  30. package/dist/templates/with-reference-ds/design-system/scripts/build-manifest.ts +1 -1
  31. package/dist/templates/with-reference-ds/design-system/scripts/validate.ts +3 -3
  32. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.contract.ts +1 -1
  33. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.contract.ts +1 -1
  34. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.contract.ts +1 -1
  35. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.contract.ts +2 -1
  36. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.contract.ts +1 -1
  37. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.contract.ts +1 -1
  38. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.contract.ts +1 -1
  39. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.contract.ts +1 -1
  40. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.contract.ts +1 -1
  41. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.contract.ts +1 -1
  42. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.contract.ts +1 -1
  43. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.contract.ts +1 -1
  44. package/dist/templates/with-reference-ds/design-system/src/tokens/index.ts +1 -1
  45. package/dist/utils/versions.d.ts +3 -3
  46. package/dist/utils/versions.d.ts.map +1 -1
  47. package/dist/utils/versions.js +14 -8
  48. package/dist/utils/versions.js.map +1 -1
  49. package/dist/versions.json +2 -12
  50. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # @forumone/create-throughline
2
2
 
3
+ ## 1.0.0-next.2
4
+
5
+ ### Major Changes
6
+
7
+ - 1595db1: The scaffold builds a 1.0 site. It depends on `@forumone/throughline` and, with the reference design system, `@forumone/throughline-design-system`, rather than on the nine 0.x packages. `payload.config.ts` registers the suite with one `throughline()` call, and `app/api/inngest/route.ts` serves `suite.jobs`, with the one Inngest client in `lib/inngest.ts`. Forms is no longer scaffolded, nor is `FORMS_IP_HASH_SECRET` asked for. The template's stub approval resolver, which overrode the approvals plugin's own and so blocked every publish that required approval, is gone.
8
+
9
+ From 1.0 the scaffolder is versioned with `@forumone/throughline` and `@forumone/throughline-design-system`: one version across the three.
10
+
11
+ ## 0.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 006ae30: A missing environment variable is reported together with every other one, in a
16
+ single error, instead of one plugin at a time.
17
+
18
+ The plugins that read the environment at init now declare what they cannot
19
+ start without, as data: `approvalsEnv` (`APPROVAL_TOKEN_SECRET`, 32+
20
+ characters), `emailEnv` (`RESEND_API_KEY`, `EMAIL_FROM_ADDRESS`) and `formsEnv`
21
+ (`FORMS_IP_HASH_SECRET`, 32+ characters). Each is a list of `EnvRequirement`
22
+ (`{ name, minLength?, why }`), a new type in `plugin-contract`, and each
23
+ plugin's own init check now reads the same entries, so the two cannot drift.
24
+ An empty or whitespace-only value now counts as missing in those checks.
25
+
26
+ Core exports `assertEnvironment(...checks)`. Call it first in
27
+ `payload.config.ts` with the plugins' lists and your own variables; it throws
28
+ one `EnvironmentError` whose first line reads "Configuration problem: N
29
+ environment variables are missing or invalid", followed by every missing or
30
+ too-short variable and why it is needed. Values are never printed. An argument
31
+ can also be a function, for a rule that is not "this name, this long", such as
32
+ a database URL accepted under several names. `checkEnvValue` is the one-value
33
+ check behind it, for a plugin's own backstop.
34
+
35
+ New projects call `assertEnvironment` at the top of `payload.config.ts` with
36
+ `approvalsEnv`, `emailEnv`, `formsEnv`, `PAYLOAD_SECRET` (32+ characters),
37
+ `NEXT_PUBLIC_SERVER_URL` and the database resolver, and `.env.example` marks
38
+ which variables are checked. An existing site can do the same and delete any
39
+ hand-kept copy of the plugins' requirements.
40
+
41
+ - 833c1bd: A scaffolded project ships the rules an agent, or a new developer, needs:
42
+
43
+ - **`CLAUDE.md`** covers the layout, the gate in CI's own order, which files are generated and committed, how migrations and snapshots work, and the contract rule for the design system.
44
+ - **A Stop hook** (`.claude/hooks/gate.sh`) runs typecheck and lint when a session ends with pending changes. It reports, never blocks, and is silenced by `THROUGHLINE_SKIP_GATE=1`.
45
+
46
+ The README's project layout now matches what the scaffold generates.
47
+
48
+ - 549d292: A scaffolded project runs every Payload CLI script — `payload`, `generate:types`, `generate:importmap`, `migrate`, `migrate:create`, `migrate:status` — through core's `throughline-payload`, so a hung run is killed rather than left spinning after its shell dies. It adds `payload:reap` to `apps/web` and the root, and ignores `.payload-cli-pids`.
49
+ - 70385c4: A scaffolded project reports its failures. `apps/web/src/instrumentation.ts` sends unhandled request errors to `ERROR_WEBHOOK_URL` through core's reporter, and warns at boot when that variable is unset. The Inngest route passes `createTerminalFailureHandler` to every framework workflow and `createHealthcheckFailureHandler` to the healthcheck. `payload.config.ts` registers `jobFailuresPlugin`. `.env.example` lists `ERROR_WEBHOOK_URL` as optional.
50
+
51
+ A new project's first migration includes the `job-failures` table. An existing project that copies these changes needs `payload migrate:create`.
52
+
53
+ - c8a86bf: A scaffolded project now starts with tests in `apps/web`:
54
+
55
+ - **Vitest.** `vitest.config.ts` loads `payload.config.ts` with placeholder variables and no database. `src/access/anonymousAccess.test.ts` uses `describeAnonymousAccess` to put every collection the project has into an access bucket. `pnpm test` runs it in CI's `fast` job. `check:tested` drops its exception for `apps/web`.
56
+ - **Playwright smoke pack.** `e2e/` runs against `next start`, or against `E2E_BASE_URL`. It checks the front door, a 404, the admin sign-in screen, and anonymous REST reads. The paths are in `e2e/site.ts`, along with the checks a new project cannot pass yet because it does not serve the routes they test. It runs in CI's `verify` job after the build. The new scripts are `test`, `test:smoke` and `test:smoke:install`.
57
+ - **`pages` read rule.** The example `pages` collection gains a published-or-signed-in `read` rule. Before, Payload's default refused every anonymous read, so the public site could never read a page.
58
+
59
+ ### Patch Changes
60
+
61
+ - c8a86bf: The `Divider` contract now declares `decorative` with `defaultValue: true`, matching the component. Before, the default was written only in prose, so a divider added in the CMS started unticked and screen readers announced it.
62
+ - ab623e1: The scaffolded `payload.config.ts` uses core's `mcpApiKeyAccess(isAdmin)` to make the MCP key collection admin-only, replacing the inline override. It now also covers `unlock` and refuses a key principal outright. The scaffold depends on `payload` and `@payloadcms/*` `^3.89.0`.
63
+ - 653817e: Revalidation no longer guesses paths, and covers the changes a publish event never announces.
64
+
65
+ - **workflows (breaking)**: `createRevalidateOnPublishFunction` has no built-in URL
66
+ builders. They mapped `pages` to `/<slug>`, `posts` to `/blog/<slug>` and any other
67
+ collection to `/<slug>`, so a site whose routes differed revalidated the wrong path
68
+ without a word. `urlBuilders` is now required; a collection with no entry has its
69
+ tags dropped and no path revalidated, and the run logs a warning. To keep the old
70
+ behaviour, pass the old builders:
71
+
72
+ ```ts
73
+ urlBuilders: {
74
+ pages: (slug) => (slug === 'home' || slug === '' ? '/' : `/${slug}`),
75
+ posts: (slug) => `/blog/${slug}`,
76
+ }
77
+ ```
78
+
79
+ and then check them against your routes.
80
+
81
+ - **workflows**: `createTagRevalidationHooks` — collection `afterChange` and
82
+ `afterDelete`, and global `afterChange`, hooks that call
83
+ `revalidateTag(tag, { expire: 0 })`. Draft saves and autosave drop nothing (via
84
+ publishing's `isDraftWrite`); an unpublish still does. A hook never throws: outside a
85
+ Next request (seeds, migrations, the CLI) it logs at `debug`, and any other failure
86
+ at `error` with the tag and the cause.
87
+ - **workflows**: `createCacheTags` builds every tag string, so the hooks, the publish
88
+ workflow (new `cacheTags` option) and cached reads cannot name different tags.
89
+ Defaults: the bare slug for a collection, `global_<slug>` for a global. Also on the
90
+ dependency-free `@forumone/throughline-workflows/cache-tags` subpath for frontend code.
91
+ `@forumone/throughline-publishing` is now a dependency of this package.
92
+ - **create-throughline**: the scaffold adds `apps/web/src/lib/cache-tags.ts`, attaches
93
+ the tag hooks to `Pages`, and passes explicit `urlBuilders` and the shared
94
+ `cacheTags` to the publish workflow.
95
+
3
96
  ## 0.4.0
4
97
 
5
98
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAa,MAA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EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC7F;AAED,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED;;;;;;;;;GASG;AACH,iBAAe,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAmClF;AAiBD,iBAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI3C;AAeD,iBAAS,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AA6BD,eAAO,MAAM,SAAS;;;;;;;CAAsE,CAAA"}
package/dist/generator.js CHANGED
@@ -117,13 +117,14 @@ function isBinary(filename) {
117
117
  /**
118
118
  * npm strips files literally named `.gitignore` from a published tarball, so
119
119
  * we author them as `gitignore` in templates and restore the dot on output.
120
- * `.github` goes the same way: a dot-directory in a tarball is at the mercy of
121
- * whichever ignore rules the publishing npm applies, and the scaffold's CI is
122
- * not something to lose silently.
120
+ * `.github` and `.claude` go the same way: a dot-directory in a tarball is at
121
+ * the mercy of whichever ignore rules the publishing npm applies, and neither
122
+ * the scaffold's CI nor its agent setup is something to lose silently.
123
123
  */
124
124
  const DOTFILE_RENAMES = {
125
125
  gitignore: '.gitignore',
126
126
  github: '.github',
127
+ claude: '.claude',
127
128
  };
128
129
  function applyDotfileRename(name) {
129
130
  return DOTFILE_RENAMES[name] ?? name;
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA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AQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"post-install.d.ts","sourceRoot":"","sources":["../src/post-install.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwFrD"}
1
+ {"version":3,"file":"post-install.d.ts","sourceRoot":"","sources":["../src/post-install.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6FrD"}
@@ -27,7 +27,12 @@ export function printNextSteps(answers) {
27
27
  lines.push(formatStep(step++, 'Generate required secrets:'));
28
28
  lines.push(` ${pc.dim('openssl rand -base64 48 # PAYLOAD_SECRET')}`);
29
29
  lines.push(` ${pc.dim('openssl rand -base64 48 # APPROVAL_TOKEN_SECRET')}`);
30
- lines.push(` ${pc.dim('openssl rand -base64 48 # FORMS_IP_HASH_SECRET')}`);
30
+ // The config imports the design system's built manifest, and every Payload
31
+ // command below loads the config. `pnpm dev` builds it too, but runs last.
32
+ if (answers.useReferenceDs) {
33
+ lines.push(formatStep(step++, 'Build the design system, which the Payload config reads:'));
34
+ lines.push(` ${pc.dim('pnpm --filter ./design-system build')}`);
35
+ }
31
36
  // `push: false`: the schema exists only once a migration has created it.
32
37
  lines.push(formatStep(step++, 'Create and apply the first migration:'));
33
38
  lines.push(` ${pc.dim('pnpm --dir apps/web migrate:create initial')}`);
@@ -57,7 +62,6 @@ export function printNextSteps(answers) {
57
62
  const customizations = [
58
63
  'Replace the example Pages collection with your content model',
59
64
  'Implement the groupResolver and user resolvers in payload.config.ts',
60
- 'Add your destinations to the formsPlugin allowlist',
61
65
  ];
62
66
  if (!answers.useReferenceDs) {
63
67
  customizations.push('Point componentsPlugin at your design system manifest URL');
@@ -1 +1 @@
1
- {"version":3,"file":"post-install.js","sourceRoot":"","sources":["../src/post-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAA;IAE7D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,CACR,UAAU,CACR,IAAI,EAAE,EACN,QAAQ,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,qBAAqB,CACjF,CACF,CAAA;IAED,IAAI,OAAO,CAAC,gBAAgB,KAAK,MAAM,EAAE,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,qEAAqE,CAAC,EAAE,CAAC,CAAA;IACvG,CAAC;SAAM,IAAI,OAAO,CAAC,gBAAgB,KAAK,UAAU,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,gFAAgF,CAAC,EAAE,CAAC,CAAA;IAClH,CAAC;SAAM,CAAC;QACN,KAAK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AG,CAAC,IAAI,IAAI,EAAE,CAAA;AACxC,CAAC"}
@@ -1,9 +1,17 @@
1
- # --- Required ---
1
+ # Every variable marked "checked at startup" is listed in the assertEnvironment
2
+ # call at the top of apps/web/src/payload.config.ts, which reports all the
3
+ # missing or too-short ones in a single error before anything else runs. Add a
4
+ # variable there when you add one here that the site cannot start without.
5
+
6
+ # --- Required (checked at startup) ---
7
+ # The database may come from DATABASE_URI or, on Vercel + Neon, the
8
+ # integration's DATABASE_URL and friends — see apps/web/src/lib/database.ts.
2
9
  DATABASE_URI=postgres://user:pass@host/dbname
3
10
  # Optional: a schema-owner credential used only by `pnpm migrate`, so the app
4
11
  # itself can run as a role that reads and writes rows and no more. See
5
12
  # apps/web/src/lib/database.ts.
6
13
  # MIGRATION_DATABASE_URL=
14
+ # 32+ characters. Generate: openssl rand -base64 48
7
15
  PAYLOAD_SECRET=generate-with-openssl-rand-base64-48
8
16
  NEXT_PUBLIC_SERVER_URL=http://localhost:3000
9
17
 
@@ -13,26 +21,32 @@ NEXT_PUBLIC_SERVER_URL=http://localhost:3000
13
21
  INNGEST_EVENT_KEY=
14
22
  INNGEST_SIGNING_KEY=
15
23
 
16
- # --- Resend (for approval + form notification emails) ---
24
+ # --- Resend (for approval notification emails) ---
25
+ # RESEND_API_KEY and EMAIL_FROM_ADDRESS are checked at startup (emailEnv).
17
26
  RESEND_API_KEY=
18
27
  EMAIL_FROM_ADDRESS=notifications@example.com
28
+ # Optional.
19
29
  EMAIL_FROM_NAME={{projectName}}
20
30
  EMAIL_REPLY_TO=
21
31
 
22
- # --- Approval tokens ---
23
- # Generate: openssl rand -base64 48
32
+ # --- Approval tokens (checked at startup: approvalsEnv) ---
33
+ # 32+ characters. Generate: openssl rand -base64 48
24
34
  APPROVAL_TOKEN_SECRET=
25
35
 
26
- # --- Forms ---
27
- # Generate: openssl rand -base64 48
28
- FORMS_IP_HASH_SECRET=
29
-
30
36
  # --- MCP ---
31
37
  # No keys here. Every Throughline tool is served on one /api/mcp by
32
38
  # @payloadcms/plugin-mcp; create a key in the admin under MCP -> Payload MCP
33
39
  # API Keys and give it to your MCP client, not to this file. Scheduled
34
40
  # publishes run in process and need no key either.
35
41
 
42
+ # --- Optional: error reporting ---
43
+ # Where unhandled request errors, workflows that ran out of retries and failing
44
+ # healthchecks are POSTed as JSON (with a one-line `text`, so a Slack incoming
45
+ # webhook works as-is). A log drain, an alerting endpoint or a proxy in front of
46
+ # your error tracker. Unset: errors reach the log only, and the server says so
47
+ # at boot. Job failures are also recorded in the admin under Job Failures.
48
+ ERROR_WEBHOOK_URL=
49
+
36
50
  # --- Optional: storage ---
37
51
  # Vercel Blob token if deploying to Vercel; remove this and the storage
38
52
  # adapter from payload.config.ts if you're using a different provider.
@@ -0,0 +1,112 @@
1
+ # {{projectName}}
2
+
3
+ A **Throughline** project: a Payload CMS application (`apps/web`) wired to the
4
+ Throughline plugin suite, plus the design system that supplies its component
5
+ vocabulary. Throughline docs: https://github.com/forumone/throughline
6
+
7
+ ```
8
+ apps/web/ Next.js + Payload host
9
+ design-system/ The design system and its Storybook
10
+ scripts/ Workspace gates, each explained at the top of its file
11
+ .github/ CI: `fast` on every pull request, `verify` on main
12
+ ```
13
+
14
+ ## The gate
15
+
16
+ This is what CI's `fast` job runs, in its order. Run it before calling work
17
+ done:
18
+
19
+ ```bash
20
+ pnpm install --frozen-lockfile \
21
+ && pnpm typecheck && pnpm lint \
22
+ && pnpm check:instances && pnpm check:tested && pnpm check:migrations \
23
+ && pnpm validate \
24
+ && bash .github/scripts/check-generated.sh \
25
+ && pnpm test
26
+ ```
27
+
28
+ `--frozen-lockfile` leads because a lockfile missing an entry passes every
29
+ other gate locally and fails in CI. `check-generated.sh` needs the environment
30
+ `payload.config.ts` validates; the placeholders at the top of
31
+ `.github/workflows/ci.yml` are enough — it parses the connection string and
32
+ never connects.
33
+
34
+ `verify` adds a migrated Postgres and `pnpm build`; it runs on main.
35
+
36
+ A Stop hook (`.claude/hooks/gate.sh`) runs typecheck and lint when a session
37
+ ends with pending changes. It reports and never blocks. Set
38
+ `THROUGHLINE_SKIP_GATE=1` to silence it.
39
+
40
+ ## Generated files are committed — never hand-edit them
41
+
42
+ After any change to `payload.config.ts`, a collection or a plugin version:
43
+
44
+ ```bash
45
+ pnpm --dir apps/web generate:types # -> src/payload-types.ts
46
+ pnpm --dir apps/web generate:importmap # -> src/app/(payload)/admin/importMap.js
47
+ ```
48
+
49
+ Commit both. CI regenerates them and fails on a difference. A stale import map
50
+ is a 500 on any admin screen that renders a component it has never heard of;
51
+ stale types make everything downstream compile against a schema that no longer
52
+ exists.
53
+
54
+ ## Schema changes go through migrations
55
+
56
+ `push` is off, in development too: `apps/web/src/migrations` is the only way the
57
+ schema changes.
58
+
59
+ ```bash
60
+ pnpm --dir apps/web migrate:create <name> # diffs the config against the newest snapshot
61
+ pnpm --dir apps/web migrate # apply
62
+ pnpm --dir apps/web migrate:snapshot # only after hand-writing a migration
63
+ ```
64
+
65
+ `migrate:create` diffs against the `.json` snapshot beside the newest migration,
66
+ **not the database**. A hand-written migration without its snapshot leaves the
67
+ generator a step behind, re-proposing changes that already shipped.
68
+ `check:migrations` fails on a missing or orphaned snapshot, and on a drop that a
69
+ `CASCADE` has already carried out.
70
+
71
+ The `payload` CLI loads `.env.local`; `tsx` scripts load nothing. For anything
72
+ that writes to a database, pass the variables on the command line and use
73
+ `requireTarget` from `apps/web/scripts/lib/target.ts`, which prints the target
74
+ and demands `--confirm` before overwriting.
75
+
76
+ ## The design system reaches the CMS through its manifest
77
+
78
+ `payload.config.ts` hands the design system's manifest to `componentsPlugin`,
79
+ and that manifest is how the CMS knows which components exist and how they may
80
+ be composed. It is built from a `<Name>.contract.ts` beside every component.
81
+ {{#if useReferenceDs}}
82
+ - **A new component needs a contract.** `build:manifest` refuses a component
83
+ directory without one; prefix a directory with `_` if it is not a component.
84
+ - **`pnpm validate` must pass.** It catches an unknown token, a composition rule
85
+ naming a component that does not exist, and an example pointing at a story
86
+ that is not there.
87
+ {{else}}
88
+ The design system here is a placeholder. When you build it, give every
89
+ component a contract, publish a manifest, and point `componentsPlugin` at it —
90
+ see `@forumone/throughline-design-system` in the Throughline repository.
91
+ {{/if}}
92
+ ## Tests
93
+
94
+ `check:tested` requires at least one test in every package that ships code.
95
+
96
+ `apps/web` starts with one: `src/access/anonymousAccess.test.ts`, which
97
+ `pnpm test` runs through a vitest config that loads `payload.config.ts` without
98
+ a database. It puts every collection in one of two buckets: read by the
99
+ rendered site, so anonymous reads must be allowed, or private, so they must be
100
+ refused. A new collection fails it until you add it to a bucket. Decide which,
101
+ and don't open a collection to anonymous reads to make the test pass. More good
102
+ first tests need no database: field validations, and hooks as functions.
103
+
104
+ `pnpm test:smoke` runs the Playwright smoke pack in `e2e/` against
105
+ `next start`, so build first, or against a deployed site when `E2E_BASE_URL`
106
+ is set. Every check is a GET. CI runs it in `verify`, after the production
107
+ build. Add routes to `e2e/site.ts` as the site gains them.
108
+
109
+ ## Conventions
110
+
111
+ - pnpm only. The lockfile is at the root.
112
+ - Open a pull request for review; do not merge your own.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generated by [`@forumone/create-throughline`](https://github.com/forumone/throughline/tree/main/packages/create-throughline).
4
4
 
5
- This is a Throughline project: a Payload CMS application wired with the Throughline plugin suite (audit, components, publishing, approvals, audit-query, integrations, email, forms) plus an Inngest endpoint that runs the workflow functions.
5
+ This is a Throughline project: a Payload CMS application wired with the Throughline plugin suite (audit, components, publishing, approvals, audit-query, integrations, email) plus an Inngest endpoint that runs the workflow functions.
6
6
 
7
7
  ## Prerequisites
8
8
 
@@ -28,9 +28,14 @@ openssl rand -base64 48
28
28
  # - DATABASE_URI — your Postgres connection string
29
29
  # - PAYLOAD_SECRET — generated above
30
30
  # - APPROVAL_TOKEN_SECRET — generated above
31
- # - FORMS_IP_HASH_SECRET — generated above
32
31
  # - RESEND_API_KEY — from Resend dashboard
32
+ # - EMAIL_FROM_ADDRESS — a verified sender on your Resend domain
33
33
  # - INNGEST_EVENT_KEY/SIGNING — from Inngest (optional in local dev)
34
+ #
35
+ # Anything missing or too short is reported all at once, in one error that
36
+ # starts "Configuration problem", by the assertEnvironment call at the top
37
+ # of apps/web/src/payload.config.ts — the first command that loads the
38
+ # config (step 5) tells you everything left to fill in.
34
39
 
35
40
  # 5. Create and apply the first migration. The config sets `push: false`, so
36
41
  # migrations are the only way the schema changes, from the first table on.
@@ -75,6 +80,27 @@ pnpm dev
75
80
  - `pnpm typecheck` — TypeScript check across the monorepo
76
81
  - `pnpm lint` — ESLint
77
82
  - `pnpm test` — run all package tests
83
+ - `pnpm payload:reap` — kill any Payload CLI run a killed shell left behind (the next Payload command does this too)
84
+
85
+ Every script that runs the Payload CLI — `payload`, `generate:*`, `migrate*` —
86
+ goes through `throughline-payload` from `@forumone/throughline`. pnpm does
87
+ not forward signals to the node process it starts, so a bare `payload` whose
88
+ shell is killed keeps running, and a hung one spins on a core indefinitely. The
89
+ runner gives Payload its own process group, forwards Ctrl-C and friends to it,
90
+ and kills it after five minutes (`PAYLOAD_CLI_TIMEOUT_MS`, `0` to disable;
91
+ `migrate*` has no limit unless you set one). Run the Payload CLI through these
92
+ scripts rather than `npx payload`.
93
+
94
+ - `pnpm --dir apps/web test:smoke` — the Playwright smoke pack, against a local `next start` (run `pnpm build` first) or `E2E_BASE_URL`
95
+
96
+ ## Tests
97
+
98
+ `apps/web` has two kinds of test.
99
+
100
+ - **`pnpm test`** runs vitest in Node with no database and no browser, so it runs in CI's `fast` job on every pull request. `vitest.config.ts` gives `payload.config.ts` placeholder environment variables, so the config loads without connecting to anything. The first test, `src/access/anonymousAccess.test.ts`, puts every collection into one of two buckets: collections the public site reads with nobody signed in (`renderPath`), and collections it must not read (`private`). It then checks each collection's `read` rule against its bucket. **Adding a collection, or a plugin that brings collections, fails this test until you put each new collection in a bucket.** See the Throughline guide _Adding a collection_.
101
+ - **`pnpm --dir apps/web test:smoke`** is a Playwright smoke pack (`e2e/`) that sends real requests to `next start` on an empty, migrated database. It checks that the front door answers, that an unknown path returns 404, that the admin shows its sign-in screen, and that the REST API refuses anonymous reads of private collections while allowing reads of public ones. It runs in CI's `verify` job, which has a database. Set `E2E_BASE_URL` to run it against a deployed site. Every check is a GET request. The paths it checks are configured in `e2e/site.ts`. That file also lists checks a new project cannot pass yet because it does not serve the route: security headers, `robots.txt`, the sitemap, `llms.txt` and a draft-mode route. Add each check when you add its route.
102
+
103
+ Run `pnpm --dir apps/web test:smoke:install` once to download Chromium.
78
104
 
79
105
  ## Migrations
80
106
 
@@ -109,14 +135,15 @@ map has never heard of.
109
135
  `.github/workflows/ci.yml` runs two tiers. `fast` runs on every pull request
110
136
  and needs no database: install from the lockfile, typecheck, lint, the gates
111
137
  below, manifest validation, the generated-files check and tests. `verify` runs
112
- on pushes to main: it migrates a fresh Postgres and runs a production build.
138
+ on pushes to main: it migrates a fresh Postgres, runs a production build, and
139
+ runs the smoke pack against it.
113
140
 
114
141
  ## Workspace gates
115
142
 
116
143
  Each is explained at the top of its script in `scripts/`:
117
144
 
118
145
  - `pnpm check:instances` — `payload`, `@payloadcms/ui`, `react` and `react-dom` each resolve to exactly one copy. Two byte-identical copies are two React contexts, and a runtime failure nothing else can see.
119
- - `pnpm check:tested` — every workspace package that ships code has at least one test. Not a coverage number. `apps/web` starts on its exception list; delete the entry with your first test.
146
+ - `pnpm check:tested` — every workspace package that ships code has at least one test. Not a coverage number. A package with no tests can go on the exception list in the script, with a reason. An entry fails once that package has tests.
120
147
  - `pnpm check:audit` — high and critical production advisories against an allowlist that carries a reason for each entry, and that fails when an entry stops applying.
121
148
 
122
149
  ## Project layout
@@ -125,10 +152,14 @@ Each is explained at the top of its script in `scripts/`:
125
152
  {{projectName}}/
126
153
  ├── apps/
127
154
  │ └── web/ # Next.js + Payload host
128
- ├── packages/
129
- │ ├── design-system/ # UI components consumed by Components MCP
130
- │ ├── content/ # Reusable collections + blocks (optional)
131
- │ └── brand/ # Brand tokens / email theme (optional)
155
+ │ ├── scripts/ # migration tooling, requireTarget
156
+ │ └── src/migrations/ # the only way the schema changes
157
+ ├── design-system/ # components + contracts -> the manifest the CMS reads
158
+ ├── packages/ # your own shared packages (optional)
159
+ ├── scripts/ # workspace gates
160
+ ├── .claude/ # agent settings and the Stop-hook gate
161
+ ├── .github/ # CI: fast + verify
162
+ ├── CLAUDE.md # the rules an agent (or a new developer) needs
132
163
  ├── .env.example
133
164
  ├── pnpm-workspace.yaml
134
165
  ├── turbo.json
@@ -0,0 +1,36 @@
1
+ /*
2
+ What the smoke pack checks, and where. Site data: change the paths here, not in
3
+ the specs.
4
+
5
+ **What the pack does not check yet, because a fresh project does not serve it.**
6
+ Each is a check worth adding with the route that makes it true:
7
+
8
+ - security headers — `next.config.mjs` sets none. Add `headers()` there, then
9
+ assert them per route: HSTS, `nosniff`, a referrer policy, and framing
10
+ (`DENY` on `/admin`, `SAMEORIGIN` where live preview frames the site).
11
+ - `robots.txt` and `sitemap.xml` — add `app/robots.ts` and `app/sitemap.ts`;
12
+ assert a 200, the content type, and that the sitemap lists each URL once.
13
+ - `llms.txt` — a route serving `text/markdown`, with a heading and links.
14
+ - draft mode — a preview route must refuse a request without its secret
15
+ (401) and one naming no document (400).
16
+ */
17
+ export const site = {
18
+ /**
19
+ * A deployed site to point at, from `E2E_BASE_URL`. Unset, the pack starts
20
+ * `next start` locally on `port`.
21
+ */
22
+ baseURL: process.env.E2E_BASE_URL?.trim() || undefined,
23
+ port: 3100,
24
+
25
+ /** The front door. */
26
+ home: '/',
27
+ /** The Payload admin. On an empty database it asks for the first user. */
28
+ admin: '/admin',
29
+ /** A path nothing serves, which must be a 404 and never a 500. */
30
+ missing: '/a-page-that-was-never-written',
31
+
32
+ /** REST collections an anonymous request must be refused. */
33
+ privateCollections: ['users', 'payload-mcp-api-keys'],
34
+ /** REST collections an anonymous request may read — published documents only. */
35
+ publicCollections: ['pages'],
36
+ }
@@ -0,0 +1,52 @@
1
+ import { expect, test } from '@playwright/test'
2
+ import { site } from './site'
3
+
4
+ test.describe('the front door', () => {
5
+ test('answers with a document and a main landmark', async ({ page }) => {
6
+ const response = await page.goto(site.home)
7
+ expect(response?.status()).toBe(200)
8
+ await expect(page.locator('main')).toBeAttached()
9
+ })
10
+
11
+ test('404s a path that does not exist, rather than erroring', async ({ request }) => {
12
+ const response = await request.get(site.missing, { maxRedirects: 0 })
13
+ expect(response.status()).toBe(404)
14
+ })
15
+ })
16
+
17
+ test.describe('the admin', () => {
18
+ /*
19
+ The whole admin is one client bundle and the import map it reads. A stale
20
+ map, a missing environment variable or a plugin that throws at init all
21
+ surface here as a 500 or a blank screen — and as nothing at all in a test
22
+ that does not load the page.
23
+ */
24
+ test('serves a sign-in screen', async ({ page }) => {
25
+ const response = await page.goto(site.admin)
26
+ expect(response?.status()).toBeLessThan(500)
27
+ await expect(page.getByRole('textbox', { name: /email/i })).toBeVisible({ timeout: 30_000 })
28
+ })
29
+ })
30
+
31
+ test.describe('the REST API, to a request with nobody signed in', () => {
32
+ /*
33
+ The same rules `src/access/anonymousAccess.test.ts` checks as values, here as
34
+ responses: proof that nothing between the rule and the wire — a plugin, an
35
+ endpoint, a framework upgrade — reopened a collection.
36
+ */
37
+ for (const slug of site.privateCollections) {
38
+ test(`refuses to list ${slug}`, async ({ request }) => {
39
+ const response = await request.get(`/api/${slug}`)
40
+ expect(response.status()).toBe(403)
41
+ })
42
+ }
43
+
44
+ for (const slug of site.publicCollections) {
45
+ test(`lists ${slug}`, async ({ request }) => {
46
+ const response = await request.get(`/api/${slug}`)
47
+ expect(response.status()).toBe(200)
48
+ const body = (await response.json()) as { docs?: unknown }
49
+ expect(Array.isArray(body.docs)).toBe(true)
50
+ })
51
+ }
52
+ })
@@ -9,44 +9,45 @@
9
9
  "start": "next start",
10
10
  "clean": "rm -rf .next .turbo",
11
11
  "typecheck": "tsc --noEmit",
12
- "payload": "payload",
13
- "generate:types": "payload generate:types",
14
- "generate:importmap": "payload generate:importmap",
15
- "migrate": "PAYLOAD_MIGRATING=1 payload migrate",
16
- "migrate:create": "payload migrate:create",
17
- "migrate:status": "payload migrate:status",
12
+ "payload": "throughline-payload",
13
+ "payload:reap": "throughline-payload --reap",
14
+ "generate:types": "throughline-payload generate:types",
15
+ "generate:importmap": "throughline-payload generate:importmap",
16
+ "migrate": "PAYLOAD_MIGRATING=1 throughline-payload migrate",
17
+ "migrate:create": "throughline-payload migrate:create",
18
+ "migrate:status": "throughline-payload migrate:status",
18
19
  "migrate:snapshot": "tsx scripts/write-migration-snapshot.ts",
19
- "check:migrations": "tsx scripts/check-migrations.ts"
20
+ "check:migrations": "tsx scripts/check-migrations.ts",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "test:smoke": "playwright test",
24
+ "test:smoke:install": "playwright install --with-deps chromium"
20
25
  },
21
26
  "dependencies": {
22
- "@forumone/throughline-approvals": "^{{version_approvals}}",
23
- "@forumone/throughline-audit": "^{{version_audit}}",
24
- "@forumone/throughline-components": "^{{version_components}}",
25
- "@forumone/throughline-core": "^{{version_core}}",
26
- "@forumone/throughline-email": "^{{version_email}}",
27
- "@forumone/throughline-forms": "^{{version_forms}}",
28
- "@forumone/throughline-integrations": "^{{version_integrations}}",
29
- "@forumone/throughline-publishing": "^{{version_publishing}}",
30
- "@forumone/throughline-workflows": "^{{version_workflows}}",
31
- {{#if useReferenceDs}}"@forumone/throughline-design-contract": "^{{version_design_contract}}",
27
+ "@forumone/throughline": "^{{version_throughline}}",
28
+ {{#if useReferenceDs}}"@forumone/throughline-design-system": "^{{version_design_system}}",
32
29
  "{{designSystemName}}": "workspace:*",
33
- {{/if}}"@payloadcms/db-postgres": "^3.83.0",
34
- "@payloadcms/next": "^3.83.0",
35
- "@payloadcms/plugin-form-builder": "^3.83.0",
36
- "@payloadcms/plugin-mcp": "^3.83.0",
37
- "@payloadcms/richtext-lexical": "^3.83.0",
30
+ {{/if}}"@payloadcms/db-postgres": "^3.89.0",
31
+ "@payloadcms/next": "^3.89.0",
32
+ "@payloadcms/plugin-mcp": "^3.89.0",
33
+ "@payloadcms/richtext-lexical": "^3.89.0",
34
+ "@react-email/components": "^0.5.4",
35
+ "@react-email/render": "^1.3.2",
38
36
  "graphql": "^16.8.1",
39
37
  "inngest": "^4.2.0",
40
38
  "next": "^16.2.4",
41
- "payload": "^3.83.0",
39
+ "payload": "^3.89.0",
42
40
  "react": "^19.2.0",
43
- "react-dom": "^19.2.0"
41
+ "react-dom": "^19.2.0",
42
+ "resend": "^6.1.4"
44
43
  },
45
44
  "devDependencies": {
45
+ "@playwright/test": "^1.63.0",
46
46
  "@types/node": "^20.17.0",
47
47
  "@types/react": "^19.2.0",
48
48
  "@types/react-dom": "^19.2.0",
49
49
  "tsx": "^4.21.0",
50
- "typescript": "^5.6.0"
50
+ "typescript": "^5.6.0",
51
+ "vitest": "^4.1.10"
51
52
  }
52
53
  }