- Build with Codemod Studio
- Scaffold a package with Codemod CLI
Building with Codemod Studio
To learn how to build codemods with Codemod Studio, please refer to the detailed Codemod Studio usage guide.Scaffolding a codemod package
Scaffolding a codemod package allows you to either:- manually write your own codemod
- turn an existing codemod into a Codemod-compatible package.
1
Verify codemod engine compatibility
Verify that the existing codemod is built by one of the supported codemod engines.
2
Initialize codemod package
Initialize a Codemod-compatible package by running:
3
Update transform file content
For jscodeshift/ts-morph/workflow codemods:
Update the content inside the
src/index.ts
file with the content of your codemod’s transform file.For ast-grep codemods:
Update the content inside the
src/rule.yaml
file with the content of your ast-grep rule.4
Update package configuration file
Add information about your codemod to the
.codemodrc.json
configuration file. Refer to .codemodrc.json
reference here.Next steps
Publishing your codemod ->
Get started with publishing your codemod to Codemod Registry.