zitejs 0.9.20 → 0.9.21

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.
@@ -237,12 +237,16 @@ function createAliasPlugin(opts) {
237
237
  return { path: 'zitejs/backend', external: true };
238
238
  });
239
239
  }
240
- // Resolve zitejs/db to .zite/db.ts
240
+ // Resolve zitejs/db to .zite/db.ts — check app dir first, then
241
+ // workspace root (monorepo keeps db.ts at the project root).
241
242
  build.onResolve({ filter: /^zitejs\/db$/ }, () => {
242
243
  if (opts.baseDir) {
243
- const dbPath = path.resolve(opts.baseDir, '.zite/db.ts');
244
- if (fs.existsSync(dbPath))
245
- return { path: dbPath };
244
+ const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
245
+ if (fs.existsSync(appDbPath))
246
+ return { path: appDbPath };
247
+ const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
248
+ if (fs.existsSync(rootDbPath))
249
+ return { path: rootDbPath };
246
250
  }
247
251
  return { path: 'zitejs/db', external: true };
248
252
  });
@@ -201,12 +201,16 @@ function createAliasPlugin(opts) {
201
201
  return { path: 'zitejs/backend', external: true };
202
202
  });
203
203
  }
204
- // Resolve zitejs/db to .zite/db.ts
204
+ // Resolve zitejs/db to .zite/db.ts — check app dir first, then
205
+ // workspace root (monorepo keeps db.ts at the project root).
205
206
  build.onResolve({ filter: /^zitejs\/db$/ }, () => {
206
207
  if (opts.baseDir) {
207
- const dbPath = path.resolve(opts.baseDir, '.zite/db.ts');
208
- if (fs.existsSync(dbPath))
209
- return { path: dbPath };
208
+ const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
209
+ if (fs.existsSync(appDbPath))
210
+ return { path: appDbPath };
211
+ const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
212
+ if (fs.existsSync(rootDbPath))
213
+ return { path: rootDbPath };
210
214
  }
211
215
  return { path: 'zitejs/db', external: true };
212
216
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.20",
3
+ "version": "0.9.21",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",