Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurie committed Feb 25, 2021
2 parents b67b6ec + ba7d505 commit 7711836
Show file tree
Hide file tree
Showing 983 changed files with 82,543 additions and 37,576 deletions.
75 changes: 31 additions & 44 deletions .circleci/config.yml
@@ -1,5 +1,5 @@
orbs:
win: circleci/windows@2.2.0
win: circleci/windows@2.4.0
slack: circleci/slack@3.4.1

executors:
Expand All @@ -8,15 +8,7 @@ executors:
image:
type: string
# First 10.x LTS release, but old Yarn
default: "10.13"
docker:
- image: circleci/node:<< parameters.image >>
node_10_19:
parameters:
image:
type: string
# More recent Yarn binary
default: "10.19"
default: "12.13"
docker:
- image: circleci/node:<< parameters.image >>

Expand All @@ -34,7 +26,12 @@ aliases:
install_node_modules: &install_node_modules
run:
name: Install node modules
command: yarn --frozen-lockfile
command: yarn

check_lockfile: &check_lockfile
run:
name: Check for dirty lockfile
command: ./scripts/check-lockfile.sh || exit 1

persist_cache: &persist_cache
save_cache:
Expand Down Expand Up @@ -85,7 +82,7 @@ aliases:
requires:
- lint
- typecheck
- unit_tests_node10
- unit_tests_node12

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

unit_tests_node10:
executor: node
<<: *test_template

unit_tests_node12:
executor:
name: node
image: "12"
<<: *test_template

unit_tests_node14:
Expand All @@ -234,6 +227,12 @@ jobs:
image: "14"
<<: *test_template

integration_tests_gatsby_source_wordpress:
executor: node
steps:
- e2e-test:
test_path: integration-tests/gatsby-source-wordpress

integration_tests_long_term_caching:
executor: node
steps:
Expand Down Expand Up @@ -296,7 +295,7 @@ jobs:
test_path: e2e-tests/path-prefix

e2e_tests_pnp:
executor: node_10_19
executor: node
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
Expand Down Expand Up @@ -338,14 +337,6 @@ jobs:
e2e_tests_development_runtime:
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_fast_refresh:
<<: *e2e_tests_development_runtime_alias
environment:
GATSBY_HOT_LOADER: fast-refresh
CYPRESS_HOT_LOADER: fast-refresh
CYPRESS_PROJECT_ID: 917bea
CYPRESS_RECORD_KEY: 4750fb36-4576-4638-a617-d243a381acef

e2e_tests_development_runtime_with_experimental_react:
<<: *e2e_tests_development_runtime_alias

Expand Down Expand Up @@ -466,11 +457,21 @@ jobs:
shell: powershell.exe
steps:
- checkout
- run:
command: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|yarn.lock"
shell: bash.exe
# Restoring cache takes as long as installing node modules, so skipping
# - restore_cache:
# keys:
# - yarn-packages-v2-{{ checksum "yarn.lock" }}
# - yarn-packages-v2-
- run:
name: Install node 12.13
command: |
nvm install 12.13.0
nvm alias default 12.13.0
nvm use 12.13.0
choco install yarn
- run:
name: Set yarn timeout
command: yarn config set network-timeout 300000
Expand All @@ -482,9 +483,6 @@ jobs:
# paths:
# - C:\Users\circleci\AppData\Local\Yarn\Cache
# key: yarn-packages-v2-{{ checksum "yarn.lock" }}
- run:
command: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
shell: bash.exe
- run: yarn npm-run-all -s check-versions "lerna-prepare --concurrency=4 --stream"
- run:
name: "Run Tests"
Expand Down Expand Up @@ -523,17 +521,6 @@ workflows:
jobs:
- sync_translation_repo

weekly-node-14:
triggers:
- schedule:
cron: "0 1 * * 6"
filters:
branches:
only:
- master
jobs:
- unit_tests_node14

nightly-react-next:
triggers:
- schedule:
Expand Down Expand Up @@ -592,18 +579,20 @@ workflows:
<<: *ignore_docs
requires:
- lint
- unit_tests_node10:
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- unit_tests_node12:
- unit_tests_node14:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- integration_tests_gatsby_source_wordpress:
<<: *e2e-test-workflow
- integration_tests_long_term_caching:
<<: *e2e-test-workflow
- integration_tests_cache_resilience:
Expand Down Expand Up @@ -633,8 +622,6 @@ workflows:
<<: *e2e-test-workflow
- e2e_tests_development_runtime:
<<: *e2e-test-workflow
- e2e_tests_development_runtime_fast_refresh:
<<: *e2e-test-workflow
- e2e_tests_production_runtime:
<<: *e2e-test-workflow
- themes_e2e_tests_production_runtime:
Expand Down
6 changes: 6 additions & 0 deletions .eslintignore
Expand Up @@ -6,6 +6,7 @@ packages/*/dist/**
packages/*/lib/**
packages/*/scripts/**
**/dist/*
**/public/*
**/__testfixtures__/**
**/__tests__/fixtures/**
peril
Expand All @@ -24,3 +25,8 @@ packages/gatsby-image/withIEPolyfill/index.js
packages/gatsby/cache-dir/commonjs/**/*
packages/gatsby-admin/public
packages/gatsby/gatsby-admin-public
packages/gatsby-codemods/transforms

packages/gatsby-source-wordpress/test-site/**
!packages/gatsby-source-wordpress/test-site/__tests__
!packages/gatsby-source-wordpress/test-site/test-utils
63 changes: 45 additions & 18 deletions .eslintrc.js
Expand Up @@ -29,6 +29,11 @@ module.exports = {
before: true,
after: true,
spyOn: true,
// These should be in scope but for some reason eslint can't see them
NodeJS: true,
JSX: true,
NodeRequire: true,
TimerHandler: true,
__PATH_PREFIX__: true,
__BASE_PATH__: true,
__ASSET_PREFIX__: true,
Expand All @@ -48,8 +53,10 @@ module.exports = {
"no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_"
}
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"consistent-return": ["error"],
"filenames/match-regex": ["error", "^[a-z-\\d\\.]+$", true],
Expand Down Expand Up @@ -93,7 +100,9 @@ module.exports = {
...TSEslint.configs.recommended.rules,
// We should absolutely avoid using ts-ignore, but it's not always possible.
// particular when a dependencies types are incorrect.
"@typescript-eslint/ban-ts-ignore": "warn",
"@typescript-eslint/ban-ts-comment": {
"ts-ignore": "allow-with-description",
},
// This rule is great. It helps us not throw on types for areas that are
// easily inferrable. However we have a desire to have all function inputs
// and outputs declaratively typed. So this let's us ignore the parameters
Expand All @@ -102,16 +111,40 @@ module.exports = {
"error",
{ ignoreParameters: true },
],
"@typescript-eslint/camelcase": [
"@typescript-eslint/ban-types": [
"error",
{
// This rule tries to ensure we use camelCase for all variables, properties
// functions, etc. However, it is not always possible to ensure properties
// are camelCase. Specifically we have `node.__gatsby_resolve` which breaks
// this rule. This allows properties to be whatever they need to be.
properties: "never",
// Allow unstable api's to use `unstable_`, which is easier to grep
allow: ["^unstable_"],
extendDefaults: true,
types: {
"{}": {
fixWith: "Record<string, unknown>",
},
object: {
fixWith: "Record<string, unknown>",
},
},
},
],
"@typescript-eslint/naming-convention": [
{
selector: "default",
format: ["camelCase"],
},
{ selector: "variable", format: ["camelCase", "UPPER_CASE"] },
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
prefix: ["unstable_", ""],
},
{
selector: "typeLike",
format: ["PascalCase"],
},
{
selector: "interface",
format: ["PascalCase"],
prefix: ["I"],
},
],
// This rule tries to prevent using `require()`. However in node code,
Expand All @@ -127,6 +160,7 @@ module.exports = {
// - baz: string;
// + baz: string
// }
"@typescript-eslint/no-extra-semi": false,
"@typescript-eslint/member-delimiter-style": [
"error",
{
Expand All @@ -135,13 +169,6 @@ module.exports = {
},
},
],
// This ensures all interfaces are named with an I as a prefix
// e.g.,
// interface IFoo {}
"@typescript-eslint/interface-name-prefix": [
"error",
{ prefixWithI: "always" },
],
"@typescript-eslint/no-empty-function": "off",
// This ensures that we always type the return type of functions
// a high level focus of our TS setup is typing fn inputs and outputs.
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -23,6 +23,7 @@ packages/gatsby-plugin-mdx/node_modules/**/*.js
packages/gatsby/cache-dir/commonjs/**/*.js
packages/gatsby-admin/public/styles.*
packages/gatsby/gatsby-admin-public/styles.*
packages/gatsby-source-wordpress/test-site/**

# fixtures
**/__testfixtures__/**
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/gabe-fs-markdown-images/README.md
Expand Up @@ -40,7 +40,7 @@ When you run the benchmark, or generate the random content files, it will first

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.

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

### Running the benchmark

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source-wordpress/gatsby-config.js
Expand Up @@ -18,7 +18,7 @@ module.exports = {
},
},
{
resolve: `gatsby-source-wordpress-experimental`,
resolve: `gatsby-source-wordpress`,
options: {
url: process.env.BENCHMARK_WPGRAPHQL_URL,
type: {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source-wordpress/package.json
Expand Up @@ -23,7 +23,7 @@
"gatsby-plugin-benchmark-reporting": "*",
"gatsby-plugin-sharp": "^2.6.2",
"gatsby-source-filesystem": "^2.1.48",
"gatsby-source-wordpress-experimental": "^5.0.0",
"gatsby-source-wordpress": "^4.0.0",
"gatsby-transformer-sharp": "^2.5.2",
"react": "^16.12.0",
"react-dom": "^16.12.0"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source-wordpress/scripts/updater.js
@@ -1,4 +1,4 @@
const fetchGraphql = require(`gatsby-source-wordpress-experimental/dist/utils/fetch-graphql`)
const fetchGraphql = require(`gatsby-source-wordpress/dist/utils/fetch-graphql`)
.default

const faker = require(`faker`)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions dictionary.txt
Expand Up @@ -407,7 +407,7 @@ gatsby-source-flotiq
gatsby-source-graphql
gatsby-source-sanity
gatsby-source-tmdb
gatsby-source-wordpress-experimental
gatsby-source-wordpress
gatsby-source-x-cms
gatsby-starter-blog
gatsby-starter-buttercms
Expand Down Expand Up @@ -548,7 +548,6 @@ JAMstack
JAMStack
jankiness
Javascript
Javscript
jbampton
joi
Joi
Expand Down Expand Up @@ -636,7 +635,6 @@ modelling
modularity
modularize
modularizing
modyfing
mongodb
monorepo
monorepos
Expand Down

0 comments on commit 7711836

Please sign in to comment.