zitejs 0.9.19 → 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
  });
@@ -364,10 +368,12 @@ async function bundleEndpointsImpl(baseDir, endpointNames) {
364
368
  }
365
369
  }
366
370
  }
367
- console.log(JSON.stringify({
371
+ const output = JSON.stringify({
368
372
  bundledEndpoints,
369
373
  endpointErrors: Object.keys(endpointErrors).length > 0 ? endpointErrors : undefined,
370
- }));
374
+ });
375
+ fs.writeFileSync('/tmp/zitejs-bundle-result.json', output);
376
+ console.log(output);
371
377
  }
372
378
  async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
373
379
  const rawScript = fs.readFileSync(scriptPath, 'utf-8');
@@ -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
  });
@@ -328,10 +332,12 @@ async function bundleEndpointsImpl(baseDir, endpointNames) {
328
332
  }
329
333
  }
330
334
  }
331
- console.log(JSON.stringify({
335
+ const output = JSON.stringify({
332
336
  bundledEndpoints,
333
337
  endpointErrors: Object.keys(endpointErrors).length > 0 ? endpointErrors : undefined,
334
- }));
338
+ });
339
+ fs.writeFileSync('/tmp/zitejs-bundle-result.json', output);
340
+ console.log(output);
335
341
  }
336
342
  async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
337
343
  const rawScript = fs.readFileSync(scriptPath, 'utf-8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.19",
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",