fix(store): move SqliteStore export from universal to node entry#10
fix(store): move SqliteStore export from universal to node entry#10niconiconi merged 1 commit intomainfrom
Conversation
SqliteStore depends on node:sqlite and better-sqlite3 which are Node-only modules. Exporting from the universal entry caused them to be bundled into dist/browser.js, breaking Vite 7+ which statically analyzes all dynamic import() calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello, 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 refactors the module exports to properly isolate Node.js-specific components, specifically the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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 moves the SqliteStore export from the universal entry point (src/index.ts) to the Node.js-specific entry point (src/index.node.ts). This change is necessary because SqliteStore has Node.js-specific dependencies, and this refactoring resolves build failures in browser environments like Vite. The changes are accurate and effectively address the described issue.
Summary
SqliteStoreexport fromsrc/index.ts(universal) tosrc/index.node.ts(node-only)node:sqliteandbetter-sqlite3, which are Node-only modulesexport *pulled SqliteStore intodist/browser.js, causing Vite 7+ to fail onimport("sqlite")static analysisBefore
dist/browser.jscontainedimport("sqlite")→ Vite 7 error:After
dist/browser.js: 0 sqlite referencesdist/node.js: SqliteStore fully availabledist/index.js: no longer contains Node-only moduleTest plan
pnpm run type-checkpassespnpm run test— 37/37 files, 115/115 tests passdist/browser.jscontains zero sqlite referencesdist/node.jsstill exports SqliteStore🤖 Generated with Claude Code