You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codemods are now output to the codemods/ directory instead of src/ to be more flexible when working with both isolated packages and pre-existing packages such as monorepos etc. Tooling should continue to work as expected regardless
Copy file name to clipboardExpand all lines: website/docs/external-packages.mdx
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ react-cool-library/
39
39
package.json
40
40
tsconfig.json
41
41
jest.config.js
42
-
src/
42
+
codemods/
43
43
10.0.0/ // semver version
44
44
transform.ts // main logic (should contain a transformer)
45
45
transform.spec.ts // main tests
@@ -57,3 +57,10 @@ See the [Testing guide](testing) for help getting started with unit tests.
57
57
Since your new codeshift package can simply be treated as an NPM package you can simply run `npm version [patch\minor\major]` and `npm publish`.
58
58
59
59
Your package will now be accessible via the `codeshift/cli`. Refer to the [Consuming guide](consuming) for information about how to run your new codemods.
60
+
61
+
## Examples
62
+
63
+
Here are some helpful example of this setup working in the wild:
Copy file name to clipboardExpand all lines: website/docs/guides/monorepos.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ points to them.
57
57
58
58
See the [configuration guide](/docs/configuration) for help writing config files.
59
59
60
-
## Initialization
60
+
## Initializing
61
61
62
62
Codeshift provides a CLI to quickly codegen a working codemod package around your existing source files. To do so, run `init` with the `--config-only` flag,
63
63
which will output a bare-bones configuration. If you provide a `--transform` or `--preset` it will also generate empty transform files in addition.
0 commit comments