Skip to content

Commit 55f39a7

Browse files
committed
Merge branch 'master' into svgo
* master: (1037 commits) Update starters.yml (gatsbyjs#10505) chore(release): Publish fix(graphql-skip-limit): fix hasNextPage (gatsbyjs#10504) chore: use cjs instead of esm for consistency (gatsbyjs#10494) feat(gatsby-remark-copy-linked-files): add support for video elements with `src` attribute (gatsbyjs#10395) typofix (gatsbyjs#10488) Add kobit.in to showcase (gatsbyjs#10496) fix(docs): window.reload => window.location.reload (gatsbyjs#10459) feat(www): add unbird feedback component to starter lib (gatsbyjs#10450) fix(blog): youfit case study typofix Doc improvements to Visual testing with Storybook guide (gatsbyjs#10436) fix(gatsby-plugin-offline): prevent incorrect revisioning of static file by workbox (gatsbyjs#10416) fix(starters): ttag repo link fix typo in pull request template (gatsbyjs#10454) fix(www) Fix query for plugin links always ?=undefined (gatsbyjs#10453) chore(release): Publish fix(gatsby): fix extracting StaticQuery nested in shorthand fragment (gatsbyjs#10443) fix(www): avoid querying for no-cache=1 (gatsbyjs#10389) fix(gatsby-image): update typescript definitions - properly mark fields as optional (gatsbyjs#10419) refactor(gatsby): improve EnsureResources (gatsbyjs#10224) ...
2 parents 42dab81 + 84124da commit 55f39a7

File tree

1,641 files changed

+50027
-19517
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,641 files changed

+50027
-19517
lines changed

.babelrc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ if (process.env.NODE_ENV !== `test`) {
66
ignore.push(`**/__tests__`)
77
}
88

9-
const presetAbsPath = require(`path`).join(__dirname, '.babel-preset.js')
10-
119
module.exports = {
1210
sourceMaps: true,
13-
presets: [presetAbsPath],
11+
presets: ["babel-preset-gatsby-package"],
1412
ignore,
1513
}

.circleci/config.yml

Lines changed: 94 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
aliases:
2-
node6: &node6
3-
docker:
4-
- image: circleci/node:6
5-
6-
node8: &node8
7-
docker:
8-
- image: circleci/node:8
9-
10-
node10: &node10
1+
executors:
2+
node:
3+
parameters:
4+
image:
5+
type: string
6+
default: "10"
117
docker:
12-
- image: circleci/node:10
8+
- image: circleci/node:<< parameters.image >>
139

14-
node10_browsers: &node10_browsers
10+
aliases:
11+
e2e-executor: &e2e-executor
1512
docker:
16-
- image: circleci/node:10-browsers
13+
- image: cypress/browsers:chrome69
1714

18-
restore_node_modules: &restore_node_modules
15+
restore_cache: &restore_cache
1916
restore_cache:
2017
name: Restore node_modules cache
2118
keys:
22-
- node-modules-{{ checksum "yarn.lock" }}
19+
- yarn-cypress-cache-{{ checksum "yarn.lock" }}
2320

2421
install_node_modules: &install_node_modules
2522
run:
2623
name: Install node modules
27-
command: |
28-
yarn
24+
command: yarn --frozen-lockfile
2925

30-
persist_node_modules: &persist_node_modules
26+
persist_cache: &persist_cache
3127
save_cache:
3228
name: Save node modules cache
33-
key: node-modules-{{ checksum "yarn.lock" }}
29+
key: yarn-cypress-cache-{{ checksum "yarn.lock" }}
3430
paths:
35-
- node_modules
31+
- ~/.cache
3632

3733
attach_to_bootstrap: &attach_to_bootstrap
3834
attach_workspace:
@@ -44,108 +40,126 @@ aliases:
4440
ignore:
4541
- master
4642

43+
ignore_docs: &ignore_docs
44+
filters:
45+
branches:
46+
ignore:
47+
- /docs.+/
48+
- /blog.+/
49+
4750
test_template: &test_template
4851
steps:
4952
- checkout
50-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
51-
- <<: *restore_node_modules
53+
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
54+
- <<: *restore_cache
5255
- <<: *install_node_modules
53-
- <<: *persist_node_modules
56+
- <<: *persist_cache
5457
- <<: *attach_to_bootstrap
5558
- run: yarn jest -w 1
5659

57-
integration_test_workflow: &integration_test_workflow
58-
<<: *ignore_master
60+
e2e-test-workflow: &e2e-test-workflow
61+
filters:
62+
branches:
63+
ignore:
64+
- master
65+
- /docs.+/
66+
- /blog.+/
5967
requires:
6068
- bootstrap
6169

62-
version: 2
70+
commands:
71+
e2e-test:
72+
parameters:
73+
trigger_pattern:
74+
type: string
75+
default: "packages/*|.circleci/*"
76+
test_path:
77+
type: string
78+
steps:
79+
- checkout
80+
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
81+
- <<: *restore_cache
82+
- <<: *install_node_modules
83+
- <<: *persist_cache
84+
- <<: *attach_to_bootstrap
85+
- run: ./scripts/e2e-test.sh "<< parameters.test_path >>"
86+
87+
version: 2.1
6388

6489
jobs:
6590
bootstrap:
66-
<<: *node10
91+
executor: node
6792
steps:
6893
- checkout
69-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
70-
- <<: *restore_node_modules
94+
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
95+
- <<: *restore_cache
7196
- <<: *install_node_modules
72-
- <<: *persist_node_modules
97+
- <<: *persist_cache
7398
- run: yarn bootstrap
7499
- persist_to_workspace:
75100
root: packages
76101
paths:
77-
- '*'
102+
- "*"
78103

79104
lint:
80-
<<: *node10
105+
executor: node
81106
steps:
82107
- checkout
83-
- <<: *restore_node_modules
108+
- <<: *restore_cache
84109
- <<: *install_node_modules
85-
- <<: *persist_node_modules
110+
- <<: *persist_cache
86111
- run: yarn lint
87112

88113
unit_tests_node6:
89-
<<: *node6
114+
executor:
115+
name: node
116+
image: "6"
90117
<<: *test_template
91118

92119
unit_tests_node8:
93-
<<: *node8
120+
executor:
121+
name: node
122+
image: "8"
94123
<<: *test_template
95124

96125
unit_tests_node10:
97-
<<: *node10
126+
executor: node
98127
<<: *test_template
99128

100129
integration_tests:
101-
<<: *node10
130+
executor: node
102131
steps:
103132
- checkout
104-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
105-
- <<: *restore_node_modules
133+
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*|.circleci/*"
134+
- <<: *restore_cache
106135
- <<: *install_node_modules
107-
- <<: *persist_node_modules
136+
- <<: *persist_cache
137+
- <<: *attach_to_bootstrap
108138
- run: yarn test:integration
109139

110140
e2e_tests_gatsbygram:
111-
<<: *node10_browsers
141+
<<: *e2e-executor
112142
steps:
113-
- checkout
114-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*|examples/gatsbygram/*"
115-
- <<: *restore_node_modules
116-
- <<: *install_node_modules
117-
- <<: *attach_to_bootstrap
118-
- run: ./scripts/integration-test.sh examples/gatsbygram
143+
- e2e-test:
144+
test_path: examples/gatsbygram
119145

120146
e2e_tests_path-prefix:
121-
<<: *node10_browsers
147+
<<: *e2e-executor
122148
steps:
123-
- checkout
124-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
125-
- <<: *restore_node_modules
126-
- <<: *install_node_modules
127-
- <<: *attach_to_bootstrap
128-
- run: ./scripts/integration-test.sh integration-tests/path-prefix
129-
149+
- e2e-test:
150+
test_path: e2e-tests/path-prefix
151+
130152
e2e_tests_gatsby-image:
131-
<<: *node10_browsers
153+
<<: *e2e-executor
132154
steps:
133-
- checkout
134-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
135-
- <<: *restore_node_modules
136-
- <<: *install_node_modules
137-
- <<: *attach_to_bootstrap
138-
- run: ./scripts/integration-test.sh integration-tests/gatsby-image
139-
155+
- e2e-test:
156+
test_path: e2e-tests/gatsby-image
157+
140158
e2e_tests_runtime:
141-
<<: *node10_browsers
159+
<<: *e2e-executor
142160
steps:
143-
- checkout
144-
- run: ./scripts/assert-changed-files.sh "packages/*|integration-tests/*"
145-
- <<: *restore_node_modules
146-
- <<: *install_node_modules
147-
- <<: *attach_to_bootstrap
148-
- run: ./scripts/integration-test.sh integration-tests/production-runtime
161+
- e2e-test:
162+
test_path: e2e-tests/production-runtime
149163

150164
workflows:
151165
version: 2
@@ -154,20 +168,24 @@ workflows:
154168
- bootstrap
155169
- lint
156170
- unit_tests_node6:
171+
<<: *ignore_docs
157172
requires:
158173
- bootstrap
159174
- unit_tests_node8:
175+
<<: *ignore_docs
160176
requires:
161177
- bootstrap
162178
- unit_tests_node10:
179+
<<: *ignore_docs
163180
requires:
164181
- bootstrap
165-
- integration_tests
182+
- integration_tests:
183+
<<: *ignore_docs
166184
- e2e_tests_gatsbygram:
167-
<<: *integration_test_workflow
185+
<<: *e2e-test-workflow
168186
- e2e_tests_path-prefix:
169-
<<: *integration_test_workflow
187+
<<: *e2e-test-workflow
170188
- e2e_tests_gatsby-image:
171-
<<: *integration_test_workflow
189+
<<: *e2e-test-workflow
172190
- e2e_tests_runtime:
173-
<<: *integration_test_workflow
191+
<<: *e2e-test-workflow

.editorconfig

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@
22
root = true
33

44
[*]
5-
indent_style = space
6-
indent_size = 2
7-
end_of_line = lf
85
charset = utf-8
9-
trim_trailing_whitespace = true
10-
insert_final_newline = true
11-
12-
[{*.json}]
13-
indent_style = space
14-
indent_size = 4
15-
16-
# Matches the exact package.json, or *rc
17-
[{package.json,*.yml,*rc}]
18-
indent_style = space
6+
end_of_line = lf
197
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true

.eslintrc.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"prettier/flowtype",
1010
"prettier/react"
1111
],
12-
"plugins": ["flowtype", "react"],
12+
"plugins": ["flowtype", "prettier", "react"],
1313
"parserOptions": {
1414
"ecmaVersion": 2016,
1515
"sourceType": "module",
@@ -27,36 +27,22 @@
2727
"spyOn": true
2828
},
2929
"rules": {
30-
"no-console": "off",
31-
"no-inner-declarations": "off",
32-
"valid-jsdoc": "off",
33-
"require-jsdoc": "off",
34-
"quotes": ["error", "backtick"],
35-
"consistent-return": ["error"],
3630
"arrow-body-style": [
3731
"error",
3832
"as-needed",
3933
{ "requireReturnForObjectLiteral": true }
4034
],
41-
"jsx-quotes": ["error", "prefer-double"],
42-
"semi": ["error", "never"],
43-
"object-curly-spacing": ["error", "always"],
44-
"comma-dangle": [
45-
"error",
46-
{
47-
"arrays": "always-multiline",
48-
"objects": "always-multiline",
49-
"imports": "always-multiline",
50-
"exports": "always-multiline",
51-
"functions": "ignore"
52-
}
53-
],
54-
"react/prop-types": [
55-
"error",
56-
{
57-
"ignore": ["children"]
58-
}
59-
]
35+
"consistent-return": ["error"],
36+
"no-console": "off",
37+
"no-inner-declarations": "off",
38+
"prettier/prettier": "error",
39+
"quotes": ["error", "backtick"],
40+
"react/display-name": "off",
41+
"react/jsx-key": "warn",
42+
"react/no-unescaped-entities": "warn",
43+
"react/prop-types": "off",
44+
"require-jsdoc": "off",
45+
"valid-jsdoc": "off"
6046
},
6147
"overrides": [
6248
{
@@ -71,6 +57,18 @@
7157
"___loader": false,
7258
"___emitter": false
7359
}
60+
},
61+
{
62+
"files": ["**/cypress/integration/**/*", "**/cypress/support/**/*"],
63+
"globals": {
64+
"cy": false,
65+
"Cypress": false
66+
}
67+
}
68+
],
69+
"settings": {
70+
"react": {
71+
"version": "16.4.2"
7472
}
75-
]
73+
}
7674
}

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.js.snap text eol=lf
2+
**/__testfixtures__/** text eol=lf
3+
**/__tests__/fixtures/** text eol=lf
4+
**/*.md text eol=lf

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<!--
22
Q. Which branch should I use for my pull request?
3-
A. Use `master` branch (probably).
4-
5-
Q. Which branch if my change is a bug fix for Gatsby v1?
6-
A. In this case, you should use the `v1` branch
7-
8-
Q. Which branch if I'm still not sure?
9-
A. Use `master` branch. Ask in the PR if you're not sure and a Gatsby maintainer will be happy to help :)
3+
A. Your best bet is to go for `master`. If you are unsure, ask in the PR, and a Gatsby maintainer will be happy to help :)
104
115
Note: We will only accept bug fixes for Gatsby v1. New features should be added to Gatsby v2.
126

0 commit comments

Comments
 (0)