canopycms 0.8.3 → 0.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 +61 -47
- package/dist/ai/json-to-markdown.js +2 -0
- package/dist/api/branch-entry-changes.js +2 -4
- package/dist/cli/cli.js +83 -16
- package/dist/cli/generate-ai-content.js +82 -15
- package/dist/cli/init.js +1 -1
- package/dist/config/types.d.ts +4 -4
- package/dist/config/types.js +1 -1
- package/dist/config/validation.d.ts +9 -3
- package/dist/config/validation.js +30 -5
- package/dist/content-listing.js +2 -3
- package/dist/content-store.js +5 -5
- package/dist/editor/FormRenderer.js +5 -0
- package/dist/editor/components/EntryChangesDrawer.js +3 -2
- package/dist/editor/entry-diff.js +7 -1
- package/dist/editor/fields/DateField.d.ts +19 -0
- package/dist/editor/fields/DateField.js +53 -0
- package/dist/editor/fields/DateTimeField.d.ts +10 -0
- package/dist/editor/fields/DateTimeField.js +5 -15
- package/dist/editor/fields/list-item-title.js +2 -1
- package/dist/editor/theme.js +12 -4
- package/dist/entry-schema-registry.js +2 -1
- package/dist/static/index.js +5 -2
- package/dist/utils/calendar-day.d.ts +23 -0
- package/dist/utils/calendar-day.js +102 -0
- package/dist/utils/content-serialize.d.ts +4 -2
- package/dist/utils/content-serialize.js +8 -6
- package/dist/validation/entry-validator.js +7 -1
- package/dist/validation/field-traversal.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,9 @@ packages release together, at one version.
|
|
|
5
5
|
|
|
6
6
|
## This build
|
|
7
7
|
|
|
8
|
-
Version `0.
|
|
8
|
+
Version `0.9.0`, built from [`2646912`](https://github.com/safeinsights/canopycms/tree/264691297c186d4a066f0455b4a20a66a84290be).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.
|
|
10
|
+
Its entries are [0.9.0](#090), under **Released**.
|
|
11
11
|
|
|
12
12
|
If you upgraded from a build on another branch, compare the `<!-- changeset: … -->` slugs in your previous build's `CHANGELOG.md` (`npm pack canopycms@<old>` fetches it) with this one's: entries whose slug your old file lacks are new to you.
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ Each entry has up to three parts:
|
|
|
24
24
|
`node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
|
|
25
25
|
what is new since the previous int on the same branch, or on a stable release links its entries, and its links point at the commit the build
|
|
26
26
|
came from. The copy in the repository holds released history and the entries from before changesets;
|
|
27
|
-
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/
|
|
27
|
+
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/.changeset/README.md) until a stable release
|
|
28
28
|
moves it here.
|
|
29
29
|
|
|
30
30
|
**Find your starting point.** From a stable pin, start at the first version under **Released**
|
|
@@ -62,6 +62,20 @@ entries under **Released**.
|
|
|
62
62
|
|
|
63
63
|
## Released
|
|
64
64
|
|
|
65
|
+
### 0.9.0
|
|
66
|
+
|
|
67
|
+
#### A `date` field for a day with no time and no zone
|
|
68
|
+
|
|
69
|
+
<!-- changeset: date-field-type -->
|
|
70
|
+
|
|
71
|
+
_First in 0.9.0._
|
|
72
|
+
|
|
73
|
+
**What changed.** A new scalar field type, `date`, holds a calendar day as a `YYYY-MM-DD` string, edited with a day picker. `datetime` stores an instant, so a day picked in one zone can read as the day before in another; a `date` is the same day everywhere. A save and a production build refuse a value that is not a real day, such as `2026-02-30` or `2026-5-1`; YAML rolls an unquoted `2026-02-30` forward first, so quote hand-written days. A hand-written unquoted `2024-05-01` in md or mdx frontmatter reads as that day in every zone, and survives a save on its own line. `list: true` is refused on a `date`; use an object list with a `date` field inside, which `itemTitleField` may name. `stampOnPublish` stays on `datetime`, and `datetime` values and checks are unchanged. Editor field errors now meet 4.5:1 contrast.
|
|
74
|
+
|
|
75
|
+
**To adopt.** Change `type: 'string'` to `type: 'date'` on a field that holds `YYYY-MM-DD`: `TypeFromEntrySchema` still gives `string`, and every `YYYY-MM-DD` value stays as it is. A production build lists any entry whose value is not a real day, such as `2026-5-1`; fix those by hand. A custom field type that was named `date` keeps its `customRenderers` entry but is now checked as a `date`, so rename it if its values differ. See [Field Types](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/.changeset/README.md#field-types).
|
|
76
|
+
|
|
77
|
+
**Now deletable.** A `string` field with a hand-written `YYYY-MM-DD` format check, and site code that reads a `datetime` back into a day.
|
|
78
|
+
|
|
65
79
|
### 0.8.3
|
|
66
80
|
|
|
67
81
|
#### Dev pages load for non-admin users under `defaultBranchAccess: 'deny'`
|
|
@@ -334,7 +348,7 @@ _First in 0.7.0._
|
|
|
334
348
|
|
|
335
349
|
**What changed.** The pull request a submit opens now lists the branch's unresolved editor comment threads: where each one is, the first line of its first comment (80 characters at most) and a link to it in the editor. Once every thread is resolved, it says so. The list is updated whenever a comment is added, replied to or resolved, as well as on submit. Comment excerpts are visible to everyone who can read the pull request, which on a public repository means everyone. Open threads do not block the merge or keep the pull request in draft. A pull request opened before this release shows no list until its branch is next submitted.
|
|
336
350
|
|
|
337
|
-
**To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
351
|
+
**To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
|
|
338
352
|
|
|
339
353
|
#### Pull request bodies link back to the editor
|
|
340
354
|
|
|
@@ -344,7 +358,7 @@ _First in 0.7.0._
|
|
|
344
358
|
|
|
345
359
|
**What changed.** The pull request a submit opens links to the branch in the editor, and each changed entry to that entry. A notice tells reviewers that comments on the pull request do not reach the editor, so the author will not see them. The links use the editor's URL from the submit, accepted only when its host is the one the request was addressed to (`X-Forwarded-Host`, else `Host`), which holds behind `canopycms-cdk`'s CloudFront distribution as it stands.
|
|
346
360
|
|
|
347
|
-
**To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/
|
|
361
|
+
**To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#definecanopyconfig-options).
|
|
348
362
|
|
|
349
363
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
350
364
|
|
|
@@ -430,7 +444,7 @@ _First in 0.6.0._
|
|
|
430
444
|
|
|
431
445
|
**What changed.** `CanopyCmsService` takes `clerkOrganizationsAsGroups` (default `true`, unchanged), which the worker honours; in a deployment it, not the plugin's `useOrganizationsAsGroups`, decides the groups. When Clerk refuses the organization list with a 403 (Organizations disabled), the refresh now writes users with no groups and logs a warning, instead of failing whole; any other failure still keeps the last snapshot. Memberships are fetched instance-wide rather than per user. The scaffolds write `false` explicitly: `useOrganizationsAsGroups` in `canopycms init`'s `canopy.ts`, and `clerkOrganizationsAsGroups` in `canopycms init-deploy aws`'s CDK stack.
|
|
432
446
|
|
|
433
|
-
**To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/
|
|
447
|
+
**To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md).
|
|
434
448
|
|
|
435
449
|
### 0.5.0
|
|
436
450
|
|
|
@@ -442,7 +456,7 @@ _First in 0.5.0._
|
|
|
442
456
|
|
|
443
457
|
**What changed.** A `type: 'reference', list: true` field now edits as rows in stored order, like an `object` list: drag a row or use its "…" menu to move or remove it, open a row to swap its entry in place, and pick from Add under the rows to append. Neither control offers an entry the list already holds. Any `list: true` field, and any `block` field, takes `maxItems`. The editor stops adding at the cap and says why, a save over it is refused, and a production build fails on an entry over it, naming the entry, field, count and cap. Adding `maxItems` to a list that already holds more therefore fails the build until an editor removes the extra items. `maxItems` on a field that holds no items is refused when the entry schema registry is created.
|
|
444
458
|
|
|
445
|
-
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
459
|
+
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#field-types).
|
|
446
460
|
|
|
447
461
|
#### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
|
|
448
462
|
|
|
@@ -452,7 +466,7 @@ _First in 0.5.0._
|
|
|
452
466
|
|
|
453
467
|
**What changed.** `defineCanopyConfig` takes `seo: { group?, fields? }`, the one place every surface reads an entry's `noindex` flag: the sitemap and `entryToMetadata` that `createNextCanopyContext` returns, AI content and the editor's reference picker. A per-call `seo`/`group`/`fields` still overrides it. The free `generateContentSitemap` takes `seo` as an argument and refuses to run without it when the config sets one; `createNextCanopyContext` and the AI content config refuse a leftover `seo`. A reference picker now badges an entry hidden from search as "Hidden from search", and picking one adds a note naming the setting on that entry's form, since a page listing only indexed entries won't show it. A reference field takes `optionSort`: `'label'` (the default), `'collection'`, or `{ field, direction }`. Point `field` at an ISO date, since strings compare as text.
|
|
454
468
|
|
|
455
|
-
**To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
469
|
+
**To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#how-references-work-in-the-editor).
|
|
456
470
|
|
|
457
471
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
458
472
|
|
|
@@ -480,7 +494,7 @@ resolved without it.
|
|
|
480
494
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
481
495
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
482
496
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
483
|
-
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/
|
|
497
|
+
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#resolving-references-in-a-listing).
|
|
484
498
|
|
|
485
499
|
### 0.3.3
|
|
486
500
|
|
|
@@ -897,7 +911,7 @@ URL.
|
|
|
897
911
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
898
912
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
899
913
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
900
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
914
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#live-preview)).
|
|
901
915
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
902
916
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
903
917
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -912,7 +926,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
912
926
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
913
927
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
914
928
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
915
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
929
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#live-preview).
|
|
916
930
|
|
|
917
931
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
918
932
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -994,7 +1008,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
994
1008
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
995
1009
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
996
1010
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
997
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1011
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#ai-content-configuration).
|
|
998
1012
|
|
|
999
1013
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
1000
1014
|
|
|
@@ -1016,7 +1030,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
1016
1030
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
1017
1031
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
1018
1032
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
1019
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
1033
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#mdx-content-cannot-run-code).
|
|
1020
1034
|
|
|
1021
1035
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
1022
1036
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -1153,7 +1167,7 @@ a format check.
|
|
|
1153
1167
|
|
|
1154
1168
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
1155
1169
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
1156
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1170
|
+
([reference](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#definecanopyconfig-options)).
|
|
1157
1171
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
1158
1172
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
1159
1173
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -1177,7 +1191,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
1177
1191
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
1178
1192
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
1179
1193
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
1180
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
1194
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
1181
1195
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
1182
1196
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
1183
1197
|
|
|
@@ -1215,7 +1229,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
1215
1229
|
new stack needs no steps.
|
|
1216
1230
|
|
|
1217
1231
|
**What changed.** (int.109) Detailed in
|
|
1218
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1232
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
1219
1233
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
1220
1234
|
refusing clients without TLS or IAM, replacing the worker's
|
|
1221
1235
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1269,10 +1283,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1269
1283
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1270
1284
|
unchanged.
|
|
1271
1285
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1272
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
1286
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#worker-down-alarm).
|
|
1273
1287
|
|
|
1274
1288
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1275
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
1289
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
1276
1290
|
`alarmTopic`.
|
|
1277
1291
|
|
|
1278
1292
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1283,7 +1297,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1283
1297
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1284
1298
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1285
1299
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1286
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1300
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#the-worker-instance).
|
|
1287
1301
|
|
|
1288
1302
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1289
1303
|
not Template first and the worker contract stays at 1.
|
|
@@ -1349,7 +1363,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1349
1363
|
|
|
1350
1364
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1351
1365
|
mirror, so the root volume needs room for two
|
|
1352
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1366
|
+
([details](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1353
1367
|
|
|
1354
1368
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1355
1369
|
|
|
@@ -1371,7 +1385,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1371
1385
|
bundle-only roll is safe.
|
|
1372
1386
|
|
|
1373
1387
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1374
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1388
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
1375
1389
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1376
1390
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1377
1391
|
|
|
@@ -1388,8 +1402,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1388
1402
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1389
1403
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1390
1404
|
takes `worker/`'s three units and `gateway.env.example`
|
|
1391
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
1392
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
1405
|
+
([steps](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
1406
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
1393
1407
|
|
|
1394
1408
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1395
1409
|
|
|
@@ -1400,7 +1414,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1400
1414
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1401
1415
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1402
1416
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
1403
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
1417
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
1404
1418
|
|
|
1405
1419
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1406
1420
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1576,7 +1590,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1576
1590
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1577
1591
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1578
1592
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1579
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1593
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#ai-content-configuration).
|
|
1580
1594
|
|
|
1581
1595
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1582
1596
|
change its link.
|
|
@@ -1651,7 +1665,7 @@ _First in int.115._
|
|
|
1651
1665
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1652
1666
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1653
1667
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1654
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1668
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1655
1669
|
unpublishing.
|
|
1656
1670
|
|
|
1657
1671
|
#### The editor calls the content drawer "All content"
|
|
@@ -1963,7 +1977,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1963
1977
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1964
1978
|
|
|
1965
1979
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1966
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
1980
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#stamping-a-publication-date).
|
|
1967
1981
|
|
|
1968
1982
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1969
1983
|
|
|
@@ -2010,7 +2024,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
2010
2024
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
2011
2025
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
2012
2026
|
no longer exported from `canopycms/client`. See
|
|
2013
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
2027
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#editor-customization).
|
|
2014
2028
|
|
|
2015
2029
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
2016
2030
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -2121,7 +2135,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
2121
2135
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
2122
2136
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
2123
2137
|
own pages, mount the hook as in
|
|
2124
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
2138
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
2125
2139
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
2126
2140
|
|
|
2127
2141
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -2162,12 +2176,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
2162
2176
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
2163
2177
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
2164
2178
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
2165
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
2179
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
2166
2180
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
2167
2181
|
lines to `.github/workflows/deploy-cms.yml`, or re-runs the generator and diffs. `cdk synth` refuses a `…JsonField` prop without its `…SecretArn`, and an ARN carrying the ECS `:KEY::` suffix
|
|
2168
2182
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
2169
2183
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
2170
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2184
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#security-model)).
|
|
2171
2185
|
|
|
2172
2186
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
2173
2187
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -2179,7 +2193,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
2179
2193
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
2180
2194
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
2181
2195
|
anyone holding an App's key can mint a token for any of its installations
|
|
2182
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
2196
|
+
([why](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
2183
2197
|
|
|
2184
2198
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
2185
2199
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -2192,7 +2206,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2192
2206
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
2193
2207
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
2194
2208
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
2195
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
2209
|
+
([details](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
2196
2210
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
2197
2211
|
of the three is refused at synth, and so is an App alongside a token.
|
|
2198
2212
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -2203,7 +2217,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2203
2217
|
|
|
2204
2218
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
2205
2219
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
2206
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
2220
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
2207
2221
|
|
|
2208
2222
|
```bash
|
|
2209
2223
|
canopycms init-github-app create -- \
|
|
@@ -2251,7 +2265,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2251
2265
|
|
|
2252
2266
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2253
2267
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
2254
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
2268
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#rotating-a-secret).
|
|
2255
2269
|
|
|
2256
2270
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2257
2271
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2305,12 +2319,12 @@ also check the bucket policy for its grant.
|
|
|
2305
2319
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2306
2320
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2307
2321
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
2308
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
2322
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#dual-build-support)).
|
|
2309
2323
|
|
|
2310
2324
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2311
2325
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2312
2326
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
2313
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
2327
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
2314
2328
|
|
|
2315
2329
|
**To adopt.**
|
|
2316
2330
|
|
|
@@ -2339,7 +2353,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2339
2353
|
|
|
2340
2354
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2341
2355
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
2342
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2356
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#media-configuration) for the
|
|
2343
2357
|
CloudFront behavior it expects.
|
|
2344
2358
|
|
|
2345
2359
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2364,7 +2378,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2364
2378
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2365
2379
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2366
2380
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
2367
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
2381
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
2368
2382
|
|
|
2369
2383
|
**To adopt.** Optional:
|
|
2370
2384
|
|
|
@@ -2474,7 +2488,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2474
2488
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2475
2489
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2476
2490
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2477
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2491
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/docs/deploying-to-aws.md#security-model)).
|
|
2478
2492
|
|
|
2479
2493
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2480
2494
|
|
|
@@ -2573,7 +2587,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2573
2587
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2574
2588
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2575
2589
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2576
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2590
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#media-configuration)). Two traps:
|
|
2577
2591
|
|
|
2578
2592
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2579
2593
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2732,7 +2746,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2732
2746
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2733
2747
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2734
2748
|
`createNextCanopyContext`'s result. See
|
|
2735
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2749
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2736
2750
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2737
2751
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2738
2752
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2789,7 +2803,7 @@ underscore-prefixed files are skipped.
|
|
|
2789
2803
|
|
|
2790
2804
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2791
2805
|
`defaultPathAccess: { read: 'allow' }`
|
|
2792
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2806
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#public-read-on-server-deployments)).
|
|
2793
2807
|
|
|
2794
2808
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2795
2809
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2842,7 +2856,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2842
2856
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2843
2857
|
gives one template's value type) requires exactly
|
|
2844
2858
|
one component per block template name when written as an object literal. See
|
|
2845
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2859
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#block-component-registries) and
|
|
2846
2860
|
`apps/example1/app/components/PostView.tsx`.
|
|
2847
2861
|
|
|
2848
2862
|
```ts
|
|
@@ -2864,7 +2878,7 @@ templates against the schema.
|
|
|
2864
2878
|
|
|
2865
2879
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2866
2880
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2867
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2881
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2868
2882
|
identity helper for them.
|
|
2869
2883
|
|
|
2870
2884
|
```ts
|
|
@@ -2883,7 +2897,7 @@ field by composing from the same `const` field object.
|
|
|
2883
2897
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2884
2898
|
it, and listings do with
|
|
2885
2899
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2886
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2900
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#shared--referenced-blocks).
|
|
2887
2901
|
|
|
2888
2902
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2889
2903
|
|
|
@@ -2905,7 +2919,7 @@ Not retro-documented, apart from these:
|
|
|
2905
2919
|
|
|
2906
2920
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2907
2921
|
|
|
2908
|
-
**What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/
|
|
2922
|
+
**What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/264691297c186d4a066f0455b4a20a66a84290be/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2909
2923
|
|
|
2910
2924
|
**To adopt.**
|
|
2911
2925
|
|
|
@@ -152,6 +152,7 @@ function renderField(field, value, depth, entry, opts) {
|
|
|
152
152
|
switch (field.type) {
|
|
153
153
|
case 'string':
|
|
154
154
|
case 'number':
|
|
155
|
+
case 'date':
|
|
155
156
|
case 'datetime':
|
|
156
157
|
return `${heading} ${label}${descriptionLine}\n\n${String(value)}`;
|
|
157
158
|
case 'boolean':
|
|
@@ -222,6 +223,7 @@ function renderListField(field, values, depth, label, heading, descriptionLine,
|
|
|
222
223
|
const FLAT_CELL_TYPES = new Set([
|
|
223
224
|
'string',
|
|
224
225
|
'number',
|
|
226
|
+
'date',
|
|
225
227
|
'datetime',
|
|
226
228
|
'boolean',
|
|
227
229
|
'select',
|
|
@@ -5,10 +5,10 @@ import { entryRefFromRepoPath, entryRefFromRepoPathShape, parseEntryParts, } fro
|
|
|
5
5
|
import { ContentStore, ContentStoreError } from '../content-store.js';
|
|
6
6
|
import { resolveCollectionPath } from '../content-id-index.js';
|
|
7
7
|
import { BaseBranchMissingError } from '../git-manager.js';
|
|
8
|
-
import { withItemKeys } from '../item-keys.js';
|
|
9
8
|
import { getBranchProtection } from '../authorization/protected-branch.js';
|
|
10
9
|
import { baseBranchOf } from '../utils/base-branch.js';
|
|
11
10
|
import { findBodyFieldName } from '../utils/body-field.js';
|
|
11
|
+
import { entryAsRead } from '../utils/calendar-day.js';
|
|
12
12
|
import { isNodeError, isNotFoundError } from '../utils/error.js';
|
|
13
13
|
import { getFormatExtension } from '../utils/format.js';
|
|
14
14
|
import { entryLogicalPath } from '../paths/index.js';
|
|
@@ -155,9 +155,7 @@ const readBefore = async (git, mergeBase, logicalPath, match, branchContext, con
|
|
|
155
155
|
return {
|
|
156
156
|
format,
|
|
157
157
|
entryType: ref.entryType,
|
|
158
|
-
|
|
159
|
-
// base carries the same key on both.
|
|
160
|
-
data: withItemKeys(fields, parsed.data, 'content'),
|
|
158
|
+
data: entryAsRead(fields, parsed.data),
|
|
161
159
|
...(parsed.body !== undefined && {
|
|
162
160
|
body: parsed.body,
|
|
163
161
|
bodyFieldName: findBodyFieldName(fields),
|