@patterkit/compiler 0.5.0 → 0.6.1
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/dist/index.cjs +14 -2
- package/dist/index.js +14 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -362,6 +362,8 @@ function compileNode(node, foreign) {
|
|
|
362
362
|
shared: node.shared,
|
|
363
363
|
options: node.options,
|
|
364
364
|
children: node.children.map((c) => compileNode(c, foreign)),
|
|
365
|
+
padAfterDefault: node.padAfterDefault,
|
|
366
|
+
// line padding: the default for the beats inside
|
|
365
367
|
gameData: node.gameData,
|
|
366
368
|
tags: node.tags,
|
|
367
369
|
// author tags (#215), accumulated at runtime
|
|
@@ -379,6 +381,8 @@ function compileNode(node, foreign) {
|
|
|
379
381
|
beats: node.beats,
|
|
380
382
|
onEnter: node.onEnter?.map((e) => compileEffect(e, foreign)),
|
|
381
383
|
onExit: node.onExit?.map((e) => compileEffect(e, foreign)),
|
|
384
|
+
padAfterDefault: node.padAfterDefault,
|
|
385
|
+
// line padding: the default for the beats inside
|
|
382
386
|
gameData: node.gameData,
|
|
383
387
|
tags: node.tags,
|
|
384
388
|
// author tags (#215)
|
|
@@ -396,6 +400,8 @@ function compileBlock(block, foreign) {
|
|
|
396
400
|
...block.gameId ? { gameId: block.gameId } : {},
|
|
397
401
|
// host-facing address; runtime falls back to the name slug
|
|
398
402
|
children: block.children.map((c) => compileNode(c, foreign)),
|
|
403
|
+
padAfterDefault: block.padAfterDefault,
|
|
404
|
+
// line padding: the default for the beats inside
|
|
399
405
|
gameData: block.gameData,
|
|
400
406
|
tags: block.tags
|
|
401
407
|
// author tags (#215)
|
|
@@ -408,6 +414,8 @@ function compileScene(scene, foreign) {
|
|
|
408
414
|
name: scene.name,
|
|
409
415
|
...scene.gameId ? { gameId: scene.gameId } : {},
|
|
410
416
|
// host-facing address; runtime falls back to the name slug
|
|
417
|
+
padAfterDefault: scene.padAfterDefault,
|
|
418
|
+
// line padding: the default for the beats inside
|
|
411
419
|
gameData: scene.gameData,
|
|
412
420
|
tags: scene.tags,
|
|
413
421
|
// author tags (#215)
|
|
@@ -473,7 +481,8 @@ function exportBundle(input) {
|
|
|
473
481
|
strings,
|
|
474
482
|
properties: project.properties ?? [],
|
|
475
483
|
...foreignScopes ? { scopeRegistry: foreignScopes } : {},
|
|
476
|
-
...qualifiers.length > 0 ? { qualifiers } : {}
|
|
484
|
+
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
485
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {}
|
|
477
486
|
}, { trailingComma: false })),
|
|
478
487
|
// Structure-only fingerprint (live bundle refresh): the same hash with the string tables left
|
|
479
488
|
// out. Same structureHash + a different hash = a text-only edit, safe to swap in place with
|
|
@@ -483,7 +492,8 @@ function exportBundle(input) {
|
|
|
483
492
|
scenes: scenesOut,
|
|
484
493
|
properties: project.properties ?? [],
|
|
485
494
|
...foreignScopes ? { scopeRegistry: foreignScopes } : {},
|
|
486
|
-
...qualifiers.length > 0 ? { qualifiers } : {}
|
|
495
|
+
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
496
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {}
|
|
487
497
|
}, { trailingComma: false }))
|
|
488
498
|
},
|
|
489
499
|
voiced: project.voiced ?? false,
|
|
@@ -500,6 +510,8 @@ function exportBundle(input) {
|
|
|
500
510
|
return m;
|
|
501
511
|
}),
|
|
502
512
|
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
513
|
+
// The project's own line-padding default, only when it sets one: absent, every runtime uses the built-in one.
|
|
514
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {},
|
|
503
515
|
properties: project.properties,
|
|
504
516
|
scopeRegistry: hostScopes,
|
|
505
517
|
gameDataFields: project.gameDataFields,
|
package/dist/index.js
CHANGED
|
@@ -328,6 +328,8 @@ function compileNode(node, foreign) {
|
|
|
328
328
|
shared: node.shared,
|
|
329
329
|
options: node.options,
|
|
330
330
|
children: node.children.map((c) => compileNode(c, foreign)),
|
|
331
|
+
padAfterDefault: node.padAfterDefault,
|
|
332
|
+
// line padding: the default for the beats inside
|
|
331
333
|
gameData: node.gameData,
|
|
332
334
|
tags: node.tags,
|
|
333
335
|
// author tags (#215), accumulated at runtime
|
|
@@ -345,6 +347,8 @@ function compileNode(node, foreign) {
|
|
|
345
347
|
beats: node.beats,
|
|
346
348
|
onEnter: node.onEnter?.map((e) => compileEffect(e, foreign)),
|
|
347
349
|
onExit: node.onExit?.map((e) => compileEffect(e, foreign)),
|
|
350
|
+
padAfterDefault: node.padAfterDefault,
|
|
351
|
+
// line padding: the default for the beats inside
|
|
348
352
|
gameData: node.gameData,
|
|
349
353
|
tags: node.tags,
|
|
350
354
|
// author tags (#215)
|
|
@@ -362,6 +366,8 @@ function compileBlock(block, foreign) {
|
|
|
362
366
|
...block.gameId ? { gameId: block.gameId } : {},
|
|
363
367
|
// host-facing address; runtime falls back to the name slug
|
|
364
368
|
children: block.children.map((c) => compileNode(c, foreign)),
|
|
369
|
+
padAfterDefault: block.padAfterDefault,
|
|
370
|
+
// line padding: the default for the beats inside
|
|
365
371
|
gameData: block.gameData,
|
|
366
372
|
tags: block.tags
|
|
367
373
|
// author tags (#215)
|
|
@@ -374,6 +380,8 @@ function compileScene(scene, foreign) {
|
|
|
374
380
|
name: scene.name,
|
|
375
381
|
...scene.gameId ? { gameId: scene.gameId } : {},
|
|
376
382
|
// host-facing address; runtime falls back to the name slug
|
|
383
|
+
padAfterDefault: scene.padAfterDefault,
|
|
384
|
+
// line padding: the default for the beats inside
|
|
377
385
|
gameData: scene.gameData,
|
|
378
386
|
tags: scene.tags,
|
|
379
387
|
// author tags (#215)
|
|
@@ -439,7 +447,8 @@ function exportBundle(input) {
|
|
|
439
447
|
strings,
|
|
440
448
|
properties: project.properties ?? [],
|
|
441
449
|
...foreignScopes ? { scopeRegistry: foreignScopes } : {},
|
|
442
|
-
...qualifiers.length > 0 ? { qualifiers } : {}
|
|
450
|
+
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
451
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {}
|
|
443
452
|
}, { trailingComma: false })),
|
|
444
453
|
// Structure-only fingerprint (live bundle refresh): the same hash with the string tables left
|
|
445
454
|
// out. Same structureHash + a different hash = a text-only edit, safe to swap in place with
|
|
@@ -449,7 +458,8 @@ function exportBundle(input) {
|
|
|
449
458
|
scenes: scenesOut,
|
|
450
459
|
properties: project.properties ?? [],
|
|
451
460
|
...foreignScopes ? { scopeRegistry: foreignScopes } : {},
|
|
452
|
-
...qualifiers.length > 0 ? { qualifiers } : {}
|
|
461
|
+
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
462
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {}
|
|
453
463
|
}, { trailingComma: false }))
|
|
454
464
|
},
|
|
455
465
|
voiced: project.voiced ?? false,
|
|
@@ -466,6 +476,8 @@ function exportBundle(input) {
|
|
|
466
476
|
return m;
|
|
467
477
|
}),
|
|
468
478
|
...qualifiers.length > 0 ? { qualifiers } : {},
|
|
479
|
+
// The project's own line-padding default, only when it sets one: absent, every runtime uses the built-in one.
|
|
480
|
+
...typeof project.padAfterDefault === "number" ? { padAfterDefault: project.padAfterDefault } : {},
|
|
469
481
|
properties: project.properties,
|
|
470
482
|
scopeRegistry: hostScopes,
|
|
471
483
|
gameDataFields: project.gameDataFields,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patterkit/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Patter compiler: compile condition/effect expressions, validate them, and export source to the runtime bundle.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patterkit/model": "0.
|
|
38
|
-
"@patterkit/core": "0.
|
|
39
|
-
"@patterkit/dialect": "0.2.
|
|
37
|
+
"@patterkit/model": "0.13.0",
|
|
38
|
+
"@patterkit/core": "0.6.1",
|
|
39
|
+
"@patterkit/dialect": "0.2.9",
|
|
40
40
|
"@wildwinter/expr": "^0.5.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|