Skip to content

Migrate: Phase P2.14 prop interpolation codemod#99

Merged
dbanksdesign merged 3 commits into
mainfrom
fix/migrate-interpolations-p2-14
Jun 17, 2026
Merged

Migrate: Phase P2.14 prop interpolation codemod#99
dbanksdesign merged 3 commits into
mainfrom
fix/migrate-interpolations-p2-14

Conversation

@dbanksdesign

Copy link
Copy Markdown
Collaborator

Summary

  • Convert styled-components prop interpolations (${props => props.color}, ${(props) => props.width}px, etc.) to createVar + assignVars + styles.class instead of skipping them
  • Strip migrated props from JSX call sites and wire values through assignVars (including CSS suffixes like px)
  • Still warn and skip unsupported patterns: theme access, conditionals, exported components, and non-JSX references

Test plan

  • pnpm --filter @typestyles/migrate test (50 tests)
  • Run npx typestyles-migrate src --write on a styled-components codebase with prop interpolations and verify output
  • Confirm conditional/theme interpolations still emit warnings without changing files

Made with Cursor

dbanksdesign and others added 3 commits June 17, 2026 11:09
Convert styled-components prop interpolations to createVar + assignVars so
real-world templates migrate automatically instead of being skipped.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add boolean prop ternary → styles.component migration, destructured prop
params for createVar, and @media at-rule parsing. Document follow-up
codemod tasks as P2.16–P2.21 in IMPROVEMENTS.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dbanksdesign dbanksdesign merged commit 27ad6d0 into main Jun 17, 2026
6 checks passed
@dbanksdesign dbanksdesign deleted the fix/migrate-interpolations-p2-14 branch June 17, 2026 18:37
@github-actions github-actions Bot mentioned this pull request Jul 4, 2026
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.

1 participant