bunderstack 0.24.0 → 0.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -0
  3. package/dist/auth.d.ts +20 -9
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +3 -8
  6. package/dist/auth.js.map +1 -1
  7. package/dist/backend.d.ts +4 -4
  8. package/dist/backend.d.ts.map +1 -1
  9. package/dist/backend.js.map +1 -1
  10. package/dist/config.d.ts +10 -6
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js.map +1 -1
  13. package/dist/provision-internals.d.ts +1 -1
  14. package/dist/provision-internals.js +1 -1
  15. package/dist/provision-internals.js.map +1 -1
  16. package/dist/provision-runtime.d.ts +7 -0
  17. package/dist/provision-runtime.d.ts.map +1 -0
  18. package/dist/provision-runtime.js +50 -0
  19. package/dist/provision-runtime.js.map +1 -0
  20. package/dist/provision-schema.d.ts +16 -0
  21. package/dist/provision-schema.d.ts.map +1 -0
  22. package/dist/provision-schema.js +63 -0
  23. package/dist/provision-schema.js.map +1 -0
  24. package/dist/provision.d.ts +4 -21
  25. package/dist/provision.d.ts.map +1 -1
  26. package/dist/provision.js +10 -111
  27. package/dist/provision.js.map +1 -1
  28. package/dist/runtime.d.ts +9 -7
  29. package/dist/runtime.d.ts.map +1 -1
  30. package/dist/runtime.js +2 -3
  31. package/dist/runtime.js.map +1 -1
  32. package/dist/testing/fixture.d.ts +1 -1
  33. package/dist/testing/fixture.d.ts.map +1 -1
  34. package/dist/testing/fixture.js +1 -1
  35. package/dist/testing/fixture.js.map +1 -1
  36. package/llms-full.txt +416 -226
  37. package/llms.txt +4 -3
  38. package/package.json +5 -1
  39. package/skills/creating-bunderstack-apps/references/verification.md +7 -6
  40. package/skills/migrating-to-bunderstack/SKILL.md +22 -20
  41. package/skills/migrating-to-bunderstack/references/runtime-replacements.md +4 -3
package/llms.txt CHANGED
@@ -41,9 +41,10 @@ MINIMAL APP
41
41
 
42
42
  The blueprint imports the backend declaration and never starts the runtime.
43
43
  Database adapters are imported from their own entry points: libsql(),
44
- pglite(), bunSql(), postgresJs(). Provisioning: `await provision(app)` pushes
45
- the schema in development and applies committed migrations once a migrations/
46
- folder exists.
44
+ pglite(), bunSql(), postgresJs(). Production provisioning imports
45
+ `provision(app)` from `bunderstack/provision` and requires committed migrations;
46
+ that entrypoint never imports Drizzle Kit. Development schema push imports the
47
+ same function name from `bunderstack/provision-schema` instead.
47
48
 
48
49
  DECLARING AN API
49
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunderstack",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "Batteries-included backend framework for Bun: type-safe oRPC APIs, auth, storage, realtime, jobs, messaging, and validated env from one declaration.",
5
5
  "keywords": [
6
6
  "backend",
@@ -77,6 +77,10 @@
77
77
  "types": "./dist/provision.d.ts",
78
78
  "default": "./dist/provision.js"
79
79
  },
80
+ "./provision-schema": {
81
+ "types": "./dist/provision-schema.d.ts",
82
+ "default": "./dist/provision-schema.js"
83
+ },
80
84
  "./testing": {
81
85
  "types": "./dist/testing.d.ts",
82
86
  "default": "./dist/testing.js"
@@ -17,9 +17,10 @@ the configured Bunderstack entry. Set `package.json#bunderstack.entry` when the
17
17
  entry is not `src/bunderstack.ts`. `bun run blueprint:check` must pass in CI so
18
18
  the committed declaration matches the application.
19
19
 
20
- Before production, generate and commit the Drizzle `migrations/` folder. With
21
- no migrations folder, `provision(app)` uses the development schema-push loop
22
- (and needs drizzle-kit). Once migrations are committed, it applies pending
23
- migrations without importing drizzle-kit. Keep the generated migrations,
24
- blueprint, tests, worker entry, API mount, and deployment scripts under version
25
- control; never commit secrets, databases, uploads, or build output.
20
+ Before production, generate and commit the Drizzle `migrations/` folder.
21
+ `provision(app)` from `bunderstack/provision` only applies committed
22
+ migrations and never imports drizzle-kit. For the local schema-push loop, import
23
+ `provision` from `bunderstack/provision-schema`; that development-only
24
+ entrypoint requires drizzle-kit. Keep the generated migrations, blueprint,
25
+ tests, worker entry, API mount, and deployment scripts under version control;
26
+ never commit secrets, databases, uploads, or build output.
@@ -55,25 +55,26 @@ export type App = typeof app
55
55
 
56
56
  All Bunderstack capabilities are imported directly from single-segment subpaths of `bunderstack`:
57
57
 
58
- | Subpath Import | Purpose |
59
- | -------------------------- | ------------------------------------------------------------------------------------- |
60
- | `bunderstack` | Core backend builder (`bunderstack`, `defineApi`, `defineAccess`, `BunderstackError`) |
61
- | `bunderstack/libsql` | libSQL / SQLite database adapter |
62
- | `bunderstack/postgres-js` | postgres.js database adapter |
63
- | `bunderstack/bun-sql` | `Bun.sql` Postgres adapter |
64
- | `bunderstack/pglite` | PGlite in-memory / embedded Postgres adapter |
65
- | `bunderstack/client` | Framework-neutral typed client & `createLiveView` |
66
- | `bunderstack/client-react` | React LiveView hook (`useLiveView`) |
67
- | `bunderstack/client-rest` | Type-safe REST client |
68
- | `bunderstack/query` | TanStack Query integration (`createClient`, `syncRealtime`) |
69
- | `bunderstack/query-react` | React-specific query helpers |
70
- | `bunderstack/sync` | TanStack DB realtime sync collections |
71
- | `bunderstack/start` | TanStack Start integration (`createApiHandlers`) |
72
- | `bunderstack/start-auth` | Better Auth client for TanStack Start |
73
- | `bunderstack/provision` | Database schema provisioning (`provision(app)`) |
74
- | `bunderstack/testing` | Test fixture helpers |
75
- | `bunderstack/schema` | Internal system tables (`export * from 'bunderstack/schema'`) |
76
- | `bunderstack/typeid` | TypeID column types & generators |
58
+ | Subpath Import | Purpose |
59
+ | ------------------------------ | ------------------------------------------------------------------------------------- |
60
+ | `bunderstack` | Core backend builder (`bunderstack`, `defineApi`, `defineAccess`, `BunderstackError`) |
61
+ | `bunderstack/libsql` | libSQL / SQLite database adapter |
62
+ | `bunderstack/postgres-js` | postgres.js database adapter |
63
+ | `bunderstack/bun-sql` | `Bun.sql` Postgres adapter |
64
+ | `bunderstack/pglite` | PGlite in-memory / embedded Postgres adapter |
65
+ | `bunderstack/client` | Framework-neutral typed client & `createLiveView` |
66
+ | `bunderstack/client-react` | React LiveView hook (`useLiveView`) |
67
+ | `bunderstack/client-rest` | Type-safe REST client |
68
+ | `bunderstack/query` | TanStack Query integration (`createClient`, `syncRealtime`) |
69
+ | `bunderstack/query-react` | React-specific query helpers |
70
+ | `bunderstack/sync` | TanStack DB realtime sync collections |
71
+ | `bunderstack/start` | TanStack Start integration (`createApiHandlers`) |
72
+ | `bunderstack/start-auth` | Better Auth client for TanStack Start |
73
+ | `bunderstack/provision` | Production provisioning from committed migrations |
74
+ | `bunderstack/provision-schema` | Development-only schema push through Drizzle Kit |
75
+ | `bunderstack/testing` | Test fixture helpers |
76
+ | `bunderstack/schema` | Internal system tables (`export * from 'bunderstack/schema'`) |
77
+ | `bunderstack/typeid` | TypeID column types & generators |
77
78
 
78
79
  ---
79
80
 
@@ -387,11 +388,12 @@ throw new BunderstackError('FORBIDDEN', 'Quota exceeded')
387
388
  ### Development vs. Production Lifecycle
388
389
 
389
390
  1. **Local Development (No Migrations Folder):**
390
- - In dev, `await provision(app)` automatically pushes the schema to the SQLite/libSQL/Postgres database.
391
+ - Import `provision` from `bunderstack/provision-schema`; it pushes the schema to the SQLite/libSQL/Postgres database.
391
392
  - Developers can rapidly prototype and iterate on table schemas without generating migrations on every change.
392
393
 
393
394
  2. **Production & Bunderhost Deployments (MANDATORY Migrations):**
394
395
  - **Committed migrations are strictly mandatory for production deployments.**
396
+ - Import `provision` from `bunderstack/provision`; it contains no Drizzle Kit import edge and fails clearly when the migration journal is missing.
395
397
  - Bunderhost will **NOT** run schema push in production; deployment will fail if committed migrations in `migrations/` are missing or out of date.
396
398
 
397
399
  ### CRITICAL MIGRATION RULES
@@ -255,9 +255,10 @@ with names and safe placeholders only.
255
255
 
256
256
  ## Provisioning, migrations, and blueprint
257
257
 
258
- `provision(app)` uses the development schema-push loop while no `migrations/`
259
- folder exists, and applies committed migrations once one does. Generate and
260
- commit migrations before production:
258
+ `provision(app)` from `bunderstack/provision` applies committed migrations
259
+ without importing Drizzle Kit and fails when the journal is absent. During
260
+ local prototyping, import it from `bunderstack/provision-schema` to use the
261
+ development schema-push loop. Generate and commit migrations before production:
261
262
 
262
263
  ```json
263
264
  {