Skip to content

Commit 0dce377

Browse files
committed
[TEMP] For rebasing
1 parent 0a70135 commit 0dce377

5 files changed

Lines changed: 381 additions & 47 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Local token cache produced by --tokens-cache (safe to delete/regenerate)
2+
.tokens-cache.json
3+
*.tokens-cache.json

copilot-plans/hds-tokens-verify/tooling/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,34 @@ node copilot-plans/hds-tokens-verify/tooling/verify-tokens.mjs \
6363
| `--config <path>` | Config file (default: `./config/hds-pilot.config.json` next to the script). |
6464
| `--root <path>` | Repo root to scan (default: current working directory). |
6565
| `--tokens-css <path>` | Explicit path to the official `tokens.css` (overrides dependency resolution). |
66+
| `--tokens-cache <path>` | Cache the resolved official-token list to this file and reuse it on later runs (skips dependency resolution + `tokens.css` parsing). Useful when running repeatedly against an unchanging tokens package. |
67+
| `--refresh-cache` | Ignore an existing `--tokens-cache` file and rebuild it. |
6668
| `--out <dir>` | Output directory for report files (default: `../reports/<reportSubdir>` next to the script). |
6769
| `--json` | Also print the machine-readable summary to stdout. |
70+
| `--skip-clean-report` | Do not write the report files when the audit finds no invalid tokens (leaves any existing report untouched). |
71+
72+
## Repeated runs (e.g. during a rebase)
73+
74+
When running the audit many times in a row — such as at each step of a rebase to
75+
catch tokens mangled by merge conflicts — two flags keep the footprint minimal:
76+
77+
```bash
78+
node copilot-plans/hds-tokens-verify/tooling/verify-tokens.mjs \
79+
--tokens-cache copilot-plans/hds-tokens-verify/tooling/.tokens-cache.json \
80+
--skip-clean-report
81+
```
82+
83+
- `--tokens-cache` resolves and parses the tokens package **once**, then reuses
84+
the cached list (`source: postcss, cached`) on every subsequent run. Delete the
85+
cache file (or pass `--refresh-cache`) if the tokens package changes.
86+
- `--skip-clean-report` means a clean step prints its summary but does **not**
87+
touch the report files, so no spurious diffs appear while you rebase. Steps that
88+
do find invalid tokens still write the report for inspection.
89+
90+
Note: with `--skip-clean-report`, a clean run leaves any **previous** report in
91+
place (it is neither updated nor deleted), so a report on disk may reflect an
92+
earlier step. Delete it manually if you want a truly clean tree.
93+
6894

6995
## Exit codes
7096

copilot-plans/hds-tokens-verify/tooling/reports/hds/token-usage-audit.json

Lines changed: 189 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"generatedAt": "2026-07-09T15:58:36.576Z",
2+
"generatedAt": "2026-07-09T17:20:04.977Z",
33
"prefix": "--hds-",
44
"tokenSource": {
55
"path": "packages/tokens/dist/products/css/tokens.css",
66
"kind": "dependency",
7-
"parseMode": "postcss"
7+
"parseMode": "postcss",
8+
"fromCache": false
89
},
910
"roots": [
1011
"packages/components/src",
@@ -30,15 +31,194 @@
3031
"website"
3132
],
3233
"summary": {
33-
"officialTokens": 801,
34+
"officialTokens": 818,
3435
"allowlistTokens": 97,
35-
"validTokens": 898,
36-
"filesScanned": 3102,
37-
"totalTokenUsages": 1975,
36+
"validTokens": 915,
37+
"filesScanned": 3116,
38+
"totalTokenUsages": 1989,
3839
"interpolatedUsages": 63,
3940
"commentedUsages": 0,
40-
"distinctInvalidTokens": 0,
41-
"totalInvalidOccurrences": 0
41+
"distinctInvalidTokens": 13,
42+
"totalInvalidOccurrences": 20
4243
},
43-
"invalidTokens": []
44+
"invalidTokens": [
45+
{
46+
"token": "--hds-app-side-nav-color-surface-primary",
47+
"occurrences": 4,
48+
"locations": [
49+
{
50+
"file": "showcase/app/styles/showcase-pages/app-side-nav.scss",
51+
"line": 9,
52+
"column": 47
53+
},
54+
{
55+
"file": "showcase/app/styles/showcase-pages/carbonization/app-side-nav.scss",
56+
"line": 11,
57+
"column": 47
58+
},
59+
{
60+
"file": "showcase/app/styles/showcase-pages/carbonization/focus-ring.scss",
61+
"line": 30,
62+
"column": 21
63+
},
64+
{
65+
"file": "showcase/app/styles/showcase-pages/focus-ring.scss",
66+
"line": 24,
67+
"column": 21
68+
}
69+
]
70+
},
71+
{
72+
"token": "--hds-app-side-nav-interactive-surface-color-default",
73+
"occurrences": 1,
74+
"locations": [
75+
{
76+
"file": "packages/components/src/styles/components/app-header.scss",
77+
"line": 122,
78+
"column": 23
79+
}
80+
]
81+
},
82+
{
83+
"token": "--hds-code-block-syntax-highlight-color-white",
84+
"occurrences": 3,
85+
"locations": [
86+
{
87+
"file": "packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts",
88+
"line": 81,
89+
"column": 17
90+
},
91+
{
92+
"file": "packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts",
93+
"line": 85,
94+
"column": 17
95+
},
96+
{
97+
"file": "packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts",
98+
"line": 121,
99+
"column": 17
100+
}
101+
]
102+
},
103+
{
104+
"token": "--hds-color-background-highlight",
105+
"occurrences": 1,
106+
"locations": [
107+
{
108+
"file": "website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss",
109+
"line": 11,
110+
"column": 19
111+
}
112+
]
113+
},
114+
{
115+
"token": "--hds-copy-button-surface-color-focus",
116+
"occurrences": 1,
117+
"locations": [
118+
{
119+
"file": "packages/components/src/styles/components/copy/button.scss",
120+
"line": 34,
121+
"column": 27
122+
}
123+
]
124+
},
125+
{
126+
"token": "--hds-modal-header-tagline-critical",
127+
"occurrences": 1,
128+
"locations": [
129+
{
130+
"file": "packages/components/src/styles/components/modal.scss",
131+
"line": 74,
132+
"column": 16
133+
}
134+
]
135+
},
136+
{
137+
"token": "--hds-modal-header-tagline-warning",
138+
"occurrences": 1,
139+
"locations": [
140+
{
141+
"file": "packages/components/src/styles/components/modal.scss",
142+
"line": 59,
143+
"column": 16
144+
}
145+
]
146+
},
147+
{
148+
"token": "--hds-typography-body-base-font-family",
149+
"occurrences": 1,
150+
"locations": [
151+
{
152+
"file": "website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss",
153+
"line": 9,
154+
"column": 20
155+
}
156+
]
157+
},
158+
{
159+
"token": "--hds-typography-body-base-font-size",
160+
"occurrences": 1,
161+
"locations": [
162+
{
163+
"file": "website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss",
164+
"line": 8,
165+
"column": 18
166+
}
167+
]
168+
},
169+
{
170+
"token": "--hds-typography-body-base-line-height",
171+
"occurrences": 1,
172+
"locations": [
173+
{
174+
"file": "website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss",
175+
"line": 10,
176+
"column": 20
177+
}
178+
]
179+
},
180+
{
181+
"token": "--hds-value-box-shadow",
182+
"occurrences": 2,
183+
"locations": [
184+
{
185+
"file": "website/app/components/doc/token-preview/index.gts",
186+
"line": 156,
187+
"column": 17
188+
},
189+
{
190+
"file": "website/app/styles/doc-components/token-preview.scss",
191+
"line": 87,
192+
"column": 21
193+
}
194+
]
195+
},
196+
{
197+
"token": "--hds-value-height",
198+
"occurrences": 2,
199+
"locations": [
200+
{
201+
"file": "website/app/components/doc/token-preview/index.gts",
202+
"line": 149,
203+
"column": 17
204+
},
205+
{
206+
"file": "website/app/styles/doc-components/token-preview.scss",
207+
"line": 49,
208+
"column": 17
209+
}
210+
]
211+
},
212+
{
213+
"token": "--hds-var-code-block-color-lang-css-punctuatione",
214+
"occurrences": 1,
215+
"locations": [
216+
{
217+
"file": "packages/components/src/styles/components/code-block/theme.scss",
218+
"line": 210,
219+
"column": 18
220+
}
221+
]
222+
}
223+
]
44224
}
Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Token Usage Audit
22

3-
- Generated: 2026-07-09T15:58:36.576Z
3+
- Generated: 2026-07-09T17:20:04.977Z
44
- Prefix audited: `--hds-`
55
- Token source: `packages/tokens/dist/products/css/tokens.css` (dependency, parsed via postcss)
66
- Roots scanned: `packages/components/src`, `showcase/app`, `showcase/tests`, `website/app`, `website/docs`
@@ -11,16 +11,48 @@
1111

1212
| Metric | Count |
1313
| --- | ---: |
14-
| Official tokens | 801 |
14+
| Official tokens | 818 |
1515
| Allowlist tokens | 97 |
16-
| Valid tokens (union) | 898 |
17-
| Files scanned | 3102 |
18-
| Total token usages | 1975 |
16+
| Valid tokens (union) | 915 |
17+
| Files scanned | 3116 |
18+
| Total token usages | 1989 |
1919
| Interpolated usages (skipped) | 63 |
20-
| Distinct invalid tokens | 0 |
21-
| Total invalid occurrences | 0 |
20+
| Distinct invalid tokens | 13 |
21+
| Total invalid occurrences | 20 |
2222

2323
## Invalid tokens
2424

25-
No invalid token usages found. ✅
25+
### `packages/components`
26+
27+
6 invalid token(s), 8 occurrence(s).
28+
29+
| Token | Occurrences | Locations |
30+
| --- | ---: | --- |
31+
| `--hds-app-side-nav-interactive-surface-color-default` | 1 | packages/components/src/styles/components/app-header.scss:122 |
32+
| `--hds-code-block-syntax-highlight-color-white` | 3 | packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts:81<br>packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts:85<br>packages/components/src/modifiers/hds-code-editor/highlight-styles/hds-highlight-style.ts:121 |
33+
| `--hds-copy-button-surface-color-focus` | 1 | packages/components/src/styles/components/copy/button.scss:34 |
34+
| `--hds-modal-header-tagline-critical` | 1 | packages/components/src/styles/components/modal.scss:74 |
35+
| `--hds-modal-header-tagline-warning` | 1 | packages/components/src/styles/components/modal.scss:59 |
36+
| `--hds-var-code-block-color-lang-css-punctuatione` | 1 | packages/components/src/styles/components/code-block/theme.scss:210 |
37+
38+
### `showcase`
39+
40+
1 invalid token(s), 4 occurrence(s).
41+
42+
| Token | Occurrences | Locations |
43+
| --- | ---: | --- |
44+
| `--hds-app-side-nav-color-surface-primary` | 4 | showcase/app/styles/showcase-pages/app-side-nav.scss:9<br>showcase/app/styles/showcase-pages/carbonization/app-side-nav.scss:11<br>showcase/app/styles/showcase-pages/carbonization/focus-ring.scss:30<br>showcase/app/styles/showcase-pages/focus-ring.scss:24 |
45+
46+
### `website`
47+
48+
6 invalid token(s), 8 occurrence(s).
49+
50+
| Token | Occurrences | Locations |
51+
| --- | ---: | --- |
52+
| `--hds-color-background-highlight` | 1 | website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss:11 |
53+
| `--hds-typography-body-base-font-family` | 1 | website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss:9 |
54+
| `--hds-typography-body-base-font-size` | 1 | website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss:8 |
55+
| `--hds-typography-body-base-line-height` | 1 | website/docs/foundations/tokens/partials/code/code-snippets/tokens-in-styles.scss:10 |
56+
| `--hds-value-box-shadow` | 2 | website/app/components/doc/token-preview/index.gts:156<br>website/app/styles/doc-components/token-preview.scss:87 |
57+
| `--hds-value-height` | 2 | website/app/components/doc/token-preview/index.gts:149<br>website/app/styles/doc-components/token-preview.scss:49 |
2658

0 commit comments

Comments
 (0)