Skip to content

Commit 4944f3a

Browse files
committed
fix: promote runtime & driver deps to fix npm install bootstrap
1 parent d553449 commit 4944f3a

5 files changed

Lines changed: 80 additions & 28 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
Promote native database client packages so npm consumers can boot without manual installs.
6+
7+
- `better-sqlite3` is now an `optionalDependency` (prebuilt binaries cover the common case), so `npx @objectstack/cli start` boots a default SQLite database out-of-the-box.
8+
- `pg`, `mysql2`, `sqlite3`, and `tedious` are declared as optional `peerDependencies` (`peerDependenciesMeta.optional = true`), removing install warnings while keeping the loader-on-demand pattern.
9+
10+
Fixes: `Knex: Cannot find module 'better-sqlite3'` on fresh `npm install @objectstack/cli` followed by `objectstack start`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"@objectstack/runtime": patch
3+
"@objectstack/cli": patch
4+
---
5+
6+
Fix `npx @objectstack/cli start` crashing with `Cannot find package
7+
'@objectstack/metadata'` (and friends).
8+
9+
`@objectstack/runtime` dynamically `import()`s `@objectstack/metadata`,
10+
`@objectstack/objectql`, and the storage drivers (`driver-memory`,
11+
`driver-sql`, `driver-sqlite-wasm`, `driver-turso`) from
12+
`createStandaloneStack` / `createDefaultHostConfig`, but they were only
13+
listed in `devDependencies` — so when the package was installed from npm
14+
(rather than the workspace) these imports failed at boot.
15+
16+
They are now declared as real `dependencies`. `@objectstack/driver-mongodb`
17+
remains an `optionalDependency` because the standalone stack only loads
18+
it when the user passes a `mongodb://` URL (the failure path already has
19+
a friendly error message).
20+
21+
Also adds a small quick-start CLI command (`objectstack start`) that
22+
auto-creates `~/.objectstack/{data,dist,auth-secret}`, boots an empty
23+
kernel with Studio + marketplace mounted, and lets users install apps at
24+
runtime — no `objectstack.config.ts` required.

packages/plugins/driver-sql/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@
2323
"knex": "^3.2.10",
2424
"nanoid": "^5.1.11"
2525
},
26+
"optionalDependencies": {
27+
"better-sqlite3": "^12.10.0"
28+
},
29+
"peerDependencies": {
30+
"mysql2": "^3.0.0",
31+
"pg": "^8.0.0",
32+
"sqlite3": "^5.0.0",
33+
"tedious": "^18.0.0"
34+
},
35+
"peerDependenciesMeta": {
36+
"mysql2": { "optional": true },
37+
"pg": { "optional": true },
38+
"sqlite3": { "optional": true },
39+
"tedious": { "optional": true }
40+
},
2641
"devDependencies": {
2742
"@types/node": "^25.9.1",
2843
"better-sqlite3": "^12.10.0",

packages/runtime/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
},
2121
"dependencies": {
2222
"@objectstack/core": "workspace:*",
23+
"@objectstack/driver-memory": "workspace:*",
24+
"@objectstack/driver-sql": "workspace:*",
25+
"@objectstack/driver-sqlite-wasm": "workspace:*",
26+
"@objectstack/driver-turso": "workspace:*",
2327
"@objectstack/formula": "workspace:*",
28+
"@objectstack/metadata": "workspace:*",
29+
"@objectstack/objectql": "workspace:*",
2430
"@objectstack/observability": "workspace:*",
2531
"@objectstack/plugin-auth": "workspace:*",
2632
"@objectstack/plugin-security": "workspace:*",
@@ -32,14 +38,10 @@
3238
"quickjs-emscripten": "^0.32.0",
3339
"zod": "^4.4.3"
3440
},
41+
"optionalDependencies": {
42+
"@objectstack/driver-mongodb": "workspace:*"
43+
},
3544
"devDependencies": {
36-
"@objectstack/driver-memory": "workspace:*",
37-
"@objectstack/driver-mongodb": "workspace:*",
38-
"@objectstack/driver-sql": "workspace:*",
39-
"@objectstack/driver-sqlite-wasm": "workspace:*",
40-
"@objectstack/driver-turso": "workspace:*",
41-
"@objectstack/metadata": "workspace:*",
42-
"@objectstack/objectql": "workspace:*",
4345
"typescript": "^6.0.3",
4446
"vitest": "^4.1.7"
4547
},

pnpm-lock.yaml

Lines changed: 22 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)