chore: use rolldown for packaging#922
Merged
SamTV12345 merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
Review Summary by QodoMigrate from Rollup to Rolldown for package bundling
WalkthroughsDescription• Replace Rollup with Rolldown for faster bundling • Remove Rollup plugin dependencies and configuration • Add separate TypeScript declaration generation step • Add GitHub Actions CI workflow for automated testing Diagramflowchart LR
A["Rollup + Plugins"] -->|"Remove"| B["Old Build System"]
C["Rolldown"] -->|"Add"| D["New Build System"]
E["TypeScript"] -->|"Add"| F["Declaration Generation"]
D -->|"Output"| G["dist/"]
F -->|"Output"| G
H["GitHub Actions"] -->|"Add"| I["CI Pipeline"]
File Changes1. rollup.config.cjs.js
|
Code Review by Qodo
|
Comment on lines
+5
to
+13
| input: ['./index.ts'], | ||
| // Keep third-party modules external for a Node library build. | ||
| external: (id) => !id.startsWith('.') && !path.isAbsolute(id), | ||
| output: { | ||
| preserveModules: false, | ||
| dir: './dist', | ||
| format: 'cjs', | ||
| exports: 'named', | ||
| }, |
There was a problem hiding this comment.
1. Missing runtime dependencies 🐞 Bug ≡ Correctness
rolldown.config.mjs externalizes every non-relative import, so the built dist/index.js will keep
require('mysql2'), require('pg'), etc. Because package.json declares these runtime driver
packages only in devDependencies (and has no dependencies/optionalDependencies), consumers can get
MODULE_NOT_FOUND just by importing ueberdb2.
Agent Prompt
### Issue description
`rolldown.config.mjs` externalizes all third-party imports, which makes the output bundle rely on runtime-installed DB driver packages (e.g., `mysql2`, `pg`, `mssql`, etc.). The package does not declare these as `dependencies`/`optionalDependencies`, so consumers may hit `MODULE_NOT_FOUND` on import.
### Issue Context
- `index.ts` imports all DB implementations.
- DB implementation modules import their driver packages at module scope.
- `rolldown` is configured to keep all non-relative imports external.
### Fix Focus Areas
- rolldown.config.mjs[4-13]
- index.ts[20-40]
- databases/mysql_db.ts[17-21]
- package.json[25-56]
### What to change
Choose one consistent strategy:
1) **Bundle runtime deps (closest to prior rollup-bundle behavior):** remove/relax the `external` function so DB drivers are bundled into `dist/index.js`.
- If you still want externals, externalize **only Node built-ins** (e.g., `node:*`, `fs`, `path`, etc.), not npm packages.
2) **Keep externals but make installs correct:**
- Move runtime-needed drivers from `devDependencies` to `dependencies` (or `optionalDependencies`/`peerDependencies`), and
- Refactor to lazy-load DB drivers/implementations (so users don’t need every driver installed just to import the package).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
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.
No description provided.