zitejs 0.9.35 → 0.9.37
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.
- package/dist/cjs/bundle/index.js +11 -2
- package/dist/esm/bundle/index.js +11 -2
- package/dist/esm/cli.js +0 -0
- package/package.json +1 -1
- package/dist/cjs/api/index.js +0 -5
- package/dist/cjs/db/index.js +0 -5
- package/dist/esm/api/index.d.ts +0 -2
- package/dist/esm/api/index.js +0 -1
- package/dist/esm/db/index.d.ts +0 -2
- package/dist/esm/db/index.js +0 -1
package/dist/cjs/bundle/index.js
CHANGED
|
@@ -383,7 +383,9 @@ async function bundleEndpointsImpl(baseDir, endpointNames) {
|
|
|
383
383
|
}
|
|
384
384
|
async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
385
385
|
const rawScript = fs.readFileSync(scriptPath, 'utf-8');
|
|
386
|
-
|
|
386
|
+
// baseDir (the app dir — callers cd in before `--script`) lets the alias
|
|
387
|
+
// plugin resolve zitejs/db & zitejs/backend to the generated .zite/ files.
|
|
388
|
+
const plugin = createAliasPlugin({ baseDir: process.cwd(), sdkPath });
|
|
387
389
|
let importSection = '';
|
|
388
390
|
let bodySection = rawScript;
|
|
389
391
|
try {
|
|
@@ -404,7 +406,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
408
|
catch { }
|
|
407
|
-
|
|
409
|
+
// Initialize the worker runtime (sets globalThis.__wrapSdkCall) like the
|
|
410
|
+
// endpoint wrapper does — otherwise createTableClient/createSqlClient from
|
|
411
|
+
// zitejs/db throw "Zite SDK runtime not initialized" at the worker.
|
|
412
|
+
const runtimeInit = `import { __wrapSdkCall, initRuntime } from '@zite/endpoints-runtime-sdk';
|
|
413
|
+
globalThis.__wrapSdkCall = __wrapSdkCall;
|
|
414
|
+
initRuntime();`;
|
|
415
|
+
const wrappedScript = `${runtimeInit}
|
|
416
|
+
${importSection}
|
|
408
417
|
export async function execute() {
|
|
409
418
|
${bodySection}
|
|
410
419
|
}`;
|
package/dist/esm/bundle/index.js
CHANGED
|
@@ -347,7 +347,9 @@ async function bundleEndpointsImpl(baseDir, endpointNames) {
|
|
|
347
347
|
}
|
|
348
348
|
async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
349
349
|
const rawScript = fs.readFileSync(scriptPath, 'utf-8');
|
|
350
|
-
|
|
350
|
+
// baseDir (the app dir — callers cd in before `--script`) lets the alias
|
|
351
|
+
// plugin resolve zitejs/db & zitejs/backend to the generated .zite/ files.
|
|
352
|
+
const plugin = createAliasPlugin({ baseDir: process.cwd(), sdkPath });
|
|
351
353
|
let importSection = '';
|
|
352
354
|
let bodySection = rawScript;
|
|
353
355
|
try {
|
|
@@ -368,7 +370,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
372
|
catch { }
|
|
371
|
-
|
|
373
|
+
// Initialize the worker runtime (sets globalThis.__wrapSdkCall) like the
|
|
374
|
+
// endpoint wrapper does — otherwise createTableClient/createSqlClient from
|
|
375
|
+
// zitejs/db throw "Zite SDK runtime not initialized" at the worker.
|
|
376
|
+
const runtimeInit = `import { __wrapSdkCall, initRuntime } from '@zite/endpoints-runtime-sdk';
|
|
377
|
+
globalThis.__wrapSdkCall = __wrapSdkCall;
|
|
378
|
+
initRuntime();`;
|
|
379
|
+
const wrappedScript = `${runtimeInit}
|
|
380
|
+
${importSection}
|
|
372
381
|
export async function execute() {
|
|
373
382
|
${bodySection}
|
|
374
383
|
}`;
|
package/dist/esm/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/dist/cjs/api/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCaller = void 0;
|
|
4
|
-
var index_js_1 = require("../caller/index.js");
|
|
5
|
-
Object.defineProperty(exports, "createCaller", { enumerable: true, get: function () { return index_js_1.createCaller; } });
|
package/dist/cjs/db/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTableClient = void 0;
|
|
4
|
-
var index_js_1 = require("../runtime/index.js");
|
|
5
|
-
Object.defineProperty(exports, "createTableClient", { enumerable: true, get: function () { return index_js_1.createTableClient; } });
|
package/dist/esm/api/index.d.ts
DELETED
package/dist/esm/api/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createCaller } from '../caller/index.js';
|
package/dist/esm/db/index.d.ts
DELETED
package/dist/esm/db/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createTableClient } from '../runtime/index.js';
|