@invarn/cibuild 2.3.1 → 2.3.2

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.
@@ -50,7 +50,9 @@ const FAKE_GRADLEW_LINES = [
50
50
  // explicit golden-style dotted name via FAKE_ROBORAZZI_LAYOUT_NAME to prove
51
51
  // the consumer finds it by dot-segment match, decoupled from the PNG stem.
52
52
  ' lname="${FAKE_ROBORAZZI_LAYOUT_NAME:-$s.layout.json}"',
53
- ` printf '%s' '{"canvas":{"left":0,"top":0,"right":200,"bottom":400},"nodes":[{"id":"card","bounds":{"left":20,"top":20,"right":180,"bottom":200},"parentId":null,"clipsChildren":true},{"id":"tag","bounds":{"left":60,"top":150,"right":140,"bottom":224},"parentId":"card","clipsChildren":false}]}' > "$out/$lname"`,
53
+ // The tag node carries the resolved-typeface enrichment (a Roboto fallback)
54
+ // so a run with reference_typeface can prove the params → fact plumbing.
55
+ ` printf '%s' '{"renderSdk":34,"canvas":{"left":0,"top":0,"right":200,"bottom":400},"nodes":[{"id":"card","bounds":{"left":20,"top":20,"right":180,"bottom":200},"parentId":null,"clipsChildren":true},{"id":"tag","bounds":{"left":60,"top":150,"right":140,"bottom":224},"parentId":"card","clipsChildren":false,"text":"TAG","resolvedTypeface":{"family":"Roboto-Regular","weight":400}}]}' > "$out/$lname"`,
54
56
  ' fi',
55
57
  'done',
56
58
  'exit 0',
@@ -440,6 +442,52 @@ describe('android render runtime — render + trim (happy path)', () => {
440
442
  expect(tag?.sizeFlag).toBe(false);
441
443
  expect(tag?.deltas).toEqual([]);
442
444
  });
445
+ test('derives a flagged typeface fact when reference_typeface is given and the resolved font diverges (typeface issue 04)', async () => {
446
+ // The fake dump resolved Roboto-Regular 400 on `tag`; the design declares
447
+ // Poppins 600 → exactly one typeface fact on the run result. A matching
448
+ // declaration on a second run produces none.
449
+ const project = makeProject({
450
+ screens: { XProof: 'x.png' },
451
+ reference_typeface: { XProof: { tag: { family: 'Poppins', weight: 600 } } },
452
+ });
453
+ writeReference(project, 'x.png');
454
+ stageArchive(project, gradleProjectEntries());
455
+ const run = runScript(project, await buildScript(), {
456
+ FAKE_ROBORAZZI_SCREENS: 'XProof',
457
+ FAKE_ROBORAZZI_LAYOUT: '1',
458
+ });
459
+ expect(run.status).toBe(0);
460
+ const screen = readResult(project).screens.find((s) => s.screen === 'XProof');
461
+ const typefaceFacts = (screen?.structural?.appearance?.facts ?? []).filter((f) => f.kind === 'typeface');
462
+ expect(typefaceFacts).toEqual([
463
+ {
464
+ kind: 'typeface',
465
+ elementId: 'tag',
466
+ channel: 'text',
467
+ rendered: { family: 'Roboto-Regular', weight: 400 },
468
+ reference: { family: 'Poppins', weight: 600 },
469
+ },
470
+ ]);
471
+ // The resolved font is persisted as the next drift baseline.
472
+ expect(screen?.structural?.appearance?.rendered?.typeface).toEqual({
473
+ tag: { family: 'Roboto-Regular', weight: 400 },
474
+ });
475
+ // Matching declaration → no typeface fact (and no advisory).
476
+ const clean = makeProject({
477
+ screens: { XProof: 'x.png' },
478
+ reference_typeface: { XProof: { tag: { family: 'Roboto-Regular', weight: 400 } } },
479
+ });
480
+ writeReference(clean, 'x.png');
481
+ stageArchive(clean, gradleProjectEntries());
482
+ const cleanRun = runScript(clean, await buildScript(), {
483
+ FAKE_ROBORAZZI_SCREENS: 'XProof',
484
+ FAKE_ROBORAZZI_LAYOUT: '1',
485
+ });
486
+ expect(cleanRun.status).toBe(0);
487
+ const cleanScreen = readResult(clean).screens.find((s) => s.screen === 'XProof');
488
+ expect((cleanScreen?.structural?.appearance?.facts ?? []).filter((f) => f.kind === 'typeface')).toEqual([]);
489
+ expect(cleanScreen?.structural?.appearance?.advisories).toBeUndefined();
490
+ });
443
491
  test('finds the layout dump by dot-segment match even when its name differs from the PNG stem', async () => {
444
492
  const project = makeProject({ screens: { XProof: 'x.png' } });
445
493
  writeReference(project, 'x.png');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invarn/cibuild",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "CI Build CLI — local pipeline orchestration and validation",
5
5
  "type": "module",
6
6
  "main": "dist/cli.cjs",