Skip to content

Fix tokens.json import in DesignTokens story - #159

Merged
pglevy merged 1 commit into
mainfrom
fix/tokens-import-132
Jul 21, 2026
Merged

Fix tokens.json import in DesignTokens story#159
pglevy merged 1 commit into
mainfrom
fix/tokens-import-132

Conversation

@pglevy

@pglevy pglevy commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Closes #132

Summary

Changes the DesignTokens.stories.tsx import from ../../public/tokens.json to ../../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 renders
  • scripts/generate-tokens.ts — Added docs noting the CDN dependency on public/tokens.json
  • README.md — Added warning callout not to remove public/tokens.json (used by external tools via jsdelivr)
  • .kiro/hooks/tokens-story-sync.kiro.hook — Updated to watch tokens/tokens.json instead of public/tokens.json

What was tested

  • pnpm run typecheck — passes
  • pnpm run lint — passes (0 errors)
  • pnpm run build-storybook — builds cleanly, no public directory warning
  • pnpm run test — 466 tests pass

CDN note

public/tokens.json remains committed and generated by build:tokens. The jsdelivr CDN URL is unaffected:

https://cdn.jsdelivr.net/gh/pglevy/sailwind@main/public/tokens.json

- 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
@pglevy
pglevy merged commit 3d3c49e into main Jul 21, 2026
3 checks passed
@pglevy
pglevy deleted the fix/tokens-import-132 branch July 21, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix tokens.json import in DesignTokens.stories.tsx

1 participant