canopycms 0.0.62 → 0.0.64
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/README.md +153 -19
- package/dist/ai/generate.d.ts +4 -5
- package/dist/ai/generate.js +0 -1
- package/dist/ai/handler.d.ts +3 -4
- package/dist/ai/handler.js +0 -1
- package/dist/ai/index.d.ts +15 -7
- package/dist/ai/index.js +9 -1
- package/dist/ai/json-to-markdown.d.ts +1 -2
- package/dist/ai/json-to-markdown.js +11 -2
- package/dist/ai/resolve-branch.d.ts +1 -2
- package/dist/ai/resolve-branch.js +0 -1
- package/dist/ai/strip-mdx.d.ts +0 -1
- package/dist/ai/strip-mdx.js +0 -1
- package/dist/ai/to-plain-text.d.ts +60 -0
- package/dist/ai/to-plain-text.js +301 -0
- package/dist/ai/transform-components.d.ts +1 -2
- package/dist/ai/transform-components.js +70 -6
- package/dist/ai/types.d.ts +1 -2
- package/dist/ai/types.js +0 -1
- package/dist/api/admin-branch-health.d.ts +7 -8
- package/dist/api/admin-branch-health.js +0 -1
- package/dist/api/admin.d.ts +16 -17
- package/dist/api/admin.js +0 -1
- package/dist/api/assets.d.ts +8 -9
- package/dist/api/assets.js +0 -1
- package/dist/api/branch-merge.d.ts +3 -4
- package/dist/api/branch-merge.js +0 -1
- package/dist/api/branch-review.d.ts +5 -6
- package/dist/api/branch-review.js +0 -1
- package/dist/api/branch-status.d.ts +15 -16
- package/dist/api/branch-status.js +0 -1
- package/dist/api/branch-withdraw.d.ts +3 -4
- package/dist/api/branch-withdraw.js +0 -1
- package/dist/api/branch.d.ts +13 -14
- package/dist/api/branch.js +0 -1
- package/dist/api/client.d.ts +14 -15
- package/dist/api/client.js +0 -1
- package/dist/api/comments.d.ts +11 -12
- package/dist/api/comments.js +0 -1
- package/dist/api/content.d.ts +22 -24
- package/dist/api/content.js +132 -18
- package/dist/api/entries-constants.d.ts +0 -1
- package/dist/api/entries-constants.js +0 -1
- package/dist/api/entries.d.ts +12 -13
- package/dist/api/entries.js +12 -2
- package/dist/api/github-sync.d.ts +2 -3
- package/dist/api/github-sync.js +0 -1
- package/dist/api/groups.d.ts +6 -7
- package/dist/api/groups.js +0 -1
- package/dist/api/guards.d.ts +2 -3
- package/dist/api/guards.js +0 -1
- package/dist/api/index.d.ts +18 -19
- package/dist/api/index.js +0 -1
- package/dist/api/permissions.d.ts +10 -11
- package/dist/api/permissions.js +0 -1
- package/dist/api/reference-options.d.ts +3 -4
- package/dist/api/reference-options.js +0 -1
- package/dist/api/request-body-hash.d.ts +0 -1
- package/dist/api/request-body-hash.js +0 -1
- package/dist/api/resolve-references.d.ts +6 -7
- package/dist/api/resolve-references.js +24 -6
- package/dist/api/route-builder.d.ts +2 -3
- package/dist/api/route-builder.js +0 -1
- package/dist/api/schema.d.ts +43 -44
- package/dist/api/schema.js +0 -1
- package/dist/api/settings-helpers.d.ts +2 -3
- package/dist/api/settings-helpers.js +0 -1
- package/dist/api/types.d.ts +6 -7
- package/dist/api/types.js +0 -1
- package/dist/api/user.d.ts +2 -3
- package/dist/api/user.js +0 -1
- package/dist/api/validators.d.ts +3 -4
- package/dist/api/validators.js +0 -1
- package/dist/assets/asset-prefixes.d.ts +1 -2
- package/dist/assets/asset-prefixes.js +0 -1
- package/dist/assets/asset-src.d.ts +17 -5
- package/dist/assets/asset-src.js +15 -3
- package/dist/assets/asset-url.d.ts +28 -7
- package/dist/assets/asset-url.js +20 -15
- package/dist/assets/factory.d.ts +2 -3
- package/dist/assets/factory.js +0 -2
- package/dist/assets/finalize.d.ts +2 -3
- package/dist/assets/finalize.js +0 -1
- package/dist/assets/index.d.ts +12 -13
- package/dist/assets/index.js +0 -1
- package/dist/assets/keys.d.ts +1 -2
- package/dist/assets/keys.js +0 -1
- package/dist/assets/pipeline.d.ts +1 -2
- package/dist/assets/pipeline.js +0 -1
- package/dist/assets/store-local.d.ts +1 -2
- package/dist/assets/store-local.js +0 -1
- package/dist/assets/store-s3.d.ts +2 -4
- package/dist/assets/store-s3.js +0 -1
- package/dist/assets/svg-sanitizer.d.ts +0 -1
- package/dist/assets/svg-sanitizer.js +0 -1
- package/dist/assets/transform-directives.d.ts +0 -1
- package/dist/assets/transform-directives.js +0 -1
- package/dist/assets/transform.d.ts +1 -2
- package/dist/assets/transform.js +0 -1
- package/dist/assets/types.d.ts +0 -1
- package/dist/assets/types.js +0 -1
- package/dist/auth/cache.d.ts +2 -3
- package/dist/auth/cache.js +0 -1
- package/dist/auth/caching-auth-plugin.d.ts +3 -4
- package/dist/auth/caching-auth-plugin.js +0 -1
- package/dist/auth/context-helpers.d.ts +1 -2
- package/dist/auth/context-helpers.js +0 -1
- package/dist/auth/file-based-auth-cache.d.ts +3 -4
- package/dist/auth/file-based-auth-cache.js +0 -1
- package/dist/auth/index.d.ts +6 -7
- package/dist/auth/index.js +0 -1
- package/dist/auth/plugin.d.ts +3 -4
- package/dist/auth/plugin.js +0 -1
- package/dist/auth/types.d.ts +1 -2
- package/dist/auth/types.js +0 -1
- package/dist/authorization/branch.d.ts +58 -7
- package/dist/authorization/branch.js +55 -10
- package/dist/authorization/content.d.ts +6 -7
- package/dist/authorization/content.js +0 -1
- package/dist/authorization/groups/index.d.ts +2 -3
- package/dist/authorization/groups/index.js +0 -1
- package/dist/authorization/groups/loader.d.ts +3 -4
- package/dist/authorization/groups/loader.js +0 -1
- package/dist/authorization/groups/schema.d.ts +1 -2
- package/dist/authorization/groups/schema.js +0 -1
- package/dist/authorization/helpers.d.ts +0 -1
- package/dist/authorization/helpers.js +0 -1
- package/dist/authorization/index.d.ts +11 -12
- package/dist/authorization/index.js +0 -1
- package/dist/authorization/path.d.ts +4 -5
- package/dist/authorization/path.js +0 -1
- package/dist/authorization/permissions/index.d.ts +2 -3
- package/dist/authorization/permissions/index.js +0 -1
- package/dist/authorization/permissions/loader.d.ts +4 -5
- package/dist/authorization/permissions/loader.js +0 -1
- package/dist/authorization/permissions/schema.d.ts +2 -3
- package/dist/authorization/permissions/schema.js +0 -1
- package/dist/authorization/protected-branch.d.ts +2 -3
- package/dist/authorization/protected-branch.js +0 -1
- package/dist/authorization/settings-file-store.d.ts +1 -2
- package/dist/authorization/settings-file-store.js +0 -1
- package/dist/authorization/types.d.ts +7 -8
- package/dist/authorization/types.js +0 -1
- package/dist/authorization/validation.d.ts +1 -2
- package/dist/authorization/validation.js +0 -1
- package/dist/branch-health.d.ts +2 -3
- package/dist/branch-health.js +0 -1
- package/dist/branch-metadata.d.ts +2 -3
- package/dist/branch-metadata.js +0 -1
- package/dist/branch-registry.d.ts +1 -2
- package/dist/branch-registry.js +0 -1
- package/dist/branch-schema-cache.d.ts +4 -5
- package/dist/branch-schema-cache.js +0 -1
- package/dist/branch-workspace.d.ts +4 -5
- package/dist/branch-workspace.js +0 -1
- package/dist/build/generate-ai-content.d.ts +21 -5
- package/dist/build/generate-ai-content.js +98 -6
- package/dist/build/index.d.ts +2 -3
- package/dist/build/index.js +0 -1
- package/dist/build-canopy.d.ts +48 -0
- package/dist/build-canopy.js +50 -0
- package/dist/build-mode.d.ts +1 -2
- package/dist/build-mode.js +0 -1
- package/dist/cli/cli.d.ts +1 -2
- package/dist/cli/cli.js +1192 -495
- package/dist/cli/generate-ai-content.d.ts +0 -1
- package/dist/cli/generate-ai-content.js +1062 -370
- package/dist/cli/init.d.ts +1 -2
- package/dist/cli/init.js +12 -2
- package/dist/cli/migrate.d.ts +5 -3
- package/dist/cli/migrate.js +5 -3
- package/dist/cli/project-detect.d.ts +5 -2
- package/dist/cli/project-detect.js +5 -1
- package/dist/cli/project-root.d.ts +0 -1
- package/dist/cli/project-root.js +0 -1
- package/dist/cli/sync.d.ts +0 -1
- package/dist/cli/sync.js +0 -1
- package/dist/cli/template-files/canopycms.config.ts.template +18 -1
- package/dist/cli/template-files/deploy-cms.yml.template +8 -6
- package/dist/cli/templates.d.ts +0 -1
- package/dist/cli/templates.js +0 -1
- package/dist/client.d.ts +13 -14
- package/dist/client.js +0 -1
- package/dist/comment-store.d.ts +0 -1
- package/dist/comment-store.js +0 -1
- package/dist/config/flatten.d.ts +1 -2
- package/dist/config/flatten.js +0 -1
- package/dist/config/helpers.d.ts +3 -4
- package/dist/config/helpers.js +2 -2
- package/dist/config/index.d.ts +10 -11
- package/dist/config/index.js +0 -1
- package/dist/config/schemas/collection.d.ts +0 -1
- package/dist/config/schemas/collection.js +0 -1
- package/dist/config/schemas/config.d.ts +7 -4
- package/dist/config/schemas/config.js +12 -1
- package/dist/config/schemas/field.d.ts +3 -1
- package/dist/config/schemas/field.js +5 -1
- package/dist/config/schemas/media.d.ts +0 -1
- package/dist/config/schemas/media.js +0 -1
- package/dist/config/schemas/permissions.d.ts +0 -1
- package/dist/config/schemas/permissions.js +0 -1
- package/dist/config/types.d.ts +55 -9
- package/dist/config/types.js +0 -1
- package/dist/config/validation.d.ts +1 -2
- package/dist/config/validation.js +0 -1
- package/dist/config.d.ts +2 -3
- package/dist/config.js +0 -1
- package/dist/content-id-index.d.ts +1 -2
- package/dist/content-id-index.js +0 -1
- package/dist/content-index-generation.d.ts +0 -1
- package/dist/content-index-generation.js +0 -1
- package/dist/content-index-registry.d.ts +0 -1
- package/dist/content-index-registry.js +0 -1
- package/dist/content-listing.d.ts +137 -16
- package/dist/content-listing.js +175 -41
- package/dist/content-reader.d.ts +44 -8
- package/dist/content-reader.js +39 -7
- package/dist/content-store.d.ts +147 -7
- package/dist/content-store.js +294 -22
- package/dist/content-tree.d.ts +44 -5
- package/dist/content-tree.js +47 -11
- package/dist/context.d.ts +38 -15
- package/dist/context.js +55 -5
- package/dist/dev-content-watcher.d.ts +2 -3
- package/dist/dev-content-watcher.js +0 -1
- package/dist/editor/BranchManager.d.ts +4 -5
- package/dist/editor/BranchManager.js +0 -1
- package/dist/editor/CanopyEditor.d.ts +2 -3
- package/dist/editor/CanopyEditor.js +1 -2
- package/dist/editor/CanopyEditorPage.d.ts +2 -3
- package/dist/editor/CanopyEditorPage.js +0 -1
- package/dist/editor/CommentsPanel.d.ts +2 -3
- package/dist/editor/CommentsPanel.js +0 -1
- package/dist/editor/Editor.d.ts +13 -8
- package/dist/editor/Editor.js +4 -5
- package/dist/editor/EditorPanes.d.ts +0 -1
- package/dist/editor/EditorPanes.js +0 -1
- package/dist/editor/EntryNavigator.d.ts +1 -2
- package/dist/editor/EntryNavigator.js +0 -1
- package/dist/editor/FormRenderer.d.ts +2 -3
- package/dist/editor/FormRenderer.js +22 -3
- package/dist/editor/GroupManager.d.ts +2 -3
- package/dist/editor/GroupManager.js +0 -1
- package/dist/editor/PermissionManager.d.ts +2 -3
- package/dist/editor/PermissionManager.js +0 -1
- package/dist/editor/admin/SystemHealthPanel.d.ts +0 -1
- package/dist/editor/admin/SystemHealthPanel.js +0 -1
- package/dist/editor/admin/useSystemHealth.d.ts +2 -3
- package/dist/editor/admin/useSystemHealth.js +0 -1
- package/dist/editor/canopy-path.d.ts +0 -1
- package/dist/editor/canopy-path.js +0 -1
- package/dist/editor/client-reference-resolver.d.ts +13 -4
- package/dist/editor/client-reference-resolver.js +18 -8
- package/dist/editor/comments/BranchComments.d.ts +2 -3
- package/dist/editor/comments/BranchComments.js +0 -1
- package/dist/editor/comments/EntryComments.d.ts +1 -2
- package/dist/editor/comments/EntryComments.js +0 -1
- package/dist/editor/comments/FieldWrapper.d.ts +1 -2
- package/dist/editor/comments/FieldWrapper.js +0 -1
- package/dist/editor/comments/InlineCommentThread.d.ts +2 -3
- package/dist/editor/comments/InlineCommentThread.js +0 -1
- package/dist/editor/comments/ThreadCarousel.d.ts +2 -3
- package/dist/editor/comments/ThreadCarousel.js +0 -1
- package/dist/editor/components/ConfirmDeleteModal.d.ts +0 -1
- package/dist/editor/components/ConfirmDeleteModal.js +0 -1
- package/dist/editor/components/EditorFooter.d.ts +0 -1
- package/dist/editor/components/EditorFooter.js +0 -1
- package/dist/editor/components/EditorHeader.d.ts +4 -5
- package/dist/editor/components/EditorHeader.js +0 -1
- package/dist/editor/components/EditorSidebar.d.ts +1 -2
- package/dist/editor/components/EditorSidebar.js +0 -1
- package/dist/editor/components/EntryCreateModal.d.ts +0 -1
- package/dist/editor/components/EntryCreateModal.js +21 -10
- package/dist/editor/components/RenameEntryModal.d.ts +0 -1
- package/dist/editor/components/RenameEntryModal.js +0 -1
- package/dist/editor/components/UserBadge.d.ts +2 -3
- package/dist/editor/components/UserBadge.js +0 -1
- package/dist/editor/components/index.d.ts +3 -4
- package/dist/editor/components/index.js +0 -1
- package/dist/editor/context/ApiClientContext.d.ts +9 -3
- package/dist/editor/context/ApiClientContext.js +8 -4
- package/dist/editor/context/AssetContext.d.ts +26 -2
- package/dist/editor/context/AssetContext.js +23 -3
- package/dist/editor/context/EditorStateContext.d.ts +1 -2
- package/dist/editor/context/EditorStateContext.js +0 -1
- package/dist/editor/context/SWRProvider.d.ts +0 -1
- package/dist/editor/context/SWRProvider.js +0 -1
- package/dist/editor/context/index.d.ts +4 -5
- package/dist/editor/context/index.js +0 -1
- package/dist/editor/editor-config.d.ts +2 -3
- package/dist/editor/editor-config.js +0 -1
- package/dist/editor/editor-utils.d.ts +22 -10
- package/dist/editor/editor-utils.js +41 -10
- package/dist/editor/fields/BlockField.d.ts +1 -2
- package/dist/editor/fields/BlockField.js +0 -1
- package/dist/editor/fields/CodeField.d.ts +0 -1
- package/dist/editor/fields/CodeField.js +0 -1
- package/dist/editor/fields/DateTimeField.d.ts +0 -1
- package/dist/editor/fields/DateTimeField.js +0 -1
- package/dist/editor/fields/ImageField.d.ts +1 -2
- package/dist/editor/fields/ImageField.js +0 -1
- package/dist/editor/fields/InlineGroupField.d.ts +2 -3
- package/dist/editor/fields/InlineGroupField.js +0 -1
- package/dist/editor/fields/MarkdownField.d.ts +0 -1
- package/dist/editor/fields/MarkdownField.js +0 -1
- package/dist/editor/fields/MdxImageDialog.d.ts +0 -1
- package/dist/editor/fields/MdxImageDialog.js +0 -1
- package/dist/editor/fields/NumberField.d.ts +0 -1
- package/dist/editor/fields/NumberField.js +0 -1
- package/dist/editor/fields/NumberListField.d.ts +0 -1
- package/dist/editor/fields/NumberListField.js +0 -1
- package/dist/editor/fields/ObjectField.d.ts +11 -2
- package/dist/editor/fields/ObjectField.js +3 -4
- package/dist/editor/fields/ReferenceField.d.ts +0 -1
- package/dist/editor/fields/ReferenceField.js +8 -3
- package/dist/editor/fields/SelectField.d.ts +0 -1
- package/dist/editor/fields/SelectField.js +0 -1
- package/dist/editor/fields/StringListField.d.ts +0 -1
- package/dist/editor/fields/StringListField.js +0 -1
- package/dist/editor/fields/TextField.d.ts +0 -1
- package/dist/editor/fields/TextField.js +0 -1
- package/dist/editor/fields/ToggleField.d.ts +0 -1
- package/dist/editor/fields/ToggleField.js +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.d.ts +1 -2
- package/dist/editor/fields/entry-link/EntryLinkContext.js +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.d.ts +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.js +0 -1
- package/dist/editor/fields/entry-link/index.d.ts +2 -3
- package/dist/editor/fields/entry-link/index.js +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.d.ts +1 -2
- package/dist/editor/group-manager/ExternalGroupsTab.js +0 -1
- package/dist/editor/group-manager/GroupCard.d.ts +1 -2
- package/dist/editor/group-manager/GroupCard.js +0 -1
- package/dist/editor/group-manager/GroupForm.d.ts +1 -2
- package/dist/editor/group-manager/GroupForm.js +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.d.ts +1 -2
- package/dist/editor/group-manager/InternalGroupsTab.js +0 -1
- package/dist/editor/group-manager/MemberList.d.ts +1 -2
- package/dist/editor/group-manager/MemberList.js +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.js +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useGroupState.js +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useUserSearch.js +0 -1
- package/dist/editor/group-manager/index.d.ts +5 -6
- package/dist/editor/group-manager/index.js +0 -1
- package/dist/editor/group-manager/types.d.ts +4 -5
- package/dist/editor/group-manager/types.js +0 -1
- package/dist/editor/hooks/index.d.ts +14 -15
- package/dist/editor/hooks/index.js +0 -1
- package/dist/editor/hooks/useBranchActions.d.ts +0 -1
- package/dist/editor/hooks/useBranchActions.js +0 -1
- package/dist/editor/hooks/useBranchManager.d.ts +4 -5
- package/dist/editor/hooks/useBranchManager.js +0 -1
- package/dist/editor/hooks/useBranchesData.d.ts +2 -3
- package/dist/editor/hooks/useBranchesData.js +0 -1
- package/dist/editor/hooks/useCommentSystem.d.ts +2 -3
- package/dist/editor/hooks/useCommentSystem.js +0 -1
- package/dist/editor/hooks/useCommentsData.d.ts +2 -3
- package/dist/editor/hooks/useCommentsData.js +0 -1
- package/dist/editor/hooks/useDraftManager.d.ts +3 -4
- package/dist/editor/hooks/useDraftManager.js +0 -1
- package/dist/editor/hooks/useEditorLayout.d.ts +1 -2
- package/dist/editor/hooks/useEditorLayout.js +0 -1
- package/dist/editor/hooks/useEntriesData.d.ts +3 -5
- package/dist/editor/hooks/useEntriesData.js +0 -3
- package/dist/editor/hooks/useEntryLinkResolution.d.ts +2 -3
- package/dist/editor/hooks/useEntryLinkResolution.js +0 -1
- package/dist/editor/hooks/useEntryManager.d.ts +5 -7
- package/dist/editor/hooks/useEntryManager.js +8 -3
- package/dist/editor/hooks/useGroupManager.d.ts +2 -3
- package/dist/editor/hooks/useGroupManager.js +0 -1
- package/dist/editor/hooks/usePermissionManager.d.ts +2 -3
- package/dist/editor/hooks/usePermissionManager.js +0 -1
- package/dist/editor/hooks/useReferenceResolution.d.ts +1 -2
- package/dist/editor/hooks/useReferenceResolution.js +8 -3
- package/dist/editor/hooks/useSchemaManager.d.ts +2 -3
- package/dist/editor/hooks/useSchemaManager.js +0 -1
- package/dist/editor/hooks/useUserContext.d.ts +1 -2
- package/dist/editor/hooks/useUserContext.js +8 -3
- package/dist/editor/hooks/useUserMetadata.d.ts +2 -3
- package/dist/editor/hooks/useUserMetadata.js +0 -1
- package/dist/editor/media/AssetCard.d.ts +1 -2
- package/dist/editor/media/AssetCard.js +0 -1
- package/dist/editor/media/CropStep.d.ts +1 -2
- package/dist/editor/media/CropStep.js +0 -1
- package/dist/editor/media/MediaLibrary.d.ts +1 -2
- package/dist/editor/media/MediaLibrary.js +0 -1
- package/dist/editor/media/MediaLibraryBody.d.ts +1 -2
- package/dist/editor/media/MediaLibraryBody.js +0 -1
- package/dist/editor/media/crop-math.d.ts +1 -2
- package/dist/editor/media/crop-math.js +0 -1
- package/dist/editor/media/upload-asset.d.ts +2 -3
- package/dist/editor/media/upload-asset.js +0 -1
- package/dist/editor/media/upload-constants.d.ts +0 -1
- package/dist/editor/media/upload-constants.js +0 -1
- package/dist/editor/media/useAssetUpload.d.ts +1 -2
- package/dist/editor/media/useAssetUpload.js +0 -1
- package/dist/editor/media/xhr-upload.d.ts +0 -1
- package/dist/editor/media/xhr-upload.js +0 -1
- package/dist/editor/permission-manager/GroupSelector.d.ts +1 -2
- package/dist/editor/permission-manager/GroupSelector.js +0 -1
- package/dist/editor/permission-manager/PermissionEditor.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionEditor.js +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionLevelBadge.js +0 -1
- package/dist/editor/permission-manager/PermissionTree.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionTree.js +0 -1
- package/dist/editor/permission-manager/UserSelector.d.ts +1 -2
- package/dist/editor/permission-manager/UserSelector.js +0 -1
- package/dist/editor/permission-manager/constants.d.ts +1 -2
- package/dist/editor/permission-manager/constants.js +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.d.ts +1 -2
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.js +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.d.ts +2 -3
- package/dist/editor/permission-manager/hooks/usePermissionTree.js +0 -1
- package/dist/editor/permission-manager/index.d.ts +4 -5
- package/dist/editor/permission-manager/index.js +0 -1
- package/dist/editor/permission-manager/types.d.ts +3 -4
- package/dist/editor/permission-manager/types.js +0 -1
- package/dist/editor/permission-manager/utils.d.ts +2 -3
- package/dist/editor/permission-manager/utils.js +0 -1
- package/dist/editor/preview-bridge.d.ts +1 -2
- package/dist/editor/preview-bridge.js +0 -1
- package/dist/editor/relative-time.d.ts +0 -1
- package/dist/editor/relative-time.js +0 -1
- package/dist/editor/schema-editor/CollectionEditor.d.ts +4 -5
- package/dist/editor/schema-editor/CollectionEditor.js +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.d.ts +2 -3
- package/dist/editor/schema-editor/EntryTypeEditor.js +0 -1
- package/dist/editor/schema-editor/index.d.ts +2 -3
- package/dist/editor/schema-editor/index.js +0 -1
- package/dist/editor/theme.d.ts +0 -1
- package/dist/editor/theme.js +0 -1
- package/dist/editor/utils/env.d.ts +0 -1
- package/dist/editor/utils/env.js +0 -1
- package/dist/entry-link-resolver.d.ts +1 -2
- package/dist/entry-link-resolver.js +0 -1
- package/dist/entry-schema-registry.d.ts +3 -4
- package/dist/entry-schema-registry.js +6 -2
- package/dist/entry-schema.d.ts +342 -11
- package/dist/entry-schema.js +170 -1
- package/dist/git-manager.d.ts +1 -2
- package/dist/git-manager.js +0 -1
- package/dist/github-service.d.ts +1 -2
- package/dist/github-service.js +0 -1
- package/dist/http/handler.d.ts +6 -7
- package/dist/http/handler.js +0 -1
- package/dist/http/index.d.ts +6 -7
- package/dist/http/index.js +0 -1
- package/dist/http/router.d.ts +2 -3
- package/dist/http/router.js +0 -1
- package/dist/http/types.d.ts +0 -1
- package/dist/http/types.js +0 -1
- package/dist/id.d.ts +2 -3
- package/dist/id.js +0 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +7 -1
- package/dist/operating-mode/client-safe-strategy.d.ts +1 -2
- package/dist/operating-mode/client-safe-strategy.js +0 -1
- package/dist/operating-mode/client-unsafe-strategy.d.ts +1 -2
- package/dist/operating-mode/client-unsafe-strategy.js +0 -1
- package/dist/operating-mode/client.d.ts +3 -4
- package/dist/operating-mode/client.js +0 -1
- package/dist/operating-mode/deployment-name-fixtures.d.ts +0 -1
- package/dist/operating-mode/deployment-name-fixtures.js +0 -1
- package/dist/operating-mode/deployment-name.d.ts +0 -1
- package/dist/operating-mode/deployment-name.js +0 -1
- package/dist/operating-mode/index.d.ts +5 -6
- package/dist/operating-mode/index.js +0 -1
- package/dist/operating-mode/mode-env.d.ts +1 -2
- package/dist/operating-mode/mode-env.js +0 -1
- package/dist/operating-mode/types.d.ts +2 -3
- package/dist/operating-mode/types.js +0 -1
- package/dist/paths/branch-name.d.ts +1 -2
- package/dist/paths/branch-name.js +0 -1
- package/dist/paths/branch.d.ts +3 -4
- package/dist/paths/branch.js +0 -1
- package/dist/paths/index.d.ts +8 -9
- package/dist/paths/index.js +0 -1
- package/dist/paths/normalize-server.d.ts +1 -2
- package/dist/paths/normalize-server.js +0 -1
- package/dist/paths/normalize.d.ts +1 -2
- package/dist/paths/normalize.js +0 -1
- package/dist/paths/resolve.d.ts +2 -3
- package/dist/paths/resolve.js +0 -1
- package/dist/paths/types.d.ts +0 -1
- package/dist/paths/types.js +0 -1
- package/dist/paths/validation.d.ts +1 -2
- package/dist/paths/validation.js +0 -1
- package/dist/reference-resolver.d.ts +3 -4
- package/dist/reference-resolver.js +0 -1
- package/dist/resolve-canopy-user.d.ts +3 -4
- package/dist/resolve-canopy-user.js +0 -1
- package/dist/resource-generation.d.ts +0 -1
- package/dist/resource-generation.js +0 -1
- package/dist/schema/index.d.ts +3 -4
- package/dist/schema/index.js +0 -1
- package/dist/schema/meta-loader.d.ts +3 -4
- package/dist/schema/meta-loader.js +3 -3
- package/dist/schema/resolver.d.ts +2 -3
- package/dist/schema/resolver.js +0 -1
- package/dist/schema/schema-store-types.d.ts +2 -3
- package/dist/schema/schema-store-types.js +0 -1
- package/dist/schema/schema-store.d.ts +6 -7
- package/dist/schema/schema-store.js +33 -1
- package/dist/schema/types.d.ts +1 -2
- package/dist/schema/types.js +0 -1
- package/dist/server.d.ts +97 -37
- package/dist/server.js +60 -3
- package/dist/services.d.ts +10 -12
- package/dist/services.js +2 -7
- package/dist/settings-workspace.d.ts +12 -15
- package/dist/settings-workspace.js +10 -13
- package/dist/static/index.d.ts +227 -9
- package/dist/static/index.js +302 -14
- package/dist/static/seo.d.ts +128 -0
- package/dist/static/seo.js +162 -0
- package/dist/sync-core.d.ts +0 -1
- package/dist/sync-core.js +0 -1
- package/dist/task-queue/index.d.ts +2 -3
- package/dist/task-queue/index.js +0 -1
- package/dist/task-queue/task-queue.d.ts +1 -2
- package/dist/task-queue/task-queue.js +0 -1
- package/dist/task-queue/types.d.ts +0 -1
- package/dist/task-queue/types.js +0 -1
- package/dist/types.d.ts +3 -4
- package/dist/types.js +0 -1
- package/dist/url-collision.d.ts +86 -0
- package/dist/url-collision.js +186 -0
- package/dist/url-path-resolver.d.ts +11 -2
- package/dist/url-path-resolver.js +37 -5
- package/dist/user.d.ts +3 -4
- package/dist/user.js +0 -1
- package/dist/utils/async-mutex.d.ts +0 -1
- package/dist/utils/async-mutex.js +0 -1
- package/dist/utils/atomic-write.d.ts +0 -1
- package/dist/utils/atomic-write.js +0 -1
- package/dist/utils/body-field.d.ts +12 -2
- package/dist/utils/body-field.js +17 -1
- package/dist/utils/content-serialize.d.ts +37 -0
- package/dist/utils/content-serialize.js +429 -0
- package/dist/utils/content-write-lock.d.ts +12 -16
- package/dist/utils/content-write-lock.js +38 -22
- package/dist/utils/debug.d.ts +0 -1
- package/dist/utils/debug.js +0 -1
- package/dist/utils/entry-url.d.ts +17 -1
- package/dist/utils/entry-url.js +21 -3
- package/dist/utils/error.d.ts +0 -1
- package/dist/utils/error.js +0 -1
- package/dist/utils/flatten-group-fields.d.ts +1 -2
- package/dist/utils/flatten-group-fields.js +0 -1
- package/dist/utils/format.d.ts +1 -2
- package/dist/utils/format.js +0 -1
- package/dist/utils/fs.d.ts +7 -1
- package/dist/utils/fs.js +16 -1
- package/dist/utils/git.d.ts +1 -2
- package/dist/utils/git.js +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/occ-json-write.d.ts +0 -1
- package/dist/utils/occ-json-write.js +0 -1
- package/dist/utils/provisioning-lock.d.ts +17 -4
- package/dist/utils/provisioning-lock.js +94 -14
- package/dist/utils/sanitize-href.d.ts +46 -1
- package/dist/utils/sanitize-href.js +63 -3
- package/dist/utils/title-field.d.ts +1 -2
- package/dist/utils/title-field.js +0 -1
- package/dist/utils/typed-filename.d.ts +61 -0
- package/dist/utils/typed-filename.js +92 -0
- package/dist/utils/url-prefix.d.ts +121 -0
- package/dist/utils/url-prefix.js +158 -0
- package/dist/validation/block-structural-keys.d.ts +42 -0
- package/dist/validation/block-structural-keys.js +44 -0
- package/dist/validation/deletion-checker.d.ts +4 -5
- package/dist/validation/deletion-checker.js +0 -1
- package/dist/validation/entry-link-validator.d.ts +2 -3
- package/dist/validation/entry-link-validator.js +0 -1
- package/dist/validation/entry-type-reference-validator.d.ts +1 -2
- package/dist/validation/entry-type-reference-validator.js +0 -1
- package/dist/validation/entry-validator.d.ts +23 -2
- package/dist/validation/entry-validator.js +34 -2
- package/dist/validation/field-traversal.d.ts +28 -4
- package/dist/validation/field-traversal.js +24 -7
- package/dist/validation/reference-validator.d.ts +2 -3
- package/dist/validation/reference-validator.js +0 -1
- package/dist/worker/cms-worker.d.ts +9 -2
- package/dist/worker/cms-worker.js +59 -2
- package/dist/worker/log.d.ts +0 -1
- package/dist/worker/log.js +0 -1
- package/dist/worker/task-queue-config.d.ts +1 -2
- package/dist/worker/task-queue-config.js +0 -1
- package/dist/worker/task-queue.d.ts +3 -4
- package/dist/worker/task-queue.js +0 -1
- package/dist/worker/worker-status.d.ts +1 -2
- package/dist/worker/worker-status.js +0 -1
- package/package.json +2 -6
- package/dist/ai/generate.d.ts.map +0 -1
- package/dist/ai/generate.js.map +0 -1
- package/dist/ai/handler.d.ts.map +0 -1
- package/dist/ai/handler.js.map +0 -1
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/json-to-markdown.d.ts.map +0 -1
- package/dist/ai/json-to-markdown.js.map +0 -1
- package/dist/ai/resolve-branch.d.ts.map +0 -1
- package/dist/ai/resolve-branch.js.map +0 -1
- package/dist/ai/strip-mdx.d.ts.map +0 -1
- package/dist/ai/strip-mdx.js.map +0 -1
- package/dist/ai/transform-components.d.ts.map +0 -1
- package/dist/ai/transform-components.js.map +0 -1
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/ai/types.js.map +0 -1
- package/dist/api/__test__/mock-client.d.ts +0 -231
- package/dist/api/__test__/mock-client.d.ts.map +0 -1
- package/dist/api/__test__/mock-client.js +0 -388
- package/dist/api/__test__/mock-client.js.map +0 -1
- package/dist/api/admin-branch-health.d.ts.map +0 -1
- package/dist/api/admin-branch-health.js.map +0 -1
- package/dist/api/admin.d.ts.map +0 -1
- package/dist/api/admin.js.map +0 -1
- package/dist/api/assets.d.ts.map +0 -1
- package/dist/api/assets.js.map +0 -1
- package/dist/api/branch-merge.d.ts.map +0 -1
- package/dist/api/branch-merge.js.map +0 -1
- package/dist/api/branch-review.d.ts.map +0 -1
- package/dist/api/branch-review.js.map +0 -1
- package/dist/api/branch-status.d.ts.map +0 -1
- package/dist/api/branch-status.js.map +0 -1
- package/dist/api/branch-withdraw.d.ts.map +0 -1
- package/dist/api/branch-withdraw.js.map +0 -1
- package/dist/api/branch.d.ts.map +0 -1
- package/dist/api/branch.js.map +0 -1
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js.map +0 -1
- package/dist/api/comments.d.ts.map +0 -1
- package/dist/api/comments.js.map +0 -1
- package/dist/api/content.d.ts.map +0 -1
- package/dist/api/content.js.map +0 -1
- package/dist/api/entries-constants.d.ts.map +0 -1
- package/dist/api/entries-constants.js.map +0 -1
- package/dist/api/entries.d.ts.map +0 -1
- package/dist/api/entries.js.map +0 -1
- package/dist/api/github-sync.d.ts.map +0 -1
- package/dist/api/github-sync.js.map +0 -1
- package/dist/api/groups.d.ts.map +0 -1
- package/dist/api/groups.js.map +0 -1
- package/dist/api/guards.d.ts.map +0 -1
- package/dist/api/guards.js.map +0 -1
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/permissions.d.ts.map +0 -1
- package/dist/api/permissions.js.map +0 -1
- package/dist/api/reference-options.d.ts.map +0 -1
- package/dist/api/reference-options.js.map +0 -1
- package/dist/api/request-body-hash.d.ts.map +0 -1
- package/dist/api/request-body-hash.js.map +0 -1
- package/dist/api/resolve-references.d.ts.map +0 -1
- package/dist/api/resolve-references.js.map +0 -1
- package/dist/api/route-builder.d.ts.map +0 -1
- package/dist/api/route-builder.js.map +0 -1
- package/dist/api/schema.d.ts.map +0 -1
- package/dist/api/schema.js.map +0 -1
- package/dist/api/settings-helpers.d.ts.map +0 -1
- package/dist/api/settings-helpers.js.map +0 -1
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js.map +0 -1
- package/dist/api/user.d.ts.map +0 -1
- package/dist/api/user.js.map +0 -1
- package/dist/api/validators.d.ts.map +0 -1
- package/dist/api/validators.js.map +0 -1
- package/dist/assets/asset-prefixes.d.ts.map +0 -1
- package/dist/assets/asset-prefixes.js.map +0 -1
- package/dist/assets/asset-src.d.ts.map +0 -1
- package/dist/assets/asset-src.js.map +0 -1
- package/dist/assets/asset-url.d.ts.map +0 -1
- package/dist/assets/asset-url.js.map +0 -1
- package/dist/assets/factory.d.ts.map +0 -1
- package/dist/assets/factory.js.map +0 -1
- package/dist/assets/finalize.d.ts.map +0 -1
- package/dist/assets/finalize.js.map +0 -1
- package/dist/assets/index.d.ts.map +0 -1
- package/dist/assets/index.js.map +0 -1
- package/dist/assets/keys.d.ts.map +0 -1
- package/dist/assets/keys.js.map +0 -1
- package/dist/assets/pipeline.d.ts.map +0 -1
- package/dist/assets/pipeline.js.map +0 -1
- package/dist/assets/store-local.d.ts.map +0 -1
- package/dist/assets/store-local.js.map +0 -1
- package/dist/assets/store-s3.d.ts.map +0 -1
- package/dist/assets/store-s3.js.map +0 -1
- package/dist/assets/svg-sanitizer.d.ts.map +0 -1
- package/dist/assets/svg-sanitizer.js.map +0 -1
- package/dist/assets/transform-directives.d.ts.map +0 -1
- package/dist/assets/transform-directives.js.map +0 -1
- package/dist/assets/transform.d.ts.map +0 -1
- package/dist/assets/transform.js.map +0 -1
- package/dist/assets/types.d.ts.map +0 -1
- package/dist/assets/types.js.map +0 -1
- package/dist/auth/cache.d.ts.map +0 -1
- package/dist/auth/cache.js.map +0 -1
- package/dist/auth/caching-auth-plugin.d.ts.map +0 -1
- package/dist/auth/caching-auth-plugin.js.map +0 -1
- package/dist/auth/context-helpers.d.ts.map +0 -1
- package/dist/auth/context-helpers.js.map +0 -1
- package/dist/auth/file-based-auth-cache.d.ts.map +0 -1
- package/dist/auth/file-based-auth-cache.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/plugin.d.ts.map +0 -1
- package/dist/auth/plugin.js.map +0 -1
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js.map +0 -1
- package/dist/authorization/branch.d.ts.map +0 -1
- package/dist/authorization/branch.js.map +0 -1
- package/dist/authorization/content.d.ts.map +0 -1
- package/dist/authorization/content.js.map +0 -1
- package/dist/authorization/groups/index.d.ts.map +0 -1
- package/dist/authorization/groups/index.js.map +0 -1
- package/dist/authorization/groups/loader.d.ts.map +0 -1
- package/dist/authorization/groups/loader.js.map +0 -1
- package/dist/authorization/groups/schema.d.ts.map +0 -1
- package/dist/authorization/groups/schema.js.map +0 -1
- package/dist/authorization/helpers.d.ts.map +0 -1
- package/dist/authorization/helpers.js.map +0 -1
- package/dist/authorization/index.d.ts.map +0 -1
- package/dist/authorization/index.js.map +0 -1
- package/dist/authorization/path.d.ts.map +0 -1
- package/dist/authorization/path.js.map +0 -1
- package/dist/authorization/permissions/index.d.ts.map +0 -1
- package/dist/authorization/permissions/index.js.map +0 -1
- package/dist/authorization/permissions/loader.d.ts.map +0 -1
- package/dist/authorization/permissions/loader.js.map +0 -1
- package/dist/authorization/permissions/schema.d.ts.map +0 -1
- package/dist/authorization/permissions/schema.js.map +0 -1
- package/dist/authorization/protected-branch.d.ts.map +0 -1
- package/dist/authorization/protected-branch.js.map +0 -1
- package/dist/authorization/settings-file-store.d.ts.map +0 -1
- package/dist/authorization/settings-file-store.js.map +0 -1
- package/dist/authorization/test-utils.d.ts +0 -26
- package/dist/authorization/test-utils.d.ts.map +0 -1
- package/dist/authorization/test-utils.js +0 -23
- package/dist/authorization/test-utils.js.map +0 -1
- package/dist/authorization/types.d.ts.map +0 -1
- package/dist/authorization/types.js.map +0 -1
- package/dist/authorization/validation.d.ts.map +0 -1
- package/dist/authorization/validation.js.map +0 -1
- package/dist/branch-health.d.ts.map +0 -1
- package/dist/branch-health.js.map +0 -1
- package/dist/branch-metadata.d.ts.map +0 -1
- package/dist/branch-metadata.js.map +0 -1
- package/dist/branch-registry.d.ts.map +0 -1
- package/dist/branch-registry.js.map +0 -1
- package/dist/branch-schema-cache.d.ts.map +0 -1
- package/dist/branch-schema-cache.js.map +0 -1
- package/dist/branch-workspace.d.ts.map +0 -1
- package/dist/branch-workspace.js.map +0 -1
- package/dist/build/generate-ai-content.d.ts.map +0 -1
- package/dist/build/generate-ai-content.js.map +0 -1
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js.map +0 -1
- package/dist/build-mode.d.ts.map +0 -1
- package/dist/build-mode.js.map +0 -1
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/generate-ai-content.d.ts.map +0 -1
- package/dist/cli/generate-ai-content.js.map +0 -1
- package/dist/cli/init.d.ts.map +0 -1
- package/dist/cli/init.js.map +0 -1
- package/dist/cli/migrate.d.ts.map +0 -1
- package/dist/cli/migrate.js.map +0 -1
- package/dist/cli/project-detect.d.ts.map +0 -1
- package/dist/cli/project-detect.js.map +0 -1
- package/dist/cli/project-root.d.ts.map +0 -1
- package/dist/cli/project-root.js.map +0 -1
- package/dist/cli/sync.d.ts.map +0 -1
- package/dist/cli/sync.js.map +0 -1
- package/dist/cli/templates.d.ts.map +0 -1
- package/dist/cli/templates.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/comment-store.d.ts.map +0 -1
- package/dist/comment-store.js.map +0 -1
- package/dist/config/flatten.d.ts.map +0 -1
- package/dist/config/flatten.js.map +0 -1
- package/dist/config/helpers.d.ts.map +0 -1
- package/dist/config/helpers.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/schemas/collection.d.ts.map +0 -1
- package/dist/config/schemas/collection.js.map +0 -1
- package/dist/config/schemas/config.d.ts.map +0 -1
- package/dist/config/schemas/config.js.map +0 -1
- package/dist/config/schemas/field.d.ts.map +0 -1
- package/dist/config/schemas/field.js.map +0 -1
- package/dist/config/schemas/media.d.ts.map +0 -1
- package/dist/config/schemas/media.js.map +0 -1
- package/dist/config/schemas/permissions.d.ts.map +0 -1
- package/dist/config/schemas/permissions.js.map +0 -1
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js.map +0 -1
- package/dist/config/validation.d.ts.map +0 -1
- package/dist/config/validation.js.map +0 -1
- package/dist/config-test.d.ts +0 -20
- package/dist/config-test.d.ts.map +0 -1
- package/dist/config-test.js +0 -49
- package/dist/config-test.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/content-id-index.d.ts.map +0 -1
- package/dist/content-id-index.js.map +0 -1
- package/dist/content-index-generation.d.ts.map +0 -1
- package/dist/content-index-generation.js.map +0 -1
- package/dist/content-index-registry.d.ts.map +0 -1
- package/dist/content-index-registry.js.map +0 -1
- package/dist/content-listing.d.ts.map +0 -1
- package/dist/content-listing.js.map +0 -1
- package/dist/content-reader.d.ts.map +0 -1
- package/dist/content-reader.js.map +0 -1
- package/dist/content-store.d.ts.map +0 -1
- package/dist/content-store.js.map +0 -1
- package/dist/content-tree.d.ts.map +0 -1
- package/dist/content-tree.js.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/dev-content-watcher.d.ts.map +0 -1
- package/dist/dev-content-watcher.js.map +0 -1
- package/dist/editor/BranchManager.d.ts.map +0 -1
- package/dist/editor/BranchManager.js.map +0 -1
- package/dist/editor/CanopyEditor.d.ts.map +0 -1
- package/dist/editor/CanopyEditor.js.map +0 -1
- package/dist/editor/CanopyEditorPage.d.ts.map +0 -1
- package/dist/editor/CanopyEditorPage.js.map +0 -1
- package/dist/editor/CommentsPanel.d.ts.map +0 -1
- package/dist/editor/CommentsPanel.js.map +0 -1
- package/dist/editor/Editor.d.ts.map +0 -1
- package/dist/editor/Editor.js.map +0 -1
- package/dist/editor/EditorPanes.d.ts.map +0 -1
- package/dist/editor/EditorPanes.js.map +0 -1
- package/dist/editor/EntryNavigator.d.ts.map +0 -1
- package/dist/editor/EntryNavigator.js.map +0 -1
- package/dist/editor/FormRenderer.d.ts.map +0 -1
- package/dist/editor/FormRenderer.js.map +0 -1
- package/dist/editor/GroupManager.d.ts.map +0 -1
- package/dist/editor/GroupManager.js.map +0 -1
- package/dist/editor/PermissionManager.d.ts.map +0 -1
- package/dist/editor/PermissionManager.js.map +0 -1
- package/dist/editor/admin/SystemHealthPanel.d.ts.map +0 -1
- package/dist/editor/admin/SystemHealthPanel.js.map +0 -1
- package/dist/editor/admin/useSystemHealth.d.ts.map +0 -1
- package/dist/editor/admin/useSystemHealth.js.map +0 -1
- package/dist/editor/canopy-path.d.ts.map +0 -1
- package/dist/editor/canopy-path.js.map +0 -1
- package/dist/editor/client-reference-resolver.d.ts.map +0 -1
- package/dist/editor/client-reference-resolver.js.map +0 -1
- package/dist/editor/comments/BranchComments.d.ts.map +0 -1
- package/dist/editor/comments/BranchComments.js.map +0 -1
- package/dist/editor/comments/EntryComments.d.ts.map +0 -1
- package/dist/editor/comments/EntryComments.js.map +0 -1
- package/dist/editor/comments/FieldWrapper.d.ts.map +0 -1
- package/dist/editor/comments/FieldWrapper.js.map +0 -1
- package/dist/editor/comments/InlineCommentThread.d.ts.map +0 -1
- package/dist/editor/comments/InlineCommentThread.js.map +0 -1
- package/dist/editor/comments/ThreadCarousel.d.ts.map +0 -1
- package/dist/editor/comments/ThreadCarousel.js.map +0 -1
- package/dist/editor/components/ConfirmDeleteModal.d.ts.map +0 -1
- package/dist/editor/components/ConfirmDeleteModal.js.map +0 -1
- package/dist/editor/components/EditorFooter.d.ts.map +0 -1
- package/dist/editor/components/EditorFooter.js.map +0 -1
- package/dist/editor/components/EditorHeader.d.ts.map +0 -1
- package/dist/editor/components/EditorHeader.js.map +0 -1
- package/dist/editor/components/EditorSidebar.d.ts.map +0 -1
- package/dist/editor/components/EditorSidebar.js.map +0 -1
- package/dist/editor/components/EntryCreateModal.d.ts.map +0 -1
- package/dist/editor/components/EntryCreateModal.js.map +0 -1
- package/dist/editor/components/RenameEntryModal.d.ts.map +0 -1
- package/dist/editor/components/RenameEntryModal.js.map +0 -1
- package/dist/editor/components/UserBadge.d.ts.map +0 -1
- package/dist/editor/components/UserBadge.js.map +0 -1
- package/dist/editor/components/index.d.ts.map +0 -1
- package/dist/editor/components/index.js.map +0 -1
- package/dist/editor/context/ApiClientContext.d.ts.map +0 -1
- package/dist/editor/context/ApiClientContext.js.map +0 -1
- package/dist/editor/context/AssetContext.d.ts.map +0 -1
- package/dist/editor/context/AssetContext.js.map +0 -1
- package/dist/editor/context/EditorStateContext.d.ts.map +0 -1
- package/dist/editor/context/EditorStateContext.js.map +0 -1
- package/dist/editor/context/SWRProvider.d.ts.map +0 -1
- package/dist/editor/context/SWRProvider.js.map +0 -1
- package/dist/editor/context/index.d.ts.map +0 -1
- package/dist/editor/context/index.js.map +0 -1
- package/dist/editor/editor-config.d.ts.map +0 -1
- package/dist/editor/editor-config.js.map +0 -1
- package/dist/editor/editor-utils.d.ts.map +0 -1
- package/dist/editor/editor-utils.js.map +0 -1
- package/dist/editor/fields/BlockField.d.ts.map +0 -1
- package/dist/editor/fields/BlockField.js.map +0 -1
- package/dist/editor/fields/CodeField.d.ts.map +0 -1
- package/dist/editor/fields/CodeField.js.map +0 -1
- package/dist/editor/fields/DateTimeField.d.ts.map +0 -1
- package/dist/editor/fields/DateTimeField.js.map +0 -1
- package/dist/editor/fields/ImageField.d.ts.map +0 -1
- package/dist/editor/fields/ImageField.js.map +0 -1
- package/dist/editor/fields/InlineGroupField.d.ts.map +0 -1
- package/dist/editor/fields/InlineGroupField.js.map +0 -1
- package/dist/editor/fields/MarkdownField.d.ts.map +0 -1
- package/dist/editor/fields/MarkdownField.js.map +0 -1
- package/dist/editor/fields/MdxImageDialog.d.ts.map +0 -1
- package/dist/editor/fields/MdxImageDialog.js.map +0 -1
- package/dist/editor/fields/NumberField.d.ts.map +0 -1
- package/dist/editor/fields/NumberField.js.map +0 -1
- package/dist/editor/fields/NumberListField.d.ts.map +0 -1
- package/dist/editor/fields/NumberListField.js.map +0 -1
- package/dist/editor/fields/ObjectField.d.ts.map +0 -1
- package/dist/editor/fields/ObjectField.js.map +0 -1
- package/dist/editor/fields/ReferenceField.d.ts.map +0 -1
- package/dist/editor/fields/ReferenceField.js.map +0 -1
- package/dist/editor/fields/SelectField.d.ts.map +0 -1
- package/dist/editor/fields/SelectField.js.map +0 -1
- package/dist/editor/fields/StringListField.d.ts.map +0 -1
- package/dist/editor/fields/StringListField.js.map +0 -1
- package/dist/editor/fields/TextField.d.ts.map +0 -1
- package/dist/editor/fields/TextField.js.map +0 -1
- package/dist/editor/fields/ToggleField.d.ts.map +0 -1
- package/dist/editor/fields/ToggleField.js.map +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.js.map +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.js.map +0 -1
- package/dist/editor/fields/entry-link/index.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/index.js.map +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.d.ts.map +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.js.map +0 -1
- package/dist/editor/group-manager/GroupCard.d.ts.map +0 -1
- package/dist/editor/group-manager/GroupCard.js.map +0 -1
- package/dist/editor/group-manager/GroupForm.d.ts.map +0 -1
- package/dist/editor/group-manager/GroupForm.js.map +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.d.ts.map +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.js.map +0 -1
- package/dist/editor/group-manager/MemberList.d.ts.map +0 -1
- package/dist/editor/group-manager/MemberList.js.map +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.js.map +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.js.map +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.js.map +0 -1
- package/dist/editor/group-manager/index.d.ts.map +0 -1
- package/dist/editor/group-manager/index.js.map +0 -1
- package/dist/editor/group-manager/types.d.ts.map +0 -1
- package/dist/editor/group-manager/types.js.map +0 -1
- package/dist/editor/hooks/__test__/test-utils.d.ts +0 -164
- package/dist/editor/hooks/__test__/test-utils.d.ts.map +0 -1
- package/dist/editor/hooks/__test__/test-utils.js +0 -203
- package/dist/editor/hooks/__test__/test-utils.js.map +0 -1
- package/dist/editor/hooks/index.d.ts.map +0 -1
- package/dist/editor/hooks/index.js.map +0 -1
- package/dist/editor/hooks/useBranchActions.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchActions.js.map +0 -1
- package/dist/editor/hooks/useBranchManager.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchManager.js.map +0 -1
- package/dist/editor/hooks/useBranchesData.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchesData.js.map +0 -1
- package/dist/editor/hooks/useCommentSystem.d.ts.map +0 -1
- package/dist/editor/hooks/useCommentSystem.js.map +0 -1
- package/dist/editor/hooks/useCommentsData.d.ts.map +0 -1
- package/dist/editor/hooks/useCommentsData.js.map +0 -1
- package/dist/editor/hooks/useDraftManager.d.ts.map +0 -1
- package/dist/editor/hooks/useDraftManager.js.map +0 -1
- package/dist/editor/hooks/useEditorLayout.d.ts.map +0 -1
- package/dist/editor/hooks/useEditorLayout.js.map +0 -1
- package/dist/editor/hooks/useEntriesData.d.ts.map +0 -1
- package/dist/editor/hooks/useEntriesData.js.map +0 -1
- package/dist/editor/hooks/useEntryLinkResolution.d.ts.map +0 -1
- package/dist/editor/hooks/useEntryLinkResolution.js.map +0 -1
- package/dist/editor/hooks/useEntryManager.d.ts.map +0 -1
- package/dist/editor/hooks/useEntryManager.js.map +0 -1
- package/dist/editor/hooks/useGroupManager.d.ts.map +0 -1
- package/dist/editor/hooks/useGroupManager.js.map +0 -1
- package/dist/editor/hooks/usePermissionManager.d.ts.map +0 -1
- package/dist/editor/hooks/usePermissionManager.js.map +0 -1
- package/dist/editor/hooks/useReferenceResolution.d.ts.map +0 -1
- package/dist/editor/hooks/useReferenceResolution.js.map +0 -1
- package/dist/editor/hooks/useSchemaManager.d.ts.map +0 -1
- package/dist/editor/hooks/useSchemaManager.js.map +0 -1
- package/dist/editor/hooks/useUserContext.d.ts.map +0 -1
- package/dist/editor/hooks/useUserContext.js.map +0 -1
- package/dist/editor/hooks/useUserMetadata.d.ts.map +0 -1
- package/dist/editor/hooks/useUserMetadata.js.map +0 -1
- package/dist/editor/media/AssetCard.d.ts.map +0 -1
- package/dist/editor/media/AssetCard.js.map +0 -1
- package/dist/editor/media/CropStep.d.ts.map +0 -1
- package/dist/editor/media/CropStep.js.map +0 -1
- package/dist/editor/media/MediaLibrary.d.ts.map +0 -1
- package/dist/editor/media/MediaLibrary.js.map +0 -1
- package/dist/editor/media/MediaLibraryBody.d.ts.map +0 -1
- package/dist/editor/media/MediaLibraryBody.js.map +0 -1
- package/dist/editor/media/crop-math.d.ts.map +0 -1
- package/dist/editor/media/crop-math.js.map +0 -1
- package/dist/editor/media/upload-asset.d.ts.map +0 -1
- package/dist/editor/media/upload-asset.js.map +0 -1
- package/dist/editor/media/upload-constants.d.ts.map +0 -1
- package/dist/editor/media/upload-constants.js.map +0 -1
- package/dist/editor/media/useAssetUpload.d.ts.map +0 -1
- package/dist/editor/media/useAssetUpload.js.map +0 -1
- package/dist/editor/media/xhr-upload.d.ts.map +0 -1
- package/dist/editor/media/xhr-upload.js.map +0 -1
- package/dist/editor/permission-manager/GroupSelector.d.ts.map +0 -1
- package/dist/editor/permission-manager/GroupSelector.js.map +0 -1
- package/dist/editor/permission-manager/PermissionEditor.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionEditor.js.map +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.js.map +0 -1
- package/dist/editor/permission-manager/PermissionTree.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionTree.js.map +0 -1
- package/dist/editor/permission-manager/UserSelector.d.ts.map +0 -1
- package/dist/editor/permission-manager/UserSelector.js.map +0 -1
- package/dist/editor/permission-manager/constants.d.ts.map +0 -1
- package/dist/editor/permission-manager/constants.js.map +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.d.ts.map +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.js.map +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.d.ts.map +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.js.map +0 -1
- package/dist/editor/permission-manager/index.d.ts.map +0 -1
- package/dist/editor/permission-manager/index.js.map +0 -1
- package/dist/editor/permission-manager/types.d.ts.map +0 -1
- package/dist/editor/permission-manager/types.js.map +0 -1
- package/dist/editor/permission-manager/utils.d.ts.map +0 -1
- package/dist/editor/permission-manager/utils.js.map +0 -1
- package/dist/editor/preview-bridge.d.ts.map +0 -1
- package/dist/editor/preview-bridge.js.map +0 -1
- package/dist/editor/relative-time.d.ts.map +0 -1
- package/dist/editor/relative-time.js.map +0 -1
- package/dist/editor/schema-editor/CollectionEditor.d.ts.map +0 -1
- package/dist/editor/schema-editor/CollectionEditor.js.map +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.d.ts.map +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.js.map +0 -1
- package/dist/editor/schema-editor/index.d.ts.map +0 -1
- package/dist/editor/schema-editor/index.js.map +0 -1
- package/dist/editor/setup-test-dom.d.ts +0 -1
- package/dist/editor/setup-test-dom.d.ts.map +0 -1
- package/dist/editor/setup-test-dom.js +0 -12
- package/dist/editor/setup-test-dom.js.map +0 -1
- package/dist/editor/test-setup.d.ts +0 -6
- package/dist/editor/test-setup.d.ts.map +0 -1
- package/dist/editor/test-setup.js +0 -42
- package/dist/editor/test-setup.js.map +0 -1
- package/dist/editor/theme.d.ts.map +0 -1
- package/dist/editor/theme.js.map +0 -1
- package/dist/editor/utils/env.d.ts.map +0 -1
- package/dist/editor/utils/env.js.map +0 -1
- package/dist/entry-link-resolver.d.ts.map +0 -1
- package/dist/entry-link-resolver.js.map +0 -1
- package/dist/entry-schema-registry.d.ts.map +0 -1
- package/dist/entry-schema-registry.js.map +0 -1
- package/dist/entry-schema.d.ts.map +0 -1
- package/dist/entry-schema.js.map +0 -1
- package/dist/git-manager.d.ts.map +0 -1
- package/dist/git-manager.js.map +0 -1
- package/dist/github-service.d.ts.map +0 -1
- package/dist/github-service.js.map +0 -1
- package/dist/http/handler.d.ts.map +0 -1
- package/dist/http/handler.js.map +0 -1
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/http/router.d.ts.map +0 -1
- package/dist/http/router.js.map +0 -1
- package/dist/http/types.d.ts.map +0 -1
- package/dist/http/types.js.map +0 -1
- package/dist/id.d.ts.map +0 -1
- package/dist/id.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/operating-mode/client-safe-strategy.d.ts.map +0 -1
- package/dist/operating-mode/client-safe-strategy.js.map +0 -1
- package/dist/operating-mode/client-unsafe-strategy.d.ts.map +0 -1
- package/dist/operating-mode/client-unsafe-strategy.js.map +0 -1
- package/dist/operating-mode/client.d.ts.map +0 -1
- package/dist/operating-mode/client.js.map +0 -1
- package/dist/operating-mode/deployment-name-fixtures.d.ts.map +0 -1
- package/dist/operating-mode/deployment-name-fixtures.js.map +0 -1
- package/dist/operating-mode/deployment-name.d.ts.map +0 -1
- package/dist/operating-mode/deployment-name.js.map +0 -1
- package/dist/operating-mode/index.d.ts.map +0 -1
- package/dist/operating-mode/index.js.map +0 -1
- package/dist/operating-mode/mode-env.d.ts.map +0 -1
- package/dist/operating-mode/mode-env.js.map +0 -1
- package/dist/operating-mode/types.d.ts.map +0 -1
- package/dist/operating-mode/types.js.map +0 -1
- package/dist/paths/branch-name.d.ts.map +0 -1
- package/dist/paths/branch-name.js.map +0 -1
- package/dist/paths/branch.d.ts.map +0 -1
- package/dist/paths/branch.js.map +0 -1
- package/dist/paths/index.d.ts.map +0 -1
- package/dist/paths/index.js.map +0 -1
- package/dist/paths/normalize-server.d.ts.map +0 -1
- package/dist/paths/normalize-server.js.map +0 -1
- package/dist/paths/normalize.d.ts.map +0 -1
- package/dist/paths/normalize.js.map +0 -1
- package/dist/paths/resolve.d.ts.map +0 -1
- package/dist/paths/resolve.js.map +0 -1
- package/dist/paths/test-utils.d.ts +0 -22
- package/dist/paths/test-utils.d.ts.map +0 -1
- package/dist/paths/test-utils.js +0 -21
- package/dist/paths/test-utils.js.map +0 -1
- package/dist/paths/types.d.ts.map +0 -1
- package/dist/paths/types.js.map +0 -1
- package/dist/paths/validation.d.ts.map +0 -1
- package/dist/paths/validation.js.map +0 -1
- package/dist/reference-resolver.d.ts.map +0 -1
- package/dist/reference-resolver.js.map +0 -1
- package/dist/resolve-canopy-user.d.ts.map +0 -1
- package/dist/resolve-canopy-user.js.map +0 -1
- package/dist/resource-generation.d.ts.map +0 -1
- package/dist/resource-generation.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/meta-loader.d.ts.map +0 -1
- package/dist/schema/meta-loader.js.map +0 -1
- package/dist/schema/resolver.d.ts.map +0 -1
- package/dist/schema/resolver.js.map +0 -1
- package/dist/schema/schema-store-types.d.ts.map +0 -1
- package/dist/schema/schema-store-types.js.map +0 -1
- package/dist/schema/schema-store.d.ts.map +0 -1
- package/dist/schema/schema-store.js.map +0 -1
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/services.d.ts.map +0 -1
- package/dist/services.js.map +0 -1
- package/dist/settings-workspace.d.ts.map +0 -1
- package/dist/settings-workspace.js.map +0 -1
- package/dist/static/index.d.ts.map +0 -1
- package/dist/static/index.js.map +0 -1
- package/dist/sync-core.d.ts.map +0 -1
- package/dist/sync-core.js.map +0 -1
- package/dist/task-queue/index.d.ts.map +0 -1
- package/dist/task-queue/index.js.map +0 -1
- package/dist/task-queue/task-queue.d.ts.map +0 -1
- package/dist/task-queue/task-queue.js.map +0 -1
- package/dist/task-queue/types.d.ts.map +0 -1
- package/dist/task-queue/types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/url-path-resolver.d.ts.map +0 -1
- package/dist/url-path-resolver.js.map +0 -1
- package/dist/user.d.ts.map +0 -1
- package/dist/user.js.map +0 -1
- package/dist/utils/async-mutex.d.ts.map +0 -1
- package/dist/utils/async-mutex.js.map +0 -1
- package/dist/utils/atomic-write.d.ts.map +0 -1
- package/dist/utils/atomic-write.js.map +0 -1
- package/dist/utils/body-field.d.ts.map +0 -1
- package/dist/utils/body-field.js.map +0 -1
- package/dist/utils/content-write-lock.d.ts.map +0 -1
- package/dist/utils/content-write-lock.js.map +0 -1
- package/dist/utils/debug.d.ts.map +0 -1
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/entry-url.d.ts.map +0 -1
- package/dist/utils/entry-url.js.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/flatten-group-fields.d.ts.map +0 -1
- package/dist/utils/flatten-group-fields.js.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/fs.d.ts.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/occ-json-write.d.ts.map +0 -1
- package/dist/utils/occ-json-write.js.map +0 -1
- package/dist/utils/provisioning-lock.d.ts.map +0 -1
- package/dist/utils/provisioning-lock.js.map +0 -1
- package/dist/utils/sanitize-href.d.ts.map +0 -1
- package/dist/utils/sanitize-href.js.map +0 -1
- package/dist/utils/title-field.d.ts.map +0 -1
- package/dist/utils/title-field.js.map +0 -1
- package/dist/validation/deletion-checker.d.ts.map +0 -1
- package/dist/validation/deletion-checker.js.map +0 -1
- package/dist/validation/entry-link-validator.d.ts.map +0 -1
- package/dist/validation/entry-link-validator.js.map +0 -1
- package/dist/validation/entry-type-reference-validator.d.ts.map +0 -1
- package/dist/validation/entry-type-reference-validator.js.map +0 -1
- package/dist/validation/entry-validator.d.ts.map +0 -1
- package/dist/validation/entry-validator.js.map +0 -1
- package/dist/validation/field-traversal.d.ts.map +0 -1
- package/dist/validation/field-traversal.js.map +0 -1
- package/dist/validation/reference-validator.d.ts.map +0 -1
- package/dist/validation/reference-validator.js.map +0 -1
- package/dist/worker/cms-worker.d.ts.map +0 -1
- package/dist/worker/cms-worker.js.map +0 -1
- package/dist/worker/log.d.ts.map +0 -1
- package/dist/worker/log.js.map +0 -1
- package/dist/worker/task-queue-config.d.ts.map +0 -1
- package/dist/worker/task-queue-config.js.map +0 -1
- package/dist/worker/task-queue.d.ts.map +0 -1
- package/dist/worker/task-queue.js.map +0 -1
- package/dist/worker/worker-status.d.ts.map +0 -1
- package/dist/worker/worker-status.js.map +0 -1
package/dist/static/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { CanopyBuildContext } from '../context';
|
|
2
|
-
import type { ListEntriesItem } from '../content-listing';
|
|
3
|
-
import { type EntryFieldError } from '../validation/entry-validator';
|
|
1
|
+
import type { CanopyBuildContext } from '../context.js';
|
|
2
|
+
import type { ListEntriesItem } from '../content-listing.js';
|
|
3
|
+
import { type EntryFieldError } from '../validation/entry-validator.js';
|
|
4
4
|
/**
|
|
5
5
|
* Framework-agnostic helpers for static-site generation. These produce neutral data structures
|
|
6
6
|
* (no Next.js types) so that any framework adapter — e.g. canopycms-next — can map them to its own
|
|
7
7
|
* static-generation shapes (generateStaticParams, sitemap, metadata).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* .
|
|
9
|
+
* - `collectStaticPaths` — routable paths only, for `generateStaticParams`.
|
|
10
|
+
* - `collectRoutableEntries` — the same enumeration with each entry's `data` and `updatedAt`
|
|
11
|
+
* carried through, for surfaces that must inspect content (sitemap, feeds, search index).
|
|
12
|
+
* - `./seo` — `extractSeoFields` / `isNoindexEntry` / URL shaping, re-exported below.
|
|
12
13
|
*/
|
|
14
|
+
export { DEFAULT_SEO_FIELD_NAMES, extractSeoFields, isNoindexEntry, isAbsoluteUrl, withTrailingSlash, resolveSeoUrl, stripTrailingSlashes, type SeoFields, type SeoFieldNames, type SeoFieldLocation, type SeoOgType, type SeoTwitterCard, type ExtractSeoFieldsOptions, type ResolveSeoUrlOptions, } from './seo.js';
|
|
13
15
|
/** A routable content entry, reduced to what static path generation needs. */
|
|
14
16
|
export interface StaticPathEntry {
|
|
15
17
|
/**
|
|
@@ -27,6 +29,26 @@ export interface StaticPathEntry {
|
|
|
27
29
|
/** Entry type name (e.g. 'post', 'doc'). */
|
|
28
30
|
entryType: string;
|
|
29
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A routable content entry with its content attached — everything `StaticPathEntry` carries,
|
|
34
|
+
* plus the entry `data` and its `updatedAt`.
|
|
35
|
+
*
|
|
36
|
+
* This is what surfaces that must look INSIDE an entry need (sitemap, feeds, index grids),
|
|
37
|
+
* as opposed to `generateStaticParams`, which only needs the path.
|
|
38
|
+
*/
|
|
39
|
+
export interface RoutableEntry<T = Record<string, unknown>> extends StaticPathEntry {
|
|
40
|
+
/** Raw entry data (frontmatter merged with the body field for md/mdx), as `listEntries` returns it. */
|
|
41
|
+
data: T;
|
|
42
|
+
/**
|
|
43
|
+
* Filesystem mtime (ISO 8601) of the entry file.
|
|
44
|
+
*
|
|
45
|
+
* Caveat, and read it before wiring this to a sitemap `<lastmod>`: this is a checkout-time
|
|
46
|
+
* timestamp, not an editorial one. A fresh CI clone (or a fresh branch-clone checkout) resets
|
|
47
|
+
* every file's mtime, so there it says "when this tree was checked out", not "when this content
|
|
48
|
+
* was last edited". Treat it as "changed since the last build" at best.
|
|
49
|
+
*/
|
|
50
|
+
updatedAt?: string;
|
|
51
|
+
}
|
|
30
52
|
export interface CollectStaticPathsOptions {
|
|
31
53
|
/**
|
|
32
54
|
* Scope to a collection logical path (e.g. 'content/posts'). Defaults to the whole content root.
|
|
@@ -36,6 +58,50 @@ export interface CollectStaticPathsOptions {
|
|
|
36
58
|
/** Keep only entries matching this predicate (e.g. drop the root index, or filter by entryType). */
|
|
37
59
|
filter?: (entry: StaticPathEntry) => boolean;
|
|
38
60
|
}
|
|
61
|
+
export interface CollectRoutableEntriesOptions<T = Record<string, unknown>> {
|
|
62
|
+
/**
|
|
63
|
+
* Scope to a collection logical path (e.g. 'content/posts'). Defaults to the whole content root.
|
|
64
|
+
* Skips loading entries outside this scope.
|
|
65
|
+
*/
|
|
66
|
+
rootPath?: string;
|
|
67
|
+
/** Keep only entries matching this predicate. Runs after `data` is attached, so it can read content. */
|
|
68
|
+
filter?: (entry: RoutableEntry<T>) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve `reference` fields in each entry's `data`, the way `read()`/`readByUrlPath()` do.
|
|
71
|
+
* Defaults to `false`; see `ListEntriesOptions.resolveReferences` in content-listing.ts for
|
|
72
|
+
* the full rationale, cost and caveats.
|
|
73
|
+
*
|
|
74
|
+
* Turn this on for a surface that reads INSIDE an entry and must see referenced content —
|
|
75
|
+
* a search index over pages built from shared/referenced blocks is the case this exists
|
|
76
|
+
* for, since those blocks are otherwise indexed as an id string with no text in them.
|
|
77
|
+
* A sitemap needs `urlPath`/`updatedAt`/`noindex` only, so leave it off there.
|
|
78
|
+
*
|
|
79
|
+
* Not offered on `collectStaticPaths`, which discards `data` entirely — resolving
|
|
80
|
+
* references only to throw them away would be pure cost.
|
|
81
|
+
*/
|
|
82
|
+
resolveReferences?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Enumerate routable content entries WITH their data — the input to any surface that must read
|
|
86
|
+
* inside an entry to decide what to publish (sitemap, RSS, search index, index grids).
|
|
87
|
+
*
|
|
88
|
+
* Identical enumeration to `collectStaticPaths` (same single `listEntries` pass, same build-time
|
|
89
|
+
* schema-validity guard); it simply keeps `data` and `updatedAt` instead of discarding them, and
|
|
90
|
+
* can additionally opt into `reference` resolution, which a path-only enumeration has no use for.
|
|
91
|
+
*
|
|
92
|
+
* **Enumerates every entry type by default.** There is no allow-list of "publishable" types, and
|
|
93
|
+
* that is deliberate: a sitemap built from a hand-maintained list of entry types silently omits
|
|
94
|
+
* whichever type nobody remembered to add, and nothing fails. Narrow the result with `filter`
|
|
95
|
+
* when you actually mean to — omission should be a decision, not an oversight.
|
|
96
|
+
*
|
|
97
|
+
* `noindex` is NOT applied here: an entry that must not be advertised must still be built. Apply
|
|
98
|
+
* `isNoindexEntry` at the advertising surface (as `generateContentSitemap` does).
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const entries = await collectRoutableEntries(await getCanopyForBuild())
|
|
102
|
+
* const published = entries.filter((e) => !isNoindexEntry(e.data))
|
|
103
|
+
*/
|
|
104
|
+
export declare function collectRoutableEntries<T = Record<string, unknown>>(ctx: Pick<CanopyBuildContext, 'listEntries'>, options?: CollectRoutableEntriesOptions<T>): Promise<RoutableEntry<T>[]>;
|
|
39
105
|
/**
|
|
40
106
|
* Enumerate routable content entries as neutral path descriptors for static generation.
|
|
41
107
|
*
|
|
@@ -57,6 +123,21 @@ export interface InvalidBuildEntry {
|
|
|
57
123
|
entryPath: string;
|
|
58
124
|
errors: EntryFieldError[];
|
|
59
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* What the build-time validity scan needs off a listing item. `data` is `unknown` rather than
|
|
128
|
+
* `ListEntriesItem['data']` so a caller that listed with an entry-shape generic (e.g.
|
|
129
|
+
* `collectRoutableEntries<PostContent>`) can still be scanned — the scan re-guards the value
|
|
130
|
+
* anyway, since on-disk data is never trusted.
|
|
131
|
+
*/
|
|
132
|
+
type BuildScanItem = Pick<ListEntriesItem, 'entryPath' | 'schema'> & {
|
|
133
|
+
data: unknown;
|
|
134
|
+
/**
|
|
135
|
+
* Only the unknown-key scan reads this, to recognise the md/mdx body key that `listEntries`
|
|
136
|
+
* merges into `data`. Optional so a caller assembling items by hand still typechecks; an
|
|
137
|
+
* absent format is treated as markdown-shaped, which errs toward under-reporting.
|
|
138
|
+
*/
|
|
139
|
+
format?: ListEntriesItem['format'];
|
|
140
|
+
};
|
|
60
141
|
/**
|
|
61
142
|
* Scan listEntries-shaped items for schema-invalid entries.
|
|
62
143
|
*
|
|
@@ -71,7 +152,35 @@ export interface InvalidBuildEntry {
|
|
|
71
152
|
* Items whose `schema` couldn't be resolved (unknown entry type) are skipped here — that's a
|
|
72
153
|
* different failure class, handled elsewhere.
|
|
73
154
|
*/
|
|
74
|
-
export declare function findInvalidEntries(items: readonly
|
|
155
|
+
export declare function findInvalidEntries(items: readonly BuildScanItem[]): InvalidBuildEntry[];
|
|
156
|
+
/** An entry carrying data keys the schema no longer defines. */
|
|
157
|
+
export interface EntryWithUnknownKeys {
|
|
158
|
+
entryPath: string;
|
|
159
|
+
/** Canonical field paths, e.g. `author.nickname` or `blocks[2].headline`. */
|
|
160
|
+
fieldPaths: string[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Scan listEntries-shaped items for data keys with no schema counterpart.
|
|
164
|
+
*
|
|
165
|
+
* The inverse of `findInvalidEntries`, and non-fatal by design: an unknown key is stale data,
|
|
166
|
+
* not broken data. A build must not go red for it — the page still renders, it is just quietly
|
|
167
|
+
* missing whatever the renamed field used to supply. `warnUnknownEntryKeys` is the reporting
|
|
168
|
+
* half. Both sit at module scope alongside `findInvalidEntries`/`assertBuildEntriesValid` and
|
|
169
|
+
* are deliberately NOT on `canopycms/server`, matching those two — the build wires them itself.
|
|
170
|
+
*
|
|
171
|
+
* Skips items with no resolved schema, and items whose schema is empty — "no schema" is not
|
|
172
|
+
* "every key is unknown". Same `normalizeDatesDeep` pass as the validity scan, so a hand-authored
|
|
173
|
+
* `date: 2024-01-15` is a plain value here too.
|
|
174
|
+
*/
|
|
175
|
+
export declare function findEntriesWithUnknownKeys(items: readonly BuildScanItem[]): EntryWithUnknownKeys[];
|
|
176
|
+
/**
|
|
177
|
+
* Warn — never throw — about entries carrying keys the schema no longer defines.
|
|
178
|
+
*
|
|
179
|
+
* A production build is the one place that sees every entry at once, which makes it the only
|
|
180
|
+
* place a schema reshape's leftovers show up as a list rather than one mysteriously undefined
|
|
181
|
+
* value at a time.
|
|
182
|
+
*/
|
|
183
|
+
export declare function warnUnknownEntryKeys(items: readonly BuildScanItem[], phaseLabel: string): void;
|
|
75
184
|
/**
|
|
76
185
|
* Throw a single, descriptive Error if any item is schema-invalid.
|
|
77
186
|
*
|
|
@@ -79,5 +188,114 @@ export declare function findInvalidEntries(items: readonly Pick<ListEntriesItem,
|
|
|
79
188
|
* disappears from a static build is a worse failure mode than a red build. Lists every
|
|
80
189
|
* offending entry so one build catches every abandoned scaffold, not just the first.
|
|
81
190
|
*/
|
|
82
|
-
export declare function assertBuildEntriesValid(items: readonly
|
|
83
|
-
|
|
191
|
+
export declare function assertBuildEntriesValid(items: readonly BuildScanItem[], phaseLabel: string): void;
|
|
192
|
+
/**
|
|
193
|
+
* One URL claimed by more than one entry.
|
|
194
|
+
*/
|
|
195
|
+
export interface DuplicateUrlPath {
|
|
196
|
+
/** The contested URL path, exactly as `listEntries` computed it. */
|
|
197
|
+
urlPath: string;
|
|
198
|
+
/** Logical paths of every entry claiming it, sorted. Always length >= 2. */
|
|
199
|
+
entryPaths: string[];
|
|
200
|
+
}
|
|
201
|
+
/** What the duplicate-URL scan needs off a listing item. */
|
|
202
|
+
type UrlScanItem = Pick<ListEntriesItem, 'entryPath' | 'urlPath'>;
|
|
203
|
+
/**
|
|
204
|
+
* Find every `urlPath` claimed by two or more entries.
|
|
205
|
+
*
|
|
206
|
+
* `listEntries` assigns each entry exactly one `urlPath` and documents it as round-trip safe with
|
|
207
|
+
* `readByUrlPath`. That guarantee is per-entry, not per-URL: nothing stops two DIFFERENT entries
|
|
208
|
+
* computing the same one, and when they do exactly one of them is reachable while the other
|
|
209
|
+
* silently has no route at all. The known ways to get there:
|
|
210
|
+
*
|
|
211
|
+
* - An entry whose slug matches a sibling collection that also has an `index` entry — the index
|
|
212
|
+
* collapses onto the collection's path, which is the entry's path too. The write boundary now
|
|
213
|
+
* refuses to author this too (url-collision.ts), so reaching it means the content arrived some
|
|
214
|
+
* other way — the same merge/PR/retrofit routes as the same-slug case below. (An entry beside a
|
|
215
|
+
* sibling collection with NO index entry is a different, legitimate shape: a landing page plus
|
|
216
|
+
* a folder of children, nothing contested.)
|
|
217
|
+
* - Two entries whose slugs differ only by case, since `urlPath` is lowercased.
|
|
218
|
+
* - Two entries with the same slug in one collection. The write boundary already refuses this
|
|
219
|
+
* (`ContentStore.buildPaths` resolves by slug across entry types, and the create-intent guard
|
|
220
|
+
* turns a hit into a conflict), but content also arrives by merge, by PR, and by adopters
|
|
221
|
+
* retrofitting an existing repo — none of which pass through that boundary.
|
|
222
|
+
*
|
|
223
|
+
* Exported so adopters can assert on it directly instead of hand-rolling a content-integrity
|
|
224
|
+
* test; `assertNoDuplicateUrlPaths` is what the build itself uses.
|
|
225
|
+
*
|
|
226
|
+
* Pure. Results are sorted by `urlPath`, with each `entryPaths` sorted too, so messages are
|
|
227
|
+
* stable across runs (`listEntries` resolves collections in parallel, so its own order is not).
|
|
228
|
+
*/
|
|
229
|
+
export declare function findDuplicateUrlPaths(items: readonly UrlScanItem[]): DuplicateUrlPath[];
|
|
230
|
+
/**
|
|
231
|
+
* Throw a single, descriptive Error if any URL is claimed by more than one entry.
|
|
232
|
+
*
|
|
233
|
+
* Fails the build for the same reason its sibling `assertBuildEntriesValid` does: a page that
|
|
234
|
+
* silently disappears from a static build is a worse failure mode than a red build, and that is
|
|
235
|
+
* precisely what a contested URL produces — `generateStaticParams` emits the path once, one entry
|
|
236
|
+
* renders, and the other never appears anywhere with no error to notice.
|
|
237
|
+
*
|
|
238
|
+
* Runs on the RAW listing, before the caller's `filter`, and that will produce the first "why is
|
|
239
|
+
* my build red, that entry isn't even routed?" question — so: a contested `urlPath` is a real
|
|
240
|
+
* collision at RESOLUTION time regardless of routing. `readByUrlPath` picks one of the two
|
|
241
|
+
* whatever any `generateStaticParams` filter says, so the un-routed entry is not innocent; it is
|
|
242
|
+
* shadowing (or being shadowed by) the routed one at the same URL. `rootPath` narrows the scan
|
|
243
|
+
* because it narrows what was loaded at all; `filter` deliberately does not.
|
|
244
|
+
*
|
|
245
|
+
* Related but not redundant: `canopycms-next`'s `dedupeSitemapItems` warns on the same collision
|
|
246
|
+
* at the sitemap. It stays, because it also covers entry-vs-`extraUrls` collisions (adopter-supplied
|
|
247
|
+
* paths this content enumeration never sees) and non-build-mode calls, where this guard is silent.
|
|
248
|
+
*/
|
|
249
|
+
export declare function assertNoDuplicateUrlPaths(items: readonly UrlScanItem[], phaseLabel: string): void;
|
|
250
|
+
/** An entry whose slug cannot round-trip through `readByUrlPath`. */
|
|
251
|
+
export interface UnroutableSlugEntry {
|
|
252
|
+
entryPath: string;
|
|
253
|
+
urlPath: string;
|
|
254
|
+
slug: string;
|
|
255
|
+
/** Why `parseSlug` rejected it, e.g. "Slug must start with a letter or number...". */
|
|
256
|
+
error: string;
|
|
257
|
+
}
|
|
258
|
+
/** What the slug-routability scan needs off a listing item. */
|
|
259
|
+
type SlugScanItem = Pick<ListEntriesItem, 'entryPath' | 'urlPath' | 'slug'>;
|
|
260
|
+
/**
|
|
261
|
+
* Find every listed entry whose `slug` cannot pass `parseSlug` — the validation `readByUrlPath`
|
|
262
|
+
* runs on every URL-resolution candidate it tries (`context.ts`).
|
|
263
|
+
*
|
|
264
|
+
* The filename grammar `parseTypedFilename` parses (`{type}.{slug}.{id}.{ext}`) deliberately
|
|
265
|
+
* allows a slug to contain dots, anchoring the split on the type and ID instead (see that
|
|
266
|
+
* function's doc comment) — and it does not run the parsed slug through `parseSlug` before
|
|
267
|
+
* handing it back, by design: recovering `{type, slug, id}` structurally, without validating
|
|
268
|
+
* every part, is its whole contract. `listCollectionEntries` inherits that: it lists the file and
|
|
269
|
+
* computes a `urlPath` for it, same as any other entry.
|
|
270
|
+
*
|
|
271
|
+
* But `parseSlug` requires `^[a-z0-9][a-z0-9-]*$` — no dots — so a listed entry whose slug
|
|
272
|
+
* contains one is unreachable through the one path everything else assumes works:
|
|
273
|
+
* `readByUrlPath` tries the URL's last segment as a candidate slug and skips any candidate that
|
|
274
|
+
* fails `parseSlug` (treating it as a miss, not an error) before it ever calls `read()`. The
|
|
275
|
+
* entry still builds, still gets a `generateStaticParams` entry, still gets a sitemap `<loc>` —
|
|
276
|
+
* and 404s the moment anything actually visits it. That breaks the `Round-trip safe` contract
|
|
277
|
+
* `content-listing.ts` documents on `urlPath` (`readByUrlPath(item.urlPath)` resolves to the same
|
|
278
|
+
* entry) and is exactly the silent-page-loss failure mode this guard's siblings
|
|
279
|
+
* (`assertBuildEntriesValid`, `assertNoDuplicateUrlPaths`) exist to make loud instead.
|
|
280
|
+
*
|
|
281
|
+
* The write boundary refuses to MINT such a slug: `api/content.ts` and `ContentStore.write()`
|
|
282
|
+
* both run `parseSlug` on a create, and `renameEntry()` runs it on the new slug (the [SLUG]
|
|
283
|
+
* guards). That enforcement is deliberately create-only — an entry that already carries a
|
|
284
|
+
* non-conforming slug stays saveable and renameable, because renaming it is the only way to fix
|
|
285
|
+
* this build failure, and refusing reads or edits would turn a red build into unreachable data.
|
|
286
|
+
*
|
|
287
|
+
* So this guard still fires, and is still needed, for every slug the write boundary never saw:
|
|
288
|
+
* hand-authored files, scripted migrations, content merged in over git, a repo being retrofitted
|
|
289
|
+
* onto CanopyCMS (this guard's intended audience, same as its siblings), and entries created
|
|
290
|
+
* before the write-time rule existed.
|
|
291
|
+
*/
|
|
292
|
+
export declare function findUnroutableSlugs(items: readonly SlugScanItem[]): UnroutableSlugEntry[];
|
|
293
|
+
/**
|
|
294
|
+
* Throw a single, descriptive Error if any listed entry's slug cannot round-trip through
|
|
295
|
+
* `readByUrlPath`.
|
|
296
|
+
*
|
|
297
|
+
* Fails the build for the same reason its siblings do: an entry that builds and gets advertised
|
|
298
|
+
* (sitemap, `generateStaticParams`) but 404s on every actual visit is a worse failure mode than a
|
|
299
|
+
* red build.
|
|
300
|
+
*/
|
|
301
|
+
export declare function assertRoutableSlugs(items: readonly SlugScanItem[], phaseLabel: string): void;
|
package/dist/static/index.js
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
import { isBuildMode } from '../build-mode.js';
|
|
2
|
-
import { validateEntryData } from '../validation/entry-validator.js';
|
|
2
|
+
import { findUnknownKeys, validateEntryData, } from '../validation/entry-validator.js';
|
|
3
|
+
import { findBodyFieldName } from '../utils/body-field.js';
|
|
4
|
+
import { isDataOnlyFormat } from '../utils/format.js';
|
|
5
|
+
import { parseSlug } from '../paths/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Framework-agnostic helpers for static-site generation. These produce neutral data structures
|
|
8
|
+
* (no Next.js types) so that any framework adapter — e.g. canopycms-next — can map them to its own
|
|
9
|
+
* static-generation shapes (generateStaticParams, sitemap, metadata).
|
|
10
|
+
*
|
|
11
|
+
* - `collectStaticPaths` — routable paths only, for `generateStaticParams`.
|
|
12
|
+
* - `collectRoutableEntries` — the same enumeration with each entry's `data` and `updatedAt`
|
|
13
|
+
* carried through, for surfaces that must inspect content (sitemap, feeds, search index).
|
|
14
|
+
* - `./seo` — `extractSeoFields` / `isNoindexEntry` / URL shaping, re-exported below.
|
|
15
|
+
*/
|
|
16
|
+
export { DEFAULT_SEO_FIELD_NAMES, extractSeoFields, isNoindexEntry, isAbsoluteUrl, withTrailingSlash, resolveSeoUrl, stripTrailingSlashes, } from './seo.js';
|
|
17
|
+
/**
|
|
18
|
+
* Shared enumeration behind `collectStaticPaths` and `collectRoutableEntries`.
|
|
19
|
+
*
|
|
20
|
+
* `phaseLabel` only names the phase in the build-guard error, but it is threaded through rather
|
|
21
|
+
* than fixed so the message points at the surface that actually failed.
|
|
22
|
+
*/
|
|
23
|
+
async function enumerateRoutableEntries(ctx, rootPath, phaseLabel, resolveReferences) {
|
|
24
|
+
const entries = await ctx.listEntries({ rootPath, resolveReferences });
|
|
25
|
+
// Build-time only: `next dev` runs generateStaticParams against the live working tree, where
|
|
26
|
+
// fresh create-scaffolds legitimately exist mid-edit. Only fail the actual production build —
|
|
27
|
+
// an abandoned schema-invalid scaffold shipping into a static build silently drops that page's
|
|
28
|
+
// route (or worse, renders broken), which is worse than a red build.
|
|
29
|
+
//
|
|
30
|
+
// The unknown-key warning runs BEFORE all three throwing guards, so a build about to go red
|
|
31
|
+
// still prints everything it found rather than dying on the first problem.
|
|
32
|
+
//
|
|
33
|
+
// All four run on the RAW listing, before the caller's `filter` — a filtered-out entry still
|
|
34
|
+
// occupies its URL as far as every other route is concerned. `rootPath` scoping does narrow
|
|
35
|
+
// them, since that happens inside `listEntries`; that is the intended escape hatch, `filter`
|
|
36
|
+
// is not.
|
|
37
|
+
//
|
|
38
|
+
// Slug routability is asserted first, ahead of schema validity and duplicate URLs: an entry
|
|
39
|
+
// whose slug cannot round-trip through `readByUrlPath` has no URL at all as far as any OTHER
|
|
40
|
+
// guard is concerned, so it is the most fundamental of the three problems a listed entry can
|
|
41
|
+
// have. Schema validity is asserted before duplicate URLs for the same reason one level down:
|
|
42
|
+
// a schema-invalid entry is the more fundamental problem, and an adopter fixing it may remove
|
|
43
|
+
// the duplicate on the way.
|
|
44
|
+
if (isBuildMode()) {
|
|
45
|
+
warnUnknownEntryKeys(entries, phaseLabel);
|
|
46
|
+
assertRoutableSlugs(entries, phaseLabel);
|
|
47
|
+
assertBuildEntriesValid(entries, phaseLabel);
|
|
48
|
+
assertNoDuplicateUrlPaths(entries, phaseLabel);
|
|
49
|
+
}
|
|
50
|
+
return entries.map((entry) => ({
|
|
51
|
+
urlPath: entry.urlPath,
|
|
52
|
+
segments: entry.urlPath === '/' ? [] : entry.urlPath.replace(/^\//, '').split('/'),
|
|
53
|
+
slug: entry.slug,
|
|
54
|
+
entryType: entry.entryType,
|
|
55
|
+
data: entry.data,
|
|
56
|
+
...(entry.updatedAt ? { updatedAt: entry.updatedAt } : {}),
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Enumerate routable content entries WITH their data — the input to any surface that must read
|
|
61
|
+
* inside an entry to decide what to publish (sitemap, RSS, search index, index grids).
|
|
62
|
+
*
|
|
63
|
+
* Identical enumeration to `collectStaticPaths` (same single `listEntries` pass, same build-time
|
|
64
|
+
* schema-validity guard); it simply keeps `data` and `updatedAt` instead of discarding them, and
|
|
65
|
+
* can additionally opt into `reference` resolution, which a path-only enumeration has no use for.
|
|
66
|
+
*
|
|
67
|
+
* **Enumerates every entry type by default.** There is no allow-list of "publishable" types, and
|
|
68
|
+
* that is deliberate: a sitemap built from a hand-maintained list of entry types silently omits
|
|
69
|
+
* whichever type nobody remembered to add, and nothing fails. Narrow the result with `filter`
|
|
70
|
+
* when you actually mean to — omission should be a decision, not an oversight.
|
|
71
|
+
*
|
|
72
|
+
* `noindex` is NOT applied here: an entry that must not be advertised must still be built. Apply
|
|
73
|
+
* `isNoindexEntry` at the advertising surface (as `generateContentSitemap` does).
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const entries = await collectRoutableEntries(await getCanopyForBuild())
|
|
77
|
+
* const published = entries.filter((e) => !isNoindexEntry(e.data))
|
|
78
|
+
*/
|
|
79
|
+
export async function collectRoutableEntries(ctx, options = {}) {
|
|
80
|
+
const entries = await enumerateRoutableEntries(ctx, options.rootPath, 'routable entry enumeration', options.resolveReferences);
|
|
81
|
+
return options.filter ? entries.filter(options.filter) : entries;
|
|
82
|
+
}
|
|
3
83
|
/**
|
|
4
84
|
* Enumerate routable content entries as neutral path descriptors for static generation.
|
|
5
85
|
*
|
|
@@ -14,18 +94,14 @@ import { validateEntryData } from '../validation/entry-validator.js';
|
|
|
14
94
|
* const posts = await collectStaticPaths(await getCanopyForBuild(), { rootPath: 'content/posts' })
|
|
15
95
|
*/
|
|
16
96
|
export async function collectStaticPaths(ctx, options = {}) {
|
|
17
|
-
const entries = await ctx
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
urlPath: entry.urlPath,
|
|
26
|
-
segments: entry.urlPath === '/' ? [] : entry.urlPath.replace(/^\//, '').split('/'),
|
|
27
|
-
slug: entry.slug,
|
|
28
|
-
entryType: entry.entryType,
|
|
97
|
+
const entries = await enumerateRoutableEntries(ctx, options.rootPath, 'static path enumeration');
|
|
98
|
+
// Drop data/updatedAt: generateStaticParams needs paths only, and returning entry content from
|
|
99
|
+
// a path-enumeration helper invites page code to read content from the admin build context.
|
|
100
|
+
const mapped = entries.map(({ urlPath, segments, slug, entryType }) => ({
|
|
101
|
+
urlPath,
|
|
102
|
+
segments,
|
|
103
|
+
slug,
|
|
104
|
+
entryType,
|
|
29
105
|
}));
|
|
30
106
|
return options.filter ? mapped.filter(options.filter) : mapped;
|
|
31
107
|
}
|
|
@@ -89,6 +165,70 @@ export function findInvalidEntries(items) {
|
|
|
89
165
|
}
|
|
90
166
|
return invalid;
|
|
91
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* How many offending entries `warnUnknownEntryKeys` lists before summarising the rest. Bounds CI
|
|
170
|
+
* output for a schema-wide rename across a large content tree; the reported COUNT is never capped.
|
|
171
|
+
*/
|
|
172
|
+
const UNKNOWN_KEY_REPORT_LIMIT = 20;
|
|
173
|
+
/**
|
|
174
|
+
* Scan listEntries-shaped items for data keys with no schema counterpart.
|
|
175
|
+
*
|
|
176
|
+
* The inverse of `findInvalidEntries`, and non-fatal by design: an unknown key is stale data,
|
|
177
|
+
* not broken data. A build must not go red for it — the page still renders, it is just quietly
|
|
178
|
+
* missing whatever the renamed field used to supply. `warnUnknownEntryKeys` is the reporting
|
|
179
|
+
* half. Both sit at module scope alongside `findInvalidEntries`/`assertBuildEntriesValid` and
|
|
180
|
+
* are deliberately NOT on `canopycms/server`, matching those two — the build wires them itself.
|
|
181
|
+
*
|
|
182
|
+
* Skips items with no resolved schema, and items whose schema is empty — "no schema" is not
|
|
183
|
+
* "every key is unknown". Same `normalizeDatesDeep` pass as the validity scan, so a hand-authored
|
|
184
|
+
* `date: 2024-01-15` is a plain value here too.
|
|
185
|
+
*/
|
|
186
|
+
export function findEntriesWithUnknownKeys(items) {
|
|
187
|
+
const found = [];
|
|
188
|
+
for (const item of items) {
|
|
189
|
+
if (!item.schema || item.schema.length === 0)
|
|
190
|
+
continue;
|
|
191
|
+
const data = normalizeDatesDeep(item.data);
|
|
192
|
+
// For md/mdx, `listEntries` merges the file's body into `data` under
|
|
193
|
+
// `findBodyFieldName(schema)` (readEntryData in content-listing.ts). When the schema declares
|
|
194
|
+
// an `isBody` field that name IS a schema field and this is a no-op -- but declaring one is
|
|
195
|
+
// optional, and with none the merge key falls back to the literal 'body', which the schema
|
|
196
|
+
// legitimately does not define. Without this the scan told every adopter whose md entry types
|
|
197
|
+
// omit `isBody` that their prose was a stale key to delete.
|
|
198
|
+
const bodyKey = isDataOnlyFormat(item.format ?? 'md')
|
|
199
|
+
? undefined
|
|
200
|
+
: findBodyFieldName(item.schema);
|
|
201
|
+
const fieldPaths = findUnknownKeys(item.schema, data).filter((path) => path !== bodyKey);
|
|
202
|
+
if (fieldPaths.length > 0) {
|
|
203
|
+
found.push({ entryPath: item.entryPath, fieldPaths });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return found;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Warn — never throw — about entries carrying keys the schema no longer defines.
|
|
210
|
+
*
|
|
211
|
+
* A production build is the one place that sees every entry at once, which makes it the only
|
|
212
|
+
* place a schema reshape's leftovers show up as a list rather than one mysteriously undefined
|
|
213
|
+
* value at a time.
|
|
214
|
+
*/
|
|
215
|
+
export function warnUnknownEntryKeys(items, phaseLabel) {
|
|
216
|
+
const found = findEntriesWithUnknownKeys(items);
|
|
217
|
+
if (found.length === 0)
|
|
218
|
+
return;
|
|
219
|
+
// Capped, unlike the sibling assert. That one throws, so it prints once and the build stops;
|
|
220
|
+
// this one returns, and a Next build runs the enumeration several times (every catch-all route
|
|
221
|
+
// plus the sitemap). A schema-wide rename across a large tree would otherwise bury CI output
|
|
222
|
+
// under the same thousands of lines two or three times over. The count is always exact.
|
|
223
|
+
const shown = found.slice(0, UNKNOWN_KEY_REPORT_LIMIT);
|
|
224
|
+
const lines = shown.map(({ entryPath, fieldPaths }) => ` - ${entryPath} — ${fieldPaths.join(', ')}`);
|
|
225
|
+
if (found.length > shown.length) {
|
|
226
|
+
lines.push(` …and ${found.length - shown.length} more`);
|
|
227
|
+
}
|
|
228
|
+
console.warn(`CanopyCMS static build: ${found.length} ${found.length === 1 ? 'entry has' : 'entries have'} content keys not defined in their schema during ${phaseLabel}:\n${lines.join('\n')}\n` +
|
|
229
|
+
`These are usually left over from a renamed or reshaped field. Nothing reads them, and they are kept in the file on every save. ` +
|
|
230
|
+
`Add them to the schema or remove them from the content.`);
|
|
231
|
+
}
|
|
92
232
|
/**
|
|
93
233
|
* Throw a single, descriptive Error if any item is schema-invalid.
|
|
94
234
|
*
|
|
@@ -111,4 +251,152 @@ export function assertBuildEntriesValid(items, phaseLabel) {
|
|
|
111
251
|
`These are likely abandoned create-scaffolds (empty entries left behind when a create was started but never finished). ` +
|
|
112
252
|
`Finish editing the entry (fill in its required fields) or delete the abandoned draft, then rebuild.`);
|
|
113
253
|
}
|
|
114
|
-
|
|
254
|
+
/**
|
|
255
|
+
* Find every `urlPath` claimed by two or more entries.
|
|
256
|
+
*
|
|
257
|
+
* `listEntries` assigns each entry exactly one `urlPath` and documents it as round-trip safe with
|
|
258
|
+
* `readByUrlPath`. That guarantee is per-entry, not per-URL: nothing stops two DIFFERENT entries
|
|
259
|
+
* computing the same one, and when they do exactly one of them is reachable while the other
|
|
260
|
+
* silently has no route at all. The known ways to get there:
|
|
261
|
+
*
|
|
262
|
+
* - An entry whose slug matches a sibling collection that also has an `index` entry — the index
|
|
263
|
+
* collapses onto the collection's path, which is the entry's path too. The write boundary now
|
|
264
|
+
* refuses to author this too (url-collision.ts), so reaching it means the content arrived some
|
|
265
|
+
* other way — the same merge/PR/retrofit routes as the same-slug case below. (An entry beside a
|
|
266
|
+
* sibling collection with NO index entry is a different, legitimate shape: a landing page plus
|
|
267
|
+
* a folder of children, nothing contested.)
|
|
268
|
+
* - Two entries whose slugs differ only by case, since `urlPath` is lowercased.
|
|
269
|
+
* - Two entries with the same slug in one collection. The write boundary already refuses this
|
|
270
|
+
* (`ContentStore.buildPaths` resolves by slug across entry types, and the create-intent guard
|
|
271
|
+
* turns a hit into a conflict), but content also arrives by merge, by PR, and by adopters
|
|
272
|
+
* retrofitting an existing repo — none of which pass through that boundary.
|
|
273
|
+
*
|
|
274
|
+
* Exported so adopters can assert on it directly instead of hand-rolling a content-integrity
|
|
275
|
+
* test; `assertNoDuplicateUrlPaths` is what the build itself uses.
|
|
276
|
+
*
|
|
277
|
+
* Pure. Results are sorted by `urlPath`, with each `entryPaths` sorted too, so messages are
|
|
278
|
+
* stable across runs (`listEntries` resolves collections in parallel, so its own order is not).
|
|
279
|
+
*/
|
|
280
|
+
export function findDuplicateUrlPaths(items) {
|
|
281
|
+
const byUrl = new Map();
|
|
282
|
+
for (const item of items) {
|
|
283
|
+
const existing = byUrl.get(item.urlPath);
|
|
284
|
+
if (existing)
|
|
285
|
+
existing.push(item.entryPath);
|
|
286
|
+
else
|
|
287
|
+
byUrl.set(item.urlPath, [item.entryPath]);
|
|
288
|
+
}
|
|
289
|
+
const duplicates = [];
|
|
290
|
+
for (const [urlPath, entryPaths] of byUrl) {
|
|
291
|
+
if (entryPaths.length > 1) {
|
|
292
|
+
duplicates.push({ urlPath, entryPaths: [...entryPaths].sort() });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return duplicates.sort((a, b) => a.urlPath.localeCompare(b.urlPath));
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Throw a single, descriptive Error if any URL is claimed by more than one entry.
|
|
299
|
+
*
|
|
300
|
+
* Fails the build for the same reason its sibling `assertBuildEntriesValid` does: a page that
|
|
301
|
+
* silently disappears from a static build is a worse failure mode than a red build, and that is
|
|
302
|
+
* precisely what a contested URL produces — `generateStaticParams` emits the path once, one entry
|
|
303
|
+
* renders, and the other never appears anywhere with no error to notice.
|
|
304
|
+
*
|
|
305
|
+
* Runs on the RAW listing, before the caller's `filter`, and that will produce the first "why is
|
|
306
|
+
* my build red, that entry isn't even routed?" question — so: a contested `urlPath` is a real
|
|
307
|
+
* collision at RESOLUTION time regardless of routing. `readByUrlPath` picks one of the two
|
|
308
|
+
* whatever any `generateStaticParams` filter says, so the un-routed entry is not innocent; it is
|
|
309
|
+
* shadowing (or being shadowed by) the routed one at the same URL. `rootPath` narrows the scan
|
|
310
|
+
* because it narrows what was loaded at all; `filter` deliberately does not.
|
|
311
|
+
*
|
|
312
|
+
* Related but not redundant: `canopycms-next`'s `dedupeSitemapItems` warns on the same collision
|
|
313
|
+
* at the sitemap. It stays, because it also covers entry-vs-`extraUrls` collisions (adopter-supplied
|
|
314
|
+
* paths this content enumeration never sees) and non-build-mode calls, where this guard is silent.
|
|
315
|
+
*/
|
|
316
|
+
export function assertNoDuplicateUrlPaths(items, phaseLabel) {
|
|
317
|
+
const duplicates = findDuplicateUrlPaths(items);
|
|
318
|
+
if (duplicates.length === 0)
|
|
319
|
+
return;
|
|
320
|
+
const lines = duplicates.map(({ urlPath, entryPaths }) => {
|
|
321
|
+
// Identical entryPaths means ONE entry was enumerated more than once, not two entries
|
|
322
|
+
// colliding — the remedy below ("rename or remove one of them") is unfollowable, since
|
|
323
|
+
// there is only one file. The known cause is two sibling collections sharing a name: both
|
|
324
|
+
// resolve to the same directory, so its entries are listed once per sibling.
|
|
325
|
+
const selfCollision = entryPaths.every((entryPath) => entryPath === entryPaths[0]);
|
|
326
|
+
return selfCollision
|
|
327
|
+
? ` - ${urlPath} — ${entryPaths.length}x ${entryPaths[0]} (the same entry, enumerated more than once — usually two sibling collections sharing one name)`
|
|
328
|
+
: ` - ${urlPath} — claimed by ${entryPaths.join(', ')}`;
|
|
329
|
+
});
|
|
330
|
+
throw new Error(`CanopyCMS static build: found ${duplicates.length} ${duplicates.length === 1 ? 'URL' : 'URLs'} claimed by more than one entry during ${phaseLabel}:\n${lines.join('\n')}\n` +
|
|
331
|
+
'Only one entry can be served at each URL, so the rest have no route at all. This usually means ' +
|
|
332
|
+
"an entry whose slug matches a sibling collection that also has an 'index' entry (the index " +
|
|
333
|
+
"collapses onto the collection's path), or two slugs differing only by case (URL paths are " +
|
|
334
|
+
'lowercased). Rename or remove one of the colliding entries, then rebuild.');
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Find every listed entry whose `slug` cannot pass `parseSlug` — the validation `readByUrlPath`
|
|
338
|
+
* runs on every URL-resolution candidate it tries (`context.ts`).
|
|
339
|
+
*
|
|
340
|
+
* The filename grammar `parseTypedFilename` parses (`{type}.{slug}.{id}.{ext}`) deliberately
|
|
341
|
+
* allows a slug to contain dots, anchoring the split on the type and ID instead (see that
|
|
342
|
+
* function's doc comment) — and it does not run the parsed slug through `parseSlug` before
|
|
343
|
+
* handing it back, by design: recovering `{type, slug, id}` structurally, without validating
|
|
344
|
+
* every part, is its whole contract. `listCollectionEntries` inherits that: it lists the file and
|
|
345
|
+
* computes a `urlPath` for it, same as any other entry.
|
|
346
|
+
*
|
|
347
|
+
* But `parseSlug` requires `^[a-z0-9][a-z0-9-]*$` — no dots — so a listed entry whose slug
|
|
348
|
+
* contains one is unreachable through the one path everything else assumes works:
|
|
349
|
+
* `readByUrlPath` tries the URL's last segment as a candidate slug and skips any candidate that
|
|
350
|
+
* fails `parseSlug` (treating it as a miss, not an error) before it ever calls `read()`. The
|
|
351
|
+
* entry still builds, still gets a `generateStaticParams` entry, still gets a sitemap `<loc>` —
|
|
352
|
+
* and 404s the moment anything actually visits it. That breaks the `Round-trip safe` contract
|
|
353
|
+
* `content-listing.ts` documents on `urlPath` (`readByUrlPath(item.urlPath)` resolves to the same
|
|
354
|
+
* entry) and is exactly the silent-page-loss failure mode this guard's siblings
|
|
355
|
+
* (`assertBuildEntriesValid`, `assertNoDuplicateUrlPaths`) exist to make loud instead.
|
|
356
|
+
*
|
|
357
|
+
* The write boundary refuses to MINT such a slug: `api/content.ts` and `ContentStore.write()`
|
|
358
|
+
* both run `parseSlug` on a create, and `renameEntry()` runs it on the new slug (the [SLUG]
|
|
359
|
+
* guards). That enforcement is deliberately create-only — an entry that already carries a
|
|
360
|
+
* non-conforming slug stays saveable and renameable, because renaming it is the only way to fix
|
|
361
|
+
* this build failure, and refusing reads or edits would turn a red build into unreachable data.
|
|
362
|
+
*
|
|
363
|
+
* So this guard still fires, and is still needed, for every slug the write boundary never saw:
|
|
364
|
+
* hand-authored files, scripted migrations, content merged in over git, a repo being retrofitted
|
|
365
|
+
* onto CanopyCMS (this guard's intended audience, same as its siblings), and entries created
|
|
366
|
+
* before the write-time rule existed.
|
|
367
|
+
*/
|
|
368
|
+
export function findUnroutableSlugs(items) {
|
|
369
|
+
const found = [];
|
|
370
|
+
for (const item of items) {
|
|
371
|
+
const result = parseSlug(item.slug);
|
|
372
|
+
if (!result.ok) {
|
|
373
|
+
found.push({
|
|
374
|
+
entryPath: item.entryPath,
|
|
375
|
+
urlPath: item.urlPath,
|
|
376
|
+
slug: item.slug,
|
|
377
|
+
error: result.error,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return found;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Throw a single, descriptive Error if any listed entry's slug cannot round-trip through
|
|
385
|
+
* `readByUrlPath`.
|
|
386
|
+
*
|
|
387
|
+
* Fails the build for the same reason its siblings do: an entry that builds and gets advertised
|
|
388
|
+
* (sitemap, `generateStaticParams`) but 404s on every actual visit is a worse failure mode than a
|
|
389
|
+
* red build.
|
|
390
|
+
*/
|
|
391
|
+
export function assertRoutableSlugs(items, phaseLabel) {
|
|
392
|
+
const unroutable = findUnroutableSlugs(items);
|
|
393
|
+
if (unroutable.length === 0)
|
|
394
|
+
return;
|
|
395
|
+
const lines = unroutable.map(({ entryPath, urlPath, slug }) => ` - ${entryPath} (slug "${slug}", urlPath "${urlPath}")`);
|
|
396
|
+
throw new Error(`CanopyCMS static build: found ${unroutable.length} ${unroutable.length === 1 ? 'entry' : 'entries'} whose slug cannot resolve back through a URL during ${phaseLabel}:\n${lines.join('\n')}\n` +
|
|
397
|
+
'The filename grammar allows a slug to contain characters readByUrlPath cannot accept back ' +
|
|
398
|
+
"(most commonly a dot, e.g. a slug of 'getting.started.guide') — a valid slug for parseSlug is " +
|
|
399
|
+
'lowercase letters, numbers and hyphens only, starting with a letter or number. Each entry ' +
|
|
400
|
+
'above would build, appear in generateStaticParams and any sitemap, and then 404 on every ' +
|
|
401
|
+
'visit. Rename the slug (the file itself, not just its content), then rebuild.');
|
|
402
|
+
}
|