prismicio / prismic-client

The official JavaScript + TypeScript client library for Prismic
https://prismic.io/docs/technical-reference/prismicio-client
Apache License 2.0
168 stars 60 forks source link

feat: add `@prismicio/client/richtext` entry #318

Closed angeloashmore closed 11 months ago

angeloashmore commented 1 year ago

Types of changes

Description

This PR adds a new @prismicio/client/richtext entry.

It ports all of @prismicio/richtext to @prismicio/client as an isolated entry. An isolated entry was selected over exporting it adjacent to all other helpers to minimize accidental usage; rich text helpers are low-level functions to be used primarily in high-level framework SDKs, like @prismicio/react and @prismicio/vue.

@prismicio/richtext will be deprecated once this PR is published. All packages dependent on @prismicio/richtext should be upgraded to @prismicio/client/richtext.

For more details behind this PR's motivation, see this thread: https://github.com/prismicio/prismic-richtext/pull/63#discussion_r1296975156

Migration guide

  1. Update to the latest version of @prismicio/client:

    npm install @prismicio/client@latest
  2. Replace all @prismicio/richtext imports with @prismicio/client/richtext:

    - import { serialize } from "@prismicio/richtext";
    + import { serialize } from "@prismicio/client/richtext";
  3. Uninstall @prismicio/richtext:

    npm uninstall @prismicio/richtext

Checklist:

🦕

codecov-commenter commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (b43557d) 99.96% compared to head (f63f65e) 99.97%.

:exclamation: Current head f63f65e differs from pull request most recent head f166735. Consider uploading reports for the commit f166735 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #318 +/- ## ======================================== Coverage 99.96% 99.97% ======================================== Files 50 57 +7 Lines 6251 6794 +543 Branches 332 374 +42 ======================================== + Hits 6249 6792 +543 Misses 2 2 ``` | [Files](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio) | Coverage Δ | | |---|---|---| | [src/helpers/asHTML.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL2hlbHBlcnMvYXNIVE1MLnRz) | `100.00% <100.00%> (ø)` | | | [src/helpers/asText.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL2hlbHBlcnMvYXNUZXh0LnRz) | `100.00% <100.00%> (ø)` | | | [src/index.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | | | [src/lib/serializerHelpers.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL2xpYi9zZXJpYWxpemVySGVscGVycy50cw==) | `100.00% <100.00%> (ø)` | | | [src/richtext/asText.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L2FzVGV4dC50cw==) | `100.00% <100.00%> (ø)` | | | [src/richtext/asTree.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L2FzVHJlZS50cw==) | `100.00% <100.00%> (ø)` | | | [src/richtext/composeSerializers.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L2NvbXBvc2VTZXJpYWxpemVycy50cw==) | `100.00% <100.00%> (ø)` | | | [src/richtext/index.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L2luZGV4LnRz) | `100.00% <100.00%> (ø)` | | | [src/richtext/serialize.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L3NlcmlhbGl6ZS50cw==) | `100.00% <100.00%> (ø)` | | | [src/richtext/types.ts](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio#diff-c3JjL3JpY2h0ZXh0L3R5cGVzLnRz) | `100.00% <100.00%> (ø)` | | | ... and [1 more](https://app.codecov.io/gh/prismicio/prismic-client/pull/318?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=prismicio) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.