fix: prevent TypeScript from type-checking raw source files in node_modules#173
Merged
fix: prevent TypeScript from type-checking raw source files in node_modules#173
Conversation
…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
commit: |
Contributor
Docs PreviewCommit: |
geoquant
approved these changes
Mar 4, 2026
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.
Summary
Fixes an issue where consumers upgrading to kumo would get TypeScript errors because TypeScript was type-checking
.tsxand.tssource files shipped in the package.Root cause: When TypeScript resolves imports from
@cloudflare/kumo, it finds raw.tsxfiles alongside.d.tsfiles indist/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
.tsxsource files fromdist/src/blocks/todist/blocks-source/to avoid collision with.d.tsfilesai/schemas.tstodist/ai/schemas.jsinstead of shipping raw.tsscripts/theme-generator/*.tstodist/instead of shipping raw.tspackage.jsonexports to point to compiled.jsfiles with proper.d.tstypeskumo addcommand to find block sources in new locationTesting
Tested locally against
cloudflare/workers-sdklocal-explorer-uipackage 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.