Socket
Socket
Sign inDemoInstall

gatsby-codemods

Package Overview
Dependencies
Maintainers
1
Versions
280
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-codemods - npm Package Compare versions

Comparing version 1.0.0-rc.3 to 1.0.0-rc.4

transforms/__testfixtures__/rename-bound-action-creators/create-page.input.js

6

CHANGELOG.md

@@ -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 @@

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc