electron: bundle node-pty properly#21148
Merged
Brendonovich merged 1 commit intobrendan/electron-remove-clifrom Apr 6, 2026
Merged
electron: bundle node-pty properly#21148Brendonovich merged 1 commit intobrendan/electron-remove-clifrom
Brendonovich merged 1 commit intobrendan/electron-remove-clifrom
Conversation
Brendonovich
commented
Apr 6, 2026
Comment on lines
+27
to
+33
| { | ||
| name: "opencode:node-pty-narrower", | ||
| enforce: "pre", | ||
| resolveId(s) { | ||
| if (s === "@lydell/node-pty") return nodePtyPkg | ||
| }, | ||
| }, |
Member
Author
There was a problem hiding this comment.
Lets us avoid the dynamic package requires that @lydell/node-pty does. The platform-specific packages thankfully export the same APIs as the top-level package, so we can just swap any imports and have the same functionality by statically importing just the package we need.
| }, | ||
| "devDependencies": { | ||
| "@actions/artifact": "4.0.0", | ||
| "@lydell/node-pty": "catalog:", |
Member
Author
There was a problem hiding this comment.
Being a dev dependency means that electron packager doesn't include it + all the platform-specific packages in the final bundle
| "@lydell/node-pty-linux-arm64": "1.2.0-beta.10", | ||
| "@lydell/node-pty-linux-x64": "1.2.0-beta.10", | ||
| "@lydell/node-pty-win32-arm64": "1.2.0-beta.10", | ||
| "@lydell/node-pty-win32-x64": "1.2.0-beta.10" |
Member
Author
There was a problem hiding this comment.
Bun will only install the necessary package from this list, not all of them. We'll need to keep this in sync with the other node-pty versions - might make a script.
a8abd82
into
brendan/electron-remove-cli
9 of 12 checks passed
Brendonovich
added a commit
that referenced
this pull request
Apr 6, 2026
Brendonovich
added a commit
that referenced
this pull request
Apr 7, 2026
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.
Configures
@lydell/node-ptyas an external package and ensures that Electron only bundles the specific package needed for each platform