canopycms 0.2.0-int.121 → 0.3.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 +241 -78
- package/dist/api/branch.d.ts +2 -2
- package/dist/cli/cli.js +0 -18
- package/dist/cli/generate-ai-content.js +0 -6
- package/dist/cli/init.js +0 -6
- package/dist/dev-content-watcher.js +8 -1
- package/dist/editor/BranchManager.d.ts +2 -0
- package/dist/editor/BranchManager.js +3 -3
- package/dist/editor/Editor.js +276 -130
- package/dist/editor/EntryNavigator.d.ts +44 -9
- package/dist/editor/EntryNavigator.js +278 -104
- package/dist/editor/branch-lock.d.ts +42 -0
- package/dist/editor/branch-lock.js +79 -0
- package/dist/editor/branch-status.d.ts +0 -6
- package/dist/editor/branch-status.js +0 -10
- package/dist/editor/components/BranchNotAvailableNotice.d.ts +11 -0
- package/dist/editor/components/BranchNotAvailableNotice.js +10 -0
- package/dist/editor/components/BranchPill.d.ts +3 -18
- package/dist/editor/components/BranchPill.js +7 -10
- package/dist/editor/components/BranchRowLock.d.ts +3 -1
- package/dist/editor/components/BranchRowLock.js +4 -2
- package/dist/editor/components/EditorHeader.d.ts +24 -52
- package/dist/editor/components/EditorHeader.js +151 -71
- package/dist/editor/components/EditorRail.d.ts +8 -8
- package/dist/editor/components/EditorRail.js +7 -5
- package/dist/editor/components/EntryBreadcrumb.d.ts +5 -1
- package/dist/editor/components/EntryBreadcrumb.js +3 -3
- package/dist/editor/components/EntryHeader.d.ts +60 -0
- package/dist/editor/components/EntryHeader.js +45 -0
- package/dist/editor/components/EntrySaveButton.d.ts +24 -0
- package/dist/editor/components/EntrySaveButton.js +101 -0
- package/dist/editor/components/NoEditPermissionNotice.d.ts +1 -1
- package/dist/editor/components/NoEditPermissionNotice.js +1 -1
- package/dist/editor/components/RetryToastMessage.d.ts +3 -1
- package/dist/editor/components/RetryToastMessage.js +8 -4
- package/dist/editor/components/SaveAllButton.d.ts +25 -0
- package/dist/editor/components/SaveAllButton.js +81 -0
- package/dist/editor/components/UnsavedMark.d.ts +1 -1
- package/dist/editor/components/UnsavedMark.js +1 -1
- package/dist/editor/components/index.d.ts +1 -1
- package/dist/editor/components/index.js +1 -1
- package/dist/editor/copy.d.ts +0 -1
- package/dist/editor/copy.js +0 -1
- package/dist/editor/editor-utils.d.ts +2 -2
- package/dist/editor/editor-utils.js +2 -2
- package/dist/editor/entry-search.d.ts +10 -16
- package/dist/editor/entry-search.js +4 -24
- package/dist/editor/hooks/editor-history.d.ts +7 -0
- package/dist/editor/hooks/editor-history.js +80 -0
- package/dist/editor/hooks/useBranchActions.js +3 -1
- package/dist/editor/hooks/useBranchManager.d.ts +7 -3
- package/dist/editor/hooks/useBranchManager.js +18 -11
- package/dist/editor/hooks/useEntryManager.d.ts +12 -2
- package/dist/editor/hooks/useEntryManager.js +141 -20
- package/dist/editor/shell/ActivityRail.d.ts +4 -0
- package/dist/editor/shell/ActivityRail.js +13 -4
- package/dist/editor/shell/EditorShell.d.ts +6 -7
- package/dist/editor/shell/EditorShell.js +9 -13
- package/dist/editor/shell/PaneLayout.d.ts +1 -0
- package/dist/editor/shell/PaneLayout.js +23 -5
- package/dist/editor/shell/SidePanelHost.d.ts +11 -4
- package/dist/editor/shell/SidePanelHost.js +95 -7
- package/dist/editor/shell/TopBar.d.ts +4 -4
- package/dist/editor/shell/TopBar.js +6 -3
- package/dist/editor/theme.js +22 -1
- package/dist/editor/utils/focus-return.d.ts +10 -2
- package/dist/editor/utils/focus-return.js +40 -6
- package/dist/operating-mode/client-safe-strategy.d.ts +1 -6
- package/dist/operating-mode/client-safe-strategy.js +1 -10
- package/dist/operating-mode/types.d.ts +0 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/editor/components/BranchLockBanner.d.ts +0 -23
- package/dist/editor/components/BranchLockBanner.js +0 -66
- package/dist/editor/components/QuickOpenPalette.d.ts +0 -28
- package/dist/editor/components/QuickOpenPalette.js +0 -71
- package/dist/editor/components/SaveSplitButton.d.ts +0 -31
- package/dist/editor/components/SaveSplitButton.js +0 -121
package/CHANGELOG.md
CHANGED
|
@@ -5,18 +5,9 @@ packages release together, at one version.
|
|
|
5
5
|
|
|
6
6
|
## This build
|
|
7
7
|
|
|
8
|
-
Version `0.
|
|
8
|
+
Version `0.3.0`, built from [`18d436f`](https://github.com/safeinsights/canopycms/tree/18d436fe91546aabb30da8efa1397046b65681dc).
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- [Media-library thumbnails are stored at upload and cached by the browser — behaviour change](#media-library-thumbnails-are-stored-at-upload-and-cached-by-the-browser--behaviour-change)
|
|
13
|
-
- [Image fields are bordered cards, and Crop explains itself and works without aspect](#image-fields-are-bordered-cards-and-crop-explains-itself-and-works-without-aspect)
|
|
14
|
-
- [A locked branch shows a lock where a row's "…" menu would be](#a-locked-branch-shows-a-lock-where-a-rows--menu-would-be)
|
|
15
|
-
- [Links clicked in the preview open their entry instead of leaving the editor — behaviour change](#links-clicked-in-the-preview-open-their-entry-instead-of-leaving-the-editor--behaviour-change)
|
|
16
|
-
|
|
17
|
-
### Revised since int.119
|
|
18
|
-
|
|
19
|
-
- [Removing a file from the media library hides it, and an admin can restore it — breaking (assets.delete, AssetStore) / behaviour change; template first](#removing-a-file-from-the-media-library-hides-it-and-an-admin-can-restore-it--breaking-assetsdelete-assetstore--behaviour-change-template-first)
|
|
10
|
+
Its entries are [0.3.0](#030), under **Released**.
|
|
20
11
|
|
|
21
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.
|
|
22
13
|
|
|
@@ -33,7 +24,7 @@ Each entry has up to three parts:
|
|
|
33
24
|
`node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
|
|
34
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
|
|
35
26
|
came from. The copy in the repository holds released history and the entries from before changesets;
|
|
36
|
-
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/18d436fe91546aabb30da8efa1397046b65681dc/.changeset/README.md) until a stable release
|
|
37
28
|
moves it here.
|
|
38
29
|
|
|
39
30
|
**Find your starting point.** From a stable pin, start at the first version under **Released**
|
|
@@ -67,21 +58,171 @@ Nothing in this section is edited by hand: each entry is a `.changeset/` file, w
|
|
|
67
58
|
assembles here and labels with the first int that carries it, and a stable release moves the
|
|
68
59
|
entries under **Released**.
|
|
69
60
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Released
|
|
64
|
+
|
|
65
|
+
### 0.3.0
|
|
66
|
+
|
|
67
|
+
#### The branch bar's tooltips open beside their controls
|
|
68
|
+
|
|
69
|
+
<!-- changeset: bar-tooltips-beside-controls -->
|
|
70
|
+
|
|
71
|
+
_First in 0.3.0._
|
|
72
|
+
|
|
73
|
+
**What changed.** The tooltips on the bar's unsaved count, Save all and the branch-actions caret
|
|
74
|
+
no longer open a fixed distance below the bar, where a bar wrapped to several rows put them over
|
|
75
|
+
the entry's Save and breadcrumb, and a one-row bar over the preview toolbar. The unsaved count's
|
|
76
|
+
and the caret's open at their control. Save all's opens to its left, in the bar's free middle,
|
|
77
|
+
and below it when the left edge has no room. The unsaved count's tooltip now reads "Show unsaved
|
|
78
|
+
entries in the content panel".
|
|
79
|
+
|
|
80
|
+
#### The top bar becomes the branch bar — **behaviour change**
|
|
81
|
+
|
|
82
|
+
<!-- changeset: branch-bar-layout -->
|
|
83
|
+
|
|
84
|
+
_First in 0.3.0._
|
|
85
|
+
|
|
86
|
+
**What changed.** The branch pill moves to the start of the top bar, and its menu opens from
|
|
87
|
+
there. The actions on the branch sit at the bar's other end: the warning that drafts could not
|
|
88
|
+
be stored on this device, then Save all, then Submit for review or Withdraw from review. Below
|
|
89
|
+
the `md` breakpoint, on a branch you can edit, Save all and the review action share one split
|
|
90
|
+
button: Save all is the button, and its caret holds Submit or Withdraw. A branch with no review
|
|
91
|
+
action draws no caret. The confirm dialog returns focus to the review action, and focus follows
|
|
92
|
+
that action when a submit or withdraw moves it between the caret and a button of its own.
|
|
93
|
+
|
|
94
|
+
#### The branch bar states a locked branch's status, replacing the lock banner — **behaviour change**
|
|
95
|
+
|
|
96
|
+
<!-- changeset: branch-bar-status -->
|
|
97
|
+
|
|
98
|
+
_First in 0.3.0._
|
|
99
|
+
|
|
100
|
+
**What changed.** The banner under the top bar is gone. A branch's lasting state now shows
|
|
101
|
+
once, beside the branch pill, at every width: "Loading branch…", "Protected · read-only", "In
|
|
102
|
+
review · read-only", "Approved · read-only", "Archived · read-only", "Details unavailable ·
|
|
103
|
+
read-only" when branch details failed to load, "Not available · read-only" when the branch list
|
|
104
|
+
has no such branch for you, or "Protected" for a protected branch that still takes edits. Screen
|
|
105
|
+
readers hear the status with its reason when a lock arrives. The pill no longer carries a status
|
|
106
|
+
badge, and on a phone it shows the branch name, truncated, with the full name heading its menu.
|
|
107
|
+
The bar offers the way forward: New branch…, which opens Branches on its new-branch form, on the
|
|
108
|
+
protected base branch; Withdraw from review on a branch in review; Refresh branch when details
|
|
109
|
+
failed to load; and Switch branch… otherwise. Below the `md` breakpoint a locked branch has no
|
|
110
|
+
Save all: its way forward leads, with Submit or Withdraw in its caret unless Withdraw is that way.
|
|
111
|
+
Someone who may not withdraw gets Switch branch…, with the blocked Withdraw and its reason in the
|
|
112
|
+
caret.
|
|
113
|
+
|
|
114
|
+
#### The content panel lists unsaved entries under a Changed filter, replacing the pill's list — **behaviour change**
|
|
115
|
+
|
|
116
|
+
<!-- changeset: changed-filter -->
|
|
117
|
+
|
|
118
|
+
_First in 0.3.0._
|
|
119
|
+
|
|
120
|
+
**What changed.** The branch pill's menu no longer lists the unsaved entries. It keeps Switch
|
|
121
|
+
branch…, Refresh branch and Discard all changes. The unsaved count leaves the pill, and Save all
|
|
122
|
+
no longer carries it: "N unsaved" beside the branch's status opens the content panel filtered to
|
|
123
|
+
Changed, with any search cleared, in the overlay on a narrow window. The panel's All / Changed
|
|
124
|
+
choice lists only entries with unsaved changes, under the collections that hold them, and
|
|
125
|
+
combines with the search field. Enter opens the first one. Changed says when nothing is unsaved,
|
|
126
|
+
when no unsaved entry matches the search, when some entries are still being listed, and when the
|
|
127
|
+
entry list failed to load; an unsaved entry outside the content tree is offered beneath it.
|
|
128
|
+
Finding an entry with Mod+P, or switching branch, goes back to All. The entry menu gains "Show
|
|
129
|
+
in content panel": it opens the panel on All, with the search cleared, and focuses the entry's
|
|
130
|
+
row.
|
|
131
|
+
|
|
132
|
+
#### Save moves into a header over the open entry, and Save all becomes its own button — **behaviour change**
|
|
133
|
+
|
|
134
|
+
<!-- changeset: entry-header-save -->
|
|
135
|
+
|
|
136
|
+
_First in 0.3.0._
|
|
137
|
+
|
|
138
|
+
**What changed.** A header above the preview and form holds the open entry's breadcrumb, entry
|
|
139
|
+
menu, unsaved dot, "Read-only" chip and Save. It stays in view while the preview is maximized,
|
|
140
|
+
and with no entry open Save stays there, blocked, saying to open one; while entries load, the
|
|
141
|
+
crumb is a placeholder. "Save all" leaves Save's
|
|
142
|
+
menu for a button of its own in the top bar, showing the unsaved count and then its progress,
|
|
143
|
+
and waits while any entry is saving. Save waits while Save all runs, and says why. The warning
|
|
144
|
+
that drafts could not be stored on this device now shows whenever anything on the branch is
|
|
145
|
+
unsaved, not only the open entry.
|
|
146
|
+
|
|
147
|
+
#### EntryNavigator's `revealCollection` prop is replaced by `reveal` — **breaking (EntryNavigator props)**
|
|
148
|
+
|
|
149
|
+
<!-- changeset: entry-navigator-props -->
|
|
150
|
+
|
|
151
|
+
_First in 0.3.0._
|
|
152
|
+
|
|
153
|
+
**What changed.** `EntryNavigatorProps` loses `revealCollection` and gains `reveal`, a
|
|
154
|
+
`ContentPanelReveal` (a new export of `canopycms/client`). `EntryNavItem` gains an optional
|
|
155
|
+
`route`. The other additions are all optional: `onChangedOnlyChange`, `changedOnly`,
|
|
156
|
+
`unsavedCount`, `unsavedEntries`, `entryListFailed`, `branchNotAvailable`, `onSwitchBranch`,
|
|
157
|
+
`onFilterEnter`, `onFilterEscape`, `onRowMenuOpen`, `filterRef` and `filterShortcut`. No prop
|
|
158
|
+
became required, and the editor's own use of the navigator needs no change. Only code that
|
|
159
|
+
renders `EntryNavigator` directly is affected.
|
|
160
|
+
|
|
161
|
+
**To adopt.** Where you pass `revealCollection={{ path, seq }}`, pass
|
|
162
|
+
`reveal={{ kind: 'collection', path, seq }}` instead. `reveal` also takes
|
|
163
|
+
`{ kind: 'entry', path, seq }` for an entry's row and `{ kind: 'changed', seq }` to clear the
|
|
164
|
+
query for the Changed filter. `onRevealed` is unchanged. A `reveal` of kind `collection` or
|
|
165
|
+
`entry` calls `onChangedOnlyChange(false)`, so a controlled `changedOnly` returns to All.
|
|
166
|
+
|
|
167
|
+
#### A branch you can't open says so everywhere, and locked drafts say why they wait
|
|
168
|
+
|
|
169
|
+
<!-- changeset: no-access-branch-and-locked-drafts -->
|
|
170
|
+
|
|
171
|
+
_First in 0.3.0._
|
|
172
|
+
|
|
173
|
+
**What changed.** On a branch the branch list doesn't include for you ("Not available ·
|
|
174
|
+
read-only" in the bar), once its content fails to load, the content panel and the form pane say
|
|
175
|
+
"You don't have access to this branch, or it no longer exists." and offer Switch branch…, which
|
|
176
|
+
opens Branches; the preview pane says the same. They used to read "No content" and "Select an
|
|
177
|
+
item to start editing." No failed load is toasted on that branch. On any other branch, a failed
|
|
178
|
+
content load keeps its "Could not load content" toast with Retry, now in plain words, with any
|
|
179
|
+
diagnostic behind a "Details" disclosure. On a locked branch, the bar's "N unsaved" tooltip says
|
|
180
|
+
the edits are in this browser and what lets them be saved: "Withdraw to save them." in review or
|
|
181
|
+
approved, for someone who may withdraw; a pointer to "Refresh branch" when details failed to
|
|
182
|
+
load; and, on a protected or archived branch, that they can only be discarded.
|
|
183
|
+
|
|
184
|
+
#### One search: Mod+P opens the content panel's "Find entries" field, and the quick-open dialog is gone — **behaviour change**
|
|
185
|
+
|
|
186
|
+
<!-- changeset: one-entry-search -->
|
|
187
|
+
|
|
188
|
+
_First in 0.3.0._
|
|
189
|
+
|
|
190
|
+
**What changed.** Finding an entry has one place, the content panel's field, now called "Find
|
|
191
|
+
entries" and showing its shortcut (⌘P on macOS, Ctrl+P elsewhere). Mod+P focuses it from
|
|
192
|
+
anywhere, a form field included; pressed in the field, it selects the text. With the docked panel
|
|
193
|
+
closed, Mod+P opens it only until Enter opens the first match, Escape is pressed in the empty
|
|
194
|
+
field, or focus moves elsewhere; opening a row's menu or pressing Content keeps it open. That
|
|
195
|
+
Enter moves focus to the opened entry's first field. The quick-open dialog, the panel's
|
|
196
|
+
magnifier button and the rail's Open entry button are removed; the Content button's tooltip names
|
|
197
|
+
the shortcut. Each tree row's second line now shows the entry's route after its type, as in
|
|
198
|
+
"Landing page · /contact" (the type alone when the entry has no page), in full on hover or focus
|
|
199
|
+
when it is cut off.
|
|
200
|
+
|
|
201
|
+
##### Added in 0.3.0
|
|
202
|
+
|
|
203
|
+
<!-- changeset: one-entry-search-focus-polish -->
|
|
204
|
+
|
|
205
|
+
**What changed.** The form pane, when it takes focus after Enter opens an entry with no fields, draws the
|
|
206
|
+
editor's focus ring inside its edges, above the form's sticky header. On keyboard focus, a tree
|
|
207
|
+
row's cut-off line shows in full after a short delay, below the row (above it when
|
|
208
|
+
there is no room), never over the row's title, and Escape hides it. The field's shortcut hint takes
|
|
209
|
+
the placeholder's colour, and its clear buttons read "Clear search".
|
|
210
|
+
|
|
211
|
+
#### The rail drops its Branches button and moves the layout toggle up — **behaviour change**
|
|
212
|
+
|
|
213
|
+
<!-- changeset: rail-polish -->
|
|
214
|
+
|
|
215
|
+
_First in 0.3.0._
|
|
216
|
+
|
|
217
|
+
**What changed.** The activity rail now runs Content, Comments and Media, then a divider, then the
|
|
218
|
+
layout toggle; Settings and Account stay at the bottom. Arrow keys move across the divider without
|
|
219
|
+
stopping on it. Content shows an unsaved dot while its panel is closed, and its name says how many
|
|
220
|
+
entries are unsaved ("Content, 3 unsaved"). The Branches button is gone: the branch pill's Switch
|
|
221
|
+
branch… opens the Branches drawer.
|
|
222
|
+
|
|
223
|
+
### 0.2.0
|
|
224
|
+
|
|
225
|
+
#### Removing a file from the media library hides it, and an admin can restore it — **breaking (assets.delete, AssetStore) / behaviour change; template first**
|
|
85
226
|
|
|
86
227
|
<!-- changeset: ef-g-media -->
|
|
87
228
|
|
|
@@ -110,7 +251,7 @@ the media library and restore a file, and uploading the same file again restores
|
|
|
110
251
|
- Files removed before this release lost their metadata. Uploading the same bytes again recreates
|
|
111
252
|
it, recorded under the re-uploader's name.
|
|
112
253
|
|
|
113
|
-
|
|
254
|
+
#### Stacked layout docks the content panel beside the form
|
|
114
255
|
|
|
115
256
|
<!-- changeset: ef-a-shell -->
|
|
116
257
|
|
|
@@ -118,7 +259,7 @@ _First in int.119._
|
|
|
118
259
|
|
|
119
260
|
**What changed.** In a wide window the content panel docks beside the form row in the stacked layout too, keeping the preview full width; in a narrow window it slides in over the form, unless the user prefers reduced motion. Both pane dividers share one width, and a branch banner has a line beneath it.
|
|
120
261
|
|
|
121
|
-
|
|
262
|
+
#### The editor opens the home page and names single-entry types by their type — **behaviour change**
|
|
122
263
|
|
|
123
264
|
<!-- changeset: ef-b-identity -->
|
|
124
265
|
|
|
@@ -126,7 +267,7 @@ _First in int.119._
|
|
|
126
267
|
|
|
127
268
|
**What changed.** With no entry in the URL, the editor opens the entry routed at `/`, else the first with a preview. An entry type limited to one entry (`maxItems: 1`) with a label is named by that label, though entry links and search still use its title. Content tree rows show the type on a second line, quick open shows type and route, "Rename…" is "Change URL…" ("Change slug…" for an entry with no page), and the "All content" crumb, the form header's title and the rail's site button are gone.
|
|
128
269
|
|
|
129
|
-
|
|
270
|
+
#### Compact drawer headers, jumpable comment headings and a steadier owner chip
|
|
130
271
|
|
|
131
272
|
<!-- changeset: ef-c-drawers -->
|
|
132
273
|
|
|
@@ -134,7 +275,7 @@ _First in int.119._
|
|
|
134
275
|
|
|
135
276
|
**What changed.** The Branches, Comments, Media and staged-changes drawers take the content panel's compact header with no subtitle. In the Comments drawer, each thread's heading is the one control that jumps to it. The Branches drawer no longer offers "New branch comment" or "+ New", since new branch comments start in the Comments drawer. A person's chip keeps its avatar and a long name on one line.
|
|
136
277
|
|
|
137
|
-
|
|
278
|
+
#### An object's Clear moves into its "…" menu, with an inline Undo
|
|
138
279
|
|
|
139
280
|
<!-- changeset: ef-d-clear -->
|
|
140
281
|
|
|
@@ -150,7 +291,7 @@ theirs. Their Undo, and the inline one, now survive edits to other items in an e
|
|
|
150
291
|
**To adopt.** A UI test that clicked an object's "Clear" button now opens the object's
|
|
151
292
|
"Actions for …" menu and chooses the "Clear" item, then finds "Undo clear" in the label row instead of a toast.
|
|
152
293
|
|
|
153
|
-
|
|
294
|
+
#### The top bar shows one unsaved mark and a status only when it matters — **behaviour change**
|
|
154
295
|
|
|
155
296
|
<!-- changeset: ef-f-topbar -->
|
|
156
297
|
|
|
@@ -158,7 +299,7 @@ _First in int.119._
|
|
|
158
299
|
|
|
159
300
|
**What changed.** The branch pill's unsaved count is the same dot as the entry's, with a number, in the brand colour the content tree also uses. "Unsaved · kept on this device" moved into Save's tooltip and description; the bar shows it only as a warning when drafts could not be stored. The pill drops the default "Editing" status and shows In review, Approved, Archived or Protected. The "Read-only" chip no longer repeats a branch-wide lock the banner already explains; it stays for an entry read-only for its own reason.
|
|
160
301
|
|
|
161
|
-
|
|
302
|
+
#### Previews can show the site header and footer, and the preview stays put between entries
|
|
162
303
|
|
|
163
304
|
<!-- changeset: ef-e-preview -->
|
|
164
305
|
|
|
@@ -178,15 +319,17 @@ export default createPreviewPage({
|
|
|
178
319
|
|
|
179
320
|
A preview page built on `useCanopyPreview` alone can pass `siteChrome: true` when it renders the header and footer for `?chrome=1`.
|
|
180
321
|
|
|
181
|
-
|
|
322
|
+
#### Media-library thumbnails are stored at upload and cached by the browser — **breaking (AssetStore.presignPublicObjectRead) / behaviour change**
|
|
182
323
|
|
|
183
324
|
<!-- changeset: editor-thumbnails-cached -->
|
|
184
325
|
|
|
185
326
|
_First in int.121._
|
|
186
327
|
|
|
187
|
-
**What changed.** Finalizing a raster upload also stores the three widths the editor shows it at (`assets/t/w=80`, `w=160`, `w=320`), so the media library's first view reads stored objects instead of transforming in the request. Uploading a file that already exists stores any of those widths it lacks. Animated images are skipped
|
|
328
|
+
**What changed.** Finalizing a raster upload also stores the three widths the editor shows it at (`assets/t/w=80`, `w=160`, `w=320`), so the media library's first view reads stored objects instead of transforming in the request. Uploading a file that already exists stores any of those widths it lacks. Animated images are skipped; their first view transforms them as before. This adds roughly 0.1 s to a typical photo's upload; a failure is logged and never fails the upload. On S3, the authenticated asset route's redirect to a presigned URL is now `private, max-age` until the end of the hour rather than `no-store`, and the URL stays the same for that hour, so reopening the media library fetches no thumbnails. A cached redirect can outlive a sign-out by at most that hour; it points only at a public-prefix object under an unguessable key. A streamed object stored without a `Cache-Control` is now sent as `private, max-age=31536000, immutable`, since every public-prefix key is content-addressed.
|
|
188
329
|
|
|
189
|
-
|
|
330
|
+
**To adopt.** Only a custom `AssetStore` that implements `presignPublicObjectRead` changes: it returns `PresignedRead` (`{ url, maxAgeSeconds }`, from `canopycms/server`) or `null`, instead of a URL string. `maxAgeSeconds` is how long a browser may reuse that URL; return `0` to keep the old `no-store` behaviour.
|
|
331
|
+
|
|
332
|
+
#### Image fields are bordered cards, and Crop explains itself and works without `aspect`
|
|
190
333
|
|
|
191
334
|
<!-- changeset: image-field-cards -->
|
|
192
335
|
|
|
@@ -196,7 +339,7 @@ _First in int.121._
|
|
|
196
339
|
|
|
197
340
|
**To adopt.** Nothing. `canopycms/client` now imports `react-image-crop`'s stylesheet through the editor theme, so a bundler that handles the Mantine stylesheets handles it too.
|
|
198
341
|
|
|
199
|
-
|
|
342
|
+
#### A locked branch shows a lock where a row's "…" menu would be
|
|
200
343
|
|
|
201
344
|
<!-- changeset: locked-row-lock -->
|
|
202
345
|
|
|
@@ -204,7 +347,7 @@ _First in int.121._
|
|
|
204
347
|
|
|
205
348
|
**What changed.** On a protected, in-review or approved branch the content tree no longer drops a row's "…" menu without a trace. Each row that would have had a menu shows a lock of the same size, and its tooltip gives the branch's reason ("This branch is in review. Withdraw it to make changes."), on hover, keyboard focus and touch. An entry a path rule locks keeps its own lock beside its title and gets none in the menu slot.
|
|
206
349
|
|
|
207
|
-
|
|
350
|
+
#### Links clicked in the preview open their entry instead of leaving the editor — **behaviour change**
|
|
208
351
|
|
|
209
352
|
<!-- changeset: preview-links-stay-in-editor -->
|
|
210
353
|
|
|
@@ -212,9 +355,29 @@ _First in int.121._
|
|
|
212
355
|
|
|
213
356
|
**What changed.** A plain click on a link in the editor's preview no longer navigates the frame off its preview route to a public page, which could refuse to be framed. A link to another page of the site opens that page's entry in the editor, keeping the draft of the one left, and focus follows into its page. A page no entry has, such as a listing, opens in a new tab, and a note naming it says so; a link to another site opens in a new tab. Cmd/Ctrl/Shift/Alt and middle clicks, links with `download` or a `target` other than `_self`, links to the same page and `mailto:`/`tel:` links behave as they do outside the editor. A click that follows a link no longer also focuses the field it sits in, except while fields are highlighted, when a click on a marked link picks its field instead. The preview takes over links only once the editor has connected, so a public page embedded elsewhere keeps its links. Pages using `useCanopyPreview` or `withCanopyPreview` get this with no change.
|
|
214
357
|
|
|
215
|
-
|
|
358
|
+
#### The browser's Back and Forward move between entries in the editor — **behaviour change**
|
|
216
359
|
|
|
217
|
-
|
|
360
|
+
<!-- changeset: editor-back-forward-entries -->
|
|
361
|
+
|
|
362
|
+
_First in 0.2.0._
|
|
363
|
+
|
|
364
|
+
**What changed.** Opening an entry in the editor adds a browser history entry, whether it is opened from the content panel, quick open, a comment, a preview link or a new entry's creation, and so does switching branch. Back and Forward then open the entry their URL names, without reloading the page; the preview follows, focus moves to the entry's menu in the top bar, and drafts are kept, as on any switch. Choosing the open entry again adds nothing, and the editor's own corrections, such as the home page it opens at load or the URL it fixes after a rename or delete, replace the URL instead. An entry since deleted or renamed opens the home page, with a note saying so. A Back onto another branch switches to it, asking first when there are unsaved changes; staying, or a branch no longer listed, returns to the entry the Back left.
|
|
365
|
+
|
|
366
|
+
#### A locked branch's row lock shows on the hovered, focused or selected row
|
|
367
|
+
|
|
368
|
+
<!-- changeset: row-lock-on-hover -->
|
|
369
|
+
|
|
370
|
+
_First in 0.2.0._
|
|
371
|
+
|
|
372
|
+
**What changed.** The lock in a content-tree row's menu slot was drawn on every row, repeating the branch pill and banner. It now appears on the row under the pointer, the focused row, the row with focus inside it, and the selected row, so a touch user sees the row they tapped. The slot stays reserved so rows do not shift, and the lock stays in the tab order and the accessibility tree on every row.
|
|
373
|
+
|
|
374
|
+
#### The dev content watcher waits for a save to finish before comparing
|
|
375
|
+
|
|
376
|
+
<!-- changeset: dev-watcher-waits-for-writes -->
|
|
377
|
+
|
|
378
|
+
_First in 0.2.0._
|
|
379
|
+
|
|
380
|
+
**What changed.** In `dev` mode, the watcher that warns when working-tree content has diverged from the served branch clone now acts on a new or changed file only once its size has held still for 100 ms. A save that truncates and then writes could reach the watcher as one event between the two steps. The check then read a half-written file and warned of a divergence that nothing later retracted. Now any warning about a half-finished save is retracted once the save completes.
|
|
218
381
|
|
|
219
382
|
### 0.1.0
|
|
220
383
|
|
|
@@ -267,7 +430,7 @@ URL.
|
|
|
267
430
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
268
431
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
269
432
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
270
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
433
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#live-preview)).
|
|
271
434
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
272
435
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
273
436
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -282,7 +445,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
282
445
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
283
446
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
284
447
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
285
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
448
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#live-preview).
|
|
286
449
|
|
|
287
450
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
288
451
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -364,7 +527,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
364
527
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
365
528
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
366
529
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
367
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
530
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#ai-content-configuration).
|
|
368
531
|
|
|
369
532
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
370
533
|
|
|
@@ -386,7 +549,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
386
549
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
387
550
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
388
551
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
389
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
552
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#mdx-content-cannot-run-code).
|
|
390
553
|
|
|
391
554
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
392
555
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -523,7 +686,7 @@ a format check.
|
|
|
523
686
|
|
|
524
687
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
525
688
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
526
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
689
|
+
([reference](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#definecanopyconfig-options)).
|
|
527
690
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
528
691
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
529
692
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -547,7 +710,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
547
710
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
548
711
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
549
712
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
550
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
713
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
551
714
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
552
715
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
553
716
|
|
|
@@ -585,7 +748,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
585
748
|
new stack needs no steps.
|
|
586
749
|
|
|
587
750
|
**What changed.** (int.109) Detailed in
|
|
588
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
751
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
589
752
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
590
753
|
refusing clients without TLS or IAM, replacing the worker's
|
|
591
754
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -639,10 +802,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
639
802
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
640
803
|
unchanged.
|
|
641
804
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
642
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
805
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#worker-down-alarm).
|
|
643
806
|
|
|
644
807
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
645
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
808
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
646
809
|
`alarmTopic`.
|
|
647
810
|
|
|
648
811
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -653,7 +816,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
653
816
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
654
817
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
655
818
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
656
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
819
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance).
|
|
657
820
|
|
|
658
821
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
659
822
|
not Template first and the worker contract stays at 1.
|
|
@@ -719,7 +882,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
719
882
|
|
|
720
883
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
721
884
|
mirror, so the root volume needs room for two
|
|
722
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
885
|
+
([details](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance)).
|
|
723
886
|
|
|
724
887
|
#### The worker follows a rebased or deleted GitHub branch
|
|
725
888
|
|
|
@@ -741,7 +904,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
741
904
|
bundle-only roll is safe.
|
|
742
905
|
|
|
743
906
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
744
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
907
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
745
908
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
746
909
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
747
910
|
|
|
@@ -758,8 +921,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
758
921
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
759
922
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
760
923
|
takes `worker/`'s three units and `gateway.env.example`
|
|
761
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
762
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
924
|
+
([steps](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
925
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
763
926
|
|
|
764
927
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
765
928
|
|
|
@@ -770,7 +933,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
770
933
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
771
934
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
772
935
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
773
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
936
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
774
937
|
|
|
775
938
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
776
939
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -946,7 +1109,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
946
1109
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
947
1110
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
948
1111
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
949
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1112
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#ai-content-configuration).
|
|
950
1113
|
|
|
951
1114
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
952
1115
|
change its link.
|
|
@@ -1021,7 +1184,7 @@ _First in int.115._
|
|
|
1021
1184
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1022
1185
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1023
1186
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1024
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1187
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1025
1188
|
unpublishing.
|
|
1026
1189
|
|
|
1027
1190
|
#### The editor calls the content drawer "All content"
|
|
@@ -1333,7 +1496,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1333
1496
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1334
1497
|
|
|
1335
1498
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1336
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
1499
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#stamping-a-publication-date).
|
|
1337
1500
|
|
|
1338
1501
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1339
1502
|
|
|
@@ -1380,7 +1543,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
1380
1543
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
1381
1544
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
1382
1545
|
no longer exported from `canopycms/client`. See
|
|
1383
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
1546
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#editor-customization).
|
|
1384
1547
|
|
|
1385
1548
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
1386
1549
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -1491,7 +1654,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
1491
1654
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
1492
1655
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
1493
1656
|
own pages, mount the hook as in
|
|
1494
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
1657
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
1495
1658
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
1496
1659
|
|
|
1497
1660
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -1532,12 +1695,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
1532
1695
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
1533
1696
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
1534
1697
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
1535
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
1698
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
1536
1699
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
1537
1700
|
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
|
|
1538
1701
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
1539
1702
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
1540
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
1703
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#security-model)).
|
|
1541
1704
|
|
|
1542
1705
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
1543
1706
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -1549,7 +1712,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
1549
1712
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
1550
1713
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
1551
1714
|
anyone holding an App's key can mint a token for any of its installations
|
|
1552
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
1715
|
+
([why](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
1553
1716
|
|
|
1554
1717
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
1555
1718
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -1562,7 +1725,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1562
1725
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
1563
1726
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
1564
1727
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
1565
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1728
|
+
([details](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
1566
1729
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
1567
1730
|
of the three is refused at synth, and so is an App alongside a token.
|
|
1568
1731
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -1573,7 +1736,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1573
1736
|
|
|
1574
1737
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
1575
1738
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
1576
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
1739
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
1577
1740
|
|
|
1578
1741
|
```bash
|
|
1579
1742
|
canopycms init-github-app create -- \
|
|
@@ -1621,7 +1784,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
1621
1784
|
|
|
1622
1785
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
1623
1786
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
1624
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
1787
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rotating-a-secret).
|
|
1625
1788
|
|
|
1626
1789
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
1627
1790
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -1675,12 +1838,12 @@ also check the bucket policy for its grant.
|
|
|
1675
1838
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
1676
1839
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
1677
1840
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
1678
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
1841
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#dual-build-support)).
|
|
1679
1842
|
|
|
1680
1843
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
1681
1844
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
1682
1845
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
1683
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
1846
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
1684
1847
|
|
|
1685
1848
|
**To adopt.**
|
|
1686
1849
|
|
|
@@ -1709,7 +1872,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
1709
1872
|
|
|
1710
1873
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
1711
1874
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
1712
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1875
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#media-configuration) for the
|
|
1713
1876
|
CloudFront behavior it expects.
|
|
1714
1877
|
|
|
1715
1878
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -1734,7 +1897,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
1734
1897
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
1735
1898
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
1736
1899
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
1737
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
1900
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
1738
1901
|
|
|
1739
1902
|
**To adopt.** Optional:
|
|
1740
1903
|
|
|
@@ -1844,7 +2007,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
1844
2007
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
1845
2008
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
1846
2009
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
1847
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2010
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#security-model)).
|
|
1848
2011
|
|
|
1849
2012
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
1850
2013
|
|
|
@@ -1943,7 +2106,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
1943
2106
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
1944
2107
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
1945
2108
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
1946
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2109
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#media-configuration)). Two traps:
|
|
1947
2110
|
|
|
1948
2111
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
1949
2112
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2102,7 +2265,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2102
2265
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2103
2266
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2104
2267
|
`createNextCanopyContext`'s result. See
|
|
2105
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2268
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2106
2269
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2107
2270
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2108
2271
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2159,7 +2322,7 @@ underscore-prefixed files are skipped.
|
|
|
2159
2322
|
|
|
2160
2323
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2161
2324
|
`defaultPathAccess: { read: 'allow' }`
|
|
2162
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2325
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#public-read-on-server-deployments)).
|
|
2163
2326
|
|
|
2164
2327
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2165
2328
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2212,7 +2375,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2212
2375
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2213
2376
|
gives one template's value type) requires exactly
|
|
2214
2377
|
one component per block template name when written as an object literal. See
|
|
2215
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2378
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#block-component-registries) and
|
|
2216
2379
|
`apps/example1/app/components/PostView.tsx`.
|
|
2217
2380
|
|
|
2218
2381
|
```ts
|
|
@@ -2234,7 +2397,7 @@ templates against the schema.
|
|
|
2234
2397
|
|
|
2235
2398
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2236
2399
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2237
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2400
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2238
2401
|
identity helper for them.
|
|
2239
2402
|
|
|
2240
2403
|
```ts
|
|
@@ -2253,7 +2416,7 @@ field by composing from the same `const` field object.
|
|
|
2253
2416
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2254
2417
|
it, and listings do with
|
|
2255
2418
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2256
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2419
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#shared--referenced-blocks).
|
|
2257
2420
|
|
|
2258
2421
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2259
2422
|
|
|
@@ -2275,7 +2438,7 @@ Not retro-documented, apart from these:
|
|
|
2275
2438
|
|
|
2276
2439
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2277
2440
|
|
|
2278
|
-
**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/
|
|
2441
|
+
**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/18d436fe91546aabb30da8efa1397046b65681dc/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2279
2442
|
|
|
2280
2443
|
**To adopt.**
|
|
2281
2444
|
|