cornhsu-parity 0.9.7 → 0.10.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.
Files changed (2) hide show
  1. package/README.md +27 -7
  2. package/package.json +7 -5
package/README.md CHANGED
@@ -1,11 +1,23 @@
1
1
  # Parity
2
2
 
3
3
  [![NuGet](https://img.shields.io/nuget/v/Cornhsu.Parity.svg?label=Cornhsu.Parity)](https://www.nuget.org/packages/Cornhsu.Parity)
4
- [![Downloads](https://img.shields.io/nuget/dt/Cornhsu.Parity.svg)](https://www.nuget.org/packages/Cornhsu.Parity)
4
+ [![npm](https://img.shields.io/npm/v/cornhsu-parity.svg?label=cornhsu-parity)](https://www.npmjs.com/package/cornhsu-parity)
5
+ [![Marketplace](https://img.shields.io/badge/GitHub_Marketplace-Action-2ea44f?logo=github)](https://github.com/marketplace/actions/parity-design-fidelity-check)
5
6
  [![CI](https://github.com/HSU-YU-MING/cornhsu-parity/actions/workflows/ci.yml/badge.svg)](https://github.com/HSU-YU-MING/cornhsu-parity/actions/workflows/ci.yml)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
8
 
8
- **[作品介紹與開發故事](https://cornhsu.com/parity) · [NuGet](https://www.nuget.org/packages/Cornhsu.Parity) · MIT**
9
+ **[作品介紹與開發故事](https://cornhsu.com/parity) · [GitHub Marketplace](https://github.com/marketplace/actions/parity-design-fidelity-check) · [npm](https://www.npmjs.com/package/cornhsu-parity) · [NuGet](https://www.nuget.org/packages/Cornhsu.Parity) · MIT**
10
+
11
+ ## GitHub Action
12
+
13
+ ```yaml
14
+ - uses: HSU-YU-MING/cornhsu-parity@v0.10.1 # 0.x 期間 pin 版本;發 1.0 後可改用移動式 @v1
15
+ with:
16
+ config: parity.config.json # 選填,預設 parity.config.json
17
+ target: /pricing # 選填,只檢查這個 route(省略 = 全部)
18
+ ```
19
+
20
+ 落差超過 gate 門檻就讓 CI 失敗,並把還原度報告貼成 PR 留言(原地更新不洗版)。
9
21
 
10
22
  > **能進 CI 的設計還原度檢查(Property-Level Design QA)。**
11
23
  > 抓 Figma 設計稿與實際渲染畫面**兩邊的真實數值**做程式比對——「內距 8px,設計是 12px」,
@@ -42,11 +54,11 @@
42
54
 
43
55
  | | |
44
56
  |---|---|
45
- | 發佈 | NuGet 共 13 版(v0.1.0 → v0.9.3),推 tag 即以 OIDC Trusted Publishing 自動上架,repo 內零長效金鑰 |
57
+ | 發佈 | NuGet 共 19 版(v0.1.0 → v0.10.1),推 tag 即以 OIDC Trusted Publishing 自動上架,repo 內零長效金鑰 |
46
58
  | 比對維度 | 尺寸、內距、間距、字體、顏色(CIEDE2000 ΔE)、相對位置——**刻意不比絕對座標**(彈性版面下必然誤報) |
47
59
  | 設計來源 | 4 種:Figma API、畫面快照、圖片 + 標註(像素取樣,任何工具匯出 PNG 即可)、JSON |
48
60
  | 實作端 | 網頁(含 **Shadow DOM / 同源 iframe / RWD 多斷點**)+ **Electron**(以 CDP attach 活視窗) |
49
- | 測試 | **154 條**,涵蓋 CIEDE2000 標準測資集(Sharma)、配對消歧、位置誤報防護、圖片取樣 |
61
+ | 測試 | **159 條**,涵蓋 CIEDE2000 標準測資集(Sharma)、配對消歧、位置誤報防護、圖片取樣 |
50
62
  | CI 實證 | GitHub Action 以**外部 repo 跑真實 PR** 驗證:擋 PR、自動留言(原地更新不洗版)、baseline 回歸把關 |
51
63
  | 真實驗證 | **cornhsu.com 全站 20 頁由 Parity 自己守門**——首日 dogfooding 即揪出並修掉兩個 flaky 根因 |
52
64
 
@@ -63,7 +75,7 @@ dotnet tool install -g Cornhsu.Parity
63
75
  ```
64
76
 
65
77
  > npm 版是同一份自帶執行環境的原生執行檔,只下載你這個平台的那一份
66
- > (win32-x64 / linux-x64 / darwin-x64 / darwin-arm64)。
78
+ > (win32-x64 / win32-arm64 / linux-x64 / linux-arm64 / darwin-x64 / darwin-arm64)。
67
79
  > Playwright 預設會另外自帶一份 Node,npm 版把它拿掉、改用你現成的 Node,
68
80
  > 每個平台包因此省下約 88 MB。
69
81
 
@@ -251,7 +263,7 @@ jobs:
251
263
  - run: |
252
264
  npm ci && npm run build
253
265
  npm run preview & # 例:serve 在 localhost:8080
254
- - uses: HSU-YU-MING/cornhsu-parity@v1
266
+ - uses: HSU-YU-MING/cornhsu-parity@v0.10.1 # 0.x 期間 pin 版本;發 1.0 後可改用移動式 @v1
255
267
  with:
256
268
  config: parity.config.json
257
269
  figma-token: ${{ secrets.FIGMA_TOKEN }} # 設計來源用本機 JSON 時可省略
@@ -264,7 +276,7 @@ jobs:
264
276
 
265
277
  action 輸入:`config` / `target` / `working-directory` / `version` / `figma-token` / `baseline`(回歸模式) / `comment`(關掉 PR 留言) / `upload-report`。
266
278
 
267
- > action 透過 `dotnet tool install -g Cornhsu.Parity` 安裝,需先把套件發佈到 nuget.org(發佈是 release 步驟,尚未做)。本 repo 的 `.github/workflows/ci.yml` 則是**直接從原始碼建置**並跑離線示範自我把關,不依賴發佈。
279
+ > action 透過 `dotnet tool install -g Cornhsu.Parity` 安裝(已發佈於 nuget.org)。本 repo 的 `.github/workflows/ci.yml` 則是**直接從原始碼建置**並跑離線示範自我把關,不依賴發佈。
268
280
 
269
281
  ## 回歸把關:baseline(M5)
270
282
 
@@ -300,6 +312,14 @@ parity baseline list # 看歷史快照(含分數欄 = 還原度走勢,給 PM
300
312
  - Figma token 走環境變數(`env:FIGMA_TOKEN`),不進 log、不進 URL(用 `X-Figma-Token` header)
301
313
  - 抓過的 frame 存 `.parity/cache`(已 gitignore),重跑不再打 Figma、可離線比對
302
314
 
315
+ ## 另見
316
+
317
+ [**XamlContrast**](https://github.com/HSU-YU-MING/cornhsu-xamlcontrast) —— 同作者的姊妹專案,
318
+ 同一套哲學(數值檢查、CI 把關)。Parity 回答「**實作跟設計稿一不一樣**」(還原度);
319
+ XamlContrast 回答「**做出來的東西看不看得見**」(WCAG 對比,靜態掃 XAML 原始碼)。
320
+ 一個守還原度、一個守可讀性;它的靜態顏色解析也是本專案未來
321
+ `WpfImplementationSource`(桌面 adapter)的預期值地基——見規畫書 4.5 節補記。
322
+
303
323
  ## License
304
324
 
305
325
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cornhsu-parity",
3
- "version": "0.9.7",
3
+ "version": "0.10.1",
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,9 +34,11 @@
34
34
  "node": ">=18"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@cornhsu/parity-win32-x64": "0.9.7",
38
- "@cornhsu/parity-linux-x64": "0.9.7",
39
- "@cornhsu/parity-darwin-x64": "0.9.7",
40
- "@cornhsu/parity-darwin-arm64": "0.9.7"
37
+ "@cornhsu/parity-win32-x64": "0.10.1",
38
+ "@cornhsu/parity-win32-arm64": "0.10.1",
39
+ "@cornhsu/parity-linux-x64": "0.10.1",
40
+ "@cornhsu/parity-linux-arm64": "0.10.1",
41
+ "@cornhsu/parity-darwin-x64": "0.10.1",
42
+ "@cornhsu/parity-darwin-arm64": "0.10.1"
41
43
  }
42
44
  }