Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): remove unnecessary exports #8469

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/sanity/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -23,10 +23,7 @@ export {useSetPerspective} from './perspective/useSetPerspective'
export * from './presence'
export * from './preview'
export {
AddedVersion,
DiscardVersionDialog,
formatRelativeLocalePublishDate,
getPublishDateFromRelease,
getReleaseIdFromReleaseDocumentId,
getReleaseTone,
isDraftPerspective,
Original file line number Diff line number Diff line change
@@ -29,89 +29,70 @@ export interface RevertInfo {

/**
* When a document (version) is successfully added to a release
* @internal
*/
export const AddedVersion = defineEvent<VersionInfo>({
name: 'Version Document Added to Release ',
version: 1,
description: 'User added a document to a release',
})

/** When a release is successfully created
* @internal
*/
/** When a release is successfully created */
export const CreatedRelease = defineEvent<OriginInfo>({
name: 'Release Created',
version: 1,
description: 'User created a release',
})

/** When a release is successfully updated
* @internal
*/
/** When a release is successfully updated */
export const UpdatedRelease = defineEvent({
name: 'Release Updated',
version: 1,
description: 'User updated a release',
})

/** When a release is successfully deleted
* @internal
*/
/** When a release is successfully deleted */
export const DeletedRelease = defineEvent({
name: 'Release Deleted',
version: 1,
description: 'User deleted a release',
})

/** When a release is successfully published
* @internal
*/
/** When a release is successfully published */
export const PublishedRelease = defineEvent({
name: 'Release Published',
version: 1,
description: 'User published a release',
})

/** When a release is successfully scheduled
* @internal
*/
/** When a release is successfully scheduled*/
export const ScheduledRelease = defineEvent({
name: 'Release Scheduled',
version: 1,
description: 'User scheduled a release',
})

/** When a release is successfully scheduled
* @internal
*/
/** When a release is successfully scheduled */
export const UnscheduledRelease = defineEvent({
name: 'Release Unscheduled',
version: 1,
description: 'User unscheduled a release',
})

/** When a release is successfully archived
* @internal
*/
/** When a release is successfully archived*/
export const ArchivedRelease = defineEvent({
name: 'Release Archived',
version: 1,
description: 'User archived a release',
})

/** When a release is successfully unarchived
* @internal
*/
/** When a release is successfully unarchived */
export const UnarchivedRelease = defineEvent({
name: 'Release Unarchived',
version: 1,
description: 'User unarchived a release',
})

/** When a release is successfully reverted
* @internal
*/
/** When a release is successfully reverted */
export const RevertRelease = defineEvent<RevertInfo>({
name: 'Release Reverted',
version: 1,

Unchanged files with check annotations Beta

)
const debounceSelectionChange = useMemo(
() => debounce(handleSelectionChange, 200),

Check warning on line 262 in packages/sanity/src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
[handleSelectionChange],
)
const currentSelectionIsOverlapping = useMemo(() => {
if (!currentSelection || addedCommentsDecorations.length === 0) return false
return addedCommentsDecorations.some((d) => {

Check warning on line 441 in packages/sanity/src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
if (!editorRef.current) return false
const testA = PortableTextEditor.isSelectionsOverlapping(
}, [handleBuildRangeDecorations, textComments])
const showFloatingButton = Boolean(
currentSelection && canSubmit && selectionReferenceElement && !mouseDownRef.current,

Check warning on line 528 in packages/sanity/src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
)
const showFloatingInput = Boolean(nextCommentSelection && popoverAuthoringReferenceElement)
</BoundaryElementProvider>
<Stack ref={setRootElement} onMouseDown={handleMouseDown} onMouseUp={handleMouseUp}>
{props.renderDefault({

Check warning on line 561 in packages/sanity/src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
...props,
onEditorChange,
editorRef,
const disabled = getItemDisabled?.(index) ?? false
const selected = getItemSelected?.(index) ?? false
if (!disabled) {
i += 1

Check warning on line 185 in packages/sanity/src/core/components/commandList/CommandList.tsx

GitHub Actions / lint

Reassigning a variable after render has completed can cause inconsistent behavior on subsequent renders. Consider using state instead
}
acc[index] = {
activeIndex: disabled ? null : i,
const rangeDecorations = useMemo((): RangeDecoration[] => {
const result = [...(rangeDecorationsProp || []), ...presenceCursorDecorations]
const reconciled = immutableReconcile(previousRangeDecorations.current, result)

Check warning on line 296 in packages/sanity/src/core/form/inputs/PortableText/PortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
previousRangeDecorations.current = reconciled

Check warning on line 297 in packages/sanity/src/core/form/inputs/PortableText/PortableTextInput.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
return reconciled
}, [presenceCursorDecorations, rangeDecorationsProp])
[validation],
)
const reconciled = immutableReconcile(prev.current, validation)

Check warning on line 36 in packages/sanity/src/core/form/inputs/PortableText/hooks/useMemberValidation.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
prev.current = reconciled

Check warning on line 37 in packages/sanity/src/core/form/inputs/PortableText/hooks/useMemberValidation.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
return useMemo(() => {
return {
}
}
const items: PortableTextMemberItem[] = result.map((item) => {

Check warning on line 121 in packages/sanity/src/core/form/inputs/PortableText/hooks/usePortableTextMembers.tsx

GitHub Actions / lint

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)
const key = pathToString(item.node.path)
const existingItem = portableTextMemberItemsRef.current.find((refItem) => refItem.key === key)
const isObject = item.kind !== 'textBlock'
export const BrandLogo = () => (

Check warning on line 1 in examples/movies-studio/components/BrandLogo.tsx

GitHub Actions / lint

Missing return type on function.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 530">
<g>
<path
return str.replace(/^drafts\./, '')
}
export function resolveProductionUrl(document, rev) {

Check warning on line 7 in examples/movies-studio/resolveProductionUrl.ts

GitHub Actions / lint

Missing return type on function.

Check warning on line 7 in examples/movies-studio/resolveProductionUrl.ts

GitHub Actions / lint

Argument 'document' should be typed.

Check warning on line 7 in examples/movies-studio/resolveProductionUrl.ts

GitHub Actions / lint

Argument 'rev' should be typed.
const id = stripDraftId(document._id)
if (rev) {
],
document: {
// @todo

Check warning on line 34 in examples/movies-studio/sanity.config.ts

GitHub Actions / lint

Unexpected 'todo' comment: '@todo'.
//productionUrl: resolveProductionUrl,
},
})
import {DefaultDocument} from 'sanity'
export default function Document(props) {

Check warning on line 3 in dev/strict-studio/_document.tsx

GitHub Actions / lint

Missing return type on function.

Check warning on line 3 in dev/strict-studio/_document.tsx

GitHub Actions / lint

Argument 'props' should be typed.
const {entryPath, ...rest} = props

Check warning on line 4 in dev/strict-studio/_document.tsx

GitHub Actions / lint

'entryPath' is assigned a value but never used.

Check warning on line 4 in dev/strict-studio/_document.tsx

GitHub Actions / lint

'entryPath' is assigned a value but never used.
return <DefaultDocument entryPath="/entry.tsx" {...rest} />
}
export const tagsDeploymentsQuery = ({
excludePatchReleases,
}: {excludePatchReleases?: boolean} = {}) => {

Check warning on line 18 in perf/tests/queries.ts

GitHub Actions / lint

Missing return type on function.
return `*[_type=='tag'${
excludePatchReleases ? ` && ${EXCLUDE_PATCH_RELEASES_FILTER}` : ''
}] | order(_createdAt desc) {