motely-wasm 17.4.6 → 17.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.
Files changed (85) hide show
  1. package/README.md +40 -16
  2. package/bin/dotnet.native.wasm +0 -0
  3. package/dist/dotnet/dotnet.native.js +1 -1
  4. package/dist/generated/bootsharp/inject.g.mjs +6 -0
  5. package/dist/generated/bootsharp.g.mjs +6 -0
  6. package/dist/generated/imports.g.mjs +148 -0
  7. package/dist/generated/instances.g.mjs +17 -17
  8. package/dist/generated/jet-brains/annotations.g.mjs +6 -0
  9. package/dist/generated/motely/analysis.g.mjs +6 -0
  10. package/dist/generated/motely/filters/converters.g.mjs +6 -0
  11. package/dist/generated/motely/filters/jaml.g.mjs +6 -0
  12. package/dist/generated/motely/filters/native.g.mjs +6 -0
  13. package/dist/generated/motely/filters.g.d.mts +1 -0
  14. package/dist/generated/serialization.g.mjs +3 -0
  15. package/dist/generated/six-labors/image-sharp/advanced.g.mjs +6 -0
  16. package/dist/generated/six-labors/image-sharp/color-spaces/companding.g.mjs +6 -0
  17. package/dist/generated/six-labors/image-sharp/color-spaces/conversion.g.mjs +6 -0
  18. package/dist/generated/six-labors/image-sharp/color-spaces.g.mjs +6 -0
  19. package/dist/generated/six-labors/image-sharp/compression/zlib.g.mjs +6 -0
  20. package/dist/generated/six-labors/image-sharp/diagnostics.g.mjs +6 -0
  21. package/dist/generated/six-labors/image-sharp/formats/bmp.g.mjs +6 -0
  22. package/dist/generated/six-labors/image-sharp/formats/gif.g.mjs +6 -0
  23. package/dist/generated/six-labors/image-sharp/formats/jpeg/components/encoder.g.mjs +6 -0
  24. package/dist/generated/six-labors/image-sharp/formats/jpeg.g.mjs +6 -0
  25. package/dist/generated/six-labors/image-sharp/formats/pbm.g.mjs +6 -0
  26. package/dist/generated/six-labors/image-sharp/formats/png/chunks.g.mjs +6 -0
  27. package/dist/generated/six-labors/image-sharp/formats/png.g.mjs +6 -0
  28. package/dist/generated/six-labors/image-sharp/formats/qoi.g.mjs +6 -0
  29. package/dist/generated/six-labors/image-sharp/formats/tga.g.mjs +6 -0
  30. package/dist/generated/six-labors/image-sharp/formats/tiff/compression/decompressors.g.mjs +6 -0
  31. package/dist/generated/six-labors/image-sharp/formats/tiff/compression.g.mjs +6 -0
  32. package/dist/generated/six-labors/image-sharp/formats/tiff/constants.g.mjs +6 -0
  33. package/dist/generated/six-labors/image-sharp/formats/tiff.g.mjs +6 -0
  34. package/dist/generated/six-labors/image-sharp/formats/webp.g.mjs +6 -0
  35. package/dist/generated/six-labors/image-sharp/formats.g.mjs +6 -0
  36. package/dist/generated/six-labors/image-sharp/memory.g.mjs +6 -0
  37. package/dist/generated/six-labors/image-sharp/metadata/profiles/cicp.g.mjs +6 -0
  38. package/dist/generated/six-labors/image-sharp/metadata/profiles/exif.g.mjs +6 -0
  39. package/dist/generated/six-labors/image-sharp/metadata/profiles/icc.g.mjs +6 -0
  40. package/dist/generated/six-labors/image-sharp/metadata/profiles/iptc.g.mjs +6 -0
  41. package/dist/generated/six-labors/image-sharp/metadata/profiles/xmp.g.mjs +6 -0
  42. package/dist/generated/six-labors/image-sharp/metadata.g.mjs +6 -0
  43. package/dist/generated/six-labors/image-sharp/pixel-formats.g.mjs +6 -0
  44. package/dist/generated/six-labors/image-sharp/processing/processors/binarization.g.mjs +6 -0
  45. package/dist/generated/six-labors/image-sharp/processing/processors/convolution.g.mjs +6 -0
  46. package/dist/generated/six-labors/image-sharp/processing/processors/dithering.g.mjs +6 -0
  47. package/dist/generated/six-labors/image-sharp/processing/processors/drawing.g.mjs +6 -0
  48. package/dist/generated/six-labors/image-sharp/processing/processors/effects.g.mjs +6 -0
  49. package/dist/generated/six-labors/image-sharp/processing/processors/filters.g.mjs +6 -0
  50. package/dist/generated/six-labors/image-sharp/processing/processors/normalization.g.mjs +6 -0
  51. package/dist/generated/six-labors/image-sharp/processing/processors/overlays.g.mjs +6 -0
  52. package/dist/generated/six-labors/image-sharp/processing/processors/quantization.g.mjs +6 -0
  53. package/dist/generated/six-labors/image-sharp/processing/processors/transforms.g.mjs +6 -0
  54. package/dist/generated/six-labors/image-sharp/processing/processors.g.mjs +6 -0
  55. package/dist/generated/six-labors/image-sharp/processing.g.mjs +6 -0
  56. package/dist/generated/six-labors/image-sharp.g.mjs +6 -0
  57. package/dist/generated/system/collections/generic.g.mjs +6 -0
  58. package/dist/generated/system/threading.g.d.mts +4 -0
  59. package/dist/generated/system/threading.g.mjs +6 -0
  60. package/dist/generated/system.g.mjs +6 -0
  61. package/dist/generated/yaml-dot-net/core/events.g.mjs +6 -0
  62. package/dist/generated/yaml-dot-net/core/tokens.g.mjs +6 -0
  63. package/dist/generated/yaml-dot-net/core.g.mjs +6 -0
  64. package/dist/generated/yaml-dot-net/helpers.g.mjs +6 -0
  65. package/dist/generated/yaml-dot-net/representation-model.g.mjs +6 -0
  66. package/dist/generated/yaml-dot-net/serialization/buffered-deserialization/type-discriminators.g.mjs +6 -0
  67. package/dist/generated/yaml-dot-net/serialization/buffered-deserialization.g.mjs +6 -0
  68. package/dist/generated/yaml-dot-net/serialization/callbacks.g.mjs +6 -0
  69. package/dist/generated/yaml-dot-net/serialization/converters.g.mjs +6 -0
  70. package/dist/generated/yaml-dot-net/serialization/event-emitters.g.mjs +6 -0
  71. package/dist/generated/yaml-dot-net/serialization/naming-conventions.g.mjs +6 -0
  72. package/dist/generated/yaml-dot-net/serialization/node-deserializers.g.mjs +6 -0
  73. package/dist/generated/yaml-dot-net/serialization/node-type-resolvers.g.mjs +6 -0
  74. package/dist/generated/yaml-dot-net/serialization/object-factories.g.mjs +6 -0
  75. package/dist/generated/yaml-dot-net/serialization/object-graph-traversal-strategies.g.mjs +6 -0
  76. package/dist/generated/yaml-dot-net/serialization/object-graph-visitors.g.mjs +6 -0
  77. package/dist/generated/yaml-dot-net/serialization/schemas.g.mjs +6 -0
  78. package/dist/generated/yaml-dot-net/serialization/type-inspectors.g.mjs +6 -0
  79. package/dist/generated/yaml-dot-net/serialization/type-resolvers.g.mjs +6 -0
  80. package/dist/generated/yaml-dot-net/serialization/utilities.g.mjs +6 -0
  81. package/dist/generated/yaml-dot-net/serialization/value-deserializers.g.mjs +6 -0
  82. package/dist/generated/yaml-dot-net/serialization.g.mjs +6 -0
  83. package/motely-wasm-17.5.2.tgz +0 -0
  84. package/package.json +1 -1
  85. 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. The argument is the URL path under which your
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
- // Pick whichever URL is actually reachable from your page examples:
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(binUrl)` initializes the .NET WASM runtime. Call it once before any
57
- `Motely.*` API. The argument is the URL path your host serves the `bin/` directory
58
- at (where `dotnet.native.wasm` lives). It's host-chosen — typical mountings are:
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@17.4.4/bin` | `boot("https://unpkg.com/motely-wasm@17.4.4/bin")` |
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 the path that serves the WASM
70
- to the main thread is the same path the worker must pass.
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, { BootStatus } from "motely-wasm";
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,32 @@ 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 { fileURLToPath } from "node:url";
88
+ import bootsharp from "motely-wasm";
89
+
90
+ const wasmUrl = new URL("../bin/dotnet.native.wasm", import.meta.resolve("motely-wasm"));
91
+ const wasmBytes = await readFile(fileURLToPath(wasmUrl));
92
+
93
+ await bootsharp.boot({
94
+ wasm: wasmBytes.buffer.slice(
95
+ wasmBytes.byteOffset,
96
+ wasmBytes.byteOffset + wasmBytes.byteLength
97
+ ),
98
+ });
99
+ ```
100
+
101
+ Requires Node ≥ 20.6 (sync `import.meta.resolve`). Node 22 LTS is the recommended floor.
102
+
103
+ `Motely.Wasm/motely.test.mjs` in the source repo is the executable reference for
104
+ this path — if Node boot breaks, that suite catches it first.
105
+
82
106
  ## JAML API
83
107
 
84
108
  ```js
@@ -138,7 +162,7 @@ search.cancel(); // stop early
138
162
  | `Motely.onSeedMatch` | `string` — matching seed |
139
163
  | `Motely.onScoredResult` | `{ seed, score, tallies }` |
140
164
  | `Motely.onProgress` | `MotelyProgress` — `percentComplete`, `seedsSearched`, `matchingSeeds`, `seedsPerMillisecond`, `elapsedMilliseconds` |
141
- | `Motely.onFileChanges` | `Change[]` (browser file-system mounts) |
165
+ | `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
166
 
143
167
  Subscribe and unsubscribe:
144
168
 
Binary file