zitejs 0.9.20 → 0.9.22

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.
@@ -69,6 +69,7 @@ const _NODE_BUILTIN_NAMES = [
69
69
  const NODE_BUILTINS = _NODE_BUILTIN_NAMES.flatMap(m => [m, `node:${m}`]);
70
70
  const PREBUNDLED_LIBS = {
71
71
  '@zite/endpoints-runtime-sdk': '__zite-runtime__.js',
72
+ 'zitejs/runtime': '__zite-runtime__.js',
72
73
  'zod': '__zod__.js',
73
74
  'openai': '__openai__.js',
74
75
  '@anthropic-ai/sdk': '__anthropic__.js',
@@ -237,19 +238,21 @@ function createAliasPlugin(opts) {
237
238
  return { path: 'zitejs/backend', external: true };
238
239
  });
239
240
  }
240
- // Resolve zitejs/db to .zite/db.ts
241
+ // Resolve zitejs/db to .zite/db.ts — check app dir first, then
242
+ // workspace root (monorepo keeps db.ts at the project root).
241
243
  build.onResolve({ filter: /^zitejs\/db$/ }, () => {
242
244
  if (opts.baseDir) {
243
- const dbPath = path.resolve(opts.baseDir, '.zite/db.ts');
244
- if (fs.existsSync(dbPath))
245
- return { path: dbPath };
245
+ const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
246
+ if (fs.existsSync(appDbPath))
247
+ return { path: appDbPath };
248
+ const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
249
+ if (fs.existsSync(rootDbPath))
250
+ return { path: rootDbPath };
246
251
  }
247
252
  return { path: 'zitejs/db', external: true };
248
253
  });
249
- // Resolve zitejs/runtime
250
- build.onResolve({ filter: /^zitejs\/runtime$/ }, () => {
251
- return { path: 'zitejs/runtime', external: true };
252
- });
254
+ // zitejs/runtime is prebundled as __zite-runtime__.js in the worker —
255
+ // handled by the PREBUNDLED_LIBS loop below, no special case needed.
253
256
  for (const [pkgName, modulePath] of Object.entries(PREBUNDLED_LIBS)) {
254
257
  const escapedName = pkgName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
255
258
  const filter = new RegExp(`^${escapedName}$`);
@@ -33,6 +33,7 @@ const _NODE_BUILTIN_NAMES = [
33
33
  const NODE_BUILTINS = _NODE_BUILTIN_NAMES.flatMap(m => [m, `node:${m}`]);
34
34
  const PREBUNDLED_LIBS = {
35
35
  '@zite/endpoints-runtime-sdk': '__zite-runtime__.js',
36
+ 'zitejs/runtime': '__zite-runtime__.js',
36
37
  'zod': '__zod__.js',
37
38
  'openai': '__openai__.js',
38
39
  '@anthropic-ai/sdk': '__anthropic__.js',
@@ -201,19 +202,21 @@ function createAliasPlugin(opts) {
201
202
  return { path: 'zitejs/backend', external: true };
202
203
  });
203
204
  }
204
- // Resolve zitejs/db to .zite/db.ts
205
+ // Resolve zitejs/db to .zite/db.ts — check app dir first, then
206
+ // workspace root (monorepo keeps db.ts at the project root).
205
207
  build.onResolve({ filter: /^zitejs\/db$/ }, () => {
206
208
  if (opts.baseDir) {
207
- const dbPath = path.resolve(opts.baseDir, '.zite/db.ts');
208
- if (fs.existsSync(dbPath))
209
- return { path: dbPath };
209
+ const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
210
+ if (fs.existsSync(appDbPath))
211
+ return { path: appDbPath };
212
+ const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
213
+ if (fs.existsSync(rootDbPath))
214
+ return { path: rootDbPath };
210
215
  }
211
216
  return { path: 'zitejs/db', external: true };
212
217
  });
213
- // Resolve zitejs/runtime
214
- build.onResolve({ filter: /^zitejs\/runtime$/ }, () => {
215
- return { path: 'zitejs/runtime', external: true };
216
- });
218
+ // zitejs/runtime is prebundled as __zite-runtime__.js in the worker —
219
+ // handled by the PREBUNDLED_LIBS loop below, no special case needed.
217
220
  for (const [pkgName, modulePath] of Object.entries(PREBUNDLED_LIBS)) {
218
221
  const escapedName = pkgName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
219
222
  const filter = new RegExp(`^${escapedName}$`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",