motely-wasm 17.4.6 → 17.5.2
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 +39 -16
- package/bin/dotnet.native.wasm +0 -0
- package/dist/dotnet/dotnet.native.js +1 -1
- package/dist/generated/bootsharp/inject.g.mjs +6 -0
- package/dist/generated/bootsharp.g.mjs +6 -0
- package/dist/generated/imports.g.mjs +148 -0
- package/dist/generated/instances.g.mjs +17 -17
- package/dist/generated/jet-brains/annotations.g.mjs +6 -0
- package/dist/generated/motely/analysis.g.mjs +6 -0
- package/dist/generated/motely/filters/converters.g.mjs +6 -0
- package/dist/generated/motely/filters/jaml.g.mjs +6 -0
- package/dist/generated/motely/filters/native.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/advanced.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/color-spaces/companding.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/color-spaces/conversion.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/color-spaces.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/compression/zlib.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/diagnostics.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/bmp.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/gif.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/jpeg/components/encoder.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/jpeg.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/pbm.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/png/chunks.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/png.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/qoi.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/tga.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/tiff/compression/decompressors.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/tiff/compression.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/tiff/constants.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/tiff.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats/webp.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/formats.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/memory.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata/profiles/cicp.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata/profiles/exif.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata/profiles/icc.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata/profiles/iptc.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata/profiles/xmp.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/metadata.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/pixel-formats.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/binarization.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/convolution.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/dithering.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/drawing.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/effects.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/filters.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/normalization.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/overlays.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/quantization.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors/transforms.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing/processors.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp/processing.g.mjs +6 -0
- package/dist/generated/six-labors/image-sharp.g.mjs +6 -0
- package/dist/generated/system/collections/generic.g.mjs +6 -0
- package/dist/generated/system/threading.g.d.mts +4 -0
- package/dist/generated/system/threading.g.mjs +6 -0
- package/dist/generated/system.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/core/events.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/core/tokens.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/core.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/helpers.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/representation-model.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/buffered-deserialization/type-discriminators.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/buffered-deserialization.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/callbacks.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/converters.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/event-emitters.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/naming-conventions.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/node-deserializers.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/node-type-resolvers.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/object-factories.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/object-graph-traversal-strategies.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/object-graph-visitors.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/schemas.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/type-inspectors.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/type-resolvers.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/utilities.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization/value-deserializers.g.mjs +6 -0
- package/dist/generated/yaml-dot-net/serialization.g.mjs +6 -0
- package/motely-wasm-17.5.2.tgz +0 -0
- package/package.json +1 -1
- package/motely-wasm-17.4.6.tgz +0 -0
package/README.md
CHANGED
|
@@ -13,15 +13,9 @@ npm install motely-wasm
|
|
|
13
13
|
```js
|
|
14
14
|
import bootsharp, { Motely } from "motely-wasm";
|
|
15
15
|
|
|
16
|
-
// Boot the .NET WASM runtime.
|
|
16
|
+
// Boot the .NET WASM runtime. In a browser, pass the URL path under which your
|
|
17
17
|
// host serves the package's `bin/` directory (where dotnet.native.wasm lives).
|
|
18
|
-
//
|
|
19
|
-
// "/motely-wasm/bin" (Vite/Storybook staticDirs, Next.js route)
|
|
20
|
-
// "/bin" (page served from the package root)
|
|
21
|
-
// "/node_modules/motely-wasm/bin" (raw node_modules served as static)
|
|
22
|
-
// "https://unpkg.com/motely-wasm@17.4.4/bin" (CDN)
|
|
23
|
-
// Workers must use the SAME path — don't pass "/bin" if your host serves
|
|
24
|
-
// the assets at "/motely-wasm/bin".
|
|
18
|
+
// In Node, pass the `.wasm` bytes directly — see the "Booting" section below.
|
|
25
19
|
await bootsharp.boot("/motely-wasm/bin");
|
|
26
20
|
|
|
27
21
|
// A JAML filter — see https://github.com/OptimusPi/MotelyJAML for the language.
|
|
@@ -53,9 +47,13 @@ console.log("done:", search.totalSeedsSearched, "searched,", search.matchingSeed
|
|
|
53
47
|
|
|
54
48
|
## Booting
|
|
55
49
|
|
|
56
|
-
`bootsharp.boot(
|
|
57
|
-
`Motely.*` API. The argument
|
|
58
|
-
|
|
50
|
+
`bootsharp.boot(...)` initializes the .NET WASM runtime. Call it once before any
|
|
51
|
+
`Motely.*` API. The argument shape depends on the host.
|
|
52
|
+
|
|
53
|
+
### Browser
|
|
54
|
+
|
|
55
|
+
Pass the URL path your host serves the package's `bin/` directory at (where
|
|
56
|
+
`dotnet.native.wasm` lives). It's host-chosen — typical mountings:
|
|
59
57
|
|
|
60
58
|
| Host | Mount `bin/` at | Boot call |
|
|
61
59
|
| --- | --- | --- |
|
|
@@ -63,14 +61,14 @@ at (where `dotnet.native.wasm` lives). It's host-chosen — typical mountings ar
|
|
|
63
61
|
| Next.js route handler | `/motely-wasm/bin/[...path]` | `boot("/motely-wasm/bin")` |
|
|
64
62
|
| Static page in `node_modules/motely-wasm/` | `/bin` | `boot("/bin")` |
|
|
65
63
|
| Raw node_modules served as static | `/node_modules/motely-wasm/bin` | `boot("/node_modules/motely-wasm/bin")` |
|
|
66
|
-
| Public CDN | `https://unpkg.com/motely-wasm
|
|
64
|
+
| Public CDN | `https://unpkg.com/motely-wasm/bin` | `boot("https://unpkg.com/motely-wasm/bin")` |
|
|
67
65
|
|
|
68
66
|
Web Workers must boot from the **same** URL as the main thread — absolute paths
|
|
69
|
-
in a worker resolve against the page origin, so
|
|
70
|
-
to the main thread is the same
|
|
67
|
+
in a worker resolve against the page origin, so whichever URL serves the WASM
|
|
68
|
+
to the main thread is the same one the worker must pass.
|
|
71
69
|
|
|
72
70
|
```js
|
|
73
|
-
import bootsharp
|
|
71
|
+
import bootsharp from "motely-wasm";
|
|
74
72
|
|
|
75
73
|
if (bootsharp.getStatus() === bootsharp.BootStatus.Standby) {
|
|
76
74
|
await bootsharp.boot("/motely-wasm/bin");
|
|
@@ -79,6 +77,31 @@ if (bootsharp.getStatus() === bootsharp.BootStatus.Standby) {
|
|
|
79
77
|
console.log(bootsharp.getStatus()); // BootStatus.Booted
|
|
80
78
|
```
|
|
81
79
|
|
|
80
|
+
### Node / Bun / Deno
|
|
81
|
+
|
|
82
|
+
There's no URL to fetch from — read `dotnet.native.wasm` off disk and hand its
|
|
83
|
+
bytes to `boot`:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
import { readFile } from "node:fs/promises";
|
|
87
|
+
import { createRequire } from "node:module";
|
|
88
|
+
import bootsharp from "motely-wasm";
|
|
89
|
+
|
|
90
|
+
const require = createRequire(import.meta.url);
|
|
91
|
+
const pkgRoot = require.resolve("motely-wasm/package.json").replace(/package\.json$/, "");
|
|
92
|
+
const wasmBytes = await readFile(`${pkgRoot}bin/dotnet.native.wasm`);
|
|
93
|
+
|
|
94
|
+
await bootsharp.boot({
|
|
95
|
+
wasm: wasmBytes.buffer.slice(
|
|
96
|
+
wasmBytes.byteOffset,
|
|
97
|
+
wasmBytes.byteOffset + wasmBytes.byteLength
|
|
98
|
+
),
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`Motely.Wasm/test-sanity.mjs` in the source repo is the executable reference for
|
|
103
|
+
this path — if Node boot breaks, that smoke test catches it first.
|
|
104
|
+
|
|
82
105
|
## JAML API
|
|
83
106
|
|
|
84
107
|
```js
|
|
@@ -138,7 +161,7 @@ search.cancel(); // stop early
|
|
|
138
161
|
| `Motely.onSeedMatch` | `string` — matching seed |
|
|
139
162
|
| `Motely.onScoredResult` | `{ seed, score, tallies }` |
|
|
140
163
|
| `Motely.onProgress` | `MotelyProgress` — `percentComplete`, `seedsSearched`, `matchingSeeds`, `seedsPerMillisecond`, `elapsedMilliseconds` |
|
|
141
|
-
| `Motely.onFileChanges` | `Change[]` (browser
|
|
164
|
+
| `Motely.onFileChanges` | `Change[]` — fires when files change under a directory mounted via `Motely.mountRoot` (browser File System Access API, requires `Bootsharp.FileSystem`). Ignore if your app doesn't mount local directories. |
|
|
142
165
|
|
|
143
166
|
Subscribe and unsubscribe:
|
|
144
167
|
|
package/bin/dotnet.native.wasm
CHANGED
|
Binary file
|