gatsby-codemods
Advanced tools
Comparing version 1.0.0-rc.3 to 1.0.0-rc.4
@@ -6,2 +6,8 @@ # Change Log | ||
<a name="1.0.0-rc.4"></a> | ||
# [1.0.0-rc.4](https://github.com/gatsbyjs/gatsby/compare/gatsby-codemods@1.0.0-rc.3...gatsby-codemods@1.0.0-rc.4) (2018-09-11) | ||
**Note:** Version bump only for package gatsby-codemods | ||
<a name="1.0.0-rc.3"></a> | ||
@@ -8,0 +14,0 @@ |
{ | ||
"name": "gatsby-codemods", | ||
"version": "1.0.0-rc.3", | ||
"version": "1.0.0-rc.4", | ||
"description": "Stub description for gatsby-codemods", | ||
@@ -34,3 +34,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "98730c80e3b840c69766c03b1071aa9f836c0155" | ||
"gitHead": "f1c0f2b649474f8cccafddadb455f7eb418174c3" | ||
} |
@@ -71,3 +71,2 @@ ## gatsby-codemods | ||
#### `import-link` | ||
@@ -94,3 +93,2 @@ | ||
#### `navigate-calls` | ||
@@ -121,2 +119,32 @@ | ||
#### `rename-bound-action-creators` | ||
Rename `boundActionCreators` to `actions`. `boundActionCreators` has been deprecated in Gatsby v2 | ||
Note: Run this codemod only against files that use `boundActionCreators` instead of running it against a whole directory. | ||
See the [Gatsby v2 migration guide for details on when to use this](https://next.gatsbyjs.org/docs/migrating-from-v1-to-v2/#rename-boundactioncreators-to-actions). | ||
```sh | ||
jscodeshift -t node_modules/gatsby-codemods/dist/transforms/rename-bound-action-creators.js <path-to-file> | ||
``` | ||
Example result: | ||
```diff | ||
- exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { | ||
+ exports.onCreateNode = ({ node, getNode, actions }) => { | ||
- const { createNodeField } = boundActionCreators | ||
+ const { createNodeField } = actions | ||
if (node.internal.type === `MarkdownRemark`) { | ||
const slug = createFilePath({ node, getNode, basePath: `pages` }) | ||
createNodeField({ | ||
node, | ||
name: `slug`, | ||
value: slug, | ||
}) | ||
} | ||
} | ||
``` | ||
### More scripts | ||
@@ -123,0 +151,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35447
46
906
152
13