@datamoc/mw_games 0.39.1 → 0.41.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/CHANGELOG.md +89 -0
- package/REFERENCE.md +2115 -0
- package/api-surface.json +48 -0
- package/data/microgm-opt.PROVENANCE.md +23 -0
- package/data/microgm-opt.sf2 +0 -0
- package/data/soundfont-catalog.json +183 -0
- package/dist/ai/index.d.ts +10 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/lua.d.ts +6 -0
- package/dist/ai/lua.d.ts.map +1 -1
- package/dist/ai/lua.js.map +1 -1
- package/dist/audio/SampleDecoder.d.ts +41 -0
- package/dist/audio/SampleDecoder.d.ts.map +1 -0
- package/dist/audio/SampleDecoder.js +70 -0
- package/dist/audio/SampleDecoder.js.map +1 -0
- package/dist/audio/SoundFont.d.ts +59 -0
- package/dist/audio/SoundFont.d.ts.map +1 -1
- package/dist/audio/SoundFont.js +248 -2
- package/dist/audio/SoundFont.js.map +1 -1
- package/dist/audio/index.d.ts +3 -1
- package/dist/audio/index.d.ts.map +1 -1
- package/dist/audio/index.js +2 -1
- package/dist/audio/index.js.map +1 -1
- package/dist/mw_games.global.js +11 -11
- package/dist/mwl/presentation.d.ts +16 -0
- package/dist/mwl/presentation.d.ts.map +1 -1
- package/dist/mwl/presentation.js.map +1 -1
- package/dist/mwl/pyroeis-runtime.d.ts +7 -0
- package/dist/mwl/pyroeis-runtime.d.ts.map +1 -1
- package/dist/mwl/pyroeis-runtime.js.map +1 -1
- package/dist/mwl/pyroeis.d.ts +3 -0
- package/dist/mwl/pyroeis.d.ts.map +1 -1
- package/dist/mwl/pyroeis.js.map +1 -1
- package/dist/physics/PhysicsWorld.d.ts +3 -0
- package/dist/physics/PhysicsWorld.d.ts.map +1 -1
- package/dist/physics/PhysicsWorld.js.map +1 -1
- package/dist/physics/XpbdWorld.d.ts +11 -0
- package/dist/physics/XpbdWorld.d.ts.map +1 -1
- package/dist/physics/XpbdWorld.js.map +1 -1
- package/dist/physics/cloth/index.d.ts +20 -19
- package/dist/physics/cloth/index.d.ts.map +1 -1
- package/dist/physics/cloth/index.js +19 -0
- package/dist/physics/cloth/index.js.map +1 -1
- package/dist/physics/spring/index.d.ts +19 -18
- package/dist/physics/spring/index.d.ts.map +1 -1
- package/dist/physics/spring/index.js +23 -0
- package/dist/physics/spring/index.js.map +1 -1
- package/dist/three-d/Character3D.d.ts +8 -7
- package/dist/three-d/Character3D.d.ts.map +1 -1
- package/dist/three-d/Character3D.js +7 -0
- package/dist/three-d/Character3D.js.map +1 -1
- package/dist/three-d/Collision3D.d.ts +4 -0
- package/dist/three-d/Collision3D.d.ts.map +1 -1
- package/dist/three-d/Collision3D.js.map +1 -1
- package/dist/three-d/Engine3D.d.ts +2 -0
- package/dist/three-d/Engine3D.d.ts.map +1 -1
- package/dist/three-d/Engine3D.js.map +1 -1
- package/dist/three-d/Grid.d.ts +5 -0
- package/dist/three-d/Grid.d.ts.map +1 -1
- package/dist/three-d/Grid.js.map +1 -1
- package/dist/three-d/Heightmap.d.ts +3 -0
- package/dist/three-d/Heightmap.d.ts.map +1 -1
- package/dist/three-d/Heightmap.js.map +1 -1
- package/dist/three-d/TileGrid3D.d.ts +6 -0
- package/dist/three-d/TileGrid3D.d.ts.map +1 -1
- package/dist/three-d/TileGrid3D.js.map +1 -1
- package/dist/three-d/Vox.d.ts +7 -0
- package/dist/three-d/Vox.d.ts.map +1 -1
- package/dist/three-d/Vox.js.map +1 -1
- package/dist/two-d/presentation/MwlPresentation.d.ts +7 -0
- package/dist/two-d/presentation/MwlPresentation.d.ts.map +1 -1
- package/dist/two-d/presentation/MwlPresentation.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +18 -1
- package/sbom.cdx.json +139 -139
- package/tools/benchmark-browser.mjs +6 -0
- package/tools/bundle-size.mjs +4 -0
- package/tools/compile-resources.d.mts +22 -0
- package/tools/compile-resources.mjs +116 -3
- package/tools/emit-page.d.mts +7 -1
- package/tools/emit-page.mjs +20 -2
- package/tools/init.mjs +3 -1
- package/tools/make-example-assets.mjs +4 -0
- package/tools/multiplayer-server.mjs +4 -0
- package/tools/mwl.mjs +7 -0
- package/tools/play-uci.mjs +4 -0
- package/tools/sbom.mjs +4 -0
- package/tools/soundfonts.d.mts +79 -0
- package/tools/soundfonts.mjs +301 -0
- package/tools/verify-scenarios.mjs +6 -2
- package/tools/vite.mjs +2 -0
- package/tools.md +216 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,95 @@ the public API may still change between minor versions.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.41.0] - 2026-10-16
|
|
11
|
+
|
|
12
|
+
`microgm-opt` stays the default SoundFont, and a game that wants another one can now pick it:
|
|
13
|
+
a licence-classified catalogue of a per-instrument collection, a tool that fetches only the
|
|
14
|
+
instruments the game plays, and SoundFont 3 support from the build to the browser, so the
|
|
15
|
+
font reaches the page compressed and is decoded at load.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `mwg-soundfonts` (`list`, `fetch`, `convert`, and `@datamoc/mw_games/tools/soundfonts`):
|
|
20
|
+
`data/soundfont-catalog.json` lists the bundled bank and 18 fonts of the marmooo
|
|
21
|
+
free-soundfonts collection with each licence classified (public domain, permissive and
|
|
22
|
+
attribution fetch freely; share-alike, copyleft and unclear ones need `--accept-licence`;
|
|
23
|
+
TimGM6mb is listed as GPL-2.0 where the collection says public domain). `fetch` takes the
|
|
24
|
+
instruments named by `--midi` files or `--programs` and merges them into one SoundFont 3 with
|
|
25
|
+
a `.credits.txt` beside it: nothing is decoded, so no `ffmpeg`. `--sf2` and `convert` decode
|
|
26
|
+
to a plain SoundFont 2 instead (Ogg Vorbis through `ffmpeg`, a developer-machine tool), about
|
|
27
|
+
eight times larger.
|
|
28
|
+
- `loadSoundFont`, `decodeSoundFont` and `webAudioSampleDecoder` (`audio`): a game reads the
|
|
29
|
+
SoundFont 2 or 3 it ships with `loadSoundFont`, a SoundFont 3 decoded once at load through
|
|
30
|
+
`decodeAudioData` (each sample in a context at its own rate, so no resampling), or through a
|
|
31
|
+
decoder the caller passes. Checked in Chrome against `ffmpeg`: the same frames, rates and
|
|
32
|
+
loop points, and the same render. `decodeSoundFont` returns the SoundFont 2 bytes for
|
|
33
|
+
anything that takes them.
|
|
34
|
+
- `compileResources`, `emitPage` and `mwgPage` embed `.sf3` assets and subset them to the
|
|
35
|
+
programs the game's MIDI files use, the Ogg bytes copied untouched.
|
|
36
|
+
- `mergeSoundFonts` (`audio`): joins SoundFont 2 files, or SoundFont 3 files with their Ogg
|
|
37
|
+
bytes untouched, into one, the first font winning a shared (bank, program).
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- `parseSoundFont` refuses a SoundFont 3 by name (pointing at `loadSoundFont`) instead of
|
|
42
|
+
reading its Ogg bytes as PCM and playing noise.
|
|
43
|
+
- A SoundFont whose sample offsets point outside its sample data is refused when read, rather
|
|
44
|
+
than read beyond it.
|
|
45
|
+
- Decoding a SoundFont 3 bounds what the file can make it allocate: a sample rate outside 400 to
|
|
46
|
+
200000 Hz is refused, a decoded sample is capped at sixteen million frames and a whole font at
|
|
47
|
+
134 million (256 MB of audio), in both `decodeSoundFont` and the WebAudio decoder.
|
|
48
|
+
- `mwg-soundfonts` treats the font as untrusted input: a sample whose offsets point outside the
|
|
49
|
+
sample data is refused instead of copied from beyond it, and `ffmpeg` only ever receives bytes
|
|
50
|
+
that start with the Ogg magic, with the demuxer forced to Ogg and only the `pipe` protocol
|
|
51
|
+
allowed, so a crafted "sample" cannot be probed as a playlist that names local files.
|
|
52
|
+
|
|
53
|
+
## [0.40.1] - 2026-10-15
|
|
54
|
+
|
|
55
|
+
The published package now carries its documentation the way npm expects to find it: a
|
|
56
|
+
homepage that opens the documentation site, the reference and the tools guide inside the
|
|
57
|
+
tarball, declared Node support, and a `--help` on every command line tool.
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- `package.json` declares `homepage` (the documentation site, so `npm docs` opens it
|
|
62
|
+
instead of the GitHub README), `bugs` and `engines` (`node >=20.19.0`), and exports
|
|
63
|
+
`./package.json` so a tool can read an installed module's metadata. `@datamoc/mwg`
|
|
64
|
+
inherits all of them, plus the keywords it lacked.
|
|
65
|
+
- `REFERENCE.md` and `tools.md` ship in the tarball, so the README's relative links
|
|
66
|
+
resolve offline from `node_modules`.
|
|
67
|
+
- `REFERENCE.md` sections for `skeleton`, `physics` and `mwl/pyroeis`.
|
|
68
|
+
- JSDoc on the exported symbols of the least documented entry points
|
|
69
|
+
(`mwl/presentation`, `ai/lua`, `physics/xpbd`, `two-d/presentation`, `3d`, `mwl/pyroeis`,
|
|
70
|
+
`physics`).
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
|
|
74
|
+
- `mwg-bench`, `mwg-size`, `mwg-sbom`, `mwg-lockstep-server`, `mwg-mwl`, `mwg-uci` now print
|
|
75
|
+
their usage for `--help` instead of running. `mwg-init --help` no longer creates a folder
|
|
76
|
+
named `--help`, `mwg-scenarios --help` no longer hangs, and `mwg-placeholder-assets --help`
|
|
77
|
+
no longer rewrites the assets.
|
|
78
|
+
|
|
79
|
+
## [0.40.0] - 2026-10-15
|
|
80
|
+
|
|
81
|
+
A game that plays sampled MIDI no longer ships a whole SoundFont: the asset
|
|
82
|
+
compiler subsets the bank to the instruments its tracks actually use, and the
|
|
83
|
+
package now carries a small WTFPL General MIDI bank to subset from.
|
|
84
|
+
|
|
85
|
+
### Added
|
|
86
|
+
|
|
87
|
+
- Build-time SoundFont subsetting: `compileResources`, `emitPage` and `mwgPage` now
|
|
88
|
+
embed `.mid`/`.midi` and `.sf2` assets, and every embedded SoundFont is subset to
|
|
89
|
+
the programs the embedded MIDI files actually use (`collectSoundFontUsage` over
|
|
90
|
+
the shipped tracks, drums as bank 128). `soundFont: false` embeds a font whole,
|
|
91
|
+
`soundFontUsage` (or `--soundfont-usage=bank:program,...`) names the programs
|
|
92
|
+
explicitly, and a font with no shipped MIDI embeds whole. An unreadable MIDI or
|
|
93
|
+
SoundFont fails the build by name instead of shipping silently. The result and
|
|
94
|
+
both CLIs report each font's kept programs and byte saving: the reference bank
|
|
95
|
+
`data/microgm-opt.sf2` (2.6 MB, 137 presets, WTFPL, shipped in the npm package
|
|
96
|
+
for a game to copy into its assets) embeds as 25 KB for a piano-only track.
|
|
97
|
+
|
|
98
|
+
|
|
10
99
|
## [0.39.1] - 2026-10-15
|
|
11
100
|
|
|
12
101
|
Fixes the 0.39.0 publish gate on Linux: the WebP skip-shrink test asserted one
|