@blazen-dev/wasi 0.5.1 → 0.5.3
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 +32 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,30 +1,51 @@
|
|
|
1
1
|
# @blazen-dev/wasi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The single-install Blazen package for Cloudflare Workers, Deno, and any other WASI host. Re-exports [`@blazen-dev/blazen-wasm32-wasi`](https://www.npmjs.com/package/@blazen-dev/blazen-wasm32-wasi) — the napi-rs WASI build of Blazen — and lists the wasm sidecar as a regular dependency so `pnpm add @blazen-dev/wasi` is all you need.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Just install the umbrella package and let it resolve the right sidecar for your host:
|
|
5
|
+
## Install
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
|
|
8
|
+
pnpm add @blazen-dev/wasi
|
|
9
|
+
# or
|
|
10
|
+
npm install @blazen-dev/wasi
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The
|
|
13
|
+
The wasm sidecar (`@blazen-dev/blazen-wasm32-wasi`) is pulled in automatically as a transitive dependency. No second install, no Vite/Rollup workaround plugins, no `ssr.external` lists, no `manualChunks`. Works out of the box with wrangler ≥ 3.15 and `@cloudflare/vite-plugin`.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import {
|
|
19
|
+
CompletionModel,
|
|
20
|
+
EmbeddingModel,
|
|
21
|
+
AnthropicProvider,
|
|
22
|
+
Workflow,
|
|
23
|
+
} from '@blazen-dev/wasi';
|
|
24
|
+
```
|
|
14
25
|
|
|
15
|
-
|
|
26
|
+
The export surface is identical to the main `blazen` package; only the binding implementation differs (wasm32-wasi build instead of a per-platform `.node` binary).
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
## When to use this instead of `blazen`
|
|
29
|
+
|
|
30
|
+
The umbrella `blazen` package targets Node servers and installs a per-platform native `.node` binary. The wasm sidecar is an *optional* peer-dependency there, intentionally kept out of Node-only install footprints. Use this package when:
|
|
31
|
+
|
|
32
|
+
- You're deploying to Cloudflare Workers, Deno Deploy, Fastly Compute, or another WASI host where the native `.node` binary won't load.
|
|
33
|
+
- You want a single `pnpm add` line that pulls everything needed for the target runtime.
|
|
34
|
+
- You want the dependency graph to clearly declare your Workers/edge intent.
|
|
35
|
+
|
|
36
|
+
## Alternative: `blazen/workers` subpath
|
|
37
|
+
|
|
38
|
+
If you'd rather list `blazen` in your dependency tree (mirroring a Node deployment) and explicitly pin the wasm sidecar yourself:
|
|
18
39
|
|
|
19
40
|
```bash
|
|
20
|
-
|
|
41
|
+
pnpm add blazen @blazen-dev/blazen-wasm32-wasi
|
|
21
42
|
```
|
|
22
43
|
|
|
23
44
|
```js
|
|
24
|
-
import {
|
|
45
|
+
import { CompletionModel } from 'blazen/workers';
|
|
25
46
|
```
|
|
26
47
|
|
|
27
|
-
|
|
48
|
+
Both installs are required because the wasm sidecar is an optional peer-dependency on `blazen`. The `blazen/workers` subpath uses the same wrangler-static `import wasm from '@blazen-dev/blazen-wasm32-wasi/blazen.wasm32-wasi.wasm'` loader under the hood as this alias.
|
|
28
49
|
|
|
29
50
|
## Documentation
|
|
30
51
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazen-dev/wasi",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Blazen
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "Single-install Blazen package for Cloudflare Workers, Deno, and any WASI host. Re-exports @blazen-dev/blazen-wasm32-wasi and lists the wasm sidecar as a regular dependency, so `pnpm add @blazen-dev/wasi` is all that's needed. The umbrella `blazen` package targets Node servers and keeps the wasm sidecar out of the default install footprint.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "index.cjs",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"index.d.ts"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@blazen-dev/blazen-wasm32-wasi": "0.5.
|
|
16
|
+
"@blazen-dev/blazen-wasm32-wasi": "0.5.3"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|