canopycms 0.12.1 → 0.13.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +211 -49
  2. package/dist/api/branch-review.d.ts +20 -2
  3. package/dist/api/branch-review.js +112 -23
  4. package/dist/api/branch-status.d.ts +11 -2
  5. package/dist/api/branch-status.js +3 -2
  6. package/dist/api/branch-update-from-base.js +57 -6
  7. package/dist/api/branch.d.ts +5 -0
  8. package/dist/api/branch.js +27 -2
  9. package/dist/api/client.d.ts +2 -2
  10. package/dist/api/client.js +2 -2
  11. package/dist/api/content.js +1 -1
  12. package/dist/api/merge-conflicts.d.ts +10 -1
  13. package/dist/api/merge-conflicts.js +42 -7
  14. package/dist/api/types.d.ts +3 -2
  15. package/dist/base-update.d.ts +6 -0
  16. package/dist/branch-metadata-file.d.ts +15 -0
  17. package/dist/branch-metadata-file.js +5 -1
  18. package/dist/cli/cli.js +238 -108
  19. package/dist/cli/generate-ai-content.js +20 -6
  20. package/dist/cli/github-app-manifest.d.ts +4 -1
  21. package/dist/cli/github-app-manifest.js +5 -1
  22. package/dist/cli/init.js +7 -1
  23. package/dist/editor/Editor.js +39 -16
  24. package/dist/editor/admin/ConflictsStatusAlert.d.ts +8 -0
  25. package/dist/editor/admin/ConflictsStatusAlert.js +22 -0
  26. package/dist/editor/admin/SystemHealthPanel.js +4 -3
  27. package/dist/editor/base-update-wait.d.ts +4 -0
  28. package/dist/editor/base-update-wait.js +7 -0
  29. package/dist/editor/components/ConflictsGroup.d.ts +13 -1
  30. package/dist/editor/components/ConflictsGroup.js +52 -12
  31. package/dist/editor/components/EditorHeader.d.ts +3 -1
  32. package/dist/editor/components/EditorHeader.js +11 -7
  33. package/dist/editor/components/EntryChangesDrawer.d.ts +1 -1
  34. package/dist/editor/components/EntryChangesDrawer.js +58 -6
  35. package/dist/editor/conflict-cards.d.ts +4 -1
  36. package/dist/editor/conflict-cards.js +14 -9
  37. package/dist/editor/hooks/useBaseUpdate.d.ts +2 -0
  38. package/dist/editor/hooks/useBaseUpdate.js +12 -2
  39. package/dist/editor/hooks/useBranchChangesData.d.ts +7 -1
  40. package/dist/editor/hooks/useBranchChangesData.js +13 -0
  41. package/dist/editor/hooks/useBranchManager.d.ts +2 -0
  42. package/dist/editor/hooks/useBranchManager.js +80 -6
  43. package/dist/editor/hooks/useDraftManager.d.ts +8 -1
  44. package/dist/editor/hooks/useDraftManager.js +16 -1
  45. package/dist/editor/hooks/useEntryManager.d.ts +8 -3
  46. package/dist/editor/hooks/useEntryManager.js +6 -5
  47. package/dist/git-manager.d.ts +1 -0
  48. package/dist/git-manager.js +8 -3
  49. package/dist/merge/entry-merge.js +4 -3
  50. package/dist/merge/list-alignment.d.ts +9 -6
  51. package/dist/merge/list-alignment.js +65 -16
  52. package/dist/merge/rekey.d.ts +11 -0
  53. package/dist/merge/rekey.js +75 -0
  54. package/dist/operating-mode/client-safe-strategy.js +1 -1
  55. package/dist/operating-mode/client-unsafe-strategy.js +6 -0
  56. package/dist/operating-mode/types.d.ts +10 -2
  57. package/dist/services.d.ts +12 -4
  58. package/dist/services.js +56 -0
  59. package/dist/types.d.ts +35 -3
  60. package/dist/utils/git.d.ts +7 -0
  61. package/dist/utils/git.js +35 -0
  62. package/dist/version.d.ts +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/worker/branch-merge.d.ts +27 -3
  65. package/dist/worker/branch-merge.js +106 -5
  66. package/dist/worker/branch-policy.d.ts +18 -2
  67. package/dist/worker/branch-policy.js +36 -0
  68. package/dist/worker/cms-worker.d.ts +21 -0
  69. package/dist/worker/cms-worker.js +29 -4
  70. package/dist/worker/conflicts-status.d.ts +20 -0
  71. package/dist/worker/conflicts-status.js +204 -0
  72. package/dist/worker/field-merge.d.ts +17 -2
  73. package/dist/worker/field-merge.js +95 -2
  74. package/dist/worker/git-sync.d.ts +3 -2
  75. package/dist/worker/git-sync.js +9 -0
  76. package/dist/worker/github-commits.d.ts +3 -3
  77. package/dist/worker/github-commits.js +192 -40
  78. package/dist/worker/github-errors.d.ts +15 -0
  79. package/dist/worker/github-errors.js +47 -0
  80. package/dist/worker/github-gateway-http.js +7 -0
  81. package/dist/worker/github-gateway-wire.d.ts +30 -10
  82. package/dist/worker/github-gateway-wire.js +14 -2
  83. package/dist/worker/github-gateway.d.ts +17 -0
  84. package/dist/worker/github-gateway.js +37 -1
  85. package/dist/worker/history-rewrite.d.ts +40 -8
  86. package/dist/worker/history-rewrite.js +51 -23
  87. package/dist/worker/publish-decision.d.ts +37 -0
  88. package/dist/worker/publish-decision.js +16 -0
  89. package/dist/worker/rebase.d.ts +25 -5
  90. package/dist/worker/rebase.js +225 -81
  91. package/dist/worker/task-runner.js +16 -39
  92. package/dist/worker/worker-context.d.ts +6 -0
  93. 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.12.1`, built from [`aaf8e5f`](https://github.com/safeinsights/canopycms/tree/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb).
8
+ Version `0.13.0`, built from [`b5a1131`](https://github.com/safeinsights/canopycms/tree/b5a1131194aa99a6532f84792caf439f6d358e67).
9
9
 
10
- Its entries are [0.12.1](#0121), under **Released**.
10
+ Its entries are [0.13.0](#0130), 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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/.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,168 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.13.0
66
+
67
+ #### Focus stays in "Show changes" after an entry-level conflict choice
68
+
69
+ <!-- changeset: conflict-entry-choice-focus -->
70
+
71
+ _First in 0.13.0._
72
+
73
+ **What changed.** After "Keep it", "Keep it deleted", "Restore entry" or "Keep your version" on a
74
+ conflict card, a status line says what happened. Focus moves to "Restore entry" while the entry
75
+ stays deleted, and otherwise to the drawer's title, instead of dropping to the page.
76
+
77
+ #### "Keep it deleted" on a conflict checks that the entry is still gone
78
+
79
+ <!-- changeset: conflict-keep-deleted-check -->
80
+
81
+ _First in 0.13.0._
82
+
83
+ **What changed.** If an entry came back after "Show changes" opened (from another tab, or a
84
+ restore whose answer was lost), "Keep it deleted" no longer clears its conflicts. The card reloads
85
+ and shows what is left to choose.
86
+
87
+ #### "Use latest version" never changes another list item
88
+
89
+ <!-- changeset: conflict-use-latest-other-item -->
90
+
91
+ _First in 0.13.0._
92
+
93
+ **What changed.** In a list whose items look alike, a save could give one item the key of an item
94
+ you had removed. That item's conflict card then offered "Use latest version", which overwrote the
95
+ look-alike, and showed it as your version. The card now shows that item as removed, and its
96
+ latest version can't be placed: change it in the form by hand, then choose "Mark resolved".
97
+
98
+ #### "Get latest changes" works in dev mode
99
+
100
+ <!-- changeset: dev-get-latest-changes -->
101
+
102
+ _First in 0.13.0._
103
+
104
+ **What changed.** In dev mode, "Get latest changes" now shows on an editing branch. The request
105
+ runs the worker's merge for that branch alone and answers before it returns, so the result and
106
+ any conflicts show at once. It brings in the local remote's base; a branch cloned from another
107
+ remote is told so and left as it is. Prod still queues the request for the CMS worker, as before.
108
+
109
+ #### A refused "Get latest changes" that is a conflict shows yellow
110
+
111
+ <!-- changeset: get-latest-refusal-colour -->
112
+
113
+ _First in 0.13.0._
114
+
115
+ **What changed.** When "Get latest changes" is refused because of the branch's state, for example
116
+ a branch in review or one busy with a save, the message now shows yellow, as other conflicts do.
117
+ Other failures stay red.
118
+
119
+ #### "Latest changes waiting" in the branch bar
120
+
121
+ <!-- changeset: latest-changes-waiting -->
122
+
123
+ _First in 0.13.0._
124
+
125
+ **What changed.** The automatic sync still skips a branch with saved but uncommitted work and
126
+ commits nothing on a timer. When the base has moved on meanwhile, the branch bar now shows "Latest
127
+ changes waiting", whose tooltip points to "Get latest changes". It clears once the branch holds the
128
+ base again.
129
+
130
+ #### Approve and Request changes pin the commit the reviewer saw — **behaviour change**
131
+
132
+ <!-- changeset: review-pins-the-commit-seen -->
133
+
134
+ _First in 0.13.0._
135
+
136
+ **What changed.** Approve and Request changes now send the commit the reviewer's page showed, and
137
+ the API refuses either one when the branch has moved since: "This branch changed since you opened
138
+ it. Review the latest changes." The editor then reloads the branch, keeping a Request changes
139
+ note for the next try. An approval records its commit, and the worker sends an approved branch
140
+ back to review when commits come in that are more than that commit with the base merged in. An editor tab opened before this
141
+ release is refused the same way until the page is reloaded.
142
+
143
+ #### A "CanopyCMS conflicts" status on pull requests — **new GitHub App permission**
144
+
145
+ <!-- changeset: conflicts-commit-status -->
146
+
147
+ _First in 0.13.0._
148
+
149
+ **What changed.** The worker sets a `CanopyCMS conflicts` commit status on each pull request's
150
+ head: it fails with the number of choices still open in the editor, and passes once none are.
151
+ Make it a required check in branch protection to stop a by-hand merge of undecided content, on a
152
+ branch the CMS opens every pull request into: other pull requests never get it.
153
+ `init-github-app` now asks for the "Commit statuses: read and write" permission, and `verify`
154
+ reports an installation without it. Until an installation has it, only the status is refused, and
155
+ System health says so.
156
+
157
+ **To adopt.** On an existing GitHub App, its owner adds "Commit statuses: read and write" in the
158
+ App's permissions on GitHub, an owner of the account it is installed on accepts the request in the
159
+ installation's settings, then `canopycms init-github-app verify` confirms it. A fine-grained token
160
+ needs "Commit statuses: read and write"; a classic token's `repo` scope already covers it. See
161
+ [Submitting for Review](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#submitting-for-review).
162
+
163
+ #### List items rewritten to read like one deleted item no longer conflict as a whole list
164
+
165
+ <!-- changeset: fm-list-items-rewritten-alike -->
166
+
167
+ _First in 0.13.0._
168
+
169
+ **What changed.** When one side of a merge rewrote two or more list items to read exactly like an
170
+ item it deleted, the field merge raised a conflict on the whole list. Each rewritten item now
171
+ merges as the item its key names. Where that side also copied an item it rewrote this way, the
172
+ copy now stays a new item instead of being read as the original and dropped.
173
+
174
+ #### Update branch on GitHub no longer leaves list items under keys that name other items
175
+
176
+ <!-- changeset: fm-rekey-update-branch -->
177
+
178
+ _First in 0.13.0._
179
+
180
+ **What changed.** When "Update branch" on a pull request merges the base into a branch, git keeps each list item under the key the branch's copy held, which can name another item once the base changed it. Later merges could then misread the item and undo a deletion or miss a conflict. The worker now takes such a merge in with one more commit that gives those items the keys the field merge would, and moves the branch's comment threads with them. The commit changes item keys only, so an approved branch stays approved. On GitHub it is a new push to the pull request, which dismisses approvals where the repository dismisses stale approvals.
181
+
182
+ #### "Get latest changes" reports the conflicts a merge of GitHub's commits leaves
183
+
184
+ <!-- changeset: get-latest-answer-after-github-merge -->
185
+
186
+ _First in 0.13.0._
187
+
188
+ **What changed.** When the latest changes reached a branch through its pull request on GitHub, for example after Update branch, "Get latest changes" merged them, then answered "You already have the latest changes" a cycle later, even where the merge left values for a person to choose. Where that merge holds the base, it now answers as a merge of the base does, with the conflicts to resolve, and the "Latest changes waiting" badge clears at once.
189
+
190
+ #### An item moved into a list no longer takes the identity of the copy beside it
191
+
192
+ <!-- changeset: merge-moved-in-item-keeps-identity -->
193
+
194
+ _First in 0.13.0._
195
+
196
+ **What changed.** When an editor duplicated a list item, moved the copy to another list, and later moved the original into that list above the copy, the field merge could read the original as the copy. The base's edit of the copy then landed on the original with no conflict shown, and a base deletion of the copy was reported against the wrong item. An item now takes another's identity from a look-alike key only where no item on its side holds that item's own key, and never when the key belongs to an item of another list. Such a moved-in item is also no longer merged into an alike item the other side added to that list, so neither is lost.
197
+
198
+ #### A rebased branch publishes only the commits the rebase made
199
+
200
+ <!-- changeset: rewrite-publish-rebased-tip -->
201
+
202
+ _First in 0.13.0._
203
+
204
+ **What changed.** After rebasing a branch it had already published onto the base, the worker publishes the rewritten history to the workspace's remote and GitHub. It read the branch's head for that a few steps after the rebase. If the worker had lost its lock and the editor committed saved work in that moment, that unsubmitted work was published too. The worker now publishes the commit the rebase made, and saved work committed after it stays unpublished until it is submitted.
205
+
206
+ #### An entry deleted or renamed in the editor no longer comes back when GitHub's commits are taken in
207
+
208
+ <!-- changeset: take-in-keeps-saved-deletes -->
209
+
210
+ _First in 0.13.0._
211
+
212
+ **What changed.** When a branch's copy on GitHub had commits the editor's workspace lacked, such as an Update branch or a maintainer's fix, the worker brought them in and wrote back any entry the editor had deleted, or the old path of one it had renamed, while that change was not yet submitted. The deletion was lost, or a renamed entry ended up twice. The worker now waits instead, as it already does for a saved edit to a file those commits change. An editing branch that lacks the base shows that the latest changes are waiting, and the deletion merges with GitHub's commits once it is committed, by "Get latest changes" or a submit.
213
+
214
+ #### Saved work stays off GitHub until it is submitted — **behaviour change**
215
+
216
+ <!-- changeset: unsubmitted-work-stays-unpublished -->
217
+
218
+ _First in 0.13.0._
219
+
220
+ **What changed.** When the worker brings the base branch, or commits made on GitHub, into a branch
221
+ that holds saved work its author has not submitted, the merge stays in the branch's clone: neither
222
+ the worker's own repository nor GitHub receives it until the author submits, whose push carries it.
223
+ This holds for a withdrawn branch, one sent back with "Request changes", and one whose GitHub branch
224
+ was deleted, which the worker no longer recreates with that work. Finishing an interrupted rewrite
225
+ of a published branch publishes only the rewritten history, never a commit made since.
226
+
65
227
  ### 0.12.1
66
228
 
67
229
  <!-- changeset: field-merge-engine -->
@@ -79,7 +241,7 @@ entries under **Released**.
79
241
 
80
242
  _First in 0.12.1._
81
243
 
82
- **What changed.** A new command writes the `_key` of every object-list item and block into your content, exactly as an editor save of the unedited entry would. Until a file holds its keys, an editor's first save adds `_key` lines beside the real edit, and those lines can conflict with changes the base branch makes to the same entry meanwhile. `--check` writes nothing and exits 1 when any file needs keys. See [Keying list items](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#keying-list-items).
244
+ **What changed.** A new command writes the `_key` of every object-list item and block into your content, exactly as an editor save of the unedited entry would. Until a file holds its keys, an editor's first save adds `_key` lines beside the real edit, and those lines can conflict with changes the base branch makes to the same entry meanwhile. `--check` writes nothing and exits 1 when any file needs keys. See [Keying list items](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#keying-list-items).
83
245
 
84
246
  **To adopt.** Once, on a clean checkout of your base branch: run `npx canopycms backfill-item-keys`, review the files it lists as also normalised, and commit the result on its own, with nothing else in the commit. Optionally gate CI on `npx canopycms backfill-item-keys --check`.
85
247
 
@@ -234,7 +396,7 @@ _First in 0.9.0._
234
396
 
235
397
  **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.
236
398
 
237
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/.changeset/README.md#field-types).
399
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/.changeset/README.md#field-types).
238
400
 
239
401
  **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.
240
402
 
@@ -510,7 +672,7 @@ _First in 0.7.0._
510
672
 
511
673
  **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.
512
674
 
513
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
675
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
514
676
 
515
677
  #### Pull request bodies link back to the editor
516
678
 
@@ -520,7 +682,7 @@ _First in 0.7.0._
520
682
 
521
683
  **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.
522
684
 
523
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#definecanopyconfig-options).
685
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#definecanopyconfig-options).
524
686
 
525
687
  #### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
526
688
 
@@ -606,7 +768,7 @@ _First in 0.6.0._
606
768
 
607
769
  **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.
608
770
 
609
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md).
771
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md).
610
772
 
611
773
  ### 0.5.0
612
774
 
@@ -618,7 +780,7 @@ _First in 0.5.0._
618
780
 
619
781
  **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.
620
782
 
621
- **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#field-types).
783
+ **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#field-types).
622
784
 
623
785
  #### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
624
786
 
@@ -628,7 +790,7 @@ _First in 0.5.0._
628
790
 
629
791
  **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.
630
792
 
631
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#how-references-work-in-the-editor).
793
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#how-references-work-in-the-editor).
632
794
 
633
795
  **Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
634
796
 
@@ -656,7 +818,7 @@ resolved without it.
656
818
  **To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
657
819
  reference field. Code that reads the body from a link-only reference's resolved type now sees
658
820
  `string | undefined`; either set `includeBody: true` or handle the missing value. See
659
- [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#resolving-references-in-a-listing).
821
+ [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#resolving-references-in-a-listing).
660
822
 
661
823
  ### 0.3.3
662
824
 
@@ -1073,7 +1235,7 @@ URL.
1073
1235
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
1074
1236
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
1075
1237
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
1076
- [Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview)).
1238
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#live-preview)).
1077
1239
  3. A test reading view content from the route's server HTML must load the page in a browser.
1078
1240
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
1079
1241
  of cross-request caches (`unstable_cache`, module memos).
@@ -1088,7 +1250,7 @@ kept site styles ahead of Mantine's in the preview.
1088
1250
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
1089
1251
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
1090
1252
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
1091
- [Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview).
1253
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#live-preview).
1092
1254
 
1093
1255
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
1094
1256
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -1170,7 +1332,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
1170
1332
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
1171
1333
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
1172
1334
  place. A field that links to a hidden section by plain URL needs a field transform; the README
1173
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
1335
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#ai-content-configuration).
1174
1336
 
1175
1337
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
1176
1338
 
@@ -1192,7 +1354,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
1192
1354
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
1193
1355
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
1194
1356
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
1195
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#mdx-content-cannot-run-code).
1357
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#mdx-content-cannot-run-code).
1196
1358
 
1197
1359
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
1198
1360
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -1329,7 +1491,7 @@ a format check.
1329
1491
 
1330
1492
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
1331
1493
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
1332
- ([reference](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#definecanopyconfig-options)).
1494
+ ([reference](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#definecanopyconfig-options)).
1333
1495
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
1334
1496
  the PR-body section every user who edited the branch, not only the submitter; settings commits
1335
1497
  (permissions, groups) carry the acting user's trailer.
@@ -1353,7 +1515,7 @@ saves only push the branch, and no failing PR task lands in System health.
1353
1515
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
1354
1516
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
1355
1517
  worker holds the base branch for up to 30 minutes while that lasts; see
1356
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1518
+ [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1357
1519
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
1358
1520
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
1359
1521
 
@@ -1391,7 +1553,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
1391
1553
  new stack needs no steps.
1392
1554
 
1393
1555
  **What changed.** (int.109) Detailed in
1394
- [The worker instance](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1556
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1395
1557
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
1396
1558
  refusing clients without TLS or IAM, replacing the worker's
1397
1559
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -1445,10 +1607,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
1445
1607
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
1446
1608
  unchanged.
1447
1609
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
1448
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#worker-down-alarm).
1610
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#worker-down-alarm).
1449
1611
 
1450
1612
  **To adopt.** Optional. For parameter-only change sets, see
1451
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1613
+ [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1452
1614
  `alarmTopic`.
1453
1615
 
1454
1616
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -1459,7 +1621,7 @@ worker, and a hand-built alarm on the worker log group.
1459
1621
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
1460
1622
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
1461
1623
  `alarmTopic` if set; a retried step names itself when it gives up. See
1462
- [The worker instance](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance).
1624
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#the-worker-instance).
1463
1625
 
1464
1626
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
1465
1627
  not Template first and the worker contract stays at 1.
@@ -1525,7 +1687,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
1525
1687
 
1526
1688
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
1527
1689
  mirror, so the root volume needs room for two
1528
- ([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance)).
1690
+ ([details](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#the-worker-instance)).
1529
1691
 
1530
1692
  #### The worker follows a rebased or deleted GitHub branch
1531
1693
 
@@ -1547,7 +1709,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
1547
1709
  bundle-only roll is safe.
1548
1710
 
1549
1711
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
1550
- ([recipe](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1712
+ ([recipe](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1551
1713
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
1552
1714
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
1553
1715
 
@@ -1564,8 +1726,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
1564
1726
  template, then roll the bundle; on an older template it stops with `template too old for this
1565
1727
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
1566
1728
  takes `worker/`'s three units and `gateway.env.example`
1567
- ([steps](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1568
- [checklist](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#first-deploy-checklist).
1729
+ ([steps](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1730
+ [checklist](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#first-deploy-checklist).
1569
1731
 
1570
1732
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
1571
1733
 
@@ -1576,7 +1738,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
1576
1738
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
1577
1739
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
1578
1740
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
1579
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1741
+ [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1580
1742
 
1581
1743
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
1582
1744
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -1752,7 +1914,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
1752
1914
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
1753
1915
  apply the same rule here, for example `referenceLink: (target, { body }) =>
1754
1916
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
1755
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
1917
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#ai-content-configuration).
1756
1918
 
1757
1919
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
1758
1920
  change its link.
@@ -1827,7 +1989,7 @@ _First in int.115._
1827
1989
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1828
1990
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1829
1991
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1830
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#drafts-and-unpublishing) section covers long-lived branches and
1992
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#drafts-and-unpublishing) section covers long-lived branches and
1831
1993
  unpublishing.
1832
1994
 
1833
1995
  #### The editor calls the content drawer "All content"
@@ -2139,7 +2301,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
2139
2301
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
2140
2302
 
2141
2303
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
2142
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#stamping-a-publication-date).
2304
+ `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#stamping-a-publication-date).
2143
2305
 
2144
2306
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
2145
2307
 
@@ -2186,7 +2348,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
2186
2348
  stored at, and `react-split-pane` is no longer a dependency.
2187
2349
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
2188
2350
  no longer exported from `canopycms/client`. See
2189
- [Your root layout](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#editor-customization).
2351
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#editor-customization).
2190
2352
 
2191
2353
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
2192
2354
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -2297,7 +2459,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
2297
2459
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
2298
2460
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
2299
2461
  own pages, mount the hook as in
2300
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2462
+ [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2301
2463
  Your own Server Actions in the CMS build still 403 behind OAC.
2302
2464
 
2303
2465
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -2338,12 +2500,12 @@ fast naming the ARN, the field and the keys present, never a value.
2338
2500
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
2339
2501
  prop. The scaffolded stack fills them from the repository _variables_
2340
2502
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
2341
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2503
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2342
2504
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
2343
2505
  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
2344
2506
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
2345
2507
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
2346
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
2508
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#security-model)).
2347
2509
 
2348
2510
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
2349
2511
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -2355,7 +2517,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
2355
2517
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
2356
2518
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
2357
2519
  anyone holding an App's key can mint a token for any of its installations
2358
- ([why](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2520
+ ([why](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2359
2521
 
2360
2522
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
2361
2523
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -2368,7 +2530,7 @@ anyone holding an App's key can mint a token for any of its installations
2368
2530
  `verify` checks an existing installation's permissions: run it, since an App missing a
2369
2531
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
2370
2532
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
2371
- ([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2533
+ ([details](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2372
2534
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
2373
2535
  of the three is refused at synth, and so is an App alongside a token.
2374
2536
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -2379,7 +2541,7 @@ anyone holding an App's key can mint a token for any of its installations
2379
2541
 
2380
2542
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
2381
2543
  IAM policy automatically, so you need not add it to `secretsArns`. See
2382
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2544
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2383
2545
 
2384
2546
  ```bash
2385
2547
  canopycms init-github-app create -- \
@@ -2427,7 +2589,7 @@ downloads the `.pem` from the App's settings page.
2427
2589
 
2428
2590
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
2429
2591
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
2430
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rotating-a-secret).
2592
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#rotating-a-secret).
2431
2593
 
2432
2594
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
2433
2595
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -2481,12 +2643,12 @@ also check the bucket policy for its grant.
2481
2643
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
2482
2644
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
2483
2645
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
2484
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#dual-build-support)).
2646
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#dual-build-support)).
2485
2647
 
2486
2648
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
2487
2649
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
2488
2650
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
2489
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#where-the-image-is-built)).
2651
+ on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#where-the-image-is-built)).
2490
2652
 
2491
2653
  **To adopt.**
2492
2654
 
@@ -2515,7 +2677,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
2515
2677
 
2516
2678
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
2517
2679
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
2518
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration) for the
2680
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#media-configuration) for the
2519
2681
  CloudFront behavior it expects.
2520
2682
 
2521
2683
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -2540,7 +2702,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
2540
2702
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
2541
2703
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
2542
2704
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
2543
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#cross-account-asset-bucket).
2705
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#cross-account-asset-bucket).
2544
2706
 
2545
2707
  **To adopt.** Optional:
2546
2708
 
@@ -2650,7 +2812,7 @@ public JWKS PEM, used only to verify signatures.
2650
2812
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
2651
2813
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
2652
2814
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
2653
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
2815
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/docs/deploying-to-aws.md#security-model)).
2654
2816
 
2655
2817
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
2656
2818
 
@@ -2749,7 +2911,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
2749
2911
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
2750
2912
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
2751
2913
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
2752
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration)). Two traps:
2914
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#media-configuration)). Two traps:
2753
2915
 
2754
2916
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
2755
2917
  a nested route prefix and emits zero params, building green.
@@ -2908,7 +3070,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2908
3070
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2909
3071
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2910
3072
  `createNextCanopyContext`'s result. See
2911
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#sitemap-and-seo-metadata). Every routable entry type is in
3073
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2912
3074
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2913
3075
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2914
3076
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2965,7 +3127,7 @@ underscore-prefixed files are skipped.
2965
3127
 
2966
3128
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2967
3129
  `defaultPathAccess: { read: 'allow' }`
2968
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#public-read-on-server-deployments)).
3130
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#public-read-on-server-deployments)).
2969
3131
 
2970
3132
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2971
3133
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -3018,7 +3180,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
3018
3180
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
3019
3181
  gives one template's value type) requires exactly
3020
3182
  one component per block template name when written as an object literal. See
3021
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#block-component-registries) and
3183
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#block-component-registries) and
3022
3184
  `apps/example1/app/components/PostView.tsx`.
3023
3185
 
3024
3186
  ```ts
@@ -3040,7 +3202,7 @@ templates against the schema.
3040
3202
 
3041
3203
  **What changed.** Spreading a `const` field array into several schemas, and nesting
3042
3204
  `defineInlineFieldGroup()` inside a block template, are documented
3043
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
3205
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
3044
3206
  identity helper for them.
3045
3207
 
3046
3208
  ```ts
@@ -3059,7 +3221,7 @@ field by composing from the same `const` field object.
3059
3221
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
3060
3222
  it, and listings do with
3061
3223
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
3062
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#shared--referenced-blocks).
3224
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#shared--referenced-blocks).
3063
3225
 
3064
3226
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
3065
3227
 
@@ -3081,7 +3243,7 @@ Not retro-documented, apart from these:
3081
3243
 
3082
3244
  #### The registry is keyed by entry-type name (0.0.42)
3083
3245
 
3084
- **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/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
3246
+ **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/b5a1131194aa99a6532f84792caf439f6d358e67/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
3085
3247
 
3086
3248
  **To adopt.**
3087
3249