canopycms 0.0.63 → 0.0.65
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 +7 -8
- package/dist/ai/index.js +0 -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 +4 -1
- package/dist/ai/to-plain-text.js +47 -1
- package/dist/ai/transform-components.d.ts +1 -2
- package/dist/ai/transform-components.js +0 -1
- 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 +9 -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 +14 -3
- 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 +4 -5
- package/dist/authorization/branch.js +0 -1
- 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 +6 -7
- 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 +22 -3
- package/dist/branch-health.js +6 -2
- 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 +5 -6
- package/dist/build-canopy.js +0 -1
- package/dist/build-mode.d.ts +1 -2
- package/dist/build-mode.js +0 -1
- package/dist/cli/cli.d.ts +18 -2
- package/dist/cli/cli.js +1172 -490
- package/dist/cli/generate-ai-content.d.ts +0 -1
- package/dist/cli/generate-ai-content.js +1000 -360
- package/dist/cli/init.d.ts +1 -2
- package/dist/cli/init.js +43 -6
- 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/Dockerfile.cms.template +8 -2
- package/dist/cli/template-files/cms-stack.ts.template +33 -6
- package/dist/cli/template-files/deploy-cms.yml.template +29 -14
- 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 +75 -59
- package/dist/content-listing.js +76 -83
- package/dist/content-reader.d.ts +4 -5
- package/dist/content-reader.js +22 -3
- package/dist/content-store.d.ts +137 -6
- package/dist/content-store.js +294 -22
- package/dist/content-tree.d.ts +15 -5
- package/dist/content-tree.js +27 -8
- package/dist/context.d.ts +9 -6
- package/dist/context.js +0 -1
- package/dist/dev-content-watcher.d.ts +12 -3
- package/dist/dev-content-watcher.js +120 -30
- 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 +114 -3
- package/dist/entry-schema.js +46 -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 -18
- package/dist/index.js +0 -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 +54 -45
- package/dist/server.js +11 -3
- package/dist/services.d.ts +10 -11
- package/dist/services.js +0 -1
- package/dist/settings-workspace.d.ts +12 -15
- package/dist/settings-workspace.js +10 -13
- package/dist/static/index.d.ts +164 -6
- package/dist/static/index.js +242 -7
- package/dist/static/seo.d.ts +8 -30
- package/dist/static/seo.js +19 -46
- 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 +10 -2
- 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 +18 -2
- package/dist/utils/git.js +61 -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 +2 -3
- package/dist/utils/sanitize-href.js +2 -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 +31 -2
- package/dist/worker/cms-worker.js +321 -13
- 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 +3 -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/to-plain-text.d.ts.map +0 -1
- package/dist/ai/to-plain-text.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-canopy.d.ts.map +0 -1
- package/dist/build-canopy.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/static/seo.d.ts.map +0 -1
- package/dist/static/seo.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldConfig } from '../config';
|
|
1
|
+
import type { FieldConfig } from '../config/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Count the number of top-level fields marked `isBody: true` in a schema.
|
|
4
4
|
* Does NOT recurse into objects — isBody only makes sense at the top level
|
|
@@ -10,9 +10,19 @@ export declare function countBodyFields(fields: readonly FieldConfig[]): number;
|
|
|
10
10
|
* Used at read time to map the markdown file's content to the correct data field.
|
|
11
11
|
*/
|
|
12
12
|
export declare function findBodyFieldName(fields: readonly FieldConfig[]): string;
|
|
13
|
+
/**
|
|
14
|
+
* Find an isBody field whose NAME is reserved by reference resolution.
|
|
15
|
+
*
|
|
16
|
+
* A resolved reference reserves `id`/`slug`/`collection`/`urlPath` by applying them after the
|
|
17
|
+
* target's data. The body is the one value assigned by key rather than spread, so a body field
|
|
18
|
+
* named e.g. `id` would be the single way to get around that — and since the write boundary
|
|
19
|
+
* recovers a reference's id from `value.id`, re-saving would then persist the prose as the
|
|
20
|
+
* reference. Rejected at registry-validation time instead, so the schema fails loudly rather
|
|
21
|
+
* than the body being silently dropped at resolution.
|
|
22
|
+
*/
|
|
23
|
+
export declare function findReservedBodyFieldName(fields: readonly FieldConfig[], reserved: readonly string[]): string | undefined;
|
|
13
24
|
/**
|
|
14
25
|
* Find isBody fields that have an invalid type (not 'markdown' or 'mdx').
|
|
15
26
|
* Returns field names that fail validation.
|
|
16
27
|
*/
|
|
17
28
|
export declare function findInvalidBodyFields(fields: readonly FieldConfig[]): string[];
|
|
18
|
-
//# sourceMappingURL=body-field.d.ts.map
|
package/dist/utils/body-field.js
CHANGED
|
@@ -24,6 +24,23 @@ export function findBodyFieldName(fields) {
|
|
|
24
24
|
}
|
|
25
25
|
return 'body';
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Find an isBody field whose NAME is reserved by reference resolution.
|
|
29
|
+
*
|
|
30
|
+
* A resolved reference reserves `id`/`slug`/`collection`/`urlPath` by applying them after the
|
|
31
|
+
* target's data. The body is the one value assigned by key rather than spread, so a body field
|
|
32
|
+
* named e.g. `id` would be the single way to get around that — and since the write boundary
|
|
33
|
+
* recovers a reference's id from `value.id`, re-saving would then persist the prose as the
|
|
34
|
+
* reference. Rejected at registry-validation time instead, so the schema fails loudly rather
|
|
35
|
+
* than the body being silently dropped at resolution.
|
|
36
|
+
*/
|
|
37
|
+
export function findReservedBodyFieldName(fields, reserved) {
|
|
38
|
+
for (const field of flattenGroupFields(fields)) {
|
|
39
|
+
if ('isBody' in field && field.isBody && reserved.includes(field.name))
|
|
40
|
+
return field.name;
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
27
44
|
/**
|
|
28
45
|
* Find isBody fields that have an invalid type (not 'markdown' or 'mdx').
|
|
29
46
|
* Returns field names that fail validation.
|
|
@@ -37,4 +54,3 @@ export function findInvalidBodyFields(fields) {
|
|
|
37
54
|
}
|
|
38
55
|
return invalid;
|
|
39
56
|
}
|
|
40
|
-
//# sourceMappingURL=body-field.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment-preserving serialisation for YAML content files and md/mdx frontmatter.
|
|
3
|
+
*
|
|
4
|
+
* ContentStore used to write a content file by stringifying a fresh plain object
|
|
5
|
+
* (`yamlStringify(data)` / `matter.stringify(body, data)`). Comments live in neither the object
|
|
6
|
+
* nor that round trip, so **every editor save silently deleted every comment in the file** —
|
|
7
|
+
* invisible to a dev team (`canopycms sync` copies files byte-for-byte) and certain for an
|
|
8
|
+
* editorial team. See `.claude/future-tasks/resolved/content-comment-loss-on-editor-save.md`.
|
|
9
|
+
*
|
|
10
|
+
* The fix re-serialises onto the file's OWN parsed document instead of a fresh one: nodes whose
|
|
11
|
+
* value did not change are left untouched, and an untouched node keeps its attached comments
|
|
12
|
+
* (and its original quoting/block style). Only what actually changed is rewritten.
|
|
13
|
+
*
|
|
14
|
+
* What this module does NOT do is give the file any authority over its own content. The
|
|
15
|
+
* reconciler makes the document's key set match `data` exactly — a key the caller dropped
|
|
16
|
+
* disappears, a key the caller kept survives whether or not the schema still knows about it.
|
|
17
|
+
* Data authority stays with the payload; comments are the only thing inherited from disk. That
|
|
18
|
+
* separation is deliberate: whether a surviving key SHOULD still be there is a schema question,
|
|
19
|
+
* answered one layer up by `findUnknownKeys` (validation/entry-validator.ts) at the API
|
|
20
|
+
* boundary, not by a serialiser that has no schema.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Serialise entry data as a YAML file, carrying the comments of `existingRaw` through.
|
|
24
|
+
*
|
|
25
|
+
* Falls back to a plain stringify — byte-identical to the pre-fix behaviour — when there is
|
|
26
|
+
* nothing to preserve (a new file) or nothing trustworthy to preserve (the bytes on disk do not
|
|
27
|
+
* parse). A save must not fail because the previous content was malformed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function serializeYaml(data: Record<string, unknown>, existingRaw?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Serialise an md/mdx entry, carrying the comments of `existingRaw`'s frontmatter through.
|
|
32
|
+
*
|
|
33
|
+
* The reconciled YAML goes back through `matter.stringify` via a custom stringify engine rather
|
|
34
|
+
* than being spliced between hand-written `---` lines, so the delimiters, blank lines and
|
|
35
|
+
* trailing newline stay exactly what gray-matter would have produced.
|
|
36
|
+
*/
|
|
37
|
+
export declare function serializeFrontmatter(body: string, data: Record<string, unknown>, existingRaw?: string): string;
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment-preserving serialisation for YAML content files and md/mdx frontmatter.
|
|
3
|
+
*
|
|
4
|
+
* ContentStore used to write a content file by stringifying a fresh plain object
|
|
5
|
+
* (`yamlStringify(data)` / `matter.stringify(body, data)`). Comments live in neither the object
|
|
6
|
+
* nor that round trip, so **every editor save silently deleted every comment in the file** —
|
|
7
|
+
* invisible to a dev team (`canopycms sync` copies files byte-for-byte) and certain for an
|
|
8
|
+
* editorial team. See `.claude/future-tasks/resolved/content-comment-loss-on-editor-save.md`.
|
|
9
|
+
*
|
|
10
|
+
* The fix re-serialises onto the file's OWN parsed document instead of a fresh one: nodes whose
|
|
11
|
+
* value did not change are left untouched, and an untouched node keeps its attached comments
|
|
12
|
+
* (and its original quoting/block style). Only what actually changed is rewritten.
|
|
13
|
+
*
|
|
14
|
+
* What this module does NOT do is give the file any authority over its own content. The
|
|
15
|
+
* reconciler makes the document's key set match `data` exactly — a key the caller dropped
|
|
16
|
+
* disappears, a key the caller kept survives whether or not the schema still knows about it.
|
|
17
|
+
* Data authority stays with the payload; comments are the only thing inherited from disk. That
|
|
18
|
+
* separation is deliberate: whether a surviving key SHOULD still be there is a schema question,
|
|
19
|
+
* answered one layer up by `findUnknownKeys` (validation/entry-validator.ts) at the API
|
|
20
|
+
* boundary, not by a serialiser that has no schema.
|
|
21
|
+
*/
|
|
22
|
+
import matter from 'gray-matter';
|
|
23
|
+
import { isCollection, isMap, isNode, isScalar, isSeq, parseDocument, stringify as yamlStringify, } from 'yaml';
|
|
24
|
+
import { isBlockStructuralKey } from '../validation/block-structural-keys.js';
|
|
25
|
+
/**
|
|
26
|
+
* True only for a PLAIN object — one that should be reconciled key-by-key against a YAML map.
|
|
27
|
+
*
|
|
28
|
+
* The prototype check is load-bearing, not defensive tidiness. A looser "object and not an array"
|
|
29
|
+
* test classifies a class instance as a record, and the reconciler then walks its (empty) own
|
|
30
|
+
* enumerable keys and emits `{}` — silently replacing the value. A `Date` is the case that
|
|
31
|
+
* actually occurs: HTTP payloads carry none, but `ContentStore.write` is also reachable from
|
|
32
|
+
* server-side callers (build scripts via `createBuildCanopy`, migrations), and `d: 2024-01-15`
|
|
33
|
+
* became `d: {}` on save. Anything non-plain falls through to `doc.createNode`, which serialises
|
|
34
|
+
* it exactly as the pre-fix `yaml.stringify` did.
|
|
35
|
+
*
|
|
36
|
+
* Known residual, and the reason this is a prototype check rather than a `toJSON` check: a PLAIN
|
|
37
|
+
* object carrying its own `toJSON` is still walked as a record here, while `createNode` (the
|
|
38
|
+
* create path, and the scalar-slot path) would call `toJSON` instead — so the same payload can
|
|
39
|
+
* serialise differently depending on what is currently on disk, and a `toJSON` function value
|
|
40
|
+
* makes `createNode` throw. Unreachable over HTTP, since JSON payloads carry no functions; a loud
|
|
41
|
+
* failure rather than corruption if a server-side caller ever hits it.
|
|
42
|
+
*/
|
|
43
|
+
function isPlainRecord(value) {
|
|
44
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
45
|
+
return false;
|
|
46
|
+
const proto = Object.getPrototypeOf(value);
|
|
47
|
+
return proto === Object.prototype || proto === null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The JS record key a YAML map key projects to, or undefined for a key that cannot be one.
|
|
51
|
+
*
|
|
52
|
+
* `String(...)` mirrors how parsing into a plain object projects non-string scalar keys
|
|
53
|
+
* (`1: x` reads back as `{ '1': x }`). A non-scalar (complex) key — `? [a, b] : v` — has no
|
|
54
|
+
* record counterpart at all; those pairs are dropped, which is what the old
|
|
55
|
+
* stringify-a-fresh-object write did to them too.
|
|
56
|
+
*/
|
|
57
|
+
function recordKeyOf(keyNode) {
|
|
58
|
+
if (!isScalar(keyNode))
|
|
59
|
+
return undefined;
|
|
60
|
+
const { value } = keyNode;
|
|
61
|
+
if (value === null || value === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
if (typeof value === 'object')
|
|
64
|
+
return undefined;
|
|
65
|
+
return String(value);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Copy the comment metadata attached to a node being REPLACED onto its replacement, so a changed
|
|
69
|
+
* value keeps the comments written about it.
|
|
70
|
+
*/
|
|
71
|
+
function carryComments(from, to) {
|
|
72
|
+
if (!isNode(from) || !isNode(to))
|
|
73
|
+
return;
|
|
74
|
+
const source = from;
|
|
75
|
+
const target = to;
|
|
76
|
+
if (source.commentBefore !== undefined)
|
|
77
|
+
target.commentBefore = source.commentBefore;
|
|
78
|
+
if (source.comment !== undefined)
|
|
79
|
+
target.comment = source.comment;
|
|
80
|
+
if (source.spaceBefore !== undefined)
|
|
81
|
+
target.spaceBefore = source.spaceBefore;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Identity key for sequence alignment: the JSON form of a value.
|
|
85
|
+
*
|
|
86
|
+
* Returns undefined when the value cannot be keyed — a cyclic structure (reachable through YAML
|
|
87
|
+
* anchors) makes `JSON.stringify` throw, and a save must never fail because of it. An unkeyable
|
|
88
|
+
* item simply matches nothing and falls through to positional reconciliation.
|
|
89
|
+
*/
|
|
90
|
+
function identityKey(value) {
|
|
91
|
+
try {
|
|
92
|
+
return JSON.stringify(value) ?? 'undefined';
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function nodePlainValue(node) {
|
|
99
|
+
if (!isNode(node))
|
|
100
|
+
return node;
|
|
101
|
+
try {
|
|
102
|
+
return node.toJSON();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function nodeIdentityKey(node) {
|
|
109
|
+
const plain = nodePlainValue(node);
|
|
110
|
+
return plain === undefined && isNode(node) ? undefined : identityKey(plain);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* How far {@link sharesFieldEvidence} descends into nested records before giving up.
|
|
114
|
+
*
|
|
115
|
+
* Termination does not actually depend on this — it is defence in depth, deliberately kept
|
|
116
|
+
* because the alternative is depending on two other layers behaving as expected, which is the
|
|
117
|
+
* shape of assumption that produced the bug {@link looksLikeSameItem} documents. Spelling out
|
|
118
|
+
* what the cap is and is not doing, since the obvious guess is wrong in both directions:
|
|
119
|
+
*
|
|
120
|
+
* - A cyclic PAYLOAD is genuinely reachable (`ContentStore.write` is callable server-side with
|
|
121
|
+
* arbitrary objects, which is why `identityKey` guards `JSON.stringify` at all). It cannot run
|
|
122
|
+
* away here on its own, because the descent below only happens when BOTH sides are records.
|
|
123
|
+
* - The on-disk side cannot supply the matching cycle: `existing` comes from `yaml`'s `toJSON()`,
|
|
124
|
+
* and a self-referential anchor (`- &b {self: *b}`) does not round-trip into a cyclic JS
|
|
125
|
+
* object — `toJSON` degrades the unresolvable alias to a plain `{ source }` marker (verified
|
|
126
|
+
* against the `yaml` version pinned here; the cycle case `identityKey`'s comment describes is
|
|
127
|
+
* the `JSON.stringify` hazard, not this one).
|
|
128
|
+
*
|
|
129
|
+
* So the real bound today is the finite depth of the parsed document — a guarantee owned by
|
|
130
|
+
* `yaml`, not by this module. The cap makes it local and explicit, and incidentally bounds cost
|
|
131
|
+
* on pathologically nested content. Real content bottoms out far shallower: a block is item ->
|
|
132
|
+
* `value` -> fields, and an object field inside one adds a level. Exceeding the cap simply means
|
|
133
|
+
* "no evidence found", which drops a comment rather than risking a move — the safe direction.
|
|
134
|
+
*/
|
|
135
|
+
const EVIDENCE_MAX_DEPTH = 6;
|
|
136
|
+
/**
|
|
137
|
+
* Does `value` share at least one non-structural leaf with `existing` — i.e. is there any field
|
|
138
|
+
* whose value an edit left alone?
|
|
139
|
+
*
|
|
140
|
+
* Two things this looks past, both learned the hard way:
|
|
141
|
+
*
|
|
142
|
+
* - **Block discriminators are not evidence.** `template` (and the inline shape's `_type`) names
|
|
143
|
+
* a block's TEMPLATE, so every `hero` on the page carries the same one. Counting it made the
|
|
144
|
+
* check below true for any two blocks of the same kind. See `../validation/block-structural-keys`.
|
|
145
|
+
* - **A block's real fields are one level down.** The canonical shape is
|
|
146
|
+
* `{ template, value: { ...fields } }`, so comparing top-level values compares `value` whole —
|
|
147
|
+
* which differs the moment ANY field in it changes. Together with the point above that left a
|
|
148
|
+
* block with no reachable evidence at all, i.e. "drop every block comment on every edit". So
|
|
149
|
+
* nested records are descended into.
|
|
150
|
+
*
|
|
151
|
+
* Arrays are compared whole rather than element-wise, deliberately. A list has no item identity
|
|
152
|
+
* — that is the premise `reconcileSeq` is built on — so pairing elements by index to harvest
|
|
153
|
+
* evidence would be the same positional guess this module exists to refuse, just one level down.
|
|
154
|
+
* The cost is that a record whose only field is a list loses its comment when that list changes,
|
|
155
|
+
* which is the single-field residual documented on {@link looksLikeSameItem}, not a new class.
|
|
156
|
+
*/
|
|
157
|
+
function sharesFieldEvidence(existing, value, depth) {
|
|
158
|
+
for (const key of Object.keys(value)) {
|
|
159
|
+
if (isBlockStructuralKey(key))
|
|
160
|
+
continue;
|
|
161
|
+
if (!Object.prototype.hasOwnProperty.call(existing, key))
|
|
162
|
+
continue;
|
|
163
|
+
const before = existing[key];
|
|
164
|
+
const after = value[key];
|
|
165
|
+
// Descending is only ever an EXTRA chance to find evidence: the whole-value comparison below
|
|
166
|
+
// still runs, so a pair of structurally-empty records ({} vs {}) still matches on identity
|
|
167
|
+
// even though there is no leaf inside them to match on.
|
|
168
|
+
if (depth < EVIDENCE_MAX_DEPTH &&
|
|
169
|
+
isPlainRecord(before) &&
|
|
170
|
+
isPlainRecord(after) &&
|
|
171
|
+
sharesFieldEvidence(before, after, depth + 1)) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
const beforeKey = identityKey(before);
|
|
175
|
+
if (beforeKey !== undefined && beforeKey === identityKey(after))
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Is `value` plausibly an EDITED version of the item currently at this index, rather than a
|
|
182
|
+
* different item that merely landed on the same index?
|
|
183
|
+
*
|
|
184
|
+
* Position alone is not evidence. A save that replaces one list item wholesale — delete this
|
|
185
|
+
* block, add that one — leaves the new item sitting exactly where the old one was, and pairing
|
|
186
|
+
* them purely by index moved the old item's comments onto content they do not describe. For the
|
|
187
|
+
* comments this change exists to protect ("do not delete this block") that is worse than losing
|
|
188
|
+
* them, because a lost comment reads as a deletion in review while a moved one reads as intact.
|
|
189
|
+
*
|
|
190
|
+
* Records carry usable evidence: an edit changes some fields and leaves others alone, so one
|
|
191
|
+
* surviving field value means "same item, edited". The evidence has to be a real FIELD, though.
|
|
192
|
+
* An earlier version of this rule accepted any shared key/value pair on the reasoning that "a
|
|
193
|
+
* wholesale replacement shares nothing" — true of arbitrary records, false of this CMS's block
|
|
194
|
+
* shape, where `template: <name>` is a category label every block of that kind carries. A save
|
|
195
|
+
* that deleted one `hero` and edited the next shifted the survivor onto the deleted item's
|
|
196
|
+
* index, and the discriminator alone was enough to pair them: the deleted block's "keep this
|
|
197
|
+
* verbatim" comment silently migrated onto unrelated content. So the module was failing in the
|
|
198
|
+
* exact direction it declared unacceptable, through the case it assumed could not arise.
|
|
199
|
+
* {@link sharesFieldEvidence} is therefore discriminator-blind and record-deep.
|
|
200
|
+
*
|
|
201
|
+
* Scalars carry no evidence at all, so they keep the plain same-index rule — an edited string in
|
|
202
|
+
* a list is overwhelmingly the common case there, and a short annotation on a scalar is far less
|
|
203
|
+
* load-bearing than a block comment. That residual is unchanged by the above and is pinned as
|
|
204
|
+
* accepted rather than fixed: giving scalars the same treatment would drop the comment on every
|
|
205
|
+
* ordinary one-line edit, which is a large, certain loss traded against a small, speculative one.
|
|
206
|
+
*
|
|
207
|
+
* One shared field is still the bar, not two. Raising it would take a two-field block — the
|
|
208
|
+
* common size — from "keeps its comment when one field is edited" to "never keeps it", which
|
|
209
|
+
* empties the rule out for the shape it was just repaired for; the discriminator was the thing
|
|
210
|
+
* making one pair meaningless, and it is now excluded.
|
|
211
|
+
*
|
|
212
|
+
* The residuals, deliberately accepted: a record whose every field changed shares nothing, so
|
|
213
|
+
* its comment is dropped rather than risked (this now includes a block edited in ALL its fields,
|
|
214
|
+
* which previously kept its comment via the discriminator — a deliberate move toward the losing
|
|
215
|
+
* side of the trade-off); and a genuine schema field NAMED `template` or `_type` is not counted
|
|
216
|
+
* as evidence, which can only ever drop a comment, never move one.
|
|
217
|
+
*/
|
|
218
|
+
function looksLikeSameItem(node, value) {
|
|
219
|
+
const existing = nodePlainValue(node);
|
|
220
|
+
// No record evidence available on either side — fall back to position.
|
|
221
|
+
if (!isPlainRecord(existing) || !isPlainRecord(value))
|
|
222
|
+
return true;
|
|
223
|
+
return sharesFieldEvidence(existing, value, 0);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Reconcile one slot of the document against the value that must occupy it, returning the node
|
|
227
|
+
* to put there. `existing` is the node currently in that slot (or null/undefined for a slot that
|
|
228
|
+
* did not exist).
|
|
229
|
+
*/
|
|
230
|
+
function reconcileNode(doc, existing, value) {
|
|
231
|
+
if (isMap(existing) && isPlainRecord(value)) {
|
|
232
|
+
reconcileMap(doc, existing, value);
|
|
233
|
+
return existing;
|
|
234
|
+
}
|
|
235
|
+
if (isSeq(existing) && Array.isArray(value)) {
|
|
236
|
+
reconcileSeq(doc, existing, value);
|
|
237
|
+
return existing;
|
|
238
|
+
}
|
|
239
|
+
// Unchanged scalar: return the node itself, untouched. This is the case that preserves
|
|
240
|
+
// comments in practice, and it also keeps the author's original quoting and block style.
|
|
241
|
+
if (isScalar(existing) && Object.is(existing.value, value))
|
|
242
|
+
return existing;
|
|
243
|
+
// Changed, or a shape change (scalar <-> collection). Build a fresh node rather than mutating
|
|
244
|
+
// `scalar.value` in place: an in-place type change would keep the old node's representation,
|
|
245
|
+
// emitting `'42'` where the number 42 was meant.
|
|
246
|
+
const fresh = doc.createNode(value);
|
|
247
|
+
// Comments move with a changed VALUE, but not off a replaced STRUCTURE. `yaml` attaches a
|
|
248
|
+
// comment written above a collection's first entry to the collection node itself (the same
|
|
249
|
+
// rule that makes a leading list comment a list-head comment), so that node's comments are
|
|
250
|
+
// about its innards. Carrying them onto whatever replaces the collection put "# FLAG: explains
|
|
251
|
+
// the heading below" above a bare string that has no heading -- a comment over content it does
|
|
252
|
+
// not describe, which this module treats as worse than losing it. A comment written above the
|
|
253
|
+
// KEY is unaffected either way: it lives on the pair's key node, which is never replaced here.
|
|
254
|
+
if (!isCollection(existing))
|
|
255
|
+
carryComments(existing, fresh);
|
|
256
|
+
return fresh;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Make a map's key set match `value` exactly.
|
|
260
|
+
*
|
|
261
|
+
* Retained pairs are reconciled in place, so their key order and the comments attached to their
|
|
262
|
+
* keys survive; keys new to `value` are appended in `value` order, which keeps the diff of a
|
|
263
|
+
* save down to the lines that actually changed.
|
|
264
|
+
*/
|
|
265
|
+
function reconcileMap(doc, map, value) {
|
|
266
|
+
// An explicitly-undefined key is NOT a key. `Object.keys` reports it, but both `JSON.stringify`
|
|
267
|
+
// and `yaml.stringify` omit it — so without this filter a key present on disk and set to
|
|
268
|
+
// `undefined` in the payload would be rewritten as `key: null` here while the create path
|
|
269
|
+
// dropped it entirely. Same rule on both paths, so "the key set matches the payload" holds
|
|
270
|
+
// exactly rather than approximately.
|
|
271
|
+
const wanted = new Set(Object.keys(value).filter((key) => value[key] !== undefined));
|
|
272
|
+
const seen = new Set();
|
|
273
|
+
const retained = [];
|
|
274
|
+
for (const pair of map.items) {
|
|
275
|
+
const key = recordKeyOf(pair.key);
|
|
276
|
+
// Drop complex keys (no record counterpart), keys the caller removed, and any duplicate
|
|
277
|
+
// (malformed YAML can carry two pairs with the same key; a record holds one).
|
|
278
|
+
if (key === undefined || !wanted.has(key) || seen.has(key))
|
|
279
|
+
continue;
|
|
280
|
+
seen.add(key);
|
|
281
|
+
pair.value = reconcileNode(doc, pair.value, value[key]);
|
|
282
|
+
retained.push(pair);
|
|
283
|
+
}
|
|
284
|
+
map.items = retained;
|
|
285
|
+
for (const key of Object.keys(value)) {
|
|
286
|
+
if (seen.has(key) || !wanted.has(key))
|
|
287
|
+
continue;
|
|
288
|
+
map.set(doc.createNode(key), doc.createNode(value[key]));
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Make a sequence's items match `value` exactly, aligning by VALUE first and position second.
|
|
293
|
+
*
|
|
294
|
+
* A list has no item identity — nothing in the payload says "this is the item that used to be
|
|
295
|
+
* third" — so any alignment is a guess, and the two failure modes are not equally bad. Losing a
|
|
296
|
+
* comment shows up in review as a deletion; silently MOVING a comment onto content it does not
|
|
297
|
+
* describe does not, and the comments this fix exists to protect are exactly the load-bearing
|
|
298
|
+
* kind ("do not delete this block") that must never end up over the wrong thing. The rules are
|
|
299
|
+
* therefore ordered from most evidence to least, and stop rather than guessing:
|
|
300
|
+
*
|
|
301
|
+
* 1. **Exact value match** — reuse that old node whole, comments and all. This is what carries a
|
|
302
|
+
* comment through a pure reorder, instead of stranding it on whatever moved into its index.
|
|
303
|
+
* 2. **Same index, still unclaimed, and recognisably the same item** (`looksLikeSameItem`) —
|
|
304
|
+
* reconcile against it. This is the edit-in-place case.
|
|
305
|
+
* 3. **Otherwise a fresh node, with no comments.**
|
|
306
|
+
*
|
|
307
|
+
* Rule 2 is deliberately same-index rather than "next unclaimed old node in order": the looser
|
|
308
|
+
* form paired a newly-inserted item with an unrelated deleted one whenever one save both removed
|
|
309
|
+
* and added an item. Position alone is still not enough, though — a wholesale replacement lands
|
|
310
|
+
* on the index it replaced — which is why rule 2 also demands evidence of identity.
|
|
311
|
+
*/
|
|
312
|
+
function reconcileSeq(doc, seq, value) {
|
|
313
|
+
const oldItems = seq.items;
|
|
314
|
+
// Old indices by identity, in order, so equal items are consumed first-come-first-served.
|
|
315
|
+
const byIdentity = new Map();
|
|
316
|
+
oldItems.forEach((node, index) => {
|
|
317
|
+
const key = nodeIdentityKey(node);
|
|
318
|
+
if (key === undefined)
|
|
319
|
+
return;
|
|
320
|
+
const bucket = byIdentity.get(key);
|
|
321
|
+
if (bucket)
|
|
322
|
+
bucket.push(index);
|
|
323
|
+
else
|
|
324
|
+
byIdentity.set(key, [index]);
|
|
325
|
+
});
|
|
326
|
+
const consumed = new Set();
|
|
327
|
+
const matches = value.map((item) => {
|
|
328
|
+
const key = identityKey(item);
|
|
329
|
+
if (key === undefined)
|
|
330
|
+
return undefined;
|
|
331
|
+
const bucket = byIdentity.get(key);
|
|
332
|
+
while (bucket && bucket.length > 0) {
|
|
333
|
+
const index = bucket.shift();
|
|
334
|
+
if (index !== undefined && !consumed.has(index)) {
|
|
335
|
+
consumed.add(index);
|
|
336
|
+
return index;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return undefined;
|
|
340
|
+
});
|
|
341
|
+
seq.items = value.map((item, index) => {
|
|
342
|
+
const matched = matches[index];
|
|
343
|
+
if (matched !== undefined)
|
|
344
|
+
return oldItems[matched];
|
|
345
|
+
// `consumed` holds OLD indices claimed by rule 1, so this asks "is the node that sits at my
|
|
346
|
+
// index still unclaimed?". Each iteration owns a distinct index, so no bookkeeping is needed
|
|
347
|
+
// here — a candidate cannot be taken twice.
|
|
348
|
+
const candidate = index < oldItems.length && !consumed.has(index) ? oldItems[index] : undefined;
|
|
349
|
+
const sameItem = candidate !== undefined && looksLikeSameItem(candidate, item) ? candidate : undefined;
|
|
350
|
+
return reconcileNode(doc, sameItem, item);
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
/** Apply `data` onto a parsed document, preserving every node the data did not change. */
|
|
354
|
+
function applyDataToDocument(doc, data) {
|
|
355
|
+
doc.contents = reconcileNode(doc, doc.contents, data);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Serialise entry data as a YAML file, carrying the comments of `existingRaw` through.
|
|
359
|
+
*
|
|
360
|
+
* Falls back to a plain stringify — byte-identical to the pre-fix behaviour — when there is
|
|
361
|
+
* nothing to preserve (a new file) or nothing trustworthy to preserve (the bytes on disk do not
|
|
362
|
+
* parse). A save must not fail because the previous content was malformed.
|
|
363
|
+
*/
|
|
364
|
+
export function serializeYaml(data, existingRaw) {
|
|
365
|
+
if (existingRaw === undefined)
|
|
366
|
+
return yamlStringify(data);
|
|
367
|
+
const doc = parseDocument(existingRaw);
|
|
368
|
+
if (doc.errors.length > 0)
|
|
369
|
+
return yamlStringify(data);
|
|
370
|
+
applyDataToDocument(doc, data);
|
|
371
|
+
return doc.toString();
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Split a file into its raw frontmatter string, or undefined when there is nothing usable.
|
|
375
|
+
*
|
|
376
|
+
* Two gray-matter hazards are handled here, both of which cost a real bug when discovered:
|
|
377
|
+
*
|
|
378
|
+
* 1. **The options argument is load-bearing.** `matter(str)` with no options reads and writes a
|
|
379
|
+
* process-global content-keyed cache, and the object it hands back on a HIT has lost
|
|
380
|
+
* `.matter` — so the second save of the same file would silently see no frontmatter and drop
|
|
381
|
+
* every comment. Passing an options object skips the cache on both sides (see the `if
|
|
382
|
+
* (!options)` guard in gray-matter's index.js), which also keeps the write path from
|
|
383
|
+
* polluting that cache for everyone else — the same class of problem as `42aede48`.
|
|
384
|
+
* 2. **It throws on malformed frontmatter.** js-yaml raises rather than returning an error list,
|
|
385
|
+
* so a file whose bytes do not parse must not be allowed to fail the save.
|
|
386
|
+
*
|
|
387
|
+
* Only the raw STRING is read, never `.data`, so nothing from gray-matter's own object graph can
|
|
388
|
+
* alias into what gets written.
|
|
389
|
+
*/
|
|
390
|
+
function extractRawFrontmatter(raw) {
|
|
391
|
+
let parsed;
|
|
392
|
+
try {
|
|
393
|
+
parsed = matter(raw, {});
|
|
394
|
+
}
|
|
395
|
+
catch {
|
|
396
|
+
return undefined;
|
|
397
|
+
}
|
|
398
|
+
const frontmatter = parsed.matter;
|
|
399
|
+
if (typeof frontmatter !== 'string' || frontmatter.trim() === '')
|
|
400
|
+
return undefined;
|
|
401
|
+
return frontmatter;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Serialise an md/mdx entry, carrying the comments of `existingRaw`'s frontmatter through.
|
|
405
|
+
*
|
|
406
|
+
* The reconciled YAML goes back through `matter.stringify` via a custom stringify engine rather
|
|
407
|
+
* than being spliced between hand-written `---` lines, so the delimiters, blank lines and
|
|
408
|
+
* trailing newline stay exactly what gray-matter would have produced.
|
|
409
|
+
*/
|
|
410
|
+
export function serializeFrontmatter(body, data, existingRaw) {
|
|
411
|
+
if (existingRaw === undefined)
|
|
412
|
+
return matter.stringify(body, data);
|
|
413
|
+
const existingFrontmatter = extractRawFrontmatter(existingRaw);
|
|
414
|
+
if (existingFrontmatter === undefined)
|
|
415
|
+
return matter.stringify(body, data);
|
|
416
|
+
const doc = parseDocument(existingFrontmatter);
|
|
417
|
+
if (doc.errors.length > 0)
|
|
418
|
+
return matter.stringify(body, data);
|
|
419
|
+
applyDataToDocument(doc, data);
|
|
420
|
+
const reconciled = doc.toString();
|
|
421
|
+
return matter.stringify(body, data, {
|
|
422
|
+
engines: {
|
|
423
|
+
yaml: {
|
|
424
|
+
parse: () => ({}),
|
|
425
|
+
stringify: () => reconciled,
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
}
|
|
@@ -26,22 +26,18 @@
|
|
|
26
26
|
* an acceptable price, and a read racing a rebase gets a consistent-enough
|
|
27
27
|
* older or newer file, never a destroyed one.
|
|
28
28
|
*
|
|
29
|
-
* ## Why the lock
|
|
29
|
+
* ## Why the lock marker lives under `{branchRoot}/.canopy-meta`
|
|
30
30
|
*
|
|
31
31
|
* proper-lockfile keys its module-level `locks{}` bookkeeping (refresh timer,
|
|
32
32
|
* release function) by the **target path** passed to `lock()`, NOT by
|
|
33
|
-
* `lockfilePath`.
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* every other branch's content lock -- the provisioning locks already share
|
|
42
|
-
* one key across branches);
|
|
43
|
-
* - a distinct on-disk lock directory, so the server-enforced mkdir cannot
|
|
44
|
-
* collide either; and
|
|
33
|
+
* `lockfilePath`. `provisioning-lock.ts` now anchors every lock on its own
|
|
34
|
+
* marker path, so the registry key equals the on-disk lock identity and two
|
|
35
|
+
* live locks can no longer share a key -- aliasing is structurally impossible
|
|
36
|
+
* rather than merely avoided by convention. Keeping the content lock under
|
|
37
|
+
* `{branchRoot}/.canopy-meta` still buys:
|
|
38
|
+
*
|
|
39
|
+
* - a per-branch marker, so one branch's content lock is independent of every
|
|
40
|
+
* other branch's and of that branch's provisioning lock; and
|
|
45
41
|
* - no deadlock potential: the two locks are never both required, and the only
|
|
46
42
|
* possible acquisition order (provision, then write) is consistent.
|
|
47
43
|
*
|
|
@@ -59,6 +55,7 @@
|
|
|
59
55
|
* unsynchronized writers), so this is a strict improvement -- not a proof of
|
|
60
56
|
* mutual exclusion. See docs/concurrency.md.
|
|
61
57
|
*/
|
|
58
|
+
import { type OnLockCompromised } from './provisioning-lock.js';
|
|
62
59
|
/** On-disk name of the lock marker (a directory, created by mkdir). */
|
|
63
60
|
export declare const CONTENT_WRITE_LOCK_NAME = "content-write.lock";
|
|
64
61
|
/**
|
|
@@ -107,7 +104,7 @@ export declare class ContentWriteLockBusyError extends Error {
|
|
|
107
104
|
* the worker's rebase loop (which skips the branch and retries next cycle) and
|
|
108
105
|
* by tests standing in for a writer.
|
|
109
106
|
*/
|
|
110
|
-
export declare function tryAcquireContentWriteLock(branchRoot: string): Promise<() => Promise<void>>;
|
|
107
|
+
export declare function tryAcquireContentWriteLock(branchRoot: string, onCompromised?: OnLockCompromised): Promise<() => Promise<void>>;
|
|
111
108
|
/**
|
|
112
109
|
* Acquire the branch's content-write lock with a short bounded wait.
|
|
113
110
|
*
|
|
@@ -118,10 +115,9 @@ export declare function tryAcquireContentWriteLock(branchRoot: string): Promise<
|
|
|
118
115
|
*
|
|
119
116
|
* @throws ContentWriteLockBusyError when the budget expires under contention.
|
|
120
117
|
*/
|
|
121
|
-
export declare function acquireContentWriteLock(branchRoot: string, waitMs?: number): Promise<() => Promise<void>>;
|
|
118
|
+
export declare function acquireContentWriteLock(branchRoot: string, waitMs?: number, onCompromised?: OnLockCompromised): Promise<() => Promise<void>>;
|
|
122
119
|
/**
|
|
123
120
|
* Run `fn` holding the branch's content-write lock, releasing it in a
|
|
124
121
|
* `finally` so a throw can never strand it.
|
|
125
122
|
*/
|
|
126
123
|
export declare function withContentWriteLock<T>(branchRoot: string, fn: () => Promise<T>, waitMs?: number): Promise<T>;
|
|
127
|
-
//# sourceMappingURL=content-write-lock.d.ts.map
|