canopycms 0.12.0 → 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.
- package/CHANGELOG.md +164 -48
- package/dist/api/admin.d.ts +4 -4
- package/dist/api/branch-review.js +45 -13
- package/dist/api/branch-status.d.ts +12 -0
- package/dist/api/branch-status.js +13 -0
- package/dist/api/branch-update-from-base.d.ts +23 -0
- package/dist/api/branch-update-from-base.js +176 -0
- package/dist/api/branch.d.ts +5 -0
- package/dist/api/branch.js +1 -0
- package/dist/api/client.d.ts +14 -1
- package/dist/api/client.js +22 -0
- package/dist/api/comments.d.ts +2 -2
- package/dist/api/content.d.ts +38 -1
- package/dist/api/content.js +41 -5
- package/dist/api/merge-conflicts.d.ts +226 -0
- package/dist/api/merge-conflicts.js +674 -0
- package/dist/api/routes.js +2 -0
- package/dist/api/types.d.ts +7 -3
- package/dist/base-update.d.ts +26 -0
- package/dist/base-update.js +31 -0
- package/dist/branch-metadata-file.d.ts +51 -0
- package/dist/branch-metadata-file.js +11 -0
- package/dist/branch-schema-cache.d.ts +12 -0
- package/dist/branch-schema-cache.js +27 -2
- package/dist/cli/backfill-item-keys.d.ts +77 -0
- package/dist/cli/backfill-item-keys.js +320 -0
- package/dist/cli/cli.d.ts +1 -1
- package/dist/cli/cli.js +9658 -1499
- package/dist/cli/generate-ai-content.js +354 -244
- package/dist/cli/init.js +6 -0
- package/dist/cli/site-config.d.ts +14 -2
- package/dist/cli/site-config.js +20 -4
- package/dist/comment-store.d.ts +8 -0
- package/dist/comment-store.js +28 -0
- package/dist/content-index-generation.d.ts +1 -4
- package/dist/content-index-generation.js +1 -4
- package/dist/content-store.d.ts +39 -3
- package/dist/content-store.js +48 -15
- package/dist/editor/BranchManager.d.ts +4 -1
- package/dist/editor/BranchManager.js +9 -5
- package/dist/editor/Editor.js +429 -52
- package/dist/editor/EntryNavigator.d.ts +10 -2
- package/dist/editor/EntryNavigator.js +12 -4
- package/dist/editor/FormRenderer.d.ts +8 -2
- package/dist/editor/FormRenderer.js +5 -6
- package/dist/editor/base-update-wait.d.ts +74 -0
- package/dist/editor/base-update-wait.js +91 -0
- package/dist/editor/branch-status.js +1 -1
- package/dist/editor/components/BaseUpdateNotice.d.ts +12 -0
- package/dist/editor/components/BaseUpdateNotice.js +24 -0
- package/dist/editor/components/BranchPill.d.ts +4 -1
- package/dist/editor/components/BranchPill.js +5 -2
- package/dist/editor/components/ConflictsGroup.d.ts +100 -0
- package/dist/editor/components/ConflictsGroup.js +364 -0
- package/dist/editor/components/EditorHeader.d.ts +16 -1
- package/dist/editor/components/EditorHeader.js +92 -30
- package/dist/editor/components/EntryChangesDrawer.d.ts +16 -2
- package/dist/editor/components/EntryChangesDrawer.js +33 -167
- package/dist/editor/components/EntryHeader.d.ts +3 -1
- package/dist/editor/components/EntryHeader.js +2 -2
- package/dist/editor/components/GetLatestChangesButton.d.ts +15 -0
- package/dist/editor/components/GetLatestChangesButton.js +29 -0
- package/dist/editor/components/ReleaseHoldButton.d.ts +20 -0
- package/dist/editor/components/ReleaseHoldButton.js +36 -0
- package/dist/editor/components/RetryToastMessage.js +1 -1
- package/dist/editor/components/change-parts.d.ts +51 -0
- package/dist/editor/components/change-parts.js +171 -0
- package/dist/editor/conflict-cards.d.ts +90 -0
- package/dist/editor/conflict-cards.js +279 -0
- package/dist/editor/conflict-choices.d.ts +60 -0
- package/dist/editor/conflict-choices.js +108 -0
- package/dist/editor/conflict-notice.d.ts +25 -0
- package/dist/editor/conflict-notice.js +39 -0
- package/dist/editor/copy.d.ts +12 -0
- package/dist/editor/copy.js +12 -0
- package/dist/editor/entry-diff.d.ts +2 -1
- package/dist/editor/entry-diff.js +5 -21
- package/dist/editor/hooks/useBaseUpdate.d.ts +36 -0
- package/dist/editor/hooks/useBaseUpdate.js +269 -0
- package/dist/editor/hooks/useBranchManager.d.ts +6 -1
- package/dist/editor/hooks/useBranchManager.js +28 -7
- package/dist/editor/hooks/useBranchesData.js +3 -0
- package/dist/editor/hooks/useConflictChoices.d.ts +24 -0
- package/dist/editor/hooks/useConflictChoices.js +75 -0
- package/dist/editor/hooks/useConflictsData.d.ts +26 -0
- package/dist/editor/hooks/useConflictsData.js +89 -0
- package/dist/editor/hooks/useDraftManager.d.ts +5 -0
- package/dist/editor/hooks/useDraftManager.js +24 -8
- package/dist/editor/hooks/useEntryManager.d.ts +9 -0
- package/dist/editor/hooks/useEntryManager.js +5 -0
- package/dist/editor/release-hold.d.ts +12 -0
- package/dist/editor/release-hold.js +39 -0
- package/dist/editor/server-clock.d.ts +4 -0
- package/dist/editor/server-clock.js +15 -0
- package/dist/editor/undo-change.d.ts +7 -0
- package/dist/editor/undo-change.js +19 -4
- package/dist/git-manager.d.ts +5 -0
- package/dist/git-manager.js +30 -0
- package/dist/item-keys.d.ts +13 -0
- package/dist/item-keys.js +36 -14
- package/dist/merge/conflict-path.d.ts +40 -0
- package/dist/merge/conflict-path.js +128 -0
- package/dist/merge/diff3.d.ts +27 -0
- package/dist/merge/diff3.js +113 -0
- package/dist/merge/entry-merge.d.ts +94 -0
- package/dist/merge/entry-merge.js +875 -0
- package/dist/merge/list-alignment.d.ts +52 -0
- package/dist/merge/list-alignment.js +441 -0
- package/dist/merge/text-merge.d.ts +29 -0
- package/dist/merge/text-merge.js +59 -0
- package/dist/merge/value-equality.d.ts +18 -0
- package/dist/merge/value-equality.js +50 -0
- package/dist/merge-conflicts.d.ts +232 -0
- package/dist/merge-conflicts.js +451 -0
- package/dist/operating-mode/client-safe-strategy.d.ts +2 -0
- package/dist/operating-mode/client-safe-strategy.js +6 -0
- package/dist/operating-mode/types.d.ts +5 -0
- package/dist/services.d.ts +16 -1
- package/dist/services.js +82 -22
- package/dist/task-queue/cms-task-queue.d.ts +3 -1
- package/dist/types.d.ts +28 -2
- package/dist/utils/content-serialize.d.ts +18 -1
- package/dist/utils/content-serialize.js +12 -0
- package/dist/utils/content-write-lock.d.ts +3 -3
- package/dist/utils/content-write-lock.js +3 -3
- package/dist/utils/markdown-body-splice.d.ts +1 -1
- package/dist/utils/markdown-body-splice.js +1 -19
- package/dist/utils/markdown-parse.d.ts +9 -0
- package/dist/utils/markdown-parse.js +27 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/branch-merge.d.ts +53 -37
- package/dist/worker/branch-merge.js +139 -54
- package/dist/worker/cms-worker.d.ts +16 -3
- package/dist/worker/cms-worker.js +59 -12
- package/dist/worker/field-merge.d.ts +65 -0
- package/dist/worker/field-merge.js +636 -0
- package/dist/worker/git-sync.d.ts +1 -1
- package/dist/worker/git-sync.js +7 -6
- package/dist/worker/github-commits.d.ts +42 -10
- package/dist/worker/github-commits.js +287 -47
- package/dist/worker/github-gateway-http.js +17 -9
- package/dist/worker/github-gateway-wire.d.ts +21 -12
- package/dist/worker/github-gateway-wire.js +5 -1
- package/dist/worker/github-gateway.d.ts +10 -1
- package/dist/worker/github-gateway.js +18 -6
- package/dist/worker/github-transfer.d.ts +5 -3
- package/dist/worker/github-transfer.js +8 -5
- package/dist/worker/rebase.d.ts +5 -4
- package/dist/worker/rebase.js +293 -156
- package/dist/worker/task-runner.d.ts +1 -1
- package/dist/worker/task-runner.js +14 -2
- package/dist/worker/worker-context.d.ts +18 -2
- 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.
|
|
8
|
+
Version `0.12.1`, built from [`aaf8e5f`](https://github.com/safeinsights/canopycms/tree/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.12.
|
|
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/
|
|
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,122 @@ 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
|
+
|
|
65
181
|
### 0.12.0
|
|
66
182
|
|
|
67
183
|
#### Undo a branch's saved changes from "Show changes"
|
|
@@ -118,7 +234,7 @@ _First in 0.9.0._
|
|
|
118
234
|
|
|
119
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.
|
|
120
236
|
|
|
121
|
-
**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/
|
|
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).
|
|
122
238
|
|
|
123
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.
|
|
124
240
|
|
|
@@ -394,7 +510,7 @@ _First in 0.7.0._
|
|
|
394
510
|
|
|
395
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.
|
|
396
512
|
|
|
397
|
-
**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/
|
|
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).
|
|
398
514
|
|
|
399
515
|
#### Pull request bodies link back to the editor
|
|
400
516
|
|
|
@@ -404,7 +520,7 @@ _First in 0.7.0._
|
|
|
404
520
|
|
|
405
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.
|
|
406
522
|
|
|
407
|
-
**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/
|
|
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).
|
|
408
524
|
|
|
409
525
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
410
526
|
|
|
@@ -490,7 +606,7 @@ _First in 0.6.0._
|
|
|
490
606
|
|
|
491
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.
|
|
492
608
|
|
|
493
|
-
**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/
|
|
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).
|
|
494
610
|
|
|
495
611
|
### 0.5.0
|
|
496
612
|
|
|
@@ -502,7 +618,7 @@ _First in 0.5.0._
|
|
|
502
618
|
|
|
503
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.
|
|
504
620
|
|
|
505
|
-
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
506
622
|
|
|
507
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**
|
|
508
624
|
|
|
@@ -512,7 +628,7 @@ _First in 0.5.0._
|
|
|
512
628
|
|
|
513
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.
|
|
514
630
|
|
|
515
|
-
**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/
|
|
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).
|
|
516
632
|
|
|
517
633
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
518
634
|
|
|
@@ -540,7 +656,7 @@ resolved without it.
|
|
|
540
656
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
541
657
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
542
658
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
543
|
-
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/
|
|
659
|
+
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#resolving-references-in-a-listing).
|
|
544
660
|
|
|
545
661
|
### 0.3.3
|
|
546
662
|
|
|
@@ -957,7 +1073,7 @@ URL.
|
|
|
957
1073
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
958
1074
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
959
1075
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
960
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
1076
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview)).
|
|
961
1077
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
962
1078
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
963
1079
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -972,7 +1088,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
972
1088
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
973
1089
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
974
1090
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
975
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
1091
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#live-preview).
|
|
976
1092
|
|
|
977
1093
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
978
1094
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -1054,7 +1170,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
1054
1170
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
1055
1171
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
1056
1172
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
1057
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1173
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
|
|
1058
1174
|
|
|
1059
1175
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
1060
1176
|
|
|
@@ -1076,7 +1192,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
1076
1192
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
1077
1193
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
1078
1194
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
1079
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
1195
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#mdx-content-cannot-run-code).
|
|
1080
1196
|
|
|
1081
1197
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
1082
1198
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -1213,7 +1329,7 @@ a format check.
|
|
|
1213
1329
|
|
|
1214
1330
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
1215
1331
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
1216
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1332
|
+
([reference](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#definecanopyconfig-options)).
|
|
1217
1333
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
1218
1334
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
1219
1335
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -1237,7 +1353,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
1237
1353
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
1238
1354
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
1239
1355
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
1240
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
1241
1357
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
1242
1358
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
1243
1359
|
|
|
@@ -1275,7 +1391,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
1275
1391
|
new stack needs no steps.
|
|
1276
1392
|
|
|
1277
1393
|
**What changed.** (int.109) Detailed in
|
|
1278
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
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
|
|
1279
1395
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
1280
1396
|
refusing clients without TLS or IAM, replacing the worker's
|
|
1281
1397
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1329,10 +1445,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1329
1445
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1330
1446
|
unchanged.
|
|
1331
1447
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1332
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
1448
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#worker-down-alarm).
|
|
1333
1449
|
|
|
1334
1450
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1335
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
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
|
|
1336
1452
|
`alarmTopic`.
|
|
1337
1453
|
|
|
1338
1454
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1343,7 +1459,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1343
1459
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1344
1460
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1345
1461
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1346
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1462
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance).
|
|
1347
1463
|
|
|
1348
1464
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1349
1465
|
not Template first and the worker contract stays at 1.
|
|
@@ -1409,7 +1525,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1409
1525
|
|
|
1410
1526
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1411
1527
|
mirror, so the root volume needs room for two
|
|
1412
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1528
|
+
([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1413
1529
|
|
|
1414
1530
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1415
1531
|
|
|
@@ -1431,7 +1547,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1431
1547
|
bundle-only roll is safe.
|
|
1432
1548
|
|
|
1433
1549
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1434
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
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
|
|
1435
1551
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1436
1552
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1437
1553
|
|
|
@@ -1448,8 +1564,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1448
1564
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1449
1565
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1450
1566
|
takes `worker/`'s three units and `gateway.env.example`
|
|
1451
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
1452
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
1453
1569
|
|
|
1454
1570
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1455
1571
|
|
|
@@ -1460,7 +1576,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1460
1576
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1461
1577
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1462
1578
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
1463
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
1464
1580
|
|
|
1465
1581
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1466
1582
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1636,7 +1752,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1636
1752
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1637
1753
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1638
1754
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1639
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1755
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#ai-content-configuration).
|
|
1640
1756
|
|
|
1641
1757
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1642
1758
|
change its link.
|
|
@@ -1711,7 +1827,7 @@ _First in int.115._
|
|
|
1711
1827
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1712
1828
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1713
1829
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1714
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1830
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1715
1831
|
unpublishing.
|
|
1716
1832
|
|
|
1717
1833
|
#### The editor calls the content drawer "All content"
|
|
@@ -2023,7 +2139,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
2023
2139
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
2024
2140
|
|
|
2025
2141
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
2026
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
2027
2143
|
|
|
2028
2144
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
2029
2145
|
|
|
@@ -2070,7 +2186,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
2070
2186
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
2071
2187
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
2072
2188
|
no longer exported from `canopycms/client`. See
|
|
2073
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
2189
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#editor-customization).
|
|
2074
2190
|
|
|
2075
2191
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
2076
2192
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -2181,7 +2297,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
2181
2297
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
2182
2298
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
2183
2299
|
own pages, mount the hook as in
|
|
2184
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
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).
|
|
2185
2301
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
2186
2302
|
|
|
2187
2303
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -2222,12 +2338,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
2222
2338
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
2223
2339
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
2224
2340
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
2225
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
2341
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
2226
2342
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
2227
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
|
|
2228
2344
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
2229
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
|
|
2230
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2346
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
|
|
2231
2347
|
|
|
2232
2348
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
2233
2349
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -2239,7 +2355,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
2239
2355
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
2240
2356
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
2241
2357
|
anyone holding an App's key can mint a token for any of its installations
|
|
2242
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
2358
|
+
([why](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
2243
2359
|
|
|
2244
2360
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
2245
2361
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -2252,7 +2368,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2252
2368
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
2253
2369
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
2254
2370
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
2255
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
2371
|
+
([details](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
2256
2372
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
2257
2373
|
of the three is refused at synth, and so is an App alongside a token.
|
|
2258
2374
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -2263,7 +2379,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2263
2379
|
|
|
2264
2380
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
2265
2381
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
2266
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
2382
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
2267
2383
|
|
|
2268
2384
|
```bash
|
|
2269
2385
|
canopycms init-github-app create -- \
|
|
@@ -2311,7 +2427,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2311
2427
|
|
|
2312
2428
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2313
2429
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
2314
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
2430
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#rotating-a-secret).
|
|
2315
2431
|
|
|
2316
2432
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2317
2433
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2365,12 +2481,12 @@ also check the bucket policy for its grant.
|
|
|
2365
2481
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2366
2482
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2367
2483
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
2368
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
2484
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#dual-build-support)).
|
|
2369
2485
|
|
|
2370
2486
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2371
2487
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2372
2488
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
2373
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
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)).
|
|
2374
2490
|
|
|
2375
2491
|
**To adopt.**
|
|
2376
2492
|
|
|
@@ -2399,7 +2515,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2399
2515
|
|
|
2400
2516
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2401
2517
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
2402
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2518
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration) for the
|
|
2403
2519
|
CloudFront behavior it expects.
|
|
2404
2520
|
|
|
2405
2521
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2424,7 +2540,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2424
2540
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2425
2541
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2426
2542
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
2427
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
2543
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
2428
2544
|
|
|
2429
2545
|
**To adopt.** Optional:
|
|
2430
2546
|
|
|
@@ -2534,7 +2650,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2534
2650
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2535
2651
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2536
2652
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2537
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2653
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/docs/deploying-to-aws.md#security-model)).
|
|
2538
2654
|
|
|
2539
2655
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2540
2656
|
|
|
@@ -2633,7 +2749,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2633
2749
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2634
2750
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2635
2751
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2636
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2752
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#media-configuration)). Two traps:
|
|
2637
2753
|
|
|
2638
2754
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2639
2755
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2792,7 +2908,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2792
2908
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2793
2909
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2794
2910
|
`createNextCanopyContext`'s result. See
|
|
2795
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2911
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2796
2912
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2797
2913
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2798
2914
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2849,7 +2965,7 @@ underscore-prefixed files are skipped.
|
|
|
2849
2965
|
|
|
2850
2966
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2851
2967
|
`defaultPathAccess: { read: 'allow' }`
|
|
2852
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2968
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#public-read-on-server-deployments)).
|
|
2853
2969
|
|
|
2854
2970
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2855
2971
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2902,7 +3018,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2902
3018
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2903
3019
|
gives one template's value type) requires exactly
|
|
2904
3020
|
one component per block template name when written as an object literal. See
|
|
2905
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
3021
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#block-component-registries) and
|
|
2906
3022
|
`apps/example1/app/components/PostView.tsx`.
|
|
2907
3023
|
|
|
2908
3024
|
```ts
|
|
@@ -2924,7 +3040,7 @@ templates against the schema.
|
|
|
2924
3040
|
|
|
2925
3041
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2926
3042
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2927
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
3043
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2928
3044
|
identity helper for them.
|
|
2929
3045
|
|
|
2930
3046
|
```ts
|
|
@@ -2943,7 +3059,7 @@ field by composing from the same `const` field object.
|
|
|
2943
3059
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2944
3060
|
it, and listings do with
|
|
2945
3061
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2946
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
3062
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/aaf8e5f929e4c9f84bc33f1b32d6a3c22ddc98cb/README.md#shared--referenced-blocks).
|
|
2947
3063
|
|
|
2948
3064
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2949
3065
|
|
|
@@ -2965,7 +3081,7 @@ Not retro-documented, apart from these:
|
|
|
2965
3081
|
|
|
2966
3082
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2967
3083
|
|
|
2968
|
-
**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/
|
|
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.
|
|
2969
3085
|
|
|
2970
3086
|
**To adopt.**
|
|
2971
3087
|
|
package/dist/api/admin.d.ts
CHANGED
|
@@ -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" | "
|
|
94
|
+
status: "failed" | "pending" | "processing" | "completed" | "corrupt";
|
|
95
95
|
limit?: number | undefined;
|
|
96
96
|
}, {
|
|
97
|
-
status: "failed" | "pending" | "
|
|
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" | "
|
|
171
|
+
status: "failed" | "pending" | "processing" | "completed" | "corrupt";
|
|
172
172
|
limit?: number | undefined;
|
|
173
173
|
}, {
|
|
174
|
-
status: "failed" | "pending" | "
|
|
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<{
|