@se-studio/project-build 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @se-studio/project-build
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d2728ab: New `check-content-model` bin. It reads the published Contentful content types (Delivery token preferred, Management token as a fallback) and fails when a type that exists in the space lacks a field core selects or has a conflicting type; absent types are skipped. Run locally with no credentials it skips and exits 0 (`--require-credentials` makes it exit 1). `tagType.slug` is optional when `marketing-routes.json` sets `tagTypeRoutes: false`, and migration 42 then does not add it (set `CONTENT_MODEL_APP_DIR` to the app directory). Fix a failure with core migration `42-add-core-required-fields.js`, not in code. README documents it.
8
+
9
+ ## 1.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 621653a: marketing-routes.json gains `peopleTypeSlug` (CMS custom type slug for people when it differs from the `peopleSlug` URL; written as `PEOPLE_TYPE_SLUG`, kept by `--from-cms --write`) and `segmentConfig` (path-keyed literal `dynamic`, `revalidate`, `dynamicParams`, `fetchCache`, `runtime`, `preferredRegion` exports on generated pages; illegal keys, values and paths are rejected). Bugfix: `enableArticleTypeIndex` is now true only when `articlesSlug` is a non-empty string, so a site with article types and no `articlesSlug` no longer gets a phantom `/articles/` index (regenerate `marketing-flags.ts`). `check-marketing-routes` accepts `route-build-policy.json` entries for pages on `allowHandWrittenPages`. `generate-marketing-routes --write` keeps hand-added `route-build-policy.json` entries for `allowHandWrittenPages` pages, `check-marketing-routes` now fails on an illegal `segmentConfig` instead of swallowing the render error, `enableArticleTypeTagIndex` is documented as intentionally independent of `articlesSlug`, and the README notes that `dynamic: 'force-dynamic'` and `runtime: 'edge'` opt out of static rendering for that route.
14
+
3
15
  ## 1.7.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -121,6 +121,22 @@ See [`packages/skills/README.md`](../skills/README.md) for frontmatter rules.
121
121
 
122
122
  ### CLI Commands
123
123
 
124
+ #### `check-content-model`
125
+ Read only. Lists the published content types in your Contentful space and fails when a type that exists there lacks a field core selects, or has it with a conflicting type (a Link where core needs RichText). Content types that are not in the space are skipped. Symbol and Text count as the same type.
126
+
127
+ ```bash
128
+ pnpm exec check-content-model . # or: pnpm check:content-model
129
+ pnpm exec check-content-model . --require-credentials # exit 1 instead of skipping when credentials are missing
130
+ ```
131
+
132
+ Credentials come from the environment, or from `.env.local` / `.env` in the directory you pass (the environment wins): `CONTENTFUL_SPACE_ID`, `CONTENTFUL_ENVIRONMENT` or `CONTENTFUL_ENVIRONMENT_NAME` (default `master`), and `CONTENTFUL_ACCESS_TOKEN` (Delivery, preferred) or `CONTENTFUL_MANAGEMENT_TOKEN`. Tokens are never printed. Run locally without credentials, the command prints a skip message and exits 0; `--require-credentials` makes that exit 1. The shared `site-ci.yml` job always passes it.
133
+
134
+ `tagType.slug` is required only when the site has tag type routes. With `"tagTypeRoutes": false` in `src/lib/marketing-routes.json` (read from the directory you pass) core falls back to `TAG_TYPE_MINIMAL_FIELDS`, which has no slug, so the check does not require it. Migration 42 reads the same file from `CONTENT_MODEL_APP_DIR` (default: the current directory) and does not add `slug` in that case.
135
+
136
+ When a site gets a 422 on a core select (for example `person.summary`), or this check fails, **run core migration `scripts/migrations/42-add-core-required-fields.js`** (and `37-add-summary-and-tag-parent.js` where it applies), after a human approves it. 42 adds only the missing fields, all optional; it aborts naming any field whose type conflicts and never changes or deletes an existing field. Do not work around a missing field in site code or the marketing-routes allowlist.
137
+
138
+ To run it in site CI, set `run_content_model: true` on the shared `site-ci.yml` workflow and pass `CONTENTFUL_SPACE_ID`, `CONTENTFUL_ACCESS_TOKEN` and optionally `CONTENTFUL_ENVIRONMENT` as workflow secrets (see `customer-guardrails/site-ci.yml`). It is a separate job, off by default; once `run_content_model` is true, missing secrets fail the job. The required field list lives in core (`scripts/content-model-spec.cjs`); a core test fails if the select lists in `listing-fetch-params.ts` gain a field the checker does not require.
139
+
124
140
  #### `generate-marketing-routes` and `check-marketing-routes`
125
141
  Customer sites run these from their own repo (`pnpm generate:routes`); do not copy the scripts.
126
142
 
@@ -182,6 +198,19 @@ An index that is off writes no page (so it 404s) and the matching `enable…Inde
182
198
 
183
199
  That serves `/people/` and `/person/{slug}/`, and `/tag/{slug}/` with no `/tags/`. The generated person and tag pages pass their own served path to the handlers, so the canonical is always the URL that served the page. A config that declares any of the four keys also writes `PERSON_DETAIL_BASE` / `PERSON_DETAIL_SLUG` and `TAG_DETAIL_BASE` / `TAG_DETAIL_SLUG` into `src/generated/marketing-slugs.ts`. Build person and tag links (`section-urls.ts`, `urlCalculators`, sitemap sources) from those constants, not from `PEOPLE_BASE` / `TAGS_BASE`, or internal links point at the index segment while the page lives at the detail segment.
184
200
 
201
+ ##### People custom type slug, segment config, and the article-type index flag
202
+
203
+ | Key | Meaning | Default |
204
+ |-----|---------|---------|
205
+ | `peopleTypeSlug` | CMS custom type slug backing the people section, when it differs from the URL (`/people/` and `/person/{slug}/`, custom type `person`). Written as `PEOPLE_TYPE_SLUG` in `marketing-slugs.ts` and used for `getCustomType`, the person `customType` lookup and the sitemap people backing type. `peopleSlug` / `personSlug` stay the URL segments. `--from-cms --write` keeps it | the value of `peopleSlug` (no constant is written) |
206
+ | `segmentConfig` | `{ "<generated page path>": { "dynamic": "force-static" } }`. Each key is written as `export const key = <literal>;` at the end of that generated page. Allowed keys: `dynamic`, `revalidate`, `dynamicParams`, `fetchCache`, `runtime`, `preferredRegion`, each with a literal value Next.js accepts. An unknown key, a non-literal value, a path that is not a generated page, or a path on `allowHandWrittenPages` is an error. The checker flags a page edited away from it. `--from-cms --write` keeps it | none: no extra exports |
207
+
208
+ `enableArticleTypeIndex` (bugfix, not an opt-in) is `true` only when `articlesSlug` is a non-empty string. It used to be `true` for a site with article types and `articlesSlug: null`, which could add a phantom `/articles/` sitemap entry. Article type index pages at their `indexSlug` are unaffected. `enableArticleTypeTagIndex` is deliberately **not** tied to `articlesSlug`: it stays `tagInPath && (articlesSlug || articleTypes)` because tag-in-path indexes live on article-type routes such as `/resources/events/{tag}/` and need no parent hub. A site with `tagInPath: true`, `articlesSlug: null` and `articleTypes` keeps `enableArticleTypeTagIndex = true` (and `enableArticleTypeIndex = false`), so its tag URLs stay in the sitemap. A site that kept `enableArticleTypeIndex = false` by hand can drop that after regenerating; a site with `articlesSlug` set sees no change.
209
+
210
+ **`segmentConfig` trades away static rendering.** `dynamic: 'force-dynamic'` and `runtime: 'edge'` are accepted by design, as opt-ins. Each one removes static rendering (SSG/ISR, and the R5 `mustBeSsgOrStatic` guarantee for that route) from that generated CMS route: the page renders per request, or on the edge runtime with its limits. Use them only on a page that really needs it. `force-static`, `revalidate` and `dynamicParams` keep the route static. `check-marketing-routes` fails when `segmentConfig` is illegal (unknown key, non-literal value, a path that is not a generated page or is on `allowHandWrittenPages`), the same error `generate-marketing-routes` reports.
211
+
212
+ **Hand-added build policy for allowlisted pages.** `generate-marketing-routes --write` regenerates the generated-route entries of `mustBeSsgOrStatic` but keeps hand-added entries that match an `allowHandWrittenPages` entry by URL shape; other unknown routes are dropped. `check-marketing-routes` accepts a `route-build-policy.json` `mustBeSsgOrStatic` entry whose route matches an `allowHandWrittenPages` entry (by URL shape), so a hand-written page keeps the SSG guard. A route that is neither generated nor allowlisted still fails.
213
+
185
214
  **Keep a custom tag listing or filter.** Pass `renderTagListing` to `createRouteHandlers` in `src/lib/route-handlers.ts`. `generateTagPage` calls it after the tag's own content and renders the result inside the layout, so the generated `tag/[tag]` page keeps the site's filter tabs and article list with no hand-written route and no generator fork:
186
215
 
187
216
  ```tsx
@@ -0,0 +1,182 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Fail when a Contentful content type that exists in the space lacks a field core selects,
4
+ * or has it with a conflicting type. Content types absent from the space are skipped.
5
+ * Read only: it never changes the space. Fix a failure with migration 42
6
+ * (scripts/migrations/42-add-core-required-fields.js), not in code.
7
+ *
8
+ * Credentials (env, or <dir>/.env.local and <dir>/.env; the environment wins):
9
+ * CONTENTFUL_SPACE_ID
10
+ * CONTENTFUL_ENVIRONMENT or CONTENTFUL_ENVIRONMENT_NAME (default master)
11
+ * CONTENTFUL_ACCESS_TOKEN (Delivery, preferred) or CONTENTFUL_MANAGEMENT_TOKEN
12
+ * Missing credentials exit 0 with a skip message for a local run. Pass --require-credentials to
13
+ * exit 1 instead; the shared site-ci.yml job always passes it, so a mis-wired site fails.
14
+ * Tokens are never printed. tagType.slug is optional when <dir>/src/lib/marketing-routes.json
15
+ * sets tagTypeRoutes: false (core falls back to TAG_TYPE_MINIMAL_FIELDS).
16
+ *
17
+ * Usage (core): node scripts/check-content-model.mjs [app-dir] [--require-credentials]
18
+ * Usage (customer): check-content-model [app-dir] [--require-credentials] (@se-studio/project-build bin)
19
+ */
20
+
21
+ import fs from 'node:fs';
22
+ import { createRequire } from 'node:module';
23
+ import path from 'node:path';
24
+ import { fileURLToPath } from 'node:url';
25
+
26
+ const require = createRequire(import.meta.url);
27
+ const { REQUIRED_FIELDS, diffContentType, readTagTypeRoutes } = require('./content-model-spec.cjs');
28
+
29
+ /** Minimal dotenv: KEY=VALUE lines, optional quotes, no expansion. */
30
+ export function parseEnvFile(text) {
31
+ const out = {};
32
+ for (const line of text.split(/\r?\n/)) {
33
+ const m = line.match(/^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*?)\s*$/);
34
+ if (!m) {
35
+ continue;
36
+ }
37
+ let value = m[2];
38
+ if (/^(["']).*\1$/.test(value)) {
39
+ value = value.slice(1, -1);
40
+ } else {
41
+ value = value.replace(/\s+#.*$/, '');
42
+ }
43
+ out[m[1]] = value;
44
+ }
45
+ return out;
46
+ }
47
+
48
+ function loadEnv(dir, env) {
49
+ const merged = { ...env };
50
+ for (const name of ['.env.local', '.env']) {
51
+ const file = path.join(dir, name);
52
+ if (!fs.existsSync(file)) {
53
+ continue;
54
+ }
55
+ for (const [key, value] of Object.entries(parseEnvFile(fs.readFileSync(file, 'utf8')))) {
56
+ if (merged[key] === undefined || merged[key] === '') {
57
+ merged[key] = value;
58
+ }
59
+ }
60
+ }
61
+ return merged;
62
+ }
63
+
64
+ /**
65
+ * @returns {{ spaceId: string, environment: string, token: string, api: 'cda' | 'cma' } | null}
66
+ */
67
+ export function resolveCredentials(env) {
68
+ const spaceId = env.CONTENTFUL_SPACE_ID;
69
+ const environment = env.CONTENTFUL_ENVIRONMENT || env.CONTENTFUL_ENVIRONMENT_NAME || 'master';
70
+ if (!spaceId) {
71
+ return null;
72
+ }
73
+ if (env.CONTENTFUL_ACCESS_TOKEN) {
74
+ return { spaceId, environment, token: env.CONTENTFUL_ACCESS_TOKEN, api: 'cda' };
75
+ }
76
+ if (env.CONTENTFUL_MANAGEMENT_TOKEN) {
77
+ return { spaceId, environment, token: env.CONTENTFUL_MANAGEMENT_TOKEN, api: 'cma' };
78
+ }
79
+ return null;
80
+ }
81
+
82
+ /** Published content types, the same view Delivery selects against. */
83
+ export async function fetchContentTypes(creds, fetchImpl = fetch) {
84
+ const base =
85
+ creds.api === 'cda'
86
+ ? 'https://cdn.contentful.com'
87
+ : 'https://api.contentful.com';
88
+ const tail = creds.api === 'cda' ? 'content_types' : 'public/content_types';
89
+ const url = `${base}/spaces/${encodeURIComponent(creds.spaceId)}/environments/${encodeURIComponent(creds.environment)}/${tail}?limit=1000`;
90
+ const res = await fetchImpl(url, { headers: { Authorization: `Bearer ${creds.token}` } });
91
+ if (!res.ok) {
92
+ throw new Error(
93
+ `Contentful ${creds.api.toUpperCase()} content_types returned HTTP ${res.status} for space ${creds.spaceId} environment ${creds.environment}`,
94
+ );
95
+ }
96
+ const body = await res.json();
97
+ return Array.isArray(body.items) ? body.items : [];
98
+ }
99
+
100
+ /**
101
+ * @param {object[]} contentTypes
102
+ * @param {{ tagTypeRoutes?: boolean }} [options] false: tagType.slug is optional (core falls back)
103
+ * @returns {{ ok: boolean, lines: string[], skipped: string[], checked: string[] }}
104
+ */
105
+ export function checkContentTypes(contentTypes, options = {}) {
106
+ const byId = new Map(contentTypes.map((ct) => [ct?.sys?.id, ct]));
107
+ const lines = [];
108
+ const skipped = [];
109
+ const checked = [];
110
+ for (const id of Object.keys(REQUIRED_FIELDS)) {
111
+ const ct = byId.get(id);
112
+ if (!ct) {
113
+ skipped.push(id);
114
+ continue;
115
+ }
116
+ checked.push(id);
117
+ const { missing, conflicts } = diffContentType(id, ct, options);
118
+ for (const fieldId of missing) {
119
+ lines.push(`${id}.${fieldId}: missing`);
120
+ }
121
+ for (const c of conflicts) {
122
+ lines.push(`${id}.${c.fieldId}: space has ${c.actual}, core needs ${c.expected}`);
123
+ }
124
+ }
125
+ return { ok: lines.length === 0, lines, skipped, checked };
126
+ }
127
+
128
+ /**
129
+ * @param {{ argv?: string[], env?: Record<string, string | undefined>, fetchImpl?: typeof fetch, log?: (s: string) => void, error?: (s: string) => void }} [opts]
130
+ * @returns {Promise<number>} exit code
131
+ */
132
+ export async function run(opts = {}) {
133
+ const argv = opts.argv ?? process.argv.slice(2);
134
+ const log = opts.log ?? console.log;
135
+ const error = opts.error ?? console.error;
136
+ const requireCredentials = argv.includes('--require-credentials');
137
+ const dir = path.resolve(argv.find((a) => !a.startsWith('--')) ?? '.');
138
+ const env = loadEnv(dir, opts.env ?? process.env);
139
+
140
+ const creds = resolveCredentials(env);
141
+ if (!creds) {
142
+ const msg =
143
+ 'check-content-model: no Contentful credentials (need CONTENTFUL_SPACE_ID plus CONTENTFUL_ACCESS_TOKEN or CONTENTFUL_MANAGEMENT_TOKEN).';
144
+ if (requireCredentials) {
145
+ error(`${msg} --require-credentials is set.`);
146
+ return 1;
147
+ }
148
+ log(`${msg} Skipping.`);
149
+ return 0;
150
+ }
151
+
152
+ let contentTypes;
153
+ try {
154
+ contentTypes = await fetchContentTypes(creds, opts.fetchImpl);
155
+ } catch (err) {
156
+ error(`check-content-model: ${err instanceof Error ? err.message : 'request failed'}`);
157
+ return 1;
158
+ }
159
+
160
+ const result = checkContentTypes(contentTypes, {
161
+ tagTypeRoutes: readTagTypeRoutes(dir),
162
+ });
163
+ log(
164
+ `check-content-model: ${creds.spaceId}/${creds.environment} via ${creds.api.toUpperCase()}: checked ${result.checked.join(', ') || 'nothing'}${result.skipped.length ? `; not in space: ${result.skipped.join(', ')}` : ''}`,
165
+ );
166
+ if (!result.ok) {
167
+ error('Content model is missing fields core selects:');
168
+ for (const line of result.lines) {
169
+ error(` ${line}`);
170
+ }
171
+ error(
172
+ 'Run scripts/migrations/42-add-core-required-fields.js (and 37 if needed) with a human approval. Do not work around this in code or the allowlist.',
173
+ );
174
+ return 1;
175
+ }
176
+ log('Content model has every field core selects.');
177
+ return 0;
178
+ }
179
+
180
+ if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
181
+ process.exit(await run());
182
+ }
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Fields core selects from Contentful, per content type, with golden types.
3
+ *
4
+ * Source of truth for migration 42 and `check-content-model`. A test keeps this in step with
5
+ * the select lists in packages/contentful-rest-api/src/api/listing-fetch-params.ts and with
6
+ * docs/schema-export.json. Every field is optional when migration 42 adds it, even where the
7
+ * golden schema marks it required: a type that already has entries must not gain a required field.
8
+ */
9
+
10
+ const fs = require('node:fs');
11
+ const path = require('node:path');
12
+
13
+ const SLUG_VALIDATIONS = [
14
+ {
15
+ regexp: { pattern: '^[^/]+(?:\\/[^/]+)*$', flags: null },
16
+ message:
17
+ 'Slug must not start or end with /. Use one or more segments separated by / (e.g. part1, part1/part2, or part1/part2/part3). Home page slug is "index".',
18
+ },
19
+ ];
20
+
21
+ const RICH_INLINE_VALIDATIONS = [
22
+ {
23
+ enabledMarks: ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough'],
24
+ },
25
+ { enabledNodeTypes: [] },
26
+ { nodes: {} },
27
+ ];
28
+
29
+ const symbol = (name, validations = []) => ({ name, type: 'Symbol', validations });
30
+ const text = (name, validations = []) => ({ name, type: 'Text', validations });
31
+ const bool = (name) => ({ name, type: 'Boolean', validations: [] });
32
+ const asset = (name, validations = []) => ({ name, type: 'Link', linkType: 'Asset', validations });
33
+ const entry = (name, linkContentType) => ({
34
+ name,
35
+ type: 'Link',
36
+ linkType: 'Entry',
37
+ validations: [{ linkContentType }],
38
+ });
39
+ const entryArray = (name, linkContentType) => ({
40
+ name,
41
+ type: 'Array',
42
+ items: { type: 'Link', linkType: 'Entry', validations: [{ linkContentType }] },
43
+ validations: [],
44
+ });
45
+ const richInline = (name) => ({ name, type: 'RichText', validations: RICH_INLINE_VALIDATIONS });
46
+
47
+ const FEATURED = asset('Featured image', [{ linkMimetypeGroup: ['image'] }]);
48
+ const TEXT_COLOUR = symbol('Text colour', [{ in: ['Black', 'White'] }]);
49
+ // The colour palette is site specific, so a field added here carries no enum.
50
+ const BACKGROUND_COLOUR = symbol('Background colour');
51
+
52
+ /** Fields every route type has in common. */
53
+ const ROUTE_COMMON = {
54
+ slug: symbol('Slug', SLUG_VALIDATIONS),
55
+ breadcrumbTitle: symbol('Breadcrumb title'),
56
+ featuredImage: FEATURED,
57
+ thumbnail: asset('Thumbnail'),
58
+ backgroundColour: BACKGROUND_COLOUR,
59
+ textColour: TEXT_COLOUR,
60
+ indexed: bool('Indexed'),
61
+ hidden: bool('Hidden'),
62
+ metaTitle: symbol('Meta title'),
63
+ };
64
+
65
+ const { featuredImage: _hero, ...PERSON_COMMON } = ROUTE_COMMON;
66
+
67
+ /** content type id -> field id -> golden definition. */
68
+ const REQUIRED_FIELDS = {
69
+ page: {
70
+ cmsLabel: symbol('CMS label'),
71
+ title: symbol('Title'),
72
+ ...ROUTE_COMMON,
73
+ summary: richInline('Summary'),
74
+ tags: entryArray('Tags', ['tag']),
75
+ description: text('Description'),
76
+ },
77
+ article: {
78
+ cmsLabel: symbol('CMS label'),
79
+ title: symbol('Title'),
80
+ subtitle: symbol('Subtitle'),
81
+ ...ROUTE_COMMON,
82
+ tags: entryArray('Tags', ['tag']),
83
+ articleType: entry('Article type', ['articleType']),
84
+ date: { name: 'Date', type: 'Date', validations: [] },
85
+ author: entry('Author', ['person']),
86
+ authors: entryArray('Authors', ['person']),
87
+ externalLink: symbol('External link'),
88
+ download: asset('Download'),
89
+ visuals: entryArray('Visuals', ['externalVideo', 'media']),
90
+ description: text('Description', [{ size: { max: 160 } }]),
91
+ summary: richInline('Summary'),
92
+ icon: asset('Icon'),
93
+ },
94
+ articleType: {
95
+ name: symbol('Name'),
96
+ ...ROUTE_COMMON,
97
+ indexPageName: symbol('Index page name'),
98
+ indexPageDescription: symbol('Index page description'),
99
+ indexPageSummary: richInline('Index page summary'),
100
+ },
101
+ tag: {
102
+ cmsLabel: symbol('CMS label'),
103
+ name: symbol('Name'),
104
+ ...ROUTE_COMMON,
105
+ summary: richInline('Summary'),
106
+ show: bool('Show'),
107
+ tagType: entry('Tag type', ['tagType']),
108
+ parent: entry('Parent tag', ['tag']),
109
+ description: symbol('Description'),
110
+ },
111
+ tagType: {
112
+ name: symbol('Name'),
113
+ slug: symbol('Slug', SLUG_VALIDATIONS),
114
+ show: bool('Show'),
115
+ },
116
+ person: {
117
+ name: symbol('Name'),
118
+ ...PERSON_COMMON,
119
+ personType: entry('Person type', ['personType']),
120
+ media: asset('Media', [{ linkMimetypeGroup: ['image', 'video'] }]),
121
+ summary: richInline('Summary'),
122
+ bio: { name: 'Bio', type: 'RichText', validations: [] },
123
+ jobTitle: symbol('Job title'),
124
+ phoneNumber: symbol('Phone number'),
125
+ emailAddress: symbol('Email address'),
126
+ location: symbol('Location'),
127
+ linkedIn: symbol('LinkedIn'),
128
+ twitter: symbol('Twitter'),
129
+ website: symbol('Website'),
130
+ quote: text('Quote'),
131
+ visuals: entryArray('Visuals', ['externalVideo', 'media']),
132
+ description: text('Description', [{ size: { max: 160 } }]),
133
+ },
134
+ customType: {
135
+ name: symbol('Name'),
136
+ ...ROUTE_COMMON,
137
+ indexPageName: symbol('Index page name'),
138
+ indexPageDescription: symbol('Index page description'),
139
+ indexPageSummary: richInline('Index page summary'),
140
+ },
141
+ };
142
+
143
+ /** Per-field help text for fields that migration 37 documented. */
144
+ const HELP_TEXT = {
145
+ summary: 'Short rich text intro. Description stays the SEO text. Inline formatting only.',
146
+ indexPageSummary:
147
+ 'Short rich text intro for the index page. Index page description stays the SEO text. Inline formatting only.',
148
+ parent: 'Optional parent tag. Leave empty for a top-level tag. Use the same tag type.',
149
+ thumbnail: 'Small image for cards and listings. Featured image stays the hero.',
150
+ };
151
+
152
+ /**
153
+ * Fields that stay in REQUIRED_FIELDS (a select list requests them) but are a documented
154
+ * fallback, not an unconditional requirement. `tagType.slug` is needed only when the site has
155
+ * tag type routes: with `tagTypeRoutes: false` core falls back to TAG_TYPE_MINIMAL_FIELDS,
156
+ * which has no slug, so the checker must not demand it and migration 42 must not add it.
157
+ */
158
+ const OPTIONAL_WITHOUT_TAG_TYPE_ROUTES = { tagType: ['slug'] };
159
+
160
+ /**
161
+ * Reads `tagTypeRoutes` from `<appDir>/src/lib/marketing-routes.json`, the config the site
162
+ * already uses. Defaults to true (core's default) when the file is missing or unreadable.
163
+ * @param {string} [appDir]
164
+ * @returns {boolean}
165
+ */
166
+ function readTagTypeRoutes(appDir = '.') {
167
+ try {
168
+ const config = JSON.parse(
169
+ fs.readFileSync(path.join(appDir, 'src/lib/marketing-routes.json'), 'utf8'),
170
+ );
171
+ return config.tagTypeRoutes !== false;
172
+ } catch {
173
+ return true;
174
+ }
175
+ }
176
+
177
+ const STRING_TYPES = new Set(['Symbol', 'Text']);
178
+
179
+ /**
180
+ * @param {object[] | Record<string, object> | undefined} fields
181
+ * @returns {object[]}
182
+ */
183
+ function asFieldArray(fields) {
184
+ if (Array.isArray(fields)) {
185
+ return fields;
186
+ }
187
+ if (fields && typeof fields === 'object') {
188
+ return Object.keys(fields).map((id) => ({ id, ...fields[id] }));
189
+ }
190
+ return [];
191
+ }
192
+
193
+ /**
194
+ * Describes a field as `Link/Entry`, `Array<Link/Asset>` or `Symbol`.
195
+ * @param {{ type?: string, linkType?: string, items?: object }} field
196
+ */
197
+ function describeType(field) {
198
+ if (!field) {
199
+ return 'unknown';
200
+ }
201
+ if (field.type === 'Array') {
202
+ return `Array<${describeType(field.items)}>`;
203
+ }
204
+ return field.linkType ? `${field.type}/${field.linkType}` : String(field.type);
205
+ }
206
+
207
+ /**
208
+ * Type compatibility only. Validations, names and required flags are not compared.
209
+ * Symbol and Text are interchangeable: both select as a string.
210
+ * @returns {boolean}
211
+ */
212
+ function typesCompatible(expected, actual) {
213
+ if (!actual) {
214
+ return false;
215
+ }
216
+ if (STRING_TYPES.has(expected.type) && STRING_TYPES.has(actual.type)) {
217
+ return true;
218
+ }
219
+ if (expected.type !== actual.type) {
220
+ return false;
221
+ }
222
+ if (expected.type === 'Link') {
223
+ return expected.linkType === actual.linkType;
224
+ }
225
+ if (expected.type === 'Array') {
226
+ return typesCompatible(expected.items, actual.items);
227
+ }
228
+ return true;
229
+ }
230
+
231
+ /**
232
+ * @param {string} contentTypeId
233
+ * @param {{ fields?: object[] | Record<string, object> }} contentType
234
+ * @param {{ tagTypeRoutes?: boolean }} [options] `tagTypeRoutes: false` makes tagType.slug optional
235
+ * @returns {{ missing: string[], conflicts: { fieldId: string, expected: string, actual: string }[] }}
236
+ */
237
+ function diffContentType(contentTypeId, contentType, options = {}) {
238
+ const spec = REQUIRED_FIELDS[contentTypeId] ?? {};
239
+ const actualById = new Map(asFieldArray(contentType.fields).map((f) => [f.id, f]));
240
+ const missing = [];
241
+ const conflicts = [];
242
+ const optional =
243
+ options.tagTypeRoutes === false ? (OPTIONAL_WITHOUT_TAG_TYPE_ROUTES[contentTypeId] ?? []) : [];
244
+ for (const [fieldId, expected] of Object.entries(spec)) {
245
+ const actual = actualById.get(fieldId);
246
+ if (!actual && optional.includes(fieldId)) {
247
+ continue;
248
+ }
249
+ if (!actual) {
250
+ missing.push(fieldId);
251
+ } else if (!typesCompatible(expected, actual)) {
252
+ conflicts.push({
253
+ fieldId,
254
+ expected: describeType(expected),
255
+ actual: describeType(actual),
256
+ });
257
+ }
258
+ }
259
+ return { missing, conflicts };
260
+ }
261
+
262
+ module.exports = {
263
+ REQUIRED_FIELDS,
264
+ HELP_TEXT,
265
+ OPTIONAL_WITHOUT_TAG_TYPE_ROUTES,
266
+ readTagTypeRoutes,
267
+ asFieldArray,
268
+ describeType,
269
+ diffContentType,
270
+ typesCompatible,
271
+ };
@@ -91,6 +91,7 @@ if (fromCms) {
91
91
  articleTypes,
92
92
  tagTypes,
93
93
  peopleSlug: hand.peopleSlug,
94
+ peopleTypeSlug: hand.peopleTypeSlug,
94
95
  tagsSlug: hand.tagsSlug,
95
96
  articlesSlug: hand.articlesSlug,
96
97
  personSlug: hand.personSlug,
@@ -118,10 +118,12 @@ function pathOrNull(slug, label, problems) {
118
118
  * `tags`. Role words still win when the slug is `people`, `tags`, or `articles`.
119
119
  *
120
120
  * @param {string} slug
121
- * @param {{ person?: string | null, tag?: string | null, article?: string | null }} declared
121
+ * @param {{ person?: string | null, personType?: string | null, tag?: string | null, article?: string | null }} declared
122
122
  */
123
123
  function declaredRole(slug, declared) {
124
- if (declared.person && declared.person === slug) return 'person';
124
+ if (declared.person && (declared.person === slug || declared.personType === slug)) {
125
+ return 'person';
126
+ }
125
127
  if (declared.tag && declared.tag === slug) return 'tag';
126
128
  if (declared.article && declared.article === slug) return 'article';
127
129
  return null;
@@ -129,7 +131,7 @@ function declaredRole(slug, declared) {
129
131
 
130
132
  /**
131
133
  * @param {{ slug?: string, name?: string }} entry
132
- * @param {{ person?: string | null, tag?: string | null, article?: string | null }} declared
134
+ * @param {{ person?: string | null, personType?: string | null, tag?: string | null, article?: string | null }} declared
133
135
  * @returns {{ role: string, slug: string } | { error: string }}
134
136
  */
135
137
  function prefixOf(entry, declared) {
@@ -238,6 +240,7 @@ function claimRest(used, rest, label, problems) {
238
240
  * articleTypes?: { slug?: string, name?: string, indexPageSlug?: string }[],
239
241
  * tagTypes?: { slug?: string, name?: string, show?: boolean }[],
240
242
  * peopleSlug?: string | null,
243
+ * peopleTypeSlug?: string | null,
241
244
  * tagsSlug?: string | null,
242
245
  * articlesSlug?: string | null,
243
246
  * personSlug?: string | null,
@@ -259,6 +262,7 @@ export function planFromCms(input) {
259
262
  const options = input.articleTypeOptions ?? {};
260
263
  const declared = {
261
264
  person: handSlug(input, 'peopleSlug', null),
265
+ personType: handSlug(input, 'peopleTypeSlug', null),
262
266
  tag: handSlug(input, 'tagsSlug', null),
263
267
  article: handSlug(input, 'articlesSlug', null),
264
268
  };
@@ -312,6 +316,7 @@ export function planFromCms(input) {
312
316
  }
313
317
  }
314
318
  const peopleSlug = handSlug(input, 'peopleSlug', prefixes.person, problems);
319
+ const peopleTypeSlug = handSlug(input, 'peopleTypeSlug', null, problems);
315
320
  const tagsSlug = handSlug(input, 'tagsSlug', prefixes.tag, problems);
316
321
  const articlesSlug = handSlug(input, 'articlesSlug', prefixes.article, problems);
317
322
  const personBase =
@@ -416,13 +421,14 @@ export function planFromCms(input) {
416
421
  if (problems.length > 0) {
417
422
  return { ok: false, problems };
418
423
  }
419
- const hasArticles = articleTypes.length > 0 || Boolean(articlesSlug);
424
+ const hasArticles = Boolean(articlesSlug);
420
425
  const hasTags = tagTypes.length > 0 || Boolean(tagBase);
421
426
  const hasPeople = personTypes.length > 0 || Boolean(personBase);
422
427
  return {
423
428
  ok: true,
424
429
  warnings,
425
430
  peopleSlug,
431
+ peopleTypeSlug,
426
432
  tagsSlug,
427
433
  articlesSlug,
428
434
  personTypes: [...new Set(personTypes)].sort(),
@@ -474,6 +480,7 @@ export function sectionConfigFromPlan(hand, plan) {
474
480
  tagInPath,
475
481
  peopleSlug: plan.peopleSlug,
476
482
  ...shapeKeys(hand, 'personSlug', 'enablePeopleIndex'),
483
+ ...(plan.peopleTypeSlug ? { peopleTypeSlug: plan.peopleTypeSlug } : {}),
477
484
  tagsSlug: plan.tagsSlug,
478
485
  ...shapeKeys(hand, 'tagSlug', 'enableTagsIndex'),
479
486
  articlesSlug: plan.articlesSlug,
@@ -490,6 +497,9 @@ export function sectionConfigFromPlan(hand, plan) {
490
497
  if (Array.isArray(hand.allowHandWrittenPages) && hand.allowHandWrittenPages.length > 0) {
491
498
  next.allowHandWrittenPages = hand.allowHandWrittenPages;
492
499
  }
500
+ if (hand.segmentConfig && typeof hand.segmentConfig === 'object') {
501
+ next.segmentConfig = hand.segmentConfig;
502
+ }
493
503
  return next;
494
504
  }
495
505
 
@@ -55,6 +55,22 @@ export function isSectionConfig(config) {
55
55
  /** Keys that opt a section config in to separate index and detail segments. */
56
56
  const SHAPE_KEYS = ['personSlug', 'tagSlug', 'enablePeopleIndex', 'enableTagsIndex'];
57
57
 
58
+ /**
59
+ * CMS custom type slug backing the people section. `peopleSlug` is the URL segment and
60
+ * defaults the type slug; `peopleTypeSlug` is set only when the custom type is named
61
+ * differently (URL `/people/`, custom type `person`). Never changes a URL.
62
+ *
63
+ * @param {Record<string, unknown>} config
64
+ * @returns {string} '' when there is no people section
65
+ */
66
+ export function peopleTypeSlug(config) {
67
+ const value = config.peopleTypeSlug;
68
+ if (value === undefined || value === null) {
69
+ return typeof config.peopleSlug === 'string' ? config.peopleSlug : '';
70
+ }
71
+ return requireSegment(value, 'peopleTypeSlug');
72
+ }
73
+
58
74
  /**
59
75
  * URL shape of the people and tag sections. `peopleSlug` / `tagsSlug` name the index
60
76
  * and the type prefix. `personSlug` / `tagSlug` name the singular detail segment and
@@ -102,6 +118,7 @@ export function sectionShape(config) {
102
118
  tagBase: detail('tagSlug', tags),
103
119
  peopleIndex: index('enablePeopleIndex', people, 'peopleSlug'),
104
120
  tagsIndex: index('enableTagsIndex', tags, 'tagsSlug'),
121
+ peopleType: peopleTypeSlug(config),
105
122
  declared: SHAPE_KEYS.some((key) => config[key] !== undefined),
106
123
  };
107
124
  }
@@ -118,8 +135,12 @@ export function sectionFlags(config) {
118
135
  const articles = typeof config.articlesSlug === 'string';
119
136
  const articleTypes = Array.isArray(config.articleTypes) && config.articleTypes.length > 0;
120
137
  const tagInPath = config.tagInPath === true;
138
+ // enableArticleTypeIndex gates only the articlesSlug hub (/articles/ or /resources/ as a section
139
+ // index). enableArticleTypeTagIndex is deliberately NOT tied to it: tag-in-path indexes live on
140
+ // article-type routes (/resources/events/{tag}/) and need no parent hub. Live sites (Pedestal,
141
+ // Headwater) have tagInPath, articlesSlug null and articleTypes, and must keep the flag true.
121
142
  return {
122
- enableArticleTypeIndex: articles || articleTypes,
143
+ enableArticleTypeIndex: articles && config.articlesSlug.length > 0,
123
144
  enableArticleTypeTagIndex: tagInPath && (articles || articleTypes),
124
145
  enableTag: tags || tagTypes,
125
146
  enableTagsIndex: shape.tagsIndex,
@@ -541,7 +562,7 @@ export function checkMarketingRoutes(appRoot) {
541
562
  ...handlerProblems,
542
563
  ...drift,
543
564
  ...supportDrift(appRoot, config),
544
- ...policyProblems(appRoot, allowed),
565
+ ...policyProblems(appRoot, allowed, handWritten),
545
566
  ...proxyMarkdownProblems(appRoot),
546
567
  ];
547
568
  const note = warnings.length > 0 ? ` [warning: ${warnings.join('; ')}]` : '';
@@ -570,6 +591,87 @@ export function checkMarketingRoutes(appRoot) {
570
591
  * @returns {Map<string, string>} rest → file contents
571
592
  */
572
593
  export function renderGeneratedRoutes(config) {
594
+ const files = renderRoutesBase(config);
595
+ applySegmentConfig(config, files);
596
+ return files;
597
+ }
598
+
599
+ /** Next.js route segment config keys a generated page may export, with their literal check. */
600
+ const SEGMENT_CONFIG_KEYS = {
601
+ dynamic: (v) => ['auto', 'force-dynamic', 'error', 'force-static'].includes(v),
602
+ revalidate: (v) => v === false || (Number.isInteger(v) && v >= 0),
603
+ dynamicParams: (v) => typeof v === 'boolean',
604
+ fetchCache: (v) =>
605
+ [
606
+ 'auto',
607
+ 'default-cache',
608
+ 'only-cache',
609
+ 'force-cache',
610
+ 'force-no-store',
611
+ 'default-no-store',
612
+ 'only-no-store',
613
+ ].includes(v),
614
+ runtime: (v) => v === 'nodejs' || v === 'edge',
615
+ preferredRegion: (v) =>
616
+ typeof v === 'string'
617
+ ? /^[a-z0-9-]+$/.test(v)
618
+ : Array.isArray(v) && v.length > 0 && v.every((r) => typeof r === 'string' && /^[a-z0-9-]+$/.test(r)),
619
+ };
620
+
621
+ /**
622
+ * `segmentConfig` is `{ "<generated page rest>": { "dynamic": "force-static" } }`. Each
623
+ * known key is written as `export const key = <literal>;` at the end of that generated
624
+ * page. Unknown keys, non-literal values and paths that are not a generated page throw.
625
+ *
626
+ * @param {unknown} config
627
+ * @param {Map<string, string>} files rest → file contents, updated in place
628
+ */
629
+ function applySegmentConfig(config, files) {
630
+ const raw = config && typeof config === 'object' ? config.segmentConfig : undefined;
631
+ if (raw === undefined || raw === null) {
632
+ return;
633
+ }
634
+ if (typeof raw !== 'object' || Array.isArray(raw)) {
635
+ throw new Error('marketing-routes.json segmentConfig must be an object keyed by page path');
636
+ }
637
+ const allow = handWrittenAllowlist(config);
638
+ for (const [key, entry] of Object.entries(raw)) {
639
+ const rest = key.replace(/^\/+|\/+$/g, '');
640
+ if (!files.has(rest)) {
641
+ throw new Error(`segmentConfig path "${key}" is not a generated marketing page`);
642
+ }
643
+ if (isAllowlisted(allow, rest)) {
644
+ throw new Error(
645
+ `segmentConfig path "${key}" is in allowHandWrittenPages: a hand-written page exports its own config`,
646
+ );
647
+ }
648
+ if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
649
+ throw new Error(`segmentConfig "${key}" must be an object of segment config keys`);
650
+ }
651
+ const lines = [];
652
+ for (const [name, value] of Object.entries(entry)) {
653
+ const valid = Object.hasOwn(SEGMENT_CONFIG_KEYS, name) ? SEGMENT_CONFIG_KEYS[name] : null;
654
+ if (!valid) {
655
+ throw new Error(
656
+ `segmentConfig "${key}": "${name}" is not an allowed key (${Object.keys(SEGMENT_CONFIG_KEYS).join(', ')})`,
657
+ );
658
+ }
659
+ if (!valid(value)) {
660
+ throw new Error(`segmentConfig "${key}": illegal value for ${name}: ${JSON.stringify(value)}`);
661
+ }
662
+ lines.push(`export const ${name} = ${JSON.stringify(value).replace(/"/g, "'")};`);
663
+ }
664
+ if (lines.length > 0) {
665
+ files.set(rest, `${files.get(rest)}\n${lines.join('\n')}\n`);
666
+ }
667
+ }
668
+ }
669
+
670
+ /**
671
+ * @param {unknown} config
672
+ * @returns {Map<string, string>}
673
+ */
674
+ function renderRoutesBase(config) {
573
675
  if (!config || typeof config !== 'object') {
574
676
  throw new Error('marketing-routes.json must be an object');
575
677
  }
@@ -727,6 +829,12 @@ export const ARTICLE_DETAIL_TYPE_SLUGS = ${slugList(
727
829
  `
728
830
  : '';
729
831
  const shape = sectionShape(config);
832
+ const typeLine =
833
+ config.peopleTypeSlug === undefined || config.peopleTypeSlug === null
834
+ ? ''
835
+ : `/** CMS custom type slug for people lookups. PEOPLE_SLUG stays the URL segment. */
836
+ export const PEOPLE_TYPE_SLUG = '${shape.peopleType}';
837
+ `;
730
838
  const detailLines = shape.declared
731
839
  ? `export const PERSON_DETAIL_SLUG = '${shape.personBase}';
732
840
  export const PERSON_DETAIL_BASE = ${base(shape.personBase)};
@@ -737,7 +845,7 @@ export const TAG_DETAIL_BASE = ${base(shape.tagBase)};
737
845
  return `${header()}
738
846
  export const PEOPLE_SLUG = '${people}';
739
847
  export const PEOPLE_BASE = ${base(people)};
740
- export const TAGS_SLUG = '${tags}';
848
+ ${typeLine}export const TAGS_SLUG = '${tags}';
741
849
  export const TAGS_BASE = ${base(tags)};
742
850
  export const ARTICLES_SLUG = '${articles}';
743
851
  export const ARTICLES_BASE = ${base(articles)};
@@ -879,8 +987,10 @@ function generatedDrift(appRoot, config) {
879
987
  let files;
880
988
  try {
881
989
  files = renderGeneratedRoutes(config);
882
- } catch {
883
- return drift;
990
+ } catch (error) {
991
+ // An illegal segmentConfig (or other render error) must fail the checker, as it fails generate.
992
+ const message = error instanceof Error ? error.message : String(error);
993
+ return [`generated routes cannot be rendered: ${message}`];
884
994
  }
885
995
  const requireComplete = fs.existsSync(path.join(appRoot, FLAGS_REL));
886
996
  for (const [rest, expected] of files) {
@@ -1127,6 +1237,11 @@ export function mustBeSsgOrStaticRoutes(config) {
1127
1237
  return routes;
1128
1238
  }
1129
1239
 
1240
+ /** `/llms.txt`, `/site-info.md`: a dotted last segment that is not a `[...catchAll]`. */
1241
+ function isTextRoute(route) {
1242
+ return /\/[^/[\]]+\.[A-Za-z0-9]+$/.test(route);
1243
+ }
1244
+
1130
1245
  /**
1131
1246
  * @param {string} appRoot
1132
1247
  * @param {unknown} config
@@ -1137,7 +1252,23 @@ function syncRouteBuildPolicy(appRoot, config) {
1137
1252
  return;
1138
1253
  }
1139
1254
  const policy = JSON.parse(fs.readFileSync(policyPath, 'utf8'));
1140
- policy.mustBeSsgOrStatic = mustBeSsgOrStaticRoutes(config);
1255
+ const generated = mustBeSsgOrStaticRoutes(config);
1256
+ // Keep hand-added entries for allowHandWrittenPages (same URL-shape match the checker uses).
1257
+ // Unknown, non-allowlisted, non-generated routes are dropped, never invented.
1258
+ const handWritten = handWrittenAllowlist(config);
1259
+ const kept = (Array.isArray(policy.mustBeSsgOrStatic) ? policy.mustBeSsgOrStatic : []).filter(
1260
+ (route) =>
1261
+ typeof route === 'string' &&
1262
+ route.startsWith('/') &&
1263
+ !isTextRoute(route) &&
1264
+ !generated.includes(route) &&
1265
+ isAllowlisted(handWritten, route.slice(1)),
1266
+ );
1267
+ policy.mustBeSsgOrStatic = [
1268
+ ...generated.filter((route) => !isTextRoute(route)),
1269
+ ...kept,
1270
+ ...generated.filter(isTextRoute),
1271
+ ];
1141
1272
  fs.writeFileSync(policyPath, `${JSON.stringify(policy, null, 2)}\n`);
1142
1273
  console.log(`Updated ${path.relative(appRoot, policyPath)}`);
1143
1274
  }
@@ -1215,13 +1346,16 @@ function formatGeneratedPages(appRoot) {
1215
1346
  }
1216
1347
 
1217
1348
  /**
1218
- * Bracket CMS routes in route-build-policy.json must be the generated tree.
1349
+ * Bracket CMS routes in route-build-policy.json must be the generated tree. A route the
1350
+ * site hand-wrote and listed in `allowHandWrittenPages` may also be listed, so it keeps
1351
+ * the SSG guard.
1219
1352
  *
1220
1353
  * @param {string} appRoot
1221
1354
  * @param {Set<string>} allowed
1355
+ * @param {Set<string>} [handWritten] from handWrittenAllowlist
1222
1356
  * @returns {string[]}
1223
1357
  */
1224
- function policyProblems(appRoot, allowed) {
1358
+ function policyProblems(appRoot, allowed, handWritten = new Set()) {
1225
1359
  const policyPath = path.join(appRoot, 'route-build-policy.json');
1226
1360
  if (!fs.existsSync(policyPath)) {
1227
1361
  return [];
@@ -1250,7 +1384,7 @@ function policyProblems(appRoot, allowed) {
1250
1384
  continue;
1251
1385
  }
1252
1386
  const rest = route.slice(1);
1253
- if (!allowed.has(rest)) {
1387
+ if (!allowed.has(rest) && !isAllowlisted(handWritten, rest)) {
1254
1388
  problems.push(`route-build-policy.json lists ${route} outside marketing-routes.json`);
1255
1389
  }
1256
1390
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/project-build",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Build tools and management scripts for SE Studio projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,7 +45,8 @@
45
45
  "cms-generate-html-style-guide": "./dist/cms-generate-html-style-guide.js",
46
46
  "patch-next-flight-debuginfo": "./dist/patch-next-flight-debuginfo.js",
47
47
  "generate-marketing-routes": "./dist/generate-marketing-routes.mjs",
48
- "check-marketing-routes": "./dist/check-marketing-routes.mjs"
48
+ "check-marketing-routes": "./dist/check-marketing-routes.mjs",
49
+ "check-content-model": "./dist/check-content-model.mjs"
49
50
  },
50
51
  "files": [
51
52
  "dist",
@@ -84,7 +85,7 @@
84
85
  "vitest": "^5.1.0"
85
86
  },
86
87
  "scripts": {
87
- "build": "tsc --project tsconfig.build.json && cp src/patch-next-dev.cjs src/patch-next-dev.d.ts src/patch-next-browser-debug.cjs dist/ && cp ../../scripts/generate-marketing-routes.mjs ../../scripts/check-marketing-routes.mjs ../../scripts/marketing-routes.mjs ../../scripts/marketing-routes-cms.mjs dist/",
88
+ "build": "tsc --project tsconfig.build.json && cp src/patch-next-dev.cjs src/patch-next-dev.d.ts src/patch-next-browser-debug.cjs dist/ && cp ../../scripts/generate-marketing-routes.mjs ../../scripts/check-marketing-routes.mjs ../../scripts/marketing-routes.mjs ../../scripts/marketing-routes-cms.mjs ../../scripts/check-content-model.mjs ../../scripts/content-model-spec.cjs dist/",
88
89
  "dev": "tsc --project tsconfig.build.json --watch",
89
90
  "type-check": "tsc --noEmit",
90
91
  "lint": "biome lint .",