Skip to content

Commit 8553f16

Browse files
cursoragentjherr
authored andcommitted
chore: changeset for explicit collection roles
Co-authored-by: jherr <jherr@pobox.com>
1 parent 0c5b1a5 commit 8553f16

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@tanstack/cms-core': minor
3+
'@tanstack/cms-ui-react': minor
4+
'@tanstack/cms-cli': minor
5+
'@tanstack/cms-skills': minor
6+
'@tanstack/cms-migrate-wp': minor
7+
---
8+
9+
A collection's declared content roles are now authoritative. When a collection
10+
sets `summaryField`, `imageField`, or the new `dateField`, `cmsHead` and
11+
`cmsJsonLd` read only that field for the meta description, the social image,
12+
and JSON-LD `datePublished`, even when it's empty for a document; they no
13+
longer fall back to fields named `excerpt`/`description`/…, `hero`/`image`/…,
14+
`publishedDate`/`date`, or the first block's subheading or image. Collections
15+
that don't declare a role keep today's fallbacks for now; they will be removed.
16+
17+
- New `Collection.dateField` role (JSON-LD `datePublished`), `getDateField()`,
18+
and `getCollectionRoles(collection)`, which resolves the title, slug,
19+
blocks, image, summary, byline, body, and date roles at once. The on-page
20+
post editor and the home page's post cards read roles through it.
21+
- `tanstack-cms init`, the skills' collection blueprints (`imageField`,
22+
`summaryField`, `bylineField`, `bodyField`, `dateField`), and the WordPress
23+
schema inference now declare roles.
24+
25+
Declare roles in your own collections with the codemod from a TanStack/cms
26+
checkout. It sets each role to the field the fallbacks pick today, so your
27+
pages' tags don't change:
28+
29+
```sh
30+
pnpm codemod explicit-roles --dry /path/to/your/app
31+
pnpm codemod explicit-roles /path/to/your/app
32+
```

0 commit comments

Comments
 (0)