.codemodrc.json
configuration file in its root directory.codemodrc.json
configuration file allows Codemod platform to better understand information about your codemod, as well as bring an enhanced running experience.
The structure of the codemod package can vary based on the codemod engine used. This document explains the requirements for a valid codemod package for each of the supported codemod engines.
ast-grep
, filemod
, jscodeshift
, ts-morph
, and piranha
.
.codemodrc.json
reference.codemodrc.json
configuration file includes several metafields that can be used to help Codemod platform understand more information about your codemod package.
private
.By default, when a codemod is published without a namespace, visibility will be set as public
.
If a codemod is published under a namespace, such as @codemod/my-codemod
, visibility will be set as private
.filemod
jscodeshift
ts-morph
ast-grep
piranha
(requires additional language
field that specifies one of the supported piranha languages:
java
, kt
, go
, py
, swift
, ts
, tsx
, or scala
)recipe
(requires additional names
field, which is an ordered array of codemod names that will be executed)from
and to
keys that are both arrays of tuples.
This field can be used to specify the dependencies and versions this codemod is made for.Specifying the applicability criteria of your codemod helps:<
, >
, <=
, >=
, =
)-
sign.
Each dependency should be a string in one of the following formats:package-name@version
-package-name
package-name