Skip to content

🚀 release: ship sqlite runtime safety fix and bundle regression tests - #3

Open
warengonzaga wants to merge 2 commits into
mainfrom
dev
Open

🚀 release: ship sqlite runtime safety fix and bundle regression tests#3
warengonzaga wants to merge 2 commits into
mainfrom
dev

Conversation

@warengonzaga

@warengonzaga warengonzaga commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Promotes devmain with the SQLite runtime safety fix for node-targeted bundles.

Changes

  • src/runtime.ts — Avoid static bun:sqlite loads; guard SQLite adapter behind a runtime check so node-targeted bundles don't fail at import time
  • tests/runtime.test.ts — Add bundle regression test; include openDatabase import to prevent tree-shaking and ensure the Bun SQLite guard is actually exercised; use file:// URL for cross-platform portability
  • README.md — Minor documentation updates

Effort

This was a targeted fix with moderate test work — 3 points.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

)

* 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>
Copilot AI lite review requested due to automatic review settings August 27, 2026 11:43
@warengonzaga warengonzaga added enhancement [Type] New feature or improvement to existing functionality [issues, PRs] core [Area] Core logic, business rules, and primary functionality [issues, PRs] ready [Status] Triaged and ready to be picked up [issues] labels Aug 27, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Workbench Aug 27, 2026
@warengonzaga warengonzaga moved this from Backlog to In Review in Workbench Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Promotes devmain 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:sqlite resolution during bundling.
  • Add a bundling regression test that builds a Node-targeted bundle and verifies it doesn’t contain a static bun:sqlite import.
  • 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.

Comment thread tests/runtime.test.ts Outdated
Comment thread tests/runtime.test.ts
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Area] Core logic, business rules, and primary functionality [issues, PRs] enhancement [Type] New feature or improvement to existing functionality [issues, PRs] ready [Status] Triaged and ready to be picked up [issues]

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants