chore!: ship ESM only, require node 22.12 - #39
Open
rexxars wants to merge 1 commit into
Open
Conversation
Brings the package in line with the rest of the Portable Text packages, which
are already ESM only on Node.js 22.12 or later. `main` now points at the ESM
entry rather than a CommonJS build, and the `require` condition is gone, so
`pkg-utils` no longer emits `dist/index.cjs`.
There was no `engines` range before, so nothing was enforced.
BREAKING CHANGE: `require("@portabletext/react-pdf")` no longer resolves, since
the CommonJS build is gone. Use `import`, or a dynamic `await import()` from a
CommonJS file. Node.js 22.12 or later is required.
🦋 Changeset detectedLatest commit: 50190f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 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.
Brings this package in line with the rest of the Portable Text packages, which are already ESM only on Node.js 22.12 or later. It was the one that got missed.
Changes
requirecondition is gone fromexports,mainnow points at the ESM entry, andmoduleis removed as redundant under"type": "module".pkg-utilsno longer emitsdist/index.cjs.engines.node: ">=22.12". There was noenginesrange at all before, so nothing was enforced.pkg-utils build --strictrequiresmainto be declared, which is why it points atdist/index.jshere rather than being removed the way it was in@portabletext/toolkit.Breaking
require("@portabletext/react-pdf")no longer resolves. Useimport, or a dynamicawait import()from a CommonJS file.Verification
47 tests pass, lint and type-check clean, and the build output is a single ESM entry with no
.cjs.Unrelated, but worth knowing
While checking whether the
nestLists()fix in@portabletext/toolkit@6.0.0affects this package, I rendered lists that start deeper than level 1 and lists that skip levels, which the fixtures here do not currently cover. No code changes are needed. The output is correct: a level 3 opener gets its roman numeral, indentation follows the item's ownlevel, and the generated intermediate levels draw no markers becausedirectmode fills them with item-less lists andlistDeepcarries no margin.Two things did come up:
@portabletext/reactis on^3.2.4against a current 7.0.1, with an 8.0.0 pending in fix!: nest lists as deeply as their level says react-portabletext#340, and the type-only@portabletext/toolkitdep is on^3.0.0against 6.0.0. Worth planning separately.