@se-studio/skills 1.16.0 → 1.16.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @se-studio/skills
2
2
 
3
+ ## 1.16.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d2728ab: The customer `site-ci.yml` template gains an off-by-default `run_content_model` input (when on, missing Contentful secrets fail the job) and a commented secrets block (`CONTENTFUL_SPACE_ID`, `CONTENTFUL_ACCESS_TOKEN`, optional `CONTENTFUL_ENVIRONMENT`). `contentful-cms-content-model` and `contentful-cms-sync-schema` document migration `42-add-core-required-fields.js` and `check-content-model` for a site 422 on a core select (for example `person.summary`).
8
+
9
+ ## 1.16.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 7344552: se-marketing-sites-cms-routes-and-appshared documents `peopleTypeSlug`, `segmentConfig`, the new article/person route hooks, the `enableArticleTypeIndex` fix and policy entries for allowlisted pages. It also notes that `segmentConfig` `force-dynamic` / `edge` trade away static rendering, that the checker fails an illegal `segmentConfig`, and why `enableArticleTypeTagIndex` is independent of `articlesSlug`.
14
+
3
15
  ## 1.16.0
4
16
 
5
17
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/skills",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "description": "SE Studio agent skills for marketing site development with Contentful CMS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,6 +5,15 @@
5
5
  # workflow strips `?` and `#` before the report and does not upload reports
6
6
  # to temporary public storage.
7
7
  #
8
+ # Content model check (opt in): set run_content_model: true and uncomment the secrets block
9
+ # below. It compares the published Contentful content types with the fields core selects, so a
10
+ # site 422 on a core select (for example person.summary) fails here first. Use a read-only
11
+ # Delivery token (CONTENTFUL_ACCESS_TOKEN) in repo or org Actions secrets; a Management token
12
+ # is not needed. With run_content_model: true and no secrets the job FAILS (it runs with
13
+ # --require-credentials), so a mis-wired site is never reported as checked. A real missing
14
+ # field fails that job only, never the lint, typecheck, and test gate. Fix it with core
15
+ # migration 42, not in code. The filesystem-only jobs never receive CMS tokens.
16
+ #
8
17
  # actions: write is granted on this job so the shared workflow's Lighthouse
9
18
  # job can upload artifacts. That job is the only one that uses it. Lint,
10
19
  # typecheck, test, Prettier, and lychee stay at contents: read.
@@ -36,6 +45,12 @@ jobs:
36
45
  # false to skip it. The shared workflow defaults to false only so a caller pinned
37
46
  # to @dev does not change under it.
38
47
  run_marketing_routes: true
48
+ run_content_model: false
39
49
  run_prettier: false
40
50
  run_lychee: false
41
51
  run_lighthouse: false
52
+ # Uncomment with run_content_model: true. Required when run_content_model is true: missing secrets fail the job.
53
+ # secrets:
54
+ # CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
55
+ # CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
56
+ # CONTENTFUL_ENVIRONMENT: ${{ secrets.CONTENTFUL_ENVIRONMENT }} # optional, default master
@@ -14,6 +14,8 @@ The content model is a **development** concern. **cms-edit edits content (entrie
14
14
  3. In se-core-product only, after a core migration, re-export the golden schema (`docs/schema-export.json`; see `contentful-cms-sync-schema`). Customer-specific migrations do not touch the golden file.
15
15
  4. Regenerate types (`pnpm codegen`) and update `src/lib/registrations.ts` when a new component/collection/external component is added (skill `se-marketing-sites-register-cms-features`).
16
16
 
17
+ **Site 422 on a core select** (for example `person.summary`, `Unknown field` from Delivery): the space is missing a field core queries. Run `pnpm exec check-content-model .` to list them, then migration `scripts/migrations/42-add-core-required-fields.js` (and `37-add-summary-and-tag-parent.js` if needed) with human approval. 42 adds only missing fields, all optional, and aborts on a type conflict. Do not work around it in site code, with `withUnknownFieldFallback`, or in the marketing-routes allowlist. Sites can run the check in CI with `run_content_model` on the shared site CI workflow; missing Contentful secrets fail that job. `tagType.slug` is not required when `marketing-routes.json` sets `tagTypeRoutes: false`.
18
+
17
19
  `add-cms-type` and `setup-colours` call the management API directly (they need `CONTENTFUL_MANAGEMENT_TOKEN`) instead of going through the CLI, so they leave no numbered migration behind. Both are safe to re-run. `add-cms-type` prints the target space and environment, refuses a content type that has unpublished changes, and never reorders or removes existing values. They still need the same human approval as a migration, and in se-core-product a core change still needs the golden schema re-exported.
18
20
 
19
21
  Rules:
@@ -97,6 +97,7 @@ Standard order when diff shows these gaps:
97
97
  | 8 | `25-add-meta-field.js` | Optional Long text `meta` JSON bag on template/page/article/tag/person and related types. Idempotent. Unused until filled. |
98
98
  | 9 | `28-add-html-component-external-scripts.js` | Optional `externalScripts` (array of URL strings) on existing `htmlComponent`. Idempotent. Greenfield spaces that run migration 12 after this change already get the field. |
99
99
  | 10 | `37-add-summary-and-tag-parent.js` | Optional rich-text `summary` after `description`, optional `indexPageSummary` after `indexPageDescription`, optional `tag.parent` (one tag link), and optional `thumbnail` asset on route types (page, pageVariant, article, articleType, tag, person, personType, customType). Idempotent. Does not copy description text and does not publish entries. |
100
+ | 11 | `42-add-core-required-fields.js` | **The standard "make the space match what core queries".** Adds every missing field core selects (the `listing-fetch-params.ts` select lists: `summary`, `indexPageSummary`, `thumbnail`, `tag.parent`, `description`, `metaTitle`, `breadcrumbTitle`, `personType`, `authors`, ...) with golden types, all optional. Covers what 37 adds, plus `description` where 37 skips it (a `person` type with neither `description` nor `summary` is fixed in one run). Skips content types the space lacks. Aborts, changing nothing, if an existing field has a different type or linkType. Idempotent. Does not publish or modify entries. |
100
101
 
101
102
  Site-specific (run only when diff shows missing field **and** app uses it):
102
103
 
@@ -119,6 +120,8 @@ contentful space migration \
119
120
  scripts/migrations/12-add-html-component.js
120
121
  ```
121
122
 
123
+ **Check before and after:** `pnpm exec check-content-model .` (core: `pnpm check:content-model`) reads the published content types with a Delivery token and lists missing or conflicting fields; it is the same list migration 42 applies. When a site 422s on a core select (for example `person.summary`), run migration 42 (and 37 if needed) with human approval. Do not work around it in code or the marketing-routes allowlist.
124
+
122
125
  Remove dry-run flags only after reviewing output. Re-run compare until **missing types/fields** are cleared (extras and enum diffs may remain).
123
126
 
124
127
  ### 6. App follow-up
@@ -9,6 +9,8 @@ Reference app: **example-empty** (this monorepo). Customer sites with fuller rou
9
9
 
10
10
  Do not add a `page.tsx` for a marketing URL. That URL is a Contentful slug on the catch-all. Extra folders are only article types and person types listed in `src/lib/marketing-routes.json`. Route files come from `generate-marketing-routes <app> --from-cms --write` (the `@se-studio/project-build` bin; a site runs `pnpm generate:routes`; `node scripts/generate-marketing-routes.mjs` exists only in se-core-product). `check-marketing-routes <app>` (same package) fails any hand-written `(cms-routes)` page outside `marketing-routes.json` or its `allowHandWrittenPages` list. Tabs, filters and listings come from CMS tags and article/tag types, never from code-side mappings or a hand-written route for grouping. A site that needs its own tag listing or filter component passes `renderTagListing` to `createRouteHandlers`; it does not hand-write the tag route. Known non-CMS pages (`resource-list-cards`, `(cms-routes)/preview`) go on `allowHandWrittenPages` as `{ "path": "preview", "reason": "..." }` (a bare string is deprecated and warns). The check also fails when `marketing-routes.json` is missing, unless a not-yet-migrated repo has `src/lib/marketing-routes.opt-out.json` with a `reason`; it also covers `page.ts[x]` anywhere under `src/app` and `route.ts` under `(cms-routes)`, modified files included. The shared site CI runs it (`run_marketing_routes`, no CMS secrets). Index-only article types (`detailPages: false`), nested article slugs (`nestedSlugs: true`, `[...slugs]`) and `excludeArticleTypes` are per-type options in `marketing-routes.json`; custom person pages use the `renderPersonIndex` / `renderPersonDetail` hooks and article metadata tweaks `transformArticleMetadata`, never a hand-written route. Reviews of any added or modified hand-written page or route, or an allowlist change, must come from a reviewer who did not author the change. If CMS writes are off and the tag, type or data you need is missing, stop and ask. Do not code around it.
11
11
 
12
+ Before hand-writing a page and listing it in `allowHandWrittenPages`, use the config and hooks instead: `peopleTypeSlug` (the CMS custom type slug when it differs from the people URL, e.g. URL `/people/`, type `person`), `segmentConfig` (`{ "resources": { "dynamic": "force-static" } }` writes literal segment config into that generated page), and the opt-in `createRouteHandlers` hooks `transformPersonMetadata`, `renderArticleTypeListing` (index page, after the CMS contents) and `renderArticleDetail` (`{ before, after }` around an article's contents). `segmentConfig` accepts `dynamic: 'force-dynamic'` and `runtime: 'edge'` as opt-ins, but each trades away static rendering (and the R5 SSG guard) on that generated route; `check-marketing-routes` fails an illegal `segmentConfig`. `enableArticleTypeIndex` is true only when `articlesSlug` is set (the hub only); `enableArticleTypeTagIndex` stays `tagInPath && (articlesSlug || articleTypes)` because tag indexes live on article-type routes (`/resources/events/{tag}/`) and need no hub. A hand-written page that stays on the allowlist may also be listed in `route-build-policy.json` `mustBeSsgOrStatic`; `generate --write` keeps that entry. Details: `@se-studio/project-build` and `@se-studio/core-ui` READMEs.
13
+
12
14
  ## Route Group: (cms-routes)
13
15
 
14
16
  All CMS-driven pages live under `src/app/(cms-routes)/`. The layout enables dynamic params: