Fix module/exports fields in published @xterm/headless package#6053
Open
yyq1025 wants to merge 1 commit into
Open
Fix module/exports fields in published @xterm/headless package#6053yyq1025 wants to merge 1 commit into
yyq1025 wants to merge 1 commit into
Conversation
package_headless.js spreads the main package.json and only overrode
name/description/main/types, so the main package's module field
("lib/xterm.mjs" — nonexistent in the headless package) leaked into
every published @xterm/headless, and the exports map was dropped.
Override module and exports too, matching the committed
headless/package.json.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 #6052, fixes #5796
bin/package_headless.jsregeneratesheadless/package.jsonat publish time by spreading the main package's package.json and only overridingname/description/main/types. The main package'smodulefield (lib/xterm.mjs— a path that only exists in@xterm/xterm) leaks through into every published@xterm/headless, and theexportsmap from the committedheadless/package.jsonis dropped. Verified broken on6.0.0and6.1.0-beta.289(npm view @xterm/headless module→lib/xterm.mjs; the tarball has nolib/directory).This is also why #5442 (which fixed the same bug, reported in #5441) regressed: it corrected the committed
headless/package.json, but the publish script clobbers that file on every release. Patching the script's overrides —moduleandexports, matching the committed manifest — fixes it at the source.Verified by running
node bin/package_headless.jsand diffing the regeneratedheadless/package.jsonagainst the committed one:main/module/types/exportsnow all match.🤖 Generated with Claude Code