@sebastienrousseau/noyalib-wasm 0.0.16 → 0.0.18
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 +13 -4
- package/noyalib_wasm.d.ts +4 -2
- package/noyalib_wasm_bg.js +4 -2
- package/noyalib_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -263,13 +263,21 @@ Browser + Node demos under
|
|
|
263
263
|
|---|---|---|
|
|
264
264
|
| [`node-stringify.js`](examples/node-stringify.js) | Node | `parse` + `stringify` round-trip. |
|
|
265
265
|
| [`cst-edit.js`](examples/cst-edit.js) | Node | Lossless CST edit; comments + whitespace preserved. |
|
|
266
|
-
| [`
|
|
266
|
+
| [`paths-and-spans.js`](examples/paths-and-spans.js) | Node | `getPath`, `merge`, `getSource`, `spanAt`, `replaceSpan`, `setValue`, `commentsAt`. |
|
|
267
|
+
| [`json-compat.js`](examples/json-compat.js) | Node | `validateJson` — refuse YAML that JSON cannot represent (NaN / Infinity). |
|
|
267
268
|
| [`browser/index.html`](examples/browser/index.html) | Browser | Live in-page YAML editor with a parsed-JSON pane. |
|
|
269
|
+
| [`benches/bench.js`](benches/bench.js) | Node | Throughput measured across the real JS↔wasm boundary. |
|
|
270
|
+
|
|
271
|
+
> The wasm build ships **no JSON Schema engine**. `validateJson` only
|
|
272
|
+
> checks JSON round-trip safety. For JSON Schema 2020-12 use
|
|
273
|
+
> `noyavalidate --schema`, or the `noyalib` crate's `validate-schema`
|
|
274
|
+
> feature.
|
|
268
275
|
|
|
269
276
|
```bash
|
|
270
277
|
# Node:
|
|
271
278
|
wasm-pack build --release --target nodejs crates/noyalib-wasm
|
|
272
279
|
node crates/noyalib-wasm/examples/cst-edit.js
|
|
280
|
+
node crates/noyalib-wasm/examples/json-compat.js
|
|
273
281
|
|
|
274
282
|
# Browser:
|
|
275
283
|
wasm-pack build --release --target web crates/noyalib-wasm
|
|
@@ -294,9 +302,10 @@ python3 -m http.server # or any static-file server
|
|
|
294
302
|
|
|
295
303
|
## Compatibility
|
|
296
304
|
|
|
297
|
-
**MSRV: Rust 1.
|
|
298
|
-
|
|
299
|
-
|
|
305
|
+
**MSRV: Rust 1.86.0** stable — a deliberate policy choice: one floor across the whole lockstep set,
|
|
306
|
+
with headroom for the dependency tree. No current dependency *requires*
|
|
307
|
+
1.86 — this crate still compiles on 1.85. The whole lockstep set,
|
|
308
|
+
including the core `noyalib` library, shares this floor. CI verifies the floor on every PR via
|
|
300
309
|
the `Per-crate MSRV` workflow job. The bump policy lives in
|
|
301
310
|
[`doc/POLICIES.md`](https://github.com/sebastienrousseau/noyalib/blob/main/doc/POLICIES.md#1-msrv-minimum-supported-rust-version).
|
|
302
311
|
|
package/noyalib_wasm.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* A YAML document with byte-faithful source preservation and path-targeted
|
|
5
|
+
* A YAML document with byte-faithful source preservation and path-targeted
|
|
6
|
+
* edits.
|
|
6
7
|
*/
|
|
7
8
|
export class WasmDocument {
|
|
8
9
|
free(): void;
|
|
@@ -58,7 +59,8 @@ export class WasmDocument {
|
|
|
58
59
|
*/
|
|
59
60
|
spanAt(path: string): any;
|
|
60
61
|
/**
|
|
61
|
-
* Re-emit the document as a string. Byte-identical to original if no
|
|
62
|
+
* Re-emit the document as a string. Byte-identical to original if no
|
|
63
|
+
* edits.
|
|
62
64
|
*
|
|
63
65
|
* Bound on the JS side as `toString()` (the conventional camelCase
|
|
64
66
|
* name) so callers can write `doc.toString()` and override the
|
package/noyalib_wasm_bg.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A YAML document with byte-faithful source preservation and path-targeted
|
|
2
|
+
* A YAML document with byte-faithful source preservation and path-targeted
|
|
3
|
+
* edits.
|
|
3
4
|
*/
|
|
4
5
|
export class WasmDocument {
|
|
5
6
|
__destroy_into_raw() {
|
|
@@ -141,7 +142,8 @@ export class WasmDocument {
|
|
|
141
142
|
return takeFromExternrefTable0(ret[0]);
|
|
142
143
|
}
|
|
143
144
|
/**
|
|
144
|
-
* Re-emit the document as a string. Byte-identical to original if no
|
|
145
|
+
* Re-emit the document as a string. Byte-identical to original if no
|
|
146
|
+
* edits.
|
|
145
147
|
*
|
|
146
148
|
* Bound on the JS side as `toString()` (the conventional camelCase
|
|
147
149
|
* name) so callers can write `doc.toString()` and override the
|
package/noyalib_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Sebastien Rousseau <sebastian.rousseau@gmail.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly (wasm-bindgen) bindings for the noyalib YAML library — browser-ready parse / serialise / lossless edit",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.18",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|