zitejs 0.9.22 → 0.9.24

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,7 +69,6 @@ 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',
73
72
  'zod': '__zod__.js',
74
73
  'openai': '__openai__.js',
75
74
  '@anthropic-ai/sdk': '__anthropic__.js',
@@ -251,8 +250,8 @@ function createAliasPlugin(opts) {
251
250
  }
252
251
  return { path: 'zitejs/db', external: true };
253
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
+ // zitejs/runtime is NOT in PREBUNDLED_LIBS — it's a thin fetch()
254
+ // wrapper that gets bundled inline by esbuild (no special handling).
256
255
  for (const [pkgName, modulePath] of Object.entries(PREBUNDLED_LIBS)) {
257
256
  const escapedName = pkgName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
258
257
  const filter = new RegExp(`^${escapedName}$`);
@@ -9,11 +9,20 @@ const ENVIRONMENTS = {
9
9
  staging: 'https://workflows.zitestaging.com',
10
10
  local: 'http://localhost:2506',
11
11
  };
12
+ function getExecutionConfig() {
13
+ return globalThis.__ZITE_EXECUTION_CONFIG__;
14
+ }
12
15
  function getRunnerUrl() {
16
+ const config = getExecutionConfig();
17
+ if (config?.workflowRunnerUrl)
18
+ return config.workflowRunnerUrl;
13
19
  const env = (0, env_js_1.getEnv)('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
14
20
  return (0, env_js_1.getEnv)('ZITE_RUNNER_URL', 'VITE_ZITE_RUNNER_URL') ?? ENVIRONMENTS[env] ?? ENVIRONMENTS.production;
15
21
  }
16
22
  function getToken() {
23
+ const config = getExecutionConfig();
24
+ if (config?.token)
25
+ return config.token;
17
26
  return (0, env_js_1.getEnv)('ZITE_DB_TOKEN', 'VITE_ZITE_DB_TOKEN') ?? '';
18
27
  }
19
28
  async function wrapSdkCall(integrationId, className, methodName, params) {
@@ -33,7 +33,6 @@ 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',
37
36
  'zod': '__zod__.js',
38
37
  'openai': '__openai__.js',
39
38
  '@anthropic-ai/sdk': '__anthropic__.js',
@@ -215,8 +214,8 @@ function createAliasPlugin(opts) {
215
214
  }
216
215
  return { path: 'zitejs/db', external: true };
217
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
+ // zitejs/runtime is NOT in PREBUNDLED_LIBS — it's a thin fetch()
218
+ // wrapper that gets bundled inline by esbuild (no special handling).
220
219
  for (const [pkgName, modulePath] of Object.entries(PREBUNDLED_LIBS)) {
221
220
  const escapedName = pkgName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
222
221
  const filter = new RegExp(`^${escapedName}$`);
@@ -4,11 +4,20 @@ const ENVIRONMENTS = {
4
4
  staging: 'https://workflows.zitestaging.com',
5
5
  local: 'http://localhost:2506',
6
6
  };
7
+ function getExecutionConfig() {
8
+ return globalThis.__ZITE_EXECUTION_CONFIG__;
9
+ }
7
10
  function getRunnerUrl() {
11
+ const config = getExecutionConfig();
12
+ if (config?.workflowRunnerUrl)
13
+ return config.workflowRunnerUrl;
8
14
  const env = getEnv('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
9
15
  return getEnv('ZITE_RUNNER_URL', 'VITE_ZITE_RUNNER_URL') ?? ENVIRONMENTS[env] ?? ENVIRONMENTS.production;
10
16
  }
11
17
  function getToken() {
18
+ const config = getExecutionConfig();
19
+ if (config?.token)
20
+ return config.token;
12
21
  return getEnv('ZITE_DB_TOKEN', 'VITE_ZITE_DB_TOKEN') ?? '';
13
22
  }
14
23
  export async function wrapSdkCall(integrationId, className, methodName, params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.22",
3
+ "version": "0.9.24",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",