Skip to content

fix: prevent TypeScript from type-checking raw source files in node_modules#173

Merged
geoquant merged 3 commits intomainfrom
fix/blocks-tsx-location
Mar 4, 2026
Merged

fix: prevent TypeScript from type-checking raw source files in node_modules#173
geoquant merged 3 commits intomainfrom
fix/blocks-tsx-location

Conversation

@mattrothenberg
Copy link
Collaborator

Summary

Fixes an issue where consumers upgrading to kumo would get TypeScript errors because TypeScript was type-checking .tsx and .ts source files shipped in the package.

Root cause: When TypeScript resolves imports from @cloudflare/kumo, it finds raw .tsx files alongside .d.ts files in dist/src/blocks/. TypeScript then tries to type-check those source files using the consumer's tsconfig, which often has stricter or different settings, causing errors.

Changes

  • Move block .tsx source files from dist/src/blocks/ to dist/blocks-source/ to avoid collision with .d.ts files
  • Compile ai/schemas.ts to dist/ai/schemas.js instead of shipping raw .ts
  • Compile scripts/theme-generator/*.ts to dist/ instead of shipping raw .ts
  • Update package.json exports to point to compiled .js files with proper .d.ts types
  • Update CLI kumo add command to find block sources in new location

Testing

Tested locally against cloudflare/workers-sdk local-explorer-ui package which was experiencing this issue when upgrading from kumo 1.5.0 to 1.9.0.

Related

Reported by Ben Dixon (Wrangler team) - TypeScript errors when upgrading kumo in Local Data Explorer.

…odules

Fixes an issue where consumers upgrading to kumo would get TypeScript errors
because TypeScript was type-checking .tsx and .ts source files shipped in the
package.

Changes:
- Move block .tsx source files from dist/src/blocks/ to dist/blocks-source/
  to avoid collision with .d.ts files that TypeScript resolves
- Compile ai/schemas.ts to dist/ai/schemas.js instead of shipping raw .ts
- Compile scripts/theme-generator/*.ts to dist/ instead of shipping raw .ts
- Update package.json exports to point to compiled files
- Update CLI to find block sources in new location
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@173

commit: fb09da2

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Docs Preview

View docs preview

Commit: fb09da2

@geoquant geoquant merged commit 409d32b into main Mar 4, 2026
11 of 12 checks passed
@geoquant geoquant deleted the fix/blocks-tsx-location branch March 4, 2026 13:49
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