sandboxedjs 0.1.55 → 0.1.57
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/README.md +22 -2
- package/dist/index.cjs +23 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/python/python.data +278 -268
- package/dist/python/python.js +1 -1
- package/dist/python/python.wasm +0 -0
- package/dist/python/runtime.json +3 -3
- package/dist/python/wheels/index.json +42 -0
- package/dist/python/wheels/pydantic_core-2.23.2-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/pydantic_core-2.46.5-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/sbx_c_probe-1.0.0-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/sbx_rust_probe-1.0.0-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python-abi.cjs +6 -0
- package/dist/python-abi.cjs.map +1 -1
- package/dist/python-abi.d.cts +2 -0
- package/dist/python-abi.d.ts +2 -0
- package/dist/python-abi.js +6 -0
- package/dist/python-abi.js.map +1 -1
- package/dist/python-worker.js +80 -5
- package/dist/python-worker.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17918,7 +17918,15 @@ var bundledManifest = {
|
|
|
17918
17918
|
persistence: "memory"
|
|
17919
17919
|
}
|
|
17920
17920
|
};
|
|
17921
|
-
var
|
|
17921
|
+
var bundledWheelIndex = (typeof process !== "undefined" && process.versions?.node ? new URL(
|
|
17922
|
+
import.meta.url.includes("/src/runtime/python/") ? "../../../dist/python/wheels/" : "./python/wheels/",
|
|
17923
|
+
import.meta.url
|
|
17924
|
+
) : new URL("/python/wheels/", globalThis.location?.href ?? import.meta.url)).href;
|
|
17925
|
+
var config = {
|
|
17926
|
+
backend: "sbx-cpython-wasm",
|
|
17927
|
+
manifest: bundledManifest,
|
|
17928
|
+
wheelIndex: bundledWheelIndex
|
|
17929
|
+
};
|
|
17922
17930
|
function setPythonBackend(options) {
|
|
17923
17931
|
if (options.wheelIndex !== void 0) config.wheelIndex = options.wheelIndex;
|
|
17924
17932
|
if (options.manifest !== void 0) config.manifest = validateManifest(options.manifest);
|
|
@@ -20387,6 +20395,17 @@ environments. A package with no usable wheel is an error, never a silent skip.`,
|
|
|
20387
20395
|
}
|
|
20388
20396
|
const cache = /* @__PURE__ */ new Map();
|
|
20389
20397
|
const request = async (url, timeoutMs, read) => {
|
|
20398
|
+
if (url.startsWith("file:")) {
|
|
20399
|
+
try {
|
|
20400
|
+
const [{ readFile }, { fileURLToPath: fileURLToPath2 }] = await Promise.all([
|
|
20401
|
+
nodeBuiltin("fs/promises"),
|
|
20402
|
+
nodeBuiltin("url")
|
|
20403
|
+
]);
|
|
20404
|
+
return await read(new Response(await readFile(fileURLToPath2(url))));
|
|
20405
|
+
} catch (error) {
|
|
20406
|
+
throw new Error(`could not read bundled wheel asset ${url}: ${error.message}`);
|
|
20407
|
+
}
|
|
20408
|
+
}
|
|
20390
20409
|
const controller = new AbortController();
|
|
20391
20410
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
20392
20411
|
try {
|
|
@@ -20423,7 +20442,9 @@ environments. A package with no usable wheel is an error, never a silent skip.`,
|
|
|
20423
20442
|
const loaded = await client.json(`${url}/index.json`);
|
|
20424
20443
|
index = { baseUrl: url, wheels: loaded.wheels ?? [] };
|
|
20425
20444
|
} catch (error) {
|
|
20426
|
-
return ctx.fail(
|
|
20445
|
+
return ctx.fail(
|
|
20446
|
+
`could not read the wheel index at ${configured}: ${error.message}. When running under a bundler such as Vite, publish dist/python/wheels as a static asset and configurePython({ wheelIndex: '/python/wheels' }) before creating the container.`
|
|
20447
|
+
);
|
|
20427
20448
|
}
|
|
20428
20449
|
} else if (configured) {
|
|
20429
20450
|
index = configured;
|