Skip to content

Commit cbd234b

Browse files
authoredAug 1, 2024··
feat: remove *AsRichText helpers (#347)
* feat: remove `*AsRichText` helpers The migration-related helpers will be made available through a dedicated package to limit their impact on this core Prismic SDK. * chore: remove staled snapshot --------- Co-authored-by: lihbr <lihbr@users.noreply.github.com>
1 parent 2042e40 commit cbd234b

18 files changed

+44
-3973
lines changed
 

‎package-lock.json

+42-721
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-14
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,7 @@
7979
"test": "npm run lint && npm run types && npm run unit && npm run build && npm run size"
8080
},
8181
"dependencies": {
82-
"hast": "^1.0.0",
83-
"hast-util-select": "^6.0.2",
84-
"hast-util-to-html": "^9.0.1",
85-
"imgix-url-builder": "^0.0.5",
86-
"mdast-util-to-string": "^4.0.0",
87-
"rehype-minify-whitespace": "^6.0.0",
88-
"rehype-parse": "^9.0.0",
89-
"remark-parse": "^11.0.0",
90-
"remark-rehype": "^11.1.0",
91-
"unified": "^11.0.5",
92-
"unist-util-remove": "^4.0.0",
93-
"unist-util-visit": "^5.0.0",
94-
"vfile": "^6.0.2"
82+
"imgix-url-builder": "^0.0.5"
9583
},
9684
"devDependencies": {
9785
"@prismicio/mock": "^0.3.7",
@@ -114,7 +102,7 @@
114102
"standard-version": "^9.5.0",
115103
"ts-expect": "^1.3.0",
116104
"typescript": "^5.5.4",
117-
"vite": "^5.3.4",
105+
"vite": "^5.3.5",
118106
"vite-plugin-sdk": "^0.1.2",
119107
"vitest": "^2.0.4"
120108
},

‎src/errors/PrismicRichTextError.ts

-1
This file was deleted.

‎src/errors/PrismicRichTextSerializerError.ts

-3
This file was deleted.

‎src/helpers/unstable_htmlAsRichText.ts

-122
This file was deleted.

‎src/helpers/unstable_markdownAsRichText.ts

-53
This file was deleted.

‎src/index.ts

-8
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ export { mapSliceZone, unstable_mapSliceZone }
8080

8181
// Conversion helper.
8282
export { documentToLinkField } from "./helpers/documentToLinkField"
83-
export { unstable_htmlAsRichText } from "./helpers/unstable_htmlAsRichText"
84-
export { unstable_markdownAsRichText } from "./helpers/unstable_markdownAsRichText"
8583

8684
export type { LinkResolverFunction } from "./helpers/asLink"
8785
export type { AsLinkAttrsConfig } from "./helpers/asLinkAttrs"
@@ -103,8 +101,6 @@ export type {
103101
}
104102
export type { HTMLRichTextSerializer } from "./helpers/asHTML"
105103

106-
export type { RichTextHTMLMapSerializer } from "./helpers/unstable_htmlAsRichText"
107-
108104
//=============================================================================
109105
// Errors - Custom errors for Prismic APIs.
110106
//=============================================================================
@@ -119,10 +115,6 @@ export { PreviewTokenExpiredError } from "./errors/PreviewTokenExpired"
119115
export { ParsingError } from "./errors/ParsingError"
120116
export { RepositoryNotFoundError } from "./errors/RepositoryNotFoundError"
121117

122-
// Rich Text Errors
123-
export { PrismicRichTextError } from "./errors/PrismicRichTextError"
124-
export { PrismicRichTextSerializerError } from "./errors/PrismicRichTextSerializerError"
125-
126118
//=============================================================================
127119
// Types - Types representing Prismic content, models, and API payloads.
128120
//=============================================================================

‎src/lib/RichTextFieldBuilder.ts

-164
This file was deleted.

‎src/lib/filterRichTextField.ts

-159
This file was deleted.

‎src/lib/hastSerializerHelpers.ts

-157
This file was deleted.

‎src/lib/hastToRichText.ts

-295
This file was deleted.

‎src/lib/rehypeRichText.ts

-184
This file was deleted.

‎test/__snapshots__/helpers-unstable_htmlAsRichText.test.ts.snap

-1,170
This file was deleted.

‎test/__snapshots__/helpers-unstable_markdownAsRichText.test.ts.snap

-31
This file was deleted.

‎test/__testutils__/testAsRichTextHelper.ts

-108
This file was deleted.

‎test/helpers-unstable_htmlAsRichText.test.ts

-502
This file was deleted.

‎test/helpers-unstable_markdownAsRichText.test.ts

-20
This file was deleted.

‎test/lib-filterRichTextField.test.ts

-261
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.