Skip to content

Commit 873ffce

Browse files
author
gatsbybot
committed
Merge remote-tracking branch 'upstream/master' into veryspry/fix-windows-node-manifest
2 parents 57a733d + c9a35ed commit 873ffce

File tree

1,414 files changed

+106242
-66008
lines changed

Some content is hidden

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

1,414 files changed

+106242
-66008
lines changed

.circleci/config.yml

+86-80
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ executors:
77
parameters:
88
image:
99
type: string
10-
# First 10.x LTS release, but old Yarn
11-
default: "12.13.0"
10+
default: "14.17.0"
1211
docker:
1312
- image: cimg/node:<< parameters.image >>
13+
environment:
14+
GATSBY_CPU_COUNT: 2
1415

1516
aliases:
1617
e2e-executor: &e2e-executor
1718
docker:
18-
- image: cypress/browsers:node12.18.3-chrome87-ff82
19+
- image: cypress/browsers:node14.15.0-chrome86-ff82
20+
environment:
21+
GATSBY_CPU_COUNT: 2
1922

2023
restore_cache: &restore_cache
2124
restore_cache:
@@ -63,6 +66,7 @@ aliases:
6366
- /blog.+/
6467

6568
test_template: &test_template
69+
parallelism: 4
6670
parameters:
6771
npm_rebuild:
6872
type: boolean
@@ -75,12 +79,17 @@ aliases:
7579
condition: << parameters.npm_rebuild >>
7680
steps:
7781
- run: npm rebuild
78-
- run: yarn list react
79-
- run: yarn why lmdb-store
8082
- run:
81-
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
83+
name: Step debug info
84+
command: |
85+
yarn list react
86+
yarn why lmdb-store
87+
- run:
88+
name: Run tests
89+
command: yarn jest --ci --runInBand $(yarn -s jest --listTests | sed 's/\/home\/circleci\/project\///g' | circleci tests split)
8290
environment:
83-
GENERATE_JEST_REPORT: true
91+
NODE_OPTIONS: --max-old-space-size=2048
92+
GENERATE_JEST_REPORT: "true"
8493
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
8594
JEST_JUNIT_OUTPUT_NAME: results.xml
8695
- store_test_results:
@@ -96,7 +105,7 @@ aliases:
96105
requires:
97106
- lint
98107
- typecheck
99-
- unit_tests_node12
108+
- unit_tests_node14
100109

101110
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
102111
<<: *e2e-executor
@@ -128,22 +137,6 @@ aliases:
128137
- notify-status:
129138
condition: << parameters.nightly >>
130139

131-
e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
132-
<<: *e2e-executor
133-
parameters:
134-
nightly:
135-
type: boolean
136-
default: false
137-
environment:
138-
CYPRESS_PROJECT_ID: ave32k
139-
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
140-
steps:
141-
- e2e-test:
142-
test_path: e2e-tests/gatsby-image
143-
skip_file_change_test: << parameters.nightly >>
144-
- notify-status:
145-
condition: << parameters.nightly >>
146-
147140
commands:
148141
notify-status:
149142
parameters:
@@ -155,7 +148,7 @@ commands:
155148
condition: << parameters.condition >>
156149
steps:
157150
- slack/status:
158-
channel: eng-react-integration-status
151+
channel: eng-react-integration-status
159152

160153
e2e-test:
161154
parameters:
@@ -198,7 +191,7 @@ jobs:
198191
- checkout
199192
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|scripts/e2e-test.sh|yarn.lock"
200193
# python 2 is not built in and node-gyp needs it to build lmdb
201-
- run: apt-get update && apt-get install python -y
194+
- run: sudo apt-get update && sudo apt-get install python -y
202195
- <<: *restore_cache
203196
- <<: *install_node_modules
204197
- <<: *check_lockfile
@@ -209,7 +202,8 @@ jobs:
209202
- persist_to_workspace:
210203
root: ./
211204
paths:
212-
- "*"
205+
- "packages/"
206+
- "node_modules/"
213207

214208
lint:
215209
executor: node
@@ -236,11 +230,6 @@ jobs:
236230
- run: yarn typecheck
237231
- run: yarn check-repo-fields
238232

239-
unit_tests_node12:
240-
executor:
241-
name: node
242-
<<: *test_template
243-
244233
unit_tests_node14:
245234
executor:
246235
name: node
@@ -253,20 +242,22 @@ jobs:
253242
image: "14.17.0"
254243
environment:
255244
GATSBY_EXPERIMENTAL_LMDB_STORE: 1
245+
GATSBY_EXPERIMENTAL_LMDB_INDEXES: 1
256246
GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING: 1
257247
<<: *test_template
258248

259249
integration_tests_gatsby_source_wordpress:
260-
machine: true
250+
machine:
251+
image: "ubuntu-2004:202107-02"
261252
steps:
262253
- run:
263254
command: |
264255
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
265256
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
266-
- run: nvm install v12
267-
- run: nvm alias default v12
268-
- run: nvm use v12
269-
- run: npm i -g [email protected].10
257+
- run: nvm install v14
258+
- run: nvm alias default v14
259+
- run: nvm use v14
260+
- run: npm i -g [email protected].11
270261
- e2e-test:
271262
test_path: integration-tests/gatsby-source-wordpress
272263

@@ -362,6 +353,15 @@ jobs:
362353
- run: # Quick upgrade to the v2 (any version, we just need the real set version)
363354
command: yarn policies set-version berry
364355
working_directory: /tmp/e2e-tests/gatsby-pnp
356+
- run: # Explicitly set nodeLinker to avoid Yarn selecting node_modules due to the Yarn 1.x lockfile
357+
command: yarn config set nodeLinker pnp
358+
working_directory: /tmp/e2e-tests/gatsby-pnp
359+
- run: # Allow installs to change the lockfile
360+
command: yarn config set enableImmutableInstalls false
361+
working_directory: /tmp/e2e-tests/gatsby-pnp
362+
- run: # Don't allow any fallback to root dependencies
363+
command: yarn config set pnpFallbackMode none
364+
working_directory: /tmp/e2e-tests/gatsby-pnp
365365
- run: # Forces to use the local packages
366366
command: yarn link --all --private ~/project
367367
working_directory: /tmp/e2e-tests/gatsby-pnp
@@ -378,15 +378,6 @@ jobs:
378378
command: 'DEBUG=start-server-and-test yarn start-server-and-test "yarn develop 2>&1 | tee log.txt" :8000 "! cat log.txt | grep -E ''ERROR #|Require stack:''"'
379379
working_directory: /tmp/e2e-tests/gatsby-pnp
380380

381-
e2e_tests_gatsby-image:
382-
<<: *e2e_tests_gatsby-image_alias
383-
384-
e2e_tests_gatsby-image_with_experimental_react:
385-
<<: *e2e_tests_gatsby-image_alias
386-
387-
e2e_tests_gatsby-image_with_next_react:
388-
<<: *e2e_tests_gatsby-image_alias
389-
390381
e2e_tests_development_runtime:
391382
<<: *e2e_tests_development_runtime_alias
392383

@@ -485,14 +476,25 @@ jobs:
485476
steps:
486477
- checkout
487478
# jq is helpful for parsing json & python required for node-gyp to build lmdb
488-
- run: apt-get update && apt-get install jq python -y
479+
- run: sudo apt-get update && sudo apt-get install jq python -y
489480
- <<: *restore_cache
490481
- <<: *install_node_modules
491482
- run: yarn markdown
492483
- run: git config --global user.name "GatsbyJS Bot"
493484
- run: git config --global user.email "[email protected]"
494485
- run: sh ./scripts/publish-starters.sh "starters/*"
495486

487+
update_changelogs:
488+
executor: node
489+
steps:
490+
- checkout
491+
- run: sudo apt-get update && sudo apt-get install jq python -y
492+
- <<: *restore_cache
493+
- <<: *install_node_modules
494+
- run: git config --global user.name "GatsbyJS Bot"
495+
- run: git config --global user.email "[email protected]"
496+
- run: node scripts/gatsby-changelog-generator/update-and-open-pr.js
497+
496498
update_i18n_source:
497499
executor: node
498500
steps:
@@ -520,6 +522,7 @@ jobs:
520522
working_directory: ~/project/scripts/i18n
521523

522524
windows_unit_tests:
525+
parallelism: 4
523526
executor:
524527
name: win/default
525528
shell: powershell.exe
@@ -533,28 +536,30 @@ jobs:
533536
# keys:
534537
# - yarn-packages-v2-{{ checksum "yarn.lock" }}
535538
# - yarn-packages-v2-
539+
540+
- <<: *attach_to_bootstrap
536541
- run:
537-
name: Install node 12.13
542+
name: Install node 14.17 and yarn
538543
command: |
539-
nvm install 12.13.0
540-
nvm alias default 12.13.0
541-
nvm use 12.13.0
544+
nvm install 14.17.0
545+
nvm alias default 14.17.0
546+
nvm use 14.17.0
542547
choco install yarn
543548
- run:
544-
name: Set yarn timeout
545-
command: yarn config set network-timeout 300000
546-
- run:
547-
name: Install node modules
548-
command: yarn --frozen-lockfile
549-
# Caching is slow, so disabling
550-
# - save_cache:
551-
# paths:
552-
# - C:\Users\circleci\AppData\Local\Yarn\Cache
553-
# key: yarn-packages-v2-{{ checksum "yarn.lock" }}
554-
- run: yarn npm-run-all -s check-versions "lerna-prepare --concurrency=4 --stream"
549+
name: Rebuild packages for windows
550+
command: |
551+
Remove-Item -Recurse -Force -Path "node_modules/sharp/"
552+
yarn
555553
- run:
556-
name: "Run Tests"
557-
command: yarn jest -w 1 --ci
554+
name: Run tests
555+
command: yarn jest --ci --runInBand ((yarn jest --listTests) | Foreach-Object {$_ -replace '.*\\packages', 'packages'} | Foreach-Object {$_ -replace '\\', '/'} | circleci tests split --split-by=timings)
556+
environment:
557+
NODE_OPTIONS: --max-old-space-size=2048
558+
GENERATE_JEST_REPORT: "true"
559+
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
560+
JEST_JUNIT_OUTPUT_NAME: results.xml
561+
- store_test_results:
562+
path: ./test-results/jest-node/
558563

559564
bootstrap-with-experimental-react:
560565
executor: node
@@ -565,7 +570,7 @@ jobs:
565570
steps:
566571
- checkout
567572
# python 2 is not built in and node-gyp needs it to build lmdb
568-
- run: apt-get update && apt-get install python -y
573+
- run: sudo apt-get update && sudo apt-get install python -y
569574
- run:
570575
name: "Update React to prerelease"
571576
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
@@ -602,10 +607,6 @@ workflows:
602607
jobs:
603608
- bootstrap-with-experimental-react:
604609
version: "next"
605-
- e2e_tests_gatsby-image_with_next_react:
606-
nightly: true
607-
requires:
608-
- bootstrap-with-experimental-react
609610
- e2e_tests_development_runtime_with_next_react:
610611
nightly: true
611612
requires:
@@ -625,10 +626,6 @@ workflows:
625626
jobs:
626627
- bootstrap-with-experimental-react:
627628
version: "experimental"
628-
- e2e_tests_gatsby-image_with_experimental_react:
629-
nightly: true
630-
requires:
631-
- bootstrap-with-experimental-react
632629
- e2e_tests_development_runtime_with_experimental_react:
633630
nightly: true
634631
requires:
@@ -638,6 +635,22 @@ workflows:
638635
requires:
639636
- bootstrap-with-experimental-react
640637

638+
# Ideally, we should trigger this when any new release is created, sadly there is no easy way to do it:
639+
# - Can't rely on tags: GitHub won't send webhook to CircleCI when there are more than 3 tags in one push
640+
# See: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push
641+
# - Can't rely on pushes to "release/*" branches because we have "Only build pull requests" option enabled
642+
# (so pushes without pull requests are ignored by CircleCI)
643+
nightly-update-changelogs:
644+
triggers:
645+
- schedule:
646+
cron: "0 0 * * 1,2,3,4,5"
647+
filters:
648+
branches:
649+
only:
650+
- master
651+
jobs:
652+
- update_changelogs
653+
641654
build-test:
642655
jobs:
643656
- bootstrap
@@ -649,11 +662,6 @@ workflows:
649662
<<: *ignore_docs
650663
requires:
651664
- lint
652-
- unit_tests_node12:
653-
<<: *ignore_docs
654-
requires:
655-
- lint
656-
- typecheck
657665
- bootstrap
658666
- unit_tests_node14:
659667
<<: *ignore_docs
@@ -696,8 +704,6 @@ workflows:
696704
<<: *e2e-test-workflow
697705
- e2e_tests_path-prefix:
698706
<<: *e2e-test-workflow
699-
- e2e_tests_gatsby-image:
700-
<<: *e2e-test-workflow
701707
- e2e_tests_gatsby-static-image:
702708
<<: *e2e-test-workflow
703709
- e2e_tests_visual-regression:

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ integration-tests
2222
packages/*/*.js
2323
packages/gatsby-source-shopify/**/*.js
2424
packages/gatsby-plugin-preload-fonts/prepare/*.js
25-
packages/gatsby-image/withIEPolyfill/index.js
2625
packages/gatsby/cache-dir/commonjs/**/*
2726
packages/gatsby-admin/public
2827
packages/gatsby/gatsby-admin-public

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module.exports = {
3636
__PATH_PREFIX__: true,
3737
__BASE_PATH__: true,
3838
__ASSET_PREFIX__: true,
39+
_CFLAGS_: true,
40+
__GATSBY: true,
3941
},
4042
rules: {
4143
"@babel/no-unused-expressions": [

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ body:
1111
Please fill out each section below. This info allows Gatsby maintainers to diagnose (and fix!) your issue as quickly as possible. Otherwise we might need to close the issue without e.g. clear reproduction steps.
1212
1313
Also please verify that your issue is present in `gatsby@next`, too. The `next` version is the latest beta version of Gatsby and has any pending changes that are in the next stable release.
14+
Bug reports also shoulnd't be used for support requests about a specific problem in your site, please use GitHub Discussions for that.
1415
1516
Useful Links:
1617
- Documentation: https://www.gatsbyjs.com/docs/
@@ -22,7 +23,7 @@ body:
2223
options:
2324
- label: "This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues"
2425
required: true
25-
- label: "This issue is not a question, feature request, RFC, or anything other than a bug report. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions"
26+
- label: "This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions"
2627
required: true
2728
- type: textarea
2829
attributes:
@@ -36,7 +37,7 @@ body:
3637
attributes:
3738
label: Reproduction Link
3839
placeholder: "https://github.com/username/repository-name/"
39-
description: "Link to a reproduction (GitHub repository, Codesandbox, etc.). How to make a minimal reproduction: https://gatsby.dev/reproduction"
40+
description: "Link to a reproduction (GitHub repository, Codesandbox, etc.). **Do not link to your actual project**, but provide a minimal reproduction in a fresh project -- how to make a minimal reproduction: https://gatsby.dev/reproduction"
4041
validations:
4142
required: true
4243
- type: textarea

0 commit comments

Comments
 (0)