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
Note that you cannot pass additional flags to this command. It will automatically run the codemod against file extensions `js, jsx, ts, tsx` and ignore the `node_modules`, `.cache` and `public` directories of your project.
20
20
21
-
2. Use JSCodeshift directly
21
+
### JSCodeshift
22
22
23
-
- Install JSCodeshift as a global module
23
+
1. Install JSCodeshift as a global module
24
24
25
25
```shell
26
26
npm install --global jscodeshift
27
27
```
28
28
29
-
- Install this package
29
+
2. Install this package
30
30
31
31
```shell
32
32
npm install gatsby-codemods
33
33
```
34
34
35
-
- Run a transform from this package on your project
35
+
3. Run a transform from this package on your project
@@ -51,14 +51,37 @@ Structure of a jscodeshift call:
51
51
52
52
## Included scripts
53
53
54
+
### `sort-and-aggr-graphql`
55
+
56
+
Apply changes to the `sort` argument and aggregation's `field` argument as explained in the [RFC: Change to sort and aggregation fields API](https://github.com/gatsbyjs/gatsby/discussions/36242).
57
+
58
+
See the [Gatsby v4 to v5 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v4-to-v5/#graphql-schema-changes-to-sort-and-aggregation-fields).
Add a `graphql` import to modules that use the `graphql` tag function without an import. This was supported in Gatsby v1 and deprecated for Gatsby v2.
57
80
58
-
See the [Gatsby v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#import-graphql-from-gatsby).
81
+
See the [Gatsby v1 to v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#import-graphql-from-gatsby).
Change the deprecated `navigateTo` method from `gatsby-link` to `navigate` from the `gatsby` module.
109
132
110
-
See the [Gatsby v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#change-navigateto-to-navigate).
133
+
See the [Gatsby v1 to v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#change-navigateto-to-navigate).
@@ -134,10 +157,10 @@ Rename `boundActionCreators` to `actions`. `boundActionCreators` has been deprec
134
157
135
158
Note: Run this codemod only against files that use `boundActionCreators` instead of running it against a whole directory.
136
159
137
-
See the [Gatsby v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#rename-boundactioncreators-to-actions).
160
+
See the [Gatsby v1 to v2 migration guide for details on when to use this](https://gatsbyjs.com/docs/migrating-from-v1-to-v2/#rename-boundactioncreators-to-actions).
Check out [issue 5038 in the Gatsby repo for additional codemod ideas](https://github.com/gatsbyjs/gatsby/issues/5038#issuecomment-411516865).
0 commit comments