fix(build): externalize native clipboard modules#8
Conversation
Native .node binaries from @mariozechner/clipboard-* cannot be bundled. Without --external flag, bun replaces require() with throw Error(), causing pi extension to crash on load. Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Summary of ChangesHello @assagman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial fix for a build configuration problem that was preventing the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a build failure caused by bun build attempting to inline native .node binaries from the @mariozechner/clipboard dependency. The fix, which adds the --external flag for these modules, is appropriate and resolves the issue. For future maintainability, a suggestion to refactor the build command into a separate script has been included, as it aligns with the repository's guidelines for complex build steps.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08ee9d2580
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical build issue where native clipboard modules from the @mariozechner/pi-coding-agent dependency were being incorrectly bundled by bun build, causing runtime failures when loading the pi extension.
Changes:
- Added
--external '@mariozechner/clipboard-*'flag to the build command to preserve native module requires at runtime
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move build logic to scripts/build.ts and externalize native modules. - Improve release and quick-merge documentation with robust polling and security best practices. - Add jq to prerequisites and fix cleanup steps. Signed-off-by: assagman <ahmetsercansagman@gmail.com>
- Move build logic to scripts/build.ts and externalize native modules. - Improve release and quick-merge documentation with robust polling and security best practices. - Add jq to prerequisites and fix cleanup steps. Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Problem
When loading the pi extension, users get:
Root Cause
bun buildcannot inline native.nodebinaries. Without--externalflag, it replacesrequire()withthrow Error(), causing immediate crash on extension load.Fix
Add
--external '@mariozechner/clipboard-*'to the build command to preserve native module requires at runtime.Dependency Chain