Skip to content

refactor(docs): use kumo components directly for instant reload#24

Open
invisal wants to merge 1 commit intocloudflare:mainfrom
invisal:refactor/docs-hot-reload
Open

refactor(docs): use kumo components directly for instant reload#24
invisal wants to merge 1 commit intocloudflare:mainfrom
invisal:refactor/docs-hot-reload

Conversation

@invisal
Copy link

@invisal invisal commented Feb 6, 2026

Summary

This PR refactors the kumo-docs-astro package to import Kumo components directly from source files instead of the built distribution, enabling instant hot module reloading during development.

Key Changes:

  • Direct source imports: Updated Vite configuration to alias @cloudflare/kumo to ../kumo/src/index.ts instead of the built package
  • Component registry loading: Switched from importing the packaged JSON to dynamically reading the registry file using readFileSync
  • Tailwind CSS source scanning: Updated source directive to scan ../kumo/src/**/*.{js,jsx,ts,tsx} instead of dist/
  • Style imports: Changed CSS import to point directly to source (../kumo/src/styles/kumo.css)
  • TypeScript configuration: Added path mapping for @cloudflare/kumo to resolve to source files
  • Dev server configuration: Added filesystem access permissions for the sibling kumo package

Benefits:

  • ⚡ Instant reload: Changes to Kumo components now hot-reload immediately in the docs site without rebuilding the package
  • 🔄 Better DX: Eliminates the need to run pnpm build in the kumo package during development
  • 🛠️ Faster iteration: Component development is significantly faster with instant feedback

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.

2 participants