sandboxedjs 0.2.14 → 0.2.17

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 CHANGED
@@ -38,6 +38,13 @@ box.dispose();
38
38
  The same line boots in Node and in a page. Nothing is compiled, nothing is downloaded, nothing
39
39
  touches your disk.
40
40
 
41
+ <div align="center">
42
+ <a href="https://sandboxedjs.pages.dev">
43
+ <img src="https://cdn.jsdelivr.net/npm/sandboxedjs@latest/assets/demo.png" alt="SandboxedJS running a full-stack project in a browser" width="720" />
44
+ </a>
45
+ <p>The image you see above is that I am running a full stack project in a static site deployed on cloudlfare pages, which is a CLI to interact with this sandbox, Try it out! <a href="https://sandboxedjs.pages.dev">Try the live demo →</a></p>
46
+ </div>
47
+
41
48
  ## Why
42
49
 
43
50
  Run untrusted or AI-generated code. Give an agent a real shell. Build a browser IDE that actually
@@ -151,8 +158,10 @@ await box.exec("npm install", { cwd: "/app/frontend", timeoutMs: 600_000 });
151
158
 
152
159
  box.spawn("fastapi run", { cwd: "/app/backend" });
153
160
  box.spawn("npm run dev", { cwd: "/app/frontend" });
154
- if (!(await box.waitForPort(8000, { timeoutMs: 60_000 })) ||
155
- !(await box.waitForPort(3000, { timeoutMs: 60_000 }))) {
161
+ if (
162
+ !(await box.waitForPort(8000, { timeoutMs: 60_000 })) ||
163
+ !(await box.waitForPort(3000, { timeoutMs: 60_000 }))
164
+ ) {
156
165
  throw new Error("Check backend and frontend startup logs");
157
166
  }
158
167
 
@@ -187,6 +196,9 @@ its own origin for that proxy before giving up. The guest project needs no proxy
187
196
  the host must deploy the generated function. For a separate relay, set `network.proxy`.
188
197
  A host serving only static files cannot relay APIs that reject browser requests.
189
198
 
199
+ > **Cloudflare Pages:** Dashboard drag-and-drop uploads only see `dist/`. If you deploy a static zip rather than using Git integration, compile `functions/` into `dist/_worker.js` on build:
200
+ > `"build": "vite build && wrangler pages functions build functions --outdir dist/_worker.js"`
201
+
190
202
  | Where you are | What to do |
191
203
  | --------------------------------- | ----------------------------------------------------------------------------------- |
192
204
  | Deployed (Pages, Vercel, Netlify) | `npx sandboxedjs-egress init --allow …`, then deploy |
Binary file
package/dist/index.cjs CHANGED
@@ -21103,7 +21103,7 @@ var wheels_default = {
21103
21103
 
21104
21104
  // package.json
21105
21105
  var package_default = {
21106
- version: "0.2.14"};
21106
+ version: "0.2.17"};
21107
21107
 
21108
21108
  // src/python/extension-abi.ts
21109
21109
  var EXTENSION_ABI = {
package/dist/index.js CHANGED
@@ -21086,7 +21086,7 @@ var wheels_default = {
21086
21086
 
21087
21087
  // package.json
21088
21088
  var package_default = {
21089
- version: "0.2.14"};
21089
+ version: "0.2.17"};
21090
21090
 
21091
21091
  // src/python/extension-abi.ts
21092
21092
  var EXTENSION_ABI = {
@@ -92,8 +92,10 @@ A GET to the deployed probe must return JSON containing
92
92
  paths automatically. Development uses `npx sandboxedjs-egress --allow ollama.com` or
93
93
  `npx sandboxedjs-serve dist`; Vite alone does not execute Pages Functions.
94
94
 
95
- Deploy the function along with the static build. Cloudflare dashboard drag-and-drop does
96
- not compile a `functions` directory: use Git integration or Wrangler from the project root.
95
+ Deploy the function along with the static build. Cloudflare dashboard drag-and-drop only uploads
96
+ `dist/` and does not compile a root `functions/` directory automatically: either deploy via Git integration
97
+ or Wrangler, or compile it into `dist/_worker.js` during build:
98
+ `wrangler pages functions build functions --outdir dist/_worker.js`.
97
99
  See [Cloudflare's deployment documentation](https://developers.cloudflare.com/pages/get-started/direct-upload/).
98
100
 
99
101
  Keep the relay's allowlist narrow and apply your application's authentication and rate limits
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxedjs",
3
- "version": "0.2.14",
3
+ "version": "0.2.17",
4
4
  "description": "A Linux-like container that runs entirely inside Node.js — POSIX shell, ~140 coreutils, Node.js and Python runtimes, virtual filesystem and networking. No Docker, no VM, no native modules.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,6 +55,7 @@
55
55
  "README.md",
56
56
  "LICENSE",
57
57
  "assets/logo.png",
58
+ "assets/demo.png",
58
59
  "docs"
59
60
  ],
60
61
  "scripts": {