codemods: model-to-schema typescript support#10474
Open
BobrImperator wants to merge 3 commits intowarp-drive-data:mainfrom
Open
codemods: model-to-schema typescript support#10474BobrImperator wants to merge 3 commits intowarp-drive-data:mainfrom
BobrImperator wants to merge 3 commits intowarp-drive-data:mainfrom
Conversation
7d61f8b to
83d7f90
Compare
BobrImperator
commented
Feb 17, 2026
| collectTraitImports(extendedTraits, imports, options); | ||
|
|
||
| const traitSchemaName = traitInterfaceName; | ||
| const traitSchemaName = `${toPascalCase(baseName)}Schema`; |
Contributor
Author
There was a problem hiding this comment.
A recurring problem so far is shotgun surgeries like this which are also very error prone that Claude was very happy with. Additionally the codemod often lacks the ability to quickly refer from a file to it's dependencies for the exact same reason.
There's on-going effort to wrangle this up https://github.com/BobrImperator/data/compare/codemod/typescript-support...BobrImperator:data:codemod/poc-typescript?expand=1
255e935 to
e71b50e
Compare
e71b50e to
6d62aed
Compare
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.
Previously the imports were borked and misaligned - which is an on-going issue post Claude catastrophe.
There's some work being done to unify transformations under a single source of truth representation of a file (Entity) Codemod/poc typescript BobrImperator/data#1
TraitorExtensionResourceBrandsBrands using Typescript interface merging.This does rely on the fact that some imports are effectively circular, but Typescript appears to be fine with that.
Note
A foldable section below 👇
The examples don't contain any actual imports since it's meant to be simply ran with
tsxor IDE to verify typechecking.PoC showcasing consuming code and file interaction in Typescript context
Consuming
Userresources/user.schema.tsresources/user.ext.tstraits/timestampable.schema.tstraits/timestampable.ext.tsIf this PR updates API docs, preview them by:
pnpm installin the root (if needed)pnpm previewin the root