Repository navigation
fix: declare type declaration dependencies - #3602
Open
iliev-blnk wants to merge 1 commit into
Open
iliev-blnk wants to merge 1 commit into
iliev-blnk wants to merge 1 commit into
Conversation
The published declarations of @react-pdf/font and @react-pdf/textkit import fontkit, whose types come from @types/fontkit, which both list only as a devDependency. textkit and layout also import types from @react-pdf/font without depending on it. Projects that check library declarations (skipLibCheck: false) fail to type-check until they add these themselves. Fixes diegomura#3592
|
@iliev-blnk is attempting to deploy a commit to the diegomura Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 4da1381 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3592
The published declarations import packages that aren't installed for consumers:
@react-pdf/fontfontkit(types from@types/fontkit)@types/fontkitin devDependencies@react-pdf/textkitfontkit,@react-pdf/font@react-pdf/layout@react-pdf/font(HyphenationCallback)This PR moves
@types/fontkittodependenciesin font and textkit, and adds@react-pdf/fontto textkit and layout, as TypeScript's publishing guide recommends.@react-pdf/rendererusers hit this through@react-pdf/types→@react-pdf/font./// <reference types="node" />in textkit resolves without further changes:@types/fontkitdepends on@types/node.Verification
A clean pnpm project using the tsconfig from the issue (
strict,skipLibCheck: false), with packed tarballs of font and textkit, andindex.tsimportingFontStoreand textkit'sParagraphtype:fontkitin font and textkit, TS2688 fornode, TS2580 forBufferfont, textkit and layout tests pass (153 files, 1361 tests).
@react-pdf/render's declarations importpdfkitand@react-pdf/layout, which it only has as devDependencies. I left that out because it would add layout as a runtime dependency of render. I'm happy to include it if you'd like.