canopycms 0.8.3 → 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 +73 -47
- package/dist/ai/json-to-markdown.js +2 -0
- 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-entry-changes.js +2 -4
- 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 +85 -16
- package/dist/cli/generate-ai-content.js +83 -15
- package/dist/cli/init.js +1 -1
- package/dist/config/types.d.ts +4 -4
- package/dist/config/types.js +1 -1
- package/dist/config/validation.d.ts +9 -3
- package/dist/config/validation.js +30 -5
- package/dist/content-listing.js +2 -3
- package/dist/content-store.js +5 -5
- 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/FormRenderer.js +5 -0
- 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/components/EntryChangesDrawer.js +3 -2
- package/dist/editor/copy.d.ts +3 -0
- package/dist/editor/copy.js +3 -0
- package/dist/editor/entry-diff.js +7 -1
- package/dist/editor/fields/DateField.d.ts +19 -0
- package/dist/editor/fields/DateField.js +53 -0
- package/dist/editor/fields/DateTimeField.d.ts +10 -0
- package/dist/editor/fields/DateTimeField.js +5 -15
- package/dist/editor/fields/list-item-title.js +2 -1
- 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/theme.js +12 -4
- package/dist/entry-schema-registry.js +2 -1
- package/dist/static/index.js +5 -2
- package/dist/types.d.ts +33 -0
- package/dist/utils/calendar-day.d.ts +23 -0
- package/dist/utils/calendar-day.js +102 -0
- package/dist/utils/content-serialize.d.ts +4 -2
- package/dist/utils/content-serialize.js +8 -6
- package/dist/validation/entry-validator.js +7 -1
- package/dist/validation/field-traversal.js +1 -1
- 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,32 @@ 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
|
+
|
|
77
|
+
### 0.9.0
|
|
78
|
+
|
|
79
|
+
#### A `date` field for a day with no time and no zone
|
|
80
|
+
|
|
81
|
+
<!-- changeset: date-field-type -->
|
|
82
|
+
|
|
83
|
+
_First in 0.9.0._
|
|
84
|
+
|
|
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.
|
|
86
|
+
|
|
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).
|
|
88
|
+
|
|
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.
|
|
90
|
+
|
|
65
91
|
### 0.8.3
|
|
66
92
|
|
|
67
93
|
#### Dev pages load for non-admin users under `defaultBranchAccess: 'deny'`
|
|
@@ -334,7 +360,7 @@ _First in 0.7.0._
|
|
|
334
360
|
|
|
335
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.
|
|
336
362
|
|
|
337
|
-
**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).
|
|
338
364
|
|
|
339
365
|
#### Pull request bodies link back to the editor
|
|
340
366
|
|
|
@@ -344,7 +370,7 @@ _First in 0.7.0._
|
|
|
344
370
|
|
|
345
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.
|
|
346
372
|
|
|
347
|
-
**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).
|
|
348
374
|
|
|
349
375
|
#### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
|
|
350
376
|
|
|
@@ -430,7 +456,7 @@ _First in 0.6.0._
|
|
|
430
456
|
|
|
431
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.
|
|
432
458
|
|
|
433
|
-
**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).
|
|
434
460
|
|
|
435
461
|
### 0.5.0
|
|
436
462
|
|
|
@@ -442,7 +468,7 @@ _First in 0.5.0._
|
|
|
442
468
|
|
|
443
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.
|
|
444
470
|
|
|
445
|
-
**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).
|
|
446
472
|
|
|
447
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**
|
|
448
474
|
|
|
@@ -452,7 +478,7 @@ _First in 0.5.0._
|
|
|
452
478
|
|
|
453
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.
|
|
454
480
|
|
|
455
|
-
**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).
|
|
456
482
|
|
|
457
483
|
**Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
|
|
458
484
|
|
|
@@ -480,7 +506,7 @@ resolved without it.
|
|
|
480
506
|
**To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
|
|
481
507
|
reference field. Code that reads the body from a link-only reference's resolved type now sees
|
|
482
508
|
`string | undefined`; either set `includeBody: true` or handle the missing value. See
|
|
483
|
-
[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).
|
|
484
510
|
|
|
485
511
|
### 0.3.3
|
|
486
512
|
|
|
@@ -897,7 +923,7 @@ URL.
|
|
|
897
923
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
898
924
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
899
925
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
900
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
926
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#live-preview)).
|
|
901
927
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
902
928
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
903
929
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -912,7 +938,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
912
938
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
913
939
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
914
940
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
915
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
941
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#live-preview).
|
|
916
942
|
|
|
917
943
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
918
944
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -994,7 +1020,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
994
1020
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
995
1021
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
996
1022
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
997
|
-
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).
|
|
998
1024
|
|
|
999
1025
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
1000
1026
|
|
|
@@ -1016,7 +1042,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
1016
1042
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
1017
1043
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
1018
1044
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
1019
|
-
[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).
|
|
1020
1046
|
|
|
1021
1047
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
1022
1048
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -1153,7 +1179,7 @@ a format check.
|
|
|
1153
1179
|
|
|
1154
1180
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
1155
1181
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
1156
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
1182
|
+
([reference](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#definecanopyconfig-options)).
|
|
1157
1183
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
1158
1184
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
1159
1185
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -1177,7 +1203,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
1177
1203
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
1178
1204
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
1179
1205
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
1180
|
-
[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).
|
|
1181
1207
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
1182
1208
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
1183
1209
|
|
|
@@ -1215,7 +1241,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
1215
1241
|
new stack needs no steps.
|
|
1216
1242
|
|
|
1217
1243
|
**What changed.** (int.109) Detailed in
|
|
1218
|
-
[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
|
|
1219
1245
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
1220
1246
|
refusing clients without TLS or IAM, replacing the worker's
|
|
1221
1247
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -1269,10 +1295,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
1269
1295
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
1270
1296
|
unchanged.
|
|
1271
1297
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
1272
|
-
[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).
|
|
1273
1299
|
|
|
1274
1300
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
1275
|
-
[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
|
|
1276
1302
|
`alarmTopic`.
|
|
1277
1303
|
|
|
1278
1304
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -1283,7 +1309,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
1283
1309
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
1284
1310
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
1285
1311
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
1286
|
-
[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).
|
|
1287
1313
|
|
|
1288
1314
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
1289
1315
|
not Template first and the worker contract stays at 1.
|
|
@@ -1349,7 +1375,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
1349
1375
|
|
|
1350
1376
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
1351
1377
|
mirror, so the root volume needs room for two
|
|
1352
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1378
|
+
([details](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/docs/deploying-to-aws.md#the-worker-instance)).
|
|
1353
1379
|
|
|
1354
1380
|
#### The worker follows a rebased or deleted GitHub branch
|
|
1355
1381
|
|
|
@@ -1371,7 +1397,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
1371
1397
|
bundle-only roll is safe.
|
|
1372
1398
|
|
|
1373
1399
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
1374
|
-
([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
|
|
1375
1401
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
1376
1402
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
1377
1403
|
|
|
@@ -1388,8 +1414,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
1388
1414
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
1389
1415
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
1390
1416
|
takes `worker/`'s three units and `gateway.env.example`
|
|
1391
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
1392
|
-
[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).
|
|
1393
1419
|
|
|
1394
1420
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
1395
1421
|
|
|
@@ -1400,7 +1426,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
1400
1426
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
1401
1427
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
1402
1428
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
1403
|
-
[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).
|
|
1404
1430
|
|
|
1405
1431
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
1406
1432
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1576,7 +1602,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1576
1602
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1577
1603
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1578
1604
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1579
|
-
[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).
|
|
1580
1606
|
|
|
1581
1607
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1582
1608
|
change its link.
|
|
@@ -1651,7 +1677,7 @@ _First in int.115._
|
|
|
1651
1677
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1652
1678
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1653
1679
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1654
|
-
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
|
|
1655
1681
|
unpublishing.
|
|
1656
1682
|
|
|
1657
1683
|
#### The editor calls the content drawer "All content"
|
|
@@ -1963,7 +1989,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1963
1989
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1964
1990
|
|
|
1965
1991
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1966
|
-
`{ 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).
|
|
1967
1993
|
|
|
1968
1994
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1969
1995
|
|
|
@@ -2010,7 +2036,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
2010
2036
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
2011
2037
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
2012
2038
|
no longer exported from `canopycms/client`. See
|
|
2013
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
2039
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/e2c1dc9f026d0139864d54ee56e10caf6e98d9b7/README.md#editor-customization).
|
|
2014
2040
|
|
|
2015
2041
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
2016
2042
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -2121,7 +2147,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
2121
2147
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
2122
2148
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
2123
2149
|
own pages, mount the hook as in
|
|
2124
|
-
[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).
|
|
2125
2151
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
2126
2152
|
|
|
2127
2153
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -2162,12 +2188,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
2162
2188
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
2163
2189
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
2164
2190
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
2165
|
-
([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
|
|
2166
2192
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
2167
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
|
|
2168
2194
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
2169
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
|
|
2170
|
-
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)).
|
|
2171
2197
|
|
|
2172
2198
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
2173
2199
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -2179,7 +2205,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
2179
2205
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
2180
2206
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
2181
2207
|
anyone holding an App's key can mint a token for any of its installations
|
|
2182
|
-
([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)).
|
|
2183
2209
|
|
|
2184
2210
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
2185
2211
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -2192,7 +2218,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2192
2218
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
2193
2219
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
2194
2220
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
2195
|
-
([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)).
|
|
2196
2222
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
2197
2223
|
of the three is refused at synth, and so is an App alongside a token.
|
|
2198
2224
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -2203,7 +2229,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
2203
2229
|
|
|
2204
2230
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
2205
2231
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
2206
|
-
[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).
|
|
2207
2233
|
|
|
2208
2234
|
```bash
|
|
2209
2235
|
canopycms init-github-app create -- \
|
|
@@ -2251,7 +2277,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
2251
2277
|
|
|
2252
2278
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
2253
2279
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
2254
|
-
[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).
|
|
2255
2281
|
|
|
2256
2282
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
2257
2283
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -2305,12 +2331,12 @@ also check the bucket policy for its grant.
|
|
|
2305
2331
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
2306
2332
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
2307
2333
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
2308
|
-
([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)).
|
|
2309
2335
|
|
|
2310
2336
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
2311
2337
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
2312
2338
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
2313
|
-
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)).
|
|
2314
2340
|
|
|
2315
2341
|
**To adopt.**
|
|
2316
2342
|
|
|
@@ -2339,7 +2365,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
2339
2365
|
|
|
2340
2366
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
2341
2367
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
2342
|
-
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
|
|
2343
2369
|
CloudFront behavior it expects.
|
|
2344
2370
|
|
|
2345
2371
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -2364,7 +2390,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
2364
2390
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
2365
2391
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
2366
2392
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
2367
|
-
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).
|
|
2368
2394
|
|
|
2369
2395
|
**To adopt.** Optional:
|
|
2370
2396
|
|
|
@@ -2474,7 +2500,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2474
2500
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2475
2501
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2476
2502
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2477
|
-
`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)).
|
|
2478
2504
|
|
|
2479
2505
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2480
2506
|
|
|
@@ -2573,7 +2599,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2573
2599
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2574
2600
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2575
2601
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2576
|
-
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:
|
|
2577
2603
|
|
|
2578
2604
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2579
2605
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2732,7 +2758,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2732
2758
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2733
2759
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2734
2760
|
`createNextCanopyContext`'s result. See
|
|
2735
|
-
[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
|
|
2736
2762
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2737
2763
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2738
2764
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2789,7 +2815,7 @@ underscore-prefixed files are skipped.
|
|
|
2789
2815
|
|
|
2790
2816
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2791
2817
|
`defaultPathAccess: { read: 'allow' }`
|
|
2792
|
-
([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)).
|
|
2793
2819
|
|
|
2794
2820
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2795
2821
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2842,7 +2868,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2842
2868
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2843
2869
|
gives one template's value type) requires exactly
|
|
2844
2870
|
one component per block template name when written as an object literal. See
|
|
2845
|
-
[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
|
|
2846
2872
|
`apps/example1/app/components/PostView.tsx`.
|
|
2847
2873
|
|
|
2848
2874
|
```ts
|
|
@@ -2864,7 +2890,7 @@ templates against the schema.
|
|
|
2864
2890
|
|
|
2865
2891
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2866
2892
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2867
|
-
([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
|
|
2868
2894
|
identity helper for them.
|
|
2869
2895
|
|
|
2870
2896
|
```ts
|
|
@@ -2883,7 +2909,7 @@ field by composing from the same `const` field object.
|
|
|
2883
2909
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2884
2910
|
it, and listings do with
|
|
2885
2911
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2886
|
-
(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).
|
|
2887
2913
|
|
|
2888
2914
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2889
2915
|
|
|
@@ -2905,7 +2931,7 @@ Not retro-documented, apart from these:
|
|
|
2905
2931
|
|
|
2906
2932
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2907
2933
|
|
|
2908
|
-
**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.
|
|
2909
2935
|
|
|
2910
2936
|
**To adopt.**
|
|
2911
2937
|
|
|
@@ -152,6 +152,7 @@ function renderField(field, value, depth, entry, opts) {
|
|
|
152
152
|
switch (field.type) {
|
|
153
153
|
case 'string':
|
|
154
154
|
case 'number':
|
|
155
|
+
case 'date':
|
|
155
156
|
case 'datetime':
|
|
156
157
|
return `${heading} ${label}${descriptionLine}\n\n${String(value)}`;
|
|
157
158
|
case 'boolean':
|
|
@@ -222,6 +223,7 @@ function renderListField(field, values, depth, label, heading, descriptionLine,
|
|
|
222
223
|
const FLAT_CELL_TYPES = new Set([
|
|
223
224
|
'string',
|
|
224
225
|
'number',
|
|
226
|
+
'date',
|
|
225
227
|
'datetime',
|
|
226
228
|
'boolean',
|
|
227
229
|
'select',
|
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 {};
|