fix(registry): use type-only imports (fixes TS1484 in stock Vite react-ts apps) - #993
Merged
Merged
Conversation
Registry components import type-only bindings (Transition, Variants, MotionStyle, HTMLMotionProps, CSSProperties, ReactNode, VariantProps, ...) as value imports. TypeScript's own `--template react-ts` scaffold turns on `verbatimModuleSyntax`, so every one of these is a hard TS1484 compile error the moment someone installs a component into a stock Vite app. The generated payloads under public/r embed the component source verbatim, so the registry was rebuilt too — that is what the CLI actually writes into a user's project. 43 specifiers across 33 files, plus the regenerated registry output. Adds the inline `type` modifier, matching the style already used in the same import statements (spinning-text.tsx already writes `type ComponentPropsWithoutRef` one line above). No runtime or type semantics change.
|
@noron12234 is attempting to deploy a commit to the product-studio Team on Vercel. A member of the Team first needs to authorize it. |
Yeom-JinHo
self-requested a review
July 31, 2026 11:02
The previous commit removed every type-only binding imported as a value, so the flag turns on with zero additional changes (tsc --noEmit passes). New registry code that reintroduces the pattern now fails in-editor and in CI instead of surfacing as a build error in consumers' Vite apps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPdQpL26E46TqVKrBFKrgH
Yeom-JinHo
approved these changes
Jul 31, 2026
Yeom-JinHo
left a comment
Member
There was a problem hiding this comment.
@noron12234
Thanks for the contribution 👍🏽
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.
The problem
Registry components import type-only bindings as value imports:
verbatimModuleSyntaxis on by default in the scaffold TypeScript itself generates —npm create vite@latest -- --template react-tswrites it intotsconfig.app.json. So for anyone installing one of these components into a stock Vite app, these are hardTS1484build errors, not warnings.Reproduction (before)
After
tsc --noEmit --verbatimModuleSyntaxinapps/wwwTS1484react-tstemplate, 3 components)prettier --checkon changed fileseslinton changed filesThe change
Adds the inline
typemodifier at 43 specifiers across 33 files — 23 of them inregistry/, the rest in the site's own code so the whole class is gone rather than half of it.The generated payloads matter here.
public/r/*.jsonembeds the component source verbatim, and that string is what the CLI writes into a user's project — fixing only the.tsxsources would have left the shipped payload broken. So the registry was rebuilt (scripts/build-registry.mts) after formatting, and 16 generated files carry the change through:Affected bindings:
TransitionVariantsMotionStyleMotionPropsHTMLMotionProps(motion) ·CSSPropertiesReactNodeReactElementFC(react) ·VariantProps(cva) ·MetadataMetadataRouteImageProps(next) ·RegistryItem(shadcn/schema).Verification
npx tsc --noEmit --verbatimModuleSyntaxinapps/www:TS1484count 43 → 0. The 55 pre-existing unrelated errors are unchanged — this PR does not claim to fix those.typeinsertion, 0 non-trivial changes. The extra lines in the stat are Prettier rewrapping imports that crossed the print width.spinning-text/border-beam/comic-textin a stock Vite React-TS app: compiles and bundles clean.Optional follow-up
Setting
"verbatimModuleSyntax": trueinapps/www/tsconfig.jsonwould stop this class coming back — it shows up in-editor immediately. Left out of this PR on purpose so the diff stays mechanical; happy to add it if you want it.