Skip to content

Commit

Permalink
Upgrade Gatsby to latest major version
Browse files Browse the repository at this point in the history
* Fix graphql-compose to version 9.0.4 due to [1]
* Some new settings are required for newer TypeScript version
* TypeScript 4.8 is incompatible with currently used msw version

[1]: gatsbyjs/gatsby#35212
  • Loading branch information
jgosmann committed Aug 28, 2022
1 parent 1444857 commit d109082
Show file tree
Hide file tree
Showing 7 changed files with 63,563 additions and 65,597 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.cache
.bin
.cache*
.DS_Store
.netlify
.*.swp
Expand Down
13 changes: 13 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ const createLegalPages = async ({ actions, graphql }) => {
)
}

exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions
createTypes(`
type SitePage implements Node {
context: SitePageContext
}
type SitePageContext {
year: Int
}
`)
}

exports.createPages = args => {
return Promise.all([
createYearlyIndices(args),
Expand Down
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ module.exports = {
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/__mocks__/file-mock.js`,
"^gatsby-page-utils/(.*)$": `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
"^gatsby-core-utils/(.*)$": `gatsby-core-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
"^gatsby-plugin-utils/(.*)$": [
`gatsby-plugin-utils/dist/$1`,
`gatsby-plugin-utils/$1`,
], // Workaround for https://github.com/facebook/jest/issues/9771
"^gatsby$": `<rootDir>/.storybook/mocks/gatsby.js`,
"^gatsby-original$": `gatsby`,
},
Expand All @@ -16,4 +22,5 @@ module.exports = {
setupFiles: [`<rootDir>/loadershim.js`],
setupFilesAfterEnv: [`<rootDir>/jest-setup.ts`],
testEnvironment: "jsdom",
roots: ["src"],
}
Loading

0 comments on commit d109082

Please sign in to comment.