Skip to content

Commit 7b07123

Browse files
joshblackmperrottiJosep Martinsradglob
authored
feat(theme): update gatsby to v3 (#479)
* chore: add peer dep @babel/core to deps * refactor: rename __experimentalThemes to plugins * feat: update theme to depend on gatsby v3 * feat(docs): update to gatsby v3 * refactor(theme): use path-browserify as fallback in browser * feat(theme): update deps for gatsby v3 * chore: add changeset * chore: change styled-components dep range for compat * chore: change styled-components dep range for compat * chore: change styled-components dep range for compat * chore: change styled-components dep range for compat * Update react and react-dom versions, yarn resolutions. * feat(theme): update deps for gatsby v3 * Bump theme version to 5.0.0 due to peerDependencies changes. * Fix conflict markers in theme/package.json. * Revert version number, let release tracking PR update it. --------- Co-authored-by: Mike Perrotti <[email protected]> Co-authored-by: Josep Martins <[email protected]> Co-authored-by: Jeremy Neal <[email protected]>
1 parent 3269bd9 commit 7b07123

File tree

7 files changed

+5155
-6430
lines changed

7 files changed

+5155
-6430
lines changed

.changeset/honest-bags-tell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/gatsby-theme-doctocat': major
3+
---
4+
5+
Update gatsby to v3

docs/gatsby-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
description: 'A Gatsby theme for creating Primer documentation sites',
66
},
77
pathPrefix: '/doctocat',
8-
__experimentalThemes: [
8+
plugins: [
99
{
1010
resolve: '@primer/gatsby-theme-doctocat',
1111
options: {

docs/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"dependencies": {
1313
"@primer/gatsby-theme-doctocat": "*",
1414
"@primer/react": "^35.2.2",
15-
"gatsby": "^2.32.13",
16-
"react": "^16.13.1",
17-
"react-dom": "^16.13.1"
15+
"gatsby": "^3.14.0",
16+
"react": "^18.2.0",
17+
"react-dom": "^18.2.0"
1818
},
1919
"repository": "primer/doctocat"
2020
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as primerComponents from '@primer/react'
22
import * as doctocatComponents from '@primer/gatsby-theme-doctocat'
33

4+
// eslint-disable-next-line import/no-anonymous-default-export
45
export default {...primerComponents, ...doctocatComponents}

theme/package.json

+22-15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"lint:fix": "yarn lint -- --fix"
1010
},
1111
"prettier": "@github/prettier-config",
12+
"resolutions": {
13+
"graphql": "^15.4.0",
14+
"graphql-compose": "^7.25.0"
15+
},
1216
"devDependencies": {
1317
"@github/prettier-config": "^0.0.4",
1418
"eslint": "^8.0.1",
@@ -17,17 +21,18 @@
1721
"eslint-plugin-prettier": "^4.0.0",
1822
"eslint-plugin-primer-react": "0.7.4",
1923
"eslint-plugin-react": "^7.26.1",
20-
"gatsby": "^2.32.13",
24+
"gatsby": "^3.14.6",
2125
"prettier": "^2.4.1",
22-
"react": "^16.13.1",
23-
"react-dom": "^16.13.1"
26+
"react": "^18.2.0",
27+
"react-dom": "^18.2.0"
2428
},
2529
"peerDependencies": {
26-
"gatsby": "2.x",
27-
"react": "^16.9.x",
28-
"react-dom": "^16.9.x"
30+
"gatsby": "3.x",
31+
"react": "^18.x",
32+
"react-dom": "^18.x"
2933
},
3034
"dependencies": {
35+
"@babel/core": "^7.19.1",
3136
"@babel/preset-env": "^7.5.5",
3237
"@babel/preset-react": "^7.0.0",
3338
"@mdx-js/mdx": "^1.0.21",
@@ -40,28 +45,30 @@
4045
"@testing-library/react": "^9.1.3",
4146
"axios": "^0.21.2",
4247
"babel-jest": "^24.9.0",
48+
"babel-plugin-styled-components": "^2.0.7",
4349
"copy-to-clipboard": "^3.2.0",
4450
"date-fns": "^2.28.0",
4551
"details-element-polyfill": "^2.4.0",
4652
"downshift": "^3.2.10",
4753
"find-up": "^6.3.0",
4854
"framer-motion": "^1.4.2",
4955
"fuse.js": "^3.4.5",
50-
"gatsby-plugin-catch-links": "^2.1.2",
51-
"gatsby-plugin-manifest": "^2.2.1",
56+
"gatsby-plugin-catch-links": "^3.14.0",
57+
"gatsby-plugin-manifest": "^3.14.0",
5258
"gatsby-plugin-mdx": "^1.0.13",
53-
"gatsby-plugin-page-creator": "^2.1.1",
54-
"gatsby-plugin-react-helmet": "^3.1.0",
55-
"gatsby-plugin-remove-trailing-slashes": "^2.1.2",
56-
"gatsby-plugin-styled-components": "^3.1.0",
57-
"gatsby-source-filesystem": "^2.1.0",
58-
"gatsby-transformer-yaml": "^2.2.0",
59+
"gatsby-plugin-page-creator": "^3.14.0",
60+
"gatsby-plugin-react-helmet": "^4.14.0",
61+
"gatsby-plugin-remove-trailing-slashes": "^3.14.0",
62+
"gatsby-plugin-styled-components": "^4.14.0",
63+
"gatsby-source-filesystem": "^3.14.0",
64+
"gatsby-transformer-yaml": "^3.14.0",
5965
"get-pkg-repo": "^4.1.0",
6066
"github-slugger": "^1.2.1",
6167
"html-react-parser": "^1.4.0",
6268
"jest": "^24.9.0",
6369
"lodash.debounce": "4.0.8",
6470
"lodash.uniqby": "^4.7.0",
71+
"path-browserify": "^1.0.1",
6572
"pkg-up": "^3.1.0",
6673
"pluralize": "^8.0.0",
6774
"preval.macro": "^3.0.0",
@@ -75,7 +82,7 @@
7582
"react-measure": "^2.3.0",
7683
"read-pkg-up": "^6.0.0",
7784
"sentence-case": "^2.1.1",
78-
"styled-components": "^4.3.2",
85+
"styled-components": "^5.3.5",
7986
"styled-system": "^5.0.18",
8087
"worker-loader": "^3.0.2"
8188
}

theme/src/use-search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {graphql, useStaticQuery} from 'gatsby'
2-
import path from 'path'
2+
import path from 'path-browserify'
33
import React from 'react'
44
import SearchWorker from 'worker-loader!./search.worker.js'
55

0 commit comments

Comments
 (0)