[WIP] [ISSUE-334] Migrate Project to latest Gatsby release #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upgrades gatsby from v2 to v4, and also upgrades all the packages of the application.
This was done with
CXXFLAGS="--std=c++17" yarn upgrade-interactive --latest
and then selecting everything.The
CXXFLAGS="--std=c++17"
part was needed on my machine because the setup uses g++ to build node-sass.Even though I found a package-lock.json file in the project, I used yarn instead of npm because I noticed that the former was called in the project's Github actions. npm is mentioned in package.json though, so we probably need to keep one of them otherwise both the package-lock.json and yarn.lock files would have to be kept up to date.
I also had to call
yarn husky install
after the upgrade to solve the 'error Command "husky-run" not found.' issue.The upgraded gatsby apparently uses a new webpack version that no longer includes polyfills for nodejs modules, so I replaced path.separator with / to avoid having to polyfill
path
. It was the only mention I found of thepath
module throughout the project, so it's probably safe to remove thepath
dependency altogether.Also, mdx-js/mdx was kept at v1 to maintain gatsby-plugin-mdx compatibility (gatsbyjs/gatsby#34706 (comment))
This is a WIP PR, the project runs with
yarn develop
but I haven't tested it yet.Relevant issue : #334