🚀 release: ship sqlite runtime safety fix and bundle regression tests - #3
Open
warengonzaga wants to merge 2 commits into
Open
🚀 release: ship sqlite runtime safety fix and bundle regression tests#3warengonzaga wants to merge 2 commits into
warengonzaga wants to merge 2 commits into
Conversation
) * Initial plan * 🔧 update (runtime): avoid static bun sqlite loads Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> * 🧪 test: tighten runtime bundle regression check Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> * 🧪 test: include openDatabase import to prevent tree-shaking in bundle test - Import openDatabase alongside isBun so the bundler cannot eliminate the SQLite adapter code, ensuring bun:sqlite guard is actually tested - Switch to file:// URL for runtime path for cross-platform portability Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> Co-authored-by: Waren Gonzaga <opensource@warengonzaga.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Promotes dev → main to fix Node-targeted bundling safety around the Bun SQLite adapter, ensuring consumers don’t fail at import time due to bun:* handling.
Changes:
- Update the Bun SQLite adapter loading to avoid static
bun:sqliteresolution during bundling. - Add a bundling regression test that builds a Node-targeted bundle and verifies it doesn’t contain a static
bun:sqliteimport. - Document the runtime-only loading behavior for the Bun SQLite backend.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/runtime.ts |
Switches to createRequire and constructs the Bun SQLite specifier at runtime to prevent static bun:* imports in Node-targeted bundles. |
tests/runtime.test.ts |
Adds a regression test that bundles for Node and inspects/executes the output to validate the guard behavior. |
README.md |
Clarifies that Bun SQLite is loaded at runtime so Node bundles can safely consume the package. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.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.
Summary
Promotes
dev→mainwith the SQLite runtime safety fix for node-targeted bundles.Changes
src/runtime.ts— Avoid staticbun:sqliteloads; guard SQLite adapter behind a runtime check so node-targeted bundles don't fail at import timetests/runtime.test.ts— Add bundle regression test; includeopenDatabaseimport to prevent tree-shaking and ensure the Bun SQLite guard is actually exercised; usefile://URL for cross-platform portabilityREADME.md— Minor documentation updatesEffort
This was a targeted fix with moderate test work — 3 points.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.