Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed May 5, 2020
2 parents 4e89725 + ba1f73f commit 2e74c8e
Show file tree
Hide file tree
Showing 620 changed files with 9,507 additions and 4,791 deletions.
146 changes: 107 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
orbs:
win: circleci/windows@1.0.0
win: circleci/windows@2.2.0
slack: circleci/[email protected]

executors:
node:
parameters:
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"
docker:
- image: circleci/node:<< parameters.image >>

aliases:
e2e-executor: &e2e-executor
Expand Down Expand Up @@ -53,12 +62,12 @@ aliases:

test_template: &test_template
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- <<: *attach_to_bootstrap
- <<: *install_node_modules
- run: yarn list react
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
- run: GATSBY_DB_NODES=loki node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
# - run: GATSBY_DB_NODES=loki node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci

e2e-test-workflow: &e2e-test-workflow
filters:
Expand All @@ -69,6 +78,7 @@ aliases:
- /blog.+/
requires:
- lint
- typecheck
- unit_tests_node10

e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
Expand Down Expand Up @@ -147,7 +157,7 @@ commands:
type: boolean
default: false
steps:
- <<: *attach_to_bootstrap
- checkout
# In case of failure, add these steps again. Cache probably got deleted
#- <<: *restore_cache
#- <<: *install_node_modules
Expand All @@ -156,6 +166,8 @@ commands:
condition: << parameters.skip_file_change_test >>
steps:
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"

- <<: *attach_to_bootstrap
- run:
name: Run tests (using defaults)
command: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"
Expand All @@ -175,16 +187,10 @@ jobs:
executor: node
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
# persist our git checkout and node_modules as the next step (assert-changed-files) might exit this step
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node10
- persist_to_workspace:
root: ./
paths:
- "*"
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*"
- run: yarn bootstrap -- concurrency=2
# Persist the workspace again with all packages already built
- persist_to_workspace:
Expand All @@ -194,12 +200,25 @@ jobs:

lint:
executor: node
parallelism: 2
steps:
- <<: *attach_to_bootstrap
- checkout
# installation of dependencies takes a while because of the 100 packages we have inside the monorepo
# Linting only needs the root packages, we remove the workspace and only install root packages
- run:
name: "remove workspaces from package.json"
command: |
sed -i ':a;N;$!ba;s/,\n\s*"workspaces":\s\[[^]]*]//g' package.json
- <<: *install_node_modules
- run: yarn lint:code
- run: yarn lint:docs
- run: yarn lint:other

typecheck:
executor: node
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- <<: *attach_to_bootstrap
- run: yarn typecheck
- run: yarn check-repo-fields

Expand Down Expand Up @@ -230,12 +249,12 @@ jobs:
- e2e-test:
test_path: integration-tests/long-term-caching

integration_tests_cache_resilience:
executor: node
steps:
- e2e-test:
test_path: integration-tests/cache-resilience
run_loki: true
# integration_tests_cache_resilience:
# executor: node
# steps:
# - e2e-test:
# test_path: integration-tests/cache-resilience
# run_loki: true

integration_tests_gatsby_pipeline:
executor: node
Expand All @@ -247,10 +266,11 @@ jobs:
<<: *e2e-executor
executor: node
steps:
- <<: *attach_to_bootstrap
- checkout
- run:
name: Assert Changed Files
command: ./scripts/assert-changed-files.sh "packages/gatsby-cli/*|packages/gatsby/*|integration-tests/gatsby-cli/*"
- <<: *attach_to_bootstrap
- run:
name: Run tests (using defaults)
command: cd integration-tests/gatsby-cli && yarn && yarn test
Expand All @@ -270,6 +290,40 @@ jobs:
- e2e-test:
test_path: e2e-tests/path-prefix

e2e_tests_pnp:
executor: node_10_19
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- <<: *attach_to_bootstrap
- run:
command: cp -r ./starters/default ./e2e-tests/gatsby-pnp
working_directory: ~/project
- run:
command: touch yarn.lock
working_directory: ~/project/e2e-tests/gatsby-pnp
- run: # Quick upgrade to the v2 (any version, we just need the real set version)
command: yarn policies set-version berry
working_directory: ~/project/e2e-tests/gatsby-pnp
- run: # Pins the Yarn version
command: yarn set version 2.0.0-rc.32
working_directory: ~/project/e2e-tests/gatsby-pnp
- run: # Forces to use the local packages
command: yarn link --all --private ../..
working_directory: ~/project/e2e-tests/gatsby-pnp
- run:
command: yarn install
working_directory: ~/project/e2e-tests/gatsby-pnp
- run:
command: yarn add start-server-and-test@^1.11.0
working_directory: ~/project/e2e-tests/gatsby-pnp
- run:
command: yarn build
working_directory: ~/project/e2e-tests/gatsby-pnp
- run:
command: 'DEBUG=start-server-and-test yarn start-server-and-test "yarn develop 2>&1 | tee log.txt" :8000 "! cat log.txt | grep ''ERROR #''"'
working_directory: ~/project/e2e-tests/gatsby-pnp

e2e_tests_gatsby-image:
<<: *e2e_tests_gatsby-image_alias

Expand Down Expand Up @@ -327,7 +381,9 @@ jobs:
starters_publish:
executor: node
steps:
- <<: *attach_to_bootstrap
- checkout
- <<: *restore_cache
- <<: *install_node_modules
- run: yarn markdown
- run: sudo apt-get update && sudo apt-get install jq # jq is helpful for parsing json
- run: git config --global user.name "GatsbyJS Bot"
Expand Down Expand Up @@ -362,21 +418,27 @@ jobs:

windows_unit_tests:
executor:
name: win/vs2019
name: win/default
shell: powershell.exe
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- yarn-packages-v2-
# 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 dependencies"
command: yarn bootstrap
- save_cache:
paths:
- C:\Users\circleci\AppData\Local\Yarn\Cache
key: yarn-packages-v2-{{ checksum "yarn.lock" }}
name: Install node modules
command: yarn --frozen-lockfile
# Caching is slow, so disabling
# - save_cache:
# 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"
command: yarn jest -w 1 --ci
Expand Down Expand Up @@ -464,36 +526,44 @@ workflows:
build-test:
jobs:
- bootstrap
- lint
- typecheck:
requires:
- bootstrap
- windows_unit_tests:
<<: *ignore_docs
- lint:
requires:
- bootstrap
- lint
- unit_tests_node10:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- typecheck
- bootstrap
- unit_tests_www:
requires:
- lint
- typecheck
- bootstrap
- integration_tests_long_term_caching:
<<: *e2e-test-workflow
- integration_tests_cache_resilience:
<<: *e2e-test-workflow
# - integration_tests_cache_resilience:
# <<: *e2e-test-workflow
- integration_tests_gatsby_pipeline:
<<: *e2e-test-workflow
- integration_tests_structured_logging:
<<: *e2e-test-workflow
- integration_tests_gatsby_cli:
requires:
- bootstrap
- e2e_tests_pnp:
<<: *e2e-test-workflow
- e2e_tests_path-prefix:
<<: *e2e-test-workflow
- e2e_tests_gatsby-image:
Expand All @@ -509,8 +579,6 @@ workflows:
- starters_validate:
<<: *ignore_master
- starters_publish:
requires:
- bootstrap
filters:
branches:
only:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/schedule-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
Thanks again for being part of the Gatsby community! 💪💜
EXEMPT_ISSUE_LABELS: |
not stale
status: triage needed
- name: Post slack report
uses: pullreminders/[email protected]
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test/**/public
.DS_Store
public/
node_modules/
e2e-tests/gatsby-pnp/
.cache/
.netlify

Expand Down
39 changes: 39 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
plugins: [
["remark-frontmatter", "yaml"],
"remark-preset-lint-recommended",
"remark-preset-lint-markdown-style-guide",

// additional remark-lint rules
["remark-lint-list-item-indent", "space"],
"remark-lint-no-duplicate-headings-in-section",
"remark-lint-no-reference-like-url",
["remark-lint-ordered-list-marker-value", "ordered"],

// We would like these rules to be enabled, but they require significant content changes
// and need additional PRs to be implemented
["remark-lint-emphasis-marker", false],
["remark-lint-heading-increment", false],
["remark-lint-no-heading-punctuation", false],
["remark-lint-list-item-spacing", false],

// The following rules are disabled because they are inconsistent to the
// Gatsby Style Guide.

// We use soft-wrapped paragraphs for ease of diffing/translation.
["remark-lint-maximum-line-length", false],
// We don't restrict the length of headings.
["remark-lint-maximum-heading-length", false],
// We use duplicate headings sometimes, e.g. multiple "Directions" in Recipes.
// Use no-duplicate-headings-in-section instead.
["remark-lint-no-duplicate-headings", false],
// We use emphasis as notes or warnings in a couple places, which triggers this rule.
["remark-lint-no-emphasis-as-heading", false],
// YouTube and Giphy embeds in the docs use literal URLs.
["remark-lint-no-literal-urls", false],
// We use `[shortcuts]` for convenience.
["remark-lint-no-shortcut-reference-link", false],
// We use brackets in a lot of places as argument lists and do not want to escape them.
["remark-lint-no-undefined-references", false],
],
}
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
/docs/ @gatsbyjs/learning
**/README.md @gatsbyjs/learning

# All blog posts must be reviewed by the content team.
/docs/blog/ @gatsbyjs/content

# The website auto-deploys, so we need an extra check to avoid shenanigans.
/www/ @gatsbyjs/website

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"serve": "gatsby serve"
},
"dependencies": {
"@mdx-js/mdx": "^1.5.7",
"@mdx-js/react": "^1.5.7",
"@mdx-js/mdx": "^1.6.1",
"@mdx-js/react": "^1.6.1",
"cross-env": "^7.0.0",
"del-cli": "^3.0.0",
"dotenv": "^8.2.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/100days/comments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ There are multiple ways to accept user-generated content on your site. So, inste

### Gatsby Comments Resources

#### Option 1. Embed comments using JavaScript.
#### Option 1. Embed comments using JavaScript

_Pros and cons_: This approach is the simplest option for adding comments to your site. You can choose many low cost or free comment services, like Disqus and Facebook Comments. However, this method will have a negative impact on your site performance, and has privacy implications for your users.

Expand Down
2 changes: 2 additions & 0 deletions docs/blog/100days/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ author: "Hashim Warren"
tags: ["learning-to-code", "contest", "100-Days-of-Gatsby"]
---

import EmailCaptureForm from "@components/email-capture-form"

### If you're looking for a fun way to explore how to build blazing fast websites with Gatsby, our #100DaysOfGatsby challenge is for you!

![alt text](./100daysofgatsby.png "100 Days of Gatsby")
Expand Down
Loading

0 comments on commit 2e74c8e

Please sign in to comment.