Skip to content

Fix module/exports fields in published @xterm/headless package#6053

Open
yyq1025 wants to merge 1 commit into
xtermjs:masterfrom
yyq1025:fix/headless-published-module-field
Open

Fix module/exports fields in published @xterm/headless package#6053
yyq1025 wants to merge 1 commit into
xtermjs:masterfrom
yyq1025:fix/headless-published-module-field

Conversation

@yyq1025

@yyq1025 yyq1025 commented Jul 15, 2026

Copy link
Copy Markdown

Fixes #6052, fixes #5796

bin/package_headless.js regenerates headless/package.json at publish time by spreading the main package's package.json and only overriding name/description/main/types. The main package's module field (lib/xterm.mjs — a path that only exists in @xterm/xterm) leaks through into every published @xterm/headless, and the exports map from the committed headless/package.json is dropped. Verified broken on 6.0.0 and 6.1.0-beta.289 (npm view @xterm/headless modulelib/xterm.mjs; the tarball has no lib/ 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 — module and exports, matching the committed manifest — fixes it at the source.

Verified by running node bin/package_headless.js and diffing the regenerated headless/package.json against the committed one: main/module/types/exports now all match.

🤖 Generated with Claude Code

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>
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.

Published @xterm/headless has a broken module field and no exports map Wrong module path in package.json file.

1 participant