From 033bf37ea4c5406721fd20d0bf4e8b30c20cba89 Mon Sep 17 00:00:00 2001 From: Pedro Bonamin Date: Mon, 19 Feb 2024 12:56:09 +0100 Subject: [PATCH] chore(core): rename commentsSetup to addOnDataset/setup --- packages/sanity/src/core/studio/addOnDataset/index.ts | 1 + .../setup}/CommentsSetupContext.ts | 0 .../setup}/CommentsSetupProvider.tsx | 8 ++++---- .../studio/{commentsSetup => addOnDataset/setup}/index.ts | 0 .../studio/{commentsSetup => addOnDataset/setup}/types.ts | 0 .../setup}/useCommentsSetup.ts | 0 packages/sanity/src/core/studio/index.ts | 2 +- .../comments/src/context/comments/CommentsProvider.tsx | 2 +- packages/sanity/src/structure/comments/src/hooks/index.ts | 1 - 9 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 packages/sanity/src/core/studio/addOnDataset/index.ts rename packages/sanity/src/core/studio/{commentsSetup => addOnDataset/setup}/CommentsSetupContext.ts (100%) rename packages/sanity/src/core/studio/{commentsSetup => addOnDataset/setup}/CommentsSetupProvider.tsx (94%) rename packages/sanity/src/core/studio/{commentsSetup => addOnDataset/setup}/index.ts (100%) rename packages/sanity/src/core/studio/{commentsSetup => addOnDataset/setup}/types.ts (100%) rename packages/sanity/src/core/studio/{commentsSetup => addOnDataset/setup}/useCommentsSetup.ts (100%) diff --git a/packages/sanity/src/core/studio/addOnDataset/index.ts b/packages/sanity/src/core/studio/addOnDataset/index.ts new file mode 100644 index 00000000000..5a774a6b36e --- /dev/null +++ b/packages/sanity/src/core/studio/addOnDataset/index.ts @@ -0,0 +1 @@ +export * from './setup' diff --git a/packages/sanity/src/core/studio/commentsSetup/CommentsSetupContext.ts b/packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupContext.ts similarity index 100% rename from packages/sanity/src/core/studio/commentsSetup/CommentsSetupContext.ts rename to packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupContext.ts diff --git a/packages/sanity/src/core/studio/commentsSetup/CommentsSetupProvider.tsx b/packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupProvider.tsx similarity index 94% rename from packages/sanity/src/core/studio/commentsSetup/CommentsSetupProvider.tsx rename to packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupProvider.tsx index c6182d14cfd..8150987ca97 100644 --- a/packages/sanity/src/core/studio/commentsSetup/CommentsSetupProvider.tsx +++ b/packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupProvider.tsx @@ -1,9 +1,9 @@ import {type SanityClient} from '@sanity/client' import {useCallback, useEffect, useMemo, useState} from 'react' -import {useClient} from '../../hooks' -import {DEFAULT_STUDIO_CLIENT_OPTIONS} from '../../studioClient' -import {useWorkspace} from '../workspace' +import {useClient} from '../../../hooks' +import {DEFAULT_STUDIO_CLIENT_OPTIONS} from '../../../studioClient' +import {useWorkspace} from '../../workspace' import {CommentsSetupContext} from './CommentsSetupContext' import {type CommentsSetupContextValue} from './types' @@ -14,7 +14,7 @@ interface CommentsSetupProviderProps { } /** - * This providers sets the addon dataset client, currently called `comments` dataset. + * This provider sets the addon dataset client, currently called `comments` dataset. * It also exposes a `runSetup` function that can be used to create the addon dataset if it does not exist. * @beta * @hidden diff --git a/packages/sanity/src/core/studio/commentsSetup/index.ts b/packages/sanity/src/core/studio/addOnDataset/setup/index.ts similarity index 100% rename from packages/sanity/src/core/studio/commentsSetup/index.ts rename to packages/sanity/src/core/studio/addOnDataset/setup/index.ts diff --git a/packages/sanity/src/core/studio/commentsSetup/types.ts b/packages/sanity/src/core/studio/addOnDataset/setup/types.ts similarity index 100% rename from packages/sanity/src/core/studio/commentsSetup/types.ts rename to packages/sanity/src/core/studio/addOnDataset/setup/types.ts diff --git a/packages/sanity/src/core/studio/commentsSetup/useCommentsSetup.ts b/packages/sanity/src/core/studio/addOnDataset/setup/useCommentsSetup.ts similarity index 100% rename from packages/sanity/src/core/studio/commentsSetup/useCommentsSetup.ts rename to packages/sanity/src/core/studio/addOnDataset/setup/useCommentsSetup.ts diff --git a/packages/sanity/src/core/studio/index.ts b/packages/sanity/src/core/studio/index.ts index 518dde556f7..98275cd5ec1 100644 --- a/packages/sanity/src/core/studio/index.ts +++ b/packages/sanity/src/core/studio/index.ts @@ -1,6 +1,6 @@ export * from './activeWorkspaceMatcher' +export * from './addOnDataset' export * from './colorScheme' -export * from './commentsSetup' export * from './components' export * from './renderStudio' export * from './source' diff --git a/packages/sanity/src/structure/comments/src/context/comments/CommentsProvider.tsx b/packages/sanity/src/structure/comments/src/context/comments/CommentsProvider.tsx index 3dabc6fd41d..d4818d9fe88 100644 --- a/packages/sanity/src/structure/comments/src/context/comments/CommentsProvider.tsx +++ b/packages/sanity/src/structure/comments/src/context/comments/CommentsProvider.tsx @@ -2,6 +2,7 @@ import {orderBy} from 'lodash' import {memo, type ReactNode, useCallback, useMemo, useState} from 'react' import { getPublishedId, + useCommentsSetup, useCurrentUser, useEditState, useSchema, @@ -13,7 +14,6 @@ import { type CommentOperationsHookOptions, useCommentOperations, useCommentsEnabled, - useCommentsSetup, } from '../../hooks' import {useCommentsStore} from '../../store' import { diff --git a/packages/sanity/src/structure/comments/src/hooks/index.ts b/packages/sanity/src/structure/comments/src/hooks/index.ts index 0ae502238c8..1905fda09fe 100644 --- a/packages/sanity/src/structure/comments/src/hooks/index.ts +++ b/packages/sanity/src/structure/comments/src/hooks/index.ts @@ -1,4 +1,3 @@ -export * from '../../../../core/studio/commentsSetup/useCommentsSetup' export * from './use-comment-operations' export * from './useComments' export * from './useCommentsEnabled'