Skip to content

Commit

Permalink
refactor: use @portabletext/editor instead of `@sanity/portable-tex…
Browse files Browse the repository at this point in the history
…t-editor` (#7035)

* fix: replace internal PTE pkg with public @portabletext/editor pkg (#7001)

All the code in `packages/@sanity/portable-text-editor` has been moved to a new
`@portabletext/editor` package published on npm. The package lives in
https://github.com/portabletext/editor where you'll be able to see that all the
git history for these files has been preserved.

The goal of publishing this as a standalone package is to eventually allow the
Portable Text Editor to be used in other apps, innovate on the editor
independently of the Studio and truly make the Portable Text spec feel open.

No code changes have been made in that package yet, so replacing the internal
code with `v1.0.2` of the package *should* be safe and not accidentally delete
any new work or cause regressions.

* fix(deps): drop @sanity/portable-text-editor dependency (#7033)

* fix(deps): use `^` for `@portabletext/editor`

* chore(deps): bump @portabletext/editor in test-studio

---------

Co-authored-by: Christian Grøngaard <[email protected]>
Co-authored-by: Espen Hovlandsdal <[email protected]>
  • Loading branch information
3 people authored Jul 2, 2024
1 parent 628cb76 commit 9864985
Show file tree
Hide file tree
Showing 181 changed files with 145 additions and 19,696 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/packages/sanity/src/core/preview/ @sanity-io/studio-dx

# -- PTE --
/packages/@sanity/portable-text-editor/ @sanity-io/studio-ex
/packages/sanity/src/core/field/types/portableText/ @sanity-io/studio-ex
/packages/sanity/src/core/form/inputs/PortableText/ @sanity-io/studio-ex
/packages/sanity/src/core/form/types/blockProps.ts @sanity-io/studio-ex
Expand Down
5 changes: 0 additions & 5 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"description": "Slate upgrades are handled manually as they require extensive manual testing to verify it's safe to upgrade",
"matchPackageNames": ["slate", "slate-react"],
"enabled": false
},
{
"description": "Dependency updates to examples and the root should always use the chore scope as they aren't published to npm",
"matchFileNames": ["package.json", "dev/**/package.json", "examples/**/package.json"],
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/e2e-pte.yml

This file was deleted.

1 change: 0 additions & 1 deletion dev/aliases.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const devAliases = {
'@sanity/diff': './packages/@sanity/diff/src',
'@sanity/cli': './packages/@sanity/cli/src',
'@sanity/mutator': './packages/@sanity/mutator/src',
'@sanity/portable-text-editor': './packages/@sanity/portable-text-editor/src',
'@sanity/schema': './packages/@sanity/schema/src/_exports',
'@sanity/migrate': './packages/@sanity/migrate/src/_exports',
'@sanity/types': './packages/@sanity/types/src',
Expand Down
5 changes: 0 additions & 5 deletions dev/test-next-studio/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const config = {
'@sanity/diff',
'@sanity/migrate',
'@sanity/mutator',
'@sanity/portable-text-editor',
'@sanity/schema',
'@sanity/types',
'@sanity/util',
Expand All @@ -40,9 +39,6 @@ const config = {
'@sanity/diff': requireResolve('../../packages/@sanity/diff/src/index.ts'),
'@sanity/cli': requireResolve('../../packages/@sanity/cli/src/index.ts'),
'@sanity/mutator': requireResolve('../../packages/@sanity/mutator/src/index.ts'),
'@sanity/portable-text-editor': requireResolve(
'../../packages/@sanity/portable-text-editor/src/index.ts',
),
'@sanity/schema/_internal': requireResolve(
'../../packages/@sanity/schema/src/_exports/_internal.ts',
),
Expand Down Expand Up @@ -90,7 +86,6 @@ const config = {
'@sanity/diff': '@sanity/diff/src/index.ts',
'@sanity/cli': '@sanity/cli/src/index.ts',
'@sanity/mutator': '@sanity/mutator/src/index.ts',
'@sanity/portable-text-editor': '@sanity/portable-text-editor/src/index.ts',
'@sanity/schema/_internal': '@sanity/schema/src/_exports/_internal.ts',
'@sanity/schema': '@sanity/schema/src/_exports/index.ts',
'@sanity/migrate': '@sanity/migrate/src/_exports/index.ts',
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"workshop:dev": "node -r esbuild-register scripts/workshop/dev.ts"
},
"dependencies": {
"@portabletext/editor": "^1.0.7",
"@portabletext/react": "^3.0.0",
"@react-three/cannon": "^6.5.2",
"@react-three/drei": "^9.80.1",
Expand All @@ -34,7 +35,6 @@
"@sanity/locale-sv-se": "^1.0.1",
"@sanity/logos": "^2.1.2",
"@sanity/migrate": "workspace:*",
"@sanity/portable-text-editor": "workspace:*",
"@sanity/preview-url-secret": "^1.6.1",
"@sanity/react-loader": "^1.8.3",
"@sanity/tsdoc": "1.0.72",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {type OnPasteFn, type PortableTextBlock} from '@portabletext/editor'
import {htmlToBlocks} from '@sanity/block-tools'
import {type OnPasteFn, type PortableTextBlock} from '@sanity/portable-text-editor'
import {useCallback, useMemo} from 'react'
import {PortableTextInput, type PortableTextInputProps, type PortableTextMarker} from 'sanity'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {type PortableTextBlock} from '@portabletext/editor'
import {CommentIcon} from '@sanity/icons'
import {type PortableTextBlock} from '@sanity/portable-text-editor'
import {Box, Button, Popover, Stack, Text, TextArea} from '@sanity/ui'
import {type ChangeEvent, useCallback, useState} from 'react'
import {type RenderBlockActionsCallback} from 'sanity'
Expand Down
1 change: 0 additions & 1 deletion dev/tsconfig.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@sanity/cli": ["./packages/@sanity/cli/src/index.ts"],
"@sanity/codegen": ["./packages/@sanity/codegen/src/_exports/index.ts"],
"@sanity/mutator": ["./packages/@sanity/mutator/src/index.ts"],
"@sanity/portable-text-editor": ["./packages/@sanity/portable-text-editor/src/index.ts"],
"@sanity/schema/*": ["./packages/@sanity/schema/src/_exports/*"],
"@sanity/schema": ["./packages/@sanity/schema/src/_exports/index.ts"],
"@sanity/migrate": ["./packages/@sanity/migrate/src/_exports/index.ts"],
Expand Down
1 change: 0 additions & 1 deletion examples/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@sanity/cli": ["./packages/@sanity/cli/src/index.ts"],
"@sanity/codegen": ["./packages/@sanity/codegen/src/_exports/index.ts"],
"@sanity/mutator": ["./packages/@sanity/mutator/src/index.ts"],
"@sanity/portable-text-editor": ["./packages/@sanity/portable-text-editor/src/index.ts"],
"@sanity/schema/*": ["./packages/@sanity/schema/src/_exports/*"],
"@sanity/schema": ["./packages/@sanity/schema/src/_exports/index.ts"],
"@sanity/migrate": ["./packages/@sanity/migrate/src/_exports/index.ts"],
Expand Down
1 change: 0 additions & 1 deletion packages/@repo/test-exports/.depcheckrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"@sanity/diff",
"@sanity/migrate",
"@sanity/mutator",
"@sanity/portable-text-editor",
"@sanity/schema",
"@sanity/types",
"@sanity/util",
Expand Down
1 change: 0 additions & 1 deletion packages/@repo/test-exports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@sanity/diff": "workspace:*",
"@sanity/migrate": "workspace:*",
"@sanity/mutator": "workspace:*",
"@sanity/portable-text-editor": "workspace:*",
"@sanity/schema": "workspace:*",
"@sanity/types": "workspace:*",
"@sanity/util": "workspace:*",
Expand Down
3 changes: 0 additions & 3 deletions packages/@sanity/portable-text-editor/.depcheckrc.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/@sanity/portable-text-editor/.eslintrc.cjs

This file was deleted.

13 changes: 0 additions & 13 deletions packages/@sanity/portable-text-editor/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions packages/@sanity/portable-text-editor/LICENSE

This file was deleted.

3 changes: 0 additions & 3 deletions packages/@sanity/portable-text-editor/README.md

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9864985

Please sign in to comment.