canopycms 0.9.0 → 0.10.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 +60 -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 +5 -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/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/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.10.0`, built from [`e2c1dc9`](https://github.com/safeinsights/canopycms/tree/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.
|
|
10
|
+
Its entries are [0.10.0](#0100), 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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/.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,18 @@ entries under **Released**.
|
|
|
62
62
|
|
|
63
63
|
## Released
|
|
64
64
|
|
|
65
|
+
### 0.10.0
|
|
66
|
+
|
|
67
|
+
#### Archived branches move out of the way, with optional retention
|
|
68
|
+
|
|
69
|
+
<!-- changeset: archived-branches-list -->
|
|
70
|
+
|
|
71
|
+
_First in 0.10.0._
|
|
72
|
+
|
|
73
|
+
**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.
|
|
74
|
+
|
|
75
|
+
**To adopt.** Nothing is required. To turn retention on, set `archivedBranchRetentionDays` on `CanopyCmsService` to a whole number of days and deploy the stack.
|
|
76
|
+
|
|
65
77
|
### 0.9.0
|
|
66
78
|
|
|
67
79
|
#### A `date` field for a day with no time and no zone
|
|
@@ -72,7 +84,7 @@ _First in 0.9.0._
|
|
|
72
84
|
|
|
73
85
|
**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
86
|
|
|
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/
|
|
87
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/.changeset/README.md#field-types).
|
|
76
88
|
|
|
77
89
|
**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
90
|
|
|
@@ -348,7 +360,7 @@ _First in 0.7.0._
|
|
|
348
360
|
|
|
349
361
|
**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
362
|
|
|
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/
|
|
363
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
|
|
352
364
|
|
|
353
365
|
#### Pull request bodies link back to the editor
|
|
354
366
|
|
|
@@ -358,7 +370,7 @@ _First in 0.7.0._
|
|
|
358
370
|
|
|
359
371
|
**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
372
|
|
|
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/
|
|
373
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#definecanopyconfig-options).
|
|
362
374
|
|
|
363
375
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
364
376
|
|
|
@@ -444,7 +456,7 @@ _First in 0.6.0._
|
|
|
444
456
|
|
|
445
457
|
**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
458
|
|
|
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/
|
|
459
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md).
|
|
448
460
|
|
|
449
461
|
### 0.5.0
|
|
450
462
|
|
|
@@ -456,7 +468,7 @@ _First in 0.5.0._
|
|
|
456
468
|
|
|
457
469
|
**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
470
|
|
|
459
|
-
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/
|
|
471
|
+
**To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#field-types).
|
|
460
472
|
|
|
461
473
|
#### 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
474
|
|
|
@@ -466,7 +478,7 @@ _First in 0.5.0._
|
|
|
466
478
|
|
|
467
479
|
**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
480
|
|
|
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/
|
|
481
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#how-references-work-in-the-editor).
|
|
470
482
|
|
|
471
483
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
472
484
|
|
|
@@ -494,7 +506,7 @@ resolved without it.
|
|
|
494
506
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
495
507
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
496
508
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
497
|
-
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/
|
|
509
|
+
[Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#resolving-references-in-a-listing).
|
|
498
510
|
|
|
499
511
|
### 0.3.3
|
|
500
512
|
|
|
@@ -911,7 +923,7 @@ URL.
|
|
|
911
923
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
912
924
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
913
925
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
914
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
926
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#live-preview)).
|
|
915
927
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
916
928
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
917
929
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -926,7 +938,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
926
938
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
927
939
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
928
940
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
929
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
941
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#live-preview).
|
|
930
942
|
|
|
931
943
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
932
944
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -1008,7 +1020,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
1008
1020
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
1009
1021
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
1010
1022
|
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/
|
|
1023
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#ai-content-configuration).
|
|
1012
1024
|
|
|
1013
1025
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
1014
1026
|
|
|
@@ -1030,7 +1042,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
1030
1042
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
1031
1043
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
1032
1044
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
1033
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
1045
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#mdx-content-cannot-run-code).
|
|
1034
1046
|
|
|
1035
1047
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
1036
1048
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -1167,7 +1179,7 @@ a format check.
|
|
|
1167
1179
|
|
|
1168
1180
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
1169
1181
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
1170
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1182
|
+
([reference](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#definecanopyconfig-options)).
|
|
1171
1183
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
1172
1184
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
1173
1185
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -1191,7 +1203,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
1191
1203
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
1192
1204
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
1193
1205
|
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/
|
|
1206
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
1195
1207
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
1196
1208
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
1197
1209
|
|
|
@@ -1229,7 +1241,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
1229
1241
|
new stack needs no steps.
|
|
1230
1242
|
|
|
1231
1243
|
**What changed.** (int.109) Detailed in
|
|
1232
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1244
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
1233
1245
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
1234
1246
|
refusing clients without TLS or IAM, replacing the worker's
|
|
1235
1247
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1283,10 +1295,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1283
1295
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1284
1296
|
unchanged.
|
|
1285
1297
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1286
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
1298
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#worker-down-alarm).
|
|
1287
1299
|
|
|
1288
1300
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1289
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
1301
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
1290
1302
|
`alarmTopic`.
|
|
1291
1303
|
|
|
1292
1304
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1297,7 +1309,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1297
1309
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1298
1310
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1299
1311
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1300
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
1312
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#the-worker-instance).
|
|
1301
1313
|
|
|
1302
1314
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1303
1315
|
not Template first and the worker contract stays at 1.
|
|
@@ -1363,7 +1375,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1363
1375
|
|
|
1364
1376
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1365
1377
|
mirror, so the root volume needs room for two
|
|
1366
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1378
|
+
([details](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1367
1379
|
|
|
1368
1380
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1369
1381
|
|
|
@@ -1385,7 +1397,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1385
1397
|
bundle-only roll is safe.
|
|
1386
1398
|
|
|
1387
1399
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1388
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
1400
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
1389
1401
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1390
1402
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1391
1403
|
|
|
@@ -1402,8 +1414,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1402
1414
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1403
1415
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1404
1416
|
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/
|
|
1417
|
+
([steps](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
1418
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
1407
1419
|
|
|
1408
1420
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1409
1421
|
|
|
@@ -1414,7 +1426,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1414
1426
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1415
1427
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1416
1428
|
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/
|
|
1429
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
1418
1430
|
|
|
1419
1431
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1420
1432
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1590,7 +1602,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1590
1602
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1591
1603
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1592
1604
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1593
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1605
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#ai-content-configuration).
|
|
1594
1606
|
|
|
1595
1607
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1596
1608
|
change its link.
|
|
@@ -1665,7 +1677,7 @@ _First in int.115._
|
|
|
1665
1677
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1666
1678
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1667
1679
|
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/
|
|
1680
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1669
1681
|
unpublishing.
|
|
1670
1682
|
|
|
1671
1683
|
#### The editor calls the content drawer "All content"
|
|
@@ -1977,7 +1989,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1977
1989
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1978
1990
|
|
|
1979
1991
|
**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/
|
|
1992
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#stamping-a-publication-date).
|
|
1981
1993
|
|
|
1982
1994
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1983
1995
|
|
|
@@ -2024,7 +2036,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
2024
2036
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
2025
2037
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
2026
2038
|
no longer exported from `canopycms/client`. See
|
|
2027
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
2039
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#editor-customization).
|
|
2028
2040
|
|
|
2029
2041
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
2030
2042
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -2135,7 +2147,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
2135
2147
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
2136
2148
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
2137
2149
|
own pages, mount the hook as in
|
|
2138
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
2150
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
2139
2151
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
2140
2152
|
|
|
2141
2153
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -2176,12 +2188,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
2176
2188
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
2177
2189
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
2178
2190
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
2179
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
2191
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
2180
2192
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
2181
2193
|
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
2194
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
2183
2195
|
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/
|
|
2196
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#security-model)).
|
|
2185
2197
|
|
|
2186
2198
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
2187
2199
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -2193,7 +2205,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
2193
2205
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
2194
2206
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
2195
2207
|
anyone holding an App's key can mint a token for any of its installations
|
|
2196
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
2208
|
+
([why](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
2197
2209
|
|
|
2198
2210
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
2199
2211
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -2206,7 +2218,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2206
2218
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
2207
2219
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
2208
2220
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
2209
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
2221
|
+
([details](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
2210
2222
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
2211
2223
|
of the three is refused at synth, and so is an App alongside a token.
|
|
2212
2224
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -2217,7 +2229,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2217
2229
|
|
|
2218
2230
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
2219
2231
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
2220
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
2232
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
2221
2233
|
|
|
2222
2234
|
```bash
|
|
2223
2235
|
canopycms init-github-app create -- \
|
|
@@ -2265,7 +2277,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2265
2277
|
|
|
2266
2278
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2267
2279
|
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/
|
|
2280
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#rotating-a-secret).
|
|
2269
2281
|
|
|
2270
2282
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2271
2283
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2319,12 +2331,12 @@ also check the bucket policy for its grant.
|
|
|
2319
2331
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2320
2332
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2321
2333
|
`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/
|
|
2334
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#dual-build-support)).
|
|
2323
2335
|
|
|
2324
2336
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2325
2337
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2326
2338
|
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/
|
|
2339
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
2328
2340
|
|
|
2329
2341
|
**To adopt.**
|
|
2330
2342
|
|
|
@@ -2353,7 +2365,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2353
2365
|
|
|
2354
2366
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2355
2367
|
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/
|
|
2368
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#media-configuration) for the
|
|
2357
2369
|
CloudFront behavior it expects.
|
|
2358
2370
|
|
|
2359
2371
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2378,7 +2390,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2378
2390
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2379
2391
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2380
2392
|
`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/
|
|
2393
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
2382
2394
|
|
|
2383
2395
|
**To adopt.** Optional:
|
|
2384
2396
|
|
|
@@ -2488,7 +2500,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2488
2500
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2489
2501
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2490
2502
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2491
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2503
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#security-model)).
|
|
2492
2504
|
|
|
2493
2505
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2494
2506
|
|
|
@@ -2587,7 +2599,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2587
2599
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2588
2600
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2589
2601
|
`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/
|
|
2602
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#media-configuration)). Two traps:
|
|
2591
2603
|
|
|
2592
2604
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2593
2605
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2746,7 +2758,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2746
2758
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2747
2759
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2748
2760
|
`createNextCanopyContext`'s result. See
|
|
2749
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2761
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2750
2762
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2751
2763
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2752
2764
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2803,7 +2815,7 @@ underscore-prefixed files are skipped.
|
|
|
2803
2815
|
|
|
2804
2816
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2805
2817
|
`defaultPathAccess: { read: 'allow' }`
|
|
2806
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2818
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#public-read-on-server-deployments)).
|
|
2807
2819
|
|
|
2808
2820
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2809
2821
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2856,7 +2868,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2856
2868
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2857
2869
|
gives one template's value type) requires exactly
|
|
2858
2870
|
one component per block template name when written as an object literal. See
|
|
2859
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2871
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#block-component-registries) and
|
|
2860
2872
|
`apps/example1/app/components/PostView.tsx`.
|
|
2861
2873
|
|
|
2862
2874
|
```ts
|
|
@@ -2878,7 +2890,7 @@ templates against the schema.
|
|
|
2878
2890
|
|
|
2879
2891
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2880
2892
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2881
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2893
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2882
2894
|
identity helper for them.
|
|
2883
2895
|
|
|
2884
2896
|
```ts
|
|
@@ -2897,7 +2909,7 @@ field by composing from the same `const` field object.
|
|
|
2897
2909
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2898
2910
|
it, and listings do with
|
|
2899
2911
|
[`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/
|
|
2912
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#shared--referenced-blocks).
|
|
2901
2913
|
|
|
2902
2914
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2903
2915
|
|
|
@@ -2919,7 +2931,7 @@ Not retro-documented, apart from these:
|
|
|
2919
2931
|
|
|
2920
2932
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2921
2933
|
|
|
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/
|
|
2934
|
+
**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/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2923
2935
|
|
|
2924
2936
|
**To adopt.**
|
|
2925
2937
|
|
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 {};
|