@invarn/cibuild 2.3.1 → 2.3.3
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/cli.cjs +196 -18
- package/dist/src/yaml/steps/structural-facts.d.ts +87 -0
- package/dist/src/yaml/steps/structural-facts.d.ts.map +1 -1
- package/dist/src/yaml/steps/structural-facts.js +0 -0
- package/dist/src/yaml/steps/structural-facts.test.js +644 -2
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +1 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.js +16 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +49 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-fidelity-render-android.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/ui-fidelity-render-android.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAMpE,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,iDAAiD;AACjD,eAAO,MAAM,eAAe,6BAA8B,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAAwB,CAAC;AAE9D,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAC7D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAA0B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"ui-fidelity-render-android.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/ui-fidelity-render-android.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAMpE,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,iDAAiD;AACjD,eAA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AAC,OAAO,CAAC;CA0EpB"}
|
|
@@ -127,6 +127,11 @@ var referenceSpans = null;
|
|
|
127
127
|
// split per element id per screen, as an array of line texts), set in main()
|
|
128
128
|
// and read by the structural assembler. Null when none declared → no line facts.
|
|
129
129
|
var referenceLines = null;
|
|
130
|
+
// params.reference_typeface (Signal C typeface facts, typeface issue 04: the
|
|
131
|
+
// DESIGN font per element id per screen, as { family, weight }, built by the
|
|
132
|
+
// caller from Figma node metadata), set in main() and read by the structural
|
|
133
|
+
// assembler. Null when none declared → no typeface facts.
|
|
134
|
+
var referenceTypeface = null;
|
|
130
135
|
// params.reference_baseline (Signal C: 'figma' (default) or 'previous_render').
|
|
131
136
|
// Marks whether the appearance reference is the design (divergences) or the
|
|
132
137
|
// previous catalog render (regressions/drift, the no-Figma path).
|
|
@@ -673,7 +678,7 @@ function renderScreens(renderable, projectRoot) {
|
|
|
673
678
|
// geometry deltas vs reference_geometry) onto the screen entry, so the
|
|
674
679
|
// judge reads the signals from protocol-result.json without fetching
|
|
675
680
|
// artifacts. CONFIG.scale is the render density (dp = px / scale).
|
|
676
|
-
assembleStructural(entry, layoutSource, referenceGeometry, CONFIG.scale, referenceText, referenceColor, referenceBaseline, referenceFrame, proofKind, referenceSpans, referenceLines);
|
|
681
|
+
assembleStructural(entry, layoutSource, referenceGeometry, CONFIG.scale, referenceText, referenceColor, referenceBaseline, referenceFrame, proofKind, referenceSpans, referenceLines, referenceTypeface);
|
|
677
682
|
}
|
|
678
683
|
});
|
|
679
684
|
} finally {
|
|
@@ -773,6 +778,16 @@ function main() {
|
|
|
773
778
|
!Array.isArray(params.reference_lines)
|
|
774
779
|
? params.reference_lines
|
|
775
780
|
: null;
|
|
781
|
+
// Signal-C typeface reference (typeface issue 04): { "<Screen>":
|
|
782
|
+
// { "<elementId>": { family, weight } } } — the DESIGN font per element, from
|
|
783
|
+
// Figma node metadata. Diffed against the RESOLVED (painted) font the dump
|
|
784
|
+
// captured. Absent → no typeface facts.
|
|
785
|
+
referenceTypeface =
|
|
786
|
+
params.reference_typeface &&
|
|
787
|
+
typeof params.reference_typeface === 'object' &&
|
|
788
|
+
!Array.isArray(params.reference_typeface)
|
|
789
|
+
? params.reference_typeface
|
|
790
|
+
: null;
|
|
776
791
|
// Signal-C baseline marker: 'previous_render' when the appearance reference was
|
|
777
792
|
// sourced from the previous catalog render (no-Figma drift path), else 'figma'.
|
|
778
793
|
referenceBaseline =
|
|
@@ -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
|
-
|
|
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');
|