Skip to content

Commit f8c5141

Browse files
authored
chore: apply patches for v4 (#33170)
* chore: apply patches for v4 * adjust publish-next command * replace alpha with next * switch to node14 in circleci * update yarn.lock * set COMPILER_OPTIONS and update circleci config * use sudo for now
1 parent e1cba20 commit f8c5141

File tree

122 files changed

+278
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+278
-289
lines changed

.circleci/config.yml

+14-25
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ executors:
88
image:
99
type: string
1010
# First 10.x LTS release, but old Yarn
11-
default: "12.13.0"
11+
default: "14.17.0"
1212
docker:
1313
- image: cimg/node:<< parameters.image >>
1414

1515
aliases:
1616
e2e-executor: &e2e-executor
1717
docker:
18-
- image: cypress/browsers:node12.18.3-chrome87-ff82
18+
- image: cypress/browsers:node14.15.0-chrome86-ff82
1919

2020
restore_cache: &restore_cache
2121
restore_cache:
@@ -102,7 +102,7 @@ aliases:
102102
requires:
103103
- lint
104104
- typecheck
105-
- unit_tests_node12
105+
- unit_tests_node14
106106

107107
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
108108
<<: *e2e-executor
@@ -188,7 +188,7 @@ jobs:
188188
- checkout
189189
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|scripts/e2e-test.sh|yarn.lock"
190190
# python 2 is not built in and node-gyp needs it to build lmdb
191-
- run: apt-get update && apt-get install python -y
191+
- run: sudo apt-get update && sudo apt-get install python -y
192192
- <<: *restore_cache
193193
- <<: *install_node_modules
194194
- <<: *check_lockfile
@@ -227,11 +227,6 @@ jobs:
227227
- run: yarn typecheck
228228
- run: yarn check-repo-fields
229229

230-
unit_tests_node12:
231-
executor:
232-
name: node
233-
<<: *test_template
234-
235230
unit_tests_node14:
236231
executor:
237232
name: node
@@ -255,9 +250,9 @@ jobs:
255250
command: |
256251
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
257252
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
258-
- run: nvm install v12
259-
- run: nvm alias default v12
260-
- run: nvm use v12
253+
- run: nvm install v14
254+
- run: nvm alias default v14
255+
- run: nvm use v14
261256
- run: npm i -g [email protected]
262257
- e2e-test:
263258
test_path: integration-tests/gatsby-source-wordpress
@@ -477,7 +472,7 @@ jobs:
477472
steps:
478473
- checkout
479474
# jq is helpful for parsing json & python required for node-gyp to build lmdb
480-
- run: apt-get update && apt-get install jq python -y
475+
- run: sudo apt-get update && sudo apt-get install jq python -y
481476
- <<: *restore_cache
482477
- <<: *install_node_modules
483478
- run: yarn markdown
@@ -489,7 +484,7 @@ jobs:
489484
executor: node
490485
steps:
491486
- checkout
492-
- run: apt-get update && apt-get install jq python -y
487+
- run: sudo apt-get update && sudo apt-get install jq python -y
493488
- <<: *restore_cache
494489
- <<: *install_node_modules
495490
- run: git config --global user.name "GatsbyJS Bot"
@@ -540,11 +535,11 @@ jobs:
540535

541536
- <<: *attach_to_bootstrap
542537
- run:
543-
name: Install node 12.13 and yarn
538+
name: Install node 14.17 and yarn
544539
command: |
545-
nvm install 12.13.0
546-
nvm alias default 12.13.0
547-
nvm use 12.13.0
540+
nvm install 14.17.0
541+
nvm alias default 14.17.0
542+
nvm use 14.17.0
548543
choco install yarn
549544
- run:
550545
name: Rebuild packages for windows
@@ -571,7 +566,7 @@ jobs:
571566
steps:
572567
- checkout
573568
# python 2 is not built in and node-gyp needs it to build lmdb
574-
- run: apt-get update && apt-get install python -y
569+
- run: sudo apt-get update && sudo apt-get install python -y
575570
- run:
576571
name: "Update React to prerelease"
577572
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
@@ -664,12 +659,6 @@ workflows:
664659
requires:
665660
- lint
666661
- bootstrap
667-
- unit_tests_node12:
668-
<<: *ignore_docs
669-
requires:
670-
- lint
671-
- typecheck
672-
- bootstrap
673662
- unit_tests_node14:
674663
<<: *ignore_docs
675664
requires:

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"csstype": "2.6.17"
116116
},
117117
"scripts": {
118-
"bootstrap": "npm-run-all -s check-versions \"lerna-prepare -- --{@}\" --",
118+
"bootstrap": "cross-env COMPILER_OPTIONS=\"GATSBY_MAJOR=4\" npm-run-all -s check-versions \"lerna-prepare -- --{@}\" --",
119119
"check-repo-fields": "node scripts/check-repo-fields.js",
120120
"check-versions": "node scripts/check-versions.js",
121121
"format": "npm run format:code && npm run format:other && npm run format:svg",
@@ -141,7 +141,7 @@
141141
"prettier": "prettier \"**/*.{md,css,scss,yaml,yml}\"",
142142
"publish": "echo \"Use 'yarn publish-next' or 'yarn publish-release' instead of 'yarn run publish'\"",
143143
"publish-canary": "node scripts/check-publish-access && lerna publish --canary --yes",
144-
"publish-next": "node scripts/check-publish-access && node scripts/clear-package-dir prerelease --verbose && lerna publish prerelease --pre-dist-tag=next --preid=next --allow-branch=master --message=\"chore(release): Publish next\"",
144+
"publish-next": "node scripts/check-publish-access && node scripts/clear-package-dir prerelease --verbose && cross-env COMPILER_OPTIONS=\"GATSBY_MAJOR=4\" lerna publish prerelease --pre-dist-tag=next --preid=next --allow-branch=master --message=\"chore(release): Publish next\"",
145145
"publish-preminor": "node scripts/check-publish-access && node scripts/clear-package-dir preminor --verbose && lerna publish preminor --pre-dist-tag=next --preid=next --force-publish --allow-branch=master --message=\"chore(release): Publish next pre-minor\"",
146146
"publish-rc": "node scripts/check-publish-access && node scripts/clear-package-dir prerelease --verbose && lerna publish prerelease --pre-dist-tag=rc --preid=rc --message=\"chore(release): Publish rc\"",
147147
"publish-release": "node scripts/check-publish-access && node scripts/clear-package-dir patch --verbose && lerna publish patch",

packages/babel-plugin-remove-graphql-queries/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"peerDependencies": {
2222
"@babel/core": "^7.0.0",
23-
"gatsby": "^3.0.0-next.0"
23+
"gatsby": "^4.0.0-next"
2424
},
2525
"license": "MIT",
2626
"main": "index.js",
@@ -30,6 +30,6 @@
3030
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\" --extensions \".ts,.js\""
3131
},
3232
"engines": {
33-
"node": ">=12.13.0"
33+
"node": ">=14.15.0"
3434
}
3535
}

packages/babel-preset-gatsby-package/lib/__tests__/__snapshots__/index.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Array [
127127
"modules": "commonjs",
128128
"shippedProposals": true,
129129
"targets": Object {
130-
"node": "12.13.0",
130+
"node": "14.15.0",
131131
},
132132
"useBuiltIns": "entry",
133133
},
@@ -151,7 +151,7 @@ Array [
151151
"modules": "commonjs",
152152
"shippedProposals": true,
153153
"targets": Object {
154-
"node": "12.13.0",
154+
"node": "14.15.0",
155155
},
156156
"useBuiltIns": "entry",
157157
},

packages/babel-preset-gatsby-package/lib/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ function preset(context, options = {}) {
44
const {
55
browser = false,
66
debug = false,
7-
nodeVersion = `12.13.0`,
7+
nodeVersion = `14.15.0`,
88
esm = false,
99
availableCompilerFlags = [`GATSBY_MAJOR`],
1010
} = options
11-
const { NODE_ENV, BABEL_ENV, COMPILER_OPTIONS } = process.env
11+
const {
12+
NODE_ENV,
13+
BABEL_ENV,
14+
COMPILER_OPTIONS = `GATSBY_MAJOR=4`,
15+
} = process.env
1216

1317
const IS_TEST = (BABEL_ENV || NODE_ENV) === `test`
1418

packages/babel-preset-gatsby-package/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"license": "MIT",
3535
"main": "lib/index.js",
3636
"engines": {
37-
"node": ">=12.13.0"
37+
"node": ">=14.15.0"
3838
},
3939
"files": [
4040
"lib/*.js"

packages/babel-preset-gatsby/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
"slash": "^3.0.0"
4444
},
4545
"engines": {
46-
"node": ">=12.13.0"
46+
"node": ">=14.15.0"
4747
}
4848
}

packages/gatsby-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@
100100
"postinstall": "node scripts/postinstall.js"
101101
},
102102
"engines": {
103-
"node": ">=12.13.0"
103+
"node": ">=14.15.0"
104104
}
105105
}

packages/gatsby-cli/src/__tests__/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const setup = (version?: string): ReturnType<typeof getCLI> => {
5252
}
5353

5454
describe(`error handling`, () => {
55-
it(`panics on Node < 12.13.0`, () => {
56-
;[`6.0.0`, `8.0.0`, `10.0.0`, `12.0.0`].forEach(version => {
55+
it(`panics on Node < 14.15.0`, () => {
56+
;[`6.0.0`, `8.0.0`, `12.13.0`, `13.0.0`].forEach(version => {
5757
const { reporter } = setup(version)
5858

5959
expect(reporter.panic).toHaveBeenCalledTimes(1)
@@ -95,8 +95,8 @@ describe(`error handling`, () => {
9595
// })
9696

9797
describe(`normal behavior`, () => {
98-
it(`does not panic on Node >= 12.13.0`, () => {
99-
;[`12.13.0`, `13.0.0`, `14.0.0`].forEach(version => {
98+
it(`does not panic on Node >= 14.15.0`, () => {
99+
;[`14.15.0`, `15.0.0`, `16.3.0`].forEach(version => {
100100
const { reporter } = setup(version)
101101

102102
expect(reporter.panic).not.toHaveBeenCalled()

packages/gatsby-codemods/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"cross-env": "^7.0.3"
4141
},
4242
"engines": {
43-
"node": ">=12.13.0"
43+
"node": ">=14.15.0"
4444
},
4545
"bin": "./bin/gatsby-codemods.js"
4646
}

packages/gatsby-core-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
"typescript": "^4.3.5"
5151
},
5252
"engines": {
53-
"node": ">=12.13.0"
53+
"node": ">=14.15.0"
5454
}
5555
}

packages/gatsby-cypress/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
],
3232
"peerDependencies": {
3333
"cypress": "^3.1.0",
34-
"gatsby": "^3.0.0-next.0"
34+
"gatsby": "^4.0.0-next"
3535
},
3636
"scripts": {
3737
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
3838
"prepare": "cross-env NODE_ENV=production npm run build",
3939
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
4040
},
4141
"engines": {
42-
"node": ">=12.13.0"
42+
"node": ">=14.15.0"
4343
}
4444
}

packages/gatsby-design-tokens/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
"preval.macro": "^5.0.0"
3737
},
3838
"engines": {
39-
"node": ">=12.13.0"
39+
"node": ">=14.15.0"
4040
}
4141
}

packages/gatsby-dev-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
"watch": "babel -w src --out-dir dist --ignore \"**/__tests__\""
4949
},
5050
"engines": {
51-
"node": ">=12.13.0"
51+
"node": ">=14.15.0"
5252
}
5353
}

packages/gatsby-graphiql-explorer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
"whatwg-fetch": "^3.6.2"
5757
},
5858
"engines": {
59-
"node": ">=12.13.0"
59+
"node": ">=14.15.0"
6060
}
6161
}

packages/gatsby-link/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
},
4242
"types": "index.d.ts",
4343
"engines": {
44-
"node": ">=12.13.0"
44+
"node": ">=14.15.0"
4545
}
4646
}

packages/gatsby-page-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
"dist/"
4545
],
4646
"engines": {
47-
"node": ">=12.13.0"
47+
"node": ">=14.15.0"
4848
}
4949
}

packages/gatsby-plugin-benchmark-reporting/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
3131
},
3232
"engines": {
33-
"node": ">=12.13.0"
33+
"node": ">=14.15.0"
3434
}
3535
}

packages/gatsby-plugin-canonical-urls/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"license": "MIT",
2424
"main": "index.js",
2525
"peerDependencies": {
26-
"gatsby": "^3.0.0-next.0"
26+
"gatsby": "^4.0.0-next"
2727
},
2828
"repository": {
2929
"type": "git",
@@ -36,6 +36,6 @@
3636
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
3737
},
3838
"engines": {
39-
"node": ">=12.13.0"
39+
"node": ">=14.15.0"
4040
}
4141
}

packages/gatsby-plugin-catch-links/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"license": "MIT",
2525
"main": "index.js",
2626
"peerDependencies": {
27-
"gatsby": "^3.0.0-next.0"
27+
"gatsby": "^4.0.0-next"
2828
},
2929
"repository": {
3030
"type": "git",
@@ -37,6 +37,6 @@
3737
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
3838
},
3939
"engines": {
40-
"node": ">=12.13.0"
40+
"node": ">=14.15.0"
4141
}
4242
}

packages/gatsby-plugin-coffeescript/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"license": "MIT",
3131
"main": "index.js",
3232
"peerDependencies": {
33-
"gatsby": "^3.0.0-next.0"
33+
"gatsby": "^4.0.0-next"
3434
},
3535
"repository": {
3636
"type": "git",
@@ -43,6 +43,6 @@
4343
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
4444
},
4545
"engines": {
46-
"node": ">=12.13.0"
46+
"node": ">=14.15.0"
4747
}
4848
}

packages/gatsby-plugin-create-client-paths/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"license": "MIT",
2424
"main": "index.js",
2525
"peerDependencies": {
26-
"gatsby": "^3.0.0-next.0"
26+
"gatsby": "^4.0.0-next"
2727
},
2828
"repository": {
2929
"type": "git",
@@ -36,6 +36,6 @@
3636
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
3737
},
3838
"engines": {
39-
"node": ">=12.13.0"
39+
"node": ">=14.15.0"
4040
}
4141
}

0 commit comments

Comments
 (0)