Skip to content

Commit 56dbbcf

Browse files
committed
docs(tokens): comment sweep
Kept: the module contracts, the RESOLVED_BY_HAND source quotes, the document-convention notes (brace inheritance, ellipsis stems, section overlap dedup), and the branch-policy traps (exact-before-manual, prose- mixed cells). Removed: a signature paraphrase, two notes duplicating the module docs or per-entry reasons, and a CI step comment restating the step name. Rewritten: the kebab docstring down to its invariant, a false claim about apps/docs handling, and the two workflow trigger notes unified.
1 parent 6d2350a commit 56dbbcf

5 files changed

Lines changed: 6 additions & 17 deletions

File tree

.github/workflows/pr-check-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
# branches filter matches the base. Remove after the stack lands.
1717
- token-usage-guard
1818
- 'ds2-**'
19-
# DS 2.0 integration branch — same feedback as PRs to main.
19+
# Long-lived DS 2.0 integration branch; merges into main at the end.
2020
- ds-2.0
2121
paths:
2222
- 'apps/docs/**'

.github/workflows/pr-check.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ on:
1616
# branches filter matches the base. Remove after the stack lands.
1717
- token-usage-guard
1818
- 'ds2-**'
19-
# DS 2.0 integration branch — PRs targeting it need the same feedback
20-
# as PRs to main (it all merges into main at the end of the migration).
19+
# Long-lived DS 2.0 integration branch; merges into main at the end.
2120
- ds-2.0
2221

2322
permissions:
@@ -158,8 +157,6 @@ jobs:
158157
run: pnpm lint:styles
159158

160159
- name: Codemod map reproducibility
161-
# codemod-map.json is a committed artifact; it must match what its
162-
# generator produces from the checked-in designer changelog.
163160
run: |
164161
pnpm --filter @workflowbuilder/ui-tokens codemod:map
165162
git diff --exit-code -- packages/tokens/codemod-map.json

packages/tokens/scripts/build-codemod-map.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ function toCss(figmaName, prefix) {
114114
const oldCss = (name) => toCss(name, '--ax-');
115115
const newCss = (name) => toCss(name, '--wb-');
116116

117-
/** Splits a markdown table row into trimmed cells. */
118117
function cells(row) {
119118
return row
120119
.replace(/^\|/, '')
@@ -192,8 +191,6 @@ for (const line of lines) {
192191
const [oldCell, newCell] = cells(line);
193192
if (oldCell === undefined || newCell === undefined) continue;
194193

195-
// A fully-written brace list becomes the inheritance context for `{…}`
196-
// rows below it in the same table.
197194
const fullBrace = oldCell.match(/\{([^}]+)\}/);
198195
if (fullBrace && fullBrace[1].includes(',')) {
199196
lastBraceList = fullBrace[1].split(',').map((part) => part.trim());
@@ -261,8 +258,6 @@ for (const line of lines) {
261258
removed.push(removedEntry(oldName, null, context));
262259
}
263260
} else {
264-
// More candidates than a positional or clean-consolidation match allows
265-
// — prose-mixed cell; do not guess.
266261
unparsed.push({ section, row: line.trim() });
267262
}
268263
}
@@ -283,7 +278,6 @@ const map = {
283278
// Primitives keep their names 1:1 under the new namespace; validated
284279
// against the real 2.0 export by the manifest when it lands.
285280
prefixRules: [{ oldCssPrefix: '--ax-colors-', newCssPrefix: '--wb-colors-' }],
286-
// Not expressible as 1:1 renames — handled inside their component tasks:
287281
manual: [
288282
{
289283
pattern: '--ax-chips-*',

packages/tokens/scripts/codemod-usages.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
* names that exist in today's token dist (a real gap that will dangle after
1313
* the pipeline switch) and component-local names that need no rewrite.
1414
*
15-
* Dry-run by default; pass --write to modify files. apps/docs is excluded
16-
* (not part of the shipped packages; its one usage is handled in the docs
17-
* workflow separately).
15+
* Dry-run by default; pass --write to modify files. apps/docs is excluded —
16+
* it is not part of the shipped packages.
1817
*
1918
* Usage: node scripts/codemod-usages.mjs [--write]
2019
*/

packages/tokens/src/validate-collisions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ function collectLeaves(node: TokenNode, path: string[], out: { path: string; val
3434
}
3535
}
3636

37-
/** The emitted CSS name: Style Dictionary's `name/kebab` transform runs
38-
* change-case's kebabCase over the space-joined token path — use the same
39-
* function so the two can never drift. */
37+
/** Must match Style Dictionary's `name/kebab` output — same function
38+
* (change-case), same input shape, so the two cannot drift. */
4039
function toCssName(tokenPath: string): string {
4140
return `--${kebabCase(tokenPath.split('/').join(' '))}`;
4241
}

0 commit comments

Comments
 (0)