@ludic-labs/assembly 0.0.0-stage → 0.4.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 (78) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/LICENSE +2 -0
  3. package/README.md +50 -2
  4. package/dist/bake.d.ts +80 -0
  5. package/dist/bake.js +214 -0
  6. package/dist/browser.d.ts +89 -0
  7. package/dist/browser.js +534 -0
  8. package/dist/compat.d.ts +17 -0
  9. package/dist/compat.js +153 -0
  10. package/dist/compiler.d.ts +18 -0
  11. package/dist/compiler.js +1264 -0
  12. package/dist/diagnostics.d.ts +5 -0
  13. package/dist/diagnostics.js +8 -0
  14. package/dist/export.d.ts +54 -0
  15. package/dist/export.js +272 -0
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +3 -0
  18. package/dist/legacy.d.ts +36 -0
  19. package/dist/legacy.js +180 -0
  20. package/dist/math.d.ts +16 -0
  21. package/dist/math.js +62 -0
  22. package/dist/mesh.d.ts +11 -0
  23. package/dist/mesh.js +153 -0
  24. package/dist/motion.d.ts +63 -0
  25. package/dist/motion.js +1476 -0
  26. package/dist/pixel.d.ts +268 -0
  27. package/dist/pixel.js +942 -0
  28. package/dist/required.d.ts +2 -0
  29. package/dist/required.js +6 -0
  30. package/dist/shapes.d.ts +71 -0
  31. package/dist/shapes.js +396 -0
  32. package/dist/sprite-brief.d.ts +5 -0
  33. package/dist/sprite-brief.js +47 -0
  34. package/dist/sprite-compiler.d.ts +62 -0
  35. package/dist/sprite-compiler.js +1745 -0
  36. package/dist/sprite-decompile.d.ts +68 -0
  37. package/dist/sprite-decompile.js +786 -0
  38. package/dist/sprite-format.d.ts +4 -0
  39. package/dist/sprite-format.js +155 -0
  40. package/dist/sprite-guide.d.ts +40 -0
  41. package/dist/sprite-guide.js +330 -0
  42. package/dist/sprite-scene.d.ts +277 -0
  43. package/dist/sprite-scene.js +664 -0
  44. package/dist/sprite-types.d.ts +110 -0
  45. package/dist/sprite-types.js +1 -0
  46. package/dist/sprite.d.ts +8 -0
  47. package/dist/sprite.js +8 -0
  48. package/dist/svg/schema.d.ts +71 -0
  49. package/dist/svg/schema.js +217 -0
  50. package/dist/svg/types.d.ts +148 -0
  51. package/dist/svg/types.js +1 -0
  52. package/dist/svg.d.ts +26 -0
  53. package/dist/svg.js +539 -0
  54. package/dist/text.d.ts +12 -0
  55. package/dist/text.js +75 -0
  56. package/dist/types.d.ts +478 -0
  57. package/dist/types.js +1 -0
  58. package/docs/svg/README.md +150 -0
  59. package/docs/svg/specification.md +108 -0
  60. package/examples/svg/arcane-shield.json +261 -0
  61. package/examples/svg/aurora-ribbon.json +158 -0
  62. package/examples/svg/bouncing-ember.json +76 -0
  63. package/examples/svg/ember-fountain.json +224 -0
  64. package/examples/svg/lantern-keeper.json +1159 -0
  65. package/examples/svg/night-workshop.json +1120 -0
  66. package/examples/svg/waygate-platform.json +64 -0
  67. package/examples/svg/waygate-spark.json +92 -0
  68. package/examples/svg/waygate-wisp.json +105 -0
  69. package/examples/svg/waygate.json +485 -0
  70. package/package.json +132 -4
  71. package/schemas/asset-assembly-0.1.schema.json +354 -0
  72. package/schemas/asset-assembly-0.2.schema.json +429 -0
  73. package/schemas/asset-assembly-0.3.schema.json +572 -0
  74. package/schemas/motion-set-0.1.schema.json +178 -0
  75. package/schemas/pixel-sprite-0.1.schema.json +892 -0
  76. package/schemas/pixel-sprite-scene-0.1.schema.json +149 -0
  77. package/schemas/svg-asset-0.1.schema.json +1157 -0
  78. package/tools/svg-asset.mjs +106 -0
@@ -0,0 +1,485 @@
1
+ {
2
+ "schema": "svg-asset/0.1",
3
+ "name": "Waygate bloom",
4
+ "viewBox": [0, 0, 480, 480],
5
+ "seed": 2026,
6
+ "params": {
7
+ "turn": {
8
+ "default": 0,
9
+ "min": 0,
10
+ "max": 360
11
+ },
12
+ "pulse": {
13
+ "default": 1,
14
+ "min": 0.9,
15
+ "max": 1.1
16
+ },
17
+ "open": {
18
+ "default": 1,
19
+ "min": 0,
20
+ "max": 1
21
+ }
22
+ },
23
+ "palette": {
24
+ "aqua": "#8af6db",
25
+ "gold": "#f5d598",
26
+ "blue": "#658de3"
27
+ },
28
+ "gradients": {
29
+ "aura": {
30
+ "kind": "radial",
31
+ "center": [240, 240],
32
+ "radius": 188,
33
+ "stops": [
34
+ {
35
+ "offset": 0,
36
+ "color": "#2e6694",
37
+ "opacity": 0
38
+ },
39
+ {
40
+ "offset": 0.62,
41
+ "color": "#48d6cb",
42
+ "opacity": 0.12
43
+ },
44
+ {
45
+ "offset": 0.78,
46
+ "color": "#5ce5d4",
47
+ "opacity": 0.5
48
+ },
49
+ {
50
+ "offset": 1,
51
+ "color": "#4dc4cd",
52
+ "opacity": 0
53
+ }
54
+ ]
55
+ },
56
+ "core": {
57
+ "kind": "radial",
58
+ "center": [240, 240],
59
+ "radius": 140,
60
+ "stops": [
61
+ {
62
+ "offset": 0,
63
+ "color": "#162b48",
64
+ "opacity": 0.2
65
+ },
66
+ {
67
+ "offset": 0.8,
68
+ "color": "#345d88",
69
+ "opacity": 0.6
70
+ },
71
+ {
72
+ "offset": 1,
73
+ "color": "#75cbd1",
74
+ "opacity": 0.8
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ "masks": {
80
+ "ring": [
81
+ {
82
+ "id": "field",
83
+ "kind": "rect",
84
+ "x": 0,
85
+ "y": 0,
86
+ "width": 480,
87
+ "height": 480,
88
+ "radius": 0,
89
+ "style": {
90
+ "fill": "#ffffff"
91
+ }
92
+ },
93
+ {
94
+ "id": "hole",
95
+ "kind": "ellipse",
96
+ "cx": 240,
97
+ "cy": 240,
98
+ "rx": 112,
99
+ "ry": 112,
100
+ "style": {
101
+ "fill": "#000000"
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ "symbols": {
107
+ "sigil": {
108
+ "children": [
109
+ {
110
+ "id": "rune",
111
+ "kind": "path",
112
+ "d": [
113
+ ["M", -5, 8],
114
+ ["L", 0, -8],
115
+ ["L", 5, 8],
116
+ ["M", -3, 1],
117
+ ["L", 5, 1]
118
+ ],
119
+ "style": {
120
+ "fill": "none",
121
+ "stroke": "@gold",
122
+ "strokeWidth": 2,
123
+ "linecap": "round",
124
+ "linejoin": "round"
125
+ }
126
+ }
127
+ ]
128
+ }
129
+ },
130
+ "animations": {
131
+ "summon": {
132
+ "duration": 2,
133
+ "loop": false,
134
+ "tracks": {
135
+ "open": [
136
+ {
137
+ "time": 0,
138
+ "value": 0,
139
+ "ease": "smooth"
140
+ },
141
+ {
142
+ "time": 0.2,
143
+ "value": 0.08,
144
+ "ease": "smooth"
145
+ },
146
+ {
147
+ "time": 0.8,
148
+ "value": 1,
149
+ "ease": "smooth"
150
+ },
151
+ {
152
+ "time": 1.2,
153
+ "value": 0.94,
154
+ "ease": "smooth"
155
+ },
156
+ {
157
+ "time": 2,
158
+ "value": 1,
159
+ "ease": "smooth"
160
+ }
161
+ ],
162
+ "turn": [
163
+ {
164
+ "time": 0,
165
+ "value": 0,
166
+ "ease": "smooth"
167
+ },
168
+ {
169
+ "time": 2,
170
+ "value": 120,
171
+ "ease": "smooth"
172
+ }
173
+ ],
174
+ "pulse": [
175
+ {
176
+ "time": 0,
177
+ "value": 0.9,
178
+ "ease": "smooth"
179
+ },
180
+ {
181
+ "time": 0.8,
182
+ "value": 1.1,
183
+ "ease": "smooth"
184
+ },
185
+ {
186
+ "time": 2,
187
+ "value": 1,
188
+ "ease": "smooth"
189
+ }
190
+ ]
191
+ }
192
+ },
193
+ "orbit": {
194
+ "duration": 4,
195
+ "loop": true,
196
+ "tracks": {
197
+ "turn": [
198
+ {
199
+ "time": 0,
200
+ "value": 0,
201
+ "ease": "linear"
202
+ },
203
+ {
204
+ "time": 4,
205
+ "value": 360
206
+ }
207
+ ],
208
+ "pulse": [
209
+ {
210
+ "time": 0,
211
+ "value": 1,
212
+ "ease": "smooth"
213
+ },
214
+ {
215
+ "time": 2,
216
+ "value": 1.055,
217
+ "ease": "smooth"
218
+ },
219
+ {
220
+ "time": 4,
221
+ "value": 1,
222
+ "ease": "smooth"
223
+ }
224
+ ]
225
+ }
226
+ }
227
+ },
228
+ "defaultAnimation": "orbit",
229
+ "nodes": [
230
+ {
231
+ "id": "portal",
232
+ "kind": "group",
233
+ "children": [
234
+ {
235
+ "id": "outer-aura",
236
+ "kind": "ellipse",
237
+ "cx": 240,
238
+ "cy": 240,
239
+ "rx": 188,
240
+ "ry": 188,
241
+ "style": {
242
+ "fill": {
243
+ "gradient": "aura"
244
+ }
245
+ }
246
+ },
247
+ {
248
+ "id": "interior",
249
+ "kind": "ellipse",
250
+ "cx": 240,
251
+ "cy": 240,
252
+ "rx": 135,
253
+ "ry": 135,
254
+ "style": {
255
+ "fill": {
256
+ "gradient": "core"
257
+ }
258
+ }
259
+ },
260
+ {
261
+ "id": "halo",
262
+ "kind": "group",
263
+ "children": [
264
+ {
265
+ "id": "soft-ring",
266
+ "kind": "ellipse",
267
+ "cx": 240,
268
+ "cy": 240,
269
+ "rx": 142,
270
+ "ry": 142,
271
+ "style": {
272
+ "fill": "none",
273
+ "stroke": "@aqua",
274
+ "strokeWidth": 8
275
+ },
276
+ "blur": 5
277
+ },
278
+ {
279
+ "id": "edge",
280
+ "kind": "path",
281
+ "d": [
282
+ ["M", 382, 240],
283
+ ["A", 142, 142, 0, 1, 1, 98, 240],
284
+ ["A", 142, 142, 0, 1, 1, 382, 240]
285
+ ],
286
+ "style": {
287
+ "fill": "none",
288
+ "stroke": "@aqua",
289
+ "strokeWidth": 3,
290
+ "linecap": "round",
291
+ "linejoin": "round"
292
+ }
293
+ },
294
+ {
295
+ "id": "inner-edge",
296
+ "kind": "path",
297
+ "d": [
298
+ ["M", 370, 240],
299
+ ["A", 130, 130, 0, 1, 1, 110, 240],
300
+ ["A", 130, 130, 0, 1, 1, 370, 240]
301
+ ],
302
+ "style": {
303
+ "fill": "none",
304
+ "stroke": "@blue",
305
+ "strokeWidth": 1.5,
306
+ "linecap": "round",
307
+ "linejoin": "round"
308
+ }
309
+ }
310
+ ],
311
+ "transform": {
312
+ "pivot": [240, 240],
313
+ "scale": ["$pulse", "$pulse"]
314
+ }
315
+ },
316
+ {
317
+ "id": "runes",
318
+ "kind": "group",
319
+ "children": [
320
+ {
321
+ "id": "orbit-marks",
322
+ "kind": "repeat",
323
+ "count": 16,
324
+ "children": [
325
+ {
326
+ "id": "mark",
327
+ "kind": "group",
328
+ "children": [
329
+ {
330
+ "id": "rune",
331
+ "kind": "use",
332
+ "symbol": "sigil",
333
+ "transform": {
334
+ "translate": [0, -156]
335
+ }
336
+ }
337
+ ],
338
+ "transform": {
339
+ "translate": [240, 240],
340
+ "rotate": ["mul", "$i", 22.5]
341
+ }
342
+ }
343
+ ]
344
+ },
345
+ {
346
+ "id": "ticks",
347
+ "kind": "repeat",
348
+ "count": 64,
349
+ "children": [
350
+ {
351
+ "id": "tick",
352
+ "kind": "path",
353
+ "d": [
354
+ ["M", 0, -171],
355
+ ["L", 0, -175]
356
+ ],
357
+ "style": {
358
+ "fill": "none",
359
+ "stroke": "@aqua",
360
+ "strokeWidth": 1,
361
+ "linecap": "round",
362
+ "linejoin": "round"
363
+ },
364
+ "opacity": 0.55,
365
+ "transform": {
366
+ "translate": [240, 240],
367
+ "rotate": ["mul", "$i", 5.625]
368
+ }
369
+ }
370
+ ]
371
+ }
372
+ ],
373
+ "transform": {
374
+ "pivot": [240, 240],
375
+ "rotate": "$turn"
376
+ },
377
+ "mask": "ring"
378
+ },
379
+ {
380
+ "id": "swirls",
381
+ "kind": "group",
382
+ "children": [
383
+ {
384
+ "id": "ribbon-a",
385
+ "kind": "path",
386
+ "d": [
387
+ ["M", 92, 261],
388
+ ["C", 44, 131, 247, 35, 348, 130]
389
+ ],
390
+ "style": {
391
+ "fill": "none",
392
+ "stroke": "@aqua",
393
+ "strokeWidth": 5,
394
+ "linecap": "round",
395
+ "linejoin": "round"
396
+ }
397
+ },
398
+ {
399
+ "id": "ribbon-b",
400
+ "kind": "path",
401
+ "d": [
402
+ ["M", 388, 219],
403
+ ["C", 436, 349, 233, 445, 132, 350]
404
+ ],
405
+ "style": {
406
+ "fill": "none",
407
+ "stroke": "@blue",
408
+ "strokeWidth": 5,
409
+ "linecap": "round",
410
+ "linejoin": "round"
411
+ }
412
+ },
413
+ {
414
+ "id": "trail-a",
415
+ "kind": "path",
416
+ "d": [
417
+ ["M", 88, 281],
418
+ ["C", 53, 327, 119, 410, 205, 391]
419
+ ],
420
+ "style": {
421
+ "fill": "none",
422
+ "stroke": "@gold",
423
+ "strokeWidth": 2,
424
+ "linecap": "round",
425
+ "linejoin": "round"
426
+ }
427
+ },
428
+ {
429
+ "id": "trail-b",
430
+ "kind": "path",
431
+ "d": [
432
+ ["M", 392, 199],
433
+ ["C", 427, 153, 361, 70, 275, 89]
434
+ ],
435
+ "style": {
436
+ "fill": "none",
437
+ "stroke": "@gold",
438
+ "strokeWidth": 2,
439
+ "linecap": "round",
440
+ "linejoin": "round"
441
+ }
442
+ }
443
+ ],
444
+ "transform": {
445
+ "pivot": [240, 240],
446
+ "rotate": ["mul", -1, "$turn"]
447
+ }
448
+ },
449
+ {
450
+ "id": "motes",
451
+ "kind": "emitter",
452
+ "count": 36,
453
+ "lifetime": 4,
454
+ "mode": "loop",
455
+ "velocity": [
456
+ ["mul", ["cos", ["rand", 0, 0, 6.283185]], 42],
457
+ ["mul", ["sin", ["rand", 0, 0, 6.283185]], 42]
458
+ ],
459
+ "children": [
460
+ {
461
+ "id": "light",
462
+ "kind": "ellipse",
463
+ "cx": 0,
464
+ "cy": 0,
465
+ "rx": ["rand", 1, 1, 3],
466
+ "ry": ["rand", 1, 1, 3],
467
+ "style": {
468
+ "fill": "@aqua"
469
+ },
470
+ "opacity": ["sin", ["mul", 3.141592653589793, "$age"]]
471
+ }
472
+ ],
473
+ "transform": {
474
+ "translate": [240, 240]
475
+ }
476
+ }
477
+ ],
478
+ "opacity": "$open",
479
+ "transform": {
480
+ "pivot": [240, 240],
481
+ "scale": ["$open", "$open"]
482
+ }
483
+ }
484
+ ]
485
+ }
package/package.json CHANGED
@@ -1,6 +1,134 @@
1
1
  {
2
2
  "name": "@ludic-labs/assembly",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Deterministic declarative low-poly asset assemblies, characters, diagnostics and CPU bakes.",
5
+ "type": "module",
6
+ "license": "UNLICENSED",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/VictorQueiroz/ludic-assembly.git"
10
+ },
11
+ "homepage": "https://libraries.ludic-assembly.victorqueiroz.dev",
12
+ "engines": {
13
+ "node": ">=24"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "schemas",
18
+ "README.md",
19
+ "CHANGELOG.md",
20
+ "LICENSE",
21
+ "docs/svg",
22
+ "examples/svg",
23
+ "tools/svg-asset.mjs"
24
+ ],
25
+ "sideEffects": false,
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ },
31
+ "./compat": {
32
+ "types": "./dist/compat.d.ts",
33
+ "import": "./dist/compat.js"
34
+ },
35
+ "./bake": {
36
+ "types": "./dist/bake.d.ts",
37
+ "import": "./dist/bake.js"
38
+ },
39
+ "./pixel": {
40
+ "types": "./dist/pixel.d.ts",
41
+ "import": "./dist/pixel.js"
42
+ },
43
+ "./browser": {
44
+ "types": "./dist/browser.d.ts",
45
+ "import": "./dist/browser.js"
46
+ },
47
+ "./schema": "./schemas/asset-assembly-0.1.schema.json",
48
+ "./schema/asset-assembly-0.2": "./schemas/asset-assembly-0.2.schema.json",
49
+ "./schema/asset-assembly-0.3": "./schemas/asset-assembly-0.3.schema.json",
50
+ "./schema/motion-set-0.1": "./schemas/motion-set-0.1.schema.json",
51
+ "./export": {
52
+ "types": "./dist/export.d.ts",
53
+ "import": "./dist/export.js"
54
+ },
55
+ "./text": {
56
+ "types": "./dist/text.d.ts",
57
+ "import": "./dist/text.js"
58
+ },
59
+ "./sprite": {
60
+ "types": "./dist/sprite.d.ts",
61
+ "import": "./dist/sprite.js"
62
+ },
63
+ "./schema/pixel-sprite-0.1": "./schemas/pixel-sprite-0.1.schema.json",
64
+ "./schema/pixel-sprite-scene-0.1": "./schemas/pixel-sprite-scene-0.1.schema.json",
65
+ "./svg": {
66
+ "types": "./dist/svg.d.ts",
67
+ "import": "./dist/svg.js"
68
+ },
69
+ "./schema/svg-asset-0.1": "./schemas/svg-asset-0.1.schema.json"
70
+ },
71
+ "scripts": {
72
+ "build": "node node_modules/typescript7/bin/tsc -p tsconfig.json",
73
+ "test": "npm run build && node --test tests/*.test.mjs",
74
+ "typecheck": "node node_modules/typescript7/bin/tsc -p tsconfig.json --noEmit && node node_modules/typescript7/bin/tsc -p tsconfig.docs.json --noEmit",
75
+ "format": "prettier --write .",
76
+ "format:check": "prettier --check .",
77
+ "build:docs": "npm run build && node tools/build-site.mjs && npm run test:seo && npm run test:llms",
78
+ "test:browser": "node tools/verify-browser.mjs && node tools/verify-shell.mjs && node tools/verify-pixel.mjs",
79
+ "benchmark": "node benchmarks/run.mjs",
80
+ "prepack": "npm run build",
81
+ "test:city": "node tools/verify-city.mjs",
82
+ "lint": "eslint . --max-warnings=0",
83
+ "prepare": "husky",
84
+ "dev": "vite",
85
+ "test:seo": "node tools/verify-seo.mjs",
86
+ "test:llms": "node tools/verify-llms.mjs",
87
+ "test:dev": "node tools/verify-dev.mjs",
88
+ "build:svg-demo": "npm run build && node tools/build-svg-demo.mjs",
89
+ "test:svg-browser": "npm run build:svg-demo && node tools/verify-svg.mjs",
90
+ "test:waygate": "node tools/verify-waygate.mjs"
91
+ },
92
+ "publishConfig": {
93
+ "registry": "https://registry.npmjs.org",
94
+ "access": "public"
95
+ },
96
+ "devDependencies": {
97
+ "@eslint/js": "10.0.1",
98
+ "@ludic-assembly/eslint": "*",
99
+ "@playwright/test": "1.64.1",
100
+ "@types/node": "26.6.6",
101
+ "@types/pngjs": "6.0.5",
102
+ "@types/react": "19.3.0",
103
+ "@types/react-dom": "19.3.0",
104
+ "@vitejs/plugin-react": "6.2.1",
105
+ "ajv": "8.18.0",
106
+ "esbuild": "0.27.4",
107
+ "eslint": "10.14.0",
108
+ "eslint-plugin-react-hooks": "7.1.1",
109
+ "globals": "17.14.0",
110
+ "gltf-validator": "2.0.0-dev.3.10",
111
+ "husky": "9.1.7",
112
+ "lint-staged": "17.6.0",
113
+ "parse5": "8.1.0",
114
+ "pngjs": "7.0.0",
115
+ "prettier": "3.9.10",
116
+ "react": "19.3.1",
117
+ "react-dom": "19.3.1",
118
+ "sharp": "0.35.0",
119
+ "svgo": "4.0.1",
120
+ "three": "0.187.0",
121
+ "turndown": "7.2.5",
122
+ "turndown-plugin-gfm": "1.0.2",
123
+ "typescript": "6.0.2",
124
+ "typescript7": "npm:typescript@7.0.2",
125
+ "vite": "8.3.5"
126
+ },
127
+ "workspaces": [
128
+ "tooling/eslint"
129
+ ],
130
+ "bin": {
131
+ "ludic-svg": "./tools/svg-asset.mjs"
132
+ },
133
+ "gitHead": "ce7e3e431bd5b9c76bf80d1b02492ba60120cd9d"
134
+ }