canopycms 0.0.68-int.98 → 0.1.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 +2131 -0
- package/README.md +47 -63
- package/dist/ai/generate.d.ts +5 -0
- package/dist/ai/generate.js +244 -115
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/json-to-markdown.d.ts +21 -1
- package/dist/ai/json-to-markdown.js +120 -57
- package/dist/ai/references.d.ts +72 -0
- package/dist/ai/references.js +223 -0
- package/dist/ai/resolve-branch.js +9 -2
- package/dist/ai/to-plain-text.d.ts +17 -8
- package/dist/ai/to-plain-text.js +18 -15
- package/dist/ai/types.d.ts +84 -3
- package/dist/api/admin-branch-health.d.ts +24 -1
- package/dist/api/admin-branch-health.js +52 -20
- package/dist/api/admin.d.ts +23 -5
- package/dist/api/admin.js +36 -1
- package/dist/api/assets.js +88 -78
- package/dist/api/branch-create-window.d.ts +12 -0
- package/dist/api/branch-create-window.js +13 -0
- package/dist/api/branch-merge.d.ts +1 -1
- package/dist/api/branch-merge.js +1 -1
- package/dist/api/branch-review.d.ts +3 -3
- package/dist/api/branch-review.js +16 -7
- package/dist/api/branch-status.d.ts +16 -6
- package/dist/api/branch-status.js +57 -12
- package/dist/api/branch-withdraw.d.ts +2 -2
- package/dist/api/branch-withdraw.js +8 -3
- package/dist/api/branch.d.ts +25 -12
- package/dist/api/branch.js +164 -103
- package/dist/api/client.d.ts +78 -58
- package/dist/api/client.js +150 -117
- package/dist/api/comments.d.ts +12 -3
- package/dist/api/comments.js +118 -9
- package/dist/api/content.d.ts +9 -9
- package/dist/api/content.js +131 -22
- package/dist/api/entries-constants.d.ts +14 -3
- package/dist/api/entries-constants.js +14 -3
- package/dist/api/entries.d.ts +40 -2
- package/dist/api/entries.js +102 -6
- package/dist/api/github-sync.d.ts +19 -0
- package/dist/api/github-sync.js +50 -3
- package/dist/api/groups.d.ts +4 -4
- package/dist/api/groups.js +2 -1
- package/dist/api/guards.js +23 -3
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +1 -0
- package/dist/api/permissions.d.ts +21 -2
- package/dist/api/permissions.js +50 -3
- package/dist/api/request-deadline.d.ts +59 -0
- package/dist/api/request-deadline.js +73 -0
- package/dist/api/resolve-references.js +8 -7
- package/dist/api/route-builder.d.ts +14 -0
- package/dist/api/route-builder.js +14 -1
- package/dist/api/schema.d.ts +11 -9
- package/dist/api/schema.js +2 -0
- package/dist/api/settings-helpers.d.ts +5 -1
- package/dist/api/settings-helpers.js +10 -2
- package/dist/api/types.d.ts +18 -0
- package/dist/api/users-constants.d.ts +6 -0
- package/dist/api/users-constants.js +6 -0
- package/dist/assets/asset-url.d.ts +28 -16
- package/dist/assets/asset-url.js +51 -25
- package/dist/assets/finalize.js +3 -0
- package/dist/assets/index.d.ts +1 -1
- package/dist/assets/materialize.d.ts +153 -0
- package/dist/assets/materialize.js +402 -0
- package/dist/assets/store-local.d.ts +19 -5
- package/dist/assets/store-local.js +69 -10
- package/dist/assets/store-s3.d.ts +38 -7
- package/dist/assets/store-s3.js +128 -22
- package/dist/assets/transform-directives.d.ts +52 -13
- package/dist/assets/transform-directives.js +87 -27
- package/dist/assets/transform.d.ts +3 -3
- package/dist/assets/transform.js +13 -8
- package/dist/assets/types.d.ts +31 -4
- package/dist/auth/cache.d.ts +1 -1
- package/dist/auth/cache.js +1 -1
- package/dist/auth/caching-auth-plugin.d.ts +2 -0
- package/dist/auth/caching-auth-plugin.js +12 -2
- package/dist/auth/file-based-auth-cache.d.ts +8 -0
- package/dist/auth/file-based-auth-cache.js +18 -8
- package/dist/auth/person-name.d.ts +5 -0
- package/dist/auth/person-name.js +8 -0
- package/dist/auth/plugin.d.ts +10 -1
- package/dist/auth/types.d.ts +2 -0
- package/dist/auth/user-metadata-lookup.d.ts +21 -0
- package/dist/auth/user-metadata-lookup.js +116 -0
- package/dist/authorization/branch.d.ts +1 -1
- package/dist/authorization/branch.js +12 -13
- package/dist/authorization/groups/schema.d.ts +4 -4
- package/dist/authorization/helpers.d.ts +8 -0
- package/dist/authorization/helpers.js +8 -0
- package/dist/authorization/index.d.ts +1 -1
- package/dist/authorization/index.js +1 -1
- package/dist/authorization/protected-branch.d.ts +5 -4
- package/dist/authorization/protected-branch.js +7 -5
- package/dist/branch-health.d.ts +35 -8
- package/dist/branch-health.js +54 -18
- package/dist/branch-metadata-error.d.ts +27 -0
- package/dist/branch-metadata-error.js +23 -0
- package/dist/branch-metadata-file.d.ts +205 -24
- package/dist/branch-metadata-file.js +126 -25
- package/dist/branch-metadata.d.ts +45 -6
- package/dist/branch-metadata.js +142 -50
- package/dist/branch-provisioning.d.ts +167 -0
- package/dist/branch-provisioning.js +501 -0
- package/dist/branch-registry.d.ts +8 -0
- package/dist/branch-registry.js +61 -9
- package/dist/branch-schema-cache.d.ts +29 -12
- package/dist/branch-schema-cache.js +64 -21
- package/dist/branch-sparse.d.ts +23 -0
- package/dist/branch-sparse.js +118 -0
- package/dist/branch-workspace.d.ts +42 -3
- package/dist/branch-workspace.js +239 -100
- package/dist/build/asset-refs.d.ts +94 -0
- package/dist/build/asset-refs.js +267 -0
- package/dist/build/generate-ai-content.js +5 -0
- package/dist/build/inline-flight.d.ts +37 -0
- package/dist/build/inline-flight.js +142 -0
- package/dist/cli/asset-refs.d.ts +52 -0
- package/dist/cli/asset-refs.js +194 -0
- package/dist/cli/cli.d.ts +15 -1
- package/dist/cli/cli.js +8543 -3193
- package/dist/cli/configured-asset-store.d.ts +12 -0
- package/dist/cli/configured-asset-store.js +46 -0
- package/dist/cli/generate-ai-content.js +4244 -1072
- package/dist/cli/init.js +217 -126
- package/dist/cli/project-detect.d.ts +2 -0
- package/dist/cli/project-detect.js +2 -0
- package/dist/cli/template-files/Dockerfile.cms.template +13 -5
- package/dist/cli/template-files/cms-stack.ts.template +16 -13
- package/dist/client.d.ts +1 -2
- package/dist/client.js +1 -2
- package/dist/comment-store.d.ts +25 -0
- package/dist/comment-store.js +43 -8
- package/dist/config/flatten.js +2 -0
- package/dist/config/helpers.js +2 -2
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schemas/config.d.ts +12 -29
- package/dist/config/schemas/config.js +9 -12
- package/dist/config/schemas/field.d.ts +3 -0
- package/dist/config/schemas/field.js +58 -4
- package/dist/config/schemas/media.d.ts +4 -13
- package/dist/config/schemas/media.js +5 -8
- package/dist/config/schemas/url.d.ts +2 -20
- package/dist/config/schemas/url.js +2 -25
- package/dist/config/types.d.ts +116 -22
- package/dist/config/types.js +3 -9
- package/dist/config/validation.d.ts +25 -4
- package/dist/config/validation.js +116 -3
- package/dist/content-id-index.js +2 -2
- package/dist/content-index-generation.d.ts +1 -1
- package/dist/content-index-generation.js +1 -1
- package/dist/content-listing.d.ts +10 -1
- package/dist/content-listing.js +22 -5
- package/dist/content-reader.d.ts +9 -0
- package/dist/content-reader.js +16 -11
- package/dist/content-store.d.ts +75 -12
- package/dist/content-store.js +249 -86
- package/dist/content-tree.js +2 -2
- package/dist/context.js +5 -2
- package/dist/dangling-reference-log.d.ts +17 -0
- package/dist/dangling-reference-log.js +29 -0
- package/dist/dev-content-watcher.d.ts +1 -1
- package/dist/dev-content-watcher.js +1 -1
- package/dist/editor/BranchManager.d.ts +23 -7
- package/dist/editor/BranchManager.js +119 -54
- package/dist/editor/CanopyEditor.d.ts +1 -1
- package/dist/editor/CanopyEditor.js +1 -2
- package/dist/editor/CommentsPanel.d.ts +14 -0
- package/dist/editor/CommentsPanel.js +68 -43
- package/dist/editor/Editor.d.ts +11 -5
- package/dist/editor/Editor.js +891 -218
- package/dist/editor/EditorAuthGate.d.ts +7 -1
- package/dist/editor/EditorAuthGate.js +41 -9
- package/dist/editor/EntryNavigator.d.ts +22 -0
- package/dist/editor/EntryNavigator.js +353 -105
- package/dist/editor/FormHeader.d.ts +25 -0
- package/dist/editor/FormHeader.js +82 -0
- package/dist/editor/FormRenderer.d.ts +27 -3
- package/dist/editor/FormRenderer.js +171 -76
- package/dist/editor/PreviewFrame.d.ts +40 -0
- package/dist/editor/PreviewFrame.js +215 -0
- package/dist/editor/PreviewPane.d.ts +47 -0
- package/dist/editor/PreviewPane.js +147 -0
- package/dist/editor/PreviewToolbarTools.d.ts +22 -0
- package/dist/editor/PreviewToolbarTools.js +73 -0
- package/dist/editor/admin/SystemHealthPanel.d.ts +2 -1
- package/dist/editor/admin/SystemHealthPanel.js +163 -33
- package/dist/editor/admin/useSystemHealth.d.ts +18 -0
- package/dist/editor/admin/useSystemHealth.js +70 -1
- package/dist/editor/branch-status.d.ts +17 -0
- package/dist/editor/branch-status.js +29 -0
- package/dist/editor/canopy-path.d.ts +9 -6
- package/dist/editor/canopy-path.js +8 -11
- package/dist/editor/client-reference-resolver.d.ts +43 -16
- package/dist/editor/client-reference-resolver.js +155 -64
- package/dist/editor/comments/BranchComments.d.ts +1 -1
- package/dist/editor/comments/BranchComments.js +2 -2
- package/dist/editor/comments/CloseRefusedNotice.d.ts +4 -0
- package/dist/editor/comments/CloseRefusedNotice.js +7 -0
- package/dist/editor/comments/CommentThreadsPopover.d.ts +47 -0
- package/dist/editor/comments/CommentThreadsPopover.js +274 -0
- package/dist/editor/comments/CommentWriteAlert.d.ts +11 -0
- package/dist/editor/comments/CommentWriteAlert.js +13 -0
- package/dist/editor/comments/EntryComments.d.ts +10 -4
- package/dist/editor/comments/EntryComments.js +14 -17
- package/dist/editor/comments/FieldWrapper.d.ts +18 -4
- package/dist/editor/comments/FieldWrapper.js +62 -28
- package/dist/editor/comments/InlineCommentThread.d.ts +9 -2
- package/dist/editor/comments/InlineCommentThread.js +11 -47
- package/dist/editor/comments/ThreadCarousel.d.ts +1 -1
- package/dist/editor/comments/ThreadCarousel.js +18 -21
- package/dist/editor/comments/ThreadReplyControls.d.ts +28 -0
- package/dist/editor/comments/ThreadReplyControls.js +92 -0
- package/dist/editor/comments/field-comment-context.d.ts +14 -0
- package/dist/editor/comments/field-comment-context.js +14 -0
- package/dist/editor/comments/form-comments.d.ts +48 -0
- package/dist/editor/comments/form-comments.js +178 -0
- package/dist/editor/comments/item-anchor-copy.d.ts +6 -0
- package/dist/editor/comments/item-anchor-copy.js +6 -0
- package/dist/editor/comments/move-focus-if-unmoved.d.ts +6 -0
- package/dist/editor/comments/move-focus-if-unmoved.js +11 -0
- package/dist/editor/comments/popover-placement.d.ts +18 -0
- package/dist/editor/comments/popover-placement.js +58 -0
- package/dist/editor/comments/use-tracked-writes.d.ts +16 -0
- package/dist/editor/comments/use-tracked-writes.js +53 -0
- package/dist/editor/components/BranchAccessList.d.ts +15 -0
- package/dist/editor/components/BranchAccessList.js +52 -0
- package/dist/editor/components/BranchLockBanner.d.ts +22 -0
- package/dist/editor/components/BranchLockBanner.js +39 -0
- package/dist/editor/components/BranchPill.d.ts +32 -0
- package/dist/editor/components/BranchPill.js +33 -0
- package/dist/editor/components/BranchesDrawer.d.ts +11 -0
- package/dist/editor/components/BranchesDrawer.js +5 -0
- package/dist/editor/components/ConfirmDeleteModal.d.ts +6 -1
- package/dist/editor/components/ConfirmDeleteModal.js +3 -2
- package/dist/editor/components/DestructiveMenuItem.d.ts +7 -0
- package/dist/editor/components/DestructiveMenuItem.js +8 -0
- package/dist/editor/components/EditorCrashScreen.d.ts +17 -0
- package/dist/editor/components/EditorCrashScreen.js +22 -0
- package/dist/editor/components/EditorErrorBoundary.d.ts +38 -0
- package/dist/editor/components/EditorErrorBoundary.js +40 -0
- package/dist/editor/components/EditorHeader.d.ts +56 -106
- package/dist/editor/components/EditorHeader.js +130 -131
- package/dist/editor/components/EditorRail.d.ts +49 -0
- package/dist/editor/components/EditorRail.js +65 -0
- package/dist/editor/components/EntryBreadcrumb.d.ts +33 -0
- package/dist/editor/components/EntryBreadcrumb.js +56 -0
- package/dist/editor/components/EntryCreateModal.d.ts +12 -7
- package/dist/editor/components/EntryCreateModal.js +51 -57
- package/dist/editor/components/NoEditPermissionNotice.d.ts +6 -5
- package/dist/editor/components/NoEditPermissionNotice.js +5 -4
- package/dist/editor/components/QuickOpenPalette.d.ts +22 -0
- package/dist/editor/components/QuickOpenPalette.js +66 -0
- package/dist/editor/components/ReadOnlyDraftNotice.d.ts +11 -0
- package/dist/editor/components/ReadOnlyDraftNotice.js +12 -0
- package/dist/editor/components/ReasonedMenuItem.d.ts +15 -0
- package/dist/editor/components/ReasonedMenuItem.js +15 -0
- package/dist/editor/components/ReferencedByList.d.ts +11 -0
- package/dist/editor/components/ReferencedByList.js +28 -0
- package/dist/editor/components/RelativeTime.d.ts +10 -0
- package/dist/editor/components/RelativeTime.js +10 -0
- package/dist/editor/components/RenameEntryModal.d.ts +9 -1
- package/dist/editor/components/RenameEntryModal.js +19 -31
- package/dist/editor/components/RetryToastMessage.d.ts +9 -0
- package/dist/editor/components/RetryToastMessage.js +6 -0
- package/dist/editor/components/SaveAllResult.d.ts +25 -0
- package/dist/editor/components/SaveAllResult.js +86 -0
- package/dist/editor/components/SaveSplitButton.d.ts +30 -0
- package/dist/editor/components/SaveSplitButton.js +108 -0
- package/dist/editor/components/StagedChangesDrawer.d.ts +39 -0
- package/dist/editor/components/StagedChangesDrawer.js +92 -0
- package/dist/editor/components/UnavailableEntryNotice.d.ts +6 -0
- package/dist/editor/components/UnavailableEntryNotice.js +9 -0
- package/dist/editor/components/UnavailableTypeMessage.d.ts +6 -0
- package/dist/editor/components/UnavailableTypeMessage.js +9 -0
- package/dist/editor/components/UndoToastMessage.d.ts +18 -0
- package/dist/editor/components/UndoToastMessage.js +10 -0
- package/dist/editor/components/UserBadge.d.ts +2 -5
- package/dist/editor/components/UserBadge.js +62 -33
- package/dist/editor/components/ValidationSummary.d.ts +14 -0
- package/dist/editor/components/ValidationSummary.js +24 -0
- package/dist/editor/components/index.d.ts +2 -2
- package/dist/editor/components/index.js +2 -2
- package/dist/editor/context/ApiClientContext.d.ts +8 -2
- package/dist/editor/context/ApiClientContext.js +19 -8
- package/dist/editor/context/AssetContext.d.ts +13 -35
- package/dist/editor/context/AssetContext.js +12 -31
- package/dist/editor/context/EditorStateContext.d.ts +4 -4
- package/dist/editor/context/EditorStateContext.js +4 -4
- package/dist/editor/context/SWRProvider.d.ts +3 -3
- package/dist/editor/context/SiteMdxAllowContext.d.ts +4 -0
- package/dist/editor/context/SiteMdxAllowContext.js +7 -0
- package/dist/editor/context/index.d.ts +2 -1
- package/dist/editor/context/index.js +2 -1
- package/dist/editor/contrast.d.ts +19 -0
- package/dist/editor/contrast.js +41 -0
- package/dist/editor/copy.d.ts +18 -0
- package/dist/editor/copy.js +18 -0
- package/dist/editor/editor-config.js +16 -0
- package/dist/editor/editor-utils.d.ts +34 -8
- package/dist/editor/editor-utils.js +42 -20
- package/dist/editor/entry-search.d.ts +20 -0
- package/dist/editor/entry-search.js +34 -0
- package/dist/editor/field-breadcrumb.d.ts +12 -0
- package/dist/editor/field-breadcrumb.js +85 -0
- package/dist/editor/field-props.d.ts +86 -0
- package/dist/editor/field-props.js +27 -0
- package/dist/editor/field-target.d.ts +30 -0
- package/dist/editor/field-target.js +77 -0
- package/dist/editor/fields/BlockField.d.ts +12 -0
- package/dist/editor/fields/BlockField.js +89 -73
- package/dist/editor/fields/CodeField.d.ts +2 -0
- package/dist/editor/fields/CodeField.js +6 -2
- package/dist/editor/fields/DateTimeField.d.ts +4 -29
- package/dist/editor/fields/DateTimeField.js +79 -41
- package/dist/editor/fields/ExpandAllButton.d.ts +6 -0
- package/dist/editor/fields/ExpandAllButton.js +4 -0
- package/dist/editor/fields/FieldCrashFallback.d.ts +17 -0
- package/dist/editor/fields/FieldCrashFallback.js +30 -0
- package/dist/editor/fields/FieldLabel.d.ts +37 -0
- package/dist/editor/fields/FieldLabel.js +19 -0
- package/dist/editor/fields/ImageField.d.ts +4 -0
- package/dist/editor/fields/ImageField.js +29 -14
- package/dist/editor/fields/InlineGroupField.js +4 -3
- package/dist/editor/fields/ItemList.d.ts +42 -0
- package/dist/editor/fields/ItemList.js +130 -0
- package/dist/editor/fields/MarkdownField.d.ts +32 -0
- package/dist/editor/fields/MarkdownField.js +223 -46
- package/dist/editor/fields/MdxImageDialog.js +1 -1
- package/dist/editor/fields/NumberField.d.ts +2 -0
- package/dist/editor/fields/NumberField.js +8 -5
- package/dist/editor/fields/NumberListField.d.ts +2 -0
- package/dist/editor/fields/NumberListField.js +19 -16
- package/dist/editor/fields/ObjectField.d.ts +2 -7
- package/dist/editor/fields/ObjectField.js +15 -5
- package/dist/editor/fields/ObjectListField.d.ts +29 -0
- package/dist/editor/fields/ObjectListField.js +57 -0
- package/dist/editor/fields/ReferenceField.d.ts +2 -0
- package/dist/editor/fields/ReferenceField.js +34 -9
- package/dist/editor/fields/SelectField.d.ts +2 -0
- package/dist/editor/fields/SelectField.js +11 -2
- package/dist/editor/fields/StringListField.d.ts +4 -1
- package/dist/editor/fields/StringListField.js +22 -8
- package/dist/editor/fields/TextField.d.ts +2 -0
- package/dist/editor/fields/TextField.js +6 -2
- package/dist/editor/fields/ToggleField.d.ts +2 -0
- package/dist/editor/fields/ToggleField.js +8 -3
- package/dist/editor/fields/entry-link/InsertEntryLink.d.ts +1 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.js +1 -1
- package/dist/editor/fields/form-expansion.d.ts +9 -0
- package/dist/editor/fields/form-expansion.js +2 -0
- package/dist/editor/fields/item-expansion.d.ts +15 -0
- package/dist/editor/fields/item-expansion.js +60 -0
- package/dist/editor/fields/list-item-keys.d.ts +8 -0
- package/dist/editor/fields/list-item-keys.js +50 -0
- package/dist/editor/fields/list-item-title.d.ts +20 -0
- package/dist/editor/fields/list-item-title.js +85 -0
- package/dist/editor/fields/markdown-export-options.d.ts +2 -0
- package/dist/editor/fields/markdown-export-options.js +8 -0
- package/dist/editor/fields/markdown-fidelity-visitors.d.ts +11 -0
- package/dist/editor/fields/markdown-fidelity-visitors.js +160 -0
- package/dist/editor/fields/mdx-jsx-support.d.ts +5 -1
- package/dist/editor/fields/mdx-jsx-support.js +157 -69
- package/dist/editor/fields/rich-text-failures.d.ts +5 -0
- package/dist/editor/fields/rich-text-failures.js +26 -0
- package/dist/editor/fields/toolbar-wrap.d.ts +7 -0
- package/dist/editor/fields/toolbar-wrap.js +35 -0
- package/dist/editor/form-outline.d.ts +13 -0
- package/dist/editor/form-outline.js +70 -0
- package/dist/editor/group-manager/GroupCard.d.ts +4 -1
- package/dist/editor/group-manager/GroupCard.js +12 -3
- package/dist/editor/group-manager/GroupForm.js +1 -1
- package/dist/editor/group-manager/InternalGroupsTab.d.ts +2 -1
- package/dist/editor/group-manager/InternalGroupsTab.js +4 -4
- package/dist/editor/group-manager/MemberList.d.ts +2 -1
- package/dist/editor/group-manager/MemberList.js +15 -4
- package/dist/editor/group-manager/hooks/useGroupState.d.ts +5 -0
- package/dist/editor/group-manager/hooks/useGroupState.js +30 -7
- package/dist/editor/group-manager/index.js +34 -5
- package/dist/editor/group-manager/types.d.ts +5 -2
- package/dist/editor/hooks/create-branch-request.d.ts +20 -0
- package/dist/editor/hooks/create-branch-request.js +54 -0
- package/dist/editor/hooks/save-all.d.ts +68 -0
- package/dist/editor/hooks/save-all.js +61 -0
- package/dist/editor/hooks/useBranchActions.d.ts +11 -1
- package/dist/editor/hooks/useBranchActions.js +42 -19
- package/dist/editor/hooks/useBranchManager.d.ts +21 -0
- package/dist/editor/hooks/useBranchManager.js +321 -125
- package/dist/editor/hooks/useBranchesData.d.ts +8 -4
- package/dist/editor/hooks/useBranchesData.js +9 -5
- package/dist/editor/hooks/useCommentSystem.d.ts +14 -2
- package/dist/editor/hooks/useCommentSystem.js +79 -55
- package/dist/editor/hooks/useCommentsData.d.ts +11 -7
- package/dist/editor/hooks/useCommentsData.js +20 -19
- package/dist/editor/hooks/useDraftManager.d.ts +77 -3
- package/dist/editor/hooks/useDraftManager.js +887 -94
- package/dist/editor/hooks/useEditorLayout.d.ts +53 -7
- package/dist/editor/hooks/useEditorLayout.js +98 -20
- package/dist/editor/hooks/useEntriesData.d.ts +2 -1
- package/dist/editor/hooks/useEntriesData.js +18 -4
- package/dist/editor/hooks/useEntryManager.d.ts +41 -2
- package/dist/editor/hooks/useEntryManager.js +227 -41
- package/dist/editor/hooks/useGroupManager.js +13 -16
- package/dist/editor/hooks/usePermissionManager.js +14 -6
- package/dist/editor/hooks/usePreviewMarks.d.ts +21 -0
- package/dist/editor/hooks/usePreviewMarks.js +33 -0
- package/dist/editor/hooks/useReferenceResolution.d.ts +10 -3
- package/dist/editor/hooks/useReferenceResolution.js +34 -177
- package/dist/editor/hooks/useSchemaManager.d.ts +25 -6
- package/dist/editor/hooks/useSchemaManager.js +97 -39
- package/dist/editor/hooks/useUserMetadata.d.ts +14 -4
- package/dist/editor/hooks/useUserMetadata.js +76 -47
- package/dist/editor/hooks/user-metadata-batcher.d.ts +8 -0
- package/dist/editor/hooks/user-metadata-batcher.js +33 -0
- package/dist/editor/media/AssetCard.d.ts +6 -7
- package/dist/editor/media/AssetCard.js +24 -31
- package/dist/editor/media/AssetListRow.d.ts +16 -0
- package/dist/editor/media/AssetListRow.js +41 -0
- package/dist/editor/media/CropStep.js +6 -1
- package/dist/editor/media/MediaLibrary.d.ts +4 -3
- package/dist/editor/media/MediaLibrary.js +11 -4
- package/dist/editor/media/MediaLibraryBody.d.ts +3 -3
- package/dist/editor/media/MediaLibraryBody.js +195 -80
- package/dist/editor/media/MediaLibrarySkeleton.d.ts +6 -0
- package/dist/editor/media/MediaLibrarySkeleton.js +14 -0
- package/dist/editor/media/crop-math.d.ts +3 -4
- package/dist/editor/media/crop-math.js +11 -22
- package/dist/editor/media/editor-image-src.d.ts +8 -0
- package/dist/editor/media/editor-image-src.js +10 -0
- package/dist/editor/media/format-bytes.d.ts +2 -0
- package/dist/editor/media/format-bytes.js +23 -0
- package/dist/editor/media/media-library-prefs.d.ts +23 -0
- package/dist/editor/media/media-library-prefs.js +49 -0
- package/dist/editor/media/media-library-view.d.ts +34 -0
- package/dist/editor/media/media-library-view.js +40 -0
- package/dist/editor/media/useAssetLibrary.d.ts +30 -0
- package/dist/editor/media/useAssetLibrary.js +126 -0
- package/dist/editor/media/useStableAssetOrder.d.ts +11 -0
- package/dist/editor/media/useStableAssetOrder.js +37 -0
- package/dist/editor/media/useThumbnailFailure.d.ts +6 -0
- package/dist/editor/media/useThumbnailFailure.js +16 -0
- package/dist/editor/permission-manager/GroupSelector.js +2 -2
- package/dist/editor/permission-manager/PermissionEditor.d.ts +1 -1
- package/dist/editor/permission-manager/PermissionEditor.js +15 -4
- package/dist/editor/permission-manager/PermissionLevelBadge.js +1 -1
- package/dist/editor/permission-manager/PermissionTree.d.ts +1 -1
- package/dist/editor/permission-manager/UserSelector.d.ts +1 -1
- package/dist/editor/permission-manager/UserSelector.js +3 -3
- package/dist/editor/permission-manager/index.js +12 -3
- package/dist/editor/permission-manager/types.d.ts +5 -2
- package/dist/editor/platform.d.ts +3 -0
- package/dist/editor/platform.js +9 -0
- package/dist/editor/preview-asset-base.d.ts +9 -0
- package/dist/editor/preview-asset-base.js +17 -0
- package/dist/editor/preview-bridge.d.ts +51 -27
- package/dist/editor/preview-bridge.js +103 -144
- package/dist/editor/preview-marks.d.ts +15 -0
- package/dist/editor/preview-marks.js +74 -0
- package/dist/editor/preview-path.d.ts +12 -0
- package/dist/editor/preview-path.js +45 -1
- package/dist/editor/preview-scale.d.ts +27 -0
- package/dist/editor/preview-scale.js +34 -0
- package/dist/editor/raw-asset-base.d.ts +5 -0
- package/dist/editor/raw-asset-base.js +14 -0
- package/dist/editor/relative-time.d.ts +4 -4
- package/dist/editor/relative-time.js +16 -8
- package/dist/editor/schema-editor/CollectionEditor.d.ts +20 -3
- package/dist/editor/schema-editor/CollectionEditor.js +361 -62
- package/dist/editor/schema-editor/EntryTypeEditor.d.ts +5 -1
- package/dist/editor/schema-editor/EntryTypeEditor.js +11 -6
- package/dist/editor/schema-editor/collection-draft.d.ts +22 -0
- package/dist/editor/schema-editor/collection-draft.js +40 -0
- package/dist/editor/schema-editor/index.d.ts +1 -1
- package/dist/editor/schema-label.d.ts +10 -0
- package/dist/editor/schema-label.js +17 -0
- package/dist/editor/settings-conflict.d.ts +5 -0
- package/dist/editor/settings-conflict.js +8 -0
- package/dist/editor/shell/ActivityRail.d.ts +37 -0
- package/dist/editor/shell/ActivityRail.js +91 -0
- package/dist/editor/shell/EditorShell.d.ts +17 -0
- package/dist/editor/shell/EditorShell.js +31 -0
- package/dist/editor/shell/PaneLayout.d.ts +28 -0
- package/dist/editor/shell/PaneLayout.js +116 -0
- package/dist/editor/shell/SidePanelHost.d.ts +35 -0
- package/dist/editor/shell/SidePanelHost.js +184 -0
- package/dist/editor/shell/TopBar.d.ts +12 -0
- package/dist/editor/shell/TopBar.js +14 -0
- package/dist/editor/shell/host-chrome.d.ts +16 -0
- package/dist/editor/shell/host-chrome.js +69 -0
- package/dist/editor/slug.d.ts +16 -0
- package/dist/editor/slug.js +43 -0
- package/dist/editor/theme.d.ts +2 -1
- package/dist/editor/theme.js +314 -13
- package/dist/editor/unanswered.d.ts +17 -0
- package/dist/editor/unanswered.js +26 -0
- package/dist/editor/unavailable-entry-type.d.ts +20 -0
- package/dist/editor/unavailable-entry-type.js +28 -0
- package/dist/editor/undo-removal.d.ts +57 -0
- package/dist/editor/undo-removal.js +163 -0
- package/dist/editor/user-display.d.ts +4 -0
- package/dist/editor/user-display.js +5 -0
- package/dist/editor/utils/confirm-modal.d.ts +8 -0
- package/dist/editor/utils/confirm-modal.js +12 -0
- package/dist/editor/utils/editor-errors.d.ts +19 -0
- package/dist/editor/utils/editor-errors.js +32 -0
- package/dist/editor/utils/focus-return.d.ts +56 -0
- package/dist/editor/utils/focus-return.js +106 -0
- package/dist/entry-link-resolver.d.ts +11 -1
- package/dist/entry-link-resolver.js +65 -5
- package/dist/entry-schema-registry.d.ts +3 -3
- package/dist/entry-schema-registry.js +7 -4
- package/dist/entry-schema.d.ts +49 -3
- package/dist/entry-schema.js +18 -0
- package/dist/git-manager.d.ts +172 -10
- package/dist/git-manager.js +449 -107
- package/dist/github-service.d.ts +39 -2
- package/dist/github-service.js +101 -7
- package/dist/http/handler.js +74 -9
- package/dist/http/types.d.ts +2 -0
- package/dist/http/worker-not-ready.d.ts +9 -4
- package/dist/http/worker-not-ready.js +59 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/item-keys.d.ts +46 -0
- package/dist/item-keys.js +235 -0
- package/dist/operating-mode/editor-mode-check.d.ts +15 -0
- package/dist/operating-mode/editor-mode-check.js +24 -0
- package/dist/operating-mode/mode-env.d.ts +13 -14
- package/dist/operating-mode/mode-env.js +13 -14
- package/dist/operating-mode/types.d.ts +2 -2
- package/dist/paths/branch.d.ts +0 -1
- package/dist/paths/branch.js +1 -8
- package/dist/paths/index.d.ts +1 -1
- package/dist/paths/index.js +1 -1
- package/dist/paths/validation.js +0 -2
- package/dist/preview.d.ts +8 -0
- package/dist/preview.js +7 -0
- package/dist/reference-resolver.js +1 -0
- package/dist/resolve-canopy-user.d.ts +1 -1
- package/dist/resolve-canopy-user.js +1 -1
- package/dist/schema/meta-loader.d.ts +18 -8
- package/dist/schema/meta-loader.js +42 -9
- package/dist/schema/registry-fingerprint.d.ts +14 -0
- package/dist/schema/registry-fingerprint.js +63 -0
- package/dist/schema/resolver.d.ts +7 -4
- package/dist/schema/resolver.js +7 -6
- package/dist/schema/schema-store.d.ts +7 -10
- package/dist/schema/schema-store.js +13 -11
- package/dist/schema/schema-unavailable-error.d.ts +11 -0
- package/dist/schema/schema-unavailable-error.js +15 -0
- package/dist/schema/types.d.ts +22 -0
- package/dist/schema-registry-record.d.ts +35 -0
- package/dist/schema-registry-record.js +134 -0
- package/dist/server.d.ts +79 -9
- package/dist/server.js +62 -8
- package/dist/services.d.ts +33 -5
- package/dist/services.js +155 -37
- package/dist/settings-workspace.d.ts +23 -3
- package/dist/settings-workspace.js +159 -45
- package/dist/stamp-on-publish.d.ts +36 -0
- package/dist/stamp-on-publish.js +71 -0
- package/dist/static/index.d.ts +58 -5
- package/dist/static/index.js +133 -3
- package/dist/static/seo.d.ts +5 -5
- package/dist/static/seo.js +5 -5
- package/dist/submission-attribution.d.ts +8 -0
- package/dist/submission-attribution.js +22 -0
- package/dist/system-users.d.ts +12 -0
- package/dist/system-users.js +12 -0
- package/dist/task-queue/cms-task-queue.d.ts +1 -1
- package/dist/task-queue/cms-task-queue.js +1 -1
- package/dist/task-queue/index.d.ts +1 -1
- package/dist/task-queue/index.js +1 -1
- package/dist/task-queue/task-queue.d.ts +6 -0
- package/dist/task-queue/task-queue.js +29 -0
- package/dist/task-queue/worker-status.d.ts +35 -9
- package/dist/task-queue/worker-status.js +84 -17
- package/dist/types.d.ts +90 -9
- package/dist/url-collision.js +3 -3
- package/dist/url-exclusivity-fixtures.d.ts +8 -1
- package/dist/url-exclusivity-fixtures.js +11 -1
- package/dist/user.js +2 -1
- package/dist/utils/atomic-write.js +2 -1
- package/dist/utils/base-branch.d.ts +13 -0
- package/dist/utils/base-branch.js +23 -0
- package/dist/utils/content-serialize.d.ts +15 -7
- package/dist/utils/content-serialize.js +353 -51
- package/dist/utils/content-write-lock.d.ts +6 -1
- package/dist/utils/content-write-lock.js +21 -6
- package/dist/utils/debug.d.ts +1 -1
- package/dist/utils/debug.js +5 -3
- package/dist/utils/error.js +13 -2
- package/dist/utils/escape-text.d.ts +7 -0
- package/dist/utils/escape-text.js +27 -0
- package/dist/utils/fs.d.ts +12 -4
- package/dist/utils/fs.js +18 -5
- package/dist/utils/git.d.ts +21 -1
- package/dist/utils/git.js +63 -8
- package/dist/utils/json-source-splice.d.ts +14 -0
- package/dist/utils/json-source-splice.js +120 -0
- package/dist/utils/markdown-body-splice.d.ts +39 -0
- package/dist/utils/markdown-body-splice.js +421 -0
- package/dist/utils/occ-json-write.js +18 -12
- package/dist/utils/provision-log.d.ts +25 -0
- package/dist/utils/provision-log.js +49 -0
- package/dist/utils/provisioning-lock.d.ts +32 -1
- package/dist/utils/provisioning-lock.js +78 -32
- package/dist/utils/sanitize-href.d.ts +9 -23
- package/dist/utils/sanitize-href.js +14 -28
- package/dist/utils/title-field.d.ts +10 -0
- package/dist/utils/title-field.js +47 -0
- package/dist/utils/yaml-source-splice.d.ts +58 -0
- package/dist/utils/yaml-source-splice.js +515 -0
- package/dist/validation/block-structural-keys.d.ts +1 -1
- package/dist/validation/block-structural-keys.js +1 -1
- package/dist/validation/deletion-checker.d.ts +21 -29
- package/dist/validation/deletion-checker.js +41 -117
- package/dist/validation/entry-validator.d.ts +6 -10
- package/dist/validation/entry-validator.js +19 -26
- package/dist/validation/field-traversal.d.ts +22 -0
- package/dist/validation/field-traversal.js +39 -8
- package/dist/validation/markdown-safety.d.ts +68 -0
- package/dist/validation/markdown-safety.js +596 -0
- package/dist/validation/mdx-allowlist.d.ts +55 -0
- package/dist/validation/mdx-allowlist.js +183 -0
- package/dist/validation/reference-validator.d.ts +2 -0
- package/dist/validation/reference-validator.js +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/branch-policy.d.ts +124 -0
- package/dist/worker/branch-policy.js +243 -0
- package/dist/worker/bundle-header.d.ts +117 -0
- package/dist/worker/bundle-header.js +253 -0
- package/dist/worker/cms-worker.d.ts +236 -142
- package/dist/worker/cms-worker.js +772 -285
- package/dist/worker/gateway-egress.d.ts +43 -0
- package/dist/worker/gateway-egress.js +209 -0
- package/dist/worker/gateway-instance.d.ts +42 -0
- package/dist/worker/gateway-instance.js +129 -0
- package/dist/worker/git-process.d.ts +81 -0
- package/dist/worker/git-process.js +234 -0
- package/dist/worker/git-sync.d.ts +34 -17
- package/dist/worker/git-sync.js +394 -131
- package/dist/worker/github-auth.d.ts +9 -9
- package/dist/worker/github-auth.js +13 -15
- package/dist/worker/github-gateway-http.d.ts +62 -0
- package/dist/worker/github-gateway-http.js +977 -0
- package/dist/worker/github-gateway-wire.d.ts +590 -0
- package/dist/worker/github-gateway-wire.js +488 -0
- package/dist/worker/github-gateway.d.ts +238 -0
- package/dist/worker/github-gateway.js +726 -0
- package/dist/worker/github-mirror-upkeep.d.ts +75 -0
- package/dist/worker/github-mirror-upkeep.js +266 -0
- package/dist/worker/github-mirror.d.ts +364 -0
- package/dist/worker/github-mirror.js +1030 -0
- package/dist/worker/github-transfer.d.ts +56 -0
- package/dist/worker/github-transfer.js +444 -0
- package/dist/worker/history-rewrite.d.ts +4 -5
- package/dist/worker/history-rewrite.js +12 -17
- package/dist/worker/provisioned-workspace.d.ts +5 -5
- package/dist/worker/provisioned-workspace.js +5 -5
- package/dist/worker/rebase.d.ts +1 -1
- package/dist/worker/rebase.js +58 -54
- package/dist/worker/remote-git-maintenance.d.ts +3 -0
- package/dist/worker/remote-git-maintenance.js +12 -0
- package/dist/worker/schema-gate.d.ts +49 -0
- package/dist/worker/schema-gate.js +226 -0
- package/dist/worker/self-checks.d.ts +107 -0
- package/dist/worker/self-checks.js +358 -0
- package/dist/worker/shared-repo-git.d.ts +96 -0
- package/dist/worker/shared-repo-git.js +459 -0
- package/dist/worker/sparse-cone.d.ts +20 -0
- package/dist/worker/sparse-cone.js +136 -0
- package/dist/worker/stale-mirror.d.ts +82 -0
- package/dist/worker/stale-mirror.js +130 -0
- package/dist/worker/task-runner.d.ts +5 -3
- package/dist/worker/task-runner.js +287 -186
- package/dist/worker/worker-context.d.ts +36 -37
- package/package.json +35 -7
- package/dist/editor/EditorPanes.d.ts +0 -10
- package/dist/editor/EditorPanes.js +0 -98
- package/dist/editor/components/EditorFooter.d.ts +0 -11
- package/dist/editor/components/EditorFooter.js +0 -9
- package/dist/editor/components/EditorSidebar.d.ts +0 -67
- package/dist/editor/components/EditorSidebar.js +0 -22
package/dist/cli/init.js
CHANGED
|
@@ -22,19 +22,13 @@ var init_logger = __esm({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
// dist/config/types.js
|
|
25
|
-
var primitiveFieldTypes, fieldTypes;
|
|
25
|
+
var scalarFieldTypes, markdownFieldTypes, primitiveFieldTypes, fieldTypes;
|
|
26
26
|
var init_types = __esm({
|
|
27
27
|
"dist/config/types.js"() {
|
|
28
28
|
"use strict";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"boolean",
|
|
33
|
-
"datetime",
|
|
34
|
-
"markdown",
|
|
35
|
-
"mdx",
|
|
36
|
-
"code"
|
|
37
|
-
];
|
|
29
|
+
scalarFieldTypes = ["string", "number", "boolean", "datetime", "code"];
|
|
30
|
+
markdownFieldTypes = ["markdown", "mdx"];
|
|
31
|
+
primitiveFieldTypes = [...scalarFieldTypes, ...markdownFieldTypes];
|
|
38
32
|
fieldTypes = [
|
|
39
33
|
...primitiveFieldTypes,
|
|
40
34
|
"image",
|
|
@@ -47,13 +41,131 @@ var init_types = __esm({
|
|
|
47
41
|
}
|
|
48
42
|
});
|
|
49
43
|
|
|
44
|
+
// dist/validation/mdx-allowlist.js
|
|
45
|
+
function isComponentName(name) {
|
|
46
|
+
return COMPONENT_NAME.test(name) && !MDX_BINDINGS.has(name);
|
|
47
|
+
}
|
|
48
|
+
function isRefusedComponentProp(name) {
|
|
49
|
+
return /^on[A-Z]/.test(name) || FORBIDDEN_ATTRIBUTES.has(name.toLowerCase());
|
|
50
|
+
}
|
|
51
|
+
function markdownFieldOptionsError(field) {
|
|
52
|
+
const renderAs = field.renderAs;
|
|
53
|
+
if (renderAs !== void 0 && renderAs !== "mdx") {
|
|
54
|
+
return `Field "${field.name}": renderAs must be 'mdx'`;
|
|
55
|
+
}
|
|
56
|
+
if (renderAs !== void 0 && field.type === "mdx") {
|
|
57
|
+
return `Field "${field.name}": renderAs applies only to markdown fields`;
|
|
58
|
+
}
|
|
59
|
+
if (field.mdxAllow === void 0)
|
|
60
|
+
return void 0;
|
|
61
|
+
if (field.executable === true) {
|
|
62
|
+
return `Field "${field.name}": mdxAllow has no effect with executable: true, which turns the check off`;
|
|
63
|
+
}
|
|
64
|
+
if (field.type === "markdown" && field.renderAs !== "mdx") {
|
|
65
|
+
return `Field "${field.name}": mdxAllow applies to MDX; set renderAs: 'mdx' on a markdown field the site renders as MDX`;
|
|
66
|
+
}
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
var SAFE_HTML_TAGS, COMPONENT_NAME, MDX_BINDINGS, FORBIDDEN_ATTRIBUTES;
|
|
70
|
+
var init_mdx_allowlist = __esm({
|
|
71
|
+
"dist/validation/mdx-allowlist.js"() {
|
|
72
|
+
"use strict";
|
|
73
|
+
SAFE_HTML_TAGS = /* @__PURE__ */ new Set([
|
|
74
|
+
"a",
|
|
75
|
+
"abbr",
|
|
76
|
+
"address",
|
|
77
|
+
"article",
|
|
78
|
+
"aside",
|
|
79
|
+
"audio",
|
|
80
|
+
"b",
|
|
81
|
+
"bdi",
|
|
82
|
+
"bdo",
|
|
83
|
+
"blockquote",
|
|
84
|
+
"br",
|
|
85
|
+
"caption",
|
|
86
|
+
"cite",
|
|
87
|
+
"code",
|
|
88
|
+
"col",
|
|
89
|
+
"colgroup",
|
|
90
|
+
"data",
|
|
91
|
+
"dd",
|
|
92
|
+
"del",
|
|
93
|
+
"details",
|
|
94
|
+
"dfn",
|
|
95
|
+
"div",
|
|
96
|
+
"dl",
|
|
97
|
+
"dt",
|
|
98
|
+
"em",
|
|
99
|
+
"figcaption",
|
|
100
|
+
"figure",
|
|
101
|
+
"footer",
|
|
102
|
+
"h1",
|
|
103
|
+
"h2",
|
|
104
|
+
"h3",
|
|
105
|
+
"h4",
|
|
106
|
+
"h5",
|
|
107
|
+
"h6",
|
|
108
|
+
"header",
|
|
109
|
+
"hgroup",
|
|
110
|
+
"hr",
|
|
111
|
+
"i",
|
|
112
|
+
"img",
|
|
113
|
+
"ins",
|
|
114
|
+
"kbd",
|
|
115
|
+
"li",
|
|
116
|
+
"main",
|
|
117
|
+
"mark",
|
|
118
|
+
"nav",
|
|
119
|
+
"ol",
|
|
120
|
+
"p",
|
|
121
|
+
"picture",
|
|
122
|
+
"pre",
|
|
123
|
+
"q",
|
|
124
|
+
"rp",
|
|
125
|
+
"rt",
|
|
126
|
+
"ruby",
|
|
127
|
+
"s",
|
|
128
|
+
"samp",
|
|
129
|
+
"section",
|
|
130
|
+
"small",
|
|
131
|
+
"source",
|
|
132
|
+
"span",
|
|
133
|
+
"strong",
|
|
134
|
+
"sub",
|
|
135
|
+
"summary",
|
|
136
|
+
"sup",
|
|
137
|
+
"table",
|
|
138
|
+
"tbody",
|
|
139
|
+
"td",
|
|
140
|
+
"tfoot",
|
|
141
|
+
"th",
|
|
142
|
+
"thead",
|
|
143
|
+
"time",
|
|
144
|
+
"tr",
|
|
145
|
+
"track",
|
|
146
|
+
"u",
|
|
147
|
+
"ul",
|
|
148
|
+
"var",
|
|
149
|
+
"video",
|
|
150
|
+
"wbr"
|
|
151
|
+
]);
|
|
152
|
+
COMPONENT_NAME = /^[A-Z][\w$]*$/;
|
|
153
|
+
MDX_BINDINGS = /* @__PURE__ */ new Set(["MDXContent", "MDXLayout"]);
|
|
154
|
+
FORBIDDEN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
155
|
+
"dangerouslysetinnerhtml",
|
|
156
|
+
"srcdoc"
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
50
161
|
// dist/config/schemas/field.js
|
|
51
162
|
import { z } from "zod";
|
|
52
|
-
var fieldBaseSchema, selectOptionSchema, referenceOptionSchema, primitiveFieldSchema, ASPECT_RATIO_RE, imageFieldSchema, selectFieldSchema, referenceFieldSchema, fieldHolder, blockSchema, blockFieldSchema, objectFieldSchema, inlineGroupFieldSchema, customFieldSchema, knownFieldSchema, fieldSchema;
|
|
163
|
+
var fieldBaseSchema, selectOptionSchema, referenceOptionSchema, primitiveFieldSchema, mdxPropAllowSchema, mdxAllowlistSchema, markdownFieldSchema, ASPECT_RATIO_RE, imageFieldSchema, selectFieldSchema, referenceFieldSchema, fieldHolder, blockSchema, blockFieldSchema, objectFieldSchema, inlineGroupFieldSchema, customFieldSchema, knownFieldSchema, fieldSchema;
|
|
53
164
|
var init_field = __esm({
|
|
54
165
|
"dist/config/schemas/field.js"() {
|
|
55
166
|
"use strict";
|
|
56
167
|
init_types();
|
|
168
|
+
init_mdx_allowlist();
|
|
57
169
|
fieldBaseSchema = z.object({
|
|
58
170
|
name: z.string().min(1),
|
|
59
171
|
label: z.string().optional(),
|
|
@@ -78,7 +190,36 @@ var init_field = __esm({
|
|
|
78
190
|
})
|
|
79
191
|
]);
|
|
80
192
|
primitiveFieldSchema = fieldBaseSchema.extend({
|
|
81
|
-
type: z.enum(primitiveFieldTypes)
|
|
193
|
+
type: z.enum(primitiveFieldTypes).exclude([...markdownFieldTypes]),
|
|
194
|
+
// Listed so a parse keeps it (zod strips unknown keys); which fields may carry it is
|
|
195
|
+
// `ensureStampOnPublishPlacement`'s call (config/validation.ts).
|
|
196
|
+
stampOnPublish: z.boolean().optional()
|
|
197
|
+
});
|
|
198
|
+
mdxPropAllowSchema = z.union([
|
|
199
|
+
z.literal(true),
|
|
200
|
+
z.literal("string"),
|
|
201
|
+
z.object({ type: z.literal("string"), maxLength: z.number().int().min(1).optional() }).strict(),
|
|
202
|
+
z.array(z.union([z.string(), z.number(), z.boolean()])).min(1)
|
|
203
|
+
]);
|
|
204
|
+
mdxAllowlistSchema = z.object({
|
|
205
|
+
components: z.record(z.string().refine(isComponentName, {
|
|
206
|
+
message: "must be a component name: capitalised, with no dot, and not MDXContent or MDXLayout"
|
|
207
|
+
}), z.object({
|
|
208
|
+
props: z.record(z.string().min(1).refine((name) => !isRefusedComponentProp(name), {
|
|
209
|
+
message: "event handlers, srcdoc and dangerouslySetInnerHTML are always refused"
|
|
210
|
+
}), mdxPropAllowSchema).optional()
|
|
211
|
+
}).strict()).optional(),
|
|
212
|
+
htmlTags: z.array(z.string().refine((tag) => SAFE_HTML_TAGS.has(tag), {
|
|
213
|
+
message: "must be one of the HTML tags the base MDX policy accepts"
|
|
214
|
+
})).optional(),
|
|
215
|
+
expressions: z.boolean().optional(),
|
|
216
|
+
fragments: z.boolean().optional()
|
|
217
|
+
}).strict();
|
|
218
|
+
markdownFieldSchema = fieldBaseSchema.extend({
|
|
219
|
+
type: z.enum(markdownFieldTypes),
|
|
220
|
+
executable: z.boolean().optional(),
|
|
221
|
+
renderAs: z.literal("mdx").optional(),
|
|
222
|
+
mdxAllow: mdxAllowlistSchema.optional()
|
|
82
223
|
});
|
|
83
224
|
ASPECT_RATIO_RE = /^[1-9][0-9]*:[1-9][0-9]*$/;
|
|
84
225
|
imageFieldSchema = fieldBaseSchema.extend({
|
|
@@ -116,7 +257,8 @@ var init_field = __esm({
|
|
|
116
257
|
objectFieldSchema = fieldBaseSchema.extend({
|
|
117
258
|
type: z.literal("object"),
|
|
118
259
|
fields: z.array(z.lazy(() => fieldHolder[0])).min(1),
|
|
119
|
-
itemTitleField: z.string().min(1).optional()
|
|
260
|
+
itemTitleField: z.string().min(1).optional(),
|
|
261
|
+
itemLabel: z.string().trim().min(1).optional()
|
|
120
262
|
});
|
|
121
263
|
inlineGroupFieldSchema = z.object({
|
|
122
264
|
type: z.literal("group"),
|
|
@@ -132,13 +274,20 @@ var init_field = __esm({
|
|
|
132
274
|
}).passthrough());
|
|
133
275
|
knownFieldSchema = z.discriminatedUnion("type", [
|
|
134
276
|
primitiveFieldSchema,
|
|
277
|
+
markdownFieldSchema,
|
|
135
278
|
selectFieldSchema,
|
|
136
279
|
referenceFieldSchema,
|
|
137
280
|
imageFieldSchema,
|
|
138
281
|
objectFieldSchema,
|
|
139
282
|
blockFieldSchema,
|
|
140
283
|
inlineGroupFieldSchema
|
|
141
|
-
])
|
|
284
|
+
]).superRefine((field, ctx) => {
|
|
285
|
+
if (field.type !== "markdown" && field.type !== "mdx")
|
|
286
|
+
return;
|
|
287
|
+
const message = markdownFieldOptionsError(field);
|
|
288
|
+
if (message !== void 0)
|
|
289
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message });
|
|
290
|
+
});
|
|
142
291
|
fieldSchema = z.lazy(() => z.union([knownFieldSchema, customFieldSchema]));
|
|
143
292
|
fieldHolder[0] = fieldSchema;
|
|
144
293
|
}
|
|
@@ -192,7 +341,7 @@ function isImplicitlyOffOrigin(url) {
|
|
|
192
341
|
return false;
|
|
193
342
|
}
|
|
194
343
|
}
|
|
195
|
-
function isHttpUrlOrSameOriginPath(value
|
|
344
|
+
function isHttpUrlOrSameOriginPath(value) {
|
|
196
345
|
if (value === "")
|
|
197
346
|
return false;
|
|
198
347
|
for (let index = 0; index < value.length; index++) {
|
|
@@ -216,9 +365,8 @@ function isHttpUrlOrSameOriginPath(value, opts = {}) {
|
|
|
216
365
|
return false;
|
|
217
366
|
}
|
|
218
367
|
}
|
|
219
|
-
if (isImplicitlyOffOrigin(value))
|
|
220
|
-
return
|
|
221
|
-
}
|
|
368
|
+
if (isImplicitlyOffOrigin(value))
|
|
369
|
+
return false;
|
|
222
370
|
return value.startsWith("/") && value[1] !== "/";
|
|
223
371
|
}
|
|
224
372
|
var SENTINEL_BASE, DOT_SEGMENT;
|
|
@@ -232,7 +380,7 @@ var init_sanitize_href = __esm({
|
|
|
232
380
|
|
|
233
381
|
// dist/config/schemas/url.js
|
|
234
382
|
import { z as z3 } from "zod";
|
|
235
|
-
var uploadTargetUrlSchema,
|
|
383
|
+
var uploadTargetUrlSchema, previewPrefixSchema;
|
|
236
384
|
var init_url = __esm({
|
|
237
385
|
"dist/config/schemas/url.js"() {
|
|
238
386
|
"use strict";
|
|
@@ -240,9 +388,6 @@ var init_url = __esm({
|
|
|
240
388
|
uploadTargetUrlSchema = z3.string().trim().refine((value) => isHttpUrlOrSameOriginPath(value), {
|
|
241
389
|
message: 'must be an absolute http(s) URL or a site-relative path beginning with a single "/", with no query or fragment'
|
|
242
390
|
});
|
|
243
|
-
assetMountUrlSchema = z3.string().trim().refine((value) => isHttpUrlOrSameOriginPath(value, { allowProtocolRelative: true }), {
|
|
244
|
-
message: 'must be an absolute http(s) URL, a protocol-relative "//host" URL, or a site-relative path beginning with a single "/", with no query or fragment'
|
|
245
|
-
});
|
|
246
391
|
previewPrefixSchema = z3.string().trim().refine((value) => isHttpUrlOrSameOriginPath(value), {
|
|
247
392
|
message: 'editor.previewPrefix must be an absolute http(s) URL or a site-relative path beginning with a single "/", with no query or fragment'
|
|
248
393
|
});
|
|
@@ -260,7 +405,6 @@ var init_media = __esm({
|
|
|
260
405
|
mediaSchema = z4.discriminatedUnion("adapter", [
|
|
261
406
|
z4.object({
|
|
262
407
|
adapter: z4.literal("local"),
|
|
263
|
-
publicBaseUrl: assetMountUrlSchema.optional(),
|
|
264
408
|
/** Root directory for local asset storage. Defaults to the caller's dev-assets dir. */
|
|
265
409
|
directory: relativePathSchema.optional()
|
|
266
410
|
}).strict(),
|
|
@@ -268,7 +412,6 @@ var init_media = __esm({
|
|
|
268
412
|
adapter: z4.literal("s3"),
|
|
269
413
|
bucket: z4.string().min(1),
|
|
270
414
|
region: z4.string().min(1),
|
|
271
|
-
publicBaseUrl: assetMountUrlSchema.optional(),
|
|
272
415
|
/**
|
|
273
416
|
* Where the browser POSTs a presigned direct upload. Absolute http(s) URL or a
|
|
274
417
|
* site-relative path; defaults to the S3 REST endpoint the AWS SDK returns.
|
|
@@ -278,18 +421,17 @@ var init_media = __esm({
|
|
|
278
421
|
* signature is unaffected — a presigned POST's string-to-sign is the base64 policy
|
|
279
422
|
* alone, so the host never enters it (pinned by store-s3.test.ts).
|
|
280
423
|
*
|
|
281
|
-
* NOT a prefix
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
424
|
+
* NOT a prefix: nothing is joined onto this value; it replaces the POST target outright
|
|
425
|
+
* and is passed through byte-for-byte. Do not route it through `joinUrlPrefix` "for
|
|
426
|
+
* consistency" — that would strip the trailing slash and silently stop a CDN path
|
|
427
|
+
* pattern like `/asset-upload/*` from matching.
|
|
285
428
|
*/
|
|
286
429
|
uploadUrl: uploadTargetUrlSchema.optional(),
|
|
287
430
|
/** Max upload size in bytes for presigned direct uploads. Defaults to 50 MiB. */
|
|
288
431
|
maxUploadBytes: z4.number().int().positive().optional()
|
|
289
432
|
}).strict(),
|
|
290
433
|
z4.object({
|
|
291
|
-
adapter: z4.literal("lfs")
|
|
292
|
-
publicBaseUrl: assetMountUrlSchema.optional()
|
|
434
|
+
adapter: z4.literal("lfs")
|
|
293
435
|
}).strict()
|
|
294
436
|
]);
|
|
295
437
|
}
|
|
@@ -302,6 +444,7 @@ var init_config = __esm({
|
|
|
302
444
|
"dist/config/schemas/config.js"() {
|
|
303
445
|
"use strict";
|
|
304
446
|
init_collection();
|
|
447
|
+
init_field();
|
|
305
448
|
init_media();
|
|
306
449
|
init_url();
|
|
307
450
|
defaultBranchAccessSchema = z5.enum(["allow", "deny"]).default("deny");
|
|
@@ -332,7 +475,6 @@ var init_config = __esm({
|
|
|
332
475
|
});
|
|
333
476
|
editorConfigSchema = z5.object({
|
|
334
477
|
title: z5.string().optional(),
|
|
335
|
-
subtitle: z5.string().optional(),
|
|
336
478
|
theme: z5.unknown().optional(),
|
|
337
479
|
previewBase: z5.record(z5.union([z5.string(), z5.literal(false)])).optional(),
|
|
338
480
|
previewPrefix: previewPrefixSchema.optional(),
|
|
@@ -355,8 +497,8 @@ var init_config = __esm({
|
|
|
355
497
|
defaultBranchAccess: defaultBranchAccessSchema,
|
|
356
498
|
defaultPathAccess: defaultPathAccessSchema,
|
|
357
499
|
// .optional() deliberately defeats defaultBaseBranchSchema's .default('main'):
|
|
358
|
-
// unset must stay undefined after parsing so dev
|
|
359
|
-
// point
|
|
500
|
+
// unset must stay undefined after parsing so dev and prod can detect the
|
|
501
|
+
// fork point (see resolveBaseBranch in utils/git.ts).
|
|
360
502
|
defaultBaseBranch: defaultBaseBranchSchema.optional(),
|
|
361
503
|
defaultActiveBranch: z5.string().min(1).optional(),
|
|
362
504
|
defaultRemoteName: defaultRemoteNameSchema.optional(),
|
|
@@ -386,82 +528,16 @@ var init_config = __esm({
|
|
|
386
528
|
contentRoot: contentRootSchema.default("content"),
|
|
387
529
|
sourceRoot: sourceRootSchema.optional(),
|
|
388
530
|
basePath: basePathSchema,
|
|
531
|
+
unauthenticatedStatus: z5.union([z5.literal(401), z5.literal(419)]).optional(),
|
|
532
|
+
danglingReferences: z5.enum(["error", "warn"]).optional(),
|
|
389
533
|
editor: editorConfigSchema.optional(),
|
|
390
534
|
authPlugin: z5.custom().optional(),
|
|
391
535
|
entryLinkUrl: z5.custom().optional(),
|
|
392
536
|
validateEntry: z5.custom().optional(),
|
|
537
|
+
mdxAllow: mdxAllowlistSchema.optional(),
|
|
393
538
|
dev: devConfigSchema.optional()
|
|
394
539
|
}).strict();
|
|
395
|
-
DEFAULT_PROD_WORKSPACE = "/mnt/efs
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
// dist/config/schemas/permissions.js
|
|
400
|
-
import { z as z6 } from "zod";
|
|
401
|
-
var permissionTargetSchema, pathPermissionSchema;
|
|
402
|
-
var init_permissions = __esm({
|
|
403
|
-
"dist/config/schemas/permissions.js"() {
|
|
404
|
-
"use strict";
|
|
405
|
-
permissionTargetSchema = z6.object({
|
|
406
|
-
allowedUsers: z6.array(z6.string()).optional(),
|
|
407
|
-
allowedGroups: z6.array(z6.string()).optional()
|
|
408
|
-
});
|
|
409
|
-
pathPermissionSchema = z6.object({
|
|
410
|
-
path: z6.string().min(1),
|
|
411
|
-
read: permissionTargetSchema.optional(),
|
|
412
|
-
edit: permissionTargetSchema.optional(),
|
|
413
|
-
review: permissionTargetSchema.optional()
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
// dist/paths/normalize.js
|
|
419
|
-
var init_normalize = __esm({
|
|
420
|
-
"dist/paths/normalize.js"() {
|
|
421
|
-
"use strict";
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
// dist/paths/types.js
|
|
426
|
-
var init_types2 = __esm({
|
|
427
|
-
"dist/paths/types.js"() {
|
|
428
|
-
"use strict";
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
// dist/config/flatten.js
|
|
433
|
-
import { join, normalize } from "pathe";
|
|
434
|
-
var init_flatten = __esm({
|
|
435
|
-
"dist/config/flatten.js"() {
|
|
436
|
-
"use strict";
|
|
437
|
-
init_normalize();
|
|
438
|
-
init_types2();
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
|
|
442
|
-
// dist/operating-mode/mode-env.js
|
|
443
|
-
var init_mode_env = __esm({
|
|
444
|
-
"dist/operating-mode/mode-env.js"() {
|
|
445
|
-
"use strict";
|
|
446
|
-
init_logger();
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
// dist/config/validation.js
|
|
451
|
-
var init_validation = __esm({
|
|
452
|
-
"dist/config/validation.js"() {
|
|
453
|
-
"use strict";
|
|
454
|
-
init_config();
|
|
455
|
-
init_flatten();
|
|
456
|
-
init_mode_env();
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
// dist/config/helpers.js
|
|
461
|
-
var init_helpers = __esm({
|
|
462
|
-
"dist/config/helpers.js"() {
|
|
463
|
-
"use strict";
|
|
464
|
-
init_validation();
|
|
540
|
+
DEFAULT_PROD_WORKSPACE = "/mnt/efs";
|
|
465
541
|
}
|
|
466
542
|
});
|
|
467
543
|
|
|
@@ -469,15 +545,7 @@ var init_helpers = __esm({
|
|
|
469
545
|
var init_config2 = __esm({
|
|
470
546
|
"dist/config/index.js"() {
|
|
471
547
|
"use strict";
|
|
472
|
-
init_types();
|
|
473
548
|
init_config();
|
|
474
|
-
init_field();
|
|
475
|
-
init_collection();
|
|
476
|
-
init_permissions();
|
|
477
|
-
init_media();
|
|
478
|
-
init_flatten();
|
|
479
|
-
init_validation();
|
|
480
|
-
init_helpers();
|
|
481
549
|
}
|
|
482
550
|
});
|
|
483
551
|
|
|
@@ -635,6 +703,7 @@ var init_templates = __esm({
|
|
|
635
703
|
var project_detect_exports = {};
|
|
636
704
|
__export(project_detect_exports, {
|
|
637
705
|
CDK_DEPENDENCIES: () => CDK_DEPENDENCIES,
|
|
706
|
+
PLACEHOLDER_GITHUB_REPO: () => PLACEHOLDER_GITHUB_REPO,
|
|
638
707
|
commandsFor: () => commandsFor,
|
|
639
708
|
detectDefaultBranch: () => detectDefaultBranch,
|
|
640
709
|
detectGitHubRepo: () => detectGitHubRepo,
|
|
@@ -751,7 +820,7 @@ async function missingCdkDependencies(projectDir) {
|
|
|
751
820
|
}
|
|
752
821
|
return CDK_DEPENDENCIES.filter((name) => !declared.has(name));
|
|
753
822
|
}
|
|
754
|
-
var COMMANDS, MAX_WORKSPACE_DEPTH, CDK_DEPENDENCIES;
|
|
823
|
+
var COMMANDS, MAX_WORKSPACE_DEPTH, PLACEHOLDER_GITHUB_REPO, CDK_DEPENDENCIES;
|
|
755
824
|
var init_project_detect = __esm({
|
|
756
825
|
"dist/cli/project-detect.js"() {
|
|
757
826
|
"use strict";
|
|
@@ -798,6 +867,7 @@ var init_project_detect = __esm({
|
|
|
798
867
|
}
|
|
799
868
|
};
|
|
800
869
|
MAX_WORKSPACE_DEPTH = 8;
|
|
870
|
+
PLACEHOLDER_GITHUB_REPO = { owner: "your-org", repo: "your-docs-site" };
|
|
801
871
|
CDK_DEPENDENCIES = [
|
|
802
872
|
"canopycms",
|
|
803
873
|
"canopycms-cdk",
|
|
@@ -837,10 +907,11 @@ var init_task_queue_config = __esm({
|
|
|
837
907
|
function createDebugLogger(options) {
|
|
838
908
|
return new DebugLogger(options);
|
|
839
909
|
}
|
|
840
|
-
var LOG_LEVELS, DebugLogger, testLogger;
|
|
910
|
+
var envFlag, LOG_LEVELS, DebugLogger, testLogger;
|
|
841
911
|
var init_debug = __esm({
|
|
842
912
|
"dist/utils/debug.js"() {
|
|
843
913
|
"use strict";
|
|
914
|
+
envFlag = (name) => typeof process !== "undefined" && process.env[name] === "true";
|
|
844
915
|
LOG_LEVELS = {
|
|
845
916
|
DEBUG: 0,
|
|
846
917
|
INFO: 1,
|
|
@@ -853,7 +924,7 @@ var init_debug = __esm({
|
|
|
853
924
|
this.options = options;
|
|
854
925
|
}
|
|
855
926
|
shouldLog(level) {
|
|
856
|
-
const enabled = this.options.enabled ??
|
|
927
|
+
const enabled = this.options.enabled ?? envFlag("CANOPYCMS_DEBUG");
|
|
857
928
|
if (!enabled)
|
|
858
929
|
return false;
|
|
859
930
|
const minLevel = this.options.minLevel ?? "DEBUG";
|
|
@@ -929,7 +1000,7 @@ var init_debug = __esm({
|
|
|
929
1000
|
}
|
|
930
1001
|
};
|
|
931
1002
|
testLogger = createDebugLogger({
|
|
932
|
-
enabled:
|
|
1003
|
+
enabled: envFlag("E2E_DEBUG"),
|
|
933
1004
|
prefix: "E2E",
|
|
934
1005
|
throwOnError: false
|
|
935
1006
|
});
|
|
@@ -943,8 +1014,8 @@ async function atomicWriteFile(filePath, content) {
|
|
|
943
1014
|
const dir = path5.dirname(filePath);
|
|
944
1015
|
await fs4.mkdir(dir, { recursive: true });
|
|
945
1016
|
const tempPath = `${filePath}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
946
|
-
await fs4.writeFile(tempPath, content, typeof content === "string" ? "utf-8" : void 0);
|
|
947
1017
|
try {
|
|
1018
|
+
await fs4.writeFile(tempPath, content, typeof content === "string" ? "utf-8" : void 0);
|
|
948
1019
|
await fs4.rename(tempPath, filePath);
|
|
949
1020
|
} catch (err) {
|
|
950
1021
|
await fs4.unlink(tempPath).catch(() => {
|
|
@@ -1127,6 +1198,31 @@ async function retryTask(taskDir, taskId, error, logger = nullLogger) {
|
|
|
1127
1198
|
});
|
|
1128
1199
|
logger.debug("Retrying task", { id: taskId, retryCount, backoffMs });
|
|
1129
1200
|
}
|
|
1201
|
+
async function releaseTask(taskDir, taskId, logger = nullLogger) {
|
|
1202
|
+
const processingPath = path6.join(taskDir, "processing", `${taskId}.json`);
|
|
1203
|
+
const pendingPath = path6.join(taskDir, "pending", `${taskId}.json`);
|
|
1204
|
+
let task;
|
|
1205
|
+
try {
|
|
1206
|
+
const content = await fs5.readFile(processingPath, "utf-8");
|
|
1207
|
+
const parsed = parseTaskJson(content);
|
|
1208
|
+
if (!parsed) {
|
|
1209
|
+
logger.debug("Corrupt task file in processing, removing", { id: taskId });
|
|
1210
|
+
await fs5.unlink(processingPath).catch(() => {
|
|
1211
|
+
});
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
task = parsed;
|
|
1215
|
+
} catch (err) {
|
|
1216
|
+
if (isNotFoundError2(err))
|
|
1217
|
+
return;
|
|
1218
|
+
throw err;
|
|
1219
|
+
}
|
|
1220
|
+
task.status = "pending";
|
|
1221
|
+
await atomicWriteFile(pendingPath, JSON.stringify(task, null, 2));
|
|
1222
|
+
await fs5.unlink(processingPath).catch(() => {
|
|
1223
|
+
});
|
|
1224
|
+
logger.debug("Released task", { id: taskId });
|
|
1225
|
+
}
|
|
1130
1226
|
async function requeueFailedTask(taskDir, taskId, logger = nullLogger) {
|
|
1131
1227
|
const failedPath = path6.join(taskDir, "failed", `${taskId}.json`);
|
|
1132
1228
|
let content;
|
|
@@ -1383,6 +1479,7 @@ __export(cms_task_queue_exports, {
|
|
|
1383
1479
|
listCorruptTaskFiles: () => listCorruptTaskFiles,
|
|
1384
1480
|
listTasks: () => listTasks,
|
|
1385
1481
|
recoverOrphanedTasks: () => recoverOrphanedTasks,
|
|
1482
|
+
releaseTask: () => releaseTask,
|
|
1386
1483
|
requeueFailedTask: () => requeueFailedTask,
|
|
1387
1484
|
retryTask: () => retryTask
|
|
1388
1485
|
});
|
|
@@ -1610,9 +1707,6 @@ function operatingStrategy(mode) {
|
|
|
1610
1707
|
return strategy;
|
|
1611
1708
|
}
|
|
1612
1709
|
|
|
1613
|
-
// dist/operating-mode/index.js
|
|
1614
|
-
init_mode_env();
|
|
1615
|
-
|
|
1616
1710
|
// dist/auth/plugin.js
|
|
1617
1711
|
function assertAuthPluginAllowedForMode(plugin, mode) {
|
|
1618
1712
|
if (mode === "prod" && plugin.verifiesCredentials !== true) {
|
|
@@ -1764,12 +1858,12 @@ async function initDeployAws(options) {
|
|
|
1764
1858
|
const { projectDir, force, nonInteractive } = options;
|
|
1765
1859
|
const writeOpts = { force, nonInteractive };
|
|
1766
1860
|
const { dockerfileCms: dockerfileCms2, dockerignore: dockerignore2, githubWorkflowCms: githubWorkflowCms2, cdkJson: cdkJson2, cdkApp: cdkApp2, cmsStack: cmsStack2, cdkTsconfig: cdkTsconfig2 } = await Promise.resolve().then(() => (init_templates(), templates_exports));
|
|
1767
|
-
const { detectPackageManager: detectPackageManager2, detectDefaultBranch: detectDefaultBranch2, detectGitHubRepo: detectGitHubRepo2, commandsFor: commandsFor2, missingCdkDependencies: missingCdkDependencies2, CDK_DEPENDENCIES: CDK_DEPENDENCIES2 } = await Promise.resolve().then(() => (init_project_detect(), project_detect_exports));
|
|
1861
|
+
const { detectPackageManager: detectPackageManager2, detectDefaultBranch: detectDefaultBranch2, detectGitHubRepo: detectGitHubRepo2, commandsFor: commandsFor2, missingCdkDependencies: missingCdkDependencies2, CDK_DEPENDENCIES: CDK_DEPENDENCIES2, PLACEHOLDER_GITHUB_REPO: PLACEHOLDER_GITHUB_REPO2 } = await Promise.resolve().then(() => (init_project_detect(), project_detect_exports));
|
|
1768
1862
|
p.intro("CanopyCMS init-deploy aws");
|
|
1769
1863
|
const packageManager = await detectPackageManager2(projectDir);
|
|
1770
1864
|
const pm = commandsFor2(packageManager);
|
|
1771
1865
|
const defaultBranch = await detectDefaultBranch2(projectDir);
|
|
1772
|
-
const repo = await detectGitHubRepo2(projectDir);
|
|
1866
|
+
const repo = await detectGitHubRepo2(projectDir) ?? PLACEHOLDER_GITHUB_REPO2;
|
|
1773
1867
|
await writeFile(path7.join(projectDir, "Dockerfile.cms"), await dockerfileCms2({ copy: pm.dockerCopy, install: pm.dockerInstall, build: pm.build }), writeOpts);
|
|
1774
1868
|
const dockerignoreWritten = await writeFile(path7.join(projectDir, ".dockerignore"), await dockerignore2(), writeOpts);
|
|
1775
1869
|
if (!dockerignoreWritten) {
|
|
@@ -1784,10 +1878,7 @@ async function initDeployAws(options) {
|
|
|
1784
1878
|
const cdkJsonPath = path7.join(projectDir, "cdk.json");
|
|
1785
1879
|
const existingCdkJson = await filePathExists(cdkJsonPath) ? await fs6.readFile(cdkJsonPath, "utf-8") : null;
|
|
1786
1880
|
const cdkJsonWritten = await writeFile(cdkJsonPath, await cdkJson2(), writeOpts);
|
|
1787
|
-
await writeFile(path7.join(projectDir, "infrastructure/bin/app.ts"), await cdkApp2({
|
|
1788
|
-
githubOwner: repo?.owner ?? "your-org",
|
|
1789
|
-
githubRepo: repo?.repo ?? "your-docs-site"
|
|
1790
|
-
}), writeOpts);
|
|
1881
|
+
await writeFile(path7.join(projectDir, "infrastructure/bin/app.ts"), await cdkApp2({ githubOwner: repo.owner, githubRepo: repo.repo }), writeOpts);
|
|
1791
1882
|
await writeFile(path7.join(projectDir, "infrastructure/lib/cms-stack.ts"), await cmsStack2(), writeOpts);
|
|
1792
1883
|
await writeFile(path7.join(projectDir, "infrastructure/tsconfig.json"), await cdkTsconfig2(), writeOpts);
|
|
1793
1884
|
const tsconfigResult = await excludeFromTsconfig(projectDir, "infrastructure");
|
|
@@ -1830,7 +1921,7 @@ async function initDeployAws(options) {
|
|
|
1830
1921
|
` ${pm.addDev} ${CDK_DEPENDENCIES2.join(" ")}`,
|
|
1831
1922
|
"",
|
|
1832
1923
|
"2. Fill in infrastructure/lib/cms-stack.ts and infrastructure/bin/app.ts",
|
|
1833
|
-
` (worker repo currently set to ${repo
|
|
1924
|
+
` (worker repo currently set to ${repo.owner}/${repo.repo})`,
|
|
1834
1925
|
"",
|
|
1835
1926
|
"3. Bootstrap CDK in the target account/region: cdk bootstrap",
|
|
1836
1927
|
"",
|
|
@@ -51,6 +51,8 @@ export interface GitHubRepo {
|
|
|
51
51
|
owner: string;
|
|
52
52
|
repo: string;
|
|
53
53
|
}
|
|
54
|
+
/** Written into the generated CDK app when `detectGitHubRepo` finds no GitHub remote. */
|
|
55
|
+
export declare const PLACEHOLDER_GITHUB_REPO: GitHubRepo;
|
|
54
56
|
/**
|
|
55
57
|
* Owner/repo from the `origin` remote, for the generated stack's worker
|
|
56
58
|
* config. Supports both SSH (`git@github.com:owner/repo.git`) and HTTPS
|
|
@@ -160,6 +160,8 @@ export async function detectDefaultBranch(projectDir) {
|
|
|
160
160
|
const branch = slash === -1 ? head : head.slice(slash + 1);
|
|
161
161
|
return branch || 'main';
|
|
162
162
|
}
|
|
163
|
+
/** Written into the generated CDK app when `detectGitHubRepo` finds no GitHub remote. */
|
|
164
|
+
export const PLACEHOLDER_GITHUB_REPO = { owner: 'your-org', repo: 'your-docs-site' };
|
|
163
165
|
/**
|
|
164
166
|
* Owner/repo from the `origin` remote, for the generated stack's worker
|
|
165
167
|
* config. Supports both SSH (`git@github.com:owner/repo.git`) and HTTPS
|
|
@@ -48,12 +48,20 @@ ENV NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=$NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
|
|
|
48
48
|
# The browser needs the operating mode too: the editor page is a client
|
|
49
49
|
# component that imports canopycms.config.ts, so its copy of `mode` is whatever
|
|
50
50
|
# was inlined at build time -- a runtime Lambda variable can never reach it.
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
|
|
51
|
+
# Defaults to prod because this image only ever runs as the deployed CMS, whose
|
|
52
|
+
# server is prod; a dev editor bundle there selects dev auth against a server
|
|
53
|
+
# that accepts only Clerk tokens. Anything but exactly prod or dev fails the
|
|
54
|
+
# build: an empty value would fall back to the config's `dev` literal in the
|
|
55
|
+
# browser, and a typo would only throw once an editor page loads. Distinct
|
|
56
|
+
# from CANOPY_MODE above on purpose: this one is read only in the browser, so
|
|
57
|
+
# setting it here does NOT put the build's own server-side content reads into
|
|
58
|
+
# prod mode.
|
|
59
|
+
ARG NEXT_PUBLIC_CANOPY_MODE=prod
|
|
56
60
|
ENV NEXT_PUBLIC_CANOPY_MODE=$NEXT_PUBLIC_CANOPY_MODE
|
|
61
|
+
RUN case "$NEXT_PUBLIC_CANOPY_MODE" in \
|
|
62
|
+
prod|dev) ;; \
|
|
63
|
+
*) echo "NEXT_PUBLIC_CANOPY_MODE must be exactly \"prod\" or \"dev\", got \"$NEXT_PUBLIC_CANOPY_MODE\"" >&2; exit 1 ;; \
|
|
64
|
+
esac
|
|
57
65
|
RUN {{DOCKER_BUILD}}
|
|
58
66
|
|
|
59
67
|
FROM public.ecr.aws/docker/library/node:22-slim AS runner
|