Fix tokens.json import in DesignTokens story - #159
Merged
Conversation
- Change DesignTokens.stories.tsx to import from tokens/tokens.json (source) instead of public/tokens.json, eliminating the Vite warning - Add inline semantic color tokens in the story to preserve rendering - Update tokens-story-sync hook to watch source file - Add CDN dependency notes to generate-tokens.ts and README
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.
Closes #132
Summary
Changes the
DesignTokens.stories.tsximport from../../public/tokens.jsonto../../tokens/tokens.json(the source file), eliminating Vite's warning about importing assets from the public directory.Changes
src/stories/DesignTokens.stories.tsx— Import from source; add inline semantic color tokens so the Semantic Colors section still rendersscripts/generate-tokens.ts— Added docs noting the CDN dependency onpublic/tokens.jsonREADME.md— Added warning callout not to removepublic/tokens.json(used by external tools via jsdelivr).kiro/hooks/tokens-story-sync.kiro.hook— Updated to watchtokens/tokens.jsoninstead ofpublic/tokens.jsonWhat was tested
pnpm run typecheck— passespnpm run lint— passes (0 errors)pnpm run build-storybook— builds cleanly, no public directory warningpnpm run test— 466 tests passCDN note
public/tokens.jsonremains committed and generated bybuild:tokens. The jsdelivr CDN URL is unaffected: