cornhsu-parity 2.3.0 → 2.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.
- package/README.md +8 -2
- package/bin/parity.js +8 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -63,11 +63,11 @@ PR comment, updating the same comment rather than adding new ones.
|
|
|
63
63
|
|
|
64
64
|
| | |
|
|
65
65
|
|---|---|
|
|
66
|
-
| Releases |
|
|
66
|
+
| Releases | 33 on NuGet (v0.1.0 → v2.4.0). Pushing a tag publishes via OIDC Trusted Publishing — zero long-lived keys in the repo |
|
|
67
67
|
| Compared properties | Size, padding, spacing, typography, color (CIEDE2000 ΔE), relative position — **absolute coordinates are deliberately excluded** (they are guaranteed false positives in a flexible layout) |
|
|
68
68
|
| Design sources | 4: the Figma API, a rendering snapshot, an image + annotations (pixel sampling — any tool that exports a PNG works), or JSON |
|
|
69
69
|
| Implementation sources | The web (including **shadow DOM, same-origin iframes, and multiple responsive breakpoints**) plus **Electron** (attached to the live window over CDP) |
|
|
70
|
-
| Tests | **
|
|
70
|
+
| Tests | **1503**, covering the CIEDE2000 reference data set (Sharma), match disambiguation, position false-positive guards, image sampling, and real-browser capture regressions |
|
|
71
71
|
| Proven in CI | The GitHub Action is validated by **real PRs in an external repo**: blocking the PR, commenting automatically (updating in place), and baseline regression gating |
|
|
72
72
|
| Proven in production | **All 26 pages of cornhsu.com are gated by Parity itself** — dogfooding has already found and fixed three flaky root causes (most recently a scroll-triggered entrance animation; see 0.11.1) |
|
|
73
73
|
|
|
@@ -301,6 +301,12 @@ Only the things that should hold no matter how the layout flows:
|
|
|
301
301
|
axes are compared.
|
|
302
302
|
- **Padding / spacing**: all four padding edges, and auto-layout `itemSpacing` against the real
|
|
303
303
|
gap between child elements.
|
|
304
|
+
- A design's padding is often built with a child's `margin` instead (`padding: 0` on the
|
|
305
|
+
container, `margin: 12px 20px` on what is inside). The page looks the same, so from 2.4 that
|
|
306
|
+
edge counts as padding + margin of the child nearest it — but only when the sum matches the
|
|
307
|
+
design and the margin really sits inside the container (a margin that collapses out of a block
|
|
308
|
+
container leaves no space inside and still reports). When it doesn't match, the report shows
|
|
309
|
+
the CSS padding as before.
|
|
304
310
|
- **Relative position** (`offsetX`/`offsetY`): for children of freely positioned (non-auto-layout)
|
|
305
311
|
containers, the offset relative to the nearest reliable sibling or parent edge — which is what
|
|
306
312
|
catches "size and color are perfect, but it is in the wrong place." Only reliable edges are used
|
package/bin/parity.js
CHANGED
|
@@ -51,10 +51,16 @@ try {
|
|
|
51
51
|
const manifest = require.resolve(`${target.pkg}/package.json`);
|
|
52
52
|
binary = path.join(path.dirname(manifest), "bin", target.bin);
|
|
53
53
|
} catch {
|
|
54
|
+
// npm 對選用相依是解析不到、下載不到都不報錯,所以這裡是使用者第一次看到問題的地方。
|
|
55
|
+
// npx 的安裝放在 npm-cache/_npx/<hash>/,半成品會一直被重用:叫人 npm install 修不到它(2.3.1 實測)。
|
|
56
|
+
const npxCache = __dirname.match(/^(.*[\\/]_npx[\\/][^\\/]+)[\\/]/)?.[1];
|
|
54
57
|
console.error(
|
|
55
58
|
`cornhsu-parity: the platform package ${target.pkg} is not installed.\n` +
|
|
56
|
-
`
|
|
57
|
-
`
|
|
59
|
+
`npm skips optional dependencies without an error, so this happens with --no-optional / --omit=optional, ` +
|
|
60
|
+
`after an interrupted install, or while a new release is still reaching the npm registry.\n` +
|
|
61
|
+
(npxCache
|
|
62
|
+
? `npx cached this incomplete install, so running it again will not help. Delete this folder, then run npx again:\n ${npxCache}`
|
|
63
|
+
: `Reinstall: npm install cornhsu-parity`)
|
|
58
64
|
);
|
|
59
65
|
process.exit(EXECUTION_ERROR);
|
|
60
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cornhsu-parity",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Property-Level Design QA that can gate your CI. Compares real numeric values from your Figma file against the rendered UI and fails the PR when the implementation drifts from the design.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"figma",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"node": ">=20"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@cornhsu/parity-win32-x64": "2.
|
|
38
|
-
"@cornhsu/parity-win32-arm64": "2.
|
|
39
|
-
"@cornhsu/parity-linux-x64": "2.
|
|
40
|
-
"@cornhsu/parity-linux-arm64": "2.
|
|
41
|
-
"@cornhsu/parity-darwin-x64": "2.
|
|
42
|
-
"@cornhsu/parity-darwin-arm64": "2.
|
|
37
|
+
"@cornhsu/parity-win32-x64": "2.4.0",
|
|
38
|
+
"@cornhsu/parity-win32-arm64": "2.4.0",
|
|
39
|
+
"@cornhsu/parity-linux-x64": "2.4.0",
|
|
40
|
+
"@cornhsu/parity-linux-arm64": "2.4.0",
|
|
41
|
+
"@cornhsu/parity-darwin-x64": "2.4.0",
|
|
42
|
+
"@cornhsu/parity-darwin-arm64": "2.4.0"
|
|
43
43
|
}
|
|
44
44
|
}
|