Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-codemods): call jscodeshift natively #38635

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

mavaddat
Copy link
Contributor

Platform-neutral call to jscodeshift

Description

Currently, gatsby-codemods indiscriminantly calls the jscodeshift shell script for *nix and MinGW, CYGWIN, which is shell- or OS-specific and guarantees interoperability issues such as below (in PowerShell):

Before screenshot

On

PSVersionTable

Moreover, the abovementioned shell script merely calls the Javascript source file, which is a needless indirection for NodeJS (i.e., Javascript call a shell script to call Javascript).

Result after my commit:

After screenshot

Documentation

Published: https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v4-to-v5/#graphql-schema-changes-to-sort-and-aggregation-fields

Source: https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/reference/release-notes/migrating-from-v4-to-v5.md#graphql-schema-changes-to-sort-and-aggregation-fields

Tests

Ran npx gatsby-codemods@latest sort-and-aggr-graphql . --verbose locally before and after. See table:

Before After
Result:
Failing❌
Result:
Passing✔
Before screenshot
Screenshot
After screenshot
Screenshot

Related Issues

Fixes #7652
Addresses #16840
Addresses #17132
Addresses #17133

Platform-neutral call to `jscodeshift`.
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 14, 2023
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 4, 2024
@pieh pieh changed the title Call jscodeshift natively fix(gatsby-codemods): call jscodeshift natively Jan 4, 2024
@pieh pieh merged commit f129c37 into gatsbyjs:master Jan 4, 2024
1 check failed
@mavaddat mavaddat deleted the patch-1 branch January 4, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests on Windows fail - reasons and ways to fix
2 participants