The Intuita VS Code Extension allows you to run codemods over your projects to successfully migrate your project dependencies from one version to the next. This page will walk you through running these codemods as well as Intuita's useful features that make running codemods easier.
On this page, you will learn:
- Dry-running Codemods
- Change Codemod Path (Optional)
- Set Codemod Arguments
- Reviewing and Applying Changes
- More Helpful Features
Before applying a codemod to your project, you can test it out in the dry-run mode and decide which parts of your codebase it should modify. This simplifies dependency upgrade tasks and allows you to easily review large codebase changes.
To dry-run a codemod:
- Find the codemod you would like to use.
Change Codemod Path (Optional)
Before dry-running a codemod over your project, the Intuita extension allows you to limit the codemod’s changes to a specific path in your project.
This is useful for tackling large project migrations by breaking them down into smaller, manageable tasks.
By default, dry-running a codemod will affect the root directory of your project. In most cases, this is fine. However, if you are migrating a large project, choosing codemod paths can be very helpful.
To change a codemod's path:
- Hover over the codemod.
- Click on
- Specify the desired path.
Set Codemod Arguments
Some codemods may require custom arguments to be set before running. This feature allows you to specify custom arguments when needed.
To set codemod arguments:
- Click on the
Edit Codemod Argumentsicon.
- Set the value of the available arguments.
Reviewing and Applying Changes
The is reviewing the changes made by the codemod.
When you dry-run a codemod, all the changes are temporarily in preview before being applied to your local files. This allows you to accept or discard specific changes before applying them to the project's files.
To review the changes made:
Select a dry run.
Selecting a dry run will show a diff view containing the changes made by the codemod.
Accept or decline specific file changes.
Sometimes codemods may make unwanted changes to some files. In such cases, you can deselect changes to prevent them from being applied to your project.
Set changes as reviewed.
When you click
Apply, the Intuita extension will apply the selected changes to your local project files.
More Helpful Features
You can use the change explorer to easily browse the affected files. The Change Explorer is especially helpful when you are reviewing a lot of changes.
Additionally, you can use the change explorer's search to look for specific files.
Diff View Switch
You can switch between an inline or side-by-side diff view by clicking the view type toggle.
If a codemod causes an incorrect change, you can report an issue by clicking