motely-wasm 1.0.2 → 1.0.4
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 +12 -53
- package/dist/_framework/Motely.Orchestration.Browser.wasm +0 -0
- package/dist/_framework/Motely.Orchestration.wasm +0 -0
- package/dist/_framework/Motely.Repository.wasm +0 -0
- package/dist/_framework/Motely.WASM.wasm +0 -0
- package/dist/_framework/Motely.wasm +0 -0
- package/dist/_framework/System.Private.CoreLib.wasm +0 -0
- package/dist/_framework/dotnet.boot.js +8 -8
- package/dist/_framework/dotnet.native.wasm +0 -0
- package/dist/index.html +475 -144
- package/index.d.ts +1 -0
- package/jaml.schema.json +446 -0
- package/motely-wasm.d.ts +27 -2
- package/package.json +2 -1
- package/docs/NEXTJS_INTEGRATION.md +0 -202
package/README.md
CHANGED
|
@@ -62,8 +62,6 @@ npx motely-wasm-prepare public/my-wasm
|
|
|
62
62
|
|
|
63
63
|
Or use `require('motely-wasm').getDistPath()` in your own build step.
|
|
64
64
|
|
|
65
|
-
**Docs:** [Next.js](docs/NEXTJS_INTEGRATION.md)
|
|
66
|
-
|
|
67
65
|
---
|
|
68
66
|
|
|
69
67
|
## Installation
|
|
@@ -106,7 +104,8 @@ Without these headers, the WASM will still load but run single-threaded.
|
|
|
106
104
|
| Method | Description |
|
|
107
105
|
|--------|-------------|
|
|
108
106
|
| `AnalyzeSeed(seed, deck, stake, minAnte, maxAnte, optionsJson)` | Analyze one seed; returns ante data. |
|
|
109
|
-
| `SearchSeeds(jamlFilterJson, seedList, threadCount
|
|
107
|
+
| `SearchSeeds(jamlFilterJson, seedList, threadCount)` | Search seeds matching a JAML filter. Optional: set `globalThis.MotelyWasmOnProgress`, `MotelyWasmOnResult`, `MotelyWasmOnComplete` before calling. |
|
|
108
|
+
| `SearchSeedsWithOptions(jamlFilterJson, optionsJson)` | Advanced search (keywords, batch ranges, random/palindrome). `optionsJson` matches `SearchOptions` (camelCase). |
|
|
110
109
|
| `ValidateJaml(jamlString)` | Validate JAML without searching. |
|
|
111
110
|
| `CancelSearch()` | Cancel in-progress search. |
|
|
112
111
|
| `IsSearchRunning()` | Returns whether a search is running. |
|
|
@@ -272,12 +271,20 @@ Get version information.
|
|
|
272
271
|
|
|
273
272
|
```typescript
|
|
274
273
|
await MotelyWasm.GetVersion(): Promise<string>
|
|
275
|
-
// Returns: { version: "1.0.
|
|
274
|
+
// Returns: { version: "1.0.4", runtime: "browser-wasm", features: [...] }
|
|
276
275
|
```
|
|
277
276
|
|
|
278
277
|
## JAML Filter Format
|
|
279
278
|
|
|
280
|
-
JAML
|
|
279
|
+
JAML is a YAML-based format for defining seed search filters. By default we call it:
|
|
280
|
+
|
|
281
|
+
- **J**imbo's **A**nte **M**arkup **L**anguage
|
|
282
|
+
|
|
283
|
+
And in the wild it also cheekily stands for:
|
|
284
|
+
|
|
285
|
+
- JAML: **A**ntes, **M**ult, **L**ove
|
|
286
|
+
|
|
287
|
+
Schema file (for tooling / autocomplete): `jaml.schema.json` in this package.
|
|
281
288
|
|
|
282
289
|
```yaml
|
|
283
290
|
name: My Filter
|
|
@@ -297,28 +304,6 @@ should:
|
|
|
297
304
|
antes: [1, 2]
|
|
298
305
|
```
|
|
299
306
|
|
|
300
|
-
## Example: Next.js Integration
|
|
301
|
-
|
|
302
|
-
```typescript
|
|
303
|
-
// lib/motely.ts
|
|
304
|
-
let motelyWasm: any = null;
|
|
305
|
-
|
|
306
|
-
export async function getMotely() {
|
|
307
|
-
if (motelyWasm) return motelyWasm;
|
|
308
|
-
|
|
309
|
-
const { dotnet } = await import('/motely-wasm/_framework/dotnet.js');
|
|
310
|
-
const { getAssemblyExports, getConfig } = await dotnet.create();
|
|
311
|
-
const exports = await getAssemblyExports(getConfig().mainAssemblyName);
|
|
312
|
-
|
|
313
|
-
motelyWasm = exports.Motely.WASM.MotelyWasm;
|
|
314
|
-
return motelyWasm;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// Usage in component
|
|
318
|
-
const api = await getMotely();
|
|
319
|
-
const result = JSON.parse(await api.AnalyzeSeed("TACO1111", "Red", "White", 1, 8, "{}"));
|
|
320
|
-
```
|
|
321
|
-
|
|
322
307
|
## Troubleshooting
|
|
323
308
|
|
|
324
309
|
### "SharedArrayBuffer is not defined"
|
|
@@ -337,32 +322,6 @@ Make sure COOP/COEP headers are set for multi-threading. Without them, WASM runs
|
|
|
337
322
|
|
|
338
323
|
Ensure the `dist/_framework/` folder is copied to your public directory and accessible at the URL you're importing from.
|
|
339
324
|
|
|
340
|
-
## Development (maintainers)
|
|
341
|
-
|
|
342
|
-
Run all commands from the **Motely.WASM** directory (where package.json lives).
|
|
343
|
-
|
|
344
|
-
```bash
|
|
345
|
-
# Build WASM and copy publish output to dist/
|
|
346
|
-
npm run build
|
|
347
|
-
|
|
348
|
-
# Local dev server with COOP/COEP (serves dist/ on http://localhost:3333)
|
|
349
|
-
npm run dev
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
## Publishing (maintainers)
|
|
353
|
-
|
|
354
|
-
**Do not use `npm publish --ignore-scripts`.** The package must include a built `dist/` with WASM files; scripts build and verify that.
|
|
355
|
-
|
|
356
|
-
1. From repo root, build the solution so dependencies are ready: `dotnet build`
|
|
357
|
-
2. `cd Motely.WASM`
|
|
358
|
-
3. `npm run build` — wait until it finishes (dotnet publish + copy to dist). If it fails, fix the build before publishing.
|
|
359
|
-
4. Confirm `dist/_framework` exists and has files (e.g. `dotnet.js`, `.wasm` files).
|
|
360
|
-
5. `npm publish` (run `npm login` first if needed).
|
|
361
|
-
|
|
362
|
-
**Verify before publish:** Run `npm pack` in Motely.WASM. Unpack the `.tgz` and confirm `package/dist/_framework` has files. If it doesn’t, the published package will be broken for users.
|
|
363
|
-
|
|
364
|
-
**Verify after install (consumer):** After `npm install motely-wasm`, check that `node_modules/motely-wasm/dist/_framework` exists and has files. If it’s missing or empty, the publish didn’t include the build.
|
|
365
|
-
|
|
366
325
|
## License
|
|
367
326
|
|
|
368
327
|
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const config = /*json-start*/{
|
|
2
2
|
"mainAssemblyName": "Motely.WASM.dll",
|
|
3
3
|
"resources": {
|
|
4
|
-
"hash": "sha256-
|
|
4
|
+
"hash": "sha256-Gk9/xrga6zPO2J4aryZOtgrslwo7yOCLxy5PlkoNk7Q=",
|
|
5
5
|
"jsModuleWorker": [
|
|
6
6
|
{
|
|
7
7
|
"name": "dotnet.native.worker.mjs"
|
|
@@ -20,34 +20,34 @@ export const config = /*json-start*/{
|
|
|
20
20
|
"wasmNative": [
|
|
21
21
|
{
|
|
22
22
|
"name": "dotnet.native.wasm",
|
|
23
|
-
"integrity": "sha256-
|
|
23
|
+
"integrity": "sha256-jvXPUonAhErIzORkzfOnmrul71XAgOM4DoS5OQLpvwM="
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"coreAssembly": [
|
|
27
27
|
{
|
|
28
28
|
"virtualPath": "Motely.wasm",
|
|
29
29
|
"name": "Motely.wasm",
|
|
30
|
-
"integrity": "sha256-
|
|
30
|
+
"integrity": "sha256-FgCQ7Ay8Dd7qFiBGsK/hvJVeG5KF5uZ5lLy8Sw9cYWc="
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"virtualPath": "Motely.Orchestration.Browser.wasm",
|
|
34
34
|
"name": "Motely.Orchestration.Browser.wasm",
|
|
35
|
-
"integrity": "sha256-
|
|
35
|
+
"integrity": "sha256-PZU/Ijn+Vc7z8q5mldL3RHLNLSMF4v2SLVs8NPSWDQw="
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"virtualPath": "Motely.Orchestration.wasm",
|
|
39
39
|
"name": "Motely.Orchestration.wasm",
|
|
40
|
-
"integrity": "sha256-
|
|
40
|
+
"integrity": "sha256-xkUq2tzQtD9bZnGwG3Rc/fZWgV01p4+vllTXhGv4+Cg="
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"virtualPath": "Motely.Repository.wasm",
|
|
44
44
|
"name": "Motely.Repository.wasm",
|
|
45
|
-
"integrity": "sha256-
|
|
45
|
+
"integrity": "sha256-gBrKJjiZJ/DcCZ1ATtU01m392eGr44dPbmPAdAiJsLI="
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"virtualPath": "Motely.WASM.wasm",
|
|
49
49
|
"name": "Motely.WASM.wasm",
|
|
50
|
-
"integrity": "sha256-
|
|
50
|
+
"integrity": "sha256-gjwqdwFt5n0av6SZQfcg256R2cdtEI/BS40dyiwAZCs="
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"virtualPath": "System.Collections.Concurrent.wasm",
|
|
@@ -92,7 +92,7 @@ export const config = /*json-start*/{
|
|
|
92
92
|
{
|
|
93
93
|
"virtualPath": "System.Private.CoreLib.wasm",
|
|
94
94
|
"name": "System.Private.CoreLib.wasm",
|
|
95
|
-
"integrity": "sha256-
|
|
95
|
+
"integrity": "sha256-puibfW/E87IfhUS6sHL6S784oqL2ktemRzEGESkHX6Q="
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"virtualPath": "System.Private.Uri.wasm",
|
|
Binary file
|