Skip to content

Commit

Permalink
chore: apply patches for v4 (#33170)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vladar authored Sep 14, 2021
1 parent e1cba20 commit f8c5141
Show file tree
Hide file tree
Showing 122 changed files with 278 additions and 289 deletions.
39 changes: 14 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ executors:
image:
type: string
# First 10.x LTS release, but old Yarn
default: "12.13.0"
default: "14.17.0"
docker:
- image: cimg/node:<< parameters.image >>

aliases:
e2e-executor: &e2e-executor
docker:
- image: cypress/browsers:node12.18.3-chrome87-ff82
- image: cypress/browsers:node14.15.0-chrome86-ff82

restore_cache: &restore_cache
restore_cache:
Expand Down Expand Up @@ -102,7 +102,7 @@ aliases:
requires:
- lint
- typecheck
- unit_tests_node12
- unit_tests_node14

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

unit_tests_node12:
executor:
name: node
<<: *test_template

unit_tests_node14:
executor:
name: node
Expand All @@ -255,9 +250,9 @@ jobs:
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run: nvm install v12
- run: nvm alias default v12
- run: nvm use v12
- run: nvm install v14
- run: nvm alias default v14
- run: nvm use v14
- run: npm i -g [email protected]
- e2e-test:
test_path: integration-tests/gatsby-source-wordpress
Expand Down Expand Up @@ -477,7 +472,7 @@ jobs:
steps:
- checkout
# jq is helpful for parsing json & python required for node-gyp to build lmdb
- run: apt-get update && apt-get install jq python -y
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: yarn markdown
Expand All @@ -489,7 +484,7 @@ jobs:
executor: node
steps:
- checkout
- run: apt-get update && apt-get install jq python -y
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: git config --global user.name "GatsbyJS Bot"
Expand Down Expand Up @@ -540,11 +535,11 @@ jobs:

- <<: *attach_to_bootstrap
- run:
name: Install node 12.13 and yarn
name: Install node 14.17 and yarn
command: |
nvm install 12.13.0
nvm alias default 12.13.0
nvm use 12.13.0
nvm install 14.17.0
nvm alias default 14.17.0
nvm use 14.17.0
choco install yarn
- run:
name: Rebuild packages for windows
Expand All @@ -571,7 +566,7 @@ jobs:
steps:
- checkout
# python 2 is not built in and node-gyp needs it to build lmdb
- run: apt-get update && apt-get install python -y
- run: sudo apt-get update && sudo apt-get install python -y
- run:
name: "Update React to prerelease"
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
Expand Down Expand Up @@ -664,12 +659,6 @@ workflows:
requires:
- lint
- bootstrap
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- unit_tests_node14:
<<: *ignore_docs
requires:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"csstype": "2.6.17"
},
"scripts": {
"bootstrap": "npm-run-all -s check-versions \"lerna-prepare -- --{@}\" --",
"bootstrap": "cross-env COMPILER_OPTIONS=\"GATSBY_MAJOR=4\" npm-run-all -s check-versions \"lerna-prepare -- --{@}\" --",
"check-repo-fields": "node scripts/check-repo-fields.js",
"check-versions": "node scripts/check-versions.js",
"format": "npm run format:code && npm run format:other && npm run format:svg",
Expand All @@ -141,7 +141,7 @@
"prettier": "prettier \"**/*.{md,css,scss,yaml,yml}\"",
"publish": "echo \"Use 'yarn publish-next' or 'yarn publish-release' instead of 'yarn run publish'\"",
"publish-canary": "node scripts/check-publish-access && lerna publish --canary --yes",
"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\"",
"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\"",
"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\"",
"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\"",
"publish-release": "node scripts/check-publish-access && node scripts/clear-package-dir patch --verbose && lerna publish patch",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-remove-graphql-queries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"peerDependencies": {
"@babel/core": "^7.0.0",
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"license": "MIT",
"main": "index.js",
Expand All @@ -30,6 +30,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\" --extensions \".ts,.js\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Array [
"modules": "commonjs",
"shippedProposals": true,
"targets": Object {
"node": "12.13.0",
"node": "14.15.0",
},
"useBuiltIns": "entry",
},
Expand All @@ -151,7 +151,7 @@ Array [
"modules": "commonjs",
"shippedProposals": true,
"targets": Object {
"node": "12.13.0",
"node": "14.15.0",
},
"useBuiltIns": "entry",
},
Expand Down
8 changes: 6 additions & 2 deletions packages/babel-preset-gatsby-package/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ function preset(context, options = {}) {
const {
browser = false,
debug = false,
nodeVersion = `12.13.0`,
nodeVersion = `14.15.0`,
esm = false,
availableCompilerFlags = [`GATSBY_MAJOR`],
} = options
const { NODE_ENV, BABEL_ENV, COMPILER_OPTIONS } = process.env
const {
NODE_ENV,
BABEL_ENV,
COMPILER_OPTIONS = `GATSBY_MAJOR=4`,
} = process.env

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

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"license": "MIT",
"main": "lib/index.js",
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
},
"files": [
"lib/*.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
"slash": "^3.0.0"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@
"postinstall": "node scripts/postinstall.js"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
8 changes: 4 additions & 4 deletions packages/gatsby-cli/src/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const setup = (version?: string): ReturnType<typeof getCLI> => {
}

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

expect(reporter.panic).toHaveBeenCalledTimes(1)
Expand Down Expand Up @@ -95,8 +95,8 @@ describe(`error handling`, () => {
// })

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

expect(reporter.panic).not.toHaveBeenCalled()
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"cross-env": "^7.0.3"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
},
"bin": "./bin/gatsby-codemods.js"
}
2 changes: 1 addition & 1 deletion packages/gatsby-core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"typescript": "^4.3.5"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
],
"peerDependencies": {
"cypress": "^3.1.0",
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"scripts": {
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
"prepare": "cross-env NODE_ENV=production npm run build",
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"preval.macro": "^5.0.0"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-dev-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
"watch": "babel -w src --out-dir dist --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-graphiql-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"whatwg-fetch": "^3.6.2"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
},
"types": "index.d.ts",
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-page-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
"dist/"
],
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-benchmark-reporting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-canonical-urls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +36,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-catch-links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"repository": {
"type": "git",
Expand All @@ -37,6 +37,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-coffeescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"repository": {
"type": "git",
Expand All @@ -43,6 +43,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-create-client-paths/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^3.0.0-next.0"
"gatsby": "^4.0.0-next"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +36,6 @@
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
}
}
Loading

0 comments on commit f8c5141

Please sign in to comment.