canopycms 0.9.0 → 0.11.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 +74 -48
- package/dist/api/admin.d.ts +11 -0
- package/dist/api/admin.js +2 -0
- package/dist/api/archived-branches.d.ts +70 -0
- package/dist/api/archived-branches.js +146 -0
- package/dist/api/branch-merge.js +16 -1
- package/dist/api/branch-status.d.ts +11 -0
- package/dist/api/branch-status.js +2 -0
- package/dist/api/branch-withdraw.js +1 -1
- package/dist/api/branch.js +46 -108
- package/dist/api/client.d.ts +25 -21
- package/dist/api/client.js +46 -38
- package/dist/branch-archive.d.ts +19 -0
- package/dist/branch-archive.js +27 -0
- package/dist/branch-delete.d.ts +45 -0
- package/dist/branch-delete.js +97 -0
- package/dist/branch-metadata-file.d.ts +3 -0
- package/dist/branch-metadata-file.js +1 -0
- package/dist/branch-metadata.d.ts +6 -1
- package/dist/branch-metadata.js +15 -2
- package/dist/cli/cli.js +2 -0
- package/dist/cli/generate-ai-content.js +1 -0
- package/dist/editor/BranchManager.d.ts +20 -0
- package/dist/editor/BranchManager.js +92 -26
- package/dist/editor/Editor.js +49 -25
- package/dist/editor/PreviewFrame.d.ts +8 -1
- package/dist/editor/PreviewFrame.js +15 -2
- package/dist/editor/PreviewPane.d.ts +7 -2
- package/dist/editor/PreviewPane.js +6 -5
- package/dist/editor/PreviewToolbarTools.d.ts +6 -0
- package/dist/editor/PreviewToolbarTools.js +6 -1
- package/dist/editor/admin/SystemHealthPanel.js +61 -6
- package/dist/editor/admin/useSystemHealth.d.ts +3 -0
- package/dist/editor/admin/useSystemHealth.js +59 -0
- package/dist/editor/branch-status.js +9 -0
- package/dist/editor/comments/CommentThreadsPopover.d.ts +2 -0
- package/dist/editor/comments/CommentThreadsPopover.js +9 -1
- package/dist/editor/comments/FieldWrapper.js +3 -1
- package/dist/editor/copy.d.ts +3 -0
- package/dist/editor/copy.js +3 -0
- package/dist/editor/hooks/useBranchManager.d.ts +5 -0
- package/dist/editor/hooks/useBranchManager.js +55 -4
- package/dist/editor/hooks/useBranchesData.d.ts +2 -0
- package/dist/editor/hooks/useBranchesData.js +3 -1
- package/dist/editor/hooks/useEditorLayout.d.ts +4 -0
- package/dist/editor/hooks/useEditorLayout.js +5 -0
- package/dist/editor/hooks/usePreviewFollow.d.ts +26 -0
- package/dist/editor/hooks/usePreviewFollow.js +54 -0
- package/dist/editor/preview-bridge.d.ts +25 -0
- package/dist/editor/preview-bridge.js +175 -0
- package/dist/preview.d.ts +2 -2
- package/dist/preview.js +1 -1
- package/dist/types.d.ts +33 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/archived-sweep.d.ts +23 -0
- package/dist/worker/archived-sweep.js +137 -0
- package/dist/worker/cms-worker.d.ts +6 -0
- package/dist/worker/cms-worker.js +7 -0
- package/dist/worker/git-sync.d.ts +4 -4
- package/dist/worker/git-sync.js +3 -0
- package/dist/worker/github-commits.d.ts +2 -2
- package/dist/worker/github-commits.js +5 -2
- package/dist/worker/github-gateway-wire.d.ts +2 -2
- package/dist/worker/rebase.js +6 -2
- package/dist/worker/task-runner.js +7 -4
- package/dist/worker/worker-context.d.ts +2 -0
- 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.11.0`, built from [`5c6c8f1`](https://github.com/safeinsights/canopycms/tree/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.
|
|
10
|
+
Its entries are [0.11.0](#0110), under **Released**.
|
|
11
11
|
|
|
12
12
|
If you upgraded from a build on another branch, compare the `<!-- changeset: … -->` slugs in your previous build's `CHANGELOG.md` (`npm pack canopycms@<old>` fetches it) with this one's: entries whose slug your old file lacks are new to you.
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ Each entry has up to three parts:
|
|
|
24
24
|
`node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
|
|
25
25
|
what is new since the previous int on the same branch, or on a stable release links its entries, and its links point at the commit the build
|
|
26
26
|
came from. The copy in the repository holds released history and the entries from before changesets;
|
|
27
|
-
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/
|
|
27
|
+
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/.changeset/README.md) until a stable release
|
|
28
28
|
moves it here.
|
|
29
29
|
|
|
30
30
|
**Find your starting point.** From a stable pin, start at the first version under **Released**
|
|
@@ -62,6 +62,32 @@ entries under **Released**.
|
|
|
62
62
|
|
|
63
63
|
## Released
|
|
64
64
|
|
|
65
|
+
### 0.11.0
|
|
66
|
+
|
|
67
|
+
#### The preview follows the form to the field you're on
|
|
68
|
+
|
|
69
|
+
<!-- changeset: preview-follows-form -->
|
|
70
|
+
|
|
71
|
+
_First in 0.11.0._
|
|
72
|
+
|
|
73
|
+
**What changed.** Focusing a field in the form, or opening its comments, scrolls the preview to the element the page marks for that field with `fieldProps`, else to the first mark inside it, else to its nearest marked ancestor, and outlines it briefly. Nothing moves when the element already shows as much as it can, focus stays in the form, focus coming back to the same field leaves the preview where you scrolled it, and reduced motion jumps instead of scrolling. It is on by default; the preview toolbar's "Scroll the preview to the field you're on" toggle turns it off, remembered per browser like the other preview controls. The editor sends a new `canopycms:preview:reveal` message, which a page accepts only from its editor, as it does the others.
|
|
74
|
+
|
|
75
|
+
**To adopt.** Nothing for a page on `useCanopyPreview` or `withCanopyPreview` once it runs this version of `canopycms/preview`. A page on an older version ignores the message, so the preview just doesn't follow. A page that wires the bridge's hooks itself adds `usePreviewReveal({ editorOrigin })` beside `usePreviewHighlight`.
|
|
76
|
+
|
|
77
|
+
**Now deletable.** Nothing.
|
|
78
|
+
|
|
79
|
+
### 0.10.0
|
|
80
|
+
|
|
81
|
+
#### Archived branches move out of the way, with optional retention
|
|
82
|
+
|
|
83
|
+
<!-- changeset: archived-branches-list -->
|
|
84
|
+
|
|
85
|
+
_First in 0.10.0._
|
|
86
|
+
|
|
87
|
+
**What changed.** The branch list shows live branches first, newest first, then a collapsed "Archived (n)" section, with a filter box past 10 branches. A pull request closed without merging shows a "PR closed" badge, and an admin can archive that branch without recording a merge (`POST /:branch/archive`). System health gains "Delete merged archived branches older than N days". The new `archivedBranchRetentionDays` prop on `CanopyCmsService` (`CANOPYCMS_ARCHIVED_BRANCH_RETENTION_DAYS` on the worker), off by default, has the worker delete merged branches' workspaces and comments that many days after archiving. Neither way touches a GitHub branch, a branch archived without merging, or one that may hold unpublished commits.
|
|
88
|
+
|
|
89
|
+
**To adopt.** Nothing is required. To turn retention on, set `archivedBranchRetentionDays` on `CanopyCmsService` to a whole number of days and deploy the stack.
|
|
90
|
+
|
|
65
91
|
### 0.9.0
|
|
66
92
|
|
|
67
93
|
#### A `date` field for a day with no time and no zone
|
|
@@ -72,7 +98,7 @@ _First in 0.9.0._
|
|
|
72
98
|
|
|
73
99
|
**What changed.** A new scalar field type, `date`, holds a calendar day as a `YYYY-MM-DD` string, edited with a day picker. `datetime` stores an instant, so a day picked in one zone can read as the day before in another; a `date` is the same day everywhere. A save and a production build refuse a value that is not a real day, such as `2026-02-30` or `2026-5-1`; YAML rolls an unquoted `2026-02-30` forward first, so quote hand-written days. A hand-written unquoted `2024-05-01` in md or mdx frontmatter reads as that day in every zone, and survives a save on its own line. `list: true` is refused on a `date`; use an object list with a `date` field inside, which `itemTitleField` may name. `stampOnPublish` stays on `datetime`, and `datetime` values and checks are unchanged. Editor field errors now meet 4.5:1 contrast.
|
|
74
100
|
|
|
75
|
-
**To adopt.** Change `type: 'string'` to `type: 'date'` on a field that holds `YYYY-MM-DD`: `TypeFromEntrySchema` still gives `string`, and every `YYYY-MM-DD` value stays as it is. A production build lists any entry whose value is not a real day, such as `2026-5-1`; fix those by hand. A custom field type that was named `date` keeps its `customRenderers` entry but is now checked as a `date`, so rename it if its values differ. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
101
|
+
**To adopt.** Change `type: 'string'` to `type: 'date'` on a field that holds `YYYY-MM-DD`: `TypeFromEntrySchema` still gives `string`, and every `YYYY-MM-DD` value stays as it is. A production build lists any entry whose value is not a real day, such as `2026-5-1`; fix those by hand. A custom field type that was named `date` keeps its `customRenderers` entry but is now checked as a `date`, so rename it if its values differ. See [Field Types](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/.changeset/README.md#field-types).
|
|
76
102
|
|
|
77
103
|
**Now deletable.** A `string` field with a hand-written `YYYY-MM-DD` format check, and site code that reads a `datetime` back into a day.
|
|
78
104
|
|
|
@@ -348,7 +374,7 @@ _First in 0.7.0._
|
|
|
348
374
|
|
|
349
375
|
**What changed.** The pull request a submit opens now lists the branch's unresolved editor comment threads: where each one is, the first line of its first comment (80 characters at most) and a link to it in the editor. Once every thread is resolved, it says so. The list is updated whenever a comment is added, replied to or resolved, as well as on submit. Comment excerpts are visible to everyone who can read the pull request, which on a public repository means everyone. Open threads do not block the merge or keep the pull request in draft. A pull request opened before this release shows no list until its branch is next submitted.
|
|
350
376
|
|
|
351
|
-
**To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
377
|
+
**To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
|
|
352
378
|
|
|
353
379
|
#### Pull request bodies link back to the editor
|
|
354
380
|
|
|
@@ -358,7 +384,7 @@ _First in 0.7.0._
|
|
|
358
384
|
|
|
359
385
|
**What changed.** The pull request a submit opens links to the branch in the editor, and each changed entry to that entry. A notice tells reviewers that comments on the pull request do not reach the editor, so the author will not see them. The links use the editor's URL from the submit, accepted only when its host is the one the request was addressed to (`X-Forwarded-Host`, else `Host`), which holds behind `canopycms-cdk`'s CloudFront distribution as it stands.
|
|
360
386
|
|
|
361
|
-
**To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/
|
|
387
|
+
**To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#definecanopyconfig-options).
|
|
362
388
|
|
|
363
389
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
364
390
|
|
|
@@ -444,7 +470,7 @@ _First in 0.6.0._
|
|
|
444
470
|
|
|
445
471
|
**What changed.** `CanopyCmsService` takes `clerkOrganizationsAsGroups` (default `true`, unchanged), which the worker honours; in a deployment it, not the plugin's `useOrganizationsAsGroups`, decides the groups. When Clerk refuses the organization list with a 403 (Organizations disabled), the refresh now writes users with no groups and logs a warning, instead of failing whole; any other failure still keeps the last snapshot. Memberships are fetched instance-wide rather than per user. The scaffolds write `false` explicitly: `useOrganizationsAsGroups` in `canopycms init`'s `canopy.ts`, and `clerkOrganizationsAsGroups` in `canopycms init-deploy aws`'s CDK stack.
|
|
446
472
|
|
|
447
|
-
**To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/
|
|
473
|
+
**To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md).
|
|
448
474
|
|
|
449
475
|
### 0.5.0
|
|
450
476
|
|
|
@@ -456,7 +482,7 @@ _First in 0.5.0._
|
|
|
456
482
|
|
|
457
483
|
**What changed.** A `type: 'reference', list: true` field now edits as rows in stored order, like an `object` list: drag a row or use its "…" menu to move or remove it, open a row to swap its entry in place, and pick from Add under the rows to append. Neither control offers an entry the list already holds. Any `list: true` field, and any `block` field, takes `maxItems`. The editor stops adding at the cap and says why, a save over it is refused, and a production build fails on an entry over it, naming the entry, field, count and cap. Adding `maxItems` to a list that already holds more therefore fails the build until an editor removes the extra items. `maxItems` on a field that holds no items is refused when the entry schema registry is created.
|
|
458
484
|
|
|
459
|
-
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
485
|
+
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#field-types).
|
|
460
486
|
|
|
461
487
|
#### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
|
|
462
488
|
|
|
@@ -466,7 +492,7 @@ _First in 0.5.0._
|
|
|
466
492
|
|
|
467
493
|
**What changed.** `defineCanopyConfig` takes `seo: { group?, fields? }`, the one place every surface reads an entry's `noindex` flag: the sitemap and `entryToMetadata` that `createNextCanopyContext` returns, AI content and the editor's reference picker. A per-call `seo`/`group`/`fields` still overrides it. The free `generateContentSitemap` takes `seo` as an argument and refuses to run without it when the config sets one; `createNextCanopyContext` and the AI content config refuse a leftover `seo`. A reference picker now badges an entry hidden from search as "Hidden from search", and picking one adds a note naming the setting on that entry's form, since a page listing only indexed entries won't show it. A reference field takes `optionSort`: `'label'` (the default), `'collection'`, or `{ field, direction }`. Point `field` at an ISO date, since strings compare as text.
|
|
468
494
|
|
|
469
|
-
**To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
495
|
+
**To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#how-references-work-in-the-editor).
|
|
470
496
|
|
|
471
497
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
472
498
|
|
|
@@ -494,7 +520,7 @@ resolved without it.
|
|
|
494
520
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
495
521
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
496
522
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
497
|
-
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/
|
|
523
|
+
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#resolving-references-in-a-listing).
|
|
498
524
|
|
|
499
525
|
### 0.3.3
|
|
500
526
|
|
|
@@ -911,7 +937,7 @@ URL.
|
|
|
911
937
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
912
938
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
913
939
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
914
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
940
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#live-preview)).
|
|
915
941
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
916
942
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
917
943
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -926,7 +952,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
926
952
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
927
953
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
928
954
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
929
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
955
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#live-preview).
|
|
930
956
|
|
|
931
957
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
932
958
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -1008,7 +1034,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
1008
1034
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
1009
1035
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
1010
1036
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
1011
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1037
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#ai-content-configuration).
|
|
1012
1038
|
|
|
1013
1039
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
1014
1040
|
|
|
@@ -1030,7 +1056,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
1030
1056
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
1031
1057
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
1032
1058
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
1033
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
1059
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#mdx-content-cannot-run-code).
|
|
1034
1060
|
|
|
1035
1061
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
1036
1062
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -1167,7 +1193,7 @@ a format check.
|
|
|
1167
1193
|
|
|
1168
1194
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
1169
1195
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
1170
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1196
|
+
([reference](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#definecanopyconfig-options)).
|
|
1171
1197
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
1172
1198
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
1173
1199
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -1191,7 +1217,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
1191
1217
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
1192
1218
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
1193
1219
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
1194
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
1220
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
1195
1221
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
1196
1222
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
1197
1223
|
|
|
@@ -1229,7 +1255,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
1229
1255
|
new stack needs no steps.
|
|
1230
1256
|
|
|
1231
1257
|
**What changed.** (int.109) Detailed in
|
|
1232
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1258
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
1233
1259
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
1234
1260
|
refusing clients without TLS or IAM, replacing the worker's
|
|
1235
1261
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1283,10 +1309,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1283
1309
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1284
1310
|
unchanged.
|
|
1285
1311
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1286
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
1312
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#worker-down-alarm).
|
|
1287
1313
|
|
|
1288
1314
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1289
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
1315
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
1290
1316
|
`alarmTopic`.
|
|
1291
1317
|
|
|
1292
1318
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1297,7 +1323,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1297
1323
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1298
1324
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1299
1325
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1300
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1326
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#the-worker-instance).
|
|
1301
1327
|
|
|
1302
1328
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1303
1329
|
not Template first and the worker contract stays at 1.
|
|
@@ -1363,7 +1389,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1363
1389
|
|
|
1364
1390
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1365
1391
|
mirror, so the root volume needs room for two
|
|
1366
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1392
|
+
([details](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1367
1393
|
|
|
1368
1394
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1369
1395
|
|
|
@@ -1385,7 +1411,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1385
1411
|
bundle-only roll is safe.
|
|
1386
1412
|
|
|
1387
1413
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1388
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1414
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
1389
1415
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1390
1416
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1391
1417
|
|
|
@@ -1402,8 +1428,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1402
1428
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1403
1429
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1404
1430
|
takes `worker/`'s three units and `gateway.env.example`
|
|
1405
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
1406
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
1431
|
+
([steps](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
1432
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
1407
1433
|
|
|
1408
1434
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1409
1435
|
|
|
@@ -1414,7 +1440,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1414
1440
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1415
1441
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1416
1442
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
1417
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
1443
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
1418
1444
|
|
|
1419
1445
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1420
1446
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1590,7 +1616,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1590
1616
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1591
1617
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1592
1618
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1593
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1619
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#ai-content-configuration).
|
|
1594
1620
|
|
|
1595
1621
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1596
1622
|
change its link.
|
|
@@ -1665,7 +1691,7 @@ _First in int.115._
|
|
|
1665
1691
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1666
1692
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1667
1693
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1668
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1694
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1669
1695
|
unpublishing.
|
|
1670
1696
|
|
|
1671
1697
|
#### The editor calls the content drawer "All content"
|
|
@@ -1977,7 +2003,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1977
2003
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1978
2004
|
|
|
1979
2005
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1980
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
2006
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#stamping-a-publication-date).
|
|
1981
2007
|
|
|
1982
2008
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1983
2009
|
|
|
@@ -2024,7 +2050,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
2024
2050
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
2025
2051
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
2026
2052
|
no longer exported from `canopycms/client`. See
|
|
2027
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
2053
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#editor-customization).
|
|
2028
2054
|
|
|
2029
2055
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
2030
2056
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -2135,7 +2161,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
2135
2161
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
2136
2162
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
2137
2163
|
own pages, mount the hook as in
|
|
2138
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
2164
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
2139
2165
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
2140
2166
|
|
|
2141
2167
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -2176,12 +2202,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
2176
2202
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
2177
2203
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
2178
2204
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
2179
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
2205
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
2180
2206
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
2181
2207
|
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
|
|
2182
2208
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
2183
2209
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
2184
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2210
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#security-model)).
|
|
2185
2211
|
|
|
2186
2212
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
2187
2213
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -2193,7 +2219,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
2193
2219
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
2194
2220
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
2195
2221
|
anyone holding an App's key can mint a token for any of its installations
|
|
2196
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
2222
|
+
([why](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
2197
2223
|
|
|
2198
2224
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
2199
2225
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -2206,7 +2232,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2206
2232
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
2207
2233
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
2208
2234
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
2209
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
2235
|
+
([details](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
2210
2236
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
2211
2237
|
of the three is refused at synth, and so is an App alongside a token.
|
|
2212
2238
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -2217,7 +2243,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2217
2243
|
|
|
2218
2244
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
2219
2245
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
2220
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
2246
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
2221
2247
|
|
|
2222
2248
|
```bash
|
|
2223
2249
|
canopycms init-github-app create -- \
|
|
@@ -2265,7 +2291,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2265
2291
|
|
|
2266
2292
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2267
2293
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
2268
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
2294
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#rotating-a-secret).
|
|
2269
2295
|
|
|
2270
2296
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2271
2297
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2319,12 +2345,12 @@ also check the bucket policy for its grant.
|
|
|
2319
2345
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2320
2346
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2321
2347
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
2322
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
2348
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#dual-build-support)).
|
|
2323
2349
|
|
|
2324
2350
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2325
2351
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2326
2352
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
2327
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
2353
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
2328
2354
|
|
|
2329
2355
|
**To adopt.**
|
|
2330
2356
|
|
|
@@ -2353,7 +2379,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2353
2379
|
|
|
2354
2380
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2355
2381
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
2356
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2382
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#media-configuration) for the
|
|
2357
2383
|
CloudFront behavior it expects.
|
|
2358
2384
|
|
|
2359
2385
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2378,7 +2404,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2378
2404
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2379
2405
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2380
2406
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
2381
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
2407
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
2382
2408
|
|
|
2383
2409
|
**To adopt.** Optional:
|
|
2384
2410
|
|
|
@@ -2488,7 +2514,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2488
2514
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2489
2515
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2490
2516
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2491
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2517
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/docs/deploying-to-aws.md#security-model)).
|
|
2492
2518
|
|
|
2493
2519
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2494
2520
|
|
|
@@ -2587,7 +2613,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2587
2613
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2588
2614
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2589
2615
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2590
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2616
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#media-configuration)). Two traps:
|
|
2591
2617
|
|
|
2592
2618
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2593
2619
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2746,7 +2772,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2746
2772
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2747
2773
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2748
2774
|
`createNextCanopyContext`'s result. See
|
|
2749
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2775
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2750
2776
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2751
2777
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2752
2778
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2803,7 +2829,7 @@ underscore-prefixed files are skipped.
|
|
|
2803
2829
|
|
|
2804
2830
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2805
2831
|
`defaultPathAccess: { read: 'allow' }`
|
|
2806
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2832
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#public-read-on-server-deployments)).
|
|
2807
2833
|
|
|
2808
2834
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2809
2835
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2856,7 +2882,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2856
2882
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2857
2883
|
gives one template's value type) requires exactly
|
|
2858
2884
|
one component per block template name when written as an object literal. See
|
|
2859
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2885
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#block-component-registries) and
|
|
2860
2886
|
`apps/example1/app/components/PostView.tsx`.
|
|
2861
2887
|
|
|
2862
2888
|
```ts
|
|
@@ -2878,7 +2904,7 @@ templates against the schema.
|
|
|
2878
2904
|
|
|
2879
2905
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2880
2906
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2881
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2907
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2882
2908
|
identity helper for them.
|
|
2883
2909
|
|
|
2884
2910
|
```ts
|
|
@@ -2897,7 +2923,7 @@ field by composing from the same `const` field object.
|
|
|
2897
2923
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2898
2924
|
it, and listings do with
|
|
2899
2925
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2900
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2926
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#shared--referenced-blocks).
|
|
2901
2927
|
|
|
2902
2928
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2903
2929
|
|
|
@@ -2919,7 +2945,7 @@ Not retro-documented, apart from these:
|
|
|
2919
2945
|
|
|
2920
2946
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2921
2947
|
|
|
2922
|
-
**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/
|
|
2948
|
+
**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/5c6c8f1378edd82c6c0cd54923dfb2fa1bb4d4d7/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2923
2949
|
|
|
2924
2950
|
**To adopt.**
|
|
2925
2951
|
|
package/dist/api/admin.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { Task, QueueStats, CorruptTaskFile } from '../task-queue/cms-task-q
|
|
|
11
11
|
import type { BuildIdentity, WorkerStatusReport } from '../types.js';
|
|
12
12
|
import { type OperatingMode } from '../operating-mode/index.js';
|
|
13
13
|
import type { SchemaIssue } from '../schema/types.js';
|
|
14
|
+
export type { DeleteArchivedBranchesBody, DeleteArchivedBranchesResponse, } from './archived-branches.js';
|
|
14
15
|
export type { BranchHealthResponse, DismissUnpublishedResponse, PurgeBranchDirResponse, RepairBranchDirResponse, RepairContentDuplicatesResponse, } from './admin-branch-health.js';
|
|
15
16
|
type WorkerLivenessState = 'alive' | 'stale' | 'absent';
|
|
16
17
|
export interface WorkerLiveness {
|
|
@@ -117,6 +118,16 @@ export type DeleteTaskParams = z.infer<typeof deleteTaskParamsSchema>;
|
|
|
117
118
|
* `ADMIN_ROUTES` import.
|
|
118
119
|
*/
|
|
119
120
|
export declare const ADMIN_ROUTES: {
|
|
121
|
+
readonly deleteArchivedBranches: import("./route-builder.js").RouteDefinition<undefined, z.ZodObject<{
|
|
122
|
+
olderThanDays: z.ZodNumber;
|
|
123
|
+
branches: z.ZodArray<z.ZodString, "many">;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
branches: string[];
|
|
126
|
+
olderThanDays: number;
|
|
127
|
+
}, {
|
|
128
|
+
branches: string[];
|
|
129
|
+
olderThanDays: number;
|
|
130
|
+
}>, import("./archived-branches.js").DeleteArchivedBranchesResponse>;
|
|
120
131
|
readonly branchHealth: import("./route-builder.js").RouteDefinition<z.ZodObject<{
|
|
121
132
|
duplicates: z.ZodOptional<z.ZodLiteral<"1">>;
|
|
122
133
|
}, "strip", z.ZodTypeAny, {
|
package/dist/api/admin.js
CHANGED
|
@@ -17,6 +17,7 @@ import { getErrorMessage, isNotFoundError, redactCredentials } from '../utils/er
|
|
|
17
17
|
import { getBuildIdentity } from '../build-identity.js';
|
|
18
18
|
import { loadSharp } from '../assets/sharp-loader.js';
|
|
19
19
|
import { ADMIN_BRANCH_HEALTH_ROUTES } from './admin-branch-health.js';
|
|
20
|
+
import { ADMIN_ARCHIVED_BRANCH_ROUTES } from './archived-branches.js';
|
|
20
21
|
import { baseBranchOf } from '../utils/base-branch.js';
|
|
21
22
|
/**
|
|
22
23
|
* 60_000 = DEFAULT_LOCK_STALE_MS in worker/cms-worker.ts, hardcoded rather
|
|
@@ -359,4 +360,5 @@ export const ADMIN_ROUTES = {
|
|
|
359
360
|
retryTask,
|
|
360
361
|
deleteTask,
|
|
361
362
|
...ADMIN_BRANCH_HEALTH_ROUTES,
|
|
363
|
+
...ADMIN_ARCHIVED_BRANCH_ROUTES,
|
|
362
364
|
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BranchMergeResponse } from './branch-merge.js';
|
|
3
|
+
import type { ApiContext, ApiRequest, ApiResponse } from './types.js';
|
|
4
|
+
export declare const ARCHIVE_BRANCH_ROUTES: {
|
|
5
|
+
readonly archive: import("./route-builder.js").RouteDefinition<z.ZodObject<{
|
|
6
|
+
branch: z.ZodType<import("../paths/index.js").BranchName, z.ZodTypeDef, import("../paths/index.js").BranchName>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
branch: string & {
|
|
9
|
+
readonly __brand: "BranchName";
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
branch: string & {
|
|
13
|
+
readonly __brand: "BranchName";
|
|
14
|
+
};
|
|
15
|
+
}>, undefined, BranchMergeResponse>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Wall-clock budget for starting deletes, well inside the CMS Lambda's default 60 s timeout
|
|
19
|
+
* (`DEFAULT_CMS_LAMBDA_TIMEOUT` in canopycms-cdk), so one slow `rm` can still finish. A Lambda
|
|
20
|
+
* killed in an `rm` costs nothing: the branch is already gone, and the worker sweeps what is left.
|
|
21
|
+
* @internal Exported for tests.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DELETE_ARCHIVED_BUDGET_MS = 25000;
|
|
24
|
+
declare const deleteArchivedBranchesBodySchema: z.ZodObject<{
|
|
25
|
+
olderThanDays: z.ZodNumber;
|
|
26
|
+
branches: z.ZodArray<z.ZodString, "many">;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
branches: string[];
|
|
29
|
+
olderThanDays: number;
|
|
30
|
+
}, {
|
|
31
|
+
branches: string[];
|
|
32
|
+
olderThanDays: number;
|
|
33
|
+
}>;
|
|
34
|
+
export interface DeleteArchivedBranchesBody {
|
|
35
|
+
olderThanDays: number;
|
|
36
|
+
/** The full names the admin confirmed. Nothing outside them is deleted. */
|
|
37
|
+
branches: string[];
|
|
38
|
+
}
|
|
39
|
+
interface DeleteArchivedBranchesData {
|
|
40
|
+
/** Full names of the branches deleted. */
|
|
41
|
+
deleted: string[];
|
|
42
|
+
/** Old enough, but left for a person to delete, by reason (`ageDeletionHold`). */
|
|
43
|
+
skipped: {
|
|
44
|
+
notMerged: string[];
|
|
45
|
+
unpublished: string[];
|
|
46
|
+
};
|
|
47
|
+
/** Old enough, but not deleted: busy, gone, or changed since they were listed. */
|
|
48
|
+
failed: string[];
|
|
49
|
+
/** Not reached before the time budget ran out; asking again continues. */
|
|
50
|
+
remaining: number;
|
|
51
|
+
/** Deleted, with something left behind; show it to the admin. */
|
|
52
|
+
warnings: string[];
|
|
53
|
+
}
|
|
54
|
+
/** Response type for POST /admin/archived-branches/delete */
|
|
55
|
+
export type DeleteArchivedBranchesResponse = ApiResponse<DeleteArchivedBranchesData>;
|
|
56
|
+
/** @internal Exported for tests. */
|
|
57
|
+
export declare const deleteArchivedBranchesHandler: (_gc: unknown, ctx: ApiContext, _req: ApiRequest, body: z.infer<typeof deleteArchivedBranchesBodySchema>) => Promise<DeleteArchivedBranchesResponse>;
|
|
58
|
+
export declare const ADMIN_ARCHIVED_BRANCH_ROUTES: {
|
|
59
|
+
readonly deleteArchivedBranches: import("./route-builder.js").RouteDefinition<undefined, z.ZodObject<{
|
|
60
|
+
olderThanDays: z.ZodNumber;
|
|
61
|
+
branches: z.ZodArray<z.ZodString, "many">;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
branches: string[];
|
|
64
|
+
olderThanDays: number;
|
|
65
|
+
}, {
|
|
66
|
+
branches: string[];
|
|
67
|
+
olderThanDays: number;
|
|
68
|
+
}>, DeleteArchivedBranchesResponse>;
|
|
69
|
+
};
|
|
70
|
+
export {};
|