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

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

Merged
merged 5 commits into from
Oct 6, 2023
Merged

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Aug 21, 2023

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

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: prismicio/prismic-richtext#63 (comment)

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:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🦕

@angeloashmore angeloashmore marked this pull request as ready for review August 21, 2023 21:36
@angeloashmore angeloashmore requested a review from lihbr August 21, 2023 21:36
Copy link
Member

@lihbr lihbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we need to declare the new entry point in the package.json, remove the dependency on @prismicio/richtext and refactor helpers to use the internal one no? Or do you want to do that in another PR?

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

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

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

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

Additional details and impacted files
@@           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 Coverage Δ
src/helpers/asHTML.ts 100.00% <100.00%> (ø)
src/helpers/asText.ts 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/lib/serializerHelpers.ts 100.00% <100.00%> (ø)
src/richtext/asText.ts 100.00% <100.00%> (ø)
src/richtext/asTree.ts 100.00% <100.00%> (ø)
src/richtext/composeSerializers.ts 100.00% <100.00%> (ø)
src/richtext/index.ts 100.00% <100.00%> (ø)
src/richtext/serialize.ts 100.00% <100.00%> (ø)
src/richtext/types.ts 100.00% <100.00%> (ø)
... and 1 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@angeloashmore angeloashmore merged commit fb555fd into master Oct 6, 2023
@angeloashmore angeloashmore deleted the aa/richtext branch October 6, 2023 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants