@remotion/studio-server: Remove duplicate codemod formatting logic#6994
@remotion/studio-server: Remove duplicate codemod formatting logic#6994JonnyBurger merged 4 commits intomainfrom
@remotion/studio-server: Remove duplicate codemod formatting logic#6994Conversation
Co-authored-by: Jonny Burger <hi@jonny.io>
Co-authored-by: Jonny Burger <hi@jonny.io>
Co-authored-by: Jonny Burger <hi@jonny.io>
Co-authored-by: Jonny Burger <hi@jonny.io>
|
Reviewed PR #6994. The two extractions ( Task list (5/5 completed)
|
There was a problem hiding this comment.
duplicate-jsx-node.ts has the same Prettier formatting boilerplate (lines 451–507) and was not migrated to formatFileContent. This defeats the purpose of the consolidation — the most obvious third consumer was missed.
Big Pickle (free) | 𝕏
| output: prettified, | ||
| formatted: true, | ||
| }; | ||
| }; |
There was a problem hiding this comment.
duplicate-jsx-node.ts (lines 451–507) has an identical copy of this formatting logic that should also be migrated to formatFileContent. It follows the exact same pattern — lazy-load Prettier, resolve config with override, format TSX, fall back to unformatted — and is structurally identical to the code removed from delete-jsx-node.ts and update-sequence-props.ts.

Summary
formatFileContent()inpackages/studio-server/src/codemods/format-file-content.ts.delete-jsx-node.tsupdate-sequence-props.tsWhy
Both codemods had nearly identical logic for:
Centralizing this reduces maintenance overhead and keeps behavior aligned.
Behavior / tradeoffs
formatted: falsewhen Prettier/config is unavailable).Validation
~/.bun/bin/bunis missing.