canopycms 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +201 -47
- package/dist/api/admin-branch-health.js +47 -20
- package/dist/api/admin.d.ts +13 -1
- package/dist/api/admin.js +14 -24
- package/dist/api/branch-changes.d.ts +87 -0
- package/dist/api/branch-changes.js +269 -0
- package/dist/api/branch-entry-changes.d.ts +83 -0
- package/dist/api/branch-entry-changes.js +262 -0
- package/dist/api/branch-merge.js +2 -2
- package/dist/api/branch-review.js +35 -4
- package/dist/api/branch-status.js +14 -5
- package/dist/api/branch-withdraw.js +7 -0
- package/dist/api/branch.d.ts +13 -1
- package/dist/api/branch.js +171 -97
- package/dist/api/client.d.ts +15 -0
- package/dist/api/client.js +13 -1
- package/dist/api/content.d.ts +18 -18
- package/dist/api/content.js +1 -1
- package/dist/api/github-sync.js +7 -3
- package/dist/api/groups.d.ts +4 -4
- package/dist/api/pr-comment-sync.d.ts +9 -8
- package/dist/api/pr-comment-sync.js +23 -13
- package/dist/api/routes.js +4 -0
- package/dist/api/types.d.ts +3 -1
- package/dist/authorization/groups/schema.d.ts +4 -4
- package/dist/authorization/protected-branch.d.ts +3 -3
- package/dist/authorization/protected-branch.js +3 -3
- package/dist/branch-metadata-file.d.ts +84 -0
- package/dist/branch-metadata-file.js +9 -0
- package/dist/branch-metadata.d.ts +4 -4
- package/dist/branch-metadata.js +4 -5
- package/dist/branch-param.d.ts +24 -0
- package/dist/branch-param.js +87 -0
- package/dist/branch-provisioning.d.ts +6 -3
- package/dist/branch-provisioning.js +12 -10
- package/dist/branch-registry.d.ts +6 -0
- package/dist/branch-registry.js +12 -3
- package/dist/branch-workspace.js +22 -15
- package/dist/cli/cli.js +1060 -172
- package/dist/cli/generate-ai-content.js +732 -101
- package/dist/cli/init.js +126 -0
- package/dist/comment-store.d.ts +3 -0
- package/dist/comment-store.js +4 -1
- package/dist/config/schemas/config.d.ts +3 -0
- package/dist/config/schemas/config.js +2 -0
- package/dist/config/types.d.ts +11 -0
- package/dist/content-id-index.d.ts +5 -0
- package/dist/content-id-index.js +1 -1
- package/dist/content-listing.d.ts +53 -0
- package/dist/content-listing.js +123 -27
- package/dist/content-reader.js +23 -16
- package/dist/context.js +8 -7
- package/dist/editor/BranchManager.d.ts +7 -3
- package/dist/editor/BranchManager.js +51 -6
- package/dist/editor/Editor.js +166 -34
- package/dist/editor/EntryNavigator.d.ts +34 -10
- package/dist/editor/EntryNavigator.js +185 -29
- package/dist/editor/admin/SystemHealthPanel.js +36 -1
- package/dist/editor/admin/useSystemHealth.js +1 -0
- package/dist/editor/branch-names.d.ts +43 -0
- package/dist/editor/branch-names.js +75 -0
- package/dist/editor/components/BranchPill.d.ts +2 -2
- package/dist/editor/components/BranchPill.js +2 -2
- package/dist/editor/components/EditorHeader.d.ts +3 -1
- package/dist/editor/components/EditorHeader.js +2 -2
- package/dist/editor/components/EntryChangesDrawer.d.ts +51 -0
- package/dist/editor/components/EntryChangesDrawer.js +363 -0
- package/dist/editor/components/EntryChangesSkeleton.d.ts +9 -0
- package/dist/editor/components/EntryChangesSkeleton.js +7 -0
- package/dist/editor/components/EntryHeader.d.ts +9 -1
- package/dist/editor/components/EntryHeader.js +25 -3
- package/dist/editor/components/LazyEntryChangesDrawer.d.ts +16 -0
- package/dist/editor/components/LazyEntryChangesDrawer.js +45 -0
- package/dist/editor/components/ReviewDialogs.js +3 -3
- package/dist/editor/context/ApiClientContext.d.ts +9 -0
- package/dist/editor/context/ApiClientContext.js +26 -2
- package/dist/editor/context/index.d.ts +1 -1
- package/dist/editor/context/index.js +1 -1
- package/dist/editor/copy.d.ts +1 -0
- package/dist/editor/copy.js +1 -0
- package/dist/editor/editor-utils.d.ts +2 -0
- package/dist/editor/editor-utils.js +15 -0
- package/dist/editor/entry-diff.d.ts +143 -0
- package/dist/editor/entry-diff.js +593 -0
- package/dist/editor/hooks/create-branch-request.d.ts +11 -1
- package/dist/editor/hooks/create-branch-request.js +16 -6
- package/dist/editor/hooks/useBranchActions.d.ts +19 -2
- package/dist/editor/hooks/useBranchActions.js +29 -20
- package/dist/editor/hooks/useBranchChangesData.d.ts +57 -0
- package/dist/editor/hooks/useBranchChangesData.js +134 -0
- package/dist/editor/hooks/useBranchManager.d.ts +16 -0
- package/dist/editor/hooks/useBranchManager.js +142 -54
- package/dist/editor/hooks/useDraftManager.js +6 -2
- package/dist/editor/hooks/useEntryManager.d.ts +18 -2
- package/dist/editor/hooks/useEntryManager.js +36 -10
- package/dist/editor/utils/editor-errors.d.ts +5 -2
- package/dist/git-manager.d.ts +71 -0
- package/dist/git-manager.js +270 -1
- package/dist/http/handler.js +11 -9
- package/dist/operating-mode/branch-namespace-fixtures.d.ts +17 -0
- package/dist/operating-mode/branch-namespace-fixtures.js +65 -0
- package/dist/operating-mode/branch-namespace.d.ts +34 -0
- package/dist/operating-mode/branch-namespace.js +121 -0
- package/dist/operating-mode/client-unsafe-strategy.js +7 -0
- package/dist/operating-mode/types.d.ts +8 -0
- package/dist/paths/branch-name.d.ts +11 -19
- package/dist/paths/branch-name.js +17 -27
- package/dist/paths/index.d.ts +2 -2
- package/dist/paths/index.js +2 -2
- package/dist/paths/resolve.d.ts +0 -1
- package/dist/paths/resolve.js +0 -1
- package/dist/paths/validation.d.ts +40 -1
- package/dist/paths/validation.js +83 -4
- package/dist/pr-comments.d.ts +17 -9
- package/dist/pr-comments.js +53 -15
- package/dist/services.js +2 -1
- package/dist/submission-attribution.d.ts +22 -0
- package/dist/submission-attribution.js +62 -6
- package/dist/task-queue/worker-status.d.ts +6 -1
- package/dist/task-queue/worker-status.js +23 -2
- package/dist/types.d.ts +59 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/branch-policy.d.ts +111 -16
- package/dist/worker/branch-policy.js +222 -17
- package/dist/worker/cms-worker.d.ts +24 -2
- package/dist/worker/cms-worker.js +35 -24
- package/dist/worker/git-sync.d.ts +3 -3
- package/dist/worker/git-sync.js +47 -1
- package/dist/worker/github-gateway-http.js +2 -2
- package/dist/worker/github-gateway-wire.d.ts +40 -25
- package/dist/worker/github-gateway-wire.js +14 -3
- package/dist/worker/github-gateway.d.ts +17 -6
- package/dist/worker/github-gateway.js +62 -6
- package/dist/worker/github-mirror.d.ts +7 -4
- package/dist/worker/github-mirror.js +27 -16
- package/dist/worker/history-rewrite.d.ts +23 -10
- package/dist/worker/history-rewrite.js +43 -20
- package/dist/worker/legacy-branch-fixtures.d.ts +21 -0
- package/dist/worker/legacy-branch-fixtures.js +71 -0
- package/dist/worker/rebase.d.ts +2 -1
- package/dist/worker/rebase.js +93 -36
- package/dist/worker/task-runner.d.ts +4 -1
- package/dist/worker/task-runner.js +77 -48
- package/dist/worker/unpublishable-branches.d.ts +34 -0
- package/dist/worker/unpublishable-branches.js +182 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,9 @@ packages release together, at one version.
|
|
|
5
5
|
|
|
6
6
|
## This build
|
|
7
7
|
|
|
8
|
-
Version `0.
|
|
8
|
+
Version `0.8.0`, built from [`f47713d`](https://github.com/safeinsights/canopycms/tree/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.
|
|
10
|
+
Its entries are [0.8.0](#080), 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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/.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,160 @@ entries under **Released**.
|
|
|
62
62
|
|
|
63
63
|
## Released
|
|
64
64
|
|
|
65
|
+
### 0.8.0
|
|
66
|
+
|
|
67
|
+
<!-- changeset: merge-main-0-7-1-into-int-e -->
|
|
68
|
+
|
|
69
|
+
#### New branches are created in the branch namespace, and pull request links carry their short names — **behaviour change**
|
|
70
|
+
|
|
71
|
+
<!-- changeset: branches-created-in-namespace -->
|
|
72
|
+
|
|
73
|
+
_First in 0.8.0._
|
|
74
|
+
|
|
75
|
+
**What changed.** A branch an editor creates is named with the deployment's
|
|
76
|
+
[branch namespace](#the-github-gateway-writes-only-its-deployments-branch-namespace--security-fix-template-first) in front of the typed name, sanitized: typing
|
|
77
|
+
`spring/update` creates `canopycms/prod/spring-update` by default. Its short name
|
|
78
|
+
(`spring-update`) is what the branch listing returns as `shortName`, what `?branch=` links in pull
|
|
79
|
+
request bodies carry, and what a pull request without a title is named after (`Submit
|
|
80
|
+
spring-update`); `?branch=` and the API's `/:branch` segment accept it or the full name. A branch
|
|
81
|
+
outside the namespace is reached by its full name, or only by its exact form, `~<name>`, when a
|
|
82
|
+
namespace branch's short name is that name. Creation refuses a short name that another branch already has (the
|
|
83
|
+
base, the active branch, a branch outside the namespace, an exact name the gateway protects), one equal to
|
|
84
|
+
an API route (`admin`, `assets`, …), one kept for settings (`canopycms-settings-…` or the settings
|
|
85
|
+
branch), a name typed with the namespace in front, a name the remote holds a branch inside
|
|
86
|
+
(`spring/draft` for `spring`), and any name while the CMS and the gateway resolve different
|
|
87
|
+
namespaces or the remote has a branch named after part of the namespace. The gateway refuses a push
|
|
88
|
+
into the namespace while GitHub has a branch named after part of it or inside the one pushed.
|
|
89
|
+
|
|
90
|
+
**To adopt.** Update any CI workflow, ruleset or script that matches the names of branches the
|
|
91
|
+
editor creates, for example to skip them with `branches-ignore: ['canopycms/**']`. Branches that
|
|
92
|
+
already exist keep their names.
|
|
93
|
+
|
|
94
|
+
#### The editor shows a branch by its short name
|
|
95
|
+
|
|
96
|
+
<!-- changeset: editor-short-branch-names -->
|
|
97
|
+
|
|
98
|
+
_First in 0.8.0._
|
|
99
|
+
|
|
100
|
+
**What changed.** For a branch in the [branch namespace](#new-branches-are-created-in-the-branch-namespace-and-pull-request-links-carry-their-short-names--behaviour-change), the
|
|
101
|
+
editor shows `spring` where it showed `canopycms/prod/spring`: on the branch pill, the Branches
|
|
102
|
+
drawer, the Submit for review, Withdraw, Approve, Request changes and Delete dialogs, the comments
|
|
103
|
+
panel and the toasts. The editor's `?branch=` carries the short name too, as do the preview and its
|
|
104
|
+
page link; an old link with the full name still opens the branch, and the editor shortens it. A
|
|
105
|
+
branch outside the namespace, or nested deeper in it, is shown and linked by its full name, except
|
|
106
|
+
that one named like a namespace branch's short name is linked as `~<name>` (`%7E<name>` in the
|
|
107
|
+
address bar), its exact form, which only those links show; System health keeps the full ref and
|
|
108
|
+
workspace directory. The editor's API requests name a listed branch by its exact form, an internal
|
|
109
|
+
detail: `~` and the full name, each `/` as `~` (`/~canopycms~prod~spring/entries`). Git allows no
|
|
110
|
+
`~` in a branch name, so the form reaches the branch shown even when another answers to its short
|
|
111
|
+
name. Drafts saved in a browser stay with the branch, whichever name opened it.
|
|
112
|
+
|
|
113
|
+
The New branch field says "Will be named …" only when sanitizing changed what was typed, and shows
|
|
114
|
+
why a name is refused under the field, where it used to toast. A name with no letter
|
|
115
|
+
(a–z) or digit, such as `_`, is now refused. The "still being set up" answer a create or
|
|
116
|
+
open can get names the branch by its short name, not its workspace directory.
|
|
117
|
+
|
|
118
|
+
**To adopt.** Nothing. A script that reads the editor's `?branch=` gets the short name; the API
|
|
119
|
+
accepts it and the full name alike.
|
|
120
|
+
|
|
121
|
+
#### Pull request bodies show the CanopyCMS review state
|
|
122
|
+
|
|
123
|
+
<!-- changeset: pr-body-review-state -->
|
|
124
|
+
|
|
125
|
+
_First in 0.8.0._
|
|
126
|
+
|
|
127
|
+
**What changed.** The pull request body now shows whether a reviewer approved the branch or requested changes in CanopyCMS, and who, since an approval in CanopyCMS is not a GitHub review. It says "Not yet reviewed" until a reviewer acts, is updated when one does, and starts fresh when the branch is submitted or withdrawn.
|
|
128
|
+
|
|
129
|
+
#### `legacyBranches` keeps branches from outside the namespace publishing, and System health names any that cannot — **template first**
|
|
130
|
+
|
|
131
|
+
<!-- changeset: legacy-branches-and-unpublishable-warning -->
|
|
132
|
+
|
|
133
|
+
_First in 0.8.0._
|
|
134
|
+
|
|
135
|
+
**What changed.** `CanopyCmsService` takes `legacyBranches`: exact names of branches outside
|
|
136
|
+
[the gateway's namespace](#the-github-gateway-writes-only-its-deployments-branch-namespace--security-fix-template-first) that editors are still working on, which
|
|
137
|
+
the GitHub gateway may still write. It writes them, comma-separated, to the gateway's
|
|
138
|
+
`CANOPYCMS_LEGACY_BRANCHES`, and refuses at synth any list the gateway would refuse at boot,
|
|
139
|
+
such as an entry holding `*` or a comma, inside the resolved namespace, a branch the namespace
|
|
140
|
+
sits under, or repeated. Each git sync, the worker checks every editor branch against the
|
|
141
|
+
gateway's policy, and System health lists by full name the ones it would refuse to publish, with
|
|
142
|
+
what to do. The gateway now returns a pull request's body only when it would update that pull
|
|
143
|
+
request: its head is in the namespace or on `legacyBranches`, not protected, and in this
|
|
144
|
+
repository. For any other pull request it returns the merge state alone. So a legacy branch's
|
|
145
|
+
pull request keeps its comment and review blocks current, as a namespace branch's does.
|
|
146
|
+
|
|
147
|
+
**To adopt.** Before deploying, open the editor's branch list and pass every open branch whose
|
|
148
|
+
name is outside the namespace as `legacyBranches`; a hand install sets `CANOPYCMS_LEGACY_BRANCHES`
|
|
149
|
+
in `gateway.env` instead. After the deploy, System health names any you missed. Remove an entry
|
|
150
|
+
once its branch is merged or deleted.
|
|
151
|
+
|
|
152
|
+
#### The Content panel lists what a branch changes — **behaviour change**
|
|
153
|
+
|
|
154
|
+
<!-- changeset: content-panel-changed-filter -->
|
|
155
|
+
|
|
156
|
+
_First in 0.8.0._
|
|
157
|
+
|
|
158
|
+
**What changed.** The Content panel's filter now offers All, Unsaved and Changed. Unsaved is the
|
|
159
|
+
filter that used to be called Changed: entries with edits not yet saved. Changed lists the entries
|
|
160
|
+
that differ from the base branch, marked New, Edited or Moved, with deleted entries beneath the
|
|
161
|
+
tree, so a reviewer can see what a submitted branch changes without leaving the editor. It reads
|
|
162
|
+
the new `GET /:branch/changes` endpoint, which the catch-all API route already serves.
|
|
163
|
+
|
|
164
|
+
#### Show changes on a changed entry
|
|
165
|
+
|
|
166
|
+
<!-- changeset: entry-show-changes -->
|
|
167
|
+
|
|
168
|
+
_First in 0.8.0._
|
|
169
|
+
|
|
170
|
+
**What changed.** Reviewers and editors can open "Show changes" on a changed entry to see each
|
|
171
|
+
changed field's old and new values against the base branch, with text differences highlighted.
|
|
172
|
+
It opens from the entry header, and from each entry the Content panel's Changed filter lists as
|
|
173
|
+
deleted. It reads the new `GET /:branch/changes/...entryPath` endpoint, which the catch-all API
|
|
174
|
+
route already serves.
|
|
175
|
+
|
|
176
|
+
#### The GitHub gateway writes only its deployment's branch namespace — **security fix, template first**
|
|
177
|
+
|
|
178
|
+
<!-- changeset: gateway-branch-namespace -->
|
|
179
|
+
|
|
180
|
+
_First in 0.8.0._
|
|
181
|
+
|
|
182
|
+
**What changed.** The GitHub gateway now pushes, force-pushes, deletes and opens pull requests only
|
|
183
|
+
for branches in its namespace and the exact names in a new legacy list. The namespace is a template
|
|
184
|
+
ending with `/`, where `{deployment}` stands for the deployment name: `canopycms/{deployment}/` by
|
|
185
|
+
default, so `canopycms/prod/`. It is set by `CanopyCmsService`'s new `branchNamespace` prop (or
|
|
186
|
+
`CANOPYCMS_BRANCH_NAMESPACE`, then `branchNamespace` in `canopycms.config.ts`), and the gateway
|
|
187
|
+
reads it from its own environment only. Of the settings branches it pushes only this deployment's
|
|
188
|
+
own, as before: no lease, deletion or pull request. It updates, closes or drafts a pull request only
|
|
189
|
+
after GitHub shows that its head is such a branch of this repository, so a compromised CMS Lambda
|
|
190
|
+
cannot aim it elsewhere. System health says when the CMS and gateway resolve different namespaces.
|
|
191
|
+
|
|
192
|
+
**To adopt.** Deploy the stack template first: it now writes `CANOPYCMS_DEPLOYMENT_NAME`,
|
|
193
|
+
`CANOPYCMS_SETTINGS_BRANCH` and `CANOPYCMS_BRANCH_NAMESPACE`, which the gateway now reads, to
|
|
194
|
+
`gateway.env` too (a hand install adds them, as `gateway.env.example` shows). The bundle needs
|
|
195
|
+
worker contract 3, which an older template's roll gate refuses. Roll the worker bundle
|
|
196
|
+
(`canopycms-cdk`) with or before the CMS image, which creates no branch until the worker reports its
|
|
197
|
+
namespace. Stacks sharing a repository keep `{deployment}` in one template. Then list every open
|
|
198
|
+
branch outside the namespace, as [`legacyBranches`](#legacybranches-keeps-branches-from-outside-the-namespace-publishing-and-system-health-names-any-that-cannot--template-first)
|
|
199
|
+
describes. Until listed, a branch's publishes, pull request updates and deletion fail permanently,
|
|
200
|
+
naming the list. A rolled-back worker can rename namespace branches, breaking their links and open
|
|
201
|
+
editors; this release's worker restores them on its next sync. Submit none while rolled back: that
|
|
202
|
+
pushes the branch under its directory name, without its earlier commits, which this release
|
|
203
|
+
publishes only if `legacyBranches` lists it.
|
|
204
|
+
|
|
205
|
+
### 0.7.1
|
|
206
|
+
|
|
207
|
+
<!-- changeset: worker-platform-ci -->
|
|
208
|
+
|
|
209
|
+
#### An alarm for a running worker whose git syncs all fail
|
|
210
|
+
|
|
211
|
+
<!-- changeset: worker-sync-failing-alarm -->
|
|
212
|
+
|
|
213
|
+
_First in 0.7.1._
|
|
214
|
+
|
|
215
|
+
**What changed.** The worker-down alarm counts the line every git-sync cycle logs as it starts, so a running worker whose every sync failed stayed green. The worker now also logs `Git sync complete` when a cycle runs to its end. With `alarmTopic` set, `CanopyCmsService` adds `workerSyncFailingAlarm`, which notifies the topic, and again on recovery, when cycles keep starting and none completes for an hour. A GitHub outage is the usual cause, and the alarm's description says to check GitHub's status first.
|
|
216
|
+
|
|
217
|
+
**To adopt.** Nothing, in the default asset mode. With `workerCode: { source: 'parameter' }`, roll the bundle within the hour of deploying the template: an older bundle never logs `Git sync complete`, so the alarm fires until it rolls.
|
|
218
|
+
|
|
65
219
|
### 0.7.0
|
|
66
220
|
|
|
67
221
|
<!-- changeset: playwright-1-64-ubuntu-26-04 -->
|
|
@@ -97,7 +251,7 @@ _First in 0.7.0._
|
|
|
97
251
|
|
|
98
252
|
**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.
|
|
99
253
|
|
|
100
|
-
**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/
|
|
254
|
+
**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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
|
|
101
255
|
|
|
102
256
|
#### Pull request bodies link back to the editor
|
|
103
257
|
|
|
@@ -107,7 +261,7 @@ _First in 0.7.0._
|
|
|
107
261
|
|
|
108
262
|
**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.
|
|
109
263
|
|
|
110
|
-
**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/
|
|
264
|
+
**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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#definecanopyconfig-options).
|
|
111
265
|
|
|
112
266
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
113
267
|
|
|
@@ -193,7 +347,7 @@ _First in 0.6.0._
|
|
|
193
347
|
|
|
194
348
|
**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.
|
|
195
349
|
|
|
196
|
-
**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/
|
|
350
|
+
**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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md).
|
|
197
351
|
|
|
198
352
|
### 0.5.0
|
|
199
353
|
|
|
@@ -205,7 +359,7 @@ _First in 0.5.0._
|
|
|
205
359
|
|
|
206
360
|
**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.
|
|
207
361
|
|
|
208
|
-
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
362
|
+
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#field-types).
|
|
209
363
|
|
|
210
364
|
#### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
|
|
211
365
|
|
|
@@ -215,7 +369,7 @@ _First in 0.5.0._
|
|
|
215
369
|
|
|
216
370
|
**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.
|
|
217
371
|
|
|
218
|
-
**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/
|
|
372
|
+
**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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#how-references-work-in-the-editor).
|
|
219
373
|
|
|
220
374
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
221
375
|
|
|
@@ -243,7 +397,7 @@ resolved without it.
|
|
|
243
397
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
244
398
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
245
399
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
246
|
-
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/
|
|
400
|
+
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#resolving-references-in-a-listing).
|
|
247
401
|
|
|
248
402
|
### 0.3.3
|
|
249
403
|
|
|
@@ -660,7 +814,7 @@ URL.
|
|
|
660
814
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
661
815
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
662
816
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
663
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
817
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#live-preview)).
|
|
664
818
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
665
819
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
666
820
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -675,7 +829,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
675
829
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
676
830
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
677
831
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
678
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
832
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#live-preview).
|
|
679
833
|
|
|
680
834
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
681
835
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -757,7 +911,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
757
911
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
758
912
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
759
913
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
760
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
914
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#ai-content-configuration).
|
|
761
915
|
|
|
762
916
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
763
917
|
|
|
@@ -779,7 +933,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
779
933
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
780
934
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
781
935
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
782
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
936
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#mdx-content-cannot-run-code).
|
|
783
937
|
|
|
784
938
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
785
939
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -916,7 +1070,7 @@ a format check.
|
|
|
916
1070
|
|
|
917
1071
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
918
1072
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
919
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1073
|
+
([reference](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#definecanopyconfig-options)).
|
|
920
1074
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
921
1075
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
922
1076
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -940,7 +1094,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
940
1094
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
941
1095
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
942
1096
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
943
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
1097
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
944
1098
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
945
1099
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
946
1100
|
|
|
@@ -978,7 +1132,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
978
1132
|
new stack needs no steps.
|
|
979
1133
|
|
|
980
1134
|
**What changed.** (int.109) Detailed in
|
|
981
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1135
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
982
1136
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
983
1137
|
refusing clients without TLS or IAM, replacing the worker's
|
|
984
1138
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1032,10 +1186,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1032
1186
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1033
1187
|
unchanged.
|
|
1034
1188
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1035
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
1189
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#worker-down-alarm).
|
|
1036
1190
|
|
|
1037
1191
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1038
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
1192
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
1039
1193
|
`alarmTopic`.
|
|
1040
1194
|
|
|
1041
1195
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1046,7 +1200,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1046
1200
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1047
1201
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1048
1202
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1049
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1203
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance).
|
|
1050
1204
|
|
|
1051
1205
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1052
1206
|
not Template first and the worker contract stays at 1.
|
|
@@ -1112,7 +1266,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1112
1266
|
|
|
1113
1267
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1114
1268
|
mirror, so the root volume needs room for two
|
|
1115
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1269
|
+
([details](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1116
1270
|
|
|
1117
1271
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1118
1272
|
|
|
@@ -1134,7 +1288,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1134
1288
|
bundle-only roll is safe.
|
|
1135
1289
|
|
|
1136
1290
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1137
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1291
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
1138
1292
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1139
1293
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1140
1294
|
|
|
@@ -1151,8 +1305,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1151
1305
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1152
1306
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1153
1307
|
takes `worker/`'s three units and `gateway.env.example`
|
|
1154
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
1155
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
1308
|
+
([steps](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
1309
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
1156
1310
|
|
|
1157
1311
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1158
1312
|
|
|
@@ -1163,7 +1317,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1163
1317
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1164
1318
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1165
1319
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
1166
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
1320
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
1167
1321
|
|
|
1168
1322
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1169
1323
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1339,7 +1493,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1339
1493
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1340
1494
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1341
1495
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1342
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1496
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#ai-content-configuration).
|
|
1343
1497
|
|
|
1344
1498
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1345
1499
|
change its link.
|
|
@@ -1414,7 +1568,7 @@ _First in int.115._
|
|
|
1414
1568
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1415
1569
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1416
1570
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1417
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1571
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1418
1572
|
unpublishing.
|
|
1419
1573
|
|
|
1420
1574
|
#### The editor calls the content drawer "All content"
|
|
@@ -1726,7 +1880,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1726
1880
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1727
1881
|
|
|
1728
1882
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1729
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
1883
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#stamping-a-publication-date).
|
|
1730
1884
|
|
|
1731
1885
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1732
1886
|
|
|
@@ -1773,7 +1927,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
1773
1927
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
1774
1928
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
1775
1929
|
no longer exported from `canopycms/client`. See
|
|
1776
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
1930
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#editor-customization).
|
|
1777
1931
|
|
|
1778
1932
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
1779
1933
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -1884,7 +2038,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
1884
2038
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
1885
2039
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
1886
2040
|
own pages, mount the hook as in
|
|
1887
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
2041
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
1888
2042
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
1889
2043
|
|
|
1890
2044
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -1925,12 +2079,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
1925
2079
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
1926
2080
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
1927
2081
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
1928
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
2082
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
1929
2083
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
1930
2084
|
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
|
|
1931
2085
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
1932
2086
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
1933
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2087
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#security-model)).
|
|
1934
2088
|
|
|
1935
2089
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
1936
2090
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -1942,7 +2096,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
1942
2096
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
1943
2097
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
1944
2098
|
anyone holding an App's key can mint a token for any of its installations
|
|
1945
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
2099
|
+
([why](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
1946
2100
|
|
|
1947
2101
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
1948
2102
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -1955,7 +2109,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1955
2109
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
1956
2110
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
1957
2111
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
1958
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
2112
|
+
([details](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
1959
2113
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
1960
2114
|
of the three is refused at synth, and so is an App alongside a token.
|
|
1961
2115
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -1966,7 +2120,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1966
2120
|
|
|
1967
2121
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
1968
2122
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
1969
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
2123
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
1970
2124
|
|
|
1971
2125
|
```bash
|
|
1972
2126
|
canopycms init-github-app create -- \
|
|
@@ -2014,7 +2168,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2014
2168
|
|
|
2015
2169
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2016
2170
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
2017
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
2171
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rotating-a-secret).
|
|
2018
2172
|
|
|
2019
2173
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2020
2174
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2068,12 +2222,12 @@ also check the bucket policy for its grant.
|
|
|
2068
2222
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2069
2223
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2070
2224
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
2071
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
2225
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#dual-build-support)).
|
|
2072
2226
|
|
|
2073
2227
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2074
2228
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2075
2229
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
2076
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
2230
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
2077
2231
|
|
|
2078
2232
|
**To adopt.**
|
|
2079
2233
|
|
|
@@ -2102,7 +2256,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2102
2256
|
|
|
2103
2257
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2104
2258
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
2105
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2259
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#media-configuration) for the
|
|
2106
2260
|
CloudFront behavior it expects.
|
|
2107
2261
|
|
|
2108
2262
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2127,7 +2281,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2127
2281
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2128
2282
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2129
2283
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
2130
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
2284
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
2131
2285
|
|
|
2132
2286
|
**To adopt.** Optional:
|
|
2133
2287
|
|
|
@@ -2237,7 +2391,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2237
2391
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2238
2392
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2239
2393
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2240
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2394
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#security-model)).
|
|
2241
2395
|
|
|
2242
2396
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2243
2397
|
|
|
@@ -2336,7 +2490,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2336
2490
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2337
2491
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2338
2492
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2339
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2493
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#media-configuration)). Two traps:
|
|
2340
2494
|
|
|
2341
2495
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2342
2496
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2495,7 +2649,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2495
2649
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2496
2650
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2497
2651
|
`createNextCanopyContext`'s result. See
|
|
2498
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2652
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2499
2653
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2500
2654
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2501
2655
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2552,7 +2706,7 @@ underscore-prefixed files are skipped.
|
|
|
2552
2706
|
|
|
2553
2707
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2554
2708
|
`defaultPathAccess: { read: 'allow' }`
|
|
2555
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2709
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#public-read-on-server-deployments)).
|
|
2556
2710
|
|
|
2557
2711
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2558
2712
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2605,7 +2759,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2605
2759
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2606
2760
|
gives one template's value type) requires exactly
|
|
2607
2761
|
one component per block template name when written as an object literal. See
|
|
2608
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2762
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#block-component-registries) and
|
|
2609
2763
|
`apps/example1/app/components/PostView.tsx`.
|
|
2610
2764
|
|
|
2611
2765
|
```ts
|
|
@@ -2627,7 +2781,7 @@ templates against the schema.
|
|
|
2627
2781
|
|
|
2628
2782
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2629
2783
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2630
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2784
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2631
2785
|
identity helper for them.
|
|
2632
2786
|
|
|
2633
2787
|
```ts
|
|
@@ -2646,7 +2800,7 @@ field by composing from the same `const` field object.
|
|
|
2646
2800
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2647
2801
|
it, and listings do with
|
|
2648
2802
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2649
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2803
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#shared--referenced-blocks).
|
|
2650
2804
|
|
|
2651
2805
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2652
2806
|
|
|
@@ -2668,7 +2822,7 @@ Not retro-documented, apart from these:
|
|
|
2668
2822
|
|
|
2669
2823
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2670
2824
|
|
|
2671
|
-
**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/
|
|
2825
|
+
**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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2672
2826
|
|
|
2673
2827
|
**To adopt.**
|
|
2674
2828
|
|