Skip to content

Commit 7711836

Browse files
author
Laurie
committed
Merge branch 'master' into patch-1
2 parents b67b6ec + ba7d505 commit 7711836

File tree

983 files changed

+82543
-37576
lines changed

Some content is hidden

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

983 files changed

+82543
-37576
lines changed

.circleci/config.yml

Lines changed: 31 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
orbs:
2-
win: circleci/windows@2.2.0
2+
win: circleci/windows@2.4.0
33
slack: circleci/[email protected]
44

55
executors:
@@ -8,15 +8,7 @@ executors:
88
image:
99
type: string
1010
# First 10.x LTS release, but old Yarn
11-
default: "10.13"
12-
docker:
13-
- image: circleci/node:<< parameters.image >>
14-
node_10_19:
15-
parameters:
16-
image:
17-
type: string
18-
# More recent Yarn binary
19-
default: "10.19"
11+
default: "12.13"
2012
docker:
2113
- image: circleci/node:<< parameters.image >>
2214

@@ -34,7 +26,12 @@ aliases:
3426
install_node_modules: &install_node_modules
3527
run:
3628
name: Install node modules
37-
command: yarn --frozen-lockfile
29+
command: yarn
30+
31+
check_lockfile: &check_lockfile
32+
run:
33+
name: Check for dirty lockfile
34+
command: ./scripts/check-lockfile.sh || exit 1
3835

3936
persist_cache: &persist_cache
4037
save_cache:
@@ -85,7 +82,7 @@ aliases:
8582
requires:
8683
- lint
8784
- typecheck
88-
- unit_tests_node10
85+
- unit_tests_node12
8986

9087
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
9188
<<: *e2e-executor
@@ -185,6 +182,7 @@ jobs:
185182
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|yarn.lock"
186183
- <<: *restore_cache
187184
- <<: *install_node_modules
185+
- <<: *check_lockfile
188186
- <<: *persist_cache
189187
- run: yarn bootstrap -- concurrency=2
190188
# Persist the workspace again with all packages already built
@@ -218,14 +216,9 @@ jobs:
218216
- run: yarn typecheck
219217
- run: yarn check-repo-fields
220218

221-
unit_tests_node10:
222-
executor: node
223-
<<: *test_template
224-
225219
unit_tests_node12:
226220
executor:
227221
name: node
228-
image: "12"
229222
<<: *test_template
230223

231224
unit_tests_node14:
@@ -234,6 +227,12 @@ jobs:
234227
image: "14"
235228
<<: *test_template
236229

230+
integration_tests_gatsby_source_wordpress:
231+
executor: node
232+
steps:
233+
- e2e-test:
234+
test_path: integration-tests/gatsby-source-wordpress
235+
237236
integration_tests_long_term_caching:
238237
executor: node
239238
steps:
@@ -296,7 +295,7 @@ jobs:
296295
test_path: e2e-tests/path-prefix
297296

298297
e2e_tests_pnp:
299-
executor: node_10_19
298+
executor: node
300299
steps:
301300
- checkout
302301
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
@@ -338,14 +337,6 @@ jobs:
338337
e2e_tests_development_runtime:
339338
<<: *e2e_tests_development_runtime_alias
340339

341-
e2e_tests_development_runtime_fast_refresh:
342-
<<: *e2e_tests_development_runtime_alias
343-
environment:
344-
GATSBY_HOT_LOADER: fast-refresh
345-
CYPRESS_HOT_LOADER: fast-refresh
346-
CYPRESS_PROJECT_ID: 917bea
347-
CYPRESS_RECORD_KEY: 4750fb36-4576-4638-a617-d243a381acef
348-
349340
e2e_tests_development_runtime_with_experimental_react:
350341
<<: *e2e_tests_development_runtime_alias
351342

@@ -466,11 +457,21 @@ jobs:
466457
shell: powershell.exe
467458
steps:
468459
- checkout
460+
- run:
461+
command: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|yarn.lock"
462+
shell: bash.exe
469463
# Restoring cache takes as long as installing node modules, so skipping
470464
# - restore_cache:
471465
# keys:
472466
# - yarn-packages-v2-{{ checksum "yarn.lock" }}
473467
# - yarn-packages-v2-
468+
- run:
469+
name: Install node 12.13
470+
command: |
471+
nvm install 12.13.0
472+
nvm alias default 12.13.0
473+
nvm use 12.13.0
474+
choco install yarn
474475
- run:
475476
name: Set yarn timeout
476477
command: yarn config set network-timeout 300000
@@ -482,9 +483,6 @@ jobs:
482483
# paths:
483484
# - C:\Users\circleci\AppData\Local\Yarn\Cache
484485
# key: yarn-packages-v2-{{ checksum "yarn.lock" }}
485-
- run:
486-
command: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
487-
shell: bash.exe
488486
- run: yarn npm-run-all -s check-versions "lerna-prepare --concurrency=4 --stream"
489487
- run:
490488
name: "Run Tests"
@@ -523,17 +521,6 @@ workflows:
523521
jobs:
524522
- sync_translation_repo
525523

526-
weekly-node-14:
527-
triggers:
528-
- schedule:
529-
cron: "0 1 * * 6"
530-
filters:
531-
branches:
532-
only:
533-
- master
534-
jobs:
535-
- unit_tests_node14
536-
537524
nightly-react-next:
538525
triggers:
539526
- schedule:
@@ -592,18 +579,20 @@ workflows:
592579
<<: *ignore_docs
593580
requires:
594581
- lint
595-
- unit_tests_node10:
582+
- unit_tests_node12:
596583
<<: *ignore_docs
597584
requires:
598585
- lint
599586
- typecheck
600587
- bootstrap
601-
- unit_tests_node12:
588+
- unit_tests_node14:
602589
<<: *ignore_docs
603590
requires:
604591
- lint
605592
- typecheck
606593
- bootstrap
594+
- integration_tests_gatsby_source_wordpress:
595+
<<: *e2e-test-workflow
607596
- integration_tests_long_term_caching:
608597
<<: *e2e-test-workflow
609598
- integration_tests_cache_resilience:
@@ -633,8 +622,6 @@ workflows:
633622
<<: *e2e-test-workflow
634623
- e2e_tests_development_runtime:
635624
<<: *e2e-test-workflow
636-
- e2e_tests_development_runtime_fast_refresh:
637-
<<: *e2e-test-workflow
638625
- e2e_tests_production_runtime:
639626
<<: *e2e-test-workflow
640627
- themes_e2e_tests_production_runtime:

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ packages/*/dist/**
66
packages/*/lib/**
77
packages/*/scripts/**
88
**/dist/*
9+
**/public/*
910
**/__testfixtures__/**
1011
**/__tests__/fixtures/**
1112
peril
@@ -24,3 +25,8 @@ packages/gatsby-image/withIEPolyfill/index.js
2425
packages/gatsby/cache-dir/commonjs/**/*
2526
packages/gatsby-admin/public
2627
packages/gatsby/gatsby-admin-public
28+
packages/gatsby-codemods/transforms
29+
30+
packages/gatsby-source-wordpress/test-site/**
31+
!packages/gatsby-source-wordpress/test-site/__tests__
32+
!packages/gatsby-source-wordpress/test-site/test-utils

.eslintrc.js

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ module.exports = {
2929
before: true,
3030
after: true,
3131
spyOn: true,
32+
// These should be in scope but for some reason eslint can't see them
33+
NodeJS: true,
34+
JSX: true,
35+
NodeRequire: true,
36+
TimerHandler: true,
3237
__PATH_PREFIX__: true,
3338
__BASE_PATH__: true,
3439
__ASSET_PREFIX__: true,
@@ -48,8 +53,10 @@ module.exports = {
4853
"no-unused-vars": [
4954
"warn",
5055
{
51-
varsIgnorePattern: "^_"
52-
}
56+
varsIgnorePattern: "^_",
57+
argsIgnorePattern: "^_",
58+
ignoreRestSiblings: true,
59+
},
5360
],
5461
"consistent-return": ["error"],
5562
"filenames/match-regex": ["error", "^[a-z-\\d\\.]+$", true],
@@ -93,7 +100,9 @@ module.exports = {
93100
...TSEslint.configs.recommended.rules,
94101
// We should absolutely avoid using ts-ignore, but it's not always possible.
95102
// particular when a dependencies types are incorrect.
96-
"@typescript-eslint/ban-ts-ignore": "warn",
103+
"@typescript-eslint/ban-ts-comment": {
104+
"ts-ignore": "allow-with-description",
105+
},
97106
// This rule is great. It helps us not throw on types for areas that are
98107
// easily inferrable. However we have a desire to have all function inputs
99108
// and outputs declaratively typed. So this let's us ignore the parameters
@@ -102,16 +111,40 @@ module.exports = {
102111
"error",
103112
{ ignoreParameters: true },
104113
],
105-
"@typescript-eslint/camelcase": [
114+
"@typescript-eslint/ban-types": [
106115
"error",
107116
{
108-
// This rule tries to ensure we use camelCase for all variables, properties
109-
// functions, etc. However, it is not always possible to ensure properties
110-
// are camelCase. Specifically we have `node.__gatsby_resolve` which breaks
111-
// this rule. This allows properties to be whatever they need to be.
112-
properties: "never",
113-
// Allow unstable api's to use `unstable_`, which is easier to grep
114-
allow: ["^unstable_"],
117+
extendDefaults: true,
118+
types: {
119+
"{}": {
120+
fixWith: "Record<string, unknown>",
121+
},
122+
object: {
123+
fixWith: "Record<string, unknown>",
124+
},
125+
},
126+
},
127+
],
128+
"@typescript-eslint/naming-convention": [
129+
{
130+
selector: "default",
131+
format: ["camelCase"],
132+
},
133+
{ selector: "variable", format: ["camelCase", "UPPER_CASE"] },
134+
{
135+
selector: "parameter",
136+
format: ["camelCase"],
137+
leadingUnderscore: "allow",
138+
prefix: ["unstable_", ""],
139+
},
140+
{
141+
selector: "typeLike",
142+
format: ["PascalCase"],
143+
},
144+
{
145+
selector: "interface",
146+
format: ["PascalCase"],
147+
prefix: ["I"],
115148
},
116149
],
117150
// This rule tries to prevent using `require()`. However in node code,
@@ -127,6 +160,7 @@ module.exports = {
127160
// - baz: string;
128161
// + baz: string
129162
// }
163+
"@typescript-eslint/no-extra-semi": false,
130164
"@typescript-eslint/member-delimiter-style": [
131165
"error",
132166
{
@@ -135,13 +169,6 @@ module.exports = {
135169
},
136170
},
137171
],
138-
// This ensures all interfaces are named with an I as a prefix
139-
// e.g.,
140-
// interface IFoo {}
141-
"@typescript-eslint/interface-name-prefix": [
142-
"error",
143-
{ prefixWithI: "always" },
144-
],
145172
"@typescript-eslint/no-empty-function": "off",
146173
// This ensures that we always type the return type of functions
147174
// a high level focus of our TS setup is typing fn inputs and outputs.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ packages/gatsby-plugin-mdx/node_modules/**/*.js
2323
packages/gatsby/cache-dir/commonjs/**/*.js
2424
packages/gatsby-admin/public/styles.*
2525
packages/gatsby/gatsby-admin-public/styles.*
26+
packages/gatsby-source-wordpress/test-site/**
2627

2728
# fixtures
2829
**/__testfixtures__/**

benchmarks/gabe-fs-markdown-images/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ When you run the benchmark, or generate the random content files, it will first
4040

4141
Once the pool contains enough images for a given type/dimension, the random `.md` files are generated and for each file an image is copied from the pool as well. The copying of images is a lot faster.
4242

43-
It's important to note that the pool will persist between benchamrk runs, while the randomly generated content does not.
43+
It's important to note that the pool will persist between benchmark runs, while the randomly generated content does not.
4444

4545
### Running the benchmark
4646

benchmarks/source-wordpress/gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
},
1919
},
2020
{
21-
resolve: `gatsby-source-wordpress-experimental`,
21+
resolve: `gatsby-source-wordpress`,
2222
options: {
2323
url: process.env.BENCHMARK_WPGRAPHQL_URL,
2424
type: {

benchmarks/source-wordpress/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"gatsby-plugin-benchmark-reporting": "*",
2424
"gatsby-plugin-sharp": "^2.6.2",
2525
"gatsby-source-filesystem": "^2.1.48",
26-
"gatsby-source-wordpress-experimental": "^5.0.0",
26+
"gatsby-source-wordpress": "^4.0.0",
2727
"gatsby-transformer-sharp": "^2.5.2",
2828
"react": "^16.12.0",
2929
"react-dom": "^16.12.0"

benchmarks/source-wordpress/scripts/updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fetchGraphql = require(`gatsby-source-wordpress-experimental/dist/utils/fetch-graphql`)
1+
const fetchGraphql = require(`gatsby-source-wordpress/dist/utils/fetch-graphql`)
22
.default
33

44
const faker = require(`faker`)

0 commit comments

Comments
 (0)