@datamoc/mw_games 0.38.0 → 0.40.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/api-surface.json +500 -2
  3. package/data/microgm-opt.PROVENANCE.md +20 -0
  4. package/data/microgm-opt.sf2 +0 -0
  5. package/dist/assets/SvgParts.d.ts +31 -0
  6. package/dist/assets/SvgParts.d.ts.map +1 -0
  7. package/dist/assets/SvgParts.js +54 -0
  8. package/dist/assets/SvgParts.js.map +1 -0
  9. package/dist/assets/SvgSource.d.ts +3 -0
  10. package/dist/assets/SvgSource.d.ts.map +1 -0
  11. package/dist/assets/SvgSource.js +22 -0
  12. package/dist/assets/SvgSource.js.map +1 -0
  13. package/dist/assets/index.d.ts +2 -0
  14. package/dist/assets/index.d.ts.map +1 -1
  15. package/dist/assets/index.js +1 -0
  16. package/dist/assets/index.js.map +1 -1
  17. package/dist/assets/svg.d.ts.map +1 -1
  18. package/dist/assets/svg.js +9 -5
  19. package/dist/assets/svg.js.map +1 -1
  20. package/dist/mw_games.global.js +110 -110
  21. package/dist/mwl/presentation.d.ts.map +1 -1
  22. package/dist/mwl/presentation.js +25 -18
  23. package/dist/mwl/presentation.js.map +1 -1
  24. package/dist/physics/PhysicsWorld.d.ts +49 -17
  25. package/dist/physics/PhysicsWorld.d.ts.map +1 -1
  26. package/dist/physics/PhysicsWorld.js +297 -59
  27. package/dist/physics/PhysicsWorld.js.map +1 -1
  28. package/dist/physics/XpbdWorld.d.ts +1 -1
  29. package/dist/physics/XpbdWorld.js +1 -1
  30. package/dist/physics/cloth/index.d.ts +98 -0
  31. package/dist/physics/cloth/index.d.ts.map +1 -0
  32. package/dist/physics/cloth/index.js +207 -0
  33. package/dist/physics/cloth/index.js.map +1 -0
  34. package/dist/physics/index.d.ts +4 -0
  35. package/dist/physics/index.d.ts.map +1 -1
  36. package/dist/physics/index.js +2 -0
  37. package/dist/physics/index.js.map +1 -1
  38. package/dist/physics/spring/index.d.ts +90 -0
  39. package/dist/physics/spring/index.d.ts.map +1 -0
  40. package/dist/physics/spring/index.js +97 -0
  41. package/dist/physics/spring/index.js.map +1 -0
  42. package/dist/skeleton/index.d.ts +94 -13
  43. package/dist/skeleton/index.d.ts.map +1 -1
  44. package/dist/skeleton/index.js +192 -73
  45. package/dist/skeleton/index.js.map +1 -1
  46. package/dist/two-d/presentation/MwlPresentation.d.ts +12 -0
  47. package/dist/two-d/presentation/MwlPresentation.d.ts.map +1 -1
  48. package/dist/two-d/presentation/MwlPresentation.js +204 -153
  49. package/dist/two-d/presentation/MwlPresentation.js.map +1 -1
  50. package/dist/two-d/render/ClothSprite.d.ts +83 -0
  51. package/dist/two-d/render/ClothSprite.d.ts.map +1 -0
  52. package/dist/two-d/render/ClothSprite.js +105 -0
  53. package/dist/two-d/render/ClothSprite.js.map +1 -0
  54. package/dist/two-d/render/HazeLayer.d.ts +112 -0
  55. package/dist/two-d/render/HazeLayer.d.ts.map +1 -0
  56. package/dist/two-d/render/HazeLayer.js +185 -0
  57. package/dist/two-d/render/HazeLayer.js.map +1 -0
  58. package/dist/two-d/render/NeonGlow.d.ts +100 -0
  59. package/dist/two-d/render/NeonGlow.d.ts.map +1 -0
  60. package/dist/two-d/render/NeonGlow.js +183 -0
  61. package/dist/two-d/render/NeonGlow.js.map +1 -0
  62. package/dist/two-d/render/SkeletalSprite.d.ts +5 -2
  63. package/dist/two-d/render/SkeletalSprite.d.ts.map +1 -1
  64. package/dist/two-d/render/SkeletalSprite.js +27 -3
  65. package/dist/two-d/render/SkeletalSprite.js.map +1 -1
  66. package/dist/two-d/render/SpringSprite.d.ts +40 -0
  67. package/dist/two-d/render/SpringSprite.d.ts.map +1 -0
  68. package/dist/two-d/render/SpringSprite.js +39 -0
  69. package/dist/two-d/render/SpringSprite.js.map +1 -0
  70. package/dist/two-d/render/SpriteDeform.d.ts +156 -0
  71. package/dist/two-d/render/SpriteDeform.d.ts.map +1 -0
  72. package/dist/two-d/render/SpriteDeform.js +278 -0
  73. package/dist/two-d/render/SpriteDeform.js.map +1 -0
  74. package/dist/two-d/render/SvgSkeleton.d.ts +54 -0
  75. package/dist/two-d/render/SvgSkeleton.d.ts.map +1 -0
  76. package/dist/two-d/render/SvgSkeleton.js +112 -0
  77. package/dist/two-d/render/SvgSkeleton.js.map +1 -0
  78. package/dist/two-d/render/index.d.ts +12 -0
  79. package/dist/two-d/render/index.d.ts.map +1 -1
  80. package/dist/two-d/render/index.js +6 -0
  81. package/dist/two-d/render/index.js.map +1 -1
  82. package/dist/version.d.ts +1 -1
  83. package/dist/version.js +1 -1
  84. package/package.json +11 -7
  85. package/sbom.cdx.json +6 -58
  86. package/tools/asset-report.d.mts +37 -0
  87. package/tools/asset-report.mjs +157 -0
  88. package/tools/compile-resources.d.mts +24 -0
  89. package/tools/compile-resources.mjs +138 -5
  90. package/tools/emit-page.d.mts +9 -1
  91. package/tools/emit-page.mjs +31 -3
  92. package/tools/vite.mjs +6 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,81 @@ the public API may still change between minor versions.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.40.0] - 2026-10-15
11
+
12
+ A game that plays sampled MIDI no longer ships a whole SoundFont: the asset
13
+ compiler subsets the bank to the instruments its tracks actually use, and the
14
+ package now carries a small WTFPL General MIDI bank to subset from.
15
+
16
+ ### Added
17
+
18
+ - Build-time SoundFont subsetting: `compileResources`, `emitPage` and `mwgPage` now
19
+ embed `.mid`/`.midi` and `.sf2` assets, and every embedded SoundFont is subset to
20
+ the programs the embedded MIDI files actually use (`collectSoundFontUsage` over
21
+ the shipped tracks, drums as bank 128). `soundFont: false` embeds a font whole,
22
+ `soundFontUsage` (or `--soundfont-usage=bank:program,...`) names the programs
23
+ explicitly, and a font with no shipped MIDI embeds whole. An unreadable MIDI or
24
+ SoundFont fails the build by name instead of shipping silently. The result and
25
+ both CLIs report each font's kept programs and byte saving: the reference bank
26
+ `data/microgm-opt.sf2` (2.6 MB, 137 presets, WTFPL, shipped in the npm package
27
+ for a game to copy into its assets) embeds as 25 KB for a piano-only track.
28
+
29
+
30
+ ## [0.39.1] - 2026-10-15
31
+
32
+ Fixes the 0.39.0 publish gate on Linux: the WebP skip-shrink test asserted one
33
+ platform's encoder answer instead of the real guarantee, and failed where sharp
34
+ genuinely shrinks the noise fixture.
35
+
36
+ ### Fixed
37
+
38
+ - The WebP test embeds whichever encoding is smaller and asserts byte-exact output
39
+ with a lossless round-trip either way, instead of assuming the conversion always
40
+ loses on tiny noise.
41
+
42
+ ## [0.39.0] - 2026-10-15
43
+
44
+ The skeleton cluster (two-bone IK, joint limits, full clip channels, diagnostics, SVG
45
+ parts loading), the asset and deformation cluster (pinned deformation, SVG skeletons,
46
+ asset filtering and the embedded assets report), and the effects cluster (cloth, spring,
47
+ haze and neon glow, each with a stated frame budget and reduced-motion handling).
48
+ `PhysicsWorld` leaves `matter-js` behind for an in-repo solver, so the dependency is gone.
49
+
50
+ ### Added
51
+
52
+ - Pinned sprite deformation with atomic vertex batches and one GPU upload per batch, checked
53
+ against a local Pontifex bird with fixed attachments and unchanged UVs.
54
+ - `loadSvgSkeleton`: SVG limb extraction, authored/manifest pivots, rest-angle normalization
55
+ and automatic `SkeletalSprite` binding, including nested parts without duplicate drawing.
56
+ - `assetFiles` on `mwgPage`, `emitPage` and `compileResources`: exact embedding lists with
57
+ named failures for unknown entries and unchanged defaults when omitted.
58
+ - `mwg-assets` (`assetReport`): per-file raw/gzip/brotli weights with each share of
59
+ the compressed page, plus the embedded source inventory with byte-identical
60
+ duplicates grouped by hash.
61
+
62
+ - Two-bone skeleton IK with named unreachable-target failures, absolute local joint limits,
63
+ and translation/scale clip channels through `sampleTransformPose` and `advancePose`.
64
+ - Explicit `SkeletalSprite.setDiagnostics` overlay for bones, pivots, joints and tips.
65
+ - `loadSvgParts` / `releaseSvgParts`: named SVG group textures with resolution-aware caching,
66
+ compiled local-file asset support and a browser check against a local Pontifex vehicle.
67
+
68
+ - Pinned-point cloth (`Cloth` Verlet mesh plus textured `ClothSprite` on the 414 mesh
69
+ path) with gravity, wind, damping and a browser drape check; a damped 2D chase
70
+ `Spring` for secondary motion with a stated O(1) frame budget, plus a `SpringSprite`
71
+ debug line.
72
+ - `HazeLayer` (with `hazeField` / `paintHazePixels`): drifting atmospheric sheets on
73
+ stacked depth planes, checked in the browser over a painted harbour; `NeonGlow`
74
+ (with `glowFalloff` / `paintGlowPixels`): additive neon light with colour, radius,
75
+ intensity and flicker, checked in the browser over a dark lane of signs.
76
+
77
+ ### Removed
78
+
79
+ - The `matter-js` (and `@types/matter-js`) dependency: `PhysicsWorld` is recoded in TypeScript in this repo (semi-implicit Euler, impulse contacts, projected distance joints) with the same options, methods and signals. Bodies no longer spin: `angle` stays a display offset. The dropped `engine` field exposed the whole matter engine; nothing in this repo used it.
80
+ ### Fixed
81
+
82
+ - SVG group splitting retains group transforms, shared definitions and styles, and handles
83
+ nested self-closing groups. Skeleton creation reports cycles instead of overflowing the stack.
84
+
10
85
  ## [0.38.0] - 2026-10-14
11
86
 
12
87
  Optional MWL scene and UI composition with its bridge-editor example, the