Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c525e4a

Browse files
author
madalynrose
committed
Merge branch 'master' of github.com:gatsbyjs/gatsby into a11y-routing-mvp
2 parents 164eeba + 4e2b8ab commit c525e4a

File tree

758 files changed

+46000
-26716
lines changed

Some content is hidden

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

758 files changed

+46000
-26716
lines changed

.circleci/config.yml

Lines changed: 197 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
orbs:
22
win: circleci/[email protected]
3+
slack: circleci/[email protected]
34

45
executors:
56
node:
@@ -35,7 +36,7 @@ aliases:
3536

3637
attach_to_bootstrap: &attach_to_bootstrap
3738
attach_workspace:
38-
at: packages
39+
at: ./
3940

4041
ignore_master: &ignore_master
4142
filters:
@@ -52,12 +53,10 @@ aliases:
5253

5354
test_template: &test_template
5455
steps:
55-
- checkout
56-
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
57-
- <<: *restore_cache
58-
- <<: *install_node_modules
59-
- <<: *persist_cache
6056
- <<: *attach_to_bootstrap
57+
- <<: *install_node_modules
58+
- run: yarn list react
59+
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
6160
- run: yarn jest -w 1 --ci
6261
- run: GATSBY_DB_NODES=loki yarn jest -w 1 --ci
6362

@@ -72,9 +71,70 @@ aliases:
7271
- lint
7372
- unit_tests_node8
7473

74+
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
75+
<<: *e2e-executor
76+
parameters:
77+
nightly:
78+
type: boolean
79+
default: false
80+
steps:
81+
- e2e-test:
82+
test_path: e2e-tests/production-runtime
83+
test_command: CYPRESS_PROJECT_ID=is8aoq CYPRESS_RECORD_KEY=cb4708d2-1578-4665-9a07-c59f8db28d91 yarn test && CYPRESS_PROJECT_ID=htpvkv CYPRESS_RECORD_KEY=0d734841-c613-41d2-86e5-df0b5968f93f yarn test:offline
84+
skip_file_change_test: << parameters.nightly >>
85+
- notify-status:
86+
condition: << parameters.nightly >>
87+
88+
e2e_tests_development_runtime_alias: &e2e_tests_development_runtime_alias
89+
<<: *e2e-executor
90+
parameters:
91+
nightly:
92+
type: boolean
93+
default: false
94+
environment:
95+
CYPRESS_PROJECT_ID: s3j3qj
96+
CYPRESS_RECORD_KEY: 3904ca0c-bc98-47d9-8371-b68c5e81fb9b
97+
steps:
98+
- e2e-test:
99+
test_path: e2e-tests/development-runtime
100+
skip_file_change_test: << parameters.nightly >>
101+
- notify-status:
102+
condition: << parameters.nightly >>
103+
104+
e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
105+
<<: *e2e-executor
106+
parameters:
107+
nightly:
108+
type: boolean
109+
default: false
110+
environment:
111+
CYPRESS_PROJECT_ID: ave32k
112+
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
113+
steps:
114+
- e2e-test:
115+
test_path: e2e-tests/gatsby-image
116+
skip_file_change_test: << parameters.nightly >>
117+
- notify-status:
118+
condition: << parameters.nightly >>
119+
75120
commands:
121+
notify-status:
122+
parameters:
123+
condition:
124+
type: boolean
125+
default: false
126+
steps:
127+
- when:
128+
condition: << parameters.condition >>
129+
steps:
130+
- slack/status:
131+
channel: eng-react-integration-status
132+
76133
e2e-test:
77134
parameters:
135+
skip_file_change_test:
136+
type: boolean
137+
default: false
78138
trigger_pattern:
79139
type: string
80140
default: "packages/*|.circleci/*"
@@ -84,12 +144,15 @@ commands:
84144
type: string
85145
default: "" # if unset, e2e-test.sh specifies the command
86146
steps:
87-
- checkout
88-
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
89-
- <<: *restore_cache
90-
- <<: *install_node_modules
91-
- <<: *persist_cache
92147
- <<: *attach_to_bootstrap
148+
# In case of failure, add these steps again. Cache probably got deleted
149+
#- <<: *restore_cache
150+
#- <<: *install_node_modules
151+
#- <<: *persist_cache
152+
- unless:
153+
condition: << parameters.skip_file_change_test >>
154+
steps:
155+
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
93156
- run: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"
94157

95158
version: 2.1
@@ -99,24 +162,28 @@ jobs:
99162
executor: node
100163
steps:
101164
- checkout
102-
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
103165
- <<: *restore_cache
104166
- <<: *install_node_modules
105167
- <<: *persist_cache
168+
# persist our git checkout and node_modules as the next step (assert-changed-files) might exit this step
169+
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node8
170+
- persist_to_workspace:
171+
root: ./
172+
paths:
173+
- "*"
174+
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
106175
- run: yarn bootstrap -- concurrency=2
176+
# Persist the workspace again with all packages already built
107177
- persist_to_workspace:
108-
root: packages
178+
root: ./
109179
paths:
110180
- "*"
111181

112182
lint:
113183
executor: node
114184
parallelism: 2
115185
steps:
116-
- checkout
117-
- <<: *restore_cache
118-
- <<: *install_node_modules
119-
- <<: *persist_cache
186+
- <<: *attach_to_bootstrap
120187
- run: yarn lint:code
121188
- run: yarn lint:other
122189
- run: yarn check-repo-fields
@@ -176,29 +243,31 @@ jobs:
176243
test_path: e2e-tests/path-prefix
177244

178245
e2e_tests_gatsby-image:
179-
<<: *e2e-executor
180-
environment:
181-
CYPRESS_PROJECT_ID: ave32k
182-
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
183-
steps:
184-
- e2e-test:
185-
test_path: e2e-tests/gatsby-image
246+
<<: *e2e_tests_gatsby-image_alias
247+
248+
e2e_tests_gatsby-image_with_experimental_react:
249+
<<: *e2e_tests_gatsby-image_alias
250+
251+
e2e_tests_gatsby-image_with_next_react:
252+
<<: *e2e_tests_gatsby-image_alias
186253

187254
e2e_tests_development_runtime:
188-
<<: *e2e-executor
189-
environment:
190-
CYPRESS_PROJECT_ID: s3j3qj
191-
CYPRESS_RECORD_KEY: 3904ca0c-bc98-47d9-8371-b68c5e81fb9b
192-
steps:
193-
- e2e-test:
194-
test_path: e2e-tests/development-runtime
255+
<<: *e2e_tests_development_runtime_alias
256+
257+
e2e_tests_development_runtime_with_experimental_react:
258+
<<: *e2e_tests_development_runtime_alias
259+
260+
e2e_tests_development_runtime_with_next_react:
261+
<<: *e2e_tests_development_runtime_alias
195262

196263
e2e_tests_production_runtime:
197-
<<: *e2e-executor
198-
steps:
199-
- e2e-test:
200-
test_path: e2e-tests/production-runtime
201-
test_command: CYPRESS_PROJECT_ID=is8aoq CYPRESS_RECORD_KEY=cb4708d2-1578-4665-9a07-c59f8db28d91 yarn test && CYPRESS_PROJECT_ID=htpvkv CYPRESS_RECORD_KEY=0d734841-c613-41d2-86e5-df0b5968f93f yarn test:offline
264+
<<: *e2e_tests_production_runtime_alias
265+
266+
e2e_tests_production_runtime_with_experimental_react:
267+
<<: *e2e_tests_production_runtime_alias
268+
269+
e2e_tests_production_runtime_with_next_react:
270+
<<: *e2e_tests_production_runtime_alias
202271

203272
themes_e2e_tests_development_runtime:
204273
<<: *e2e-executor
@@ -230,26 +299,36 @@ jobs:
230299
starters_publish:
231300
executor: node
232301
steps:
233-
- checkout
234-
- <<: *restore_cache
235-
- <<: *install_node_modules
236-
- <<: *persist_cache
302+
- <<: *attach_to_bootstrap
237303
- run: yarn markdown
238304
- run: sudo apt-get update && sudo apt-get install jq # jq is helpful for parsing json
239305
- run: git config --global user.name "GatsbyJS Bot"
240306
- run: git config --global user.email "[email protected]"
241307
- run: sh ./scripts/publish-starters.sh "starters/*"
242308

309+
update_i18n_source:
310+
executor: node
311+
steps:
312+
- checkout
313+
- run: git config --global user.name "GatsbyJS Bot"
314+
- run: git config --global user.email "[email protected]"
315+
- run:
316+
command: yarn
317+
working_directory: ~/project/scripts/i18n
318+
- run:
319+
command: yarn run update-source
320+
working_directory: ~/project/scripts/i18n
321+
243322
build_www:
244323
docker:
245324
- image: circleci/node:12
246325
resource_class: xlarge # ++ RAM and CPU
247326
steps:
248327
- checkout
249328
- restore_cache:
250-
key: v1_www_public_dir
329+
key: v2_www_public_dir
251330
- restore_cache:
252-
key: v1_www_cache_dir
331+
key: v2_www_cache_dir
253332
- run:
254333
command: yarn
255334
working_directory: ~/project/www
@@ -258,11 +337,11 @@ jobs:
258337
command: GATSBY_CPU_COUNT=8 yarn build
259338
working_directory: ~/project/www
260339
- save_cache:
261-
key: v1_www_public_dir_{{ epoch }}
340+
key: v2_www_public_dir_{{ epoch }}
262341
paths:
263342
- ~/project/www/public
264343
- save_cache:
265-
key: v1_www_cache_dir_{{ epoch }}
344+
key: v2_www_cache_dir_{{ epoch }}
266345
paths:
267346
- ~/project/www/.cache
268347

@@ -272,7 +351,7 @@ jobs:
272351
steps:
273352
- checkout
274353
- restore_cache:
275-
key: v1_www_public_dir
354+
key: v2_www_public_dir
276355
- run:
277356
command: yarn add netlify-cli
278357
working_directory: ~/project/www
@@ -302,8 +381,74 @@ jobs:
302381
name: "Run Tests"
303382
command: yarn test
304383

384+
bootstrap-with-experimental-react:
385+
executor: node
386+
parameters:
387+
version:
388+
type: string
389+
default: "next"
390+
steps:
391+
- checkout
392+
- run:
393+
name: "Update React to prerelease"
394+
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
395+
- run: yarn install
396+
- run: yarn bootstrap -- concurrency=2
397+
- run: yarn list react
398+
- persist_to_workspace:
399+
root: ./
400+
paths:
401+
- "*"
402+
305403
workflows:
306404
version: 2
405+
nightly-react-next:
406+
triggers:
407+
- schedule:
408+
cron: "0 0 * * 1,2,3,4,5"
409+
filters:
410+
branches:
411+
only:
412+
- master
413+
jobs:
414+
- bootstrap-with-experimental-react:
415+
version: "next"
416+
- e2e_tests_gatsby-image_with_next_react:
417+
nightly: true
418+
requires:
419+
- bootstrap-with-experimental-react
420+
- e2e_tests_development_runtime_with_next_react:
421+
nightly: true
422+
requires:
423+
- bootstrap-with-experimental-react
424+
- e2e_tests_production_runtime_with_next_react:
425+
nightly: true
426+
requires:
427+
- bootstrap-with-experimental-react
428+
nightly-react-experimental:
429+
triggers:
430+
- schedule:
431+
cron: "0 0 * * 1,2,3,4,5"
432+
filters:
433+
branches:
434+
only:
435+
- master
436+
jobs:
437+
- bootstrap-with-experimental-react:
438+
version: "experimental"
439+
- e2e_tests_gatsby-image_with_experimental_react:
440+
nightly: true
441+
requires:
442+
- bootstrap-with-experimental-react
443+
- e2e_tests_development_runtime_with_experimental_react:
444+
nightly: true
445+
requires:
446+
- bootstrap-with-experimental-react
447+
- e2e_tests_production_runtime_with_experimental_react:
448+
nightly: true
449+
requires:
450+
- bootstrap-with-experimental-react
451+
307452
build-test:
308453
jobs:
309454
- windows_unit_tests
@@ -350,6 +495,8 @@ workflows:
350495
- starters_validate:
351496
<<: *ignore_master
352497
- starters_publish:
498+
requires:
499+
- bootstrap
353500
filters:
354501
branches:
355502
only:
@@ -368,6 +515,11 @@ workflows:
368515
requires:
369516
- build_www
370517
context: build_www
518+
- update_i18n_source:
519+
filters:
520+
branches:
521+
only:
522+
- master
371523
www_deploy:
372524
triggers:
373525
- schedule:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212

1313
<!-- Write a brief description of the changes introduced by this PR -->
1414

15+
### Documentation
16+
17+
<!--
18+
Where is this feature or API documented?
19+
20+
- If docs exist:
21+
- Update any references, if relevant. This includes Guides and Gatsby Internals docs.
22+
- If no docs exist:
23+
- Create a stub for documentation including bullet points for how to use the feature, code snippets (including from happy path tests), etc.
24+
- Tag @gatsbyjs/learning for review, pairing, polishing of the documentation
25+
-->
26+
1527
## Related Issues
1628

1729
<!--

0 commit comments

Comments
 (0)