Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/fix-build-optional-driver-bundling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@objectstack/plugin-dev": patch
"@objectstack/service-datasource": patch
---

fix(build): don't bundle lazily-imported optional drivers (fixes build break from #1524).

After moving optional internal `@objectstack/*` peerDependencies off `peer` (to
stop the changesets fixed-group major cascade), tsup no longer auto-externalized
them and began bundling the lazily `await import()`-ed driver packages — pulling
in their optional native clients (`mysql` / `oracledb` via knex) and failing the
build. Fix: `service-datasource` externalizes `@objectstack/driver-*` in tsup
(kept as devDeps for tests); `plugin-dev` moves its framework packages to
`dependencies` (auto-externalized; it's a dev-only plugin). Full build green.
8 changes: 4 additions & 4 deletions packages/plugins/plugin-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"dependencies": {
"@objectstack/core": "workspace:*",
"@objectstack/spec": "workspace:*",
"@objectstack/types": "workspace:*"
},
"devDependencies": {
"@objectstack/types": "workspace:*",
"@objectstack/driver-memory": "workspace:^",
"@objectstack/objectql": "workspace:^",
"@objectstack/plugin-auth": "workspace:^",
Expand All @@ -30,7 +28,9 @@
"@objectstack/plugin-security": "workspace:^",
"@objectstack/rest": "workspace:^",
"@objectstack/runtime": "workspace:^",
"@objectstack/service-i18n": "workspace:^",
"@objectstack/service-i18n": "workspace:^"
},
"devDependencies": {
"@types/node": "^25.9.1",
"typescript": "^6.0.3",
"vitest": "^4.1.8"
Expand Down
7 changes: 6 additions & 1 deletion packages/services/service-datasource/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ export default defineConfig({
dts: true,
format: ['esm', 'cjs'],
target: 'es2020',
external: ['vitest'],
// Driver packages are loaded via optional, lazy `await import('@objectstack/driver-*')`
// (default-datasource-driver-factory) — and pull in optional native clients
// (mysql / pg / better-sqlite3 / mongodb). They must stay EXTERNAL so esbuild
// never tries to bundle/resolve those optional natives. (They are devDeps for
// tests; previously they were optional peerDeps, which tsup auto-externalized.)
external: ['vitest', /^@objectstack\/driver-/],
});
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.