@stll/anonymize-wasm 2.5.0 → 2.6.0
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 +11 -20
- package/dist/native/index.js +1785 -0
- package/dist/native/{index.wasm32-wasi.wasm → index_bg.wasm} +0 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/dist/wasm.d.mts +80 -72
- package/dist/wasm.mjs +239 -106
- package/dist/wasm.mjs.map +1 -1
- package/package.json +1 -4
- package/dist/native/index.wasi-browser.js +0 -12020
- package/dist/native/index.wasi.cjs +0 -132
- package/dist/native/wasi-worker-browser.mjs +0 -10766
- package/dist/native/wasi-worker.mjs +0 -63
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ const pipeline = await loadPipeline(
|
|
|
36
36
|
);
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
With Vite, register the helper plugin so the wasm binary,
|
|
39
|
+
With Vite, register the helper plugin so the wasm binary, ESM glue, and
|
|
40
40
|
`.stlanonpkg` assets survive both dependency pre-bundling (dev) and a
|
|
41
41
|
production `vite build` (the plugin emits the `native/` assets and rewrites the
|
|
42
42
|
runtime asset base to point at them):
|
|
@@ -49,8 +49,8 @@ import stllAnonymizeWasm from "@stll/anonymize-wasm/vite";
|
|
|
49
49
|
By default the plugin emits every bundled prepared package into your build. The
|
|
50
50
|
full-dictionary default package alone is large (~20 MB), plus the per-language
|
|
51
51
|
`cs`, `de`, and `en` variants. If your app only needs some of them, restrict the
|
|
52
|
-
emitted packages with the `packages` option (the wasm binary
|
|
53
|
-
|
|
52
|
+
emitted packages with the `packages` option (the wasm binary and glue are
|
|
53
|
+
always emitted):
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
// Emit only the Czech scoped package.
|
|
@@ -80,34 +80,25 @@ app actually loads, or load your own package bytes through `loadPipeline`.
|
|
|
80
80
|
## Notes
|
|
81
81
|
|
|
82
82
|
- Same redaction core as `@stll/anonymize`, running in WebAssembly.
|
|
83
|
-
- The binding targets `wasm32-
|
|
84
|
-
|
|
83
|
+
- The binding targets single-thread `wasm32-unknown-unknown`. It runs in ordinary
|
|
84
|
+
browser contexts without `SharedArrayBuffer`, Web Workers, COOP, or COEP.
|
|
85
85
|
|
|
86
86
|
## Third-party licenses
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
following MIT-licensed runtime so it is self-contained for consumer bundlers:
|
|
91
|
-
|
|
92
|
-
- `@napi-rs/wasm-runtime` (MIT) — Copyright (c) napi-rs authors —
|
|
93
|
-
https://github.com/napi-rs/napi-rs
|
|
94
|
-
- `@tybys/wasm-util` (MIT) — Copyright (c) toyobayashi —
|
|
95
|
-
https://github.com/toyobayashi/wasm-util
|
|
96
|
-
|
|
97
|
-
Both are distributed under the MIT License; the full license text is available
|
|
98
|
-
in each project's repository.
|
|
88
|
+
See the package's `LICENSE` and the repository root `ATTRIBUTION.md` for
|
|
89
|
+
dependency attribution.
|
|
99
90
|
|
|
100
91
|
## Building from source
|
|
101
92
|
|
|
102
|
-
The wasm binding is generated by
|
|
93
|
+
The wasm binding is generated by wasm-bindgen and is not checked in:
|
|
103
94
|
|
|
104
95
|
```bash
|
|
105
96
|
cd packages/anonymize
|
|
106
|
-
bun run build:native-wasm # needs the wasm32-
|
|
97
|
+
bun run build:native-wasm # needs the wasm32-unknown-unknown Rust target
|
|
107
98
|
bun run build # tsdown + native node binding
|
|
108
99
|
bun run build:wasm-assets # copy glue + build compressed packages into wasm/dist/native
|
|
109
100
|
```
|
|
110
101
|
|
|
111
|
-
The `wasm32-
|
|
102
|
+
The `wasm32-unknown-unknown` target is pinned in `rust-toolchain.toml`, so
|
|
112
103
|
`rustup` installs it automatically; with a non-rustup toolchain run
|
|
113
|
-
`rustup target add wasm32-
|
|
104
|
+
`rustup target add wasm32-unknown-unknown` first.
|