From c1ae8f2a3b58146455f80877711b157bf193bc49 Mon Sep 17 00:00:00 2001
From: Madalyn <3230904+madalynrose@users.noreply.github.com>
Date: Thu, 21 May 2020 15:45:33 -0400
Subject: [PATCH 001/288] fix(gatsby): add control-has-associated-label rule
into eslint-config (#24311)
---
packages/gatsby/src/utils/eslint-config.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/gatsby/src/utils/eslint-config.ts b/packages/gatsby/src/utils/eslint-config.ts
index 3a10d7bd43340..434a3fa986732 100644
--- a/packages/gatsby/src/utils/eslint-config.ts
+++ b/packages/gatsby/src/utils/eslint-config.ts
@@ -41,6 +41,7 @@ export const eslintConfig = (schema: GraphQLSchema): CLIEngine.Options => {
// },
// ],
"jsx-a11y/click-events-have-key-events": `warn`,
+ "jsx-a11y/control-has-associated-label": `warn`,
"jsx-a11y/heading-has-content": `warn`,
"jsx-a11y/html-has-lang": `warn`,
"jsx-a11y/iframe-has-title": `warn`,
From c4c7563d8dc167561962c4ab7c6ef8f2e2d3eec9 Mon Sep 17 00:00:00 2001
From: Laurie Barth
Date: Thu, 21 May 2020 15:54:13 -0400
Subject: [PATCH 002/288] chore(release): Publish
- gatsby-admin@0.1.46
- gatsby-cli@2.12.30
- gatsby-theme-blog-core@1.5.21
- gatsby-theme-blog@1.6.21
- gatsby-theme-notes@1.3.47
- gatsby-theme-ui-preset@0.0.36
- gatsby@2.22.5
---
packages/gatsby-admin/CHANGELOG.md | 4 ++++
packages/gatsby-admin/package.json | 4 ++--
packages/gatsby-cli/CHANGELOG.md | 4 ++++
packages/gatsby-cli/package.json | 2 +-
packages/gatsby-theme-blog-core/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog-core/package.json | 4 ++--
packages/gatsby-theme-blog/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog/package.json | 6 +++---
packages/gatsby-theme-notes/CHANGELOG.md | 4 ++++
packages/gatsby-theme-notes/package.json | 4 ++--
packages/gatsby-theme-ui-preset/CHANGELOG.md | 4 ++++
packages/gatsby-theme-ui-preset/package.json | 4 ++--
packages/gatsby/CHANGELOG.md | 7 +++++++
packages/gatsby/package.json | 4 ++--
14 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/packages/gatsby-admin/CHANGELOG.md b/packages/gatsby-admin/CHANGELOG.md
index c8c9812bb0d35..1daf9e0b20070 100644
--- a/packages/gatsby-admin/CHANGELOG.md
+++ b/packages/gatsby-admin/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.46](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.45...gatsby-admin@0.1.46) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-admin
+
## [0.1.45](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.44...gatsby-admin@0.1.45) (2020-05-20)
**Note:** Version bump only for package gatsby-admin
diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json
index 160ce44a61ae7..67539943b8372 100644
--- a/packages/gatsby-admin/package.json
+++ b/packages/gatsby-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
- "version": "0.1.45",
+ "version": "0.1.46",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -8,7 +8,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
- "gatsby": "^2.22.4",
+ "gatsby": "^2.22.5",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-source-graphql": "^2.5.2",
"react": "^16.12.0",
diff --git a/packages/gatsby-cli/CHANGELOG.md b/packages/gatsby-cli/CHANGELOG.md
index d6bbe7dd792f1..8fd1944b652db 100644
--- a/packages/gatsby-cli/CHANGELOG.md
+++ b/packages/gatsby-cli/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.12.30](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.29...gatsby-cli@2.12.30) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-cli
+
## [2.12.29](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.28...gatsby-cli@2.12.29) (2020-05-20)
**Note:** Version bump only for package gatsby-cli
diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json
index 53495a1620078..569e76ef90946 100644
--- a/packages/gatsby-cli/package.json
+++ b/packages/gatsby-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
- "version": "2.12.29",
+ "version": "2.12.30",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "lib/index.js"
diff --git a/packages/gatsby-theme-blog-core/CHANGELOG.md b/packages/gatsby-theme-blog-core/CHANGELOG.md
index 8d7b0cb058b5f..3b7e87005883e 100644
--- a/packages/gatsby-theme-blog-core/CHANGELOG.md
+++ b/packages/gatsby-theme-blog-core/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.5.21](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.20...gatsby-theme-blog-core@1.5.21) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-blog-core
+
## [1.5.20](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.19...gatsby-theme-blog-core@1.5.20) (2020-05-20)
**Note:** Version bump only for package gatsby-theme-blog-core
diff --git a/packages/gatsby-theme-blog-core/package.json b/packages/gatsby-theme-blog-core/package.json
index 6e96fe96ffe8b..c08959056e14d 100644
--- a/packages/gatsby-theme-blog-core/package.json
+++ b/packages/gatsby-theme-blog-core/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog-core",
- "version": "1.5.20",
+ "version": "1.5.21",
"main": "index.js",
"author": "christopherbiscardi (@chrisbiscardi)",
"license": "MIT",
@@ -30,7 +30,7 @@
},
"devDependencies": {
"@mdx-js/react": "^1.6.1",
- "gatsby": "^2.22.4",
+ "gatsby": "^2.22.5",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-blog/CHANGELOG.md b/packages/gatsby-theme-blog/CHANGELOG.md
index f5fd09669f9d4..8490ab07b8754 100644
--- a/packages/gatsby-theme-blog/CHANGELOG.md
+++ b/packages/gatsby-theme-blog/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.6.21](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.20...gatsby-theme-blog@1.6.21) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-blog
+
## [1.6.20](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.19...gatsby-theme-blog@1.6.20) (2020-05-20)
**Note:** Version bump only for package gatsby-theme-blog
diff --git a/packages/gatsby-theme-blog/package.json b/packages/gatsby-theme-blog/package.json
index 5b148100fa4b7..2054ace3b6dbe 100644
--- a/packages/gatsby-theme-blog/package.json
+++ b/packages/gatsby-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog",
- "version": "1.6.20",
+ "version": "1.6.21",
"description": "A Gatsby theme for miscellaneous blogging with a dark/light mode",
"main": "index.js",
"keywords": [
@@ -29,7 +29,7 @@
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-theme-ui": "^0.2.53",
"gatsby-plugin-twitter": "^2.3.2",
- "gatsby-theme-blog-core": "^1.5.20",
+ "gatsby-theme-blog-core": "^1.5.21",
"mdx-utils": "0.2.0",
"react-helmet": "^5.2.1",
"react-switch": "^5.0.1",
@@ -39,7 +39,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.4",
+ "gatsby": "^2.22.5",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-notes/CHANGELOG.md b/packages/gatsby-theme-notes/CHANGELOG.md
index bd47c1bae4598..766c7040c5b3d 100644
--- a/packages/gatsby-theme-notes/CHANGELOG.md
+++ b/packages/gatsby-theme-notes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.47](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.46...gatsby-theme-notes@1.3.47) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-notes
+
## [1.3.46](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.45...gatsby-theme-notes@1.3.46) (2020-05-20)
**Note:** Version bump only for package gatsby-theme-notes
diff --git a/packages/gatsby-theme-notes/package.json b/packages/gatsby-theme-notes/package.json
index 46889d39d9050..019665c3bc586 100644
--- a/packages/gatsby-theme-notes/package.json
+++ b/packages/gatsby-theme-notes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-theme-notes",
"description": "Gatsby Theme for adding a notes section to your website",
- "version": "1.3.46",
+ "version": "1.3.47",
"author": "John Otander",
"license": "MIT",
"main": "index.js",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-notes#readme",
"devDependencies": {
- "gatsby": "^2.22.4",
+ "gatsby": "^2.22.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
diff --git a/packages/gatsby-theme-ui-preset/CHANGELOG.md b/packages/gatsby-theme-ui-preset/CHANGELOG.md
index 19c5878be9f3c..3db522b958cc6 100644
--- a/packages/gatsby-theme-ui-preset/CHANGELOG.md
+++ b/packages/gatsby-theme-ui-preset/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.0.36](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.35...gatsby-theme-ui-preset@0.0.36) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-ui-preset
+
## [0.0.35](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.34...gatsby-theme-ui-preset@0.0.35) (2020-05-20)
**Note:** Version bump only for package gatsby-theme-ui-preset
diff --git a/packages/gatsby-theme-ui-preset/package.json b/packages/gatsby-theme-ui-preset/package.json
index c89124f33a761..997ab2ddf8d84 100644
--- a/packages/gatsby-theme-ui-preset/package.json
+++ b/packages/gatsby-theme-ui-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-ui-preset",
- "version": "0.0.35",
+ "version": "0.0.36",
"description": "A Gatsby theme for theme-ui styles",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.4",
+ "gatsby": "^2.22.5",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index 9e94a8ae9442b..095777e743edf 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.22.5](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.4...gatsby@2.22.5) (2020-05-21)
+
+### Bug Fixes
+
+- **gatsby:** add control-has-associated-label rule into eslint-config ([#24311](https://github.com/gatsbyjs/gatsby/issues/24311)) ([c1ae8f2](https://github.com/gatsbyjs/gatsby/commit/c1ae8f2))
+- **gatsby:** adjust `create-react-context` alias to match actual package exports ([#24305](https://github.com/gatsbyjs/gatsby/issues/24305)) ([cb5d055](https://github.com/gatsbyjs/gatsby/commit/cb5d055))
+
## [2.22.4](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.3...gatsby@2.22.4) (2020-05-20)
**Note:** Version bump only for package gatsby
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index 83d8e315df238..fa72d44dbfd7b 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.22.4",
+ "version": "2.22.5",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
@@ -72,7 +72,7 @@
"flat": "^4.1.0",
"fs-exists-cached": "1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-cli": "^2.12.29",
+ "gatsby-cli": "^2.12.30",
"gatsby-core-utils": "^1.3.2",
"gatsby-graphiql-explorer": "^0.4.2",
"gatsby-link": "^2.4.3",
From 5c8dec1f71b38987ea637d42c077c06fdd4bc163 Mon Sep 17 00:00:00 2001
From: rugggger
Date: Thu, 21 May 2020 23:23:39 +0300
Subject: [PATCH 003/288] fix(gatsby-source-drupal): added check for
node.uri.value prefix (#23672)
* * added check for node.uri.value prefix
* if prefix found - allow basicAuth object to include credentials only for files whose prefix is 'public:'
* for other prefixes ('S3:' for example) use an empty auth object
( for use with Drupal's s3fs module, to store images on S3 - without the prefix check sending credentials on the file download request will fail)
* lint errors
* fixed file.json fixture (added uri.value)
* set 3 file systems for basic auth (public:, private:, temporary:)
updated unit tests to ran sourceNodes with basicAuth and without
Co-authored-by: Yaron Bar
---
.../src/__tests__/fixtures/file.json | 29 +++++++++-
.../src/__tests__/index.js | 58 ++++++++++++++++++-
.../gatsby-source-drupal/src/normalize.js | 8 ++-
3 files changed, 92 insertions(+), 3 deletions(-)
diff --git a/packages/gatsby-source-drupal/src/__tests__/fixtures/file.json b/packages/gatsby-source-drupal/src/__tests__/fixtures/file.json
index 007fa233cba06..2afb55971df57 100644
--- a/packages/gatsby-source-drupal/src/__tests__/fixtures/file.json
+++ b/packages/gatsby-source-drupal/src/__tests__/fixtures/file.json
@@ -18,7 +18,34 @@
"uuid": "file-2",
"filename": "secondary-image.png",
"uri": {
- "url" : "/sites/default/files/secondary-image.png"
+ "url" : "/sites/default/files/secondary-image.png",
+ "value" : "public://secondary-image.png"
+ }
+ }
+ },
+ {
+ "type": "file--file",
+ "id": "file-3",
+ "attributes": {
+ "id": 3,
+ "uuid": "file-3",
+ "filename": "third-image.png",
+ "uri": {
+ "url": "https://files.s3.eu-central-1.amazonaws.com/2020-05/third-image.png",
+ "value" : "s3://third-image.png"
+ }
+ }
+ },
+ {
+ "type": "file--file",
+ "id": "file-4",
+ "attributes": {
+ "id": 2,
+ "uuid": "file-4",
+ "filename": "forth-image.png",
+ "uri": {
+ "url" : "/sites/default/files/forth-image.png",
+ "value" : "private://forth-image.png"
}
}
}
diff --git a/packages/gatsby-source-drupal/src/__tests__/index.js b/packages/gatsby-source-drupal/src/__tests__/index.js
index da6d4664dc6a0..8b5546e457dd9 100644
--- a/packages/gatsby-source-drupal/src/__tests__/index.js
+++ b/packages/gatsby-source-drupal/src/__tests__/index.js
@@ -142,21 +142,77 @@ describe(`gatsby-source-drupal`, () => {
).toEqual(expect.arrayContaining([createNodeId(`article-1`)]))
})
- it(`Download files`, () => {
+ it(`Download files without Basic Auth`, () => {
const urls = [
`/sites/default/files/main-image.png`,
`/sites/default/files/secondary-image.png`,
+ `https://files.s3.eu-central-1.amazonaws.com/2020-05/third-image.png`,
+ `/sites/default/files/forth-image.png`,
].map(fileUrl => new URL(fileUrl, baseUrl).href)
urls.forEach(url => {
expect(createRemoteFileNode).toBeCalledWith(
expect.objectContaining({
url,
+ auth: {},
})
)
})
})
+ it(`Download files with Basic Auth`, async () => {
+ const basicAuth = {
+ username: `user`,
+ password: `password`,
+ }
+ await sourceNodes(args, { baseUrl, basicAuth })
+ const urls = [
+ `http://fixture/sites/default/files/main-image.png`,
+ `http://fixture/sites/default/files/secondary-image.png`,
+ `https://files.s3.eu-central-1.amazonaws.com/2020-05/third-image.png`,
+ `/sites/default/files/forth-image.png`,
+ ].map(fileUrl => new URL(fileUrl, baseUrl).href)
+ //first call without basicAuth (no fileSystem defined)
+ //(the first call is actually the 5th because sourceNodes was ran at first with no basicAuth)
+ expect(createRemoteFileNode).toHaveBeenNthCalledWith(
+ 5,
+ expect.objectContaining({
+ url: urls[0],
+ auth: {},
+ })
+ )
+ //2nd call with basicAuth (public: fileSystem defined)
+ expect(createRemoteFileNode).toHaveBeenNthCalledWith(
+ 6,
+ expect.objectContaining({
+ url: urls[1],
+ auth: {
+ htaccess_pass: `password`,
+ htaccess_user: `user`,
+ },
+ })
+ )
+ //3rd call without basicAuth (s3: fileSystem defined)
+ expect(createRemoteFileNode).toHaveBeenNthCalledWith(
+ 7,
+ expect.objectContaining({
+ url: urls[2],
+ auth: {},
+ })
+ )
+ //4th call with basicAuth (private: fileSystem defined)
+ expect(createRemoteFileNode).toHaveBeenNthCalledWith(
+ 8,
+ expect.objectContaining({
+ url: urls[3],
+ auth: {
+ htaccess_pass: `password`,
+ htaccess_user: `user`,
+ },
+ })
+ )
+ })
+
describe(`Update webhook`, () => {
describe(`Update content`, () => {
describe(`Before update`, () => {
diff --git a/packages/gatsby-source-drupal/src/normalize.js b/packages/gatsby-source-drupal/src/normalize.js
index 1a6b3258e860b..d61ca014d548e 100644
--- a/packages/gatsby-source-drupal/src/normalize.js
+++ b/packages/gatsby-source-drupal/src/normalize.js
@@ -35,17 +35,23 @@ exports.downloadFile = async (
// handle file downloads
if (isFileNode(node)) {
let fileNode
+ let fileType
+
try {
let fileUrl = node.url
if (typeof node.uri === `object`) {
// Support JSON API 2.x file URI format https://www.drupal.org/node/2982209
fileUrl = node.uri.url
+ // get file type from uri prefix ("S3:", "public:", etc.)
+ const uri_prefix = node.uri.value.match(/^\w*:/)
+ fileType = uri_prefix ? uri_prefix[0] : null
}
// Resolve w/ baseUrl if node.uri isn't absolute.
const url = new URL(fileUrl, baseUrl)
// If we have basicAuth credentials, add them to the request.
+ const basicAuthFileSystems = [`public:`, `private:`, `temporary:`]
const auth =
- typeof basicAuth === `object`
+ typeof basicAuth === `object` && basicAuthFileSystems.includes(fileType)
? {
htaccess_user: basicAuth.username,
htaccess_pass: basicAuth.password,
From f2227fc1d4df31f395fbb6f6cd55f7142ec37534 Mon Sep 17 00:00:00 2001
From: John Otander
Date: Thu, 21 May 2020 14:40:36 -0600
Subject: [PATCH 004/288] feat(gatsby-recipes): Implement initial custom react
renderer for recipes (#24065)
* feat(gatsby-recipes): Implement initial custom react renderer for recipes
This implements the first pass of a custom React reconciler and renderer for
Recipes. The idea is that we render a recipe directly and construct a plan.
The rendered components related to the resource suspend and asynchronously
call the resource plan which is then cached. When rendering, all resource
calls are added to an array and we `await` their completion before calling
render again which returns the desired data.
We also tested it with a conditional component and it worked!
function ConditionalFile(props) {
if (props.path === 'old') {
return
}
Related: https://github.com/gatsbyjs/gatsby/issues/22991#issuecomment-625985760
---
Co-authored-by: Kyle Mathews
* feat(gatsby-recipes): Implement a basic jsx renderer
A recipes comes in as MDX which we then transpile to JSX, however
we need an actual React element which we can pass to the renderer.
We achieve this be using the function constructor after a babel
transform for React.createElement.
Additionally, we now transform MDX JSX into the raw JSX string
that the renderer expects.
* feat(gatsby-recipes): Wire up renderer to recipes core
Updates the recipes state machine and client to use a simplified
data structure. Also uses the new custom react renderer to create
the data.
Co-authored-by: Kyle Mathews
* fix(gatsby-recipes): Update transformer test for new data shape
* fix(gatsby-recipes): Update tests, handle nested JSX
Co-authored-by: Kyle Mathews
* fix(gatsby-recipes): Add parse validation for JSX blocks
* fix(gatsby-recipes): Ensure babel uses built ins, make Config a noop
* fix(gatsby-recipes): Add back validation for no resource in first step
* fix(gatsby-recipes): Handle schema validation errors at render time
* chore(gatsby-recipes): Remove unused deps
* fix(gatsby-recipes): Update snapshots
Co-authored-by: Kyle Mathews
---
packages/gatsby-recipes/README.md | 9 +
packages/gatsby-recipes/package.json | 19 +-
.../validate-recipe.test.js.snap | 30 --
packages/gatsby-recipes/src/apply-plan.js | 18 +-
packages/gatsby-recipes/src/cli.js | 40 +-
packages/gatsby-recipes/src/create-plan.js | 52 +-
.../parser/__snapshots__/index.test.js.snap | 102 ++++
packages/gatsby-recipes/src/parser/index.js | 113 +---
.../gatsby-recipes/src/parser/index.test.js | 44 ++
.../gatsby-recipes/src/parser/jsx-to-json.js | 145 ------
.../src/parser/react-standard-props.js | 489 ------------------
.../src/parser/remove-element-by-name.js | 31 --
.../gatsby-recipes/src/parser/validate.js | 36 ++
.../src/parser/validate.test.js | 17 +
.../gatsby-recipes/src/recipe-machine.test.js | 243 ---------
.../__snapshots__/index.test.js.snap} | 2 +-
.../src/recipe-machine/errors.test.js | 96 ++++
.../index.js} | 55 +-
.../src/recipe-machine/index.test.js | 130 +++++
.../src/renderer/error-boundary.js | 26 +
packages/gatsby-recipes/src/renderer/index.js | 57 ++
.../gatsby-recipes/src/renderer/index.test.js | 116 +++++
.../gatsby-recipes/src/renderer/reconciler.js | 103 ++++
.../gatsby-recipes/src/renderer/render.js | 102 ++++
.../src/renderer/render.test.js | 43 ++
.../src/renderer/resource-components.js | 21 +
.../renderer/transform-to-plan-structure.js | 33 ++
.../transform-to-plan-structure.test.js | 42 ++
packages/gatsby-recipes/src/resources.js | 9 -
packages/gatsby-recipes/src/todo.md | 89 ----
.../gatsby-recipes/src/validate-recipe.js | 4 +-
.../src/validate-recipe.test.js | 18 -
packages/gatsby-recipes/src/validate-steps.js | 37 +-
.../gatsby-recipes/src/validate-steps.test.js | 19 -
yarn.lock | 27 +-
35 files changed, 1064 insertions(+), 1353 deletions(-)
delete mode 100644 packages/gatsby-recipes/src/__snapshots__/validate-recipe.test.js.snap
create mode 100644 packages/gatsby-recipes/src/parser/__snapshots__/index.test.js.snap
create mode 100644 packages/gatsby-recipes/src/parser/index.test.js
delete mode 100644 packages/gatsby-recipes/src/parser/jsx-to-json.js
delete mode 100644 packages/gatsby-recipes/src/parser/react-standard-props.js
delete mode 100644 packages/gatsby-recipes/src/parser/remove-element-by-name.js
create mode 100644 packages/gatsby-recipes/src/parser/validate.js
create mode 100644 packages/gatsby-recipes/src/parser/validate.test.js
delete mode 100644 packages/gatsby-recipes/src/recipe-machine.test.js
rename packages/gatsby-recipes/src/{__snapshots__/recipe-machine.test.js.snap => recipe-machine/__snapshots__/index.test.js.snap} (72%)
create mode 100644 packages/gatsby-recipes/src/recipe-machine/errors.test.js
rename packages/gatsby-recipes/src/{recipe-machine.js => recipe-machine/index.js} (81%)
create mode 100644 packages/gatsby-recipes/src/recipe-machine/index.test.js
create mode 100644 packages/gatsby-recipes/src/renderer/error-boundary.js
create mode 100644 packages/gatsby-recipes/src/renderer/index.js
create mode 100644 packages/gatsby-recipes/src/renderer/index.test.js
create mode 100644 packages/gatsby-recipes/src/renderer/reconciler.js
create mode 100644 packages/gatsby-recipes/src/renderer/render.js
create mode 100644 packages/gatsby-recipes/src/renderer/render.test.js
create mode 100644 packages/gatsby-recipes/src/renderer/resource-components.js
create mode 100644 packages/gatsby-recipes/src/renderer/transform-to-plan-structure.js
create mode 100644 packages/gatsby-recipes/src/renderer/transform-to-plan-structure.test.js
delete mode 100644 packages/gatsby-recipes/src/todo.md
delete mode 100644 packages/gatsby-recipes/src/validate-steps.test.js
diff --git a/packages/gatsby-recipes/README.md b/packages/gatsby-recipes/README.md
index def0fc6943be6..6ab45ec0a6e79 100644
--- a/packages/gatsby-recipes/README.md
+++ b/packages/gatsby-recipes/README.md
@@ -222,6 +222,15 @@ You can create test recipes that you run in a test site. You'll need to [use `ga
One note, as you'll be testing changes to the Gatsby CLI — instead of running the global gatsby-cli package (i.e. what you'd
run by typing `gatsby`, you'll want to run the version copied over by `gatsby-dev-cli` by running `./node_modules/.bin/gatsby`.
+When debugging the CLI, you may run into errors without stacktraces. In order
+to work around that, you can use the node inspector:
+
+```sh
+DEBUG=true node --inspect-brk ./node_modules/.bin/gatsby recipes ./test.mdx
+```
+
+Then, open up Chrome and click the node icon in dev tools.
+
### Official recipes
MDX source for the official recipes lives at [https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-recipes/recipes](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-recipes/recipes).
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 3c327959b9e85..25a2bf01aa5b9 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -9,6 +9,7 @@
"dependencies": {
"@babel/core": "^7.9.6",
"@babel/generator": "^7.9.6",
+ "@babel/plugin-transform-react-jsx": "^7.9.4",
"@babel/standalone": "^7.9.6",
"@babel/template": "^7.8.6",
"@babel/types": "^7.9.6",
@@ -18,16 +19,8 @@
"@mdx-js/runtime": "^1.6.1",
"acorn": "^7.2.0",
"acorn-jsx": "^5.2.0",
- "babel-core": "7.0.0-bridge.0",
- "babel-eslint": "^10.1.0",
- "babel-loader": "^8.1.0",
- "babel-plugin-add-module-exports": "^0.3.3",
- "babel-plugin-dynamic-import-node": "^2.3.3",
- "babel-plugin-remove-graphql-queries": "^2.9.2",
- "babel-preset-gatsby": "^0.4.6",
"cors": "^2.8.5",
- "detect-port": "^1.3.0",
- "event-source-polyfill": "^1.0.14",
+ "debug": "^4.1.1",
"execa": "^4.0.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
@@ -41,7 +34,6 @@
"graphql-type-json": "^0.3.1",
"hicat": "^0.7.0",
"html-tag-names": "^1.1.5",
- "humanize-list": "^1.0.1",
"import-jsx": "^4.0.0",
"ink-box": "^1.0.0",
"ink-link": "^1.1.0",
@@ -49,8 +41,6 @@
"ink-spinner": "^3.0.1",
"is-binary-path": "^2.1.0",
"is-blank": "^2.1.0",
- "is-newline": "^1.0.0",
- "is-relative": "^1.0.0",
"is-string": "^1.0.5",
"is-url": "^1.2.4",
"jest-diff": "^25.5.0",
@@ -58,24 +48,21 @@
"mkdirp": "^0.5.1",
"pkg-dir": "^4.2.0",
"prettier": "^2.0.5",
+ "react-reconciler": "^0.25.1",
"remark-stringify": "^8.0.0",
"semver": "^7.3.2",
"single-trailing-newline": "^1.0.0",
"style-to-object": "^0.3.0",
"subscriptions-transport-ws": "^0.9.16",
"svg-tag-names": "^2.0.1",
- "unist-util-remove": "^2.0.0",
"unist-util-visit": "^2.0.2",
- "url-loader": "^1.1.2",
"urql": "^1.9.7",
"ws": "^7.3.0",
"xstate": "^4.9.1"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
- "babel-preset-gatsby-package": "^0.4.2",
"react": "^16.12.0",
- "react-dom": "^16.12.0",
"rimraf": "^3.0.2",
"strip-ansi": "^6.0.0",
"tmp-promise": "^2.1.0"
diff --git a/packages/gatsby-recipes/src/__snapshots__/validate-recipe.test.js.snap b/packages/gatsby-recipes/src/__snapshots__/validate-recipe.test.js.snap
deleted file mode 100644
index 81c21ece9be11..0000000000000
--- a/packages/gatsby-recipes/src/__snapshots__/validate-recipe.test.js.snap
+++ /dev/null
@@ -1,30 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`validate module validates recipes with resource declarations validates File declarations 1`] = `
-Array [
- Object {
- "resource": "File",
- "resourceDeclaration": Object {
- "contentz": "yo",
- "path": "super-duper.md",
- },
- "step": 2,
- "validationError": [ValidationError: "contentz" is not allowed],
- },
-]
-`;
-
-exports[`validate module validates recipes with resource declarations validates File declarations 2`] = `[ValidationError: "contentz" is not allowed]`;
-
-exports[`validate module validates recipes with resource declarations validates NPMPackage declarations 1`] = `
-Array [
- Object {
- "resource": "NPMPackage",
- "resourceDeclaration": Object {
- "namez": "wee-package",
- },
- "step": 1,
- "validationError": [ValidationError: child "name" fails because ["name" is required]. "namez" is not allowed],
- },
-]
-`;
diff --git a/packages/gatsby-recipes/src/apply-plan.js b/packages/gatsby-recipes/src/apply-plan.js
index 08f4bf3d7442b..c1db3aa5f5700 100644
--- a/packages/gatsby-recipes/src/apply-plan.js
+++ b/packages/gatsby-recipes/src/apply-plan.js
@@ -10,19 +10,23 @@ const asyncForEach = async (array, callback) => {
const applyPlan = async stepPlan => {
let appliedResources = []
- // We apply each resource serially for now — we can parallalize in the
+ // We apply each resource serially for now — we can parallelize in the
// future for SPEED
await asyncForEach(stepPlan, async resourcePlan => {
const resource = resources[resourcePlan.resourceName]
- const changedResources = await resource.create(
- ctx,
- resourcePlan.resourceDefinitions
- )
+ try {
+ const changedResources = await resource.create(
+ ctx,
+ resourcePlan.resourceDefinitions
+ )
- appliedResources = appliedResources.concat(changedResources)
+ appliedResources = appliedResources.concat(changedResources)
- return
+ return
+ } catch (e) {
+ throw e
+ }
})
return appliedResources
diff --git a/packages/gatsby-recipes/src/cli.js b/packages/gatsby-recipes/src/cli.js
index 30d4a4e18270a..985bb2af38b23 100644
--- a/packages/gatsby-recipes/src/cli.js
+++ b/packages/gatsby-recipes/src/cli.js
@@ -362,7 +362,7 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
}
}
- log(`state`, subscriptionResponse)
+ log(`subscriptionResponse`, subscriptionResponse)
const state =
subscriptionResponse.data &&
JSON.parse(subscriptionResponse.data.operation.state)
@@ -434,8 +434,9 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
const PresentStep = ({ state }) => {
const isPlan = state.context.plan && state.context.plan.length > 0
- const isPresetPlanState = state.value === `present plan`
+ const isPresetPlanState = state.value === `presentPlan`
const isRunningStep = state.value === `applyingPlan`
+
if (isRunningStep) {
return null
}
@@ -505,40 +506,9 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
const Error = ({ state }) => {
log(`errors`, state)
if (state && state.context && state.context.error) {
- // if (false) {
- // return (
- //
- //
- // The following resources failed validation
- //
- // {state.context.error.map((err, i) => {
- // log(`recipe er`, { err })
- // return (
- //
- // Type: {err.resource}
- //
- // Resource:{` `}
- // {JSON.stringify(err.resourceDeclaration, null, 4)}
- //
- // Recipe step: {err.step}
- //
- // Error{err.validationError.details.length > 1 && `s`}:
- //
- // {err.validationError.details.map((d, v) => (
- //
- // {` `}‣ {d.message}
- //
- // ))}
- //
- // )
- // })}
- //
- // )
- // } else {
return (
{JSON.stringify(state.context.error, null, 2)}
)
- // }
}
return null
@@ -554,7 +524,7 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
{
type: `mdx`,
key: `mdx-${step}`,
- value: state.context.stepsAsMdx[step],
+ value: state.context.steps[step],
},
]
}
@@ -616,7 +586,7 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
)}
- {state.context.stepsAsMdx[state.context.currentStep]}
+ {state.context.steps[state.context.currentStep]}
{!isDone && }
{!isDone && }
diff --git a/packages/gatsby-recipes/src/create-plan.js b/packages/gatsby-recipes/src/create-plan.js
index f30997a2a5457..39d7815197fe5 100644
--- a/packages/gatsby-recipes/src/create-plan.js
+++ b/packages/gatsby-recipes/src/create-plan.js
@@ -1,48 +1,16 @@
-const resources = require(`./resources`)
-const SITE_ROOT = process.cwd()
-const ctx = { root: SITE_ROOT }
+const render = require(`./renderer`)
-const asyncForEach = async (array, callback) => {
- for (let index = 0; index < array.length; index++) {
- await callback(array[index], index, array)
- }
-}
+// TODO: Properly handle context in the renderer
+// const SITE_ROOT = process.cwd()
+// const ctx = { root: SITE_ROOT }
module.exports = async context => {
- const planForNextStep = []
+ const stepAsMdx = context.steps[context.currentStep]
- if (context.currentStep >= context.steps.length) {
- return planForNextStep
+ try {
+ const result = await render(stepAsMdx)
+ return result
+ } catch (e) {
+ throw e
}
-
- const cmds = context.steps[context.currentStep]
- const commandPlans = Object.entries(cmds).map(async ([key, val]) => {
- const resource = resources[key]
- // Filter out the Config resource
- if (key === `Config`) {
- return
- }
-
- // Does this resource support creating a plan?
- if (!resource || !resource.plan) {
- return
- }
-
- await asyncForEach(cmds[key], async cmd => {
- try {
- const commandPlan = await resource.plan(ctx, cmd)
- planForNextStep.push({
- resourceName: key,
- resourceDefinitions: cmd,
- ...commandPlan,
- })
- } catch (e) {
- console.log(e)
- }
- })
- })
-
- await Promise.all(commandPlans)
-
- return planForNextStep
}
diff --git a/packages/gatsby-recipes/src/parser/__snapshots__/index.test.js.snap b/packages/gatsby-recipes/src/parser/__snapshots__/index.test.js.snap
new file mode 100644
index 0000000000000..912293949143d
--- /dev/null
+++ b/packages/gatsby-recipes/src/parser/__snapshots__/index.test.js.snap
@@ -0,0 +1,102 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`fetches a recipe from unpkg when official short form 1`] = `
+Array [
+ "# Setup Theme UI
+
+This recipe helps you start developing with the [Theme UI](https://theme-ui.com) styling library.
+
+
+",
+ "Install packages.
+
+
+
+
+",
+ "Add the plugin \`gatsby-plugin-theme-ui\` to your \`gatsby-config.js\`.
+
+
+",
+ "Write out Theme UI configuration files.
+
+
+
+
+",
+ "**Success**!
+
+You're ready to get started!
+
+- Read the docs:
+- Learn about the theme specification:
+
+_note:_ if you're running this recipe on the default starter (or any other starter with
+base css), you'll need to remove the require to \`layout.css\` in the \`components/layout.js\` file
+as otherwise they'll override some theme-ui styles.
+",
+]
+`;
+
+exports[`partitions the MDX into steps 1`] = `
+Array [
+ "# Automatically run Prettier on Git commits
+
+Make sure all of your code is run through Prettier when you commit it to git.
+We achieve this by configuring prettier to run on git hooks using husky and
+lint-staged.
+",
+ "Install packages.
+
+
+
+
+",
+ "Implement git hooks for prettier.
+
+
+
+",
+ "Write prettier config files.
+
+
+
+",
+ "Prettier, husky, and lint-staged are now installed! You can edit your \`.prettierrc\`
+if you'd like to change your prettier configuration.
+",
+]
+`;
diff --git a/packages/gatsby-recipes/src/parser/index.js b/packages/gatsby-recipes/src/parser/index.js
index 64542185f5328..921465aa81255 100644
--- a/packages/gatsby-recipes/src/parser/index.js
+++ b/packages/gatsby-recipes/src/parser/index.js
@@ -2,16 +2,10 @@ const unified = require(`unified`)
const remarkMdx = require(`remark-mdx`)
const remarkParse = require(`remark-parse`)
const remarkStringify = require(`remark-stringify`)
-const visit = require(`unist-util-visit`)
const fetch = require(`node-fetch`)
const fs = require(`fs-extra`)
const isUrl = require(`is-url`)
const path = require(`path`)
-const _ = require(`lodash`)
-
-const extractImports = require(`./extract-imports`)
-const removeElementByName = require(`./remove-element-by-name`)
-const jsxToJson = require(`./jsx-to-json`)
const asRoot = nodes => {
return {
@@ -20,101 +14,8 @@ const asRoot = nodes => {
}
}
-const toJson = value => {
- const obj = {}
- const values = jsxToJson(value)
- values.forEach(([type, props = {}]) => {
- if (type === `\n`) {
- return undefined
- }
- obj[type] = obj[type] || []
- obj[type].push(props)
- return undefined
- })
- return obj
-}
-
-const extractCommands = steps => {
- const commands = steps
- .map(nodes => {
- const stepAst = asRoot(nodes)
- let cmds = []
- visit(stepAst, `jsx`, node => {
- const jsx = node.value
- cmds = cmds.concat(toJson(jsx))
- })
- return cmds
- })
- .reduce((acc, curr) => {
- const cmdByName = {}
- curr.map(v => {
- Object.entries(v).forEach(([key, value]) => {
- cmdByName[key] = cmdByName[key] || []
- cmdByName[key] = cmdByName[key].concat(value)
- })
- })
- return [...acc, cmdByName]
- }, [])
-
- return commands
-}
-
const u = unified().use(remarkParse).use(remarkStringify).use(remarkMdx)
-const handleImports = tree => {
- let imports = {}
- visit(tree, `import`, async (node, index, parent) => {
- imports = { ...imports, ...extractImports(node.value) }
- parent.children.splice(index, 1)
- })
- return imports
-}
-
-const unwrapImports = async (tree, imports) =>
- new Promise((resolve, reject) => {
- if (!Object.keys(imports).length) {
- return resolve()
- }
-
- let count = 0
-
- visit(tree, `jsx`, () => {
- count++
- })
-
- if (count === 0) {
- return resolve()
- }
-
- return visit(tree, `jsx`, async (node, index, parent) => {
- let names
- try {
- names = toJson(node.value)
- removeElementByName(node.value, {
- names: Object.keys(imports),
- })
- } catch (e) {
- throw e
- }
-
- if (names) {
- Object.keys(names).map(async name => {
- const url = imports[name]
- if (!url) {
- return resolve()
- }
-
- const result = await fetch(url)
- const mdx = await result.text()
- const nodes = u.parse(mdx).children
- parent.children.splice(index, 1, nodes)
- parent.children = _.flatten(parent.children)
- return resolve()
- })
- }
- })
- })
-
const partitionSteps = ast => {
const steps = []
let index = 0
@@ -137,28 +38,15 @@ const toMdx = nodes => {
return u.stringify(stepAst)
}
-const toMdxWithoutJsx = nodes => {
- const stepAst = asRoot(nodes)
- visit(stepAst, `jsx`, (node, index, parent) => {
- parent.children.splice(index, 1)
- })
- return u.stringify(stepAst)
-}
-
const parse = async src => {
try {
const ast = u.parse(src)
- const imports = handleImports(ast)
- await unwrapImports(ast, imports)
const steps = partitionSteps(ast)
- const commands = extractCommands(steps)
return {
ast,
steps,
- commands,
stepsAsMdx: steps.map(toMdx),
- stepsAsMdxWithoutJsx: steps.map(toMdxWithoutJsx),
}
} catch (e) {
throw e
@@ -217,3 +105,4 @@ module.exports = async (recipePath, projectRoot) => {
}
module.exports.parse = parse
+module.exports.u = u
diff --git a/packages/gatsby-recipes/src/parser/index.test.js b/packages/gatsby-recipes/src/parser/index.test.js
new file mode 100644
index 0000000000000..9087f740297d3
--- /dev/null
+++ b/packages/gatsby-recipes/src/parser/index.test.js
@@ -0,0 +1,44 @@
+const fs = require(`fs-extra`)
+const path = require(`path`)
+
+const parser = require(`.`)
+
+const fixturePath = path.join(__dirname, `fixtures/prettier-git-hook.mdx`)
+const fixtureSrc = fs.readFileSync(fixturePath, `utf8`)
+
+test(`fetches a recipe from unpkg when official short form`, async () => {
+ const result = await parser(`theme-ui`)
+
+ expect(result.stepsAsMdx).toMatchSnapshot()
+})
+
+test(`fetches a recipe from unpkg when official short form and .mdx`, async () => {
+ const result = await parser(`theme-ui.mdx`)
+
+ expect(result).toBeTruthy()
+})
+
+test(`raises an error when the recipe isn't known`, async () => {
+ try {
+ await parser(`theme-uiz`)
+ } catch (e) {
+ expect(e).toBeTruthy()
+ }
+})
+
+test(`partitions the MDX into steps`, async () => {
+ const result = await parser.parse(fixtureSrc)
+
+ expect(result.stepsAsMdx).toMatchSnapshot()
+})
+
+test(`raises an error if JSX doesn't parse`, async () => {
+ try {
+ await parser.parse(`# Hello, world!
+---
+
- htmlTagNames.includes(tag) || svgTagNames.includes(tag)
-
-const getAttributeValue = expression => {
- // If the expression is null, this is an implicitly "true" prop, such as readOnly
- if (expression === null) {
- return true
- }
-
- if (expression.type === `Literal`) {
- return expression.value
- }
-
- if (expression.type === `JSXExpressionContainer`) {
- return getAttributeValue(expression.expression)
- }
-
- if (expression.type === `ArrayExpression`) {
- return expression.elements.map(element => getAttributeValue(element))
- }
-
- if (expression.type === `TemplateLiteral`) {
- return expression.quasis[0].value.raw
- }
-
- if (expression.type === `ObjectExpression`) {
- const entries = expression.properties
- .map(property => {
- const key = getAttributeValue(property.key)
- const value = getAttributeValue(property.value)
-
- if (key === undefined || value === undefined) {
- return null
- }
-
- return { key, value }
- })
- .filter(property => property)
- .reduce((properties, property) => {
- return { ...properties, [property.key]: property.value }
- }, {})
-
- return entries
- }
-
- if (expression.type === `Identifier`) {
- return expression.name
- }
-
- // Unsupported type
- throw new SyntaxError(`${expression.type} is not supported`)
-}
-
-const getNode = node => {
- if (node.type === `JSXFragment`) {
- return [`Fragment`, null].concat(node.children.map(getNode))
- }
-
- if (node.type === `JSXElement`) {
- return [
- node.openingElement.name.name,
- node.openingElement.attributes
- .map(attribute => {
- if (attribute.type === `JSXAttribute`) {
- let attributeName = attribute.name.name
-
- if (isHtmlOrSvgTag(node.openingElement.name.name.toLowerCase())) {
- if (possibleStandardNames[attributeName.toLowerCase()]) {
- attributeName =
- possibleStandardNames[attributeName.toLowerCase()]
- }
- }
-
- let attributeValue = getAttributeValue(attribute.value)
-
- if (attributeValue !== undefined) {
- if (attributeName === `style` && isString(attributeValue)) {
- attributeValue = styleToObject(attributeValue)
- }
-
- return {
- name: attributeName,
- value: attributeValue,
- }
- }
- }
-
- return null
- })
- .filter(property => property)
- .reduce((properties, property) => {
- return { ...properties, [property.name]: property.value }
- }, {}),
- ].concat(node.children.map(getNode))
- }
-
- if (node.type === `JSXText`) {
- return node.value
- }
-
- // Unsupported type
- throw new SyntaxError(`${node.type} is not supported`)
-}
-
-const jsxToJson = input => {
- if (typeof input !== `string`) {
- throw new TypeError(`Expected a string`)
- }
-
- let parsed = null
- try {
- parsed = acorn.Parser.extend(jsx({ allowNamespaces: false })).parse(
- `${input}`
- )
- } catch (e) {
- throw new Error(
- JSON.stringify({
- location: e.loc,
- validationError: `Could not parse "${input}"`,
- })
- )
- }
-
- if (parsed.body[0]) {
- return parsed.body[0].expression.children
- .map(getNode)
- .filter(child => child)
- }
-
- return []
-}
-
-module.exports = jsxToJson
diff --git a/packages/gatsby-recipes/src/parser/react-standard-props.js b/packages/gatsby-recipes/src/parser/react-standard-props.js
deleted file mode 100644
index bf3029873f30e..0000000000000
--- a/packages/gatsby-recipes/src/parser/react-standard-props.js
+++ /dev/null
@@ -1,489 +0,0 @@
-// Source: https://github.com/facebook/react/blob/dbb060d561b83ad901af3e1f60541e6c313cca4f/packages/react-dom/src/shared/possibleStandardNames.js
-const possibleStandardNames = {
- // HTML
- accept: `accept`,
- acceptcharset: `acceptCharset`,
- "accept-charset": `acceptCharset`,
- accesskey: `accessKey`,
- action: `action`,
- allowfullscreen: `allowFullScreen`,
- alt: `alt`,
- as: `as`,
- async: `async`,
- autocapitalize: `autoCapitalize`,
- autocomplete: `autoComplete`,
- autocorrect: `autoCorrect`,
- autofocus: `autoFocus`,
- autoplay: `autoPlay`,
- autosave: `autoSave`,
- capture: `capture`,
- cellpadding: `cellPadding`,
- cellspacing: `cellSpacing`,
- challenge: `challenge`,
- charset: `charSet`,
- checked: `checked`,
- children: `children`,
- cite: `cite`,
- class: `className`,
- classid: `classID`,
- classname: `className`,
- cols: `cols`,
- colspan: `colSpan`,
- content: `content`,
- contenteditable: `contentEditable`,
- contextmenu: `contextMenu`,
- controls: `controls`,
- controlslist: `controlsList`,
- coords: `coords`,
- crossorigin: `crossOrigin`,
- dangerouslysetinnerhtml: `dangerouslySetInnerHTML`,
- data: `data`,
- datetime: `dateTime`,
- default: `default`,
- defaultchecked: `defaultChecked`,
- defaultvalue: `defaultValue`,
- defer: `defer`,
- dir: `dir`,
- disabled: `disabled`,
- disablepictureinpicture: `disablePictureInPicture`,
- download: `download`,
- draggable: `draggable`,
- enctype: `encType`,
- for: `htmlFor`,
- form: `form`,
- formmethod: `formMethod`,
- formaction: `formAction`,
- formenctype: `formEncType`,
- formnovalidate: `formNoValidate`,
- formtarget: `formTarget`,
- frameborder: `frameBorder`,
- headers: `headers`,
- height: `height`,
- hidden: `hidden`,
- high: `high`,
- href: `href`,
- hreflang: `hrefLang`,
- htmlfor: `htmlFor`,
- httpequiv: `httpEquiv`,
- "http-equiv": `httpEquiv`,
- icon: `icon`,
- id: `id`,
- innerhtml: `innerHTML`,
- inputmode: `inputMode`,
- integrity: `integrity`,
- is: `is`,
- itemid: `itemID`,
- itemprop: `itemProp`,
- itemref: `itemRef`,
- itemscope: `itemScope`,
- itemtype: `itemType`,
- keyparams: `keyParams`,
- keytype: `keyType`,
- kind: `kind`,
- label: `label`,
- lang: `lang`,
- list: `list`,
- loop: `loop`,
- low: `low`,
- manifest: `manifest`,
- marginwidth: `marginWidth`,
- marginheight: `marginHeight`,
- max: `max`,
- maxlength: `maxLength`,
- media: `media`,
- mediagroup: `mediaGroup`,
- method: `method`,
- min: `min`,
- minlength: `minLength`,
- multiple: `multiple`,
- muted: `muted`,
- name: `name`,
- nomodule: `noModule`,
- nonce: `nonce`,
- novalidate: `noValidate`,
- open: `open`,
- optimum: `optimum`,
- pattern: `pattern`,
- placeholder: `placeholder`,
- playsinline: `playsInline`,
- poster: `poster`,
- preload: `preload`,
- profile: `profile`,
- radiogroup: `radioGroup`,
- readonly: `readOnly`,
- referrerpolicy: `referrerPolicy`,
- rel: `rel`,
- required: `required`,
- reversed: `reversed`,
- role: `role`,
- rows: `rows`,
- rowspan: `rowSpan`,
- sandbox: `sandbox`,
- scope: `scope`,
- scoped: `scoped`,
- scrolling: `scrolling`,
- seamless: `seamless`,
- selected: `selected`,
- shape: `shape`,
- size: `size`,
- sizes: `sizes`,
- span: `span`,
- spellcheck: `spellCheck`,
- src: `src`,
- srcdoc: `srcDoc`,
- srclang: `srcLang`,
- srcset: `srcSet`,
- start: `start`,
- step: `step`,
- style: `style`,
- summary: `summary`,
- tabindex: `tabIndex`,
- target: `target`,
- title: `title`,
- type: `type`,
- usemap: `useMap`,
- value: `value`,
- width: `width`,
- wmode: `wmode`,
- wrap: `wrap`,
-
- // SVG
- about: `about`,
- accentheight: `accentHeight`,
- "accent-height": `accentHeight`,
- accumulate: `accumulate`,
- additive: `additive`,
- alignmentbaseline: `alignmentBaseline`,
- "alignment-baseline": `alignmentBaseline`,
- allowreorder: `allowReorder`,
- alphabetic: `alphabetic`,
- amplitude: `amplitude`,
- arabicform: `arabicForm`,
- "arabic-form": `arabicForm`,
- ascent: `ascent`,
- attributename: `attributeName`,
- attributetype: `attributeType`,
- autoreverse: `autoReverse`,
- azimuth: `azimuth`,
- basefrequency: `baseFrequency`,
- baselineshift: `baselineShift`,
- "baseline-shift": `baselineShift`,
- baseprofile: `baseProfile`,
- bbox: `bbox`,
- begin: `begin`,
- bias: `bias`,
- by: `by`,
- calcmode: `calcMode`,
- capheight: `capHeight`,
- "cap-height": `capHeight`,
- clip: `clip`,
- clippath: `clipPath`,
- "clip-path": `clipPath`,
- clippathunits: `clipPathUnits`,
- cliprule: `clipRule`,
- "clip-rule": `clipRule`,
- color: `color`,
- colorinterpolation: `colorInterpolation`,
- "color-interpolation": `colorInterpolation`,
- colorinterpolationfilters: `colorInterpolationFilters`,
- "color-interpolation-filters": `colorInterpolationFilters`,
- colorprofile: `colorProfile`,
- "color-profile": `colorProfile`,
- colorrendering: `colorRendering`,
- "color-rendering": `colorRendering`,
- contentscripttype: `contentScriptType`,
- contentstyletype: `contentStyleType`,
- cursor: `cursor`,
- cx: `cx`,
- cy: `cy`,
- d: `d`,
- datatype: `datatype`,
- decelerate: `decelerate`,
- descent: `descent`,
- diffuseconstant: `diffuseConstant`,
- direction: `direction`,
- display: `display`,
- divisor: `divisor`,
- dominantbaseline: `dominantBaseline`,
- "dominant-baseline": `dominantBaseline`,
- dur: `dur`,
- dx: `dx`,
- dy: `dy`,
- edgemode: `edgeMode`,
- elevation: `elevation`,
- enablebackground: `enableBackground`,
- "enable-background": `enableBackground`,
- end: `end`,
- exponent: `exponent`,
- externalresourcesrequired: `externalResourcesRequired`,
- fill: `fill`,
- fillopacity: `fillOpacity`,
- "fill-opacity": `fillOpacity`,
- fillrule: `fillRule`,
- "fill-rule": `fillRule`,
- filter: `filter`,
- filterres: `filterRes`,
- filterunits: `filterUnits`,
- floodopacity: `floodOpacity`,
- "flood-opacity": `floodOpacity`,
- floodcolor: `floodColor`,
- "flood-color": `floodColor`,
- focusable: `focusable`,
- fontfamily: `fontFamily`,
- "font-family": `fontFamily`,
- fontsize: `fontSize`,
- "font-size": `fontSize`,
- fontsizeadjust: `fontSizeAdjust`,
- "font-size-adjust": `fontSizeAdjust`,
- fontstretch: `fontStretch`,
- "font-stretch": `fontStretch`,
- fontstyle: `fontStyle`,
- "font-style": `fontStyle`,
- fontvariant: `fontVariant`,
- "font-variant": `fontVariant`,
- fontweight: `fontWeight`,
- "font-weight": `fontWeight`,
- format: `format`,
- from: `from`,
- fx: `fx`,
- fy: `fy`,
- g1: `g1`,
- g2: `g2`,
- glyphname: `glyphName`,
- "glyph-name": `glyphName`,
- glyphorientationhorizontal: `glyphOrientationHorizontal`,
- "glyph-orientation-horizontal": `glyphOrientationHorizontal`,
- glyphorientationvertical: `glyphOrientationVertical`,
- "glyph-orientation-vertical": `glyphOrientationVertical`,
- glyphref: `glyphRef`,
- gradienttransform: `gradientTransform`,
- gradientunits: `gradientUnits`,
- hanging: `hanging`,
- horizadvx: `horizAdvX`,
- "horiz-adv-x": `horizAdvX`,
- horizoriginx: `horizOriginX`,
- "horiz-origin-x": `horizOriginX`,
- ideographic: `ideographic`,
- imagerendering: `imageRendering`,
- "image-rendering": `imageRendering`,
- in2: `in2`,
- in: `in`,
- inlist: `inlist`,
- intercept: `intercept`,
- k1: `k1`,
- k2: `k2`,
- k3: `k3`,
- k4: `k4`,
- k: `k`,
- kernelmatrix: `kernelMatrix`,
- kernelunitlength: `kernelUnitLength`,
- kerning: `kerning`,
- keypoints: `keyPoints`,
- keysplines: `keySplines`,
- keytimes: `keyTimes`,
- lengthadjust: `lengthAdjust`,
- letterspacing: `letterSpacing`,
- "letter-spacing": `letterSpacing`,
- lightingcolor: `lightingColor`,
- "lighting-color": `lightingColor`,
- limitingconeangle: `limitingConeAngle`,
- local: `local`,
- markerend: `markerEnd`,
- "marker-end": `markerEnd`,
- markerheight: `markerHeight`,
- markermid: `markerMid`,
- "marker-mid": `markerMid`,
- markerstart: `markerStart`,
- "marker-start": `markerStart`,
- markerunits: `markerUnits`,
- markerwidth: `markerWidth`,
- mask: `mask`,
- maskcontentunits: `maskContentUnits`,
- maskunits: `maskUnits`,
- mathematical: `mathematical`,
- mode: `mode`,
- numoctaves: `numOctaves`,
- offset: `offset`,
- opacity: `opacity`,
- operator: `operator`,
- order: `order`,
- orient: `orient`,
- orientation: `orientation`,
- origin: `origin`,
- overflow: `overflow`,
- overlineposition: `overlinePosition`,
- "overline-position": `overlinePosition`,
- overlinethickness: `overlineThickness`,
- "overline-thickness": `overlineThickness`,
- paintorder: `paintOrder`,
- "paint-order": `paintOrder`,
- panose1: `panose1`,
- "panose-1": `panose1`,
- pathlength: `pathLength`,
- patterncontentunits: `patternContentUnits`,
- patterntransform: `patternTransform`,
- patternunits: `patternUnits`,
- pointerevents: `pointerEvents`,
- "pointer-events": `pointerEvents`,
- points: `points`,
- pointsatx: `pointsAtX`,
- pointsaty: `pointsAtY`,
- pointsatz: `pointsAtZ`,
- prefix: `prefix`,
- preservealpha: `preserveAlpha`,
- preserveaspectratio: `preserveAspectRatio`,
- primitiveunits: `primitiveUnits`,
- property: `property`,
- r: `r`,
- radius: `radius`,
- refx: `refX`,
- refy: `refY`,
- renderingintent: `renderingIntent`,
- "rendering-intent": `renderingIntent`,
- repeatcount: `repeatCount`,
- repeatdur: `repeatDur`,
- requiredextensions: `requiredExtensions`,
- requiredfeatures: `requiredFeatures`,
- resource: `resource`,
- restart: `restart`,
- result: `result`,
- results: `results`,
- rotate: `rotate`,
- rx: `rx`,
- ry: `ry`,
- scale: `scale`,
- security: `security`,
- seed: `seed`,
- shaperendering: `shapeRendering`,
- "shape-rendering": `shapeRendering`,
- slope: `slope`,
- spacing: `spacing`,
- specularconstant: `specularConstant`,
- specularexponent: `specularExponent`,
- speed: `speed`,
- spreadmethod: `spreadMethod`,
- startoffset: `startOffset`,
- stddeviation: `stdDeviation`,
- stemh: `stemh`,
- stemv: `stemv`,
- stitchtiles: `stitchTiles`,
- stopcolor: `stopColor`,
- "stop-color": `stopColor`,
- stopopacity: `stopOpacity`,
- "stop-opacity": `stopOpacity`,
- strikethroughposition: `strikethroughPosition`,
- "strikethrough-position": `strikethroughPosition`,
- strikethroughthickness: `strikethroughThickness`,
- "strikethrough-thickness": `strikethroughThickness`,
- string: `string`,
- stroke: `stroke`,
- strokedasharray: `strokeDasharray`,
- "stroke-dasharray": `strokeDasharray`,
- strokedashoffset: `strokeDashoffset`,
- "stroke-dashoffset": `strokeDashoffset`,
- strokelinecap: `strokeLinecap`,
- "stroke-linecap": `strokeLinecap`,
- strokelinejoin: `strokeLinejoin`,
- "stroke-linejoin": `strokeLinejoin`,
- strokemiterlimit: `strokeMiterlimit`,
- "stroke-miterlimit": `strokeMiterlimit`,
- strokewidth: `strokeWidth`,
- "stroke-width": `strokeWidth`,
- strokeopacity: `strokeOpacity`,
- "stroke-opacity": `strokeOpacity`,
- suppresscontenteditablewarning: `suppressContentEditableWarning`,
- suppresshydrationwarning: `suppressHydrationWarning`,
- surfacescale: `surfaceScale`,
- systemlanguage: `systemLanguage`,
- tablevalues: `tableValues`,
- targetx: `targetX`,
- targety: `targetY`,
- textanchor: `textAnchor`,
- "text-anchor": `textAnchor`,
- textdecoration: `textDecoration`,
- "text-decoration": `textDecoration`,
- textlength: `textLength`,
- textrendering: `textRendering`,
- "text-rendering": `textRendering`,
- to: `to`,
- transform: `transform`,
- typeof: `typeof`,
- u1: `u1`,
- u2: `u2`,
- underlineposition: `underlinePosition`,
- "underline-position": `underlinePosition`,
- underlinethickness: `underlineThickness`,
- "underline-thickness": `underlineThickness`,
- unicode: `unicode`,
- unicodebidi: `unicodeBidi`,
- "unicode-bidi": `unicodeBidi`,
- unicoderange: `unicodeRange`,
- "unicode-range": `unicodeRange`,
- unitsperem: `unitsPerEm`,
- "units-per-em": `unitsPerEm`,
- unselectable: `unselectable`,
- valphabetic: `vAlphabetic`,
- "v-alphabetic": `vAlphabetic`,
- values: `values`,
- vectoreffect: `vectorEffect`,
- "vector-effect": `vectorEffect`,
- version: `version`,
- vertadvy: `vertAdvY`,
- "vert-adv-y": `vertAdvY`,
- vertoriginx: `vertOriginX`,
- "vert-origin-x": `vertOriginX`,
- vertoriginy: `vertOriginY`,
- "vert-origin-y": `vertOriginY`,
- vhanging: `vHanging`,
- "v-hanging": `vHanging`,
- videographic: `vIdeographic`,
- "v-ideographic": `vIdeographic`,
- viewbox: `viewBox`,
- viewtarget: `viewTarget`,
- visibility: `visibility`,
- vmathematical: `vMathematical`,
- "v-mathematical": `vMathematical`,
- vocab: `vocab`,
- widths: `widths`,
- wordspacing: `wordSpacing`,
- "word-spacing": `wordSpacing`,
- writingmode: `writingMode`,
- "writing-mode": `writingMode`,
- x1: `x1`,
- x2: `x2`,
- x: `x`,
- xchannelselector: `xChannelSelector`,
- xheight: `xHeight`,
- "x-height": `xHeight`,
- xlinkactuate: `xlinkActuate`,
- "xlink:actuate": `xlinkActuate`,
- xlinkarcrole: `xlinkArcrole`,
- "xlink:arcrole": `xlinkArcrole`,
- xlinkhref: `xlinkHref`,
- "xlink:href": `xlinkHref`,
- xlinkrole: `xlinkRole`,
- "xlink:role": `xlinkRole`,
- xlinkshow: `xlinkShow`,
- "xlink:show": `xlinkShow`,
- xlinktitle: `xlinkTitle`,
- "xlink:title": `xlinkTitle`,
- xlinktype: `xlinkType`,
- "xlink:type": `xlinkType`,
- xmlbase: `xmlBase`,
- "xml:base": `xmlBase`,
- xmllang: `xmlLang`,
- "xml:lang": `xmlLang`,
- xmlns: `xmlns`,
- "xml:space": `xmlSpace`,
- xmlnsxlink: `xmlnsXlink`,
- "xmlns:xlink": `xmlnsXlink`,
- xmlspace: `xmlSpace`,
- y1: `y1`,
- y2: `y2`,
- y: `y`,
- ychannelselector: `yChannelSelector`,
- z: `z`,
- zoomandpan: `zoomAndPan`,
-}
-
-module.exports = possibleStandardNames
diff --git a/packages/gatsby-recipes/src/parser/remove-element-by-name.js b/packages/gatsby-recipes/src/parser/remove-element-by-name.js
deleted file mode 100644
index 8d3cd884334ec..0000000000000
--- a/packages/gatsby-recipes/src/parser/remove-element-by-name.js
+++ /dev/null
@@ -1,31 +0,0 @@
-const babel = require(`@babel/standalone`)
-const jsxSyntax = require(`@babel/plugin-syntax-jsx`)
-
-const BabelPluginRemoveElementByName = (api, { names }) => {
- return {
- visitor: {
- JSXElement(path) {
- if (names.includes(path.node.openingElement.name.name)) {
- path.remove()
- }
- },
- },
- }
-}
-
-module.exports = (src, options) => {
- try {
- const { code } = babel.transform(`<>${src}>`, {
- configFile: false,
- plugins: [[BabelPluginRemoveElementByName, options], jsxSyntax],
- })
-
- return code.replace(/^<>/, ``).replace(/<\/>;$/, ``)
- } catch (e) {
- console.log(e)
- }
-
- return null
-}
-
-module.exports.BabelPluginRemoveElementByName = BabelPluginRemoveElementByName
diff --git a/packages/gatsby-recipes/src/parser/validate.js b/packages/gatsby-recipes/src/parser/validate.js
new file mode 100644
index 0000000000000..36f4fb6fda189
--- /dev/null
+++ b/packages/gatsby-recipes/src/parser/validate.js
@@ -0,0 +1,36 @@
+const { transform } = require(`@babel/standalone`)
+const babelPluginTransformReactJsx = require(`@babel/plugin-transform-react-jsx`)
+const visit = require(`unist-util-visit`)
+
+const { u } = require(`.`)
+
+const validateJsx = () => tree => {
+ visit(tree, `jsx`, node => {
+ try {
+ transform(`<>${node.value}<>`, {
+ plugins: [babelPluginTransformReactJsx],
+ })
+ } catch (e) {
+ e.syntaxError = {
+ errorType: `parse`,
+ errorDescription: `Unable to parse JSX`,
+ line: node.position.start.line + e.loc.line - 1,
+ trace: e.toString(),
+ }
+
+ throw e
+ }
+
+ return undefined
+ })
+}
+
+module.exports = mdx => {
+ try {
+ u.use(validateJsx).processSync(mdx)
+ } catch (e) {
+ return e.syntaxError
+ }
+
+ return undefined
+}
diff --git a/packages/gatsby-recipes/src/parser/validate.test.js b/packages/gatsby-recipes/src/parser/validate.test.js
new file mode 100644
index 0000000000000..7061514628722
--- /dev/null
+++ b/packages/gatsby-recipes/src/parser/validate.test.js
@@ -0,0 +1,17 @@
+const validate = require(`./validate`)
+
+const fixture = `
+# Hello, world!
+
+---
+
+
+ {
+ const result = validate(fixture)
+
+ expect(result.line).toEqual(7)
+ expect(result.errorType).toEqual(`parse`)
+})
diff --git a/packages/gatsby-recipes/src/recipe-machine.test.js b/packages/gatsby-recipes/src/recipe-machine.test.js
deleted file mode 100644
index 4b3cf3789a28a..0000000000000
--- a/packages/gatsby-recipes/src/recipe-machine.test.js
+++ /dev/null
@@ -1,243 +0,0 @@
-const { interpret } = require(`xstate`)
-const fs = require(`fs-extra`)
-const path = require(`path`)
-
-const recipeMachine = require(`./recipe-machine`)
-
-it(`should create empty plan when the step has no resources`, done => {
- const initialContext = {
- src: `
-# Hello, world!
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `present plan`) {
- expect(state.context.plan).toEqual([])
- service.stop()
- done()
- }
- })
-
- service.start()
-})
-
-it(`should create plan for File resources`, done => {
- const initialContext = {
- src: `
-# File!
-
----
-
-
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `present plan`) {
- if (state.context.currentStep === 0) {
- service.send(`CONTINUE`)
- } else {
- //expect(state.context.plan).toMatchSnapshot()
- expect(state.context.plan).toBeTruthy()
- service.stop()
- done()
- }
- }
- })
-
- service.start()
-})
-
-it(`it should error if part of the recipe fails schema validation`, done => {
- const initialContext = {
- src: `
-# Hello, world
-
----
-
-
-
----
-
----
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `doneError`) {
- expect(state.context.error).toBeTruthy()
- //expect(state.context.error).toMatchSnapshot()
- service.stop()
- done()
- }
- })
-
- service.start()
-})
-
-it(`it should error if the introduction step has a command`, done => {
- const initialContext = {
- src: `
-# Hello, world
-
-
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `doneError`) {
- expect(state.context.error).toBeTruthy()
- //expect(state.context.error).toMatchSnapshot()
- service.stop()
- done()
- }
- })
-
- service.start()
-})
-
-it(`it should error if no src or recipePath has been given`, done => {
- const initialContext = {
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `doneError`) {
- expect(state.context.error).toBeTruthy()
- //expect(state.context.error).toMatchSnapshot()
- service.stop()
- done()
- }
- })
-
- service.start()
-})
-
-it(`it should error if invalid jsx is passed`, done => {
- const initialContext = {
- src: `
-# Hello, world
-
- {
- if (state.value === `doneError`) {
- expect(state.context.error).toBeTruthy()
- //expect(state.context.error).toMatchSnapshot()
- service.stop()
- done()
- }
- })
-
- service.start()
-})
-
-it(`it should switch to done after the final apply step`, done => {
- const filePath = `./hi.md`
- const initialContext = {
- src: `
-# File!
-
----
-
-
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- // Keep simulating moving onto the next step
- if (state.value === `present plan`) {
- service.send(`CONTINUE`)
- }
- if (state.value === `done`) {
- const fullPath = path.join(process.cwd(), filePath)
- const fileExists = fs.pathExistsSync(fullPath)
- expect(fileExists).toBeTruthy()
- // Clean up file
- fs.unlinkSync(fullPath)
- done()
- }
- })
-
- service.start()
-})
-
-it(`should store created/changed/deleted resources on the context after applying plan`, done => {
- const filePath = `./hi.md`
- const filePath2 = `./hi2.md`
- const filePath3 = `./hi3.md`
- const initialContext = {
- src: `
-# File!
-
----
-
-
-
-
----
-
-
- `,
- currentStep: 0,
- }
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- // Keep simulating moving onto the next step
- if (state.value === `present plan`) {
- service.send(`CONTINUE`)
- }
- if (state.value === `done`) {
- // Clean up files
- fs.unlinkSync(path.join(process.cwd(), filePath))
- fs.unlinkSync(path.join(process.cwd(), filePath2))
- fs.unlinkSync(path.join(process.cwd(), filePath3))
-
- expect(state.context.stepResources).toHaveLength(3)
- expect(state.context.stepResources).toMatchSnapshot()
- expect(state.context.stepResources[0]._message).toBeTruthy()
- expect(state.context.stepResources[0]._currentStep).toBeTruthy()
- done()
- }
- })
-
- service.start()
-})
-
-it.skip(`should create a plan from a url`, done => {
- const url = `https://gist.githubusercontent.com/johno/20503d2a2c80529096e60cd70260c9d8/raw/0145da93c17dcbf5d819a1ef3c97fa8713fad490/test-recipe.mdx`
- const initialContext = {
- recipePath: url,
- currentStep: 0,
- }
-
- const service = interpret(
- recipeMachine.withContext(initialContext)
- ).onTransition(state => {
- if (state.value === `present plan`) {
- expect(state.context.plan).toBeTruthy()
- //expect(state.context.plan).toMatchSnapshot()
- service.stop()
- done()
- }
- })
-
- service.start()
-})
diff --git a/packages/gatsby-recipes/src/__snapshots__/recipe-machine.test.js.snap b/packages/gatsby-recipes/src/recipe-machine/__snapshots__/index.test.js.snap
similarity index 72%
rename from packages/gatsby-recipes/src/__snapshots__/recipe-machine.test.js.snap
rename to packages/gatsby-recipes/src/recipe-machine/__snapshots__/index.test.js.snap
index 9e308bbf3950e..00e629826bab8 100644
--- a/packages/gatsby-recipes/src/__snapshots__/recipe-machine.test.js.snap
+++ b/packages/gatsby-recipes/src/recipe-machine/__snapshots__/index.test.js.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`should store created/changed/deleted resources on the context after applying plan 1`] = `
+exports[`recipe-machine stores created/changed/deleted resources on the context after applying plan 1`] = `
Array [
Object {
"_currentStep": 1,
diff --git a/packages/gatsby-recipes/src/recipe-machine/errors.test.js b/packages/gatsby-recipes/src/recipe-machine/errors.test.js
new file mode 100644
index 0000000000000..734670ead3181
--- /dev/null
+++ b/packages/gatsby-recipes/src/recipe-machine/errors.test.js
@@ -0,0 +1,96 @@
+const { interpret } = require(`xstate`)
+
+const recipeMachine = require(`.`)
+
+describe(`recipe-machine errors`, () => {
+ it(`errors if part of the recipe fails schema validation`, done => {
+ const initialContext = {
+ src: `
+# Hello, world
+
+---
+
+
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ if (state.value === `doneError`) {
+ expect(state.context.error).toBeTruthy()
+ service.stop()
+ done()
+ } else if (state.value === `presentPlan`) {
+ if (state.context.currentStep === 0) {
+ service.send(`CONTINUE`)
+ }
+ }
+ })
+
+ service.start()
+ })
+
+ it(`errors if the introduction step has a command`, done => {
+ const initialContext = {
+ src: `
+# Hello, world
+
+
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ if (state.value === `doneError`) {
+ expect(state.context.error).toBeTruthy()
+ service.stop()
+ done()
+ }
+ })
+
+ service.start()
+ })
+
+ it(`errors if no src or recipePath has been given`, done => {
+ const initialContext = {
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ if (state.value === `doneError`) {
+ expect(state.context.error).toBeTruthy()
+ //expect(state.context.error).toMatchSnapshot()
+ service.stop()
+ done()
+ }
+ })
+
+ service.start()
+ })
+
+ it(`errors if invalid jsx is passed`, done => {
+ const initialContext = {
+ src: `
+# Hello, world
+
+ {
+ if (state.value === `doneError`) {
+ expect(state.context.error).toBeTruthy()
+ //expect(state.context.error).toMatchSnapshot()
+ service.stop()
+ done()
+ }
+ })
+
+ service.start()
+ })
+})
diff --git a/packages/gatsby-recipes/src/recipe-machine.js b/packages/gatsby-recipes/src/recipe-machine/index.js
similarity index 81%
rename from packages/gatsby-recipes/src/recipe-machine.js
rename to packages/gatsby-recipes/src/recipe-machine/index.js
index fc94fa4d4d75c..383ff8d8b334c 100644
--- a/packages/gatsby-recipes/src/recipe-machine.js
+++ b/packages/gatsby-recipes/src/recipe-machine/index.js
@@ -1,10 +1,9 @@
const { Machine, assign } = require(`xstate`)
-const createPlan = require(`./create-plan`)
-const applyPlan = require(`./apply-plan`)
-const validateSteps = require(`./validate-steps`)
-const validateRecipe = require(`./validate-recipe`)
-const parser = require(`./parser`)
+const createPlan = require(`../create-plan`)
+const applyPlan = require(`../apply-plan`)
+const validateSteps = require(`../validate-steps`)
+const parser = require(`../parser`)
const recipeMachine = Machine(
{
@@ -24,7 +23,7 @@ const recipeMachine = Machine(
parsingRecipe: {
invoke: {
id: `parseRecipe`,
- src: async (context, event) => {
+ src: async (context, _event) => {
let parsed
if (context.src) {
@@ -61,8 +60,7 @@ const recipeMachine = Machine(
onDone: {
target: `validateSteps`,
actions: assign({
- steps: (context, event) => event.data.commands,
- stepsAsMdx: (context, event) => event.data.stepsAsMdx,
+ steps: (context, event) => event.data.stepsAsMdx,
}),
},
},
@@ -78,27 +76,6 @@ const recipeMachine = Machine(
return undefined
},
- onDone: `validatePlan`,
- onError: {
- target: `doneError`,
- actions: assign({
- error: (context, event) => JSON.parse(event.data.message),
- }),
- },
- },
- },
- validatePlan: {
- invoke: {
- id: `validatePlan`,
- src: async (context, event) => {
- const result = await validateRecipe(context.steps)
- if (result.length > 0) {
- // is stringifying the only way to pass data around in errors 🤔
- throw new Error(JSON.stringify(result))
- }
-
- return result
- },
onDone: `creatingPlan`,
onError: {
target: `doneError`,
@@ -113,32 +90,40 @@ const recipeMachine = Machine(
invoke: {
id: `createPlan`,
src: async (context, event) => {
- const result = await createPlan(context)
- return result
+ try {
+ const result = await createPlan(context)
+ return result
+ } catch (e) {
+ throw e
+ }
},
onDone: {
- target: `present plan`,
+ target: `presentPlan`,
actions: assign({
plan: (context, event) => event.data,
}),
},
onError: {
target: `doneError`,
- actions: assign({ error: (context, event) => event.data }),
+ actions: assign({
+ error: (context, event) => event.data.errors || event.data,
+ }),
},
},
},
- "present plan": {
+ presentPlan: {
on: {
CONTINUE: `applyingPlan`,
},
},
applyingPlan: {
+ // cb mechanism can be used to emit events/actions between UI and the server/renderer
+ // https://xstate.js.org/docs/guides/communication.html#invoking-callbacks
invoke: {
id: `applyPlan`,
src: (context, event) => cb => {
cb(`RESET`)
- if (context.plan.length == 0) {
+ if (context.plan.length === 0) {
return cb(`onDone`)
}
diff --git a/packages/gatsby-recipes/src/recipe-machine/index.test.js b/packages/gatsby-recipes/src/recipe-machine/index.test.js
new file mode 100644
index 0000000000000..044030c4c0dd5
--- /dev/null
+++ b/packages/gatsby-recipes/src/recipe-machine/index.test.js
@@ -0,0 +1,130 @@
+const { interpret } = require(`xstate`)
+const fs = require(`fs-extra`)
+const path = require(`path`)
+
+const recipeMachine = require(`.`)
+
+describe(`recipe-machine`, () => {
+ it(`creates empty plan when the step has no resources`, done => {
+ const initialContext = {
+ src: `
+# Hello, world!
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ if (state.value === `presentPlan`) {
+ expect(state.context.plan).toEqual([])
+ service.stop()
+ done()
+ }
+ })
+
+ service.start()
+ })
+
+ it(`creates plan for File resources`, done => {
+ const initialContext = {
+ src: `
+# File!
+
+---
+
+
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ if (state.value === `presentPlan`) {
+ if (state.context.currentStep === 0) {
+ service.send(`CONTINUE`)
+ } else {
+ expect(state.context.plan).toBeTruthy()
+ service.stop()
+ done()
+ }
+ }
+ })
+
+ service.start()
+ })
+
+ it(`switches to done after the final apply step`, done => {
+ const filePath = `./hi.md`
+ const initialContext = {
+ src: `
+# File!
+
+---
+
+
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ // Keep simulating moving onto the next step
+ if (state.value === `presentPlan`) {
+ service.send(`CONTINUE`)
+ }
+ if (state.value === `done`) {
+ const fullPath = path.join(process.cwd(), filePath)
+ const fileExists = fs.pathExistsSync(fullPath)
+ expect(fileExists).toBeTruthy()
+ // Clean up file
+ fs.unlinkSync(fullPath)
+ done()
+ }
+ })
+
+ service.start()
+ })
+
+ it(`stores created/changed/deleted resources on the context after applying plan`, done => {
+ const filePath = `./hi.md`
+ const filePath2 = `./hi2.md`
+ const filePath3 = `./hi3.md`
+ const initialContext = {
+ src: `
+# File!
+
+---
+
+
+
+
+---
+
+
+ `,
+ currentStep: 0,
+ }
+ const service = interpret(
+ recipeMachine.withContext(initialContext)
+ ).onTransition(state => {
+ // Keep simulating moving onto the next step
+ if (state.value === `presentPlan`) {
+ service.send(`CONTINUE`)
+ }
+ if (state.value === `done`) {
+ // Clean up files
+ fs.unlinkSync(path.join(process.cwd(), filePath))
+ fs.unlinkSync(path.join(process.cwd(), filePath2))
+ fs.unlinkSync(path.join(process.cwd(), filePath3))
+
+ expect(state.context.stepResources).toHaveLength(3)
+ expect(state.context.stepResources).toMatchSnapshot()
+ expect(state.context.stepResources[0]._message).toBeTruthy()
+ expect(state.context.stepResources[0]._currentStep).toBeTruthy()
+ done()
+ }
+ })
+
+ service.start()
+ })
+})
diff --git a/packages/gatsby-recipes/src/renderer/error-boundary.js b/packages/gatsby-recipes/src/renderer/error-boundary.js
new file mode 100644
index 0000000000000..8b34f48429d20
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/error-boundary.js
@@ -0,0 +1,26 @@
+const React = require(`react`)
+
+class ErrorBoundary extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = { hasError: false }
+ }
+
+ static getDerivedStateFromError(error) {
+ return { hasError: true }
+ }
+
+ componentDidCatch(error, errorInfo) {
+ console.log({ error, errorInfo })
+ }
+
+ render() {
+ if (this.state.hasError) {
+ return null
+ }
+
+ return this.props.children
+ }
+}
+
+module.exports = ErrorBoundary
diff --git a/packages/gatsby-recipes/src/renderer/index.js b/packages/gatsby-recipes/src/renderer/index.js
new file mode 100644
index 0000000000000..575eaa4fb279a
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/index.js
@@ -0,0 +1,57 @@
+const React = require(`react`)
+const mdx = require(`@mdx-js/mdx`)
+const { transform } = require(`@babel/standalone`)
+const babelPluginTransformReactJsx = require(`@babel/plugin-transform-react-jsx`)
+
+const { render } = require(`./render`)
+const resourceComponents = require(`./resource-components`)
+
+const scope = {
+ React,
+ Config: `div`, // Keep this as a noop for now
+ ...resourceComponents,
+}
+
+// We want to call the function constructor with our resulting
+// transformed JS so we need to turn it into a "function body"
+const transformCodeForEval = code => {
+ const newCode = code.replace(/;$/, ``)
+
+ return `return (${newCode})`
+}
+
+// TODO: Release MDX v2 canary so we can avoid the hacks
+const stripMdxLayout = str => {
+ const newJsx = str
+ .replace(/^.*mdxType="MDXLayout">/ms, ``)
+ .replace(/<\/MDXLayout>.*/ms, ``)
+
+ return `${newJsx}`
+}
+
+const transformJsx = jsx => {
+ const { code } = transform(jsx, {
+ plugins: [[babelPluginTransformReactJsx, { useBuiltIns: true }]],
+ })
+
+ return code
+}
+
+// This is overloaded to handle MDX input, JSX input
+// or MDX's JSX output as input.
+module.exports = jsx => {
+ const scopeKeys = Object.keys(scope)
+ const scopeValues = Object.values(scope)
+
+ const jsxFromMdx = mdx.sync(jsx, { skipExport: true })
+ const srcCode = transformJsx(stripMdxLayout(jsxFromMdx))
+
+ const component = new Function(...scopeKeys, transformCodeForEval(srcCode))
+
+ try {
+ const result = render(component(...scopeValues))
+ return result
+ } catch (e) {
+ throw e
+ }
+}
diff --git a/packages/gatsby-recipes/src/renderer/index.test.js b/packages/gatsby-recipes/src/renderer/index.test.js
new file mode 100644
index 0000000000000..86fc7229afa32
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/index.test.js
@@ -0,0 +1,116 @@
+const render = require(`.`)
+
+const mdxFixture = `
+# Hello, world!
+
+
+
+
+`
+
+describe(`renderer`, () => {
+ test(`handles MDX as input`, async () => {
+ const result = await render(mdxFixture)
+
+ expect(result).toMatchInlineSnapshot(`
+ Array [
+ Object {
+ "currentState": "",
+ "describe": "Write foo.js",
+ "diff": "- Original - 0
+ + Modified + 1
+
+ + /** foo */",
+ "newState": "/** foo */",
+ "resourceDefinitions": Object {
+ "content": "/** foo */",
+ "path": "foo.js",
+ },
+ "resourceName": "File",
+ },
+ Object {
+ "currentState": "",
+ "describe": "Write foo2.js",
+ "diff": "- Original - 0
+ + Modified + 1
+
+ + /** foo2 */",
+ "newState": "/** foo2 */",
+ "resourceDefinitions": Object {
+ "content": "/** foo2 */",
+ "path": "foo2.js",
+ },
+ "resourceName": "File",
+ },
+ Object {
+ "currentState": "gatsby@2.22.5",
+ "describe": "Install gatsby@latest",
+ "newState": "gatsby@latest",
+ "resourceDefinitions": Object {
+ "name": "gatsby",
+ },
+ "resourceName": "NPMPackage",
+ },
+ ]
+ `)
+ })
+
+ test(`handles JSX with a single component`, async () => {
+ const result = await render(``)
+
+ expect(result).toMatchInlineSnapshot(`
+ Array [
+ Object {
+ "currentState": "",
+ "describe": "Write hi.md",
+ "diff": "- Original - 0
+ + Modified + 1
+
+ + hi",
+ "newState": "hi",
+ "resourceDefinitions": Object {
+ "content": "hi",
+ "path": "hi.md",
+ },
+ "resourceName": "File",
+ },
+ ]
+ `)
+ })
+
+ test(`returns a plan for nested JSX`, async () => {
+ const result = await render(`
+
+
+ `)
+
+ expect(result).toMatchInlineSnapshot(`
+ Array [
+ Object {
+ "currentState": "",
+ "describe": "Write foo.js",
+ "diff": "- Original - 0
+ + Modified + 1
+
+ + /** foo */",
+ "newState": "/** foo */",
+ "resourceDefinitions": Object {
+ "content": "/** foo */",
+ "path": "foo.js",
+ },
+ "resourceName": "File",
+ },
+ ]
+ `)
+ })
+
+ test(`handles introduction step with config`, async () => {
+ const result = await render(`# Setup Theme UI
+
+This recipe helps you start developing with the [Theme UI](https://theme-ui.com) styling library.
+
+`)
+
+ expect(result).toMatchInlineSnapshot(`Array []`)
+ })
+})
diff --git a/packages/gatsby-recipes/src/renderer/reconciler.js b/packages/gatsby-recipes/src/renderer/reconciler.js
new file mode 100644
index 0000000000000..489f0a655c556
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/reconciler.js
@@ -0,0 +1,103 @@
+const ReactReconciler = require(`react-reconciler`)
+
+const debug = require(`debug`)(`recipes-reconciler`)
+
+const reconciler = ReactReconciler({
+ finalizeInitialChildren(element, type, props) {},
+ getChildHostContext(parentContext, fiberType, rootInstance) {},
+ getRootHostContext(rootInstance) {
+ return {
+ type: `recipes-root`,
+ }
+ },
+ shouldSetTextContent(type, props) {},
+ resetTextContent(element) {},
+ createInstance(
+ type,
+ props,
+ rootContainerInstance,
+ hostContext,
+ internalInstanceHandle
+ ) {
+ const instance = {
+ type,
+ props,
+ }
+
+ debug(`creating instance`, instance)
+
+ return instance
+ },
+ createTextInstance(
+ text,
+ rootContainerInstance,
+ hostContext,
+ internalInstanceHandle
+ ) {
+ debug(`creating text instance`, text)
+ return { text }
+ },
+ appendChildToContainer(container, child) {
+ debug(`appending child to container`, { container, child })
+ container.children = container.children || []
+ const index = container.children.findIndex(c => c.key === child.key)
+
+ if (index === -1) {
+ container.children.push(child)
+ } else {
+ container.children[index] = child
+ }
+
+ return container
+ },
+ appendChild(parent, child) {
+ debug(`appending child`, { parent, child })
+ parent.children = parent.children || []
+ parent.children.push(child)
+ },
+ appendInitialChild(parent, child) {
+ debug(`appending initial child`, { parent, child })
+ parent.children = parent.children || []
+ parent.children.push(child)
+ },
+ removeChildFromContainer(container, child) {},
+ removeChild(parent, child) {},
+ insertInContainerBefore(container, child, before) {},
+ insertBefore(parent, child, before) {},
+ prepareUpdate(
+ instance,
+ type,
+ oldProps,
+ newProps,
+ rootContainerInstance,
+ currentHostContext
+ ) {},
+ commitUpdate(
+ instance,
+ updatePayload,
+ type,
+ oldProps,
+ newProps,
+ finishedWork
+ ) {},
+ hideInstance() {},
+ unhideInstance() {},
+ prepareForCommit(...args) {},
+ resetAfterCommit(...args) {},
+ getPublicInstance(...args) {},
+ supportsMutation: true,
+})
+
+const RecipesRenderer = {
+ render(whatToRender, currState) {
+ debug(`rendering recipe`)
+ let container = reconciler.createContainer(currState, false, false)
+ reconciler.updateContainer(whatToRender, container, null, null)
+
+ debug(`render result`, JSON.stringify(currState, null, 2))
+
+ return currState
+ },
+}
+
+module.exports = RecipesRenderer
diff --git a/packages/gatsby-recipes/src/renderer/render.js b/packages/gatsby-recipes/src/renderer/render.js
new file mode 100644
index 0000000000000..3c37cd0595d0b
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/render.js
@@ -0,0 +1,102 @@
+const React = require(`react`)
+const { Suspense } = require(`react`)
+
+const resources = require(`../resources`)
+
+const RecipesReconciler = require(`./reconciler`)
+const ErrorBoundary = require(`./error-boundary`)
+const transformToPlan = require(`./transform-to-plan-structure`)
+
+const promises = []
+const errors = []
+const cache = new Map()
+
+const getUserProps = props => {
+ // eslint-disable-next-line
+ const { mdxType, children, ...userProps } = props
+ return userProps
+}
+
+const Wrapper = ({ children }) => (
+
+ Loading recipe...
}>{children}
+
+)
+
+const ResourceComponent = ({ _resourceName: Resource, ...props }) => {
+ const userProps = getUserProps(props)
+
+ return (
+ Reading resource...}>
+
+ {JSON.stringify({
+ ...readResource(Resource, { root: process.cwd() }, props),
+ _props: userProps,
+ })}
+
+
+ )
+}
+
+const validateResource = (resourceName, _context, props) => {
+ const userProps = getUserProps(props)
+ const { error } = resources[resourceName].validate(userProps)
+ return error
+}
+
+const readResource = (resourceName, context, props) => {
+ const error = validateResource(resourceName, context, props)
+ if (error) {
+ errors.push(error)
+ return null
+ }
+
+ const key = JSON.stringify({ resourceName, ...props })
+ const cachedResult = cache.get(key)
+
+ if (cachedResult) {
+ return cachedResult
+ }
+
+ let promise
+ try {
+ promise = resources[resourceName]
+ .plan(context, props)
+ .then(result => cache.set(key, result))
+ .catch(e => console.log(e))
+ } catch (e) {
+ throw e
+ }
+
+ promises.push(promise)
+
+ throw promise
+}
+
+const render = async recipe => {
+ const plan = {}
+
+ const recipeWithWrapper = {recipe}
+
+ try {
+ // Run the first pass of the render to queue up all the promises and suspend
+ RecipesReconciler.render(recipeWithWrapper, plan)
+
+ if (errors.length) {
+ const error = new Error(`Unable to validate resources`)
+ error.errors = errors
+ throw error
+ }
+
+ // Await all promises for resources and cache results
+ await Promise.all(promises)
+ // Rerender with the resources and resolve the data
+ const result = RecipesReconciler.render(recipeWithWrapper, plan)
+ return transformToPlan(result)
+ } catch (e) {
+ throw e
+ }
+}
+
+module.exports.render = render
+module.exports.ResourceComponent = ResourceComponent
diff --git a/packages/gatsby-recipes/src/renderer/render.test.js b/packages/gatsby-recipes/src/renderer/render.test.js
new file mode 100644
index 0000000000000..3ae90c0a0e719
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/render.test.js
@@ -0,0 +1,43 @@
+const React = require(`react`)
+
+const { render } = require(`./render`)
+const { File, NPMPackage } = require(`./resource-components`)
+
+const fixture = (
+
+
+
+
+)
+
+test(`renders to a plan`, async () => {
+ const result = await render(fixture, {})
+
+ expect(result).toMatchInlineSnapshot(`
+ Array [
+ Object {
+ "currentState": "",
+ "describe": "Write red.js",
+ "diff": "- Original - 0
+ + Modified + 1
+
+ + red!",
+ "newState": "red!",
+ "resourceDefinitions": Object {
+ "content": "red!",
+ "path": "red.js",
+ },
+ "resourceName": "File",
+ },
+ Object {
+ "currentState": "gatsby@2.22.5",
+ "describe": "Install gatsby@latest",
+ "newState": "gatsby@latest",
+ "resourceDefinitions": Object {
+ "name": "gatsby",
+ },
+ "resourceName": "NPMPackage",
+ },
+ ]
+ `)
+})
diff --git a/packages/gatsby-recipes/src/renderer/resource-components.js b/packages/gatsby-recipes/src/renderer/resource-components.js
new file mode 100644
index 0000000000000..b82d10bda3e8b
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/resource-components.js
@@ -0,0 +1,21 @@
+const React = require(`react`)
+
+const resources = require(`../resources`)
+
+const { ResourceComponent } = require(`./render`)
+
+const resourceComponents = Object.keys(resources).reduce(
+ (acc, resourceName) => {
+ acc[resourceName] = props => (
+
+ )
+
+ // Make sure the component is pretty printed in reconciler output
+ acc[resourceName].displayName = resourceName
+
+ return acc
+ },
+ {}
+)
+
+module.exports = resourceComponents
diff --git a/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.js b/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.js
new file mode 100644
index 0000000000000..e1a0d9325eac4
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.js
@@ -0,0 +1,33 @@
+const providedResources = require(`../resources`)
+
+const transform = (props = {}) => {
+ if (!props.children) {
+ return []
+ }
+
+ const plan = props.children.reduce((acc, curr) => {
+ const childResourcePlans = transform(curr)
+
+ if (!providedResources[curr.type]) {
+ return [...acc, ...childResourcePlans]
+ }
+
+ const { _props, ...plan } = JSON.parse(curr.children[0].text)
+
+ const resourcePlan = {
+ resourceName: curr.type,
+ resourceDefinitions: _props,
+ ...plan,
+ }
+
+ return [...acc, resourcePlan]
+ }, [])
+
+ return plan
+}
+
+module.exports = renderTree => {
+ const [doc] = renderTree.children
+
+ return transform(doc)
+}
diff --git a/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.test.js b/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.test.js
new file mode 100644
index 0000000000000..112dcfaf2d319
--- /dev/null
+++ b/packages/gatsby-recipes/src/renderer/transform-to-plan-structure.test.js
@@ -0,0 +1,42 @@
+const transform = require(`./transform-to-plan-structure`)
+
+const fixture = {
+ children: [
+ {
+ children: [
+ {
+ type: `NPMPackage`,
+ children: [
+ {
+ text: `{"newState": "gatsby@latest", "_props": {"name": "gatsby"}}`,
+ },
+ ],
+ },
+ {
+ type: `File`,
+ children: [
+ {
+ text: `{"currentState":"","newState":"/** foo */","describe":"Write foo.js","diff":"- Original - 0/n+ Modified + 1/n/n+ /** foo */","_props":{"path":"foo.js","content":"/** foo */"}}`,
+ },
+ ],
+ },
+ {
+ type: `File`,
+ children: [
+ {
+ text: `{"currentState":"","newState":"/** foo2 */","describe":"Write foo2.js","diff":"- Original - 0/n+ Modified + 1/n/n+ /** foo2 */","_props":{"path":"foo2.js","content":"/** foo2 */"}}`,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+}
+
+test(`transforms the render output`, async () => {
+ const [npmPackage, ...files] = transform(fixture)
+
+ expect(npmPackage.resourceDefinitions.name).toEqual(`gatsby`)
+ expect(npmPackage.newState).toEqual(`gatsby@latest`)
+ expect(files).toHaveLength(2)
+})
diff --git a/packages/gatsby-recipes/src/resources.js b/packages/gatsby-recipes/src/resources.js
index 9d0660fc9325d..f8e3cc3526b02 100644
--- a/packages/gatsby-recipes/src/resources.js
+++ b/packages/gatsby-recipes/src/resources.js
@@ -6,19 +6,10 @@ const npmPackageScriptResource = require(`./providers/npm/script`)
const npmPackageJsonResource = require(`./providers/npm/package-json`)
const gitIgnoreResource = require(`./providers/git/ignore`)
-const configResource = {
- create: () => {},
- read: () => {},
- update: () => {},
- destroy: () => {},
- plan: () => {},
-}
-
const componentResourceMapping = {
File: fileResource,
GatsbyPlugin: gatsbyPluginResource,
GatsbyShadowFile: gatsbyShadowFileResource,
- Config: configResource,
NPMPackage: npmPackageResource,
NPMScript: npmPackageScriptResource,
NPMPackageJson: npmPackageJsonResource,
diff --git a/packages/gatsby-recipes/src/todo.md b/packages/gatsby-recipes/src/todo.md
deleted file mode 100644
index c5e7a70e50b20..0000000000000
--- a/packages/gatsby-recipes/src/todo.md
+++ /dev/null
@@ -1,89 +0,0 @@
-- [x] Make root configurable/dynamic
-- [x] Make recipe configurable (theme-ui/eslint/jest)
-- [x] Exit upon completion
-
-- [x] Move into gatsby repo
-- [x] Run as a command
-- [x] Boot up server as a process
-- [x] Then run the CLI
-- [x] Clean up server after
-- [x] show plan to create or that nothing is necessary & then show in `` what was done
-
-## alpha
-
-- [x] Handle `dev` in NPMPackage
-- [x] add Joi for validating resource objects
-- [x] handle template strings in JSX parser
-- [x] Step by step design
-- [x] Use `fs-extra`
-- [x] Handle object style plugins
-- [x] Improve gatsby-config test
-- [x] convert to xstate
-- [x] integration test for each resource (read, create, update, delete)
-- [x] validate Resource component props.
-- [x] reasonably test resources
-- [x] add Joi for validating resource objects
-- [x] handle error states
-- [x] handle template strings in JSX parser
-- [x] Make it support relative paths for custom recipes (./src/recipes/foo.mdx)
-- [x] Move parsing to the server
-- [x] run recipe from url
-- [x] Move parsing to the server
-- [x] imports from a url
-- [x] Document the supported components and trivial guide on recipe authoring
-- [x] have File only pull from remote files for now until multiline strings work in MDX
-- [x] integration test for each resource (read, create, update, delete)
-- [x] update shadow file resource
-- [x] handle error states
-
-Kyle
-
-- [x] Make port selection dynamic
-- [x] Add large warning to recipes output that this is an experimental feature & might change at any moment + link to docs / umbrella issue for bug reports & discussions
-- [x] use yarn/npm based on the user config
-- [x] write tests for remote files src in File
-- [x] Gatsby recipes list (design and implementation)
-- [x] move back to "press enter to run"
-- [x] Run gatsby-config.js changes through prettier to avoid weird diffs
-- [x] document ShadowFile
-- [x] Remove mention of canary release before merging
-- [x] write blog post
-- [x] move gatsby package to depend on released version of gatsby-recipes
-
-John
-
-- [x] spike on bundling recipes into one file
-- [x] print pretty error when there's parsing errors of mdx files
-- [x] Move mdx recipes to its own package `gatsby-recipes` & pull them from unpkg
-- [x] add CODEOWNERS file for recipes
-- [x] give proper npm permissions to `gatsby-recipes`
-- [x] validate that the first step of recipes don't have any resources. They should just be for the title/description
-- [x] handle not finding a recipe
-- [x] test modifying gatsby-config.js from default starter
-- [x] get tests passing
-- [x] add emotion screenshot and add to readme
-- [x] make note about using gists for paths and using the "raw" link
-- [x] gatsby-config.js hardening — make it work if there's no plugins set like in hello-world starter
-
-## Near-ish future
-
-- [ ] support Joi.any & Joi.alternatives in joi2graphql for prettier-git-hook.mdx
-- [ ] Make a proper "Config" provider to add recipes dir, store data, etc.
-- [ ] init.js for providers to setup clients
-- [ ] validate resource config
-- [ ] Theme UI preset selection (runs dependent install and file write)
-- [ ] Failing postinstall scripts cause client to hang
-- [ ] Select input supported recipes
-- [ ] Refactor resource state to use Redux & record runs in local db
-- [ ] move creating the validate function to core and out of resources — they just declare their schema
-- [ ] get latest version of npm packages so know if can skip running.
-- [ ] Make `dependencyType` in NPMPackage an enum (joi2gql doesn't handle this right now from Joi enums)
-- [ ] Show in plan if an update will be applied vs. create.
-- [ ] Implement config object for GatsbyPlugin
-- [ ] Handle JS in config objects? { **\_javascript: "`\${**dirname}/foo/bar`" }
-- [ ] handle people pressing Y & quit if they press "n" (for now)
-- [ ] Automatically create list of recipes from the recipes directory (recipes resource 🤔)
-- [ ] ShadowFile needs more validation — validate the file to shadow exists.
-- [ ] Add eslint support & add Typescript eslint plugins to the typescript recipe.
-- [ ] add recipe mdx-pages once we can write out options https://gist.github.com/KyleAMathews/3d763491e5c4c6396e1a6a626b2793ce
-- [ ] Add PWA recipe once we can write options https://gist.githubusercontent.com/gillkyle/9e4fa3d019c525aef2f4bd431c806879/raw/f4d42a81190d2cada59688e6acddc6b5e97fe586/make-your-site-a-pwa.mdx
diff --git a/packages/gatsby-recipes/src/validate-recipe.js b/packages/gatsby-recipes/src/validate-recipe.js
index 67b030d169660..6560de67be3ac 100644
--- a/packages/gatsby-recipes/src/validate-recipe.js
+++ b/packages/gatsby-recipes/src/validate-recipe.js
@@ -20,7 +20,9 @@ module.exports = plan => {
console.log(`${key} is missing an exported validate function`)
return undefined
}
- const result = resources[key].validate(resourceDeclaration)
+ const result = resources[key].validate(
+ resourceDeclaration.resourceDefinitions
+ )
if (result.error) {
return {
step: i,
diff --git a/packages/gatsby-recipes/src/validate-recipe.test.js b/packages/gatsby-recipes/src/validate-recipe.test.js
index 85fac60d9b954..692253c9be6dc 100644
--- a/packages/gatsby-recipes/src/validate-recipe.test.js
+++ b/packages/gatsby-recipes/src/validate-recipe.test.js
@@ -1,24 +1,6 @@
const validateRecipe = require(`./validate-recipe`)
describe(`validate module validates recipes with resource declarations`, () => {
- it(`validates File declarations`, () => {
- const recipe = [
- {},
- { File: [{ path: `super.md`, content: `hi` }] },
- { File: [{ path: `super-duper.md`, contentz: `yo` }] },
- ]
- const validationResponse = validateRecipe(recipe)
- expect(validationResponse[0].validationError).toBeTruthy()
- expect(validationResponse).toMatchSnapshot()
- expect(validationResponse[0].validationError).toMatchSnapshot()
- })
-
- it(`validates NPMPackage declarations`, () => {
- const recipe = [{}, { NPMPackage: [{ namez: `wee-package` }] }]
- const validationResponse = validateRecipe(recipe)
- expect(validationResponse).toMatchSnapshot()
- })
-
it(`returns errors for unknown resources`, () => {
const recipe = [{ Fake: [{}] }]
diff --git a/packages/gatsby-recipes/src/validate-steps.js b/packages/gatsby-recipes/src/validate-steps.js
index 1dc4988d752e0..7f7c9bb441e20 100644
--- a/packages/gatsby-recipes/src/validate-steps.js
+++ b/packages/gatsby-recipes/src/validate-steps.js
@@ -1,19 +1,28 @@
-const ALLOWED_STEP_O_COMMANDS = [`Config`]
+const validate = require(`./parser/validate`)
+const render = require(`./renderer`)
-module.exports = steps => {
- const commandKeys = Object.keys(steps[0]).filter(
- cmd => !ALLOWED_STEP_O_COMMANDS.includes(cmd)
- )
+module.exports = async steps => {
+ const errors = []
- if (commandKeys.length) {
- return commandKeys.map(key => {
- return {
+ steps.map((stepMdx, i) => {
+ const syntaxError = validate(stepMdx)
+ if (syntaxError) {
+ errors.push(syntaxError)
+ }
+ })
+
+ try {
+ const firstStepPlan = await render(steps[0])
+ if (firstStepPlan.length) {
+ errors.push({
step: 0,
- resource: key,
- validationError: `Resources e.g. ${key} should not be placed in the introduction step`,
- }
- })
- } else {
- return []
+ validationError: `Resources should not be placed in the introduction step (0)`,
+ })
+ }
+ } catch (e) {
+ // This means the first step has a syntax error which is already
+ // addressed above.
}
+
+ return errors
}
diff --git a/packages/gatsby-recipes/src/validate-steps.test.js b/packages/gatsby-recipes/src/validate-steps.test.js
deleted file mode 100644
index 4d06cae7217e2..0000000000000
--- a/packages/gatsby-recipes/src/validate-steps.test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const validateSteps = require(`./validate-steps`)
-const parser = require(`./parser`)
-
-const getErrors = async mdx => {
- const { commands } = await parser.parse(mdx)
- return validateSteps(commands)
-}
-
-test(`raises a validation error if commands are in step 0`, async () => {
- const result = await getErrors(``)
-
- expect(result).toHaveLength(1)
-})
-
-test(`does not raise a validation error if Config is in step 0`, async () => {
- const result = await getErrors(``)
-
- expect(result).toHaveLength(0)
-})
diff --git a/yarn.lock b/yarn.lock
index 0f096365fec53..19c6760466a8c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -13034,11 +13034,6 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
-humanize-list@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/humanize-list/-/humanize-list-1.0.1.tgz#e7e719c60a5d5848e8e0a5ed5f0a885496c239fd"
- integrity sha1-5+cZxgpdWEjo4KXtXwqIVJbCOf0=
-
humanize-ms@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed"
@@ -13863,13 +13858,6 @@ is-negated-glob@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2"
-is-newline@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-newline/-/is-newline-1.0.0.tgz#f0aac97cc9ac0b4b94af8c55a01cf3690f436e38"
- integrity sha1-8KrJfMmsC0uUr4xVoBzzaQ9Dbjg=
- dependencies:
- newline-regex "^0.2.0"
-
is-npm@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4"
@@ -17321,11 +17309,6 @@ netlify-identity-widget@^1.6.0:
resolved "https://registry.yarnpkg.com/netlify-identity-widget/-/netlify-identity-widget-1.6.0.tgz#35f89f802311ad45ff6fdb271167429192ec0aad"
integrity sha512-TcZLl0bWCyudCOThskOGyAhBqy1zRmBLbLWpyOmnK/8Vf5+6UwPwTVl71muWwybRoSFlSyc5Qyu+c4D5sBLSDA==
-newline-regex@^0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/newline-regex/-/newline-regex-0.2.1.tgz#4696d869045ee1509b83aac3a58d4a93bbed926e"
- integrity sha1-RpbYaQRe4VCbg6rDpY1Kk7vtkm4=
-
next-tick@1, next-tick@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
@@ -20063,6 +20046,16 @@ react-reconciler@^0.24.0:
prop-types "^15.6.2"
scheduler "^0.18.0"
+react-reconciler@^0.25.1:
+ version "0.25.1"
+ resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.25.1.tgz#f9814d59d115e1210762287ce987801529363aaa"
+ integrity sha512-R5UwsIvRcSs3w8n9k3tBoTtUHdVhu9u84EG7E5M0Jk9F5i6DA1pQzPfUZd6opYWGy56MJOtV3VADzy6DRwYDjw==
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ scheduler "^0.19.1"
+
react-refresh@^0.7.0:
version "0.7.2"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50"
From 99e5d3cfeaa58ef8599e20274cc885cf3bf0cb4f Mon Sep 17 00:00:00 2001
From: Josh
Date: Thu, 21 May 2020 15:18:44 -0700
Subject: [PATCH 005/288] Update surge CNAME instructions (#24278)
---
docs/docs/deploying-to-surge.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/docs/deploying-to-surge.md b/docs/docs/deploying-to-surge.md
index 622b17d5fd296..dc1cd755b3154 100644
--- a/docs/docs/deploying-to-surge.md
+++ b/docs/docs/deploying-to-surge.md
@@ -44,10 +44,12 @@ You're done! Your terminal will output the address of the domain where your site
## Step 4: Bonus - Remembering a domain
-To ensure future deploys are sent to the same location, you can store the domain name in a [`CNAME`](https://surge.sh/help/remembering-a-domain) file from your project root. Assuming your site was deployed to `https://my-cool-domain.surge.sh`, run the following command:
+To ensure future deploys are sent to the same location, you can store the domain name in a [`CNAME`](https://surge.sh/help/remembering-a-domain) file that is added your project. First, create a [`static` directory](https://www.gatsbyjs.org/docs/static-folder/) at the root of your Gatsby project if it doesn't already exist. Then put a file named `CNAME` (no file extension) in the `static` directory.
+
+Assuming your site was deployed to `https://my-cool-domain.surge.sh`, the following command will add the file for you:
```shell
-echo my-cool-domain.surge.sh > CNAME
+echo my-cool-domain.surge.sh > static/CNAME
```
Consult the [Surge Docs](https://surge.sh/help/) for information about how to customize your deployment further. Remember that each time you redeploy your site, you will need to rerun `gatsby build` first.
From cb99fd6dbee214ac932c4b9da6de254ae6547e5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ram=C3=B3n=20Chancay=20Ortega?=
Date: Thu, 21 May 2020 17:20:52 -0500
Subject: [PATCH 006/288] Showcase que jamear.com (#24105)
---
docs/sites.yml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/docs/sites.yml b/docs/sites.yml
index 8bc9387a59041..30c5a73c6344c 100644
--- a/docs/sites.yml
+++ b/docs/sites.yml
@@ -6819,8 +6819,8 @@
description: >-
Recipes and videos with the best of Ecuadorian cuisine.
Collectable recipes from Diario El Universo.
- main_url: https://recetas-eu.netlify.com/
- url: https://recetas-eu.netlify.com/
+ main_url: https://recetas-eu.now.sh/
+ url: https://recetas-eu.now.sh/
featured: false
categories:
- Blog
@@ -10720,3 +10720,14 @@
built_by: Thanawat Gulati
built_by_url: https://twitter.com/mjamesvevo
featured: false
+- title: Que Jamear
+ description: >-
+ A directory with a map of food delivery services
+ to be used during the health emergency caused by covid 19.
+ main_url: https://quejamear.com/encebollados
+ url: https://quejamear.com/encebollados
+ featured: false
+ categories:
+ - Food
+ built_by: Ramón Chancay
+ built_by_url: https://ramonchancay.me/
From eb821717a9b42c7c5ff129c2c9867059e14a29eb Mon Sep 17 00:00:00 2001
From: Dan Dascalescu
Date: Fri, 22 May 2020 10:45:22 +1200
Subject: [PATCH 007/288] docs: fix code formatting for MDX getting-started
(#24309)
---
docs/docs/mdx/getting-started.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/mdx/getting-started.md b/docs/docs/mdx/getting-started.md
index 7ebd81afd92bf..1d13a465cc381 100644
--- a/docs/docs/mdx/getting-started.md
+++ b/docs/docs/mdx/getting-started.md
@@ -54,7 +54,7 @@ Alternatively, you may be looking to configure an existing blog site to use MDX.
}
```
-3. **Restart `gatsby develop`** and add an `.mdx` page to \`src/pages
+3. **Restart `gatsby develop`** and add an `.mdx` page to `src/pages`
> **Note:** If you want to query for frontmatter, exports, or other fields like
> `tableOfContents` and you haven't previously added a `gatsby-source-filesystem`
From 692f83d3a7885b4bf502fe4cbfb9ca3955babbfd Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 00:56:42 +0200
Subject: [PATCH 008/288] fix(docs): glossary yarn: change yarn to Yarn
(#24312)
---
docs/docs/glossary/yarn.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/docs/glossary/yarn.md b/docs/docs/glossary/yarn.md
index fb83f0bc967ab..d398fe2374b47 100644
--- a/docs/docs/glossary/yarn.md
+++ b/docs/docs/glossary/yarn.md
@@ -6,7 +6,7 @@ description: Learn what the Yarn package manager is, how to use it, and how it f
Learn what the _Yarn_ package manager is, how to use it, and how it fits in to the Gatsby ecosystem.
-## What is yarn?
+## What is Yarn?
Yarn is a package manager for the [Node.js](/docs/glossary/node) JavaScript runtime. It's an alternative to Node's standard package manager, [npm](/docs/glossary/npm). [Contributing](/contributing/setting-up-your-local-dev-environment/) to Gatsby core requires Yarn. Gatsby core uses Yarn's [workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) feature to manage dependencies. Gatsby [theme development](/tutorial/building-a-theme/) also uses Yarn workspaces. For Gatsby site development, you can use Yarn or npm.
@@ -55,9 +55,9 @@ Gatsby will use Yarn as the package manager for new projects. You can also insta
Using Yarn to install packages generates a `yarn.lock` file. The `yarn.lock` tracks the exact version that you installed with `yarn add`, similar to `package-lock.json`. Commit `yarn.lock` to your project's repository. Doing so keeps your dependencies consistent across team members and computers.
-### Learn more about yarn
+### Learn more about Yarn
-- [yarn](https://yarnpkg.com/) official website
+- [Yarn](https://yarnpkg.com/) official website
- [The package.json guide](https://nodejs.dev/the-package-json-guide) from Nodejs.dev
- [Building a Theme](/tutorial/building-a-theme/)
- [Gatsby Theme Authoring](https://egghead.io/courses/gatsby-theme-authoring) from egghead.io
From 596ca4641cfa7ff8c98da55266c7419e7a9c04f7 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 00:59:50 +0200
Subject: [PATCH 009/288] fix(docs): local https - fix brand names (#24315)
---
docs/docs/local-https.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/docs/local-https.md b/docs/docs/local-https.md
index 0198d43c52ce6..9a12b0ec9845b 100644
--- a/docs/docs/local-https.md
+++ b/docs/docs/local-https.md
@@ -22,7 +22,7 @@ info setting up SSL certificate (may require elevated permissions/sudo)
Password:
```
-On windows, the prompt will differ:
+On Windows, the prompt will differ:
```text
A password is required to access the secure certificate authority key
@@ -49,7 +49,7 @@ To install `certutil`, you need to install the `nss tools` package(s). The exact
#### Linux
-On a linux OS, you should be able to run one of the following, depending on your Linux distro:
+On a Linux OS, you should be able to run one of the following, depending on your Linux distro:
```shell
# Debian based (Ubuntu)
@@ -62,7 +62,7 @@ sudo yum install nss-tools
sudo zypper install mozilla-nss-tools
```
-#### MacOS
+#### macOS
Run the following command:
From 9bae3a26ea40c69f45bf2f6912f4378d94114095 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 01:01:00 +0200
Subject: [PATCH 010/288] fix(docs): local https - fix casing in headings
(#24316)
---
docs/docs/local-https.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/docs/local-https.md b/docs/docs/local-https.md
index 9a12b0ec9845b..981acd6ad0c30 100644
--- a/docs/docs/local-https.md
+++ b/docs/docs/local-https.md
@@ -4,7 +4,7 @@ title: Local HTTPS
Gatsby provides an easy way to use a local HTTPS server during development, thanks to [devcert](https://github.com/davewasmer/devcert). When you enable the `https` option, a private key and certificate file will be created for your project and used by the development server.
-## Usage (Automatic HTTPS)
+## Usage (automatic HTTPS)
Start the development server using `npm run develop` as usual, and add either the `-S` or `--https` flag.
@@ -43,7 +43,7 @@ After typing in your password, `devcert` will install the CA certificate in your
`devcert` is configured to install `certutil` automatically, unless you're running Windows. If an automatic install is not successful, you may need to install it manually.
-### Manual Installation of `Certutil`
+### Manual installation of `Certutil`
To install `certutil`, you need to install the `nss tools` package(s). The exact procedure will differ depending on your operating system.
@@ -74,7 +74,7 @@ brew install nss
Pre-compiled libraries are rare, so you may need to compile it yourself. Because of how difficult Windows makes it, `devcert` will not attempt to update the Firefox trust store automatically; instead, it will fall back to using the "Firefox wizard", detailed below.
-### Debugging Installation
+### Debugging installation
If you choose not to install `certutil`, or the automatic install is not successful, you may get the following errors/prompts:
@@ -120,11 +120,11 @@ You can open the development server at `https://localhost:8000` and enjoy the HT
Find out more about [how devcert works](https://github.com/davewasmer/devcert#how-it-works).
-## Management of certificates generated by devcert
+## Management of certificates generated by `devcert`
If you want to do some maintenance/cleanup of the certificates generated by `devcert`, please refer to the [devcert-cli](https://github.com/davewasmer/devcert-cli/blob/master/README.md)
-## Custom Key and Certificate Files
+## Custom key and certificate files
You may find that you need a custom key and certificate file for HTTPS if you use multiple
machines for development (or if your dev environment is containerized in Docker).
From 6799831c9d8b6a634cd2fd06f91947cd89907395 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 01:02:22 +0200
Subject: [PATCH 011/288] fix(docs): eslint - fix ESlint to ESLint (#24317)
---
docs/docs/eslint.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/eslint.md b/docs/docs/eslint.md
index daf64a3b0345a..6a41782a01a2e 100644
--- a/docs/docs/eslint.md
+++ b/docs/docs/eslint.md
@@ -8,7 +8,7 @@ JavaScript, being a dynamic and loosely-typed language, is especially prone to d
## How to use ESLint
-Gatsby ships with a built-in [ESLint](https://eslint.org) setup. For _most_ users, our built-in ESlint setup is all you need. If you know however that you'd like to customize your ESlint config e.g. your company has their own custom ESlint setup, this shows how this can be done.
+Gatsby ships with a built-in [ESLint](https://eslint.org) setup. For _most_ users, our built-in ESLint setup is all you need. If you know however that you'd like to customize your ESLint config e.g. your company has their own custom ESLint setup, this shows how this can be done.
You'll replicate (mostly) the [ESLint config Gatsby ships with](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/eslint-config.ts) so you can then add additional presets, plugins, and rules.
From 8817f97288ab5c4ea18424759b60c71cbb6dd1d2 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 01:03:43 +0200
Subject: [PATCH 012/288] fix(docs): glossary yarn - 404 link (#24314)
---
docs/docs/glossary/yarn.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/glossary/yarn.md b/docs/docs/glossary/yarn.md
index d398fe2374b47..86038252baa9b 100644
--- a/docs/docs/glossary/yarn.md
+++ b/docs/docs/glossary/yarn.md
@@ -57,8 +57,8 @@ Using Yarn to install packages generates a `yarn.lock` file. The `yarn.lock` tra
### Learn more about Yarn
+- [The package.json guide](https://nodejs.dev/learn/the-package-json-guide) from Nodejs.dev
- [Yarn](https://yarnpkg.com/) official website
-- [The package.json guide](https://nodejs.dev/the-package-json-guide) from Nodejs.dev
- [Building a Theme](/tutorial/building-a-theme/)
- [Gatsby Theme Authoring](https://egghead.io/courses/gatsby-theme-authoring) from egghead.io
- [How to change your default package manager for your next project?](/docs/gatsby-cli/#how-to-change-your-default-package-manager-for-your-next-project) from the Gatsby CLI docs
From 1f915e821c4ba22cab04be252aecc4795a6b5654 Mon Sep 17 00:00:00 2001
From: Kyle Mathews
Date: Thu, 21 May 2020 16:08:50 -0700
Subject: [PATCH 013/288] chore(release): Publish
- gatsby-admin@0.1.47
- gatsby-cli@2.12.31
- gatsby-recipes@0.1.25
- gatsby-source-drupal@3.5.8
- gatsby-theme-blog-core@1.5.22
- gatsby-theme-blog@1.6.22
- gatsby-theme-notes@1.3.48
- gatsby-theme-ui-preset@0.0.37
- gatsby@2.22.6
---
packages/gatsby-admin/CHANGELOG.md | 4 ++++
packages/gatsby-admin/package.json | 4 ++--
packages/gatsby-cli/CHANGELOG.md | 4 ++++
packages/gatsby-cli/package.json | 4 ++--
packages/gatsby-recipes/CHANGELOG.md | 6 ++++++
packages/gatsby-recipes/package.json | 2 +-
packages/gatsby-source-drupal/CHANGELOG.md | 6 ++++++
packages/gatsby-source-drupal/package.json | 2 +-
packages/gatsby-theme-blog-core/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog-core/package.json | 4 ++--
packages/gatsby-theme-blog/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog/package.json | 6 +++---
packages/gatsby-theme-notes/CHANGELOG.md | 4 ++++
packages/gatsby-theme-notes/package.json | 4 ++--
packages/gatsby-theme-ui-preset/CHANGELOG.md | 4 ++++
packages/gatsby-theme-ui-preset/package.json | 4 ++--
packages/gatsby/CHANGELOG.md | 4 ++++
packages/gatsby/package.json | 4 ++--
18 files changed, 57 insertions(+), 17 deletions(-)
diff --git a/packages/gatsby-admin/CHANGELOG.md b/packages/gatsby-admin/CHANGELOG.md
index 1daf9e0b20070..e306942476010 100644
--- a/packages/gatsby-admin/CHANGELOG.md
+++ b/packages/gatsby-admin/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.47](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.46...gatsby-admin@0.1.47) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-admin
+
## [0.1.46](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.45...gatsby-admin@0.1.46) (2020-05-21)
**Note:** Version bump only for package gatsby-admin
diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json
index 67539943b8372..1bd76889189e3 100644
--- a/packages/gatsby-admin/package.json
+++ b/packages/gatsby-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
- "version": "0.1.46",
+ "version": "0.1.47",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -8,7 +8,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
- "gatsby": "^2.22.5",
+ "gatsby": "^2.22.6",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-source-graphql": "^2.5.2",
"react": "^16.12.0",
diff --git a/packages/gatsby-cli/CHANGELOG.md b/packages/gatsby-cli/CHANGELOG.md
index 8fd1944b652db..8b2191b46bbfc 100644
--- a/packages/gatsby-cli/CHANGELOG.md
+++ b/packages/gatsby-cli/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.12.31](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.30...gatsby-cli@2.12.31) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-cli
+
## [2.12.30](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.29...gatsby-cli@2.12.30) (2020-05-21)
**Note:** Version bump only for package gatsby-cli
diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json
index 569e76ef90946..c00f2063f5b21 100644
--- a/packages/gatsby-cli/package.json
+++ b/packages/gatsby-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
- "version": "2.12.30",
+ "version": "2.12.31",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "lib/index.js"
@@ -26,7 +26,7 @@
"fs-exists-cached": "^1.0.0",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^1.3.2",
- "gatsby-recipes": "^0.1.24",
+ "gatsby-recipes": "^0.1.25",
"gatsby-telemetry": "^1.3.8",
"hosted-git-info": "^3.0.4",
"is-valid-path": "^0.1.1",
diff --git a/packages/gatsby-recipes/CHANGELOG.md b/packages/gatsby-recipes/CHANGELOG.md
index eaa091413f7b7..3d11126436b6a 100644
--- a/packages/gatsby-recipes/CHANGELOG.md
+++ b/packages/gatsby-recipes/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.25](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.24...gatsby-recipes@0.1.25) (2020-05-21)
+
+### Features
+
+- **gatsby-recipes:** Implement initial custom react renderer for recipes ([#24065](https://github.com/gatsbyjs/gatsby/issues/24065)) ([f2227fc](https://github.com/gatsbyjs/gatsby/commit/f2227fc)), closes [/github.com/gatsbyjs/gatsby/issues/22991#issuecomment-625985760](https://github.com//github.com/gatsbyjs/gatsby/issues/22991/issues/issuecomment-625985760)
+
## [0.1.24](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.23...gatsby-recipes@0.1.24) (2020-05-20)
**Note:** Version bump only for package gatsby-recipes
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 25a2bf01aa5b9..fcd6750db2f34 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-recipes",
"description": "Core functionality for Gatsby Recipes",
- "version": "0.1.24",
+ "version": "0.1.25",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-source-drupal/CHANGELOG.md b/packages/gatsby-source-drupal/CHANGELOG.md
index c3c7b2198c464..1061f99701224 100644
--- a/packages/gatsby-source-drupal/CHANGELOG.md
+++ b/packages/gatsby-source-drupal/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.5.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-drupal@3.5.7...gatsby-source-drupal@3.5.8) (2020-05-21)
+
+### Bug Fixes
+
+- **gatsby-source-drupal:** added check for node.uri.value prefix ([#23672](https://github.com/gatsbyjs/gatsby/issues/23672)) ([5c8dec1](https://github.com/gatsbyjs/gatsby/commit/5c8dec1))
+
## [3.5.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-drupal@3.5.6...gatsby-source-drupal@3.5.7) (2020-05-20)
**Note:** Version bump only for package gatsby-source-drupal
diff --git a/packages/gatsby-source-drupal/package.json b/packages/gatsby-source-drupal/package.json
index 80606b2010b8a..cd86757866552 100644
--- a/packages/gatsby-source-drupal/package.json
+++ b/packages/gatsby-source-drupal/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-drupal",
"description": "Gatsby source plugin for building websites using the Drupal CMS as a data source",
- "version": "3.5.7",
+ "version": "3.5.8",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-theme-blog-core/CHANGELOG.md b/packages/gatsby-theme-blog-core/CHANGELOG.md
index 3b7e87005883e..ed21b1c986a75 100644
--- a/packages/gatsby-theme-blog-core/CHANGELOG.md
+++ b/packages/gatsby-theme-blog-core/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.5.22](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.21...gatsby-theme-blog-core@1.5.22) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-blog-core
+
## [1.5.21](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.20...gatsby-theme-blog-core@1.5.21) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-blog-core
diff --git a/packages/gatsby-theme-blog-core/package.json b/packages/gatsby-theme-blog-core/package.json
index c08959056e14d..a1efaf07a4dd2 100644
--- a/packages/gatsby-theme-blog-core/package.json
+++ b/packages/gatsby-theme-blog-core/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog-core",
- "version": "1.5.21",
+ "version": "1.5.22",
"main": "index.js",
"author": "christopherbiscardi (@chrisbiscardi)",
"license": "MIT",
@@ -30,7 +30,7 @@
},
"devDependencies": {
"@mdx-js/react": "^1.6.1",
- "gatsby": "^2.22.5",
+ "gatsby": "^2.22.6",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-blog/CHANGELOG.md b/packages/gatsby-theme-blog/CHANGELOG.md
index 8490ab07b8754..df4bb85ab226a 100644
--- a/packages/gatsby-theme-blog/CHANGELOG.md
+++ b/packages/gatsby-theme-blog/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.6.22](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.21...gatsby-theme-blog@1.6.22) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-blog
+
## [1.6.21](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.20...gatsby-theme-blog@1.6.21) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-blog
diff --git a/packages/gatsby-theme-blog/package.json b/packages/gatsby-theme-blog/package.json
index 2054ace3b6dbe..2d9ca082e1505 100644
--- a/packages/gatsby-theme-blog/package.json
+++ b/packages/gatsby-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog",
- "version": "1.6.21",
+ "version": "1.6.22",
"description": "A Gatsby theme for miscellaneous blogging with a dark/light mode",
"main": "index.js",
"keywords": [
@@ -29,7 +29,7 @@
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-theme-ui": "^0.2.53",
"gatsby-plugin-twitter": "^2.3.2",
- "gatsby-theme-blog-core": "^1.5.21",
+ "gatsby-theme-blog-core": "^1.5.22",
"mdx-utils": "0.2.0",
"react-helmet": "^5.2.1",
"react-switch": "^5.0.1",
@@ -39,7 +39,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.5",
+ "gatsby": "^2.22.6",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-notes/CHANGELOG.md b/packages/gatsby-theme-notes/CHANGELOG.md
index 766c7040c5b3d..431111dcb5568 100644
--- a/packages/gatsby-theme-notes/CHANGELOG.md
+++ b/packages/gatsby-theme-notes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.48](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.47...gatsby-theme-notes@1.3.48) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-notes
+
## [1.3.47](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.46...gatsby-theme-notes@1.3.47) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-notes
diff --git a/packages/gatsby-theme-notes/package.json b/packages/gatsby-theme-notes/package.json
index 019665c3bc586..10985e2427d0c 100644
--- a/packages/gatsby-theme-notes/package.json
+++ b/packages/gatsby-theme-notes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-theme-notes",
"description": "Gatsby Theme for adding a notes section to your website",
- "version": "1.3.47",
+ "version": "1.3.48",
"author": "John Otander",
"license": "MIT",
"main": "index.js",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-notes#readme",
"devDependencies": {
- "gatsby": "^2.22.5",
+ "gatsby": "^2.22.6",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
diff --git a/packages/gatsby-theme-ui-preset/CHANGELOG.md b/packages/gatsby-theme-ui-preset/CHANGELOG.md
index 3db522b958cc6..b128bee514305 100644
--- a/packages/gatsby-theme-ui-preset/CHANGELOG.md
+++ b/packages/gatsby-theme-ui-preset/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.0.37](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.36...gatsby-theme-ui-preset@0.0.37) (2020-05-21)
+
+**Note:** Version bump only for package gatsby-theme-ui-preset
+
## [0.0.36](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.35...gatsby-theme-ui-preset@0.0.36) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-ui-preset
diff --git a/packages/gatsby-theme-ui-preset/package.json b/packages/gatsby-theme-ui-preset/package.json
index 997ab2ddf8d84..1704a1d397447 100644
--- a/packages/gatsby-theme-ui-preset/package.json
+++ b/packages/gatsby-theme-ui-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-ui-preset",
- "version": "0.0.36",
+ "version": "0.0.37",
"description": "A Gatsby theme for theme-ui styles",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.5",
+ "gatsby": "^2.22.6",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index 095777e743edf..6c546f82d678f 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.22.6](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.5...gatsby@2.22.6) (2020-05-21)
+
+**Note:** Version bump only for package gatsby
+
## [2.22.5](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.4...gatsby@2.22.5) (2020-05-21)
### Bug Fixes
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index fa72d44dbfd7b..c3f3d21dbfb56 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.22.5",
+ "version": "2.22.6",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
@@ -72,7 +72,7 @@
"flat": "^4.1.0",
"fs-exists-cached": "1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-cli": "^2.12.30",
+ "gatsby-cli": "^2.12.31",
"gatsby-core-utils": "^1.3.2",
"gatsby-graphiql-explorer": "^0.4.2",
"gatsby-link": "^2.4.3",
From abedd3c3ac32515f98bc59993a93af95d0d5cc26 Mon Sep 17 00:00:00 2001
From: Max Stoiber
Date: Fri, 22 May 2020 08:39:04 +0200
Subject: [PATCH 014/288] chore(gatsby): start recipes graphql server during
gatsby develop (#23733)
* Move startGraphQLServer code from cli to recipes
* Make shared startGraphQLServer util use services
* Do not return data of unlocked services as they are no longer running
* Rename variable for clarity
* Explicitly import from /index to avoid issues with importing old builds
* Start recipes GraphQL server on gatsby develop
* Make recipes command match program.directory from develop command
* Use program.directory in recipes handler
* Move graphql server to fix cloud tests
* Force start GraphQL server in develop
* Start Recipes GraphQL server from gatsby-cli to avoid recipes dependency in gatsby package
* Store JSON in GraphQL server lock data
* Proper exports/imports from gatsby-recipes
* rm index.js!
* Actually edit the right file...
* Refactor gatsby-recipes to export an ESM
* Named default export
---
packages/gatsby-cli/src/create-cli.ts | 4 +-
packages/gatsby-cli/src/recipes.ts | 56 +++----------------
.../gatsby-core-utils/src/service-lock.ts | 21 ++++---
packages/gatsby-recipes/index.js | 1 -
packages/gatsby-recipes/package.json | 1 +
packages/gatsby-recipes/src/cli.js | 5 +-
.../src/graphql-server/index.js | 54 ++++++++++++++++++
.../{graphql.js => graphql-server/server.js} | 4 +-
packages/gatsby-recipes/src/index.js | 9 ++-
9 files changed, 91 insertions(+), 64 deletions(-)
delete mode 100644 packages/gatsby-recipes/index.js
create mode 100644 packages/gatsby-recipes/src/graphql-server/index.js
rename packages/gatsby-recipes/src/{graphql.js => graphql-server/server.js} (97%)
diff --git a/packages/gatsby-cli/src/create-cli.ts b/packages/gatsby-cli/src/create-cli.ts
index b7f84f689f74d..f0c172ddde230 100644
--- a/packages/gatsby-cli/src/create-cli.ts
+++ b/packages/gatsby-cli/src/create-cli.ts
@@ -10,6 +10,7 @@ import clipboardy from "clipboardy"
import { trackCli, setDefaultTags, setTelemetryEnabled } from "gatsby-telemetry"
import { initStarter } from "./init-starter"
import { recipesHandler } from "./recipes"
+import { startGraphQLServer } from "gatsby-recipes"
const handlerP = (fn: Function) => (...args: unknown[]): void => {
Promise.resolve(fn(...args)).then(
@@ -174,6 +175,7 @@ function buildLocalCommands(cli: yargs.Argv, isLocalSite: boolean): void {
handler: handlerP(
getCommandHandler(`develop`, (args: yargs.Arguments, cmd: Function) => {
process.env.NODE_ENV = process.env.NODE_ENV || `development`
+ startGraphQLServer(siteInfo.directory, true)
cmd(args)
// Return an empty promise to prevent handlerP from exiting early.
// The development server shouldn't ever exit until the user directly
@@ -344,7 +346,7 @@ function buildLocalCommands(cli: yargs.Argv, isLocalSite: boolean): void {
describe: `[EXPERIMENTAL] Run a recipe`,
handler: handlerP(
async ({ recipe }: yargs.Arguments<{ recipe: string | undefined }>) => {
- await recipesHandler(recipe)
+ await recipesHandler(siteInfo.directory, recipe)
}
),
})
diff --git a/packages/gatsby-cli/src/recipes.ts b/packages/gatsby-cli/src/recipes.ts
index cc12d81cb5f24..79b6504d5b887 100644
--- a/packages/gatsby-cli/src/recipes.ts
+++ b/packages/gatsby-cli/src/recipes.ts
@@ -1,59 +1,17 @@
import { trackCli } from "gatsby-telemetry"
-import execa from "execa"
-import * as path from "path"
-import * as fs from "fs"
-import detectPort from "detect-port"
+import runRecipe, { startGraphQLServer } from "gatsby-recipes"
export async function recipesHandler(
+ projectRoot: string,
recipe: string | undefined
): Promise {
- // We don't really care what port is used for GraphQL as it's
- // generally only for code to code communication or debugging.
- const graphqlPort = await detectPort(4000)
trackCli(`RECIPE_RUN`, { name: recipe })
- // Start GraphQL serve
- const scriptPath = require.resolve(`gatsby-recipes/dist/graphql.js`)
+ const graphql = await startGraphQLServer(projectRoot)
- const subprocess = execa(`node`, [scriptPath, graphqlPort], {
- all: true,
- env: {
- // Chalk doesn't want to output color in a child process
- // as it (correctly) thinks it's not in a normal terminal environemnt.
- // Since we're just returning data, we'll override that.
- FORCE_COLOR: `true`,
- },
+ return runRecipe({
+ recipe,
+ graphqlPort: graphql.port,
+ projectRoot,
})
-
- // eslint-disable-next-line no-unused-expressions
- subprocess.stderr?.on(`data`, data => {
- console.log(data.toString())
- })
-
- process.on(`exit`, () => {
- subprocess.kill(`SIGTERM`, {
- forceKillAfterTimeout: 2000,
- })
- })
-
- // Log server output to a file.
- if (process.env.DEBUG) {
- const logFile = path.resolve(`./recipe-server.log`)
- fs.writeFileSync(logFile, `\n-----\n${new Date().toJSON()}\n`)
- const writeStream = fs.createWriteStream(logFile, { flags: `a` })
- // eslint-disable-next-line no-unused-expressions
- subprocess.stdout?.pipe(writeStream)
- }
-
- let started = false
- // eslint-disable-next-line no-unused-expressions
- subprocess.stdout?.on(`data`, () => {
- if (!started) {
- const runRecipe = require(`gatsby-recipes/dist/index.js`)
- runRecipe({ recipe, graphqlPort, projectRoot: process.cwd() })
- started = true
- }
- })
-
- return subprocess.then(() => {})
}
diff --git a/packages/gatsby-core-utils/src/service-lock.ts b/packages/gatsby-core-utils/src/service-lock.ts
index 1c1b282a12618..1ce4ad9087968 100644
--- a/packages/gatsby-core-utils/src/service-lock.ts
+++ b/packages/gatsby-core-utils/src/service-lock.ts
@@ -25,6 +25,11 @@ const DATA_FILE_EXTENSION = `.json`
const getDataFilePath = (siteDir: string, serviceName: string): string =>
path.join(siteDir, `${serviceName}${DATA_FILE_EXTENSION}`)
+const lockfileOptions = {
+ // Use the minimum stale duration
+ stale: 5000,
+}
+
type UnlockFn = () => Promise
const memoryServices = {}
@@ -53,10 +58,7 @@ export const createServiceLock = async (
try {
await fs.writeFile(serviceDataFile, JSON.stringify(content))
- const unlock = await lockfile.lock(serviceDataFile, {
- // Use the minimum stale duration
- stale: 5000,
- })
+ const unlock = await lockfile.lock(serviceDataFile, lockfileOptions)
return unlock
} catch (err) {
@@ -71,11 +73,16 @@ export const getService = async (
if (isCI()) return memoryServices[serviceName] || null
const siteDir = getSiteDir(programPath)
+ const serviceDataFile = getDataFilePath(siteDir, serviceName)
try {
- return JSON.parse(
- await fs.readFile(getDataFilePath(siteDir, serviceName), `utf8`)
- )
+ if (await lockfile.check(serviceDataFile, lockfileOptions)) {
+ return JSON.parse(
+ await fs.readFile(serviceDataFile, `utf8`).catch(() => `null`)
+ )
+ }
+
+ return null
} catch (err) {
return null
}
diff --git a/packages/gatsby-recipes/index.js b/packages/gatsby-recipes/index.js
deleted file mode 100644
index 172f1ae6a468c..0000000000000
--- a/packages/gatsby-recipes/index.js
+++ /dev/null
@@ -1 +0,0 @@
-// noop
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index fcd6750db2f34..37c260da27044 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -3,6 +3,7 @@
"description": "Core functionality for Gatsby Recipes",
"version": "0.1.25",
"author": "Kyle Mathews ",
+ "main": "dist/index.js",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
diff --git a/packages/gatsby-recipes/src/cli.js b/packages/gatsby-recipes/src/cli.js
index 985bb2af38b23..5ac08fccbdc3c 100644
--- a/packages/gatsby-recipes/src/cli.js
+++ b/packages/gatsby-recipes/src/cli.js
@@ -289,7 +289,7 @@ log(
`======================================= ${new Date().toJSON()}`
)
-module.exports = ({ recipe, graphqlPort, projectRoot }) => {
+module.exports = async ({ recipe, graphqlPort, projectRoot }) => {
try {
const GRAPHQL_ENDPOINT = `http://localhost:${graphqlPort}/graphql`
@@ -606,7 +606,8 @@ module.exports = ({ recipe, graphqlPort, projectRoot }) => {
const Recipe = () =>
// Enable experimental mode for more efficient reconciler and renderer
- render(, { experimental: true })
+ const { waitUntilExit } = render(, { experimental: true })
+ await waitUntilExit()
} catch (e) {
log(e)
}
diff --git a/packages/gatsby-recipes/src/graphql-server/index.js b/packages/gatsby-recipes/src/graphql-server/index.js
new file mode 100644
index 0000000000000..ffbea8e064c1f
--- /dev/null
+++ b/packages/gatsby-recipes/src/graphql-server/index.js
@@ -0,0 +1,54 @@
+const execa = require(`execa`)
+const path = require(`path`)
+const fs = require(`fs`)
+const detectPort = require(`detect-port`)
+const {
+ getService,
+ createServiceLock,
+} = require(`gatsby-core-utils/dist/service-lock`)
+
+// NOTE(@mxstbr): The forceStart boolean enforces us to start the recipes graphql server
+// even if another instance might already be running. This is necessary to ensure the gatsby
+// develop command does not _not_ run the server if the user is running gatsby recipes at the same time.
+exports.startGraphQLServer = async (programPath, forceStart) => {
+ let { port } = (await getService(programPath, `recipesgraphqlserver`)) || {}
+
+ if (!port || forceStart) {
+ port = await detectPort(4000)
+ await createServiceLock(programPath, `recipesgraphqlserver`, { port })
+
+ const subprocess = execa(`node`, [require.resolve(`./server.js`), port], {
+ all: true,
+ env: {
+ // Chalk doesn't want to output color in a child process
+ // as it (correctly) thinks it's not in a normal terminal environemnt.
+ // Since we're just returning data, we'll override that.
+ FORCE_COLOR: `true`,
+ },
+ })
+
+ // eslint-disable-next-line no-unused-expressions
+ subprocess.stderr?.on(`data`, data => {
+ console.log(data.toString())
+ })
+
+ process.on(`exit`, () => {
+ subprocess.kill(`SIGTERM`, {
+ forceKillAfterTimeout: 2000,
+ })
+ })
+
+ // Log server output to a file.
+ if (process.env.DEBUG) {
+ const logFile = path.resolve(`./recipe-server.log`)
+ fs.writeFileSync(logFile, `\n-----\n${new Date().toJSON()}\n`)
+ const writeStream = fs.createWriteStream(logFile, { flags: `a` })
+ // eslint-disable-next-line no-unused-expressions
+ subprocess.stdout?.pipe(writeStream)
+ }
+ }
+
+ return {
+ port,
+ }
+}
diff --git a/packages/gatsby-recipes/src/graphql.js b/packages/gatsby-recipes/src/graphql-server/server.js
similarity index 97%
rename from packages/gatsby-recipes/src/graphql.js
rename to packages/gatsby-recipes/src/graphql-server/server.js
index e216284dd440c..6bd268a0d91a3 100644
--- a/packages/gatsby-recipes/src/graphql.js
+++ b/packages/gatsby-recipes/src/graphql-server/server.js
@@ -14,8 +14,8 @@ const { interpret } = require(`xstate`)
const pkgDir = require(`pkg-dir`)
const cors = require(`cors`)
-const recipeMachine = require(`./recipe-machine`)
-const createTypes = require(`./create-types`)
+const recipeMachine = require(`../recipe-machine`)
+const createTypes = require(`../create-types`)
const SITE_ROOT = pkgDir.sync(process.cwd())
diff --git a/packages/gatsby-recipes/src/index.js b/packages/gatsby-recipes/src/index.js
index c8aae860e2ec0..4b0541b4d8745 100644
--- a/packages/gatsby-recipes/src/index.js
+++ b/packages/gatsby-recipes/src/index.js
@@ -1,4 +1,9 @@
-module.exports = recipe => {
+export { startGraphQLServer } from "./graphql-server"
+
+// data = { recipe?: string, graphqlPort: number, projectRoot: string }
+const recipesHandler = async data => {
const cli = require(`import-jsx`)(require.resolve(`./cli`))
- cli(recipe)
+ return cli(data)
}
+
+export default recipesHandler
From e3c4efcbae6f5eab377a40bc88f45511f7c02c80 Mon Sep 17 00:00:00 2001
From: Max Stoiber
Date: Fri, 22 May 2020 08:42:59 +0200
Subject: [PATCH 015/288] chore(release): Publish
- babel-preset-gatsby@0.4.7
- gatsby-admin@0.1.48
- gatsby-cli@2.12.32
- gatsby-core-utils@1.3.3
- gatsby-page-utils@0.2.7
- gatsby-plugin-manifest@2.4.9
- gatsby-plugin-mdx@1.2.12
- gatsby-plugin-offline@3.2.7
- gatsby-plugin-page-creator@2.3.7
- gatsby-plugin-preload-fonts@1.2.8
- gatsby-plugin-sharp@2.6.9
- gatsby-recipes@0.1.26
- gatsby-remark-images@3.3.8
- gatsby-source-contentful@2.3.12
- gatsby-source-drupal@3.5.9
- gatsby-source-filesystem@2.3.8
- gatsby-source-shopify@3.2.8
- gatsby-source-wordpress@3.3.8
- gatsby-telemetry@1.3.9
- gatsby-theme-blog-core@1.5.23
- gatsby-theme-blog@1.6.23
- gatsby-theme-notes@1.3.49
- gatsby-theme-ui-preset@0.0.38
- gatsby-transformer-remark@2.8.13
- gatsby-transformer-sqip@2.3.9
- gatsby@2.22.7
---
packages/babel-preset-gatsby/CHANGELOG.md | 4 ++++
packages/babel-preset-gatsby/package.json | 4 ++--
packages/gatsby-admin/CHANGELOG.md | 4 ++++
packages/gatsby-admin/package.json | 4 ++--
packages/gatsby-cli/CHANGELOG.md | 4 ++++
packages/gatsby-cli/package.json | 8 ++++----
packages/gatsby-core-utils/CHANGELOG.md | 4 ++++
packages/gatsby-core-utils/package.json | 2 +-
packages/gatsby-page-utils/CHANGELOG.md | 4 ++++
packages/gatsby-page-utils/package.json | 4 ++--
packages/gatsby-plugin-manifest/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-manifest/package.json | 4 ++--
packages/gatsby-plugin-mdx/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-mdx/package.json | 4 ++--
packages/gatsby-plugin-offline/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-offline/package.json | 4 ++--
packages/gatsby-plugin-page-creator/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-page-creator/package.json | 4 ++--
packages/gatsby-plugin-preload-fonts/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-preload-fonts/package.json | 4 ++--
packages/gatsby-plugin-sharp/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-sharp/package.json | 4 ++--
packages/gatsby-recipes/CHANGELOG.md | 4 ++++
packages/gatsby-recipes/package.json | 6 +++---
packages/gatsby-remark-images/CHANGELOG.md | 4 ++++
packages/gatsby-remark-images/package.json | 4 ++--
packages/gatsby-source-contentful/CHANGELOG.md | 4 ++++
packages/gatsby-source-contentful/package.json | 8 ++++----
packages/gatsby-source-drupal/CHANGELOG.md | 4 ++++
packages/gatsby-source-drupal/package.json | 4 ++--
packages/gatsby-source-filesystem/CHANGELOG.md | 4 ++++
packages/gatsby-source-filesystem/package.json | 4 ++--
packages/gatsby-source-shopify/CHANGELOG.md | 4 ++++
packages/gatsby-source-shopify/package.json | 4 ++--
packages/gatsby-source-wordpress/CHANGELOG.md | 4 ++++
packages/gatsby-source-wordpress/package.json | 4 ++--
packages/gatsby-telemetry/CHANGELOG.md | 4 ++++
packages/gatsby-telemetry/package.json | 4 ++--
packages/gatsby-theme-blog-core/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog-core/package.json | 14 +++++++-------
packages/gatsby-theme-blog/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog/package.json | 6 +++---
packages/gatsby-theme-notes/CHANGELOG.md | 4 ++++
packages/gatsby-theme-notes/package.json | 10 +++++-----
packages/gatsby-theme-ui-preset/CHANGELOG.md | 4 ++++
packages/gatsby-theme-ui-preset/package.json | 4 ++--
packages/gatsby-transformer-remark/CHANGELOG.md | 4 ++++
packages/gatsby-transformer-remark/package.json | 4 ++--
packages/gatsby-transformer-sqip/CHANGELOG.md | 4 ++++
packages/gatsby-transformer-sqip/package.json | 4 ++--
packages/gatsby/CHANGELOG.md | 4 ++++
packages/gatsby/package.json | 12 ++++++------
52 files changed, 173 insertions(+), 69 deletions(-)
diff --git a/packages/babel-preset-gatsby/CHANGELOG.md b/packages/babel-preset-gatsby/CHANGELOG.md
index d4b0630060a3a..673f41809d028 100644
--- a/packages/babel-preset-gatsby/CHANGELOG.md
+++ b/packages/babel-preset-gatsby/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.4.7](https://github.com/gatsbyjs/gatsby/compare/babel-preset-gatsby@0.4.6...babel-preset-gatsby@0.4.7) (2020-05-22)
+
+**Note:** Version bump only for package babel-preset-gatsby
+
## [0.4.6](https://github.com/gatsbyjs/gatsby/compare/babel-preset-gatsby@0.4.5...babel-preset-gatsby@0.4.6) (2020-05-20)
**Note:** Version bump only for package babel-preset-gatsby
diff --git a/packages/babel-preset-gatsby/package.json b/packages/babel-preset-gatsby/package.json
index eb6d3e49945c8..5bc62b83086ac 100644
--- a/packages/babel-preset-gatsby/package.json
+++ b/packages/babel-preset-gatsby/package.json
@@ -1,6 +1,6 @@
{
"name": "babel-preset-gatsby",
- "version": "0.4.6",
+ "version": "0.4.7",
"author": "Philipp Spiess ",
"repository": {
"type": "git",
@@ -21,7 +21,7 @@
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-macros": "^2.8.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
- "gatsby-core-utils": "^1.3.2"
+ "gatsby-core-utils": "^1.3.3"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
diff --git a/packages/gatsby-admin/CHANGELOG.md b/packages/gatsby-admin/CHANGELOG.md
index e306942476010..a6b2a9f8db53e 100644
--- a/packages/gatsby-admin/CHANGELOG.md
+++ b/packages/gatsby-admin/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.48](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.47...gatsby-admin@0.1.48) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-admin
+
## [0.1.47](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.46...gatsby-admin@0.1.47) (2020-05-21)
**Note:** Version bump only for package gatsby-admin
diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json
index 1bd76889189e3..58e6bfe4b2ce7 100644
--- a/packages/gatsby-admin/package.json
+++ b/packages/gatsby-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
- "version": "0.1.47",
+ "version": "0.1.48",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -8,7 +8,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
- "gatsby": "^2.22.6",
+ "gatsby": "^2.22.7",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-source-graphql": "^2.5.2",
"react": "^16.12.0",
diff --git a/packages/gatsby-cli/CHANGELOG.md b/packages/gatsby-cli/CHANGELOG.md
index 8b2191b46bbfc..3e7f878f5b4f8 100644
--- a/packages/gatsby-cli/CHANGELOG.md
+++ b/packages/gatsby-cli/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.12.32](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.31...gatsby-cli@2.12.32) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-cli
+
## [2.12.31](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.30...gatsby-cli@2.12.31) (2020-05-21)
**Note:** Version bump only for package gatsby-cli
diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json
index c00f2063f5b21..d3ae4e1bb061a 100644
--- a/packages/gatsby-cli/package.json
+++ b/packages/gatsby-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
- "version": "2.12.31",
+ "version": "2.12.32",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "lib/index.js"
@@ -25,9 +25,9 @@
"execa": "^3.4.0",
"fs-exists-cached": "^1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
- "gatsby-recipes": "^0.1.25",
- "gatsby-telemetry": "^1.3.8",
+ "gatsby-core-utils": "^1.3.3",
+ "gatsby-recipes": "^0.1.26",
+ "gatsby-telemetry": "^1.3.9",
"hosted-git-info": "^3.0.4",
"is-valid-path": "^0.1.1",
"lodash": "^4.17.15",
diff --git a/packages/gatsby-core-utils/CHANGELOG.md b/packages/gatsby-core-utils/CHANGELOG.md
index ff351e9f5bfb1..0aaa5437190a3 100644
--- a/packages/gatsby-core-utils/CHANGELOG.md
+++ b/packages/gatsby-core-utils/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.3](https://github.com/gatsbyjs/gatsby/compare/gatsby-core-utils@1.3.2...gatsby-core-utils@1.3.3) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-core-utils
+
## [1.3.2](https://github.com/gatsbyjs/gatsby/compare/gatsby-core-utils@1.3.1...gatsby-core-utils@1.3.2) (2020-05-20)
**Note:** Version bump only for package gatsby-core-utils
diff --git a/packages/gatsby-core-utils/package.json b/packages/gatsby-core-utils/package.json
index 6b01b04031713..d3646cab3bfe4 100644
--- a/packages/gatsby-core-utils/package.json
+++ b/packages/gatsby-core-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-core-utils",
- "version": "1.3.2",
+ "version": "1.3.3",
"description": "A collection of gatsby utils used in different gatsby packages",
"keywords": [
"gatsby",
diff --git a/packages/gatsby-page-utils/CHANGELOG.md b/packages/gatsby-page-utils/CHANGELOG.md
index e54d90efedab4..3ea98ee2a787a 100644
--- a/packages/gatsby-page-utils/CHANGELOG.md
+++ b/packages/gatsby-page-utils/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.2.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-page-utils@0.2.6...gatsby-page-utils@0.2.7) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-page-utils
+
## [0.2.6](https://github.com/gatsbyjs/gatsby/compare/gatsby-page-utils@0.2.5...gatsby-page-utils@0.2.6) (2020-05-20)
**Note:** Version bump only for package gatsby-page-utils
diff --git a/packages/gatsby-page-utils/package.json b/packages/gatsby-page-utils/package.json
index f97e86f0266d1..3fe511a05afdb 100644
--- a/packages/gatsby-page-utils/package.json
+++ b/packages/gatsby-page-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-page-utils",
- "version": "0.2.6",
+ "version": "0.2.7",
"description": "Gatsby library that helps creating pages",
"main": "dist/index.js",
"scripts": {
@@ -24,7 +24,7 @@
"bluebird": "^3.7.2",
"chokidar": "3.4.0",
"fs-exists-cached": "^1.0.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"glob": "^7.1.6",
"lodash": "^4.17.15",
"micromatch": "^3.1.10"
diff --git a/packages/gatsby-plugin-manifest/CHANGELOG.md b/packages/gatsby-plugin-manifest/CHANGELOG.md
index 7dfc90a2fab42..8827c5eb56b5e 100644
--- a/packages/gatsby-plugin-manifest/CHANGELOG.md
+++ b/packages/gatsby-plugin-manifest/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.4.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-manifest@2.4.8...gatsby-plugin-manifest@2.4.9) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-manifest
+
## [2.4.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-manifest@2.4.7...gatsby-plugin-manifest@2.4.8) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-manifest
diff --git a/packages/gatsby-plugin-manifest/package.json b/packages/gatsby-plugin-manifest/package.json
index bfa8367dc2fab..02d2892ff4825 100644
--- a/packages/gatsby-plugin-manifest/package.json
+++ b/packages/gatsby-plugin-manifest/package.json
@@ -1,14 +1,14 @@
{
"name": "gatsby-plugin-manifest",
"description": "Gatsby plugin which adds a manifest.webmanifest to make sites progressive web apps",
- "version": "2.4.8",
+ "version": "2.4.9",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
"dependencies": {
"@babel/runtime": "^7.9.6",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"semver": "^5.7.1",
"sharp": "^0.25.1"
},
diff --git a/packages/gatsby-plugin-mdx/CHANGELOG.md b/packages/gatsby-plugin-mdx/CHANGELOG.md
index ef38a25e6ad31..e8fa3cc92f7b5 100644
--- a/packages/gatsby-plugin-mdx/CHANGELOG.md
+++ b/packages/gatsby-plugin-mdx/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.2.12](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-mdx@1.2.11...gatsby-plugin-mdx@1.2.12) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-mdx
+
## [1.2.11](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-mdx@1.2.10...gatsby-plugin-mdx@1.2.11) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-mdx
diff --git a/packages/gatsby-plugin-mdx/package.json b/packages/gatsby-plugin-mdx/package.json
index 115b910eca2d7..2ea3cb860acce 100644
--- a/packages/gatsby-plugin-mdx/package.json
+++ b/packages/gatsby-plugin-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-mdx",
- "version": "1.2.11",
+ "version": "1.2.12",
"description": "MDX integration for Gatsby",
"main": "index.js",
"license": "MIT",
@@ -33,7 +33,7 @@
"escape-string-regexp": "^1.0.5",
"eval": "^0.1.4",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"gray-matter": "^4.0.2",
"json5": "^2.1.3",
"loader-utils": "^1.4.0",
diff --git a/packages/gatsby-plugin-offline/CHANGELOG.md b/packages/gatsby-plugin-offline/CHANGELOG.md
index 43fea8602c8da..fe1ef126680e9 100644
--- a/packages/gatsby-plugin-offline/CHANGELOG.md
+++ b/packages/gatsby-plugin-offline/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.2.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-offline@3.2.6...gatsby-plugin-offline@3.2.7) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-offline
+
## [3.2.6](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-offline@3.2.5...gatsby-plugin-offline@3.2.6) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-offline
diff --git a/packages/gatsby-plugin-offline/package.json b/packages/gatsby-plugin-offline/package.json
index e6929f4312378..6b49931b565b9 100644
--- a/packages/gatsby-plugin-offline/package.json
+++ b/packages/gatsby-plugin-offline/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-offline",
"description": "Gatsby plugin which sets up a site to be able to run offline",
- "version": "3.2.6",
+ "version": "3.2.7",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -9,7 +9,7 @@
"dependencies": {
"@babel/runtime": "^7.9.6",
"cheerio": "^1.0.0-rc.3",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"glob": "^7.1.6",
"idb-keyval": "^3.2.0",
"lodash": "^4.17.15",
diff --git a/packages/gatsby-plugin-page-creator/CHANGELOG.md b/packages/gatsby-plugin-page-creator/CHANGELOG.md
index 1f9473619926a..91f23a071ca6a 100644
--- a/packages/gatsby-plugin-page-creator/CHANGELOG.md
+++ b/packages/gatsby-plugin-page-creator/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.3.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-page-creator@2.3.6...gatsby-plugin-page-creator@2.3.7) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-page-creator
+
## [2.3.6](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-page-creator@2.3.5...gatsby-plugin-page-creator@2.3.6) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-page-creator
diff --git a/packages/gatsby-plugin-page-creator/package.json b/packages/gatsby-plugin-page-creator/package.json
index ebdf6a09f2c34..66b01100df8ad 100644
--- a/packages/gatsby-plugin-page-creator/package.json
+++ b/packages/gatsby-plugin-page-creator/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-page-creator",
- "version": "2.3.6",
+ "version": "2.3.7",
"description": "Gatsby plugin that automatically creates pages from React components in specified directories",
"main": "index.js",
"scripts": {
@@ -27,7 +27,7 @@
"@babel/runtime": "^7.9.6",
"bluebird": "^3.7.2",
"fs-exists-cached": "^1.0.0",
- "gatsby-page-utils": "^0.2.6",
+ "gatsby-page-utils": "^0.2.7",
"glob": "^7.1.6",
"lodash": "^4.17.15",
"micromatch": "^3.1.10"
diff --git a/packages/gatsby-plugin-preload-fonts/CHANGELOG.md b/packages/gatsby-plugin-preload-fonts/CHANGELOG.md
index 31343e17c7bb2..5f5000da607d4 100644
--- a/packages/gatsby-plugin-preload-fonts/CHANGELOG.md
+++ b/packages/gatsby-plugin-preload-fonts/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.2.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-preload-fonts@1.2.7...gatsby-plugin-preload-fonts@1.2.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-preload-fonts
+
## [1.2.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-preload-fonts@1.2.6...gatsby-plugin-preload-fonts@1.2.7) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-preload-fonts
diff --git a/packages/gatsby-plugin-preload-fonts/package.json b/packages/gatsby-plugin-preload-fonts/package.json
index 137d2d432b9b8..b2aeb79db7ce3 100644
--- a/packages/gatsby-plugin-preload-fonts/package.json
+++ b/packages/gatsby-plugin-preload-fonts/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-preload-fonts",
"description": "Gatsby plugin for preloading fonts per page",
- "version": "1.2.7",
+ "version": "1.2.8",
"author": "Aaron Ross ",
"main": "index.js",
"bin": {
@@ -14,7 +14,7 @@
"chalk": "^2.4.2",
"date-fns": "^2.14.0",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"graphql-request": "^1.8.2",
"progress": "^2.0.3",
"puppeteer": "^1.20.0"
diff --git a/packages/gatsby-plugin-sharp/CHANGELOG.md b/packages/gatsby-plugin-sharp/CHANGELOG.md
index 86fc355d65f35..dce7569174f4d 100644
--- a/packages/gatsby-plugin-sharp/CHANGELOG.md
+++ b/packages/gatsby-plugin-sharp/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.6.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-sharp@2.6.8...gatsby-plugin-sharp@2.6.9) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-sharp
+
## [2.6.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-sharp@2.6.7...gatsby-plugin-sharp@2.6.8) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-sharp
diff --git a/packages/gatsby-plugin-sharp/package.json b/packages/gatsby-plugin-sharp/package.json
index 36563c6cb2a7c..712c80e8d4e0f 100644
--- a/packages/gatsby-plugin-sharp/package.json
+++ b/packages/gatsby-plugin-sharp/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-sharp",
"description": "Wrapper of the Sharp image manipulation library for Gatsby plugins",
- "version": "2.6.8",
+ "version": "2.6.9",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -11,7 +11,7 @@
"async": "^2.6.3",
"bluebird": "^3.7.2",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"got": "^8.3.2",
"imagemin": "^6.1.0",
"imagemin-mozjpeg": "^8.0.0",
diff --git a/packages/gatsby-recipes/CHANGELOG.md b/packages/gatsby-recipes/CHANGELOG.md
index 3d11126436b6a..198ab78f33e5f 100644
--- a/packages/gatsby-recipes/CHANGELOG.md
+++ b/packages/gatsby-recipes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.26](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.25...gatsby-recipes@0.1.26) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-recipes
+
## [0.1.25](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.24...gatsby-recipes@0.1.25) (2020-05-21)
### Features
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 37c260da27044..181bf6b519872 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-recipes",
"description": "Core functionality for Gatsby Recipes",
- "version": "0.1.25",
+ "version": "0.1.26",
"author": "Kyle Mathews ",
"main": "dist/index.js",
"bugs": {
@@ -26,8 +26,8 @@
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
- "gatsby-telemetry": "^1.3.8",
+ "gatsby-core-utils": "^1.3.3",
+ "gatsby-telemetry": "^1.3.9",
"glob": "^7.1.6",
"graphql": "^14.6.0",
"graphql-compose": "^6.3.8",
diff --git a/packages/gatsby-remark-images/CHANGELOG.md b/packages/gatsby-remark-images/CHANGELOG.md
index f0dab8fec11ca..23992a840e445 100644
--- a/packages/gatsby-remark-images/CHANGELOG.md
+++ b/packages/gatsby-remark-images/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.3.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-remark-images@3.3.7...gatsby-remark-images@3.3.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-remark-images
+
## [3.3.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-remark-images@3.3.6...gatsby-remark-images@3.3.7) (2020-05-20)
**Note:** Version bump only for package gatsby-remark-images
diff --git a/packages/gatsby-remark-images/package.json b/packages/gatsby-remark-images/package.json
index bd81b00f2921e..725cdd222e209 100644
--- a/packages/gatsby-remark-images/package.json
+++ b/packages/gatsby-remark-images/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-remark-images",
"description": "Processes images in markdown so they can be used in the production build.",
- "version": "3.3.7",
+ "version": "3.3.8",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -10,7 +10,7 @@
"@babel/runtime": "^7.9.6",
"chalk": "^2.4.2",
"cheerio": "^1.0.0-rc.3",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"is-relative-url": "^3.0.0",
"lodash": "^4.17.15",
"mdast-util-definitions": "^1.2.5",
diff --git a/packages/gatsby-source-contentful/CHANGELOG.md b/packages/gatsby-source-contentful/CHANGELOG.md
index 7e9d93438a2dd..cd5c5471d4379 100644
--- a/packages/gatsby-source-contentful/CHANGELOG.md
+++ b/packages/gatsby-source-contentful/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.3.12](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-contentful@2.3.11...gatsby-source-contentful@2.3.12) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-source-contentful
+
## [2.3.11](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-contentful@2.3.10...gatsby-source-contentful@2.3.11) (2020-05-20)
### Bug Fixes
diff --git a/packages/gatsby-source-contentful/package.json b/packages/gatsby-source-contentful/package.json
index f5868011f6b10..53761740f408b 100644
--- a/packages/gatsby-source-contentful/package.json
+++ b/packages/gatsby-source-contentful/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-contentful",
"description": "Gatsby source plugin for building websites using the Contentful CMS as a data source",
- "version": "2.3.11",
+ "version": "2.3.12",
"author": "Marcus Ericsson (mericsson.com)",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -17,9 +17,9 @@
"contentful": "^7.14.4",
"deep-map": "^1.5.0",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
- "gatsby-plugin-sharp": "^2.6.8",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-core-utils": "^1.3.3",
+ "gatsby-plugin-sharp": "^2.6.9",
+ "gatsby-source-filesystem": "^2.3.8",
"is-online": "^8.3.1",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.15",
diff --git a/packages/gatsby-source-drupal/CHANGELOG.md b/packages/gatsby-source-drupal/CHANGELOG.md
index 1061f99701224..9479b957591cc 100644
--- a/packages/gatsby-source-drupal/CHANGELOG.md
+++ b/packages/gatsby-source-drupal/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.5.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-drupal@3.5.8...gatsby-source-drupal@3.5.9) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-source-drupal
+
## [3.5.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-drupal@3.5.7...gatsby-source-drupal@3.5.8) (2020-05-21)
### Bug Fixes
diff --git a/packages/gatsby-source-drupal/package.json b/packages/gatsby-source-drupal/package.json
index cd86757866552..8e42f5b2ed675 100644
--- a/packages/gatsby-source-drupal/package.json
+++ b/packages/gatsby-source-drupal/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-drupal",
"description": "Gatsby source plugin for building websites using the Drupal CMS as a data source",
- "version": "3.5.8",
+ "version": "3.5.9",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -11,7 +11,7 @@
"axios": "^0.19.2",
"bluebird": "^3.7.2",
"body-parser": "^1.19.0",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-source-filesystem": "^2.3.8",
"lodash": "^4.17.15",
"tiny-async-pool": "^1.1.0"
},
diff --git a/packages/gatsby-source-filesystem/CHANGELOG.md b/packages/gatsby-source-filesystem/CHANGELOG.md
index 2a02f77f58468..3339e3681a628 100644
--- a/packages/gatsby-source-filesystem/CHANGELOG.md
+++ b/packages/gatsby-source-filesystem/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.3.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-filesystem@2.3.7...gatsby-source-filesystem@2.3.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-source-filesystem
+
## [2.3.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-filesystem@2.3.6...gatsby-source-filesystem@2.3.7) (2020-05-20)
**Note:** Version bump only for package gatsby-source-filesystem
diff --git a/packages/gatsby-source-filesystem/package.json b/packages/gatsby-source-filesystem/package.json
index 84f8fc1d123e8..bd6846bc845b8 100644
--- a/packages/gatsby-source-filesystem/package.json
+++ b/packages/gatsby-source-filesystem/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-filesystem",
"description": "Gatsby plugin which parses files within a directory for further parsing by other plugins",
- "version": "2.3.7",
+ "version": "2.3.8",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -13,7 +13,7 @@
"chokidar": "3.4.0",
"file-type": "^12.4.2",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"got": "^9.6.0",
"md5-file": "^3.2.3",
"mime": "^2.4.5",
diff --git a/packages/gatsby-source-shopify/CHANGELOG.md b/packages/gatsby-source-shopify/CHANGELOG.md
index ffaa736580626..a9a1e6d90ef08 100644
--- a/packages/gatsby-source-shopify/CHANGELOG.md
+++ b/packages/gatsby-source-shopify/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.2.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-shopify@3.2.7...gatsby-source-shopify@3.2.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-source-shopify
+
## [3.2.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-shopify@3.2.6...gatsby-source-shopify@3.2.7) (2020-05-20)
**Note:** Version bump only for package gatsby-source-shopify
diff --git a/packages/gatsby-source-shopify/package.json b/packages/gatsby-source-shopify/package.json
index 4d0ba6905c78f..e0250830df78b 100644
--- a/packages/gatsby-source-shopify/package.json
+++ b/packages/gatsby-source-shopify/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-source-shopify",
- "version": "3.2.7",
+ "version": "3.2.8",
"description": "Gatsby source plugin for building websites using Shopfiy as a data source.",
"scripts": {
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
@@ -36,7 +36,7 @@
"babel-preset-gatsby-package": "^0.4.2",
"chalk": "^2.4.2",
"gatsby-node-helpers": "^0.3.0",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-source-filesystem": "^2.3.8",
"graphql-request": "^1.8.2",
"lodash": "^4.17.15",
"p-iteration": "^1.1.8",
diff --git a/packages/gatsby-source-wordpress/CHANGELOG.md b/packages/gatsby-source-wordpress/CHANGELOG.md
index e8b1f86d7c63d..90a1d479c9481 100644
--- a/packages/gatsby-source-wordpress/CHANGELOG.md
+++ b/packages/gatsby-source-wordpress/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.3.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-wordpress@3.3.7...gatsby-source-wordpress@3.3.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-source-wordpress
+
## [3.3.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-source-wordpress@3.3.6...gatsby-source-wordpress@3.3.7) (2020-05-20)
**Note:** Version bump only for package gatsby-source-wordpress
diff --git a/packages/gatsby-source-wordpress/package.json b/packages/gatsby-source-wordpress/package.json
index b8ae7adfdf156..e424aa129d029 100644
--- a/packages/gatsby-source-wordpress/package.json
+++ b/packages/gatsby-source-wordpress/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-wordpress",
"description": "Gatsby source plugin for building websites using the WordPress CMS as a data source.",
- "version": "3.3.7",
+ "version": "3.3.8",
"author": "Sebastien Fichot ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -14,7 +14,7 @@
"bluebird": "^3.7.2",
"deep-map": "^1.5.0",
"deep-map-keys": "^1.2.0",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-source-filesystem": "^2.3.8",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.15",
"minimatch": "^3.0.4",
diff --git a/packages/gatsby-telemetry/CHANGELOG.md b/packages/gatsby-telemetry/CHANGELOG.md
index 05001e090f37a..abc525edecff3 100644
--- a/packages/gatsby-telemetry/CHANGELOG.md
+++ b/packages/gatsby-telemetry/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-telemetry@1.3.8...gatsby-telemetry@1.3.9) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-telemetry
+
## [1.3.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-telemetry@1.3.7...gatsby-telemetry@1.3.8) (2020-05-20)
**Note:** Version bump only for package gatsby-telemetry
diff --git a/packages/gatsby-telemetry/package.json b/packages/gatsby-telemetry/package.json
index bf4c9c7581073..7d6ffe7f8266a 100644
--- a/packages/gatsby-telemetry/package.json
+++ b/packages/gatsby-telemetry/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-telemetry",
"description": "Gatsby Telemetry",
- "version": "1.3.8",
+ "version": "1.3.9",
"author": "Jarmo Isotalo ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -14,7 +14,7 @@
"configstore": "^5.0.1",
"envinfo": "^7.5.1",
"fs-extra": "^8.1.0",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"git-up": "4.0.1",
"is-docker": "2.0.0",
"lodash": "^4.17.15",
diff --git a/packages/gatsby-theme-blog-core/CHANGELOG.md b/packages/gatsby-theme-blog-core/CHANGELOG.md
index ed21b1c986a75..7767f1048c5c9 100644
--- a/packages/gatsby-theme-blog-core/CHANGELOG.md
+++ b/packages/gatsby-theme-blog-core/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.5.23](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.22...gatsby-theme-blog-core@1.5.23) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog-core
+
## [1.5.22](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.21...gatsby-theme-blog-core@1.5.22) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-blog-core
diff --git a/packages/gatsby-theme-blog-core/package.json b/packages/gatsby-theme-blog-core/package.json
index a1efaf07a4dd2..0afd7a295fabb 100644
--- a/packages/gatsby-theme-blog-core/package.json
+++ b/packages/gatsby-theme-blog-core/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog-core",
- "version": "1.5.22",
+ "version": "1.5.23",
"main": "index.js",
"author": "christopherbiscardi (@chrisbiscardi)",
"license": "MIT",
@@ -18,19 +18,19 @@
},
"dependencies": {
"@mdx-js/mdx": "^1.6.1",
- "gatsby-core-utils": "^1.3.2",
- "gatsby-plugin-mdx": "^1.2.11",
- "gatsby-plugin-sharp": "^2.6.8",
+ "gatsby-core-utils": "^1.3.3",
+ "gatsby-plugin-mdx": "^1.2.12",
+ "gatsby-plugin-sharp": "^2.6.9",
"gatsby-remark-copy-linked-files": "^2.3.3",
- "gatsby-remark-images": "^3.3.7",
+ "gatsby-remark-images": "^3.3.8",
"gatsby-remark-smartypants": "^2.3.2",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-source-filesystem": "^2.3.8",
"gatsby-transformer-sharp": "^2.5.3",
"remark-slug": "^5.1.2"
},
"devDependencies": {
"@mdx-js/react": "^1.6.1",
- "gatsby": "^2.22.6",
+ "gatsby": "^2.22.7",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-blog/CHANGELOG.md b/packages/gatsby-theme-blog/CHANGELOG.md
index df4bb85ab226a..93e4a1afdbc37 100644
--- a/packages/gatsby-theme-blog/CHANGELOG.md
+++ b/packages/gatsby-theme-blog/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.6.23](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.22...gatsby-theme-blog@1.6.23) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog
+
## [1.6.22](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.21...gatsby-theme-blog@1.6.22) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-blog
diff --git a/packages/gatsby-theme-blog/package.json b/packages/gatsby-theme-blog/package.json
index 2d9ca082e1505..6659a9ff837a1 100644
--- a/packages/gatsby-theme-blog/package.json
+++ b/packages/gatsby-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog",
- "version": "1.6.22",
+ "version": "1.6.23",
"description": "A Gatsby theme for miscellaneous blogging with a dark/light mode",
"main": "index.js",
"keywords": [
@@ -29,7 +29,7 @@
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-theme-ui": "^0.2.53",
"gatsby-plugin-twitter": "^2.3.2",
- "gatsby-theme-blog-core": "^1.5.22",
+ "gatsby-theme-blog-core": "^1.5.23",
"mdx-utils": "0.2.0",
"react-helmet": "^5.2.1",
"react-switch": "^5.0.1",
@@ -39,7 +39,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.6",
+ "gatsby": "^2.22.7",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-notes/CHANGELOG.md b/packages/gatsby-theme-notes/CHANGELOG.md
index 431111dcb5568..417a8626197db 100644
--- a/packages/gatsby-theme-notes/CHANGELOG.md
+++ b/packages/gatsby-theme-notes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.49](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.48...gatsby-theme-notes@1.3.49) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-notes
+
## [1.3.48](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.47...gatsby-theme-notes@1.3.48) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-notes
diff --git a/packages/gatsby-theme-notes/package.json b/packages/gatsby-theme-notes/package.json
index 10985e2427d0c..df8f97375d4fd 100644
--- a/packages/gatsby-theme-notes/package.json
+++ b/packages/gatsby-theme-notes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-theme-notes",
"description": "Gatsby Theme for adding a notes section to your website",
- "version": "1.3.48",
+ "version": "1.3.49",
"author": "John Otander",
"license": "MIT",
"main": "index.js",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-notes#readme",
"devDependencies": {
- "gatsby": "^2.22.6",
+ "gatsby": "^2.22.7",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
@@ -36,14 +36,14 @@
"@theme-ui/prism": "^0.2.50",
"@theme-ui/typography": "^0.2.46",
"deepmerge": "^4.2.2",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"gatsby-plugin-compile-es6-packages": "^2.1.0",
"gatsby-plugin-emotion": "^4.3.2",
- "gatsby-plugin-mdx": "^1.2.11",
+ "gatsby-plugin-mdx": "^1.2.12",
"gatsby-plugin-meta-redirect": "^1.1.1",
"gatsby-plugin-redirects": "^1.0.0",
"gatsby-plugin-theme-ui": "^0.2.53",
- "gatsby-source-filesystem": "^2.3.7",
+ "gatsby-source-filesystem": "^2.3.8",
"is-present": "^1.0.0",
"react-feather": "^1.1.6",
"theme-ui": "^0.2.52",
diff --git a/packages/gatsby-theme-ui-preset/CHANGELOG.md b/packages/gatsby-theme-ui-preset/CHANGELOG.md
index b128bee514305..7c0f19074d0a6 100644
--- a/packages/gatsby-theme-ui-preset/CHANGELOG.md
+++ b/packages/gatsby-theme-ui-preset/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.0.38](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.37...gatsby-theme-ui-preset@0.0.38) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-ui-preset
+
## [0.0.37](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.36...gatsby-theme-ui-preset@0.0.37) (2020-05-21)
**Note:** Version bump only for package gatsby-theme-ui-preset
diff --git a/packages/gatsby-theme-ui-preset/package.json b/packages/gatsby-theme-ui-preset/package.json
index 1704a1d397447..a3d7cc4280b03 100644
--- a/packages/gatsby-theme-ui-preset/package.json
+++ b/packages/gatsby-theme-ui-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-ui-preset",
- "version": "0.0.37",
+ "version": "0.0.38",
"description": "A Gatsby theme for theme-ui styles",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.6",
+ "gatsby": "^2.22.7",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-transformer-remark/CHANGELOG.md b/packages/gatsby-transformer-remark/CHANGELOG.md
index e670469edb9c7..b7da31f5c4a61 100644
--- a/packages/gatsby-transformer-remark/CHANGELOG.md
+++ b/packages/gatsby-transformer-remark/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.8.13](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-remark@2.8.12...gatsby-transformer-remark@2.8.13) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-transformer-remark
+
## [2.8.12](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-remark@2.8.11...gatsby-transformer-remark@2.8.12) (2020-05-20)
**Note:** Version bump only for package gatsby-transformer-remark
diff --git a/packages/gatsby-transformer-remark/package.json b/packages/gatsby-transformer-remark/package.json
index c34a73d54fcdf..3f911c77abf38 100644
--- a/packages/gatsby-transformer-remark/package.json
+++ b/packages/gatsby-transformer-remark/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-remark",
"description": "Gatsby transformer plugin for Markdown using the Remark library and ecosystem",
- "version": "2.8.12",
+ "version": "2.8.13",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -9,7 +9,7 @@
"dependencies": {
"@babel/runtime": "^7.9.6",
"bluebird": "^3.7.2",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-core-utils": "^1.3.3",
"gray-matter": "^4.0.2",
"hast-util-raw": "^4.0.0",
"hast-util-to-html": "^4.0.1",
diff --git a/packages/gatsby-transformer-sqip/CHANGELOG.md b/packages/gatsby-transformer-sqip/CHANGELOG.md
index fa2be9950acd8..3585ebcec3d0f 100644
--- a/packages/gatsby-transformer-sqip/CHANGELOG.md
+++ b/packages/gatsby-transformer-sqip/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.3.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-sqip@2.3.8...gatsby-transformer-sqip@2.3.9) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-transformer-sqip
+
## [2.3.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-sqip@2.3.7...gatsby-transformer-sqip@2.3.8) (2020-05-20)
**Note:** Version bump only for package gatsby-transformer-sqip
diff --git a/packages/gatsby-transformer-sqip/package.json b/packages/gatsby-transformer-sqip/package.json
index 7c025b4f5003c..91667052e1cb6 100644
--- a/packages/gatsby-transformer-sqip/package.json
+++ b/packages/gatsby-transformer-sqip/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-sqip",
"description": "Generates geometric primitive version of images",
- "version": "2.3.8",
+ "version": "2.3.9",
"author": "Benedikt Rötsch ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -10,7 +10,7 @@
"@babel/runtime": "^7.9.6",
"bluebird": "^3.7.2",
"fs-extra": "^8.1.0",
- "gatsby-plugin-sharp": "^2.6.8",
+ "gatsby-plugin-sharp": "^2.6.9",
"md5-file": "^4.0.0",
"mini-svg-data-uri": "^1.2.3",
"p-queue": "^2.4.2",
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index 6c546f82d678f..c45542a42601f 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.22.7](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.6...gatsby@2.22.7) (2020-05-22)
+
+**Note:** Version bump only for package gatsby
+
## [2.22.6](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.5...gatsby@2.22.6) (2020-05-21)
**Note:** Version bump only for package gatsby
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index c3f3d21dbfb56..e453dc86fc626 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.22.6",
+ "version": "2.22.7",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
@@ -33,7 +33,7 @@
"babel-plugin-add-module-exports": "^0.3.3",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-remove-graphql-queries": "^2.9.2",
- "babel-preset-gatsby": "^0.4.6",
+ "babel-preset-gatsby": "^0.4.7",
"better-opn": "1.0.0",
"better-queue": "^3.8.10",
"bluebird": "^3.7.2",
@@ -72,14 +72,14 @@
"flat": "^4.1.0",
"fs-exists-cached": "1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-cli": "^2.12.31",
- "gatsby-core-utils": "^1.3.2",
+ "gatsby-cli": "^2.12.32",
+ "gatsby-core-utils": "^1.3.3",
"gatsby-graphiql-explorer": "^0.4.2",
"gatsby-link": "^2.4.3",
- "gatsby-plugin-page-creator": "^2.3.6",
+ "gatsby-plugin-page-creator": "^2.3.7",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-react-router-scroll": "^3.0.1",
- "gatsby-telemetry": "^1.3.8",
+ "gatsby-telemetry": "^1.3.9",
"glob": "^7.1.6",
"got": "8.3.2",
"graphql": "^14.6.0",
From 576861aa3e5fc2830c3bdef72ffa2ef1e1a25dfe Mon Sep 17 00:00:00 2001
From: Mikhail Novikov
Date: Fri, 22 May 2020 10:32:13 +0300
Subject: [PATCH 016/288] fix(gatsby-recipes): Re-add missing dependency
(#24334)
---
packages/gatsby-recipes/package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 181bf6b519872..117a9fe7f2023 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -22,6 +22,7 @@
"acorn-jsx": "^5.2.0",
"cors": "^2.8.5",
"debug": "^4.1.1",
+ "detect-port": "^1.3.0",
"execa": "^4.0.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
From e5417f6924b45ec52b571aa772aff4824d8e8566 Mon Sep 17 00:00:00 2001
From: Mikhail Novikov
Date: Fri, 22 May 2020 10:35:10 +0300
Subject: [PATCH 017/288] chore(release): Publish
- gatsby-admin@0.1.49
- gatsby-cli@2.12.33
- gatsby-recipes@0.1.27
- gatsby-theme-blog-core@1.5.24
- gatsby-theme-blog@1.6.24
- gatsby-theme-notes@1.3.50
- gatsby-theme-ui-preset@0.0.39
- gatsby@2.22.8
---
packages/gatsby-admin/CHANGELOG.md | 4 ++++
packages/gatsby-admin/package.json | 4 ++--
packages/gatsby-cli/CHANGELOG.md | 4 ++++
packages/gatsby-cli/package.json | 4 ++--
packages/gatsby-recipes/CHANGELOG.md | 6 ++++++
packages/gatsby-recipes/package.json | 2 +-
packages/gatsby-theme-blog-core/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog-core/package.json | 4 ++--
packages/gatsby-theme-blog/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog/package.json | 6 +++---
packages/gatsby-theme-notes/CHANGELOG.md | 4 ++++
packages/gatsby-theme-notes/package.json | 4 ++--
packages/gatsby-theme-ui-preset/CHANGELOG.md | 4 ++++
packages/gatsby-theme-ui-preset/package.json | 4 ++--
packages/gatsby/CHANGELOG.md | 4 ++++
packages/gatsby/package.json | 4 ++--
16 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/packages/gatsby-admin/CHANGELOG.md b/packages/gatsby-admin/CHANGELOG.md
index a6b2a9f8db53e..16f7ae2ad822e 100644
--- a/packages/gatsby-admin/CHANGELOG.md
+++ b/packages/gatsby-admin/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.49](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.48...gatsby-admin@0.1.49) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-admin
+
## [0.1.48](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.47...gatsby-admin@0.1.48) (2020-05-22)
**Note:** Version bump only for package gatsby-admin
diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json
index 58e6bfe4b2ce7..d74b9854189cb 100644
--- a/packages/gatsby-admin/package.json
+++ b/packages/gatsby-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
- "version": "0.1.48",
+ "version": "0.1.49",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -8,7 +8,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
- "gatsby": "^2.22.7",
+ "gatsby": "^2.22.8",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-source-graphql": "^2.5.2",
"react": "^16.12.0",
diff --git a/packages/gatsby-cli/CHANGELOG.md b/packages/gatsby-cli/CHANGELOG.md
index 3e7f878f5b4f8..5141a0370ff1c 100644
--- a/packages/gatsby-cli/CHANGELOG.md
+++ b/packages/gatsby-cli/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.12.33](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.32...gatsby-cli@2.12.33) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-cli
+
## [2.12.32](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.31...gatsby-cli@2.12.32) (2020-05-22)
**Note:** Version bump only for package gatsby-cli
diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json
index d3ae4e1bb061a..2ab53d5f48abb 100644
--- a/packages/gatsby-cli/package.json
+++ b/packages/gatsby-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
- "version": "2.12.32",
+ "version": "2.12.33",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "lib/index.js"
@@ -26,7 +26,7 @@
"fs-exists-cached": "^1.0.0",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^1.3.3",
- "gatsby-recipes": "^0.1.26",
+ "gatsby-recipes": "^0.1.27",
"gatsby-telemetry": "^1.3.9",
"hosted-git-info": "^3.0.4",
"is-valid-path": "^0.1.1",
diff --git a/packages/gatsby-recipes/CHANGELOG.md b/packages/gatsby-recipes/CHANGELOG.md
index 198ab78f33e5f..8e7fef5d49090 100644
--- a/packages/gatsby-recipes/CHANGELOG.md
+++ b/packages/gatsby-recipes/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.27](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.26...gatsby-recipes@0.1.27) (2020-05-22)
+
+### Bug Fixes
+
+- **gatsby-recipes:** Re-add missing dependency ([#24334](https://github.com/gatsbyjs/gatsby/issues/24334)) ([576861a](https://github.com/gatsbyjs/gatsby/commit/576861a))
+
## [0.1.26](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.25...gatsby-recipes@0.1.26) (2020-05-22)
**Note:** Version bump only for package gatsby-recipes
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 117a9fe7f2023..74db4931c639b 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-recipes",
"description": "Core functionality for Gatsby Recipes",
- "version": "0.1.26",
+ "version": "0.1.27",
"author": "Kyle Mathews ",
"main": "dist/index.js",
"bugs": {
diff --git a/packages/gatsby-theme-blog-core/CHANGELOG.md b/packages/gatsby-theme-blog-core/CHANGELOG.md
index 7767f1048c5c9..e067432d24710 100644
--- a/packages/gatsby-theme-blog-core/CHANGELOG.md
+++ b/packages/gatsby-theme-blog-core/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.5.24](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.23...gatsby-theme-blog-core@1.5.24) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog-core
+
## [1.5.23](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.22...gatsby-theme-blog-core@1.5.23) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-blog-core
diff --git a/packages/gatsby-theme-blog-core/package.json b/packages/gatsby-theme-blog-core/package.json
index 0afd7a295fabb..10f85fa1c0b6e 100644
--- a/packages/gatsby-theme-blog-core/package.json
+++ b/packages/gatsby-theme-blog-core/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog-core",
- "version": "1.5.23",
+ "version": "1.5.24",
"main": "index.js",
"author": "christopherbiscardi (@chrisbiscardi)",
"license": "MIT",
@@ -30,7 +30,7 @@
},
"devDependencies": {
"@mdx-js/react": "^1.6.1",
- "gatsby": "^2.22.7",
+ "gatsby": "^2.22.8",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-blog/CHANGELOG.md b/packages/gatsby-theme-blog/CHANGELOG.md
index 93e4a1afdbc37..4a63379086720 100644
--- a/packages/gatsby-theme-blog/CHANGELOG.md
+++ b/packages/gatsby-theme-blog/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.6.24](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.23...gatsby-theme-blog@1.6.24) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog
+
## [1.6.23](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.22...gatsby-theme-blog@1.6.23) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-blog
diff --git a/packages/gatsby-theme-blog/package.json b/packages/gatsby-theme-blog/package.json
index 6659a9ff837a1..48a83131232de 100644
--- a/packages/gatsby-theme-blog/package.json
+++ b/packages/gatsby-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog",
- "version": "1.6.23",
+ "version": "1.6.24",
"description": "A Gatsby theme for miscellaneous blogging with a dark/light mode",
"main": "index.js",
"keywords": [
@@ -29,7 +29,7 @@
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-theme-ui": "^0.2.53",
"gatsby-plugin-twitter": "^2.3.2",
- "gatsby-theme-blog-core": "^1.5.23",
+ "gatsby-theme-blog-core": "^1.5.24",
"mdx-utils": "0.2.0",
"react-helmet": "^5.2.1",
"react-switch": "^5.0.1",
@@ -39,7 +39,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.7",
+ "gatsby": "^2.22.8",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-notes/CHANGELOG.md b/packages/gatsby-theme-notes/CHANGELOG.md
index 417a8626197db..25436201730f6 100644
--- a/packages/gatsby-theme-notes/CHANGELOG.md
+++ b/packages/gatsby-theme-notes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.50](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.49...gatsby-theme-notes@1.3.50) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-notes
+
## [1.3.49](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.48...gatsby-theme-notes@1.3.49) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-notes
diff --git a/packages/gatsby-theme-notes/package.json b/packages/gatsby-theme-notes/package.json
index df8f97375d4fd..fc4e0a5471d6d 100644
--- a/packages/gatsby-theme-notes/package.json
+++ b/packages/gatsby-theme-notes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-theme-notes",
"description": "Gatsby Theme for adding a notes section to your website",
- "version": "1.3.49",
+ "version": "1.3.50",
"author": "John Otander",
"license": "MIT",
"main": "index.js",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-notes#readme",
"devDependencies": {
- "gatsby": "^2.22.7",
+ "gatsby": "^2.22.8",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
diff --git a/packages/gatsby-theme-ui-preset/CHANGELOG.md b/packages/gatsby-theme-ui-preset/CHANGELOG.md
index 7c0f19074d0a6..8926fd4696558 100644
--- a/packages/gatsby-theme-ui-preset/CHANGELOG.md
+++ b/packages/gatsby-theme-ui-preset/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.0.39](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.38...gatsby-theme-ui-preset@0.0.39) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-ui-preset
+
## [0.0.38](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.37...gatsby-theme-ui-preset@0.0.38) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-ui-preset
diff --git a/packages/gatsby-theme-ui-preset/package.json b/packages/gatsby-theme-ui-preset/package.json
index a3d7cc4280b03..67f433fa2672c 100644
--- a/packages/gatsby-theme-ui-preset/package.json
+++ b/packages/gatsby-theme-ui-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-ui-preset",
- "version": "0.0.38",
+ "version": "0.0.39",
"description": "A Gatsby theme for theme-ui styles",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.7",
+ "gatsby": "^2.22.8",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index c45542a42601f..48411e23f1c7d 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.22.8](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.7...gatsby@2.22.8) (2020-05-22)
+
+**Note:** Version bump only for package gatsby
+
## [2.22.7](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.6...gatsby@2.22.7) (2020-05-22)
**Note:** Version bump only for package gatsby
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index e453dc86fc626..4d566e87d2747 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.22.7",
+ "version": "2.22.8",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
@@ -72,7 +72,7 @@
"flat": "^4.1.0",
"fs-exists-cached": "1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-cli": "^2.12.32",
+ "gatsby-cli": "^2.12.33",
"gatsby-core-utils": "^1.3.3",
"gatsby-graphiql-explorer": "^0.4.2",
"gatsby-link": "^2.4.3",
From a5952f691ec83c612c764f755932e5ed732a6085 Mon Sep 17 00:00:00 2001
From: Ward Peeters
Date: Fri, 22 May 2020 10:30:11 +0200
Subject: [PATCH 018/288] tests(gatsby-cli): make test similar to others
(#24274)
---
.circleci/config.yml | 12 +---
.../gatsby-cli/__tests__/develop.js | 14 ++--
integration-tests/gatsby-cli/__tests__/new.js | 32 ++++-----
.../gatsby-cli/__tests__/repl.js | 17 ++---
integration-tests/gatsby-cli/package.json | 7 +-
.../gatsby-cli/test-helpers/cleanup.js | 20 ------
.../gatsby-cli/test-helpers/index.js | 1 -
.../gatsby-cli/test-helpers/invoke-cli.js | 65 ++++++++++++-------
8 files changed, 78 insertions(+), 90 deletions(-)
delete mode 100644 integration-tests/gatsby-cli/test-helpers/cleanup.js
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 240e88c2d392e..2040b330125d8 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -257,17 +257,11 @@ jobs:
test_path: integration-tests/gatsby-pipeline
integration_tests_gatsby_cli:
- <<: *e2e-executor
executor: node
steps:
- - 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
+ - e2e-test:
+ test_path: integration-tests/gatsby-pipeline
+ trigger_pattern: packages/gatsby-cli/*|packages/gatsby/*|integration-tests/gatsby-cli/*
integration_tests_structured_logging:
executor: node
diff --git a/integration-tests/gatsby-cli/__tests__/develop.js b/integration-tests/gatsby-cli/__tests__/develop.js
index df87734a0935d..8f8e7a364e4ba 100644
--- a/integration-tests/gatsby-cli/__tests__/develop.js
+++ b/integration-tests/gatsby-cli/__tests__/develop.js
@@ -16,15 +16,15 @@ describe(`gatsby develop`, () => {
it(`starts a gatsby site on port 8000`, async () => {
// 1. Start the `gatsby develop` command
- const [childProcess, getLogs] = GatsbyCLI.from(cwd).invokeAsync(`develop`)
+ const [childProcess, getLogs] = GatsbyCLI.from(cwd).invokeAsync(
+ `develop`,
+ log => log.includes("To create a production build, use gatsby build")
+ )
- // 2. Wait for the build process to finish
- await timeout(15)
+ // 2. kill the `gatsby develop` command so we can get logs
+ await childProcess
- // 3. kill the `gatsby develop` command so we can get logs
- childProcess.kill()
-
- // 4. Make sure logs for the user contain expected results
+ // 3. Make sure logs for the user contain expected results
const logs = getLogs()
logs.should.contain(`success open and validate gatsby-configs`)
logs.should.contain(`success load plugins`)
diff --git a/integration-tests/gatsby-cli/__tests__/new.js b/integration-tests/gatsby-cli/__tests__/new.js
index 2ae88d126688e..094778d46ae65 100644
--- a/integration-tests/gatsby-cli/__tests__/new.js
+++ b/integration-tests/gatsby-cli/__tests__/new.js
@@ -1,25 +1,27 @@
-import { GatsbyCLI, removeFolder } from "../test-helpers"
-import fs from "fs"
+import { GatsbyCLI } from "../test-helpers"
+import * as fs from "fs-extra"
+import execa from "execa"
import { join } from "path"
-const MAX_TIMEOUT = 2147483647
+const MAX_TIMEOUT = 30000
jest.setTimeout(MAX_TIMEOUT)
const cwd = `execution-folder`
+const clean = dir => execa(`yarn`, ["del-cli", dir])
+
describe(`gatsby new`, () => {
// make folder for us to create sites into
const dir = join(__dirname, "../execution-folder")
- beforeAll(() => {
- if (!fs.existsSync(dir)) {
- fs.mkdirSync(dir)
- }
+ beforeAll(async () => {
+ await clean(dir)
+ await fs.ensureDir(dir)
})
- afterAll(() => removeFolder("execution-folder"))
+ afterAll(() => clean(dir))
it(`a default starter creates a gatsby site`, () => {
- const [code, logs] = GatsbyCLI.from(cwd).invoke(`new`, `gatsby-default`)
+ const [code, logs] = GatsbyCLI.from(cwd).invoke([`new`, `gatsby-default`])
logs.should.contain(
`info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git`
@@ -36,11 +38,11 @@ describe(`gatsby new`, () => {
})
it(`a theme starter creates a gatsby site`, () => {
- const [code, logs] = GatsbyCLI.from(cwd).invoke(
+ const [code, logs] = GatsbyCLI.from(cwd).invoke([
`new`,
`gatsby-blog`,
- `gatsbyjs/gatsby-starter-blog`
- )
+ `gatsbyjs/gatsby-starter-blog`,
+ ])
logs.should.contain(
`info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-blog.git`
@@ -57,11 +59,11 @@ describe(`gatsby new`, () => {
})
it(`an invalid starter fails to create a gatsby site`, () => {
- const [code, logs] = GatsbyCLI.from(cwd).invoke(
+ const [code, logs] = GatsbyCLI.from(cwd).invoke([
`new`,
`gatsby-invalid`,
- `tHiS-Is-A-fAkE-sTaRtEr`
- )
+ `tHiS-Is-A-fAkE-sTaRtEr`,
+ ])
logs.should.contain(`Error`)
logs.should.contain(`starter tHiS-Is-A-fAkE-sTaRtEr doesn't exist`)
diff --git a/integration-tests/gatsby-cli/__tests__/repl.js b/integration-tests/gatsby-cli/__tests__/repl.js
index 85474fc47d3bc..cd7b0f1a5fa08 100644
--- a/integration-tests/gatsby-cli/__tests__/repl.js
+++ b/integration-tests/gatsby-cli/__tests__/repl.js
@@ -1,10 +1,5 @@
import { GatsbyCLI } from "../test-helpers"
-const timeout = seconds =>
- new Promise(resolve => {
- setTimeout(resolve, seconds * 1000)
- })
-
const MAX_TIMEOUT = 2147483647
jest.setTimeout(MAX_TIMEOUT)
@@ -16,15 +11,15 @@ describe(`gatsby repl`, () => {
it(`starts a gatsby site on port 8000`, async () => {
// 1. Start the `gatsby develop` command
- const [childProcess, getLogs] = GatsbyCLI.from(cwd).invokeAsync(`repl`)
+ const [childProcess, getLogs] = GatsbyCLI.from(cwd).invokeAsync(
+ `repl`,
+ log => log.includes("gatsby >")
+ )
// 2. Wait for the build process to finish
- await timeout(5)
-
- // 3. Kill the repl
- childProcess.kill()
+ await childProcess
- // 4. Make assertions
+ // 3. Make assertions
const logs = getLogs()
logs.should.contain(`success open and validate gatsby-configs`)
logs.should.contain(`success load plugins`)
diff --git a/integration-tests/gatsby-cli/package.json b/integration-tests/gatsby-cli/package.json
index 82350df6084b6..26aab2b690309 100644
--- a/integration-tests/gatsby-cli/package.json
+++ b/integration-tests/gatsby-cli/package.json
@@ -2,16 +2,17 @@
"name": "gatsby-cli-tests",
"version": "1.0.0",
"dependencies": {
- "cross-spawn": "^7.0.1",
- "npm-run-all": "^4.1.5",
+ "gatsby-cli": "^2.12.29",
"strip-ansi": "^6.0.0"
},
"license": "MIT",
"scripts": {
- "pretest": "cd ../../packages/gatsby-cli && yarn build",
"test": "jest --config=../jest.config.js gatsby-cli/"
},
"devDependencies": {
+ "del-cli": "^3.0.1",
+ "execa": "^4.0.1",
+ "fs-extra": "^9.0.0",
"jest": "^24.0.0"
},
"repository": {
diff --git a/integration-tests/gatsby-cli/test-helpers/cleanup.js b/integration-tests/gatsby-cli/test-helpers/cleanup.js
deleted file mode 100644
index 8a78af0230e0b..0000000000000
--- a/integration-tests/gatsby-cli/test-helpers/cleanup.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { join } from "path"
-import { exec } from "child_process"
-
-const root = join(__dirname, "..")
-
-// Executes a shell command and return it as a Promise.
-function pExec(command) {
- return new Promise(resolve => {
- exec(command, (error, stdout, stderr) => {
- if (error) {
- console.warn(error)
- }
- resolve(stdout ? stdout : stderr)
- })
- })
-}
-
-export function removeFolder(folder) {
- return pExec(`rm -rf ${root}/${folder}`)
-}
diff --git a/integration-tests/gatsby-cli/test-helpers/index.js b/integration-tests/gatsby-cli/test-helpers/index.js
index 7f1e7f5b3a036..40443faee007c 100644
--- a/integration-tests/gatsby-cli/test-helpers/index.js
+++ b/integration-tests/gatsby-cli/test-helpers/index.js
@@ -1,2 +1 @@
export * from "./invoke-cli"
-export * from "./cleanup"
diff --git a/integration-tests/gatsby-cli/test-helpers/invoke-cli.js b/integration-tests/gatsby-cli/test-helpers/invoke-cli.js
index 236caf9e71283..a83c6bab79e87 100644
--- a/integration-tests/gatsby-cli/test-helpers/invoke-cli.js
+++ b/integration-tests/gatsby-cli/test-helpers/invoke-cli.js
@@ -1,46 +1,63 @@
-import spawn from "cross-spawn"
-import { join } from "path"
+import execa, { sync } from "execa"
+import { join, resolve } from "path"
import { createLogsMatcher } from "./matcher"
// Use as `GatsbyCLI.cwd('execution-folder').invoke('new', 'foo')`
export const GatsbyCLI = {
from(relativeCwd) {
return {
- invoke(...args) {
- const results = spawn.sync(
- join(__dirname, `../../../packages/gatsby-cli/lib/index.js`),
- args,
- {
- cwd: join(__dirname, `../`, `./${relativeCwd}`),
- }
- )
+ invoke(args) {
+ try {
+ const results = sync(
+ resolve(`./node_modules/.bin/gatsby`),
+ [].concat(args),
+ {
+ cwd: join(__dirname, `../`, `./${relativeCwd}`),
+ }
+ )
- if (results.error) {
- return [1, createLogsMatcher(results.error.toString().split("\n"))]
+ return [
+ results.exitCode,
+ createLogsMatcher(results.stdout.toString().split("\n")),
+ ]
+ } catch (err) {
+ return [
+ err.exitCode,
+ createLogsMatcher(err.stdout.toString().split("\n")),
+ ]
}
-
- return [
- results.status,
- createLogsMatcher(results.output.toString().split("\n")),
- ]
},
- invokeAsync: (...args) => {
- const res = spawn(
- join(__dirname, `../../../packages/gatsby-cli/lib/index.js`),
- args,
+ invokeAsync: (args, onExit) => {
+ const res = execa(
+ resolve(`./node_modules/.bin/gatsby`),
+ [].concat(args),
{
cwd: join(__dirname, `../`, `./${relativeCwd}`),
}
)
const logs = []
-
res.stdout.on("data", data => {
- logs.push(data.toString())
+ if (!res.killed) {
+ logs.push(data.toString())
+ }
+
+ if (onExit && onExit(data.toString())) {
+ res.cancel()
+ }
})
- return [res, () => createLogsMatcher(logs)]
+ return [
+ res.catch(err => {
+ if (err.isCanceled) {
+ return
+ }
+
+ throw err
+ }),
+ () => createLogsMatcher(logs),
+ ]
},
}
},
From 339eb66cd5e1be5d3842b98fba86d12a59c13cb4 Mon Sep 17 00:00:00 2001
From: Chris DeMars
Date: Fri, 22 May 2020 02:33:03 -0600
Subject: [PATCH 019/288] fix: adds curly braces around Helmet import in seo.js
component. (#24276)
---
starters/blog/src/components/seo.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/starters/blog/src/components/seo.js b/starters/blog/src/components/seo.js
index b8f36d32763aa..f136a254b5a99 100644
--- a/starters/blog/src/components/seo.js
+++ b/starters/blog/src/components/seo.js
@@ -7,7 +7,7 @@
import React from "react"
import PropTypes from "prop-types"
-import Helmet from "react-helmet"
+import { Helmet } from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"
const SEO = ({ description, lang, meta, title }) => {
From 34a86314613bf416468b8b624d6086c1033a9cbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20Bodn=C3=A1r?=
Date: Fri, 22 May 2020 11:03:08 +0200
Subject: [PATCH 020/288] fix(gatsby) escape string in develop command (#24277)
`developProcessPath` should be properly escaped
---
packages/gatsby/src/commands/develop.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/gatsby/src/commands/develop.ts b/packages/gatsby/src/commands/develop.ts
index 366f32f1e5736..9d1a6f265d3d5 100644
--- a/packages/gatsby/src/commands/develop.ts
+++ b/packages/gatsby/src/commands/develop.ts
@@ -109,7 +109,7 @@ module.exports = async (program: IProgram): Promise => {
const developPort = await getRandomPort()
const developProcess = new ControllableScript(`
- const cmd = require("${developProcessPath}");
+ const cmd = require(${JSON.stringify(developProcessPath)});
const args = ${JSON.stringify({
...program,
port: developPort,
From 828bc5f3b3b3c273b322713477efcf9c9da65111 Mon Sep 17 00:00:00 2001
From: Roger
Date: Fri, 22 May 2020 05:16:50 -0400
Subject: [PATCH 021/288] [gatsby-plugin-feed] Await async serializers (#24324)
I hope I'm not oversimplifying this, but I think we can slip in this `await` with no consequences.
I'd like to use a unified processor in my serializer, but it seems quite difficult to use async plugins in a synchronous function.
---
packages/gatsby-plugin-feed/src/gatsby-node.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/gatsby-plugin-feed/src/gatsby-node.js b/packages/gatsby-plugin-feed/src/gatsby-node.js
index b225814d87dfc..676fa16d7a02b 100644
--- a/packages/gatsby-plugin-feed/src/gatsby-node.js
+++ b/packages/gatsby-plugin-feed/src/gatsby-node.js
@@ -100,7 +100,7 @@ exports.onPostBuild = async ({ graphql }, pluginOptions) => {
? feed.serialize
: serialize
- const rssFeed = serializer(locals).reduce((merged, item) => {
+ const rssFeed = (await serializer(locals)).reduce((merged, item) => {
merged.item(item)
return merged
}, new RSS(setup(locals)))
From 2e629cbaa4f9a2ccf68a180b4186220c284f8c13 Mon Sep 17 00:00:00 2001
From: Michal Piechowiak
Date: Fri, 22 May 2020 11:51:50 +0200
Subject: [PATCH 022/288] test(gatsby-recipes): don't store actual version in
snapshots (#24337)
* test(gatsby-recipes): don't store actual version in snapshots
* one more test with version in snapshot
---
.../gatsby-recipes/src/renderer/index.test.js | 76 +++++++++++--------
.../src/renderer/render.test.js | 54 +++++++------
2 files changed, 76 insertions(+), 54 deletions(-)
diff --git a/packages/gatsby-recipes/src/renderer/index.test.js b/packages/gatsby-recipes/src/renderer/index.test.js
index 86fc7229afa32..f60524114c384 100644
--- a/packages/gatsby-recipes/src/renderer/index.test.js
+++ b/packages/gatsby-recipes/src/renderer/index.test.js
@@ -12,47 +12,59 @@ describe(`renderer`, () => {
test(`handles MDX as input`, async () => {
const result = await render(mdxFixture)
- expect(result).toMatchInlineSnapshot(`
- Array [
- Object {
- "currentState": "",
- "describe": "Write foo.js",
- "diff": "- Original - 0
+ // Gatsby latest version is ever changing so we use regex matcher for currentState property.
+ // Unfortunately jest property matchers work weirdly on arrays so instead
+ // of snapshotting entitre result array it's split into few pieces.
+
+ expect(result.length).toEqual(3)
+ expect(result[0]).toMatchInlineSnapshot(`
+ Object {
+ "currentState": "",
+ "describe": "Write foo.js",
+ "diff": "- Original - 0
+ Modified + 1
+ /** foo */",
- "newState": "/** foo */",
- "resourceDefinitions": Object {
- "content": "/** foo */",
- "path": "foo.js",
- },
- "resourceName": "File",
+ "newState": "/** foo */",
+ "resourceDefinitions": Object {
+ "content": "/** foo */",
+ "path": "foo.js",
},
- Object {
- "currentState": "",
- "describe": "Write foo2.js",
- "diff": "- Original - 0
+ "resourceName": "File",
+ }
+ `)
+ expect(result[1]).toMatchInlineSnapshot(`
+ Object {
+ "currentState": "",
+ "describe": "Write foo2.js",
+ "diff": "- Original - 0
+ Modified + 1
+ /** foo2 */",
- "newState": "/** foo2 */",
- "resourceDefinitions": Object {
- "content": "/** foo2 */",
- "path": "foo2.js",
- },
- "resourceName": "File",
+ "newState": "/** foo2 */",
+ "resourceDefinitions": Object {
+ "content": "/** foo2 */",
+ "path": "foo2.js",
},
- Object {
- "currentState": "gatsby@2.22.5",
- "describe": "Install gatsby@latest",
- "newState": "gatsby@latest",
- "resourceDefinitions": Object {
- "name": "gatsby",
- },
- "resourceName": "NPMPackage",
- },
- ]
+ "resourceName": "File",
+ }
`)
+ expect(result[2]).toMatchInlineSnapshot(
+ {
+ currentState: expect.stringMatching(/gatsby@[0-9.]+/),
+ },
+ `
+ Object {
+ "currentState": StringMatching /gatsby@\\[0-9\\.\\]\\+/,
+ "describe": "Install gatsby@latest",
+ "newState": "gatsby@latest",
+ "resourceDefinitions": Object {
+ "name": "gatsby",
+ },
+ "resourceName": "NPMPackage",
+ }
+ `
+ )
})
test(`handles JSX with a single component`, async () => {
diff --git a/packages/gatsby-recipes/src/renderer/render.test.js b/packages/gatsby-recipes/src/renderer/render.test.js
index 3ae90c0a0e719..72a7e5fa60f8e 100644
--- a/packages/gatsby-recipes/src/renderer/render.test.js
+++ b/packages/gatsby-recipes/src/renderer/render.test.js
@@ -13,31 +13,41 @@ const fixture = (
test(`renders to a plan`, async () => {
const result = await render(fixture, {})
- expect(result).toMatchInlineSnapshot(`
- Array [
- Object {
- "currentState": "",
- "describe": "Write red.js",
- "diff": "- Original - 0
+ // Gatsby latest version is ever changing so we use regex matcher for currentState property.
+ // Unfortunately jest property matchers work weirdly on arrays so instead
+ // of snapshotting entitre result array it's split into few pieces.
+
+ expect(result.length).toEqual(2)
+ expect(result[0]).toMatchInlineSnapshot(`
+ Object {
+ "currentState": "",
+ "describe": "Write red.js",
+ "diff": "- Original - 0
+ Modified + 1
+ red!",
- "newState": "red!",
- "resourceDefinitions": Object {
- "content": "red!",
- "path": "red.js",
- },
- "resourceName": "File",
- },
- Object {
- "currentState": "gatsby@2.22.5",
- "describe": "Install gatsby@latest",
- "newState": "gatsby@latest",
- "resourceDefinitions": Object {
- "name": "gatsby",
- },
- "resourceName": "NPMPackage",
+ "newState": "red!",
+ "resourceDefinitions": Object {
+ "content": "red!",
+ "path": "red.js",
},
- ]
+ "resourceName": "File",
+ }
`)
+ expect(result[1]).toMatchInlineSnapshot(
+ {
+ currentState: expect.stringMatching(/gatsby@[0-9.]+/),
+ },
+ `
+ Object {
+ "currentState": StringMatching /gatsby@\\[0-9\\.\\]\\+/,
+ "describe": "Install gatsby@latest",
+ "newState": "gatsby@latest",
+ "resourceDefinitions": Object {
+ "name": "gatsby",
+ },
+ "resourceName": "NPMPackage",
+ }
+ `
+ )
})
From 542cda81f97d95583cc26f9a96cb14ea2c68b18c Mon Sep 17 00:00:00 2001
From: Peter van der Zee <209817+pvdz@users.noreply.github.com>
Date: Fri, 22 May 2020 12:05:06 +0200
Subject: [PATCH 023/288] perf(gatsby): support empty filters without sift
(#24258)
* perf(gatsby): support empty filters without sift
* Add a test case for empty filters
* Make return type consistent with what Sift returned
In particular the fast filters were returning `undefined` where they should be returning `null`. Fairly benign internal change but will be relevant once this file gets the TS treatment.
* Remove some old support checks now that all ops are supported
* Only set the resolved property if something got resolved
---
packages/gatsby/src/redux/nodes.ts | 52 ++++++++
packages/gatsby/src/redux/run-sift.js | 118 +++++++-----------
.../gatsby/src/schema/__tests__/run-query.js | 9 ++
3 files changed, 105 insertions(+), 74 deletions(-)
diff --git a/packages/gatsby/src/redux/nodes.ts b/packages/gatsby/src/redux/nodes.ts
index 51567fed9dffa..1cd503aef14dd 100644
--- a/packages/gatsby/src/redux/nodes.ts
+++ b/packages/gatsby/src/redux/nodes.ts
@@ -354,6 +354,58 @@ export const ensureIndexByQuery = (
postIndexingMetaSetup(filterCache, op)
}
+export function ensureEmptyFilterCache(
+ filterCacheKey,
+ nodeTypeNames: string[],
+ filtersCache: FiltersCache
+): void {
+ // This is called for queries without any filters
+ // We want to cache the result since it's basically a set of nodes by type(s)
+ // There are sites that have multiple queries which are empty
+
+ const state = store.getState()
+ const resolvedNodesCache = state.resolvedNodesCache
+ const nodesUnordered: Array = []
+
+ filtersCache.set(filterCacheKey, {
+ op: `$eq`, // Ignore.
+ byValue: new Map>(),
+ meta: {
+ nodesUnordered, // This is what we want
+ },
+ })
+
+ if (nodeTypeNames.length === 1) {
+ getNodesByType(nodeTypeNames[0]).forEach(node => {
+ if (!node.__gatsby_resolved) {
+ const typeName = node.internal.type
+ const resolvedNodes = resolvedNodesCache.get(typeName)
+ const resolved = resolvedNodes?.get(node.id)
+ if (resolved !== undefined) {
+ node.__gatsby_resolved = resolved
+ }
+ }
+ nodesUnordered.push(node)
+ })
+ } else {
+ // Here we must first filter for the node type
+ // This loop is expensive at scale (!)
+ state.nodes.forEach(node => {
+ if (nodeTypeNames.includes(node.internal.type)) {
+ if (!node.__gatsby_resolved) {
+ const typeName = node.internal.type
+ const resolvedNodes = resolvedNodesCache.get(typeName)
+ const resolved = resolvedNodes?.get(node.id)
+ if (resolved !== undefined) {
+ node.__gatsby_resolved = resolved
+ }
+ }
+ nodesUnordered.push(node)
+ }
+ })
+ }
+}
+
function addNodeToFilterCache(
node: IGatsbyNode,
chain: Array,
diff --git a/packages/gatsby/src/redux/run-sift.js b/packages/gatsby/src/redux/run-sift.js
index 50859bac6873c..4ac2f22dcd21a 100644
--- a/packages/gatsby/src/redux/run-sift.js
+++ b/packages/gatsby/src/redux/run-sift.js
@@ -12,6 +12,7 @@ const {
dbQueryToSiftQuery,
} = require(`../db/common/query`)
const {
+ ensureEmptyFilterCache,
ensureIndexByQuery,
ensureIndexByElemMatch,
getNodesFromCacheByValue,
@@ -19,18 +20,6 @@ const {
getNode: siftGetNode,
} = require(`./nodes`)
-const FAST_OPS = [
- `$eq`,
- `$ne`,
- `$lt`,
- `$lte`,
- `$gt`,
- `$gte`,
- `$in`,
- `$nin`,
- `$regex`, // Note: this includes $glob
-]
-
// More of a testing mechanic, to verify whether last runSift call used Sift
let lastFilterUsedSift = false
@@ -38,7 +27,7 @@ let lastFilterUsedSift = false
* Creates a key for one filterCache inside FiltersCache
*
* @param {Array} typeNames
- * @param {DbQuery} filter
+ * @param {DbQuery | null} filter If null the key will have empty path/op parts
* @returns {FilterCacheKey} (a string: `types.join()/path.join()/operator` )
*/
const createFilterCacheKey = (typeNames, filter) => {
@@ -147,10 +136,15 @@ function handleMany(siftArgs, nodes) {
*
* @param {Array} filters Resolved. (Should be checked by caller to exist)
* @param {Array} nodeTypeNames
- * @param {FiltersCache} filtersCache
- * @returns {Array | undefined}
+ * @param {undefined | null | FiltersCache} filtersCache
+ * @returns {Array | null}
*/
-const runFiltersWithoutSift = (filters, nodeTypeNames, filtersCache) => {
+const filterWithoutSift = (filters, nodeTypeNames, filtersCache) => {
+ if (!filtersCache) {
+ // If no filter cache is passed on, explicitly don't use one
+ return null
+ }
+
const nodesPerValueSets /*: Array> */ = getBucketsForFilters(
filters,
nodeTypeNames,
@@ -159,7 +153,7 @@ const runFiltersWithoutSift = (filters, nodeTypeNames, filtersCache) => {
if (!nodesPerValueSets) {
// Let Sift take over as fallback
- return undefined
+ return null
}
// Put smallest last (we'll pop it)
@@ -188,11 +182,14 @@ const runFiltersWithoutSift = (filters, nodeTypeNames, filtersCache) => {
// case for all value pairs? How likely is that to ever be reused?
if (result.length === 0) {
- return undefined
+ return null
}
return result
}
+// Not a public API
+exports.filterWithoutSift = filterWithoutSift
+
/**
* @param {Array} filters
* @param {Array} nodeTypeNames
@@ -256,11 +253,7 @@ const getBucketsForQueryFilter = (
) => {
let {
path: filterPath,
- query: {
- // Note: comparator is verified to be a FilterOp in filterWithoutSift
- comparator /*: as FilterOp*/,
- value: filterValue,
- },
+ query: { comparator /*: as FilterOp*/, value: filterValue },
} = filter
if (!filtersCache.has(filterCacheKey)) {
@@ -323,10 +316,6 @@ const collectBucketForElemMatch = (
}
}
- if (!FAST_OPS.includes(comparator)) {
- return false
- }
-
if (!filtersCache.has(filterCacheKey)) {
ensureIndexByElemMatch(
comparator,
@@ -411,7 +400,7 @@ exports.didLastFilterUseSift = function _didLastFilterUseSift() {
* @param {Array} nodeTypeNames
* @param {undefined | null | FiltersCache} filtersCache
* @param resolvedFields
- * @returns {Array | undefined} Collection of results. Collection
+ * @returns {Array | null} Collection of results. Collection
* will be limited to 1 if `firstOnly` is true
*/
const applyFilters = (
@@ -444,7 +433,27 @@ const applyFilters = (
}
}
- const result = filterWithoutSift(filters, nodeTypeNames, filtersCache)
+ if (filtersCache && filters.length === 0) {
+ let filterCacheKey = createFilterCacheKey(nodeTypeNames, null)
+ if (!filtersCache.has(filterCacheKey)) {
+ ensureEmptyFilterCache(filterCacheKey, nodeTypeNames, filtersCache)
+ }
+
+ const cache = filtersCache.get(filterCacheKey).meta.nodesUnordered
+
+ lastFilterUsedSift = false
+
+ if (firstOnly || cache.length) {
+ return cache.slice(0)
+ }
+ return null
+ }
+
+ const result /*: Array | null */ = filterWithoutSift(
+ filters,
+ nodeTypeNames,
+ filtersCache
+ )
lastFilterUsedSift = false
if (result) {
@@ -458,7 +467,7 @@ const applyFilters = (
}
lastFilterUsedSift = true
- const siftResult = filterWithSift(
+ const siftResult /*: Array | null */ = filterWithSift(
filters,
firstOnly,
nodeTypeNames,
@@ -493,46 +502,6 @@ const filterToStats = (
}
}
-/**
- * Check if filter op is supported (not all are). If so, uses custom
- * fast indexes based on filter and types and returns any result it finds.
- * If conditions are not met or no nodes are found, returns undefined and
- * a slow run through Sift is executed instead.
- * This function is a noop if no filter cache is given to it.
- *
- * @param {Array} filters Resolved. (Should be checked by caller to exist)
- * @param {Array} nodeTypeNames
- * @param {undefined | null | FiltersCache} filtersCache
- * @returns {Array | undefined} Collection of results
- */
-const filterWithoutSift = (filters, nodeTypeNames, filtersCache) => {
- if (!filtersCache) {
- // If no filter cache is passed on, explicitly don't use one
- return undefined
- }
-
- if (filters.length === 0) {
- // If no filters are given, go through Sift. This does not appear to be
- // slower than shortcutting it here.
- return undefined
- }
-
- if (
- filters.some(
- filter =>
- filter.type === `query` && !FAST_OPS.includes(filter.query.comparator)
- )
- ) {
- // If there's a filter with non-supported op, stop now.
- return undefined
- }
-
- return runFiltersWithoutSift(filters, nodeTypeNames, filtersCache)
-}
-
-// Not a public API
-exports.filterWithoutSift = filterWithoutSift
-
/**
* Use sift to apply filters
*
@@ -540,7 +509,7 @@ exports.filterWithoutSift = filterWithoutSift
* @param {boolean} firstOnly
* @param {Array} nodeTypeNames
* @param resolvedFields
- * @returns {Array | undefined | null} Collection of results.
+ * @returns {Array | null} Collection of results.
* Collection will be limited to 1 if `firstOnly` is true
*/
const filterWithSift = (filters, firstOnly, nodeTypeNames, resolvedFields) => {
@@ -566,7 +535,7 @@ const filterWithSift = (filters, firstOnly, nodeTypeNames, resolvedFields) => {
* @param {Array} nodeTypeNames
* @param resolvedFields
* @param {function(id: string): IGatsbyNode | undefined} getNode
- * @returns {Array | undefined | null} Collection of results.
+ * @returns {Array | null} Collection of results.
* Collection will be limited to 1 if `firstOnly` is true
*/
const runSiftOnNodes = (
@@ -605,13 +574,14 @@ const runSiftOnNodes = (
/**
* Given a list of filtered nodes and sorting parameters, sort the nodes
*
- * @param {Array | undefined | null} nodes Pre-filtered list of nodes
+ * @param {Array | null} nodes Pre-filtered list of nodes
* @param {Object | undefined} sort Sorting arguments
* @param resolvedFields
* @returns {Array | undefined | null} Same as input, except sorted
*/
const sortNodes = (nodes, sort, resolvedFields, stats) => {
- if (!sort || nodes?.length <= 1) {
+ // `undefined <= 1` and `undefined > 1` are both false so invert the result...
+ if (!sort || !(nodes?.length > 1)) {
return nodes
}
diff --git a/packages/gatsby/src/schema/__tests__/run-query.js b/packages/gatsby/src/schema/__tests__/run-query.js
index 887ed66da060b..0796b96745bb2 100644
--- a/packages/gatsby/src/schema/__tests__/run-query.js
+++ b/packages/gatsby/src/schema/__tests__/run-query.js
@@ -414,6 +414,15 @@ it(`should use the cache argument`, async () => {
describe(desc, () => {
describe(`Filter fields`, () => {
+ describe(`none`, () => {
+ it(`handles empty filter`, async () => {
+ const [result, allNodes] = await runFastFilter({})
+
+ // Expecting all nodes
+ expect(result?.length).toEqual(allNodes.length)
+ })
+ })
+
describe(`$eq`, () => {
it(`handles eq operator with number value`, async () => {
const needle = 2
From ae3a6c476f34d826d71b732752db66de0baedd22 Mon Sep 17 00:00:00 2001
From: Peter van der Zee
Date: Fri, 22 May 2020 12:13:37 +0200
Subject: [PATCH 024/288] chore(release): Publish
- gatsby-admin@0.1.50
- gatsby-cli@2.12.34
- gatsby-plugin-feed@2.5.3
- gatsby-recipes@0.1.28
- gatsby-theme-blog-core@1.5.25
- gatsby-theme-blog@1.6.25
- gatsby-theme-notes@1.3.51
- gatsby-theme-ui-preset@0.0.40
- gatsby@2.22.9
---
packages/gatsby-admin/CHANGELOG.md | 4 ++++
packages/gatsby-admin/package.json | 4 ++--
packages/gatsby-cli/CHANGELOG.md | 4 ++++
packages/gatsby-cli/package.json | 4 ++--
packages/gatsby-plugin-feed/CHANGELOG.md | 4 ++++
packages/gatsby-plugin-feed/package.json | 2 +-
packages/gatsby-recipes/CHANGELOG.md | 4 ++++
packages/gatsby-recipes/package.json | 2 +-
packages/gatsby-theme-blog-core/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog-core/package.json | 4 ++--
packages/gatsby-theme-blog/CHANGELOG.md | 4 ++++
packages/gatsby-theme-blog/package.json | 8 ++++----
packages/gatsby-theme-notes/CHANGELOG.md | 4 ++++
packages/gatsby-theme-notes/package.json | 4 ++--
packages/gatsby-theme-ui-preset/CHANGELOG.md | 4 ++++
packages/gatsby-theme-ui-preset/package.json | 4 ++--
packages/gatsby/CHANGELOG.md | 6 ++++++
packages/gatsby/package.json | 4 ++--
18 files changed, 56 insertions(+), 18 deletions(-)
diff --git a/packages/gatsby-admin/CHANGELOG.md b/packages/gatsby-admin/CHANGELOG.md
index 16f7ae2ad822e..431b26192bc8b 100644
--- a/packages/gatsby-admin/CHANGELOG.md
+++ b/packages/gatsby-admin/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.50](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.49...gatsby-admin@0.1.50) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-admin
+
## [0.1.49](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.1.48...gatsby-admin@0.1.49) (2020-05-22)
**Note:** Version bump only for package gatsby-admin
diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json
index d74b9854189cb..996aab27cf642 100644
--- a/packages/gatsby-admin/package.json
+++ b/packages/gatsby-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
- "version": "0.1.49",
+ "version": "0.1.50",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -8,7 +8,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
- "gatsby": "^2.22.8",
+ "gatsby": "^2.22.9",
"gatsby-plugin-typescript": "^2.4.3",
"gatsby-source-graphql": "^2.5.2",
"react": "^16.12.0",
diff --git a/packages/gatsby-cli/CHANGELOG.md b/packages/gatsby-cli/CHANGELOG.md
index 5141a0370ff1c..be232f6c68991 100644
--- a/packages/gatsby-cli/CHANGELOG.md
+++ b/packages/gatsby-cli/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.12.34](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.33...gatsby-cli@2.12.34) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-cli
+
## [2.12.33](https://github.com/gatsbyjs/gatsby/compare/gatsby-cli@2.12.32...gatsby-cli@2.12.33) (2020-05-22)
**Note:** Version bump only for package gatsby-cli
diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json
index 2ab53d5f48abb..f083c120d892f 100644
--- a/packages/gatsby-cli/package.json
+++ b/packages/gatsby-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
- "version": "2.12.33",
+ "version": "2.12.34",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "lib/index.js"
@@ -26,7 +26,7 @@
"fs-exists-cached": "^1.0.0",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^1.3.3",
- "gatsby-recipes": "^0.1.27",
+ "gatsby-recipes": "^0.1.28",
"gatsby-telemetry": "^1.3.9",
"hosted-git-info": "^3.0.4",
"is-valid-path": "^0.1.1",
diff --git a/packages/gatsby-plugin-feed/CHANGELOG.md b/packages/gatsby-plugin-feed/CHANGELOG.md
index f40033caa67ba..e8cc5d5992f55 100644
--- a/packages/gatsby-plugin-feed/CHANGELOG.md
+++ b/packages/gatsby-plugin-feed/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.5.3](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-feed@2.5.2...gatsby-plugin-feed@2.5.3) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-plugin-feed
+
## [2.5.2](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-feed@2.5.1...gatsby-plugin-feed@2.5.2) (2020-05-20)
**Note:** Version bump only for package gatsby-plugin-feed
diff --git a/packages/gatsby-plugin-feed/package.json b/packages/gatsby-plugin-feed/package.json
index 4a771441e0152..655cdfd9eb330 100644
--- a/packages/gatsby-plugin-feed/package.json
+++ b/packages/gatsby-plugin-feed/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-feed",
"description": "Creates an RSS feed for your Gatsby site.",
- "version": "2.5.2",
+ "version": "2.5.3",
"author": "Nicholas Young ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-recipes/CHANGELOG.md b/packages/gatsby-recipes/CHANGELOG.md
index 8e7fef5d49090..bba9041b9718b 100644
--- a/packages/gatsby-recipes/CHANGELOG.md
+++ b/packages/gatsby-recipes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.1.28](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.27...gatsby-recipes@0.1.28) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-recipes
+
## [0.1.27](https://github.com/gatsbyjs/gatsby/compare/gatsby-recipes@0.1.26...gatsby-recipes@0.1.27) (2020-05-22)
### Bug Fixes
diff --git a/packages/gatsby-recipes/package.json b/packages/gatsby-recipes/package.json
index 74db4931c639b..75ae2205cbcdc 100644
--- a/packages/gatsby-recipes/package.json
+++ b/packages/gatsby-recipes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-recipes",
"description": "Core functionality for Gatsby Recipes",
- "version": "0.1.27",
+ "version": "0.1.28",
"author": "Kyle Mathews ",
"main": "dist/index.js",
"bugs": {
diff --git a/packages/gatsby-theme-blog-core/CHANGELOG.md b/packages/gatsby-theme-blog-core/CHANGELOG.md
index e067432d24710..3c0165693014e 100644
--- a/packages/gatsby-theme-blog-core/CHANGELOG.md
+++ b/packages/gatsby-theme-blog-core/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.5.25](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.24...gatsby-theme-blog-core@1.5.25) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog-core
+
## [1.5.24](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog-core@1.5.23...gatsby-theme-blog-core@1.5.24) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-blog-core
diff --git a/packages/gatsby-theme-blog-core/package.json b/packages/gatsby-theme-blog-core/package.json
index 10f85fa1c0b6e..6c19da2dcecd0 100644
--- a/packages/gatsby-theme-blog-core/package.json
+++ b/packages/gatsby-theme-blog-core/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog-core",
- "version": "1.5.24",
+ "version": "1.5.25",
"main": "index.js",
"author": "christopherbiscardi (@chrisbiscardi)",
"license": "MIT",
@@ -30,7 +30,7 @@
},
"devDependencies": {
"@mdx-js/react": "^1.6.1",
- "gatsby": "^2.22.8",
+ "gatsby": "^2.22.9",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-blog/CHANGELOG.md b/packages/gatsby-theme-blog/CHANGELOG.md
index 4a63379086720..86d51280322e7 100644
--- a/packages/gatsby-theme-blog/CHANGELOG.md
+++ b/packages/gatsby-theme-blog/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.6.25](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.24...gatsby-theme-blog@1.6.25) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-blog
+
## [1.6.24](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-blog@1.6.23...gatsby-theme-blog@1.6.24) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-blog
diff --git a/packages/gatsby-theme-blog/package.json b/packages/gatsby-theme-blog/package.json
index 48a83131232de..5546166e7021d 100644
--- a/packages/gatsby-theme-blog/package.json
+++ b/packages/gatsby-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-blog",
- "version": "1.6.24",
+ "version": "1.6.25",
"description": "A Gatsby theme for miscellaneous blogging with a dark/light mode",
"main": "index.js",
"keywords": [
@@ -25,11 +25,11 @@
"deepmerge": "^4.2.2",
"gatsby-image": "^2.4.5",
"gatsby-plugin-emotion": "^4.3.2",
- "gatsby-plugin-feed": "^2.5.2",
+ "gatsby-plugin-feed": "^2.5.3",
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-theme-ui": "^0.2.53",
"gatsby-plugin-twitter": "^2.3.2",
- "gatsby-theme-blog-core": "^1.5.24",
+ "gatsby-theme-blog-core": "^1.5.25",
"mdx-utils": "0.2.0",
"react-helmet": "^5.2.1",
"react-switch": "^5.0.1",
@@ -39,7 +39,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.8",
+ "gatsby": "^2.22.9",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby-theme-notes/CHANGELOG.md b/packages/gatsby-theme-notes/CHANGELOG.md
index 25436201730f6..210a90262b261 100644
--- a/packages/gatsby-theme-notes/CHANGELOG.md
+++ b/packages/gatsby-theme-notes/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.51](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.50...gatsby-theme-notes@1.3.51) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-notes
+
## [1.3.50](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-notes@1.3.49...gatsby-theme-notes@1.3.50) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-notes
diff --git a/packages/gatsby-theme-notes/package.json b/packages/gatsby-theme-notes/package.json
index fc4e0a5471d6d..c3ea8b5809181 100644
--- a/packages/gatsby-theme-notes/package.json
+++ b/packages/gatsby-theme-notes/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-theme-notes",
"description": "Gatsby Theme for adding a notes section to your website",
- "version": "1.3.50",
+ "version": "1.3.51",
"author": "John Otander",
"license": "MIT",
"main": "index.js",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-theme-notes#readme",
"devDependencies": {
- "gatsby": "^2.22.8",
+ "gatsby": "^2.22.9",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
diff --git a/packages/gatsby-theme-ui-preset/CHANGELOG.md b/packages/gatsby-theme-ui-preset/CHANGELOG.md
index 8926fd4696558..f8a5b405d9893 100644
--- a/packages/gatsby-theme-ui-preset/CHANGELOG.md
+++ b/packages/gatsby-theme-ui-preset/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.0.40](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.39...gatsby-theme-ui-preset@0.0.40) (2020-05-22)
+
+**Note:** Version bump only for package gatsby-theme-ui-preset
+
## [0.0.39](https://github.com/gatsbyjs/gatsby/compare/gatsby-theme-ui-preset@0.0.38...gatsby-theme-ui-preset@0.0.39) (2020-05-22)
**Note:** Version bump only for package gatsby-theme-ui-preset
diff --git a/packages/gatsby-theme-ui-preset/package.json b/packages/gatsby-theme-ui-preset/package.json
index 67f433fa2672c..476365ce697d7 100644
--- a/packages/gatsby-theme-ui-preset/package.json
+++ b/packages/gatsby-theme-ui-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-ui-preset",
- "version": "0.0.39",
+ "version": "0.0.40",
"description": "A Gatsby theme for theme-ui styles",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"typography-theme-wordpress-2016": "^0.16.19"
},
"devDependencies": {
- "gatsby": "^2.22.8",
+ "gatsby": "^2.22.9",
"prettier": "2.0.5",
"react": "^16.12.0",
"react-dom": "^16.12.0"
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index 48411e23f1c7d..1dcf9cde6fae1 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.22.9](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.8...gatsby@2.22.9) (2020-05-22)
+
+### Performance Improvements
+
+- **gatsby:** support empty filters without sift ([#24258](https://github.com/gatsbyjs/gatsby/issues/24258)) ([542cda8](https://github.com/gatsbyjs/gatsby/commit/542cda8))
+
## [2.22.8](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.22.7...gatsby@2.22.8) (2020-05-22)
**Note:** Version bump only for package gatsby
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index 4d566e87d2747..c01c0a47fa8fe 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.22.8",
+ "version": "2.22.9",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
@@ -72,7 +72,7 @@
"flat": "^4.1.0",
"fs-exists-cached": "1.0.0",
"fs-extra": "^8.1.0",
- "gatsby-cli": "^2.12.33",
+ "gatsby-cli": "^2.12.34",
"gatsby-core-utils": "^1.3.3",
"gatsby-graphiql-explorer": "^0.4.2",
"gatsby-link": "^2.4.3",
From e86e7d7fed423f13c1b4201f1b092d869bd2bbe3 Mon Sep 17 00:00:00 2001
From: Pranjal Jately <30666375+pranjaljately@users.noreply.github.com>
Date: Fri, 22 May 2020 14:28:49 +0100
Subject: [PATCH 025/288] Replace anonymous function with named function in
gatsby-starter-hello-world (#24342)
---
starters/hello-world/src/pages/index.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/starters/hello-world/src/pages/index.js b/starters/hello-world/src/pages/index.js
index 92b25c10168f8..8729fdc41578e 100644
--- a/starters/hello-world/src/pages/index.js
+++ b/starters/hello-world/src/pages/index.js
@@ -1,3 +1,5 @@
import React from "react"
-export default () => Hello world!
+export default function Home() {
+ return Hello world!
+}
From 9f76842d6c2594409d934b9c0092752c94135144 Mon Sep 17 00:00:00 2001
From: nikoladev <15011519+nikoladev@users.noreply.github.com>
Date: Fri, 22 May 2020 15:30:12 +0200
Subject: [PATCH 026/288] remove vulnerable http-proxy version from lockfile
(#24344)
---
yarn.lock | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 19c6760466a8c..d2f62c1f666c0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10373,7 +10373,7 @@ event-target-shim@^5.0.0:
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
-eventemitter3@^3.0.0, eventemitter3@^3.1.0:
+eventemitter3@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==
@@ -12957,16 +12957,7 @@ http-proxy-middleware@0.19.1:
lodash "^4.17.11"
micromatch "^3.1.10"
-http-proxy@^1.17.0:
- version "1.17.0"
- resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a"
- integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==
- dependencies:
- eventemitter3 "^3.0.0"
- follow-redirects "^1.0.0"
- requires-port "^1.0.0"
-
-http-proxy@^1.18.1:
+http-proxy@^1.17.0, http-proxy@^1.18.1:
version "1.18.1"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
From 4a47bf601284e8cbf710b08f15c60329fa65adb0 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 16:40:03 +0200
Subject: [PATCH 027/288] fix(docs): remove double words (#24348)
---
docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md | 2 +-
docs/tutorial/source-plugin-tutorial.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md b/docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md
index 04df1906b6389..8d0d4df0b2ce9 100644
--- a/docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md
+++ b/docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md
@@ -408,7 +408,7 @@ You've already done most of the work needed to launch your new online store. All
- update the value of `data-item-url` in your product HTML
- use your live Snipcart API key
-The `data-item-url` attribute needs to match the live page where the products can be bought, which Snipcart crawls to verify the the order. In testing, a slash is fine. To get your site ready to go live, you'll need to replace the slash with the actual URL.
+The `data-item-url` attribute needs to match the live page where the products can be bought, which Snipcart crawls to verify the order. In testing, a slash is fine. To get your site ready to go live, you'll need to replace the slash with the actual URL.
```jsx:title=index.js
data-item-url={`URL of your live product page`}
diff --git a/docs/tutorial/source-plugin-tutorial.md b/docs/tutorial/source-plugin-tutorial.md
index 99df984d2500d..04a57358ca760 100644
--- a/docs/tutorial/source-plugin-tutorial.md
+++ b/docs/tutorial/source-plugin-tutorial.md
@@ -459,7 +459,7 @@ const { createRemoteFileNode } = require(`gatsby-source-filesystem`)
// highlight-end
```
-Then export a new function `onCreateNode`, and call `createRemoteFileNode` in it whenever a node of of type `Post` is created:
+Then export a new function `onCreateNode`, and call `createRemoteFileNode` in it whenever a node of type `Post` is created:
```javascript:title=source-plugin/gatsby-node.js
// called each time a node is created
From 44cbb14010b36a3bbe41b437314b0a1624b0b6a8 Mon Sep 17 00:00:00 2001
From: Muescha <184316+muescha@users.noreply.github.com>
Date: Fri, 22 May 2020 16:41:28 +0200
Subject: [PATCH 028/288] fix(docs): brand name Webpack to webpack (#22906)
---
.../index.md | 2 +-
docs/blog/2017-09-26-embracing-graphql/index.md | 2 +-
docs/blog/2017-10-03-smartive-goes-gatsby/index.md | 2 +-
.../index.md | 2 +-
docs/blog/2017-11-06-migrate-hugo-gatsby/index.md | 4 ++--
.../index.md | 6 +++---
.../2017-12-07-taking-gatsby-for-a-spin/index.md | 2 +-
.../index.md | 4 ++--
.../2018-05-11-six-reasons-i-chose-gatsby/index.md | 2 +-
docs/blog/2018-06-08-life-after-layouts/index.md | 2 +-
.../2018-06-18-why-narative-loves-gatsby/index.md | 2 +-
docs/blog/2018-2-7-jam-out-your-blog/index.md | 4 ++--
.../2019-03-05-dot-org-messaging-survey/index.md | 2 +-
.../index.md | 6 +++---
docs/blog/2019-04-19-gatsby-why-we-write/index.md | 2 +-
docs/contributing/gatsby-style-guide.md | 1 +
docs/contributing/how-to-pitch-gatsby.md | 2 +-
docs/docs/add-custom-webpack-config.md | 4 ++--
docs/docs/asset-prefix.md | 2 +-
docs/docs/data-storage-redux.md | 2 +-
docs/docs/environment-variables.md | 4 ++--
docs/docs/gatsby-in-the-enterprise.md | 2 +-
docs/docs/gatsby-internals-terminology.md | 2 +-
docs/docs/gatsby-lifecycle-apis.md | 2 +-
docs/docs/gatsby-project-structure.md | 2 +-
docs/docs/going-gatsby-only.md | 2 +-
docs/docs/how-code-splitting-works.md | 10 +++++-----
docs/docs/html-generation.md | 2 +-
docs/docs/importing-assets-into-files.md | 12 ++++++------
docs/docs/importing-media-content.md | 4 ++--
docs/docs/localization-i18n.md | 2 +-
docs/docs/production-app.md | 8 ++++----
docs/docs/resource-handling-and-service-workers.md | 2 +-
docs/docs/static-folder.md | 2 +-
docs/docs/theme-api.md | 2 +-
docs/docs/webpack-and-ssr.md | 4 ++--
docs/docs/write-pages.md | 4 ++--
docs/starters.yml | 6 +++---
examples/using-stylus/README.md | 2 +-
packages/gatsby/CHANGELOG.md | 10 +++++-----
www/src/data/sidebars/doc-links.yaml | 6 +++---
41 files changed, 73 insertions(+), 72 deletions(-)
diff --git a/docs/blog/2017-02-21-1-0-progress-update-where-came-from-where-going/index.md b/docs/blog/2017-02-21-1-0-progress-update-where-came-from-where-going/index.md
index 2006d3e7bf8da..75dd2b6a14565 100644
--- a/docs/blog/2017-02-21-1-0-progress-update-where-came-from-where-going/index.md
+++ b/docs/blog/2017-02-21-1-0-progress-update-where-came-from-where-going/index.md
@@ -58,7 +58,7 @@ It wraps three of the most popular web app tools into a cohesive website
framework:
- [React](https://reactjs.org/) from Facebook for building UIs
-- [Webpack](https://webpack.js.org/) for bundling JavaScript and CSS
+- [webpack](https://webpack.js.org/) for bundling JavaScript and CSS
- [GraphQL](https://graphql.org/) from Facebook for declarative data queries
While designing Gatsby, I wanted a synthesis of two of my favorite developer
diff --git a/docs/blog/2017-09-26-embracing-graphql/index.md b/docs/blog/2017-09-26-embracing-graphql/index.md
index 9909e6e6a8461..e657b468cff8a 100644
--- a/docs/blog/2017-09-26-embracing-graphql/index.md
+++ b/docs/blog/2017-09-26-embracing-graphql/index.md
@@ -21,7 +21,7 @@ Gatsby at the time was still pre-1.0 but its workflow met my needs. I loved that
I could drop my existing Markdown files into a `pages` directory and Gatsby
would do the rest.
-Webpack loader —> React.js wrapper component —> static HTML page. Done.
+webpack loader —> React.js wrapper component —> static HTML page. Done.
Well...done until I read this
[GitHub Issue](https://github.com/gatsbyjs/gatsby/issues/420) … "New GraphQL
diff --git a/docs/blog/2017-10-03-smartive-goes-gatsby/index.md b/docs/blog/2017-10-03-smartive-goes-gatsby/index.md
index 606e8e3ffe0d8..7818b08ced670 100644
--- a/docs/blog/2017-10-03-smartive-goes-gatsby/index.md
+++ b/docs/blog/2017-10-03-smartive-goes-gatsby/index.md
@@ -36,7 +36,7 @@ the major drawbacks at that time were:
- Pulling in external resources, such as blog posts, was quite unhandy and
sometimes even impossible
- Build process optimization was almost impossible and in our case resulted in a
- Webpack setup on top of Wintersmith which was not really maintainable
+ webpack setup on top of Wintersmith which was not really maintainable
### React to the Rescue!
diff --git a/docs/blog/2017-10-05-portfolio-site-gatsby-wordpress/index.md b/docs/blog/2017-10-05-portfolio-site-gatsby-wordpress/index.md
index 2c6074ba3bc36..4967662d1e95a 100644
--- a/docs/blog/2017-10-05-portfolio-site-gatsby-wordpress/index.md
+++ b/docs/blog/2017-10-05-portfolio-site-gatsby-wordpress/index.md
@@ -33,7 +33,7 @@ video on
[GatsbyJS](/) is a static site generator, similar to Jekyll, however it is
written using [React](https://reactjs.org/) and allows you to write your pages
as React components! It is somewhat similar to create-react-app where almost all
-the scary Webpack config has been abstracted away from you and everything is
+the scary webpack config has been abstracted away from you and everything is
setup ready to go, so you can get to the important stuff like...building the
site! (If you are a fan of React and not convinced, the
[React website/docs](https://reactjs.org/) were just released using Gatsby!)
diff --git a/docs/blog/2017-11-06-migrate-hugo-gatsby/index.md b/docs/blog/2017-11-06-migrate-hugo-gatsby/index.md
index 86985b79c4b4e..171625acf66a9 100644
--- a/docs/blog/2017-11-06-migrate-hugo-gatsby/index.md
+++ b/docs/blog/2017-11-06-migrate-hugo-gatsby/index.md
@@ -39,7 +39,7 @@ to classical CMS comparing to Gatsby workflows.
As it's an older ecosystem, when you need a ready plugin or a theme for quick
gratification, it's more likely to find something ready online for Hugo.
-Gatsby, on the other hand, is based on React, GraphQL, Webpack and its way of
+Gatsby, on the other hand, is based on React, GraphQL, webpack and its way of
thinking is closer to how a developer would approach the problems from a
single-page-application point of view.
@@ -59,7 +59,7 @@ For me, using Gatsby is
[valuable learning experience](https://kalinchernev.github.io/learn-gatsbyjs)
and it has also been so easy to work with, it feels "unfair". For example, the
plugin system of Gatsby keeps me sane and productive, even in cases where I know
-only the briefest overview concepts of Webpack. Without Gatsby, I might have
+only the briefest overview concepts of webpack. Without Gatsby, I might have
spent hours and days configuring what Gatsby provides out of the box.
Last, but not least, the biggest benefit of using Gatsby compared to Hugo, is
diff --git a/docs/blog/2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful/index.md b/docs/blog/2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful/index.md
index 84ff0710d97a9..19e528a316a56 100644
--- a/docs/blog/2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful/index.md
+++ b/docs/blog/2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful/index.md
@@ -190,11 +190,11 @@ That would give us the best of both worlds, right?
Well, a guy named [Kyle Mathews](https://github.com/KyleAMathews) already
thought of that and created Gatsby.js.
-## Generating static websites with React and Webpack
+## Generating static websites with React and webpack
A little disclaimer: I absolutely love React, so, when I first learned that
there were some emerging Static Site Generators who leveraged only React and
-Webpack, I knew that I had to try at least one of them for the new upcoming blog
+webpack, I knew that I had to try at least one of them for the new upcoming blog
I was planning to build. These projects were [Gatsby.js](https://gatsbyjs.org/)
and [Phenomic](https://phenomic.io/), and both were still quite young back then,
neither of them having reached the 1.0 release yet.
@@ -238,7 +238,7 @@ was completely mindblown.
https://giphy.com/gifs/tim-and-eric-mind-blown-EldfH1VJdbrwY
-Not only did it have all the standard goodness of a typical React/Webpack static
+Not only did it have all the standard goodness of a typical React/webpack static
site generator (CSS Modules, PostCSS, Hot Reloading, etc), but more importantly,
it integrated an incredibly ingenious GraphQL layer which allowed the developer
to query and fetch data from practically everywhere on the web!
diff --git a/docs/blog/2017-12-07-taking-gatsby-for-a-spin/index.md b/docs/blog/2017-12-07-taking-gatsby-for-a-spin/index.md
index acba5d303930f..44f7210575588 100644
--- a/docs/blog/2017-12-07-taking-gatsby-for-a-spin/index.md
+++ b/docs/blog/2017-12-07-taking-gatsby-for-a-spin/index.md
@@ -29,7 +29,7 @@ Gatsby was my first introduction to [GraphQL](https://graphql.org/learn/) and I'
With an eye on the future, Gatsby already implements lots of Googles so called '**P**ush, **R**ender **P**re-Cache and **L**azy-load pattern (PRPL, I'm not sure if that acronym will catch on). Gatsby takes care of the pre-loading and code-splitting, which makes browsing around Gatsby sites an insanely fast experience. PRPL + the gatsby offline plugin mean that your site will be considered a PWA, will load insanely fast on any device and scores great in Google lighthouse. Read more on [PRPL](/docs/prpl-pattern/).
-### Webpack and Plugins
+### webpack and Plugins
Can you say React without webpack? I can hardly say `hello world` without webpack anymore, although I'm still not sure how to configure it right on the first go. Gatsby comes with an extensive webpack configuration and you don't really need to touch if you don't want to. If you do, you can modify and add to the default configuration with a plugin or in the `gatsby-node` file. There's already a great range of plugins so most likely any webpack tweak is a plugin install away. With all the plenty of good examples, it’s often straightforward to write your own plugin too.
diff --git a/docs/blog/2018-03-29-migration-from-wordpress-to-gatsby/index.md b/docs/blog/2018-03-29-migration-from-wordpress-to-gatsby/index.md
index 5c77c4984ca6e..2de4da5139352 100644
--- a/docs/blog/2018-03-29-migration-from-wordpress-to-gatsby/index.md
+++ b/docs/blog/2018-03-29-migration-from-wordpress-to-gatsby/index.md
@@ -56,7 +56,7 @@ There are many factors to consider. Maturity is important as it means a big comm
### Modern technologies
-Gatsby is built with a lot of interesting technologies. If you are a frontend developer, you'll probably be familiar with most of these, so adoption should be quick. If not, it gives you chance to learn a lot of interesting stuff. Gatsby is powered by React. You'll be able to nicely structure your project to components and use all the existing React components there not specifically developed for Gatsby. For styling, you can attach plain old CSS stylesheet, but Gatsby offers many more choices like Sass, Glamor, Styled Components, Stylus, Less or Styled JSX. Gatsby is built on top of Webpack. And it can generate offline-ready Progressive Web App and uses GraphQL for querying data.
+Gatsby is built with a lot of interesting technologies. If you are a frontend developer, you'll probably be familiar with most of these, so adoption should be quick. If not, it gives you chance to learn a lot of interesting stuff. Gatsby is powered by React. You'll be able to nicely structure your project to components and use all the existing React components there not specifically developed for Gatsby. For styling, you can attach plain old CSS stylesheet, but Gatsby offers many more choices like Sass, Glamor, Styled Components, Stylus, Less or Styled JSX. Gatsby is built on top of webpack. And it can generate offline-ready Progressive Web App and uses GraphQL for querying data.
### Data sources and GraphQL
@@ -68,7 +68,7 @@ What's really powerful is using GraphQL as the query language. Because when quer
### Performance
-One of the Gatsby's greatest advantages is performance. I mean - performance on top of what you get by switching to a static site generator. Since Gatsby uses Webpack, it allows code splitting by route. That means when accessing a page on your site, the client will download only code and resources necessary for the current sub-page and not the whole bundle. When navigating to another route, it will just fetch what's new. Gatsby also sticks to the Progressive Web App standard. That means your site can behave as a native-like app on mobile and work with a poor connection or even offline. What's more, Gatsby utilizes the [PRPL Pattern](https://developers.google.com/web/fundamentals/performance/prpl-pattern/). That means first push critical resources over HTTP/2 to the client, which is faster than waiting for the browser to download HTML first, parse it and then request additional stylesheets, scripts and resources linked in the HTML. Gatsby first renders static HTML version of the initial route to minimize time-to-interactive. Then in the background, it loads the bundle and initializes a Single Page App. It then starts to pre-fetch resources for the routes linked to the initial page so additional navigation within your site is blazing fast and without reload.
+One of the Gatsby's greatest advantages is performance. I mean - performance on top of what you get by switching to a static site generator. Since Gatsby uses webpack, it allows code splitting by route. That means when accessing a page on your site, the client will download only code and resources necessary for the current sub-page and not the whole bundle. When navigating to another route, it will just fetch what's new. Gatsby also sticks to the Progressive Web App standard. That means your site can behave as a native-like app on mobile and work with a poor connection or even offline. What's more, Gatsby utilizes the [PRPL Pattern](https://developers.google.com/web/fundamentals/performance/prpl-pattern/). That means first push critical resources over HTTP/2 to the client, which is faster than waiting for the browser to download HTML first, parse it and then request additional stylesheets, scripts and resources linked in the HTML. Gatsby first renders static HTML version of the initial route to minimize time-to-interactive. Then in the background, it loads the bundle and initializes a Single Page App. It then starts to pre-fetch resources for the routes linked to the initial page so additional navigation within your site is blazing fast and without reload.
Gatsby also works great with images, which are usually a big hit to site's performance. Based on the screen size and resolution of the client device, it will serve appropriate image size. It supports WebP and can convert your jpegs to progressive jpegs. While the images are loading, it will reserve the space required by the image, so the content of the page is not 'hopping' after image loads. It also replaces the image with a blurred version or monochromatic SVG until it loads - similar to what Medium uses.
diff --git a/docs/blog/2018-05-11-six-reasons-i-chose-gatsby/index.md b/docs/blog/2018-05-11-six-reasons-i-chose-gatsby/index.md
index d1067a0f72d8e..6e23454dae85d 100644
--- a/docs/blog/2018-05-11-six-reasons-i-chose-gatsby/index.md
+++ b/docs/blog/2018-05-11-six-reasons-i-chose-gatsby/index.md
@@ -16,7 +16,7 @@ I've been working with React for the better part of 3.5 years. I know it. I'm ef
## #2: An extensive, well-architected plugin system
-One of the first things about Gatsby that impressed me was its plugin system. Like many other OSS tools such as Webpack and Babel, much of the power of Gatsby is provided by plugins. And that's a good thing. Its plugin architecture allows for incredibly deep integrations into almost every aspect of Gatsby: build configuration, data extraction and transformation, the build process, the browser at runtime, etc. This system has allowed not only the core Gatsby team to create powerful plugins, but the community to create equally powerful plugins as well. I've even tried my hand at [writing one](https://github.com/raygesualdo/gatsby-plugin-settings) (quite successfully, I might add). If there's a task you're looking to accomplish with Gatsby, odds are there is already a plugin for it. And if not, there's [plenty of documentation](/docs/plugins/) to help you get started writing one.
+One of the first things about Gatsby that impressed me was its plugin system. Like many other OSS tools such as webpack and Babel, much of the power of Gatsby is provided by plugins. And that's a good thing. Its plugin architecture allows for incredibly deep integrations into almost every aspect of Gatsby: build configuration, data extraction and transformation, the build process, the browser at runtime, etc. This system has allowed not only the core Gatsby team to create powerful plugins, but the community to create equally powerful plugins as well. I've even tried my hand at [writing one](https://github.com/raygesualdo/gatsby-plugin-settings) (quite successfully, I might add). If there's a task you're looking to accomplish with Gatsby, odds are there is already a plugin for it. And if not, there's [plenty of documentation](/docs/plugins/) to help you get started writing one.
## #3: The data fetching layer
diff --git a/docs/blog/2018-06-08-life-after-layouts/index.md b/docs/blog/2018-06-08-life-after-layouts/index.md
index 19d3c35ea6a55..7fcb64ce70572 100644
--- a/docs/blog/2018-06-08-life-after-layouts/index.md
+++ b/docs/blog/2018-06-08-life-after-layouts/index.md
@@ -120,7 +120,7 @@ Removing layouts isn't the only improvement coming in Gatsby V2. We're really ex
https://twitter.com/gatsbyjs/status/974507205121617920
- We can now add GraphQL queries to any component in our app (not just page components) using [`StaticQuery`](/docs/static-query/)
-- Upgraded to the latest versions of React, Babel, Webpack, and other libraries Gatsby depends on
+- Upgraded to the latest versions of React, Babel, webpack, and other libraries Gatsby depends on
- Better support for CSS inlining and splitting, which will boost performance
For a full list of what's new, check out our [V2 migration guide](/docs/migrating-from-v1-to-v2/) and [_What’s New in Gatsby V2?_](/blog/2018-06-16-announcing-gatsby-v2-beta-launch/).
diff --git a/docs/blog/2018-06-18-why-narative-loves-gatsby/index.md b/docs/blog/2018-06-18-why-narative-loves-gatsby/index.md
index 68e31075c18ad..8552eec2ce890 100644
--- a/docs/blog/2018-06-18-why-narative-loves-gatsby/index.md
+++ b/docs/blog/2018-06-18-why-narative-loves-gatsby/index.md
@@ -29,7 +29,7 @@ Great performance out-of-the-box is a huge win. Our team does not have to focus
## Developing with Gatsby is fast, really fast
-Gatsby does not only allow us to deliver fast websites, it has also sped up our development time. The developer experience is another focus of the team behind Gatsby - and it shows. Features such as live reload are ready to go at when you start a new project. There's no need to setup a custom Webpack configuration as the basics are completed for you. Building your website and deploying is also carefully thought out by Gatsby and often requires running a single command and using one of the many integrations for hosting. Furthermore, the documentation is comprehensive and has plenty of content from introductory guides to complex use cases. This has been amazing for training and on boarding new members of our team, especially if they're already familiar with React.
+Gatsby does not only allow us to deliver fast websites, it has also sped up our development time. The developer experience is another focus of the team behind Gatsby - and it shows. Features such as live reload are ready to go at when you start a new project. There's no need to setup a custom webpack configuration as the basics are completed for you. Building your website and deploying is also carefully thought out by Gatsby and often requires running a single command and using one of the many integrations for hosting. Furthermore, the documentation is comprehensive and has plenty of content from introductory guides to complex use cases. This has been amazing for training and on boarding new members of our team, especially if they're already familiar with React.
## Separation between view and data layers
diff --git a/docs/blog/2018-2-7-jam-out-your-blog/index.md b/docs/blog/2018-2-7-jam-out-your-blog/index.md
index 671e8844fff9e..544d264516b81 100644
--- a/docs/blog/2018-2-7-jam-out-your-blog/index.md
+++ b/docs/blog/2018-2-7-jam-out-your-blog/index.md
@@ -28,7 +28,7 @@ https://giphy.com/gifs/tom-cruise-top-gun-WDtCGLCXBAgow
### Like Josh’s requirements, my list includes:
- **Speed** - this includes development, website performance, and deployment
-- **Development Experience** - I want to use React and Webpack
+- **Development Experience** - I want to use React and webpack
- **Maintainability** - ease with which anyone can create, update and delete posts
- **Scalability** - need to make sure that performance is not hindered by a growing needs
- **Lean** - simplify the tools and services use to a bare minimum
@@ -111,7 +111,7 @@ Let’s summarize where we are and why [Netlify](https://www.netlify.com/) will
[x] Speed - this includes development, website performance, and deployment
-[x] Development Experience - I want to use React and Webpack
+[x] Development Experience - I want to use React and webpack
[x] Maintainability - ease with which anyone can create, update and delete posts
diff --git a/docs/blog/2019-03-05-dot-org-messaging-survey/index.md b/docs/blog/2019-03-05-dot-org-messaging-survey/index.md
index 8aa5b7eea3585..8c84f06ada0a3 100644
--- a/docs/blog/2019-03-05-dot-org-messaging-survey/index.md
+++ b/docs/blog/2019-03-05-dot-org-messaging-survey/index.md
@@ -89,7 +89,7 @@ At companies, 43% said this was crucial. “It's f\*cking fast to dev with, ulti
Many people still marked these values as crucial things that Gatsby gives them. Just not as many people marked these as crucial as the top three values listed above, though we know they are still crucial to some! Here they are:
- Best of both worlds: Gatsby empowers creators to build web experiences that leverage the benefits of both static sites (SEO friendly, fast) and web applications (dynamic data, interactive) — simultaneously.
-- Build with modern tools: Leverage the power of the latest web technologies including React, Webpack, GraphQL, modern JavaScript, and more.
+- Build with modern tools: Leverage the power of the latest web technologies including React, webpack, GraphQL, modern JavaScript, and more.
- Bring your own content: Gatsby consolidates your data (source agnostic- CMS, static files, database, etc.) into a single, predictable, queryable layer.
- Low to no hosting costs: Gatsby eliminates the need for traditional hosting costs because the site is hosted on the edge (Content Delivery Network).
- Instantly scalable: No servers and no databases to manage with a website that never goes down because it’s built on the edge, instantly scaling for traffic spikes.
diff --git a/docs/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/index.md b/docs/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/index.md
index 1f531d5850430..342ea0935df0b 100644
--- a/docs/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/index.md
+++ b/docs/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/index.md
@@ -195,7 +195,7 @@ export default function Contact() {
Pretty vanilla looking component! We are rendering a `form` with some validation and functionality provided by the excellent libraries [`yup`](https://www.npmjs.com/package/yup) and [`Formik`](https://github.com/jaredpalmer/formik). The likelihood that these libraries are used in _all_ routes in our application is unlikely--yet this is traditionally the approach that many take with bundling their client-side JS libraries. This means that even if a particular route (e.g. `/about`) is _not using_ certain libraries that they will still likely be included in a monolithic JavaScript bundle containing all dependencies. However--Gatsby, your friendly _web app compiler_, is a little smarter!
-We use code-splitting (enabled via our internalized dependency [Webpack](https://webpack.js.org)), and in particular, our approach prioritizes app-level dependencies (libraries used by the majority or all routes) coupled with route-based code splitting for dependencies that are likely only used on a particular route. To more fully understand this, let's take a look at a sample structure produced by our build process: `gatsby build`.
+We use code-splitting (enabled via our internalized dependency [webpack](https://webpack.js.org)), and in particular, our approach prioritizes app-level dependencies (libraries used by the majority or all routes) coupled with route-based code splitting for dependencies that are likely only used on a particular route. To more fully understand this, let's take a look at a sample structure produced by our build process: `gatsby build`.
```text:title=public/
├── 404
@@ -232,7 +232,7 @@ are bundled on _every_ route because they are used on _every_ route.
Consider the output of [`webpack-bundle-analyzer`](https://github.com/webpack-contrib/webpack-bundle-analyzer), which makes this even clearer.
-![Webpack Bundle Analyzer](./images/bundle-analyzer.png)
+![webpack Bundle Analyzer](./images/bundle-analyzer.png)
### `component---{route-name}-{unique-hash}.js`
@@ -317,7 +317,7 @@ To tie it all together, the build process produces a `contact/index.html` file c
This is an optimized, HTML representation of the React component at `src/pages/contact.js` containing the **minimal** resources required for the page. Our users only load the resources they need for every single route. No more, no less. 🔥
-_Want to dive deeper? Much of this is encapsulated in our internal [Webpack config](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js)_
+_Want to dive deeper? Much of this is encapsulated in our internal [webpack config](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js)_
## Modern APIs in Gatsby
diff --git a/docs/blog/2019-04-19-gatsby-why-we-write/index.md b/docs/blog/2019-04-19-gatsby-why-we-write/index.md
index ec8b02a20f4ea..0813f75d2f511 100644
--- a/docs/blog/2019-04-19-gatsby-why-we-write/index.md
+++ b/docs/blog/2019-04-19-gatsby-why-we-write/index.md
@@ -29,7 +29,7 @@ The answer:
## Principle 2: content acts as a guide unlocking the power of Gatsby.
-Gatsby is so powerful, because of its core _and the ecosystem_ — not just plugins and themes, but React, Webpack and Babel, the entire npm ecosystem, and modern JavaScript in general.
+Gatsby is so powerful, because of its core _and the ecosystem_ — not just plugins and themes, but React, webpack and Babel, the entire npm ecosystem, and modern JavaScript in general.
You can do almost anything you want with Gatsby, you just have to:
diff --git a/docs/contributing/gatsby-style-guide.md b/docs/contributing/gatsby-style-guide.md
index 3741e1315c43a..8efa9ed6c96e3 100644
--- a/docs/contributing/gatsby-style-guide.md
+++ b/docs/contributing/gatsby-style-guide.md
@@ -384,6 +384,7 @@ Proper nouns should use correct capitalization when possible. Below is a list of
- JavaScript (capital letters in "J" and "S" and no abbreviations)
- Markdown
- Node.js
+- webpack ([should always in lower-case letters, even at the beginning of a sentence](https://webpack.js.org/branding/#the-name))
A full-stack developer (adjective form with a dash) works on the full stack
(noun form with no dash). The same goes with many other compound terms.
diff --git a/docs/contributing/how-to-pitch-gatsby.md b/docs/contributing/how-to-pitch-gatsby.md
index 2fcfee24410bb..c7f8de08cec57 100644
--- a/docs/contributing/how-to-pitch-gatsby.md
+++ b/docs/contributing/how-to-pitch-gatsby.md
@@ -15,7 +15,7 @@ Build blazing-fast websites without the hosting hassles of managing complex, cos
- **Simple:** No servers. No databases. Traditional hosting is time consuming, costly, complex, and puts your site at risk of crashing if your content goes viral. Avoid the pitfalls of hosting with a serverless architecture. A site that never goes down because it’s built on the edge, instantly scaling for traffic spikes.
-- **Trusted:** Leverage the power of the latest web technologies including React, Webpack, GraphQL, modern JavaScript, and more. Get the best of both worlds—all the power and conveniences from React and its ecosystem with a really slick and responsive user experience.
+- **Trusted:** Leverage the power of the latest web technologies including React, webpack, GraphQL, modern JavaScript, and more. Get the best of both worlds—all the power and conveniences from React and its ecosystem with a really slick and responsive user experience.
- **Flexible with the Content Mesh:** Build websites quickly and deploy them safely, no matter where your content lives. Load data from your CMS, static files, a database, or from multiple places at once. Your marketing team is happy because they can use the content management tools they’re familiar with (WordPress, Drupal, Contentful, Shopify).
diff --git a/docs/docs/add-custom-webpack-config.md b/docs/docs/add-custom-webpack-config.md
index 511c396d7117e..893ed6a10079d 100644
--- a/docs/docs/add-custom-webpack-config.md
+++ b/docs/docs/add-custom-webpack-config.md
@@ -1,5 +1,5 @@
---
-title: "Adding a Custom Webpack Config"
+title: "Adding a Custom webpack Config"
---
_Before creating custom webpack configuration, check to see if there's a Gatsby plugin already built that handles your use case in the [plugins section](/docs/plugins/). If there's not yet one and your use case is a general one, it is highly encouraged you to contribute back your plugin to the Gatsby Plugin Library so it's available to others (including your future self)._
@@ -73,7 +73,7 @@ exports.onCreateWebpackConfig = ({ stage, actions }) => {
}
```
-You can always find more information on _resolve_ and other options in the official [Webpack docs](https://webpack.js.org/concepts/).
+You can always find more information on _resolve_ and other options in the official [webpack docs](https://webpack.js.org/concepts/).
### Importing non-webpack tools using `yarn`
diff --git a/docs/docs/asset-prefix.md b/docs/docs/asset-prefix.md
index 5bd04e5968e2d..c588e18ef55f0 100644
--- a/docs/docs/asset-prefix.md
+++ b/docs/docs/asset-prefix.md
@@ -83,6 +83,6 @@ This feature works seamlessly with `pathPrefix`. Build out your application with
When using a custom asset prefix with `gatsby-plugin-offline`, your assets can still be cached offline. However, to ensure the plugin works correctly, there are a few things you need to do.
1. Your asset server needs to have the `Access-Control-Allow-Origin` header set either to `*` or your site's origin.
-2. Certain essential resources need to be available on your content server (i.e. the one used to serve pages). This includes `sw.js`, as well as resources to precache: the Webpack bundle, the app bundle, the manifest (and any icons referenced), and the resources for the offline plugin app shell.
+2. Certain essential resources need to be available on your content server (i.e. the one used to serve pages). This includes `sw.js`, as well as resources to precache: the webpack bundle, the app bundle, the manifest (and any icons referenced), and the resources for the offline plugin app shell.
You can find most of these by looking for the `self.__precacheManifest` variable in your generated `sw.js`. Remember to also include `sw.js` itself, and any icons referenced in your `manifest.webmanifest` if you have one. To check your service worker is functioning as expected, look in Application → Service Workers in your browser dev tools, and check for any failed resources in the Console/Network tabs.
diff --git a/docs/docs/data-storage-redux.md b/docs/docs/data-storage-redux.md
index ad8c317464ff8..967f1231aaa81 100644
--- a/docs/docs/data-storage-redux.md
+++ b/docs/docs/data-storage-redux.md
@@ -14,7 +14,7 @@ The namespaces in Gatsby's Redux store are a great overview of the Gatsby intern
- **[Components](/docs/gatsby-internals-terminology/#component)** - A `Map` of component file paths to page objects.
- **[Static Query Components](/docs/static-vs-normal-queries/#keeping-track-of-site-queries-during-build-in-redux-stores)** - A `Map` of any components detected with a [static query](/docs/static-query/).
- **Jobs** - Long-running and CPU-intensive processes, generally started as a side-effect to a GraphQL query. Gatsby doesn’t finish its process until all jobs are ended.
-- **Webpack** - Config for the [Webpack](/docs/webpack-and-ssr/) bundler which handles code optimization and splitting of delivered javascript bundles.
+- **webpack** - Config for the [webpack](/docs/webpack-and-ssr/) bundler which handles code optimization and splitting of delivered javascript bundles.
The Gatsby [redux index file](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby/src/redux/index.ts) has two key exports, `store` and `emitter`. Throughout the bootstrap and build phases, `store` is used to get the current state and dispatch actions, while `emitter` is used to register listeners for particular actions. The store is also made available to Gatsby users through the [Node APIs](/docs/node-apis/).
diff --git a/docs/docs/environment-variables.md b/docs/docs/environment-variables.md
index 870bb799d5aec..bf16eb3ec0552 100644
--- a/docs/docs/environment-variables.md
+++ b/docs/docs/environment-variables.md
@@ -24,7 +24,7 @@ If you want to define other environments then you'll need to do a little more wo
All of the Project and OS Env Vars are only directly available at build time, or
when Node.js is running. They aren't immediately available at run time of the client code; they
need to be actively captured and embedded into client-side JavaScript.
-This is achieved during the build using Webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/).
+This is achieved during the build using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/).
Once the environment variables have been embedded into the client-side code, they are accessible from the
global variable `process.env`.
@@ -91,7 +91,7 @@ GATSBY_API_URL=https://example.com/api
API_KEY=927349872349798
```
-Note: since Gatsby uses the [Webpack DefinePlugin](https://webpack.js.org/plugins/define-plugin/) to make the environment variables available at runtime, they cannot be destructured from `process.env`; instead, they have to be fully referenced.
+Note: since Gatsby uses the [webpack DefinePlugin](https://webpack.js.org/plugins/define-plugin/) to make the environment variables available at runtime, they cannot be destructured from `process.env`; instead, they have to be fully referenced.
`GATSBY_API_URL` will be available to your site (Client-side and server-side) as `process.env.GATSBY_API_URL`.:
diff --git a/docs/docs/gatsby-in-the-enterprise.md b/docs/docs/gatsby-in-the-enterprise.md
index e982e2df40585..a0c1163c705e0 100644
--- a/docs/docs/gatsby-in-the-enterprise.md
+++ b/docs/docs/gatsby-in-the-enterprise.md
@@ -24,7 +24,7 @@ A related challenge is how to continue to attract and retain top engineering tal
Surveys at enterprises adopting Gatsby have found that developers there highlight benefits such as:
-**1. The ability to build with modern tools such as React, Webpack, and GraphQL.** Adopting more common frameworks, rather than custom in-house tooling, tends to increases developer satisfaction, developer productivity, and the ability to recruit developers.
+**1. The ability to build with modern tools such as React, webpack, and GraphQL.** Adopting more common frameworks, rather than custom in-house tooling, tends to increases developer satisfaction, developer productivity, and the ability to recruit developers.
**2. The ability to be productive from the start.** Reduced time on dev and build tooling setup / configuration helps developers get going right away. The burden of maintaining high-quality tooling setups is offloaded from internal tooling teams (and managers) to the Gatsby maintainer team.
diff --git a/docs/docs/gatsby-internals-terminology.md b/docs/docs/gatsby-internals-terminology.md
index 0f608fa006dbb..02b8816ed26ba 100644
--- a/docs/docs/gatsby-internals-terminology.md
+++ b/docs/docs/gatsby-internals-terminology.md
@@ -189,7 +189,7 @@ export const pageQuery = graphql`
`
```
-## Webpack stuff
+## webpack stuff
### /.cache/async-requires.js
diff --git a/docs/docs/gatsby-lifecycle-apis.md b/docs/docs/gatsby-lifecycle-apis.md
index 77e984f7428ab..75c0a17eb54ba 100644
--- a/docs/docs/gatsby-lifecycle-apis.md
+++ b/docs/docs/gatsby-lifecycle-apis.md
@@ -44,7 +44,7 @@ During the main bootstrap sequence, Gatsby (in this order):
- writes page redirects (if any) to `.cache/redirects.json`
- the [onPostBootstrap](/docs/node-apis/#onPostBootstrap) lifecycle is executed
-In development this is a running process powered by [Webpack](https://github.com/gatsbyjs/gatsby/blob/dd91b8dceb3b8a20820b15acae36529799217ae4/packages/gatsby/package.json#L128) and [`react-hot-loader`](https://github.com/gatsbyjs/gatsby/blob/dd91b8dceb3b8a20820b15acae36529799217ae4/packages/gatsby/package.json#L104), so changes to any files get re-run through the sequence again, with [smart cache invalidation](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c995c760fe380769852bcdb26a2278/packages/gatsby/src/bootstrap/index.js#L141). For example, `gatsby-source-filesystem` watches files for changes, and each change triggers re-running queries. Other plugins may also perform this service. Queries are also watched, so if you modify a query, your development app is hot reloaded.
+In development this is a running process powered by [webpack](https://github.com/gatsbyjs/gatsby/blob/dd91b8dceb3b8a20820b15acae36529799217ae4/packages/gatsby/package.json#L128) and [`react-hot-loader`](https://github.com/gatsbyjs/gatsby/blob/dd91b8dceb3b8a20820b15acae36529799217ae4/packages/gatsby/package.json#L104), so changes to any files get re-run through the sequence again, with [smart cache invalidation](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c995c760fe380769852bcdb26a2278/packages/gatsby/src/bootstrap/index.js#L141). For example, `gatsby-source-filesystem` watches files for changes, and each change triggers re-running queries. Other plugins may also perform this service. Queries are also watched, so if you modify a query, your development app is hot reloaded.
The core of the bootstrap process is the "api-runner", which helps to execute APIs in sequence, with state managed in Redux. Gatsby exposes a number of lifecycle APIs which can either be implemented by you (or any of your configured plugins) in `gatsby-node.js`, `gatsby-browser.js` or `gatsby-ssr.js`.
diff --git a/docs/docs/gatsby-project-structure.md b/docs/docs/gatsby-project-structure.md
index 69511560051c4..12472662ba4dc 100644
--- a/docs/docs/gatsby-project-structure.md
+++ b/docs/docs/gatsby-project-structure.md
@@ -34,7 +34,7 @@ Inside a Gatsby project, you may see some or all of the following folders and fi
- **`/templates`** Contains templates for programmatically creating pages. Check out the [templates docs](/docs/building-with-components/#page-template-components) for more detail.
- **`html.js`** For custom configuration of default .cache/default_html.js. Check out the [custom html docs](/docs/custom-html/) for more detail.
-- **`/static`** If you put a file into the static folder, it will not be processed by Webpack. Instead it will be copied into the public folder untouched. Check out the [assets docs](/docs/static-folder/#adding-assets-outside-of-the-module-system) for more detail.
+- **`/static`** If you put a file into the static folder, it will not be processed by webpack. Instead it will be copied into the public folder untouched. Check out the [assets docs](/docs/static-folder/#adding-assets-outside-of-the-module-system) for more detail.
## Files
diff --git a/docs/docs/going-gatsby-only.md b/docs/docs/going-gatsby-only.md
index 3a31a818d6533..441e32da69860 100644
--- a/docs/docs/going-gatsby-only.md
+++ b/docs/docs/going-gatsby-only.md
@@ -17,7 +17,7 @@ One example of this is [Narative.co](https://www.narative.co/), based in Montrea
> Gatsby allows our team to use the powerful React API when creating page based websites with almost no drawbacks. All the principles and techniques we’ve learned from using React for the last few years can be leveraged with Gatsby. This has enabled us to create a team that is extremely dynamic and cohesive without the worry of creating silos or losing knowledge across teams. Our team is able to learn once, write everywhere. With an engineering team that’s familiar with React and Gatsby we’re able to tackle more problems faster, which is highly beneficial to our partners and the services we offer.
-> Gatsby does not only allow us to deliver fast websites, it has also sped up our development time. The developer experience is another focus of the team behind Gatsby - and it shows. Features such as live reload are ready to go at when you start a new project. There’s no need to setup a custom Webpack configuration as the basics are completed for you. Building your website and deploying is also carefully thought out by Gatsby and often requires running a single command and using one of the many integrations for hosting. Furthermore, the documentation is comprehensive and has plenty of content from introductory guides to complex use cases. This has been amazing for training and on boarding new members of our team, especially if they’re already familiar with React.
+> Gatsby does not only allow us to deliver fast websites, it has also sped up our development time. The developer experience is another focus of the team behind Gatsby - and it shows. Features such as live reload are ready to go at when you start a new project. There’s no need to setup a custom webpack configuration as the basics are completed for you. Building your website and deploying is also carefully thought out by Gatsby and often requires running a single command and using one of the many integrations for hosting. Furthermore, the documentation is comprehensive and has plenty of content from introductory guides to complex use cases. This has been amazing for training and on boarding new members of our team, especially if they’re already familiar with React.
> Many popular CMS tools are tightly coupled to their source of data. Gatsby offers a clear separation between the data and view layer building on top of the Headless CMS principles. The advantage for Narative is that we can develop without CMS lock-in such as WordPress. If our team decides to go with a new view layer the migration would be less painful than migrating all the data as well. Often times flexibility in software means more complexity to manage but in this case the flexibility is in the right spots where it reduces complexity.
diff --git a/docs/docs/how-code-splitting-works.md b/docs/docs/how-code-splitting-works.md
index e0f12809d58a2..fc82de98af5be 100644
--- a/docs/docs/how-code-splitting-works.md
+++ b/docs/docs/how-code-splitting-works.md
@@ -26,17 +26,17 @@ The entry point to webpack (`production-app.js`) [references ./async-requires.js
## Chunk bundle naming
-Great! You've told webpack where you want to code split. But how will these be named on disk? Webpack gives you the ability to customize this via the [chunkFilename](https://webpack.js.org/configuration/output/#output-chunkfilename) configuration in the [output](https://webpack.js.org/configuration/output/) section, which is set by Gatsby in [webpack.config.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js#L135) as:
+Great! You've told webpack where you want to code split. But how will these be named on disk? webpack gives you the ability to customize this via the [chunkFilename](https://webpack.js.org/configuration/output/#output-chunkfilename) configuration in the [output](https://webpack.js.org/configuration/output/) section, which is set by Gatsby in [webpack.config.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js#L135) as:
```text
[name]-[contenthash].js
```
-Content hash is simply a hash of the contents of the chunk that was code split. But what about `name`? You haven't told webpack the "name" of the chunk, other than the filename, which can't be a name since it has slashes in it. Normally, Webpack would replace `[name]` with `[id]` (see [webpack docs](https://webpack.js.org/configuration/output/#output-chunkfilename)). But, it gives us the opportunity to specify the name instead as a comment in the `import block`. In the example above, that's what the `/* webpackChunkName: "component---src-blog-js" */` is doing.
+Content hash is simply a hash of the contents of the chunk that was code split. But what about `name`? You haven't told webpack the "name" of the chunk, other than the filename, which can't be a name since it has slashes in it. Normally, webpack would replace `[name]` with `[id]` (see [webpack docs](https://webpack.js.org/configuration/output/#output-chunkfilename)). But, it gives us the opportunity to specify the name instead as a comment in the `import block`. In the example above, that's what the `/* webpackChunkName: "component---src-blog-js" */` is doing.
## Primer on chunkGroups and chunks
-Before we go on to show how Gatsby maps components to the generated bundle names, you should understand how webpack chunks work. A chunk group represents a logical code split, e.g. a Gatsby page, or the Gatsby core app. The chunk groups might share a bunch of code or libraries. Webpack detects these and creates shared pieces of code. These are chunks, e.g. there might be a chunk for React and other libraries. Then there would be the leftover chunks of core Gatsby JS code for the particular chunk group. This is most easily explained by the below graph.
+Before we go on to show how Gatsby maps components to the generated bundle names, you should understand how webpack chunks work. A chunk group represents a logical code split, e.g. a Gatsby page, or the Gatsby core app. The chunk groups might share a bunch of code or libraries. webpack detects these and creates shared pieces of code. These are chunks, e.g. there might be a chunk for React and other libraries. Then there would be the leftover chunks of core Gatsby JS code for the particular chunk group. This is most easily explained by the below graph.
```dot
digraph {
@@ -75,7 +75,7 @@ digraph {
}
```
-In the above graph, you can see 3 chunk groups: 2 pages and the core Gatsby app. The two pages share a bunch of libraries. Webpack found these common dependencies and created chunks for them. These chunks are id 0 and 1. And you'll see that both page `chunkGroups` depend on them. Each page also depends on its own chunk which represents the page's core code (from its src code in the Gatsby site). These would be id 7 for `component---src-blog-1-js` and 8 for `component---src-blog-2-js`.
+In the above graph, you can see 3 chunk groups: 2 pages and the core Gatsby app. The two pages share a bunch of libraries. webpack found these common dependencies and created chunks for them. These chunks are id 0 and 1. And you'll see that both page `chunkGroups` depend on them. Each page also depends on its own chunk which represents the page's core code (from its src code in the Gatsby site). These would be id 7 for `component---src-blog-1-js` and 8 for `component---src-blog-2-js`.
You can also see the chunk group for `app`. It turns out that this shares no dependencies with the pages. But it does include the webpack runtime whose name is declared in [webpack.config.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js#L390).
@@ -83,7 +83,7 @@ Remember that the chunk group name was assigned by the `/* webpackChunkName: ...
## Referencing chunks in build HTML
-Webpack can now split your code into different bundles, and you've named them appropriately. But those bundles will still be named with a content hash. E.g. for a component `component--src-blog-js`, the output chunk bundle might be named something like `component--src-blog-js-2e49587d85e03a033f58.js`. Webpack will replace `import()` calls with links to the generated bundle filenames. This works great for your pure JavaScript bundles. But things get complicated when generating your page HTML files.
+webpack can now split your code into different bundles, and you've named them appropriately. But those bundles will still be named with a content hash. E.g. for a component `component--src-blog-js`, the output chunk bundle might be named something like `component--src-blog-js-2e49587d85e03a033f58.js`. webpack will replace `import()` calls with links to the generated bundle filenames. This works great for your pure JavaScript bundles. But things get complicated when generating your page HTML files.
HTML file generation is covered under the [Page HTML Generation](/docs/html-generation/) docs. In summary, webpack builds `static-entry.js` which produces a `render-page.js` bundle. This is a function that accepts a page and renders its HTML. The HTML is enough to drive a site, and enhance SEO, but once the page is loaded, Gatsby also loads the JavaScript bundle so that page rendering occurs clientside from then on. This gives the advantage of fast initial page loads combined with client side rendering for future page clicks.
diff --git a/docs/docs/html-generation.md b/docs/docs/html-generation.md
index 17c67cf8fa5a7..9f19170c3a3d0 100644
--- a/docs/docs/html-generation.md
+++ b/docs/docs/html-generation.md
@@ -18,7 +18,7 @@ The high level process is:
2. Build a `render-page.js` that takes a page path and renders its HTML
3. For each page in redux, call `render-page.js`
-## Webpack
+## webpack
For the first step, we use webpack to build an optimized Node.js bundle. The entry point for this is called `static-entry.js`
diff --git a/docs/docs/importing-assets-into-files.md b/docs/docs/importing-assets-into-files.md
index fe41dba845f0b..3f601429d4356 100644
--- a/docs/docs/importing-assets-into-files.md
+++ b/docs/docs/importing-assets-into-files.md
@@ -4,9 +4,9 @@ title: Importing Assets Directly into Files
There are two major ways to import assets, such as images, fonts, and files, into a Gatsby site. The default path is to import the file directly into a Gatsby template, page, or component. The alternative path, which makes sense for some edge cases, is to use the [static folder](/docs/static-folder).
-## Importing assets with Webpack
+## Importing assets with webpack
-With Webpack you can **`import` a file right in a JavaScript module**. This tells Webpack to include that file in the bundle. Unlike CSS imports, importing a file gives you a string value. This imported file's value is the final path you can reference in your code, e.g. as the `src` attribute of an image or the `href` of a link to a PDF.
+With webpack you can **`import` a file right in a JavaScript module**. This tells webpack to include that file in the bundle. Unlike CSS imports, importing a file gives you a string value. This imported file's value is the final path you can reference in your code, e.g. as the `src` attribute of an image or the `href` of a link to a PDF.
To reduce the number of requests to the server, importing images that are less than 10,000 bytes returns a
[data URI](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) instead of a path. This applies to the following file extensions: `svg`, `jpg`, `jpeg`, `png`, `gif`, `mp4`, `webm`, `wav`, `mp3`, `m4a`, `aac`, and `oga`.
@@ -15,7 +15,7 @@ Here's an example:
```jsx
import React from "react"
-import logo from "./logo.png" // Tell Webpack this JS file uses this image
+import logo from "./logo.png" // Tell webpack this JS file uses this image
console.log(logo) // /logo.84287d09.png
@@ -27,7 +27,7 @@ function Header() {
export default Header
```
-This ensures that when the project is built, Webpack will correctly move the images into the public folder, and provide us with correct paths.
+This ensures that when the project is built, webpack will correctly move the images into the public folder, and provide us with correct paths.
You can reference files in CSS to import them, too:
@@ -37,11 +37,11 @@ You can reference files in CSS to import them, too:
}
```
-Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
+webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by webpack from content hashes. If the file content changes in the future, webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
If you're using SCSS the imports are relative to the entry SCSS file.
-Please be advised that this is also a custom feature of Webpack.
+Please be advised that this is also a custom feature of webpack.
` element provides a space for 2-dimensional drawing in a web
[WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL), on the other hand, creates a 3-dimensional space in a web environment using the `