Skip to content

souporserious/tsxmod

Repository files navigation

tsxmod

Warning This project and all packages are still a work in progress. The APIs are not stable and may change.

Programmatically analyze and run transformations across TypeScript or JavaScript files using TS Morph.

About

Codebases grow and change over time. As they do, it becomes more difficult to maintain and evolve them. This is where codemods can help. Codemods are a way to make large-scale, non-trivial changes to codebases. They are a great way to refactor code, migrate to new APIs, and better understand your codebase.

CLI

npx tsxmod <directory> --watch

Node

TODO

Todos

  • Convert to a monorepo
  • Add tests
  • Start utils package
  • Codemod examples
  • Loading states
  • Playground
  • Site
  • Share functionality
  • Design system specific helpers (analyze and change colors, space, etc. between CSS and JS)
  • Load a project (tsconfig.json)
  • Start TS Morph server (this is expensive so we only want to run when we need to)
  • Start optional playground that loads specific sources to test against
  • Add ability for app to write back to disk or test codemods in memory before transforming codebase
  • If a codemod runs into an error on a file provide an easy way to skip that file or isolate it to test why a specific file fails
  • Analyze a project based on a builtin helper, or a custom helper located in the .tsxmod/analyze .tsxmod/transform directory settings
  • View collapsible AST tree of a file

Related

generate typescript docs using ts morph

extract exports using ts morph

ast explorer

ts-ast-viewer

ts-morph-helpers

ts-morph-utils

tydoc

morpher

cancerberosgx ts-morph-playground

awhitty ts-morph-playground

sourcegraph codemod