canopycms 0.11.1 → 0.12.1

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 (158) hide show
  1. package/CHANGELOG.md +174 -48
  2. package/dist/api/admin.d.ts +4 -4
  3. package/dist/api/branch-changes.d.ts +1 -0
  4. package/dist/api/branch-changes.js +1 -1
  5. package/dist/api/branch-entry-changes.d.ts +92 -7
  6. package/dist/api/branch-entry-changes.js +272 -38
  7. package/dist/api/branch-review.js +45 -13
  8. package/dist/api/branch-status.d.ts +12 -0
  9. package/dist/api/branch-status.js +13 -0
  10. package/dist/api/branch-update-from-base.d.ts +23 -0
  11. package/dist/api/branch-update-from-base.js +176 -0
  12. package/dist/api/branch.d.ts +5 -0
  13. package/dist/api/branch.js +1 -0
  14. package/dist/api/client.d.ts +17 -2
  15. package/dist/api/client.js +26 -0
  16. package/dist/api/comments.d.ts +2 -2
  17. package/dist/api/content.d.ts +38 -1
  18. package/dist/api/content.js +41 -5
  19. package/dist/api/merge-conflicts.d.ts +226 -0
  20. package/dist/api/merge-conflicts.js +674 -0
  21. package/dist/api/routes.js +2 -0
  22. package/dist/api/types.d.ts +7 -3
  23. package/dist/base-update.d.ts +26 -0
  24. package/dist/base-update.js +31 -0
  25. package/dist/branch-metadata-file.d.ts +51 -0
  26. package/dist/branch-metadata-file.js +11 -0
  27. package/dist/branch-schema-cache.d.ts +12 -0
  28. package/dist/branch-schema-cache.js +27 -2
  29. package/dist/cli/backfill-item-keys.d.ts +77 -0
  30. package/dist/cli/backfill-item-keys.js +320 -0
  31. package/dist/cli/cli.d.ts +1 -1
  32. package/dist/cli/cli.js +9713 -1493
  33. package/dist/cli/generate-ai-content.js +415 -244
  34. package/dist/cli/init.js +6 -0
  35. package/dist/cli/site-config.d.ts +14 -2
  36. package/dist/cli/site-config.js +20 -4
  37. package/dist/comment-store.d.ts +8 -0
  38. package/dist/comment-store.js +28 -0
  39. package/dist/content-index-generation.d.ts +1 -4
  40. package/dist/content-index-generation.js +1 -4
  41. package/dist/content-store.d.ts +65 -3
  42. package/dist/content-store.js +121 -15
  43. package/dist/editor/BranchManager.d.ts +4 -1
  44. package/dist/editor/BranchManager.js +9 -5
  45. package/dist/editor/Editor.js +549 -53
  46. package/dist/editor/EntryNavigator.d.ts +10 -2
  47. package/dist/editor/EntryNavigator.js +12 -4
  48. package/dist/editor/FormRenderer.d.ts +8 -2
  49. package/dist/editor/FormRenderer.js +5 -6
  50. package/dist/editor/base-update-wait.d.ts +74 -0
  51. package/dist/editor/base-update-wait.js +91 -0
  52. package/dist/editor/branch-status.js +1 -1
  53. package/dist/editor/components/BaseUpdateNotice.d.ts +12 -0
  54. package/dist/editor/components/BaseUpdateNotice.js +24 -0
  55. package/dist/editor/components/BranchPill.d.ts +4 -1
  56. package/dist/editor/components/BranchPill.js +5 -2
  57. package/dist/editor/components/ConflictsGroup.d.ts +100 -0
  58. package/dist/editor/components/ConflictsGroup.js +364 -0
  59. package/dist/editor/components/EditorHeader.d.ts +16 -1
  60. package/dist/editor/components/EditorHeader.js +92 -30
  61. package/dist/editor/components/EntryChangesDrawer.d.ts +52 -2
  62. package/dist/editor/components/EntryChangesDrawer.js +164 -162
  63. package/dist/editor/components/EntryHeader.d.ts +3 -1
  64. package/dist/editor/components/EntryHeader.js +4 -6
  65. package/dist/editor/components/GetLatestChangesButton.d.ts +15 -0
  66. package/dist/editor/components/GetLatestChangesButton.js +29 -0
  67. package/dist/editor/components/ReleaseHoldButton.d.ts +20 -0
  68. package/dist/editor/components/ReleaseHoldButton.js +36 -0
  69. package/dist/editor/components/RetryToastMessage.js +1 -1
  70. package/dist/editor/components/change-parts.d.ts +51 -0
  71. package/dist/editor/components/change-parts.js +171 -0
  72. package/dist/editor/conflict-cards.d.ts +90 -0
  73. package/dist/editor/conflict-cards.js +279 -0
  74. package/dist/editor/conflict-choices.d.ts +60 -0
  75. package/dist/editor/conflict-choices.js +108 -0
  76. package/dist/editor/conflict-notice.d.ts +25 -0
  77. package/dist/editor/conflict-notice.js +39 -0
  78. package/dist/editor/copy.d.ts +20 -0
  79. package/dist/editor/copy.js +20 -0
  80. package/dist/editor/entry-diff.d.ts +18 -2
  81. package/dist/editor/entry-diff.js +26 -32
  82. package/dist/editor/hooks/useBaseUpdate.d.ts +36 -0
  83. package/dist/editor/hooks/useBaseUpdate.js +269 -0
  84. package/dist/editor/hooks/useBranchManager.d.ts +6 -1
  85. package/dist/editor/hooks/useBranchManager.js +28 -7
  86. package/dist/editor/hooks/useBranchesData.js +3 -0
  87. package/dist/editor/hooks/useConflictChoices.d.ts +24 -0
  88. package/dist/editor/hooks/useConflictChoices.js +75 -0
  89. package/dist/editor/hooks/useConflictsData.d.ts +26 -0
  90. package/dist/editor/hooks/useConflictsData.js +89 -0
  91. package/dist/editor/hooks/useDraftManager.d.ts +5 -0
  92. package/dist/editor/hooks/useDraftManager.js +24 -8
  93. package/dist/editor/hooks/useEntryManager.d.ts +9 -0
  94. package/dist/editor/hooks/useEntryManager.js +5 -0
  95. package/dist/editor/release-hold.d.ts +12 -0
  96. package/dist/editor/release-hold.js +39 -0
  97. package/dist/editor/server-clock.d.ts +4 -0
  98. package/dist/editor/server-clock.js +15 -0
  99. package/dist/editor/undo-change.d.ts +52 -0
  100. package/dist/editor/undo-change.js +241 -0
  101. package/dist/git-manager.d.ts +5 -0
  102. package/dist/git-manager.js +30 -0
  103. package/dist/item-keys.d.ts +13 -0
  104. package/dist/item-keys.js +36 -14
  105. package/dist/merge/conflict-path.d.ts +40 -0
  106. package/dist/merge/conflict-path.js +128 -0
  107. package/dist/merge/diff3.d.ts +27 -0
  108. package/dist/merge/diff3.js +113 -0
  109. package/dist/merge/entry-merge.d.ts +94 -0
  110. package/dist/merge/entry-merge.js +875 -0
  111. package/dist/merge/list-alignment.d.ts +52 -0
  112. package/dist/merge/list-alignment.js +441 -0
  113. package/dist/merge/text-merge.d.ts +29 -0
  114. package/dist/merge/text-merge.js +59 -0
  115. package/dist/merge/value-equality.d.ts +18 -0
  116. package/dist/merge/value-equality.js +50 -0
  117. package/dist/merge-conflicts.d.ts +232 -0
  118. package/dist/merge-conflicts.js +451 -0
  119. package/dist/operating-mode/client-safe-strategy.d.ts +2 -0
  120. package/dist/operating-mode/client-safe-strategy.js +6 -0
  121. package/dist/operating-mode/types.d.ts +5 -0
  122. package/dist/services.d.ts +16 -1
  123. package/dist/services.js +82 -22
  124. package/dist/task-queue/cms-task-queue.d.ts +3 -1
  125. package/dist/types.d.ts +28 -2
  126. package/dist/utils/content-serialize.d.ts +18 -1
  127. package/dist/utils/content-serialize.js +12 -0
  128. package/dist/utils/content-write-lock.d.ts +3 -3
  129. package/dist/utils/content-write-lock.js +3 -3
  130. package/dist/utils/markdown-body-splice.d.ts +1 -1
  131. package/dist/utils/markdown-body-splice.js +1 -19
  132. package/dist/utils/markdown-parse.d.ts +9 -0
  133. package/dist/utils/markdown-parse.js +27 -0
  134. package/dist/version.d.ts +1 -1
  135. package/dist/version.js +1 -1
  136. package/dist/worker/branch-merge.d.ts +53 -37
  137. package/dist/worker/branch-merge.js +139 -54
  138. package/dist/worker/cms-worker.d.ts +16 -3
  139. package/dist/worker/cms-worker.js +59 -12
  140. package/dist/worker/field-merge.d.ts +65 -0
  141. package/dist/worker/field-merge.js +636 -0
  142. package/dist/worker/git-sync.d.ts +1 -1
  143. package/dist/worker/git-sync.js +7 -6
  144. package/dist/worker/github-commits.d.ts +42 -10
  145. package/dist/worker/github-commits.js +287 -47
  146. package/dist/worker/github-gateway-http.js +17 -9
  147. package/dist/worker/github-gateway-wire.d.ts +21 -12
  148. package/dist/worker/github-gateway-wire.js +5 -1
  149. package/dist/worker/github-gateway.d.ts +10 -1
  150. package/dist/worker/github-gateway.js +18 -6
  151. package/dist/worker/github-transfer.d.ts +5 -3
  152. package/dist/worker/github-transfer.js +8 -5
  153. package/dist/worker/rebase.d.ts +5 -4
  154. package/dist/worker/rebase.js +293 -156
  155. package/dist/worker/task-runner.d.ts +1 -1
  156. package/dist/worker/task-runner.js +14 -2
  157. package/dist/worker/worker-context.d.ts +18 -2
  158. 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.11.1`, built from [`3e35fb5`](https://github.com/safeinsights/canopycms/tree/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e).
8
+ Version `0.12.1`, built from [`aaf8e5f`](https://github.com/safeinsights/canopycms/tree/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb).
9
9
 
10
- Its entries are [0.11.1](#0111), under **Released**.
10
+ Its entries are [0.12.1](#0121), 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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/.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,132 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.12.1
66
+
67
+ <!-- changeset: field-merge-engine -->
68
+ <!-- changeset: fm-catch-up-main -->
69
+ <!-- changeset: fm-deleted-entry-conflict-card -->
70
+ <!-- changeset: fm-latest-changes-after-publish -->
71
+ <!-- changeset: fm-r1-stale-key-guard -->
72
+ <!-- changeset: fm-stale-first-save-keys -->
73
+ <!-- changeset: fm-trade-off-regression -->
74
+ <!-- changeset: fm-twin-stale-keys -->
75
+
76
+ #### `canopycms backfill-item-keys` writes every list item's key
77
+
78
+ <!-- changeset: backfill-item-keys -->
79
+
80
+ _First in 0.12.1._
81
+
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).
83
+
84
+ **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
+
86
+ #### A damaged conflict record holds its branch until an admin releases it
87
+
88
+ <!-- changeset: field-merge-conflict-record-hold -->
89
+
90
+ _First in 0.12.1._
91
+
92
+ **What changed.** When a branch's record of conflicting changes can't be read, the worker sets it
93
+ aside and the branch waits: Submit for review and Approve refuse, rather than going ahead as if
94
+ nothing needed a choice. Everyone sees "Needs action" in the branch bar, with Submit for review held
95
+ and the reason; an admin also gets "Release hold", whose confirm says which choices are lost. A
96
+ later merge from the base leaves the hold in place, as it can't find the lost choices again. A
97
+ record written in another format is left as it is: Submit and Approve refuse until a developer deals
98
+ with it.
99
+
100
+ #### A conflict in a list without item keys shows the latest version
101
+
102
+ <!-- changeset: field-merge-conflict-value-paths -->
103
+
104
+ _First in 0.12.1._
105
+
106
+ **What changed.** When the base edited an item in a list whose items carry no keys, the conflict
107
+ card couldn't find the latest version's value: it read as empty, and only editing by hand was
108
+ offered. The merge now records where each version holds the value, so the card shows all three
109
+ versions and "Use latest version" works there too.
110
+
111
+ #### Submit and approve wait until conflicting changes are resolved
112
+
113
+ <!-- changeset: field-merge-conflicts-api -->
114
+
115
+ _First in 0.12.1._
116
+
117
+ **What changed.** A field that a merge from the base found changed differently on both sides stays
118
+ open until someone chooses a value. Saving the entry with that choice resolves it, and an entry
119
+ that one side deleted or that can't be merged field by field is resolved by keeping, deleting,
120
+ restoring or taking the latest version. While any conflict is open, Submit for review and Approve
121
+ answer 409 and say why. The catch-all route serves the conflicts to the editor, so adopters add
122
+ nothing.
123
+
124
+ #### "Get latest changes" brings the base branch into an editing branch on request
125
+
126
+ <!-- changeset: get-latest-changes -->
127
+
128
+ _First in 0.12.1._
129
+
130
+ **What changed.** An editing branch's bar and card offer "Get latest changes" (prod). It commits
131
+ the branch's saved work locally, then asks the worker to bring the base branch in at once instead
132
+ of at its next sync. The form is read-only while the worker works, for up to two minutes, and a
133
+ toast reports the result. Withdrawing the open branch from review when it conflicts with its base gets
134
+ the latest changes too. A worker that archives a merged pull request also syncs the other branches
135
+ soon after. Dev mode runs no worker, so it doesn't offer the button.
136
+
137
+ **Deploy order.** Deploy the worker before the CMS image. An older worker fails the new
138
+ `sync-branch` task, and the request is then answered only by its next regular sync.
139
+
140
+ #### Choose what to keep when you and someone else changed the same field
141
+
142
+ <!-- changeset: field-merge-conflict-ui -->
143
+
144
+ _First in 0.12.1._
145
+
146
+ **What changed.** When the latest changes come into a branch and a value was changed both there
147
+ and on the branch, "Show changes" opens with a "Conflicts" group above the entry's changes. Each card
148
+ shows how the value read before, in the latest version and in yours, and offers "Use latest version",
149
+ "Keep your version" or "Edit". A value one side removed offers "Remove it" or "Keep it", and long text
150
+ gets one card per changed passage, with "Use both". A choice is saved with the entry. The entry
151
+ says how many fields need a choice, "Submit for review" waits until none do, and the "Get latest
152
+ changes" message counts them. Authors never see a branch name in this copy.
153
+
154
+ #### A branch in review takes in its base when no field clashes
155
+
156
+ <!-- changeset: field-merge-review-branches -->
157
+
158
+ _First in 0.12.1._
159
+
160
+ **What changed.** When GitHub reports that a submitted or approved branch's pull request conflicts
161
+ with its base, the worker now merges the base in field by field instead of holding the branch. A
162
+ submitted branch stays submitted. An approved branch returns to review, since the merge settled
163
+ what git could not and no reviewer has seen that. A field changed differently on both sides, or
164
+ anything else a person must decide, still holds the branch with "Needs action", and its author
165
+ withdraws it to choose, as before.
166
+
167
+ #### Base changes are no longer reverted when a branch takes in its base
168
+
169
+ <!-- changeset: field-merge-worker -->
170
+
171
+ _First in 0.12.1._
172
+
173
+ **What changed.** When the base branch moves and an editing branch has changed the same entry,
174
+ the worker merges the two field by field instead of keeping the branch's whole file. Edits to
175
+ different fields, list items or body paragraphs all come in, schema changes made on the base stay,
176
+ and a field changed differently on both sides keeps the author's value and is flagged on the entry,
177
+ as before. An entry renamed on one side and edited on the other merges at the new name. A branch with no
178
+ merge commit still rebases where git takes the base in cleanly and the field merge agrees; any
179
+ other takes the base in with a merge commit.
180
+
181
+ ### 0.12.0
182
+
183
+ #### Undo a branch's saved changes from "Show changes"
184
+
185
+ <!-- changeset: undo-branch-changes -->
186
+
187
+ _First in 0.12.0._
188
+
189
+ **What changed.** The "Show changes" drawer can now set saved changes back to the base branch. Each changed field, list item or block has "Undo change", and the entry has "Undo all changes". An undo is an unsaved edit in the form: "Redo change" or "Discard changes" reverses it, and Save keeps it. A change the form has edited since can't be undone or redone until that edit is saved or discarded, so no edit is lost. List and block items are matched by item key, so a removed item comes back in its old place with its comment threads, and an item the branch added goes, its threads moving to the entry as a Remove does. An entry added on the branch offers "Delete entry", and one deleted on it "Restore entry", which puts the base's file back with its content id, so references and comment threads find it again. It puts the entry back in its collection's manual order, and refuses while another entry holds the URL, past the type's `maxItems`, or when the type's format has changed since. The controls follow the form's rules: disabled with the lock's reason on a branch in review, approved or otherwise read-only, and hidden without edit access. An entry type change can't be undone here, and undo leaves a moved entry where it is.
190
+
65
191
  ### 0.11.1
66
192
 
67
193
  #### A comment thread you can't resolve shows Resolve disabled, with the reason
@@ -108,7 +234,7 @@ _First in 0.9.0._
108
234
 
109
235
  **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.
110
236
 
111
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/.changeset/README.md#field-types).
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).
112
238
 
113
239
  **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.
114
240
 
@@ -384,7 +510,7 @@ _First in 0.7.0._
384
510
 
385
511
  **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.
386
512
 
387
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
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).
388
514
 
389
515
  #### Pull request bodies link back to the editor
390
516
 
@@ -394,7 +520,7 @@ _First in 0.7.0._
394
520
 
395
521
  **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.
396
522
 
397
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#definecanopyconfig-options).
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).
398
524
 
399
525
  #### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
400
526
 
@@ -480,7 +606,7 @@ _First in 0.6.0._
480
606
 
481
607
  **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.
482
608
 
483
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md).
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).
484
610
 
485
611
  ### 0.5.0
486
612
 
@@ -492,7 +618,7 @@ _First in 0.5.0._
492
618
 
493
619
  **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.
494
620
 
495
- **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#field-types).
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).
496
622
 
497
623
  #### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
498
624
 
@@ -502,7 +628,7 @@ _First in 0.5.0._
502
628
 
503
629
  **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.
504
630
 
505
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#how-references-work-in-the-editor).
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).
506
632
 
507
633
  **Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
508
634
 
@@ -530,7 +656,7 @@ resolved without it.
530
656
  **To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
531
657
  reference field. Code that reads the body from a link-only reference's resolved type now sees
532
658
  `string | undefined`; either set `includeBody: true` or handle the missing value. See
533
- [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#resolving-references-in-a-listing).
659
+ [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#resolving-references-in-a-listing).
534
660
 
535
661
  ### 0.3.3
536
662
 
@@ -947,7 +1073,7 @@ URL.
947
1073
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
948
1074
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
949
1075
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
950
- [Live Preview](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#live-preview)).
1076
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview)).
951
1077
  3. A test reading view content from the route's server HTML must load the page in a browser.
952
1078
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
953
1079
  of cross-request caches (`unstable_cache`, module memos).
@@ -962,7 +1088,7 @@ kept site styles ahead of Mantine's in the preview.
962
1088
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
963
1089
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
964
1090
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
965
- [Live Preview](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#live-preview).
1091
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview).
966
1092
 
967
1093
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
968
1094
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -1044,7 +1170,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
1044
1170
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
1045
1171
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
1046
1172
  place. A field that links to a hidden section by plain URL needs a field transform; the README
1047
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#ai-content-configuration).
1173
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
1048
1174
 
1049
1175
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
1050
1176
 
@@ -1066,7 +1192,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
1066
1192
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
1067
1193
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
1068
1194
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
1069
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#mdx-content-cannot-run-code).
1195
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#mdx-content-cannot-run-code).
1070
1196
 
1071
1197
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
1072
1198
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -1203,7 +1329,7 @@ a format check.
1203
1329
 
1204
1330
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
1205
1331
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
1206
- ([reference](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#definecanopyconfig-options)).
1332
+ ([reference](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#definecanopyconfig-options)).
1207
1333
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
1208
1334
  the PR-body section every user who edited the branch, not only the submitter; settings commits
1209
1335
  (permissions, groups) carry the acting user's trailer.
@@ -1227,7 +1353,7 @@ saves only push the branch, and no failing PR task lands in System health.
1227
1353
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
1228
1354
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
1229
1355
  worker holds the base branch for up to 30 minutes while that lasts; see
1230
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
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).
1231
1357
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
1232
1358
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
1233
1359
 
@@ -1265,7 +1391,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
1265
1391
  new stack needs no steps.
1266
1392
 
1267
1393
  **What changed.** (int.109) Detailed in
1268
- [The worker instance](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
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
1269
1395
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
1270
1396
  refusing clients without TLS or IAM, replacing the worker's
1271
1397
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -1319,10 +1445,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
1319
1445
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
1320
1446
  unchanged.
1321
1447
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
1322
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#worker-down-alarm).
1448
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#worker-down-alarm).
1323
1449
 
1324
1450
  **To adopt.** Optional. For parameter-only change sets, see
1325
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
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
1326
1452
  `alarmTopic`.
1327
1453
 
1328
1454
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -1333,7 +1459,7 @@ worker, and a hand-built alarm on the worker log group.
1333
1459
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
1334
1460
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
1335
1461
  `alarmTopic` if set; a retried step names itself when it gives up. See
1336
- [The worker instance](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#the-worker-instance).
1462
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance).
1337
1463
 
1338
1464
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
1339
1465
  not Template first and the worker contract stays at 1.
@@ -1399,7 +1525,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
1399
1525
 
1400
1526
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
1401
1527
  mirror, so the root volume needs room for two
1402
- ([details](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#the-worker-instance)).
1528
+ ([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance)).
1403
1529
 
1404
1530
  #### The worker follows a rebased or deleted GitHub branch
1405
1531
 
@@ -1421,7 +1547,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
1421
1547
  bundle-only roll is safe.
1422
1548
 
1423
1549
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
1424
- ([recipe](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
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
1425
1551
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
1426
1552
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
1427
1553
 
@@ -1438,8 +1564,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
1438
1564
  template, then roll the bundle; on an older template it stops with `template too old for this
1439
1565
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
1440
1566
  takes `worker/`'s three units and `gateway.env.example`
1441
- ([steps](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1442
- [checklist](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#first-deploy-checklist).
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).
1443
1569
 
1444
1570
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
1445
1571
 
@@ -1450,7 +1576,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
1450
1576
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
1451
1577
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
1452
1578
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
1453
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
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).
1454
1580
 
1455
1581
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
1456
1582
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -1626,7 +1752,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
1626
1752
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
1627
1753
  apply the same rule here, for example `referenceLink: (target, { body }) =>
1628
1754
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
1629
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#ai-content-configuration).
1755
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
1630
1756
 
1631
1757
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
1632
1758
  change its link.
@@ -1701,7 +1827,7 @@ _First in int.115._
1701
1827
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1702
1828
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1703
1829
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1704
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#drafts-and-unpublishing) section covers long-lived branches and
1830
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#drafts-and-unpublishing) section covers long-lived branches and
1705
1831
  unpublishing.
1706
1832
 
1707
1833
  #### The editor calls the content drawer "All content"
@@ -2013,7 +2139,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
2013
2139
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
2014
2140
 
2015
2141
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
2016
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#stamping-a-publication-date).
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).
2017
2143
 
2018
2144
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
2019
2145
 
@@ -2060,7 +2186,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
2060
2186
  stored at, and `react-split-pane` is no longer a dependency.
2061
2187
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
2062
2188
  no longer exported from `canopycms/client`. See
2063
- [Your root layout](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#editor-customization).
2189
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#editor-customization).
2064
2190
 
2065
2191
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
2066
2192
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -2171,7 +2297,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
2171
2297
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
2172
2298
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
2173
2299
  own pages, mount the hook as in
2174
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
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).
2175
2301
  Your own Server Actions in the CMS build still 403 behind OAC.
2176
2302
 
2177
2303
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -2212,12 +2338,12 @@ fast naming the ARN, the field and the keys present, never a value.
2212
2338
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
2213
2339
  prop. The scaffolded stack fills them from the repository _variables_
2214
2340
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
2215
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2341
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2216
2342
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
2217
2343
  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
2218
2344
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
2219
2345
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
2220
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#security-model)).
2346
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
2221
2347
 
2222
2348
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
2223
2349
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -2229,7 +2355,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
2229
2355
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
2230
2356
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
2231
2357
  anyone holding an App's key can mint a token for any of its installations
2232
- ([why](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2358
+ ([why](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2233
2359
 
2234
2360
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
2235
2361
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -2242,7 +2368,7 @@ anyone holding an App's key can mint a token for any of its installations
2242
2368
  `verify` checks an existing installation's permissions: run it, since an App missing a
2243
2369
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
2244
2370
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
2245
- ([details](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2371
+ ([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2246
2372
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
2247
2373
  of the three is refused at synth, and so is an App alongside a token.
2248
2374
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -2253,7 +2379,7 @@ anyone holding an App's key can mint a token for any of its installations
2253
2379
 
2254
2380
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
2255
2381
  IAM policy automatically, so you need not add it to `secretsArns`. See
2256
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2382
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2257
2383
 
2258
2384
  ```bash
2259
2385
  canopycms init-github-app create -- \
@@ -2301,7 +2427,7 @@ downloads the `.pem` from the App's settings page.
2301
2427
 
2302
2428
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
2303
2429
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
2304
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#rotating-a-secret).
2430
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rotating-a-secret).
2305
2431
 
2306
2432
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
2307
2433
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -2355,12 +2481,12 @@ also check the bucket policy for its grant.
2355
2481
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
2356
2482
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
2357
2483
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
2358
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#dual-build-support)).
2484
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#dual-build-support)).
2359
2485
 
2360
2486
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
2361
2487
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
2362
2488
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
2363
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#where-the-image-is-built)).
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)).
2364
2490
 
2365
2491
  **To adopt.**
2366
2492
 
@@ -2389,7 +2515,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
2389
2515
 
2390
2516
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
2391
2517
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
2392
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#media-configuration) for the
2518
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration) for the
2393
2519
  CloudFront behavior it expects.
2394
2520
 
2395
2521
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -2414,7 +2540,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
2414
2540
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
2415
2541
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
2416
2542
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
2417
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#cross-account-asset-bucket).
2543
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#cross-account-asset-bucket).
2418
2544
 
2419
2545
  **To adopt.** Optional:
2420
2546
 
@@ -2524,7 +2650,7 @@ public JWKS PEM, used only to verify signatures.
2524
2650
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
2525
2651
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
2526
2652
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
2527
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/docs/deploying-to-aws.md#security-model)).
2653
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
2528
2654
 
2529
2655
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
2530
2656
 
@@ -2623,7 +2749,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
2623
2749
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
2624
2750
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
2625
2751
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
2626
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#media-configuration)). Two traps:
2752
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration)). Two traps:
2627
2753
 
2628
2754
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
2629
2755
  a nested route prefix and emits zero params, building green.
@@ -2782,7 +2908,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2782
2908
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2783
2909
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2784
2910
  `createNextCanopyContext`'s result. See
2785
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2911
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2786
2912
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2787
2913
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2788
2914
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2839,7 +2965,7 @@ underscore-prefixed files are skipped.
2839
2965
 
2840
2966
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2841
2967
  `defaultPathAccess: { read: 'allow' }`
2842
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#public-read-on-server-deployments)).
2968
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#public-read-on-server-deployments)).
2843
2969
 
2844
2970
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2845
2971
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -2892,7 +3018,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
2892
3018
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
2893
3019
  gives one template's value type) requires exactly
2894
3020
  one component per block template name when written as an object literal. See
2895
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#block-component-registries) and
3021
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#block-component-registries) and
2896
3022
  `apps/example1/app/components/PostView.tsx`.
2897
3023
 
2898
3024
  ```ts
@@ -2914,7 +3040,7 @@ templates against the schema.
2914
3040
 
2915
3041
  **What changed.** Spreading a `const` field array into several schemas, and nesting
2916
3042
  `defineInlineFieldGroup()` inside a block template, are documented
2917
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
3043
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2918
3044
  identity helper for them.
2919
3045
 
2920
3046
  ```ts
@@ -2933,7 +3059,7 @@ field by composing from the same `const` field object.
2933
3059
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
2934
3060
  it, and listings do with
2935
3061
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
2936
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#shared--referenced-blocks).
3062
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#shared--referenced-blocks).
2937
3063
 
2938
3064
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
2939
3065
 
@@ -2955,7 +3081,7 @@ Not retro-documented, apart from these:
2955
3081
 
2956
3082
  #### The registry is keyed by entry-type name (0.0.42)
2957
3083
 
2958
- **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/3e35fb5d09036c5975fc88fbf08e9c2b960bce4e/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
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.
2959
3085
 
2960
3086
  **To adopt.**
2961
3087
 
@@ -91,10 +91,10 @@ declare const listAdminTasksParamsSchema: z.ZodObject<{
91
91
  status: z.ZodEnum<["pending", "processing", "completed", "failed", "corrupt"]>;
92
92
  limit: z.ZodOptional<z.ZodNumber>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- status: "failed" | "pending" | "corrupt" | "processing" | "completed";
94
+ status: "failed" | "pending" | "processing" | "completed" | "corrupt";
95
95
  limit?: number | undefined;
96
96
  }, {
97
- status: "failed" | "pending" | "corrupt" | "processing" | "completed";
97
+ status: "failed" | "pending" | "processing" | "completed" | "corrupt";
98
98
  limit?: number | undefined;
99
99
  }>;
100
100
  export type ListAdminTasksParams = z.infer<typeof listAdminTasksParamsSchema>;
@@ -168,10 +168,10 @@ export declare const ADMIN_ROUTES: {
168
168
  status: z.ZodEnum<["pending", "processing", "completed", "failed", "corrupt"]>;
169
169
  limit: z.ZodOptional<z.ZodNumber>;
170
170
  }, "strip", z.ZodTypeAny, {
171
- status: "failed" | "pending" | "corrupt" | "processing" | "completed";
171
+ status: "failed" | "pending" | "processing" | "completed" | "corrupt";
172
172
  limit?: number | undefined;
173
173
  }, {
174
- status: "failed" | "pending" | "corrupt" | "processing" | "completed";
174
+ status: "failed" | "pending" | "processing" | "completed" | "corrupt";
175
175
  limit?: number | undefined;
176
176
  }>, undefined, AdminTasksResponse>;
177
177
  readonly retryTask: import("./route-builder.js").RouteDefinition<z.ZodObject<{
@@ -33,6 +33,7 @@ export interface BranchChangesData {
33
33
  otherFilesTruncated?: boolean;
34
34
  }
35
35
  export type BranchChangesResponse = ApiResponse<BranchChangesData>;
36
+ export declare const SYNCING_ERROR: (base: string) => string;
36
37
  type BranchGit = ReturnType<ApiContext['services']['createGitManagerFor']>;
37
38
  /** Why a read of a branch against its base can't be trusted: see {@link readWhileSteady}. */
38
39
  export type UnsteadyRead = 'syncing' | 'moved';
@@ -14,7 +14,7 @@ import { canopyLogWarn } from '../utils/logger.js';
14
14
  const MAX_DELETED_TITLES = 200;
15
15
  /** Other files listed to an admin; the rest are counted only as `otherFilesTruncated`. */
16
16
  const MAX_OTHER_FILES = 200;
17
- const SYNCING_ERROR = (base) => `This branch is being synced with ${base}. Try again in a moment.`;
17
+ export const SYNCING_ERROR = (base) => `This branch is being synced with ${base}. Try again in a moment.`;
18
18
  const CHANGED_MID_READ_ERROR = 'This branch changed while its changes were being read. Try again in a moment.';
19
19
  const READ_FAILED_ERROR = "Couldn't read this branch's changes right now. Try again in a moment.";
20
20
  /**