@se-studio/skills 1.15.1 → 1.15.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,18 @@
|
|
|
1
1
|
# @se-studio/skills
|
|
2
2
|
|
|
3
|
+
## 1.15.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dce254a: `generate-marketing-routes` and `check-marketing-routes` express index versus detail URL shapes, so a site such as Highlander (`/people/` index with `/person/{slug}/` detail, `/tag/{slug}/` with no `/tags/`) no longer needs a hand-written route or a canonical that disagrees with the served URL.
|
|
8
|
+
|
|
9
|
+
- New optional keys in a section `marketing-routes.json`: `personSlug` and `tagSlug` (singular detail segment, default the index slug), `enablePeopleIndex` and `enableTagsIndex` (default: on when the index slug is set; `true` needs the index slug). An index that is off writes no page and the flag is `false`; the detail pages stay. A config with none of these keys generates the same files as before. A config that declares any of them also writes `PERSON_DETAIL_BASE`, `PERSON_DETAIL_SLUG`, `TAG_DETAIL_BASE` and `TAG_DETAIL_SLUG` into `src/generated/marketing-slugs.ts`; build person and tag links from them. Existing section configs that already carry `enablePeopleIndex` / `enableTagsIndex` (previously ignored) are now honoured.
|
|
10
|
+
- The generated person and tag detail pages pass their served path to the handlers (the tag page no longer reads the site's tag url calculator when the shape is declared), so the canonical is always the served URL.
|
|
11
|
+
- `allowHandWrittenPages` also allows a known non-CMS page: `resource-list-cards` or `src/app/resource-list-cards/page.tsx`. `preview` allows `(cms-routes)/preview`. Matching is exact; a child page is not covered.
|
|
12
|
+
- `--from-cms --write` keeps the four shape keys the way it keeps `allowHandWrittenPages`, and validates them. `tagTypeRoutes: false` skips tag types that have no slug.
|
|
13
|
+
- `@se-studio/core-ui`: new optional `renderTagListing` on `createRouteHandlers`. `generateTagPage` renders its result after the tag content, so a generated tag page keeps a site's custom listing or filter (category tabs plus article list) with no hand-written route and no generator fork. A tag with no `contents` still renders when the hook is set. Additive; sites that do not pass it are unchanged.
|
|
14
|
+
- Docs and skills (`@se-studio/skills`) describe the keys, the hook and the allowlist.
|
|
15
|
+
|
|
3
16
|
## 1.15.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ description: "Guide for the (cms-routes) route group and appShared pattern. Use
|
|
|
7
7
|
|
|
8
8
|
Reference app: **example-empty** (this monorepo). Customer sites with fuller route sets: see `docs/RELATED_PROJECTS.md` (e.g. OM1 uses `resources/`, `team/`, `topics/` instead of `articles/`, `people/`, `tags/`).
|
|
9
9
|
|
|
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. If CMS writes are off and the tag, type or data you need is missing, stop and ask. Do not code around it.
|
|
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`. 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
12
|
## Route Group: (cms-routes)
|
|
13
13
|
|
|
@@ -103,7 +103,7 @@ export default async function (props: PageProps<'/[level1]'>) {
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
A dynamic `articles` route uses `converterContext.urlCalculators` (`article`, `articleType`, `articleTypeTag`). Import `converterContext` from `@/lib/converter-context` when that module exists (so route files don't pull in cms-server); otherwise from `@/lib/cms-server`. A fixed article folder, and a dynamic base whose path is not `articles`, passes the path of the file that was written (`/work/`, `/work/${articleSlug}/`). `article()` prefixes `ARTICLES_BASE` and, when primary tags are on, inserts `other`. That is a different URL from the file that was written. The generator writes `[tag]` pages with `articleTypeTag` when `tagInPath` is true. Feature flags live in `marketing-routes.json` and `src/generated/marketing-flags.ts`. The legacy generator writes a typed person at `/peopleType/${peopleType}/${slug}/`. The section generator writes a static `/${peopleSlug}/${type}/${slug}/`, or `/${type}/${slug}/` when there is no person prefix. A person with no type is `/${peopleSlug}/${slug}
|
|
106
|
+
A dynamic `articles` route uses `converterContext.urlCalculators` (`article`, `articleType`, `articleTypeTag`). Import `converterContext` from `@/lib/converter-context` when that module exists (so route files don't pull in cms-server); otherwise from `@/lib/cms-server`. A fixed article folder, and a dynamic base whose path is not `articles`, passes the path of the file that was written (`/work/`, `/work/${articleSlug}/`). `article()` prefixes `ARTICLES_BASE` and, when primary tags are on, inserts `other`. That is a different URL from the file that was written. The generator writes `[tag]` pages with `articleTypeTag` when `tagInPath` is true. Feature flags live in `marketing-routes.json` and `src/generated/marketing-flags.ts`. The legacy generator writes a typed person at `/peopleType/${peopleType}/${slug}/`. The section generator writes a static `/${peopleSlug}/${type}/${slug}/`, or `/${type}/${slug}/` when there is no person prefix. A person with no type is `/${peopleSlug}/${slug}/`, or `/${personSlug}/${slug}/` when `marketing-routes.json` sets `personSlug` (likewise `tagSlug` for `/${tagSlug}/${slug}/`; `enablePeopleIndex` / `enableTagsIndex` switch an index off; build links from `PERSON_DETAIL_BASE` / `TAG_DETAIL_BASE`). Neither route redirects to the other. `[level1]` stays a generic page.
|
|
107
107
|
|
|
108
108
|
## See Also
|
|
109
109
|
|
|
@@ -19,7 +19,7 @@ App Router `page` files are only:
|
|
|
19
19
|
- a folder named in `src/lib/marketing-routes.json` for an article type or a person type (`generate-marketing-routes . --from-cms --write` writes the thin article index and detail wrappers; in a site, `pnpm generate:routes`)
|
|
20
20
|
- the fixed misc files (page-test, preview, sitemap, robots, markdown, download, og, api, cms-dev)
|
|
21
21
|
|
|
22
|
-
**Commands.** The bin is `generate-marketing-routes` from `@se-studio/project-build` (`--from-cms --write` reads the CMS tag and type model and rewrites `marketing-routes.json` plus the generated pages). A customer site runs it as `pnpm generate:routes`. `node scripts/generate-marketing-routes.mjs <app> --write` exists only in se-core-product; it is not in a customer repo. The guard is `check-marketing-routes .` (same package, same install). It fails a hand-written `(cms-routes)` page that is not in `marketing-routes.json` or its explicit `allowHandWrittenPages` list. In core, `pnpm skeleton:check` runs the same check.
|
|
22
|
+
**Commands.** The bin is `generate-marketing-routes` from `@se-studio/project-build` (`--from-cms --write` reads the CMS tag and type model and rewrites `marketing-routes.json` plus the generated pages). A customer site runs it as `pnpm generate:routes`. `node scripts/generate-marketing-routes.mjs <app> --write` exists only in se-core-product; it is not in a customer repo. The guard is `check-marketing-routes .` (same package, same install). It fails a hand-written `(cms-routes)` page that is not in `marketing-routes.json` or its explicit `allowHandWrittenPages` list. The list also allows a known non-CMS page (`resource-list-cards`). URL shape keys `personSlug`, `tagSlug`, `enablePeopleIndex`, `enableTagsIndex` in `marketing-routes.json` split index and detail segments (see `@se-studio/project-build` README); a custom tag listing is the `renderTagListing` route-handler hook. In core, `pnpm skeleton:check` runs the same check.
|
|
23
23
|
|
|
24
24
|
**Tabs, filters and listings come from CMS tags and types.** Never add a code-side tag-to-slug mapping, a `*Tabs` / `*Groups` constant, or a new hand-written route to group content.
|
|
25
25
|
|