@seanhogg/builderforce-webcontainers 2026.10.5 → 2026.10.6
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 +5 -5
- package/dist/assets.js +1 -1
- package/dist/check/index.js +1 -1
- package/dist/check/index.js.map +1 -1
- package/dist/check/worker.js +6 -6
- package/dist/host.d.ts +16 -16
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +5 -4
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/processHost.d.ts +7 -8
- package/dist/node/processHost.d.ts.map +1 -1
- package/dist/node/processHost.js +9 -21
- package/dist/node/processHost.js.map +1 -1
- package/dist/node/protocol.d.ts +1 -1
- package/dist/node/protocol.d.ts.map +1 -1
- package/dist/node/worker.js +13 -13
- package/dist/node/workerProcess.js +2 -2
- package/dist/node/workerProcess.js.map +1 -1
- package/dist/process-worker.js +13 -13
- package/package.json +2 -2
- package/src/check/index.ts +1 -1
- package/src/host.ts +24 -22
- package/src/index.ts +3 -3
- package/src/node/processHost.ts +17 -22
- package/src/node/protocol.ts +1 -1
- package/src/node/workerProcess.ts +2 -2
package/README.md
CHANGED
|
@@ -9,19 +9,19 @@ headers, no session caps, MIT licensed.
|
|
|
9
9
|
scope stays off the rest of your app. You can resolve its path with
|
|
10
10
|
`import.meta.resolve('@seanhogg/builderforce-webcontainers/sw.js')`, or copy it
|
|
11
11
|
in your build.
|
|
12
|
-
2.
|
|
12
|
+
2. Start and write the files:
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
|
-
import {
|
|
15
|
+
import { startPreviewRuntime } from '@seanhogg/builderforce-webcontainers';
|
|
16
16
|
|
|
17
|
-
const runtime = await
|
|
18
|
-
runtime.
|
|
17
|
+
const runtime = await startPreviewRuntime({ serviceWorkerUrl: '/__bfwc/sw.js', id: projectId });
|
|
18
|
+
runtime.writeTree(files);
|
|
19
19
|
if (runtime.profile().supported) iframe.src = runtime.url;
|
|
20
20
|
else showFallback(runtime.profile().reason);
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
To run untrusted code (AI-written, arbitrary packages), isolate the preview on its
|
|
24
|
-
own origin with `
|
|
24
|
+
own origin with `startPreviewRuntime({ relayUrl })`. That origin serves
|
|
25
25
|
`relay.html`, `sw.js` and `process-worker.js` (strings in `@seanhogg/builderforce-webcontainers/assets`)
|
|
26
26
|
with `Content-Security-Policy: frame-ancestors` limited to your app. See the
|
|
27
27
|
[root README](../../README.md#isolating-the-preview-relay-mode).
|