Repository navigation
Drop the token build step - #11
Merged
Merged
Conversation
tokens.json is read directly by people and agents, and no product consumes a generated file. The north-star app now turns tokens.json into CSS variables when it starts, and validates it there. Removes build/, the committed src/tokens.css and the CI staleness check; CI runs the app build instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
tokens.jsoncan be read directly by people and agents, and no product consumes a generated file. The only user ofsrc/tokens.csswas the north-star app, so the conversion now lives there.build/, the committedsrc/tokens.css, thenode buildcommand, and the CI check that the generated file was current.north-star/tokens-css.tsturnstokens.jsoninto CSS variables. A small plugin innorth-star/vite.config.tsruns it when the app starts or builds.pnpm --dir north-star build, which validatestokens.jsonand typechecks the app.build/; it readstokens.jsonitself.What this gives up
A ready-made CSS file a product could copy. That is needed when Desktop adopts, and the format is a decision to make with the Desktop developer then.
How to check
pnpm install pnpm run dev # http://localhost:8732 pnpm run buildChecked locally:
src/tokens.css, apart from its two header comments.tokens.jsonfails the build with a message naming the role.tokens.jsonwhile the dev server runs restarts it with the new values.pnpm install --frozen-lockfilepasses.