canopycms 0.1.0 → 0.2.0-int.119
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 +144 -41
- package/dist/api/assets.d.ts +27 -7
- package/dist/api/assets.js +98 -37
- package/dist/api/client.d.ts +5 -3
- package/dist/api/client.js +7 -3
- package/dist/api/index.d.ts +1 -1
- package/dist/assets/asset-prefixes.d.ts +4 -1
- package/dist/assets/asset-prefixes.js +3 -1
- package/dist/assets/finalize.js +14 -1
- package/dist/assets/keys.d.ts +4 -1
- package/dist/assets/keys.js +4 -1
- package/dist/assets/store-local.d.ts +18 -9
- package/dist/assets/store-local.js +58 -26
- package/dist/assets/store-s3.d.ts +19 -4
- package/dist/assets/store-s3.js +56 -13
- package/dist/assets/types.d.ts +26 -2
- package/dist/cli/cli.js +112 -34
- package/dist/editor/BranchManager.js +2 -1
- package/dist/editor/CommentsPanel.js +67 -29
- package/dist/editor/Editor.d.ts +3 -0
- package/dist/editor/Editor.js +58 -36
- package/dist/editor/EntryNavigator.d.ts +8 -1
- package/dist/editor/EntryNavigator.js +31 -16
- package/dist/editor/FormHeader.d.ts +2 -1
- package/dist/editor/FormHeader.js +9 -5
- package/dist/editor/FormRenderer.d.ts +7 -2
- package/dist/editor/FormRenderer.js +51 -16
- package/dist/editor/PreviewFrame.d.ts +11 -2
- package/dist/editor/PreviewFrame.js +20 -4
- package/dist/editor/PreviewPane.d.ts +15 -1
- package/dist/editor/PreviewPane.js +55 -8
- package/dist/editor/PreviewToolbarTools.d.ts +8 -0
- package/dist/editor/PreviewToolbarTools.js +9 -1
- package/dist/editor/branch-status.d.ts +6 -0
- package/dist/editor/branch-status.js +10 -0
- package/dist/editor/comments/BranchComments.d.ts +2 -4
- package/dist/editor/comments/BranchComments.js +7 -11
- package/dist/editor/comments/ThreadCarousel.d.ts +2 -8
- package/dist/editor/comments/ThreadCarousel.js +4 -49
- package/dist/editor/comments/ThreadReplyControls.js +5 -2
- package/dist/editor/components/BranchLockBanner.d.ts +2 -0
- package/dist/editor/components/BranchLockBanner.js +6 -2
- package/dist/editor/components/BranchPill.d.ts +5 -4
- package/dist/editor/components/BranchPill.js +6 -8
- package/dist/editor/components/BranchesDrawer.js +3 -3
- package/dist/editor/components/EditorHeader.d.ts +2 -6
- package/dist/editor/components/EditorHeader.js +29 -28
- package/dist/editor/components/EditorRail.d.ts +3 -4
- package/dist/editor/components/EditorRail.js +3 -4
- package/dist/editor/components/EntryBreadcrumb.d.ts +9 -10
- package/dist/editor/components/EntryBreadcrumb.js +8 -11
- package/dist/editor/components/QuickOpenPalette.d.ts +7 -1
- package/dist/editor/components/QuickOpenPalette.js +6 -1
- package/dist/editor/components/RenameEntryModal.d.ts +6 -1
- package/dist/editor/components/RenameEntryModal.js +20 -5
- package/dist/editor/components/SaveSplitButton.d.ts +3 -2
- package/dist/editor/components/SaveSplitButton.js +25 -12
- package/dist/editor/components/StagedChangesDrawer.d.ts +0 -1
- package/dist/editor/components/StagedChangesDrawer.js +5 -4
- package/dist/editor/components/UndoToastMessage.d.ts +6 -5
- package/dist/editor/components/UndoToastMessage.js +6 -4
- package/dist/editor/components/UnsavedMark.d.ts +9 -0
- package/dist/editor/components/UnsavedMark.js +20 -0
- package/dist/editor/components/UserBadge.js +13 -11
- package/dist/editor/copy.d.ts +4 -0
- package/dist/editor/copy.js +4 -0
- package/dist/editor/editor-utils.d.ts +49 -9
- package/dist/editor/editor-utils.js +117 -16
- package/dist/editor/entry-search.d.ts +4 -2
- package/dist/editor/entry-search.js +2 -3
- package/dist/editor/fields/FieldLabel.d.ts +1 -1
- package/dist/editor/fields/ObjectField.d.ts +13 -2
- package/dist/editor/fields/ObjectField.js +38 -9
- package/dist/editor/fields/entry-link/EntryLinkContext.d.ts +2 -0
- package/dist/editor/fields/entry-link/InsertEntryLink.js +3 -1
- package/dist/editor/group-manager/index.js +1 -1
- package/dist/editor/hooks/useEditorLayout.d.ts +4 -0
- package/dist/editor/hooks/useEditorLayout.js +5 -0
- package/dist/editor/hooks/useEntryManager.d.ts +2 -0
- package/dist/editor/hooks/useEntryManager.js +10 -8
- package/dist/editor/media/AssetCard.d.ts +6 -3
- package/dist/editor/media/AssetCard.js +20 -7
- package/dist/editor/media/AssetListRow.d.ts +9 -4
- package/dist/editor/media/AssetListRow.js +14 -7
- package/dist/editor/media/MediaLibrary.js +5 -4
- package/dist/editor/media/MediaLibraryBody.d.ts +1 -1
- package/dist/editor/media/MediaLibraryBody.js +65 -37
- package/dist/editor/media/useAssetLibrary.d.ts +6 -3
- package/dist/editor/media/useAssetLibrary.js +17 -10
- package/dist/editor/pane-header.d.ts +6 -0
- package/dist/editor/pane-header.js +6 -0
- package/dist/editor/permission-manager/index.js +1 -1
- package/dist/editor/preview-bridge.d.ts +16 -0
- package/dist/editor/preview-bridge.js +12 -3
- package/dist/editor/preview-path.d.ts +11 -4
- package/dist/editor/preview-path.js +62 -19
- package/dist/editor/shell/ActivityRail.d.ts +1 -3
- package/dist/editor/shell/ActivityRail.js +3 -3
- package/dist/editor/shell/EditorShell.d.ts +15 -0
- package/dist/editor/shell/EditorShell.js +17 -1
- package/dist/editor/shell/OverlayHeader.d.ts +19 -0
- package/dist/editor/shell/OverlayHeader.js +15 -0
- package/dist/editor/shell/PaneLayout.d.ts +6 -1
- package/dist/editor/shell/PaneLayout.js +68 -13
- package/dist/editor/shell/SidePanelHost.d.ts +8 -6
- package/dist/editor/shell/SidePanelHost.js +70 -33
- package/dist/editor/shell/TopBar.js +2 -1
- package/dist/editor/theme.js +2 -0
- package/dist/editor/undo-removal.d.ts +19 -10
- package/dist/editor/undo-removal.js +44 -16
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,9 @@ packages release together, at one version.
|
|
|
5
5
|
|
|
6
6
|
## This build
|
|
7
7
|
|
|
8
|
-
Version `0.
|
|
8
|
+
Version `0.2.0-int.119`, built from [`35953fb`](https://github.com/safeinsights/canopycms/tree/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a).
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
No earlier int is in this build's history, so read every Unreleased entry.
|
|
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/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/.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**
|
|
@@ -53,6 +53,109 @@ Nothing in this section is edited by hand: each entry is a `.changeset/` file, w
|
|
|
53
53
|
assembles here and labels with the first int that carries it, and a stable release moves the
|
|
54
54
|
entries under **Released**.
|
|
55
55
|
|
|
56
|
+
| int | Area | Change | Action |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| 119 | Assets | [Library removal hides the file; grant the asset-hidden/ prefix](#removing-a-file-from-the-media-library-hides-it-and-an-admin-can-restore-it--breaking-assetsdelete-assetstore--behaviour-change) | Upgrade both; grant asset-hidden |
|
|
59
|
+
| 119 | Editing | [Content panel docks when stacked; overlay slides; matched dividers](#stacked-layout-docks-the-content-panel-beside-the-form) | None |
|
|
60
|
+
| 119 | Editing | [Editor opens the home page; singletons named by type](#the-editor-opens-the-home-page-and-names-single-entry-types-by-their-type--behaviour-change) | None |
|
|
61
|
+
| 119 | Editing | [Drawers share the content panel's compact header](#compact-drawer-headers-jumpable-comment-headings-and-a-steadier-owner-chip) | None |
|
|
62
|
+
| 119 | Editing | [Object Clear in a "…" menu; Undo stays inline](#an-objects-clear-moves-into-its--menu-with-an-inline-undo) | Editor UI tests |
|
|
63
|
+
| 119 | Editing | [Top bar: one unsaved dot, no "Editing" label](#the-top-bar-shows-one-unsaved-mark-and-a-status-only-when-it-matters--behaviour-change) | None |
|
|
64
|
+
| 119 | Preview | [createPreviewPage takes a layout for the site header and footer](#previews-can-show-the-site-header-and-footer-and-the-preview-stays-put-between-entries) | Optional |
|
|
65
|
+
|
|
66
|
+
### Removing a file from the media library hides it, and an admin can restore it — **breaking (assets.delete, AssetStore) / behaviour change**
|
|
67
|
+
|
|
68
|
+
<!-- changeset: ef-g-media -->
|
|
69
|
+
|
|
70
|
+
_First in int.119._
|
|
71
|
+
|
|
72
|
+
**What changed.** "Remove from library" no longer deletes the file's metadata, so every image
|
|
73
|
+
size and crop keeps working wherever the file is used, including `materialize-assets`. It writes
|
|
74
|
+
a marker under the new `asset-hidden/` prefix instead. Admins can turn on "Show removed files" in
|
|
75
|
+
the media library and restore a file, and uploading the same file again restores it too.
|
|
76
|
+
|
|
77
|
+
**To adopt.**
|
|
78
|
+
|
|
79
|
+
- Upgrade `canopycms` and `canopycms-cdk` together.
|
|
80
|
+
- `assets.delete` and `DELETE /assets` are removed (`DELETE /assets` answers 410); use
|
|
81
|
+
`assets.hide` / `POST /assets/hide` and `assets.restore` / `POST /assets/restore`.
|
|
82
|
+
- A custom `AssetStore` drops `deleteMeta` and must implement `hideAsset` and `unhideAsset`; a
|
|
83
|
+
custom `AssetPrefixes` must set `hidden`.
|
|
84
|
+
- `AssetSupport.grantUploadAccess()` and `CanopyCmsService`'s `assetBucket` grant `s3:PutObject`
|
|
85
|
+
and `s3:DeleteObject` on `asset-hidden/*` and no longer grant delete on `asset-meta/*`. If you
|
|
86
|
+
write the CMS role's bucket policy yourself, do the same (no `s3:GetObject` is needed), and if
|
|
87
|
+
it scopes `s3:ListBucket` by prefix, include `asset-hidden/`.
|
|
88
|
+
- Files removed before this release lost their metadata. Uploading the same bytes again recreates
|
|
89
|
+
it, recorded under the re-uploader's name.
|
|
90
|
+
|
|
91
|
+
### Stacked layout docks the content panel beside the form
|
|
92
|
+
|
|
93
|
+
<!-- changeset: ef-a-shell -->
|
|
94
|
+
|
|
95
|
+
_First in int.119._
|
|
96
|
+
|
|
97
|
+
**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.
|
|
98
|
+
|
|
99
|
+
### The editor opens the home page and names single-entry types by their type — **behaviour change**
|
|
100
|
+
|
|
101
|
+
<!-- changeset: ef-b-identity -->
|
|
102
|
+
|
|
103
|
+
_First in int.119._
|
|
104
|
+
|
|
105
|
+
**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.
|
|
106
|
+
|
|
107
|
+
### Compact drawer headers, jumpable comment headings and a steadier owner chip
|
|
108
|
+
|
|
109
|
+
<!-- changeset: ef-c-drawers -->
|
|
110
|
+
|
|
111
|
+
_First in int.119._
|
|
112
|
+
|
|
113
|
+
**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.
|
|
114
|
+
|
|
115
|
+
### An object's Clear moves into its "…" menu, with an inline Undo
|
|
116
|
+
|
|
117
|
+
<!-- changeset: ef-d-clear -->
|
|
118
|
+
|
|
119
|
+
_First in int.119._
|
|
120
|
+
|
|
121
|
+
**What changed.** An optional object's Clear is now an item in a "…" menu on its label row, named
|
|
122
|
+
for the object ("Clear "SEO""). After a clear, the label row offers "Undo clear" in the menu's
|
|
123
|
+
place, with focus on it, until it can no longer put the object back where it was (the object was
|
|
124
|
+
filled in again, or the item holding it moved or went), another entry or branch opens, or the entry
|
|
125
|
+
is saved or its draft discarded. It has no timer, and Clear no longer raises a toast; list item and block removals keep
|
|
126
|
+
theirs. Their Undo, and the inline one, now survive edits to other items in an enclosing list.
|
|
127
|
+
|
|
128
|
+
**To adopt.** A UI test that clicked an object's "Clear" button now opens the object's
|
|
129
|
+
"Actions for …" menu and chooses the "Clear" item, then finds "Undo clear" in the label row instead of a toast.
|
|
130
|
+
|
|
131
|
+
### The top bar shows one unsaved mark and a status only when it matters — **behaviour change**
|
|
132
|
+
|
|
133
|
+
<!-- changeset: ef-f-topbar -->
|
|
134
|
+
|
|
135
|
+
_First in int.119._
|
|
136
|
+
|
|
137
|
+
**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.
|
|
138
|
+
|
|
139
|
+
### Previews can show the site header and footer, and the preview stays put between entries
|
|
140
|
+
|
|
141
|
+
<!-- changeset: ef-e-preview -->
|
|
142
|
+
|
|
143
|
+
_First in int.119._
|
|
144
|
+
|
|
145
|
+
**What changed.** `createPreviewPage` takes an optional `layout`, a server component that wraps every view and receives `{ children, chrome }`. Given one, the preview toolbar offers a "Show site header and footer" toggle, remembered per device, which adds `?chrome=1` to the preview's URL and sets `chrome`. Without the toggle on, `chrome` is `false`. A page that never connects with them, such as one whose layout throws, is shown without them, and the toggle says so. Switching entries keeps the preview pane and its toolbar in place: the last page stays, dimmed, until the next entry's data arrives.
|
|
146
|
+
|
|
147
|
+
**To adopt.** Pass the component your public pages use for their header and footer:
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
export default createPreviewPage({
|
|
151
|
+
layout: ({ children, chrome }) =>
|
|
152
|
+
chrome ? <SiteChrome>{children}</SiteChrome> : <main>{children}</main>,
|
|
153
|
+
views: { post: PostPreview },
|
|
154
|
+
})
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
A preview page built on `useCanopyPreview` alone can pass `siteChrome: true` when it renders the header and footer for `?chrome=1`.
|
|
158
|
+
|
|
56
159
|
---
|
|
57
160
|
|
|
58
161
|
## Released
|
|
@@ -108,7 +211,7 @@ URL.
|
|
|
108
211
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
109
212
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
110
213
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
111
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
214
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#live-preview)).
|
|
112
215
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
113
216
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
114
217
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -123,7 +226,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
123
226
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
124
227
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
125
228
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
126
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
229
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#live-preview).
|
|
127
230
|
|
|
128
231
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
129
232
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -205,7 +308,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
205
308
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
206
309
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
207
310
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
208
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
311
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#ai-content-configuration).
|
|
209
312
|
|
|
210
313
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
211
314
|
|
|
@@ -227,7 +330,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
227
330
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
228
331
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
229
332
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
230
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
333
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#mdx-content-cannot-run-code).
|
|
231
334
|
|
|
232
335
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
233
336
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -364,7 +467,7 @@ a format check.
|
|
|
364
467
|
|
|
365
468
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
366
469
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
367
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
470
|
+
([reference](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#definecanopyconfig-options)).
|
|
368
471
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
369
472
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
370
473
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -388,7 +491,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
388
491
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
389
492
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
390
493
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
391
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
494
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
392
495
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
393
496
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
394
497
|
|
|
@@ -426,7 +529,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
426
529
|
new stack needs no steps.
|
|
427
530
|
|
|
428
531
|
**What changed.** (int.109) Detailed in
|
|
429
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
532
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
430
533
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
431
534
|
refusing clients without TLS or IAM, replacing the worker's
|
|
432
535
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -480,10 +583,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
480
583
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
481
584
|
unchanged.
|
|
482
585
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
483
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
586
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#worker-down-alarm).
|
|
484
587
|
|
|
485
588
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
486
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
589
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
487
590
|
`alarmTopic`.
|
|
488
591
|
|
|
489
592
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -494,7 +597,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
494
597
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
495
598
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
496
599
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
497
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
600
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#the-worker-instance).
|
|
498
601
|
|
|
499
602
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
500
603
|
not Template first and the worker contract stays at 1.
|
|
@@ -560,7 +663,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
560
663
|
|
|
561
664
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
562
665
|
mirror, so the root volume needs room for two
|
|
563
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
666
|
+
([details](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#the-worker-instance)).
|
|
564
667
|
|
|
565
668
|
#### The worker follows a rebased or deleted GitHub branch
|
|
566
669
|
|
|
@@ -582,7 +685,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
582
685
|
bundle-only roll is safe.
|
|
583
686
|
|
|
584
687
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
585
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
688
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
586
689
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
587
690
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
588
691
|
|
|
@@ -599,8 +702,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
599
702
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
600
703
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
601
704
|
takes `worker/`'s three units and `gateway.env.example`
|
|
602
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
603
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
705
|
+
([steps](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
706
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
604
707
|
|
|
605
708
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
606
709
|
|
|
@@ -611,7 +714,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
611
714
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
612
715
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
613
716
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
614
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
717
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
615
718
|
|
|
616
719
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
617
720
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -787,7 +890,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
787
890
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
788
891
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
789
892
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
790
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
893
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#ai-content-configuration).
|
|
791
894
|
|
|
792
895
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
793
896
|
change its link.
|
|
@@ -862,7 +965,7 @@ _First in int.115._
|
|
|
862
965
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
863
966
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
864
967
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
865
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
968
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
866
969
|
unpublishing.
|
|
867
970
|
|
|
868
971
|
#### The editor calls the content drawer "All content"
|
|
@@ -1174,7 +1277,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1174
1277
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1175
1278
|
|
|
1176
1279
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1177
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
1280
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#stamping-a-publication-date).
|
|
1178
1281
|
|
|
1179
1282
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1180
1283
|
|
|
@@ -1221,7 +1324,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
1221
1324
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
1222
1325
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
1223
1326
|
no longer exported from `canopycms/client`. See
|
|
1224
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
1327
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#editor-customization).
|
|
1225
1328
|
|
|
1226
1329
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
1227
1330
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -1332,7 +1435,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
1332
1435
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
1333
1436
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
1334
1437
|
own pages, mount the hook as in
|
|
1335
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
1438
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
1336
1439
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
1337
1440
|
|
|
1338
1441
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -1373,12 +1476,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
1373
1476
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
1374
1477
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
1375
1478
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
1376
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
1479
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
1377
1480
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
1378
1481
|
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
|
|
1379
1482
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
1380
1483
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
1381
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
1484
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#security-model)).
|
|
1382
1485
|
|
|
1383
1486
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
1384
1487
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -1390,7 +1493,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
1390
1493
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
1391
1494
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
1392
1495
|
anyone holding an App's key can mint a token for any of its installations
|
|
1393
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
1496
|
+
([why](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
1394
1497
|
|
|
1395
1498
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
1396
1499
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -1403,7 +1506,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1403
1506
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
1404
1507
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
1405
1508
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
1406
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1509
|
+
([details](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
1407
1510
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
1408
1511
|
of the three is refused at synth, and so is an App alongside a token.
|
|
1409
1512
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -1414,7 +1517,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1414
1517
|
|
|
1415
1518
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
1416
1519
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
1417
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
1520
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
1418
1521
|
|
|
1419
1522
|
```bash
|
|
1420
1523
|
canopycms init-github-app create -- \
|
|
@@ -1462,7 +1565,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
1462
1565
|
|
|
1463
1566
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
1464
1567
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
1465
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
1568
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#rotating-a-secret).
|
|
1466
1569
|
|
|
1467
1570
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
1468
1571
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -1516,12 +1619,12 @@ also check the bucket policy for its grant.
|
|
|
1516
1619
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
1517
1620
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
1518
1621
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
1519
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
1622
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#dual-build-support)).
|
|
1520
1623
|
|
|
1521
1624
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
1522
1625
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
1523
1626
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
1524
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
1627
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
1525
1628
|
|
|
1526
1629
|
**To adopt.**
|
|
1527
1630
|
|
|
@@ -1550,7 +1653,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
1550
1653
|
|
|
1551
1654
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
1552
1655
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
1553
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1656
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#media-configuration) for the
|
|
1554
1657
|
CloudFront behavior it expects.
|
|
1555
1658
|
|
|
1556
1659
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -1575,7 +1678,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
1575
1678
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
1576
1679
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
1577
1680
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
1578
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
1681
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
1579
1682
|
|
|
1580
1683
|
**To adopt.** Optional:
|
|
1581
1684
|
|
|
@@ -1685,7 +1788,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
1685
1788
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
1686
1789
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
1687
1790
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
1688
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
1791
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/docs/deploying-to-aws.md#security-model)).
|
|
1689
1792
|
|
|
1690
1793
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
1691
1794
|
|
|
@@ -1784,7 +1887,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
1784
1887
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
1785
1888
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
1786
1889
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
1787
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1890
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#media-configuration)). Two traps:
|
|
1788
1891
|
|
|
1789
1892
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
1790
1893
|
a nested route prefix and emits zero params, building green.
|
|
@@ -1943,7 +2046,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
1943
2046
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
1944
2047
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
1945
2048
|
`createNextCanopyContext`'s result. See
|
|
1946
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2049
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
1947
2050
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
1948
2051
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
1949
2052
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2000,7 +2103,7 @@ underscore-prefixed files are skipped.
|
|
|
2000
2103
|
|
|
2001
2104
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2002
2105
|
`defaultPathAccess: { read: 'allow' }`
|
|
2003
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2106
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#public-read-on-server-deployments)).
|
|
2004
2107
|
|
|
2005
2108
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2006
2109
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2053,7 +2156,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2053
2156
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2054
2157
|
gives one template's value type) requires exactly
|
|
2055
2158
|
one component per block template name when written as an object literal. See
|
|
2056
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2159
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#block-component-registries) and
|
|
2057
2160
|
`apps/example1/app/components/PostView.tsx`.
|
|
2058
2161
|
|
|
2059
2162
|
```ts
|
|
@@ -2075,7 +2178,7 @@ templates against the schema.
|
|
|
2075
2178
|
|
|
2076
2179
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2077
2180
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2078
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2181
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2079
2182
|
identity helper for them.
|
|
2080
2183
|
|
|
2081
2184
|
```ts
|
|
@@ -2094,7 +2197,7 @@ field by composing from the same `const` field object.
|
|
|
2094
2197
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2095
2198
|
it, and listings do with
|
|
2096
2199
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2097
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2200
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#shared--referenced-blocks).
|
|
2098
2201
|
|
|
2099
2202
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2100
2203
|
|
|
@@ -2116,7 +2219,7 @@ Not retro-documented, apart from these:
|
|
|
2116
2219
|
|
|
2117
2220
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2118
2221
|
|
|
2119
|
-
**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/
|
|
2222
|
+
**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/35953fbf6f9e0e0bb8181ed89c3ade8cd14db72a/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2120
2223
|
|
|
2121
2224
|
**To adopt.**
|
|
2122
2225
|
|
package/dist/api/assets.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ApiResponse } from './types.js';
|
|
3
3
|
import type { RouteDefinition } from '../http/router.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ListedAssetMeta, StagedUploadTarget } from '../assets/types.js';
|
|
5
5
|
/** An asset's persisted meta plus its computed, root-relative public URL. */
|
|
6
|
-
export type AssetRecord =
|
|
6
|
+
export type AssetRecord = ListedAssetMeta & {
|
|
7
7
|
src: string;
|
|
8
8
|
};
|
|
9
9
|
/** Response type for listing assets */
|
|
@@ -19,9 +19,9 @@ export type PresignAssetResponse = ApiResponse<{
|
|
|
19
19
|
export type FinalizeAssetResponse = ApiResponse<{
|
|
20
20
|
asset: AssetRecord;
|
|
21
21
|
}>;
|
|
22
|
-
/** Response type for
|
|
23
|
-
export type
|
|
24
|
-
|
|
22
|
+
/** Response type for removing a file from the library or restoring it: whether it is now hidden */
|
|
23
|
+
export type AssetVisibilityResponse = ApiResponse<{
|
|
24
|
+
hidden: boolean;
|
|
25
25
|
}>;
|
|
26
26
|
declare const presignAssetBodySchema: z.ZodObject<{
|
|
27
27
|
filename: z.ZodString;
|
|
@@ -48,6 +48,14 @@ declare const finalizeAssetBodySchema: z.ZodObject<{
|
|
|
48
48
|
stagingKey: string;
|
|
49
49
|
}>;
|
|
50
50
|
export type FinalizeAssetBody = z.infer<typeof finalizeAssetBodySchema>;
|
|
51
|
+
declare const assetKeyBodySchema: z.ZodObject<{
|
|
52
|
+
key: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
key: string;
|
|
55
|
+
}, {
|
|
56
|
+
key: string;
|
|
57
|
+
}>;
|
|
58
|
+
export type AssetKeyBody = z.infer<typeof assetKeyBodySchema>;
|
|
51
59
|
/**
|
|
52
60
|
* Exported routes for router registration and client codegen.
|
|
53
61
|
*/
|
|
@@ -79,20 +87,32 @@ export declare const ASSET_ROUTES: {
|
|
|
79
87
|
readonly list: import("./route-builder.js").RouteDefinition<z.ZodObject<{
|
|
80
88
|
cursor: z.ZodOptional<z.ZodString>;
|
|
81
89
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
/** Admin only: also list files removed from the library, each marked `hidden: true`. */
|
|
91
|
+
includeHidden: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
|
|
82
92
|
}, "strip", z.ZodTypeAny, {
|
|
83
93
|
cursor?: string | undefined;
|
|
84
94
|
limit?: number | undefined;
|
|
95
|
+
includeHidden?: "true" | "false" | undefined;
|
|
85
96
|
}, {
|
|
86
97
|
cursor?: string | undefined;
|
|
87
98
|
limit?: number | undefined;
|
|
99
|
+
includeHidden?: "true" | "false" | undefined;
|
|
88
100
|
}>, undefined, AssetsListResponse>;
|
|
89
|
-
readonly
|
|
101
|
+
readonly hide: import("./route-builder.js").RouteDefinition<undefined, z.ZodObject<{
|
|
102
|
+
key: z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
key: string;
|
|
105
|
+
}, {
|
|
106
|
+
key: string;
|
|
107
|
+
}>, AssetVisibilityResponse>;
|
|
108
|
+
readonly restore: import("./route-builder.js").RouteDefinition<undefined, z.ZodObject<{
|
|
90
109
|
key: z.ZodString;
|
|
91
110
|
}, "strip", z.ZodTypeAny, {
|
|
92
111
|
key: string;
|
|
93
112
|
}, {
|
|
94
113
|
key: string;
|
|
95
|
-
}>,
|
|
114
|
+
}>, AssetVisibilityResponse>;
|
|
115
|
+
readonly deleteGone: RouteDefinition;
|
|
96
116
|
};
|
|
97
117
|
/**
|
|
98
118
|
* GET /assets/raw/{key...} - see `rawAssetHandler` above for why this is
|