feat: add bundled variables.css to the Tokens Studio release pipeline - #5209
Conversation
|
@claude review |
|
Claude finished @pomfrida's task in 3m 23s —— View job PR Review — Tokens Studio CSS bundleReviewed the diff against Verified claims ✅
Findings1. const minScopes = Number(minSchemeScopes)If 2. Committed artifact stability is tied to an unpinned 3. Glob follows stale files if the export set ever shrinks (nit) 4. Minor
Overall: clean, minimal, and the risky-looking parts (concat ordering, self-exclusion, scheme scopes) all check out against the real files. 👍
|
|
@claude review |
|
Claude finished @pomfrida's task in 2m 28s —— View job PR Review — Tokens Studio CSS bundle (follow-up)Re-reviewed the current branch state. The two low-severity findings from the previous round are both resolved, and I verified the key behaviours by actually running the scripts rather than reading only. Clean change — nothing blocking. Previous findings — resolved ✅
Verified this round
Findings1. The const HEADER = `/* Do not edit directly … (concatenation of ${CSS_DIR}/) */\n`With the default args CI uses this is stable ( 2. Guard invocation depends on cwd being the package root (nit, no action needed) 3. Note
Overall: the risky-looking parts (concat ordering, self-exclusion, scheme scopes, threshold validation) all check out against the real files and a live run. 👍
|
…rd via import.meta.url
Closes #5201. Implements step 1 of the ADR-0010 (#5199) validation plan.
What
packages/eds-tokens/scripts/generate-css-bundle.mjs— globssrc/tokens/css/recursively (excluding only the output file itself), concatenates the files in sorted path order, and writes the committedsrc/tokens/css/variables.csswith a do-not-edit header. Plain concatenation — the bundle adds no behaviour on top of the generated files (colour-scheme behaviour is governed by ADR-0004; noprefers-color-schemefallback, per ADR-0013).scripts/assert-no-light-dark.mjsparameterised — optional file path and scheme-scope threshold arguments; defaults are unchanged so the 2.x_build:csschain behaves exactly as before. The threshold is validated (a non-numeric value would otherwise make the comparisons silently pass). The bundle script runs the guard on the output as a regression check (threshold 1 — the new export has exactly one block per scheme).tokens_studio_release.yaml— runsgenerate:css-bundleafter the TS token generation, so every Tokens Studio release PR regenerates the bundle alongside the nine source files.src/tokens/css/variables.csscommitted now — generated from the current token state so the bundle ships in the next beta without waiting for the next Tokens Studio release. It becomes importable as@equinor/eds-tokens/next/css/variables.cssthrough the./next/css/*wildcardpublish_tokens.yamlalready injects — no publish-workflow change needed.Notes
comfortabledensity is scoped at:rootin the bundle (not[data-density=comfortable]) because it is the base density of the saved EDS-CSS export — this mirrors the source files as-is.var()references are late-bound so order does not affect resolution; sorting only keeps the committed artifact deterministic.Verification
build/css/variables.min.css; fails correctly on inputs containinglight-dark(, missing a scheme scope, or given a non-numeric threshold[data-color-scheme=\"light\"]and one\"dark\"scope,compact/relaxeddensity scopes, and nolight-dark(