canopycms 0.3.0 → 0.3.1

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 CHANGED
@@ -5,9 +5,9 @@ packages release together, at one version.
5
5
 
6
6
  ## This build
7
7
 
8
- Version `0.3.0`, built from [`18d436f`](https://github.com/safeinsights/canopycms/tree/18d436fe91546aabb30da8efa1397046b65681dc).
8
+ Version `0.3.1`, built from [`2924058`](https://github.com/safeinsights/canopycms/tree/2924058c932bb84bb07466ecaab6562d46c8825c).
9
9
 
10
- Its entries are [0.3.0](#030), under **Released**.
10
+ Its entries are [0.3.1](#031), 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/18d436fe91546aabb30da8efa1397046b65681dc/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/.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,20 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.3.1
66
+
67
+ #### The branch list shows exactly the branches you can open
68
+
69
+ <!-- changeset: branch-list-follows-access-check -->
70
+
71
+ _First in 0.3.1._
72
+
73
+ **What changed.** The branch list now includes a branch only when branch access grants it, so
74
+ the two can no longer disagree. Under `defaultBranchAccess: 'allow'`, a colleague's branch with
75
+ no ACL now appears in your list, and opening it no longer shows "Not available · read-only" with
76
+ Save locked while its content loads. A branch whose explicit ACL leaves out its own creator no
77
+ longer appears in that creator's list, matching the access check that already refused them.
78
+
65
79
  ### 0.3.0
66
80
 
67
81
  #### The branch bar's tooltips open beside their controls
@@ -430,7 +444,7 @@ URL.
430
444
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
431
445
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
432
446
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
433
- [Live Preview](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#live-preview)).
447
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#live-preview)).
434
448
  3. A test reading view content from the route's server HTML must load the page in a browser.
435
449
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
436
450
  of cross-request caches (`unstable_cache`, module memos).
@@ -445,7 +459,7 @@ kept site styles ahead of Mantine's in the preview.
445
459
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
446
460
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
447
461
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
448
- [Live Preview](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#live-preview).
462
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#live-preview).
449
463
 
450
464
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
451
465
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -527,7 +541,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
527
541
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
528
542
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
529
543
  place. A field that links to a hidden section by plain URL needs a field transform; the README
530
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#ai-content-configuration).
544
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#ai-content-configuration).
531
545
 
532
546
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
533
547
 
@@ -549,7 +563,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
549
563
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
550
564
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
551
565
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
552
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#mdx-content-cannot-run-code).
566
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#mdx-content-cannot-run-code).
553
567
 
554
568
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
555
569
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -686,7 +700,7 @@ a format check.
686
700
 
687
701
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
688
702
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
689
- ([reference](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#definecanopyconfig-options)).
703
+ ([reference](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#definecanopyconfig-options)).
690
704
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
691
705
  the PR-body section every user who edited the branch, not only the submitter; settings commits
692
706
  (permissions, groups) carry the acting user's trailer.
@@ -710,7 +724,7 @@ saves only push the branch, and no failing PR task lands in System health.
710
724
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
711
725
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
712
726
  worker holds the base branch for up to 30 minutes while that lasts; see
713
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
727
+ [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
714
728
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
715
729
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
716
730
 
@@ -748,7 +762,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
748
762
  new stack needs no steps.
749
763
 
750
764
  **What changed.** (int.109) Detailed in
751
- [The worker instance](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
765
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
752
766
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
753
767
  refusing clients without TLS or IAM, replacing the worker's
754
768
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -802,10 +816,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
802
816
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
803
817
  unchanged.
804
818
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
805
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#worker-down-alarm).
819
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#worker-down-alarm).
806
820
 
807
821
  **To adopt.** Optional. For parameter-only change sets, see
808
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
822
+ [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
809
823
  `alarmTopic`.
810
824
 
811
825
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -816,7 +830,7 @@ worker, and a hand-built alarm on the worker log group.
816
830
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
817
831
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
818
832
  `alarmTopic` if set; a retried step names itself when it gives up. See
819
- [The worker instance](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance).
833
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance).
820
834
 
821
835
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
822
836
  not Template first and the worker contract stays at 1.
@@ -882,7 +896,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
882
896
 
883
897
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
884
898
  mirror, so the root volume needs room for two
885
- ([details](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#the-worker-instance)).
899
+ ([details](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance)).
886
900
 
887
901
  #### The worker follows a rebased or deleted GitHub branch
888
902
 
@@ -904,7 +918,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
904
918
  bundle-only roll is safe.
905
919
 
906
920
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
907
- ([recipe](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
921
+ ([recipe](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
908
922
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
909
923
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
910
924
 
@@ -921,8 +935,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
921
935
  template, then roll the bundle; on an older template it stops with `template too old for this
922
936
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
923
937
  takes `worker/`'s three units and `gateway.env.example`
924
- ([steps](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
925
- [checklist](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#first-deploy-checklist).
938
+ ([steps](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
939
+ [checklist](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#first-deploy-checklist).
926
940
 
927
941
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
928
942
 
@@ -933,7 +947,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
933
947
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
934
948
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
935
949
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
936
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
950
+ [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
937
951
 
938
952
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
939
953
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -1109,7 +1123,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
1109
1123
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
1110
1124
  apply the same rule here, for example `referenceLink: (target, { body }) =>
1111
1125
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
1112
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#ai-content-configuration).
1126
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#ai-content-configuration).
1113
1127
 
1114
1128
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
1115
1129
  change its link.
@@ -1184,7 +1198,7 @@ _First in int.115._
1184
1198
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1185
1199
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1186
1200
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1187
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#drafts-and-unpublishing) section covers long-lived branches and
1201
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#drafts-and-unpublishing) section covers long-lived branches and
1188
1202
  unpublishing.
1189
1203
 
1190
1204
  #### The editor calls the content drawer "All content"
@@ -1496,7 +1510,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
1496
1510
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
1497
1511
 
1498
1512
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
1499
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#stamping-a-publication-date).
1513
+ `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#stamping-a-publication-date).
1500
1514
 
1501
1515
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
1502
1516
 
@@ -1543,7 +1557,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
1543
1557
  stored at, and `react-split-pane` is no longer a dependency.
1544
1558
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
1545
1559
  no longer exported from `canopycms/client`. See
1546
- [Your root layout](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#editor-customization).
1560
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#editor-customization).
1547
1561
 
1548
1562
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
1549
1563
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -1654,7 +1668,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
1654
1668
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
1655
1669
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
1656
1670
  own pages, mount the hook as in
1657
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
1671
+ [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
1658
1672
  Your own Server Actions in the CMS build still 403 behind OAC.
1659
1673
 
1660
1674
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -1695,12 +1709,12 @@ fast naming the ARN, the field and the keys present, never a value.
1695
1709
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
1696
1710
  prop. The scaffolded stack fills them from the repository _variables_
1697
1711
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
1698
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
1712
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
1699
1713
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
1700
1714
  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
1701
1715
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
1702
1716
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
1703
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#security-model)).
1717
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#security-model)).
1704
1718
 
1705
1719
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
1706
1720
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -1712,7 +1726,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
1712
1726
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
1713
1727
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
1714
1728
  anyone holding an App's key can mint a token for any of its installations
1715
- ([why](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
1729
+ ([why](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
1716
1730
 
1717
1731
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
1718
1732
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -1725,7 +1739,7 @@ anyone holding an App's key can mint a token for any of its installations
1725
1739
  `verify` checks an existing installation's permissions: run it, since an App missing a
1726
1740
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
1727
1741
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
1728
- ([details](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
1742
+ ([details](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
1729
1743
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
1730
1744
  of the three is refused at synth, and so is an App alongside a token.
1731
1745
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -1736,7 +1750,7 @@ anyone holding an App's key can mint a token for any of its installations
1736
1750
 
1737
1751
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
1738
1752
  IAM policy automatically, so you need not add it to `secretsArns`. See
1739
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#authenticating-as-a-github-app).
1753
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#authenticating-as-a-github-app).
1740
1754
 
1741
1755
  ```bash
1742
1756
  canopycms init-github-app create -- \
@@ -1784,7 +1798,7 @@ downloads the `.pem` from the App's settings page.
1784
1798
 
1785
1799
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
1786
1800
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
1787
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#rotating-a-secret).
1801
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rotating-a-secret).
1788
1802
 
1789
1803
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
1790
1804
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -1838,12 +1852,12 @@ also check the bucket policy for its grant.
1838
1852
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
1839
1853
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
1840
1854
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
1841
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#dual-build-support)).
1855
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#dual-build-support)).
1842
1856
 
1843
1857
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
1844
1858
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
1845
1859
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
1846
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#where-the-image-is-built)).
1860
+ on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#where-the-image-is-built)).
1847
1861
 
1848
1862
  **To adopt.**
1849
1863
 
@@ -1872,7 +1886,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
1872
1886
 
1873
1887
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
1874
1888
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
1875
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#media-configuration) for the
1889
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#media-configuration) for the
1876
1890
  CloudFront behavior it expects.
1877
1891
 
1878
1892
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -1897,7 +1911,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
1897
1911
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
1898
1912
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
1899
1913
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
1900
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#cross-account-asset-bucket).
1914
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#cross-account-asset-bucket).
1901
1915
 
1902
1916
  **To adopt.** Optional:
1903
1917
 
@@ -2007,7 +2021,7 @@ public JWKS PEM, used only to verify signatures.
2007
2021
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
2008
2022
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
2009
2023
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
2010
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/docs/deploying-to-aws.md#security-model)).
2024
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#security-model)).
2011
2025
 
2012
2026
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
2013
2027
 
@@ -2106,7 +2120,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
2106
2120
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
2107
2121
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
2108
2122
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
2109
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#media-configuration)). Two traps:
2123
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#media-configuration)). Two traps:
2110
2124
 
2111
2125
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
2112
2126
  a nested route prefix and emits zero params, building green.
@@ -2265,7 +2279,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2265
2279
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2266
2280
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2267
2281
  `createNextCanopyContext`'s result. See
2268
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2282
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2269
2283
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2270
2284
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2271
2285
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2322,7 +2336,7 @@ underscore-prefixed files are skipped.
2322
2336
 
2323
2337
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2324
2338
  `defaultPathAccess: { read: 'allow' }`
2325
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#public-read-on-server-deployments)).
2339
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#public-read-on-server-deployments)).
2326
2340
 
2327
2341
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2328
2342
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -2375,7 +2389,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
2375
2389
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
2376
2390
  gives one template's value type) requires exactly
2377
2391
  one component per block template name when written as an object literal. See
2378
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#block-component-registries) and
2392
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#block-component-registries) and
2379
2393
  `apps/example1/app/components/PostView.tsx`.
2380
2394
 
2381
2395
  ```ts
@@ -2397,7 +2411,7 @@ templates against the schema.
2397
2411
 
2398
2412
  **What changed.** Spreading a `const` field array into several schemas, and nesting
2399
2413
  `defineInlineFieldGroup()` inside a block template, are documented
2400
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2414
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2401
2415
  identity helper for them.
2402
2416
 
2403
2417
  ```ts
@@ -2416,7 +2430,7 @@ field by composing from the same `const` field object.
2416
2430
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
2417
2431
  it, and listings do with
2418
2432
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
2419
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#shared--referenced-blocks).
2433
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#shared--referenced-blocks).
2420
2434
 
2421
2435
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
2422
2436
 
@@ -2438,7 +2452,7 @@ Not retro-documented, apart from these:
2438
2452
 
2439
2453
  #### The registry is keyed by entry-type name (0.0.42)
2440
2454
 
2441
- **What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/18d436fe91546aabb30da8efa1397046b65681dc/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2455
+ **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/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2442
2456
 
2443
2457
  **To adopt.**
2444
2458
 
@@ -34,7 +34,7 @@ const updateBranchAccessBodySchema = z.object({
34
34
  allowedUsers: z.array(z.string()).optional(),
35
35
  allowedGroups: z.array(z.string()).optional(),
36
36
  });
37
- import { isPrivileged, isAdmin, isLockedOutOfBranch, loadPathPermissions, getBranchProtection, getBranchWriteProtection, } from '../authorization/index.js';
37
+ import { isPrivileged, isAdmin, loadPathPermissions, getBranchProtection, getBranchWriteProtection, } from '../authorization/index.js';
38
38
  import { operatingStrategy } from '../operating-mode/index.js';
39
39
  /**
40
40
  * Returns true if:
@@ -405,36 +405,9 @@ export const listBranchesHandler = async (ctx, req) => {
405
405
  // editor matches defaultBranch against registry names, so return the form
406
406
  // that can actually be found there.
407
407
  const defaultBranch = sanitizeBranchName(ctx.services.config.defaultActiveBranch ?? baseBranchOf(ctx.services.config));
408
- // Admins and Reviewers see all branches
409
- if (isPrivileged(req.user.groups)) {
410
- return branchListResponse(ctx, req, allBranches, defaultBranch);
411
- }
412
- // Regular users see the base branch and the branches they created or were given access to
413
- const visibleBranches = allBranches.filter((context) => {
414
- const branch = context.branch;
415
- // Ahead of every grant below, as in checkBranchAccessWithDefault.
416
- if (isLockedOutOfBranch(branch.access, req.user.groups)) {
417
- return false;
418
- }
419
- // The protected base branch is where every user lands by default; always
420
- // show it (read-only) so the editor can render its protected state.
421
- if (getBranchProtection(ctx.services.config, branch.name, branch.baseBranch).isProtected) {
422
- return true;
423
- }
424
- // User created the branch
425
- if (branch.createdBy === req.user.userId) {
426
- return true;
427
- }
428
- // User is in allowedUsers
429
- if (branch.access?.allowedUsers?.includes(req.user.userId)) {
430
- return true;
431
- }
432
- // User's group is in allowedGroups
433
- if (branch.access?.allowedGroups?.some((groupId) => req.user.groups?.includes(groupId))) {
434
- return true;
435
- }
436
- return false;
437
- });
408
+ // The access check is the rule: the list shows exactly the branches it grants, so the editor
409
+ // never lists a branch it cannot open, nor leaves out one it can.
410
+ const visibleBranches = allBranches.filter((context) => ctx.services.checkBranchAccess(context, req.user).allowed);
438
411
  return branchListResponse(ctx, req, visibleBranches, defaultBranch);
439
412
  };
440
413
  /**
@@ -25,10 +25,9 @@ export function checkBranchAccessWithDefault(context, user, defaultAccess = 'den
25
25
  const hasUserConstraint = !!access.allowedUsers?.length;
26
26
  const hasGroupConstraint = !!access.allowedGroups?.length;
27
27
  if (!hasUserConstraint && !hasGroupConstraint) {
28
- // The branch creator owns their own un-ACL'd branch, as listBranchesHandler,
29
- // canDeleteBranch and canModifyBranchAccess also grant: without it, under
30
- // 'deny' a creator could delete their branch and rewrite its ACL but not
31
- // read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
28
+ // The branch creator owns their own un-ACL'd branch, as canDeleteBranch and
29
+ // canModifyBranchAccess also grant: without it, under 'deny' a creator could
30
+ // delete their branch and rewrite its ACL but not read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
32
31
  // allowlist omitting the creator still denies them, which is how an admin
33
32
  // locks down a branch someone else created.
34
33
  if (context.branch.createdBy === user.userId) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CANOPYCMS_VERSION = "0.3.0";
1
+ export declare const CANOPYCMS_VERSION = "0.3.1";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/bump-version.mjs, its only writer. The package builds with plain
2
2
  // tsc (rootDir: src), so src/ cannot import ../package.json; version.test.ts keeps the two equal.
3
- export const CANOPYCMS_VERSION = '0.3.0';
3
+ export const CANOPYCMS_VERSION = '0.3.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@codemirror/language, @lezer/highlight: workaround — @mdxeditor/editor uses cm6-theme-basic-light which peer-requires these but mdxeditor doesn't declare them as dependencies",
3
3
  "name": "canopycms",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "CanopyCMS core package: schema-driven content, branch-aware editing, and editor UI for Next.js.",
6
6
  "license": "MIT",
7
7
  "repository": {