Skip to content

Commit

Permalink
Merge branch 'master' into fix/validate/warnonunknown
Browse files Browse the repository at this point in the history
* master: (125 commits)
  chore(release): Publish next
  fix(gatsby): createNode return promise (gatsbyjs#34399)
  chore(release): Publish next
  fix(gatsby): Wrong route resolved by findPageByPath function (gatsbyjs#34070)
  fix(deps): update typescript to v5 (major) (gatsbyjs#33786)
  chore(docs): Update processing external images guide (gatsbyjs#34388)
  chore(deps): update dependency aws-sdk to ^2.1048.0 (gatsbyjs#34365)
  chore(deps): update dependency autoprefixer to ^10.4.1 for gatsby-plugin-sass (gatsbyjs#34357)
  chore(deps): update formatting & linting (gatsbyjs#34370)
  fix(deps): update minor and patch dependencies for gatsby-source-drupal (gatsbyjs#34375)
  fix(deps): update dependency eslint-plugin-react to ^7.28.0 (gatsbyjs#34372)
  fix(deps): update dependency resolve-url-loader to ^3.1.4 for gatsby-plugin-sass (gatsbyjs#34361)
  chore(deps): update dependency typescript to ^4.5.4 (gatsbyjs#34358)
  chore(docs): Fix links to shared layout component (gatsbyjs#34330)
  chore: Fix typo (gatsbyjs#34349)
  chore(examples): use mobx v6 in using-mobx example (gatsbyjs#34351)
  chore(deps): update dependency rewire to v6 for gatsby-plugin-offline (gatsbyjs#34376)
  chore(deps): update dependency msw to ^0.36.3 for gatsby-core-utils (gatsbyjs#34367)
  chore(deps): update dependency msw to ^0.36.3 for gatsby-plugin-gatsby-cloud (gatsbyjs#34368)
  fix(deps): update dependency graphql to ^15.8.0 for gatsby-codemods (gatsbyjs#34373)
  ...
  • Loading branch information
moonmeister committed Jan 5, 2022
2 parents abc1dbc + f4f1313 commit b656bb0
Show file tree
Hide file tree
Showing 589 changed files with 10,836 additions and 13,037 deletions.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ executors:
GATSBY_CPU_COUNT: 2

aliases:
e2e-executor-env: &e2e-executor-env
GATSBY_CPU_COUNT: 2
VERBOSE: 1

e2e-executor: &e2e-executor
docker:
- image: cypress/browsers:node14.15.0-chrome86-ff82
environment:
GATSBY_CPU_COUNT: 2
<<: *e2e-executor-env

restore_cache: &restore_cache
restore_cache:
Expand Down Expand Up @@ -91,6 +95,8 @@ aliases:
GENERATE_JEST_REPORT: "true"
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
GATSBY_EXPERIMENTAL_LMDB_STORE: 1
GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING: 1
- store_test_results:
path: ./test-results/jest-node/

Expand Down Expand Up @@ -126,6 +132,7 @@ aliases:
type: boolean
default: false
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: s3j3qj
CYPRESS_RECORD_KEY: 3904ca0c-bc98-47d9-8371-b68c5e81fb9b
steps:
Expand Down Expand Up @@ -318,6 +325,7 @@ jobs:
e2e_tests_path-prefix:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: pzj19c
CYPRESS_RECORD_KEY: c9ea1b91-eed6-4bac-be41-eccd75a48969
steps:
Expand Down Expand Up @@ -388,6 +396,7 @@ jobs:
themes_e2e_tests_development_runtime:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: 9parq5
CYPRESS_RECORD_KEY: 3fb49000-4143-4bd8-9ab4-219389060910
steps:
Expand All @@ -398,6 +407,7 @@ jobs:
themes_e2e_tests_production_runtime:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: c9rs27
CYPRESS_RECORD_KEY: e4e7b3b8-e1e7-4a74-a0c9-9ac76585236b
steps:
Expand All @@ -408,6 +418,7 @@ jobs:
mdx_e2e_tests:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: spbj28
CYPRESS_RECORD_KEY: af30ea46-121f-4fb7-97dd-f17ec224402e
steps:
Expand All @@ -418,6 +429,7 @@ jobs:
e2e_tests_gatsby-static-image:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: zstawi
CYPRESS_RECORD_KEY: 389326a6-c0d2-4215-bc5e-3be29483ed13
steps:
Expand All @@ -428,6 +440,7 @@ jobs:
e2e_tests_visual-regression:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: nz99aw
CYPRESS_RECORD_KEY: ed4b1af1-bd97-47d4-bb09-3cab2435a147
steps:
Expand All @@ -442,6 +455,7 @@ jobs:
e2e_tests_contentful:
<<: *e2e-executor
environment:
<<: *e2e-executor-env
CYPRESS_PROJECT_ID: 2193cm
CYPRESS_RECORD_KEY: 57e9563e-af49-494c-837c-5af53c2d6f76
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/high-priority-prs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"lodash": "^4.17.15"
},
"devDependencies": {
"jest": "^25.1.0"
"jest": "^27.2.1"
}
}
3 changes: 3 additions & 0 deletions .jestSetup.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
process.env.GATSBY_RECIPES_NO_COLOR = "true"

// Potrace has a dependency on giwrap which has a process.nextTick as a sideEffect which messes up with jest.
jest.mock(`gifwrap`, () => jest.fn())
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Gatsby is a modern web framework for blazing fast websites.
limitations. Gatsby sites are fully functional React apps, so you can create high-quality,
dynamic web apps, from blogs to e-commerce sites to user dashboards.

- **Choose your Rendering Option.** You can choose alternative [rendering options](https://gatsbyjs.com/docs/conceptual/rendering-options/), namely Deferred Static Generation (DSG) and Server-Side Rendering (SSR), in addition to Static Site Generation (SSG) — on a per-page basis. This type of granular control allows you to optimize for performance and productivity without sacrificing one for the other.
- **Choose your Rendering Options.** You can choose alternative [rendering options](https://gatsbyjs.com/docs/conceptual/rendering-options/), namely Deferred Static Generation (DSG) and Server-Side Rendering (SSR), in addition to Static Site Generation (SSG) — on a per-page basis. This type of granular control allows you to optimize for performance and productivity without sacrificing one for the other.

- **Use a Modern Stack for Every Site.** No matter where the data comes from, Gatsby sites are
built using React and GraphQL. Build a uniform workflow for you and your team, regardless of
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The following versions are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 4.x | :heavy_check_mark: |
| 3.x | :heavy_check_mark: |
| 2.x | :x: |
| 1.x | :x: |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.0](https://github.com/gatsbyjs/gatsby/commits/[email protected]/packages/gatsby-recipes) (2021-12-01)

[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.3)

#### Bug Fixes

- Pin `remark-mdx` to `2.0.0-next.7` [#34064](https://github.com/gatsbyjs/gatsby/issues/34064) ([c41bb5e](https://github.com/gatsbyjs/gatsby/commit/c41bb5e7b0647bd96841df8400f76266ff55675e))

## [1.2.0](https://github.com/gatsbyjs/gatsby/commits/[email protected]/packages/gatsby-recipes) (2021-11-16)

[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.2)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Gatsby Recipes

**Please Note: Gatsby Recipes has been removed from `gatsby` with v4.5.0. If you want to use it you can install `[email protected]` to use it.**

Recipes is an “infrastructure as code” system that lets users automatically manage and provision the technology stack for their Gatsby site/app through code rather than manual processes.

It’s powered by React & MDX and a useful analogy is “React Native for Infrastructure”.
Expand Down
21 changes: 21 additions & 0 deletions deprecated-packages/gatsby-recipes/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = api => {
const isTest = api.env(`test`)

return {
presets: [
[
`@babel/env`,
{
// use ES modules for rollup and commonjs for jest
modules: isTest ? `commonjs` : false,
shippedProposals: true,
targets: {
node: `10.13.0`,
},
},
],
`@babel/preset-react`,
],
plugins: [`@babel/plugin-transform-runtime`],
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const components = require(`./dist/web/components`)
module.exports = components
module.exports = components
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-recipes",
"description": "Core functionality for Gatsby Recipes",
"version": "1.4.0-next.0",
"version": "1.5.0-next.0",
"author": "Kyle Mathews <[email protected]>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Expand Down Expand Up @@ -31,8 +31,8 @@
"express": "^4.17.1",
"express-graphql": "^0.12.0",
"fs-extra": "^10.0.0",
"gatsby-core-utils": "^3.4.0-next.0",
"gatsby-telemetry": "^3.4.0-next.0",
"gatsby-core-utils": "^3.5.0-next.0",
"gatsby-telemetry": "^3.5.0-next.0",
"glob": "^7.1.6",
"graphql": "^15.4.0",
"graphql-compose": "~7.25.0",
Expand All @@ -41,14 +41,14 @@
"hicat": "^0.8.0",
"is-binary-path": "^2.1.0",
"is-url": "^1.2.4",
"jest-diff": "^25.5.0",
"jest-diff": "^27.2.0",
"lock": "^1.0.0",
"lodash": "^4.17.21",
"mitt": "^1.2.0",
"mkdirp": "^0.5.1",
"node-fetch": "^2.5.0",
"pkg-dir": "^4.2.0",
"prettier": "^2.4.1",
"prettier": "^2.5.1",
"prop-types": "^15.6.1",
"remark-mdx": "2.0.0-next.7",
"remark-mdxjs": "^2.0.0-next.4",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import path from "path"
function excludeDevTools() {
const re = /ink/
return {
name: "ignoreDevTools",

name: `ignoreDevTools`,
// eslint-disable-next-line
load(id) {
if (id.match(re)) {
if (path.parse(id).name === `devtools`) {
Expand All @@ -33,7 +33,7 @@ export default [
output: {
dir: `dist`,
entryFileNames: `[name].js`,
format: "cjs",
format: `cjs`,
sourcemap: true,
},
plugins: [
Expand Down Expand Up @@ -98,7 +98,7 @@ export default [
output: {
dir: `dist/web/`,
entryFileNames: `[name].js`,
format: "es",
format: `es`,
sourcemap: true,
},
plugins: [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import diff from "jest-diff"
import { diff } from "jest-diff"
import chalk from "chalk"
import stripAnsi from "strip-ansi"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/docs/adding-a-shopping-cart-with-snipcart.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,4 @@ The following quote is from the Snipcart [payment gateway page](https://app.snip
- [OneShopper Gatsby starter](/starters/rohitguptab/OneShopper/)
- Reference guide on [sourcing from Etsy](/docs/sourcing-from-etsy/)
- Reference guide on [processing payments with Stripe](/docs/how-to/adding-common-features/processing-payments-with-stripe/)
- From the Snipcart blog: [Gatsby E-Commerce Recipe: Integrate a Cart in a Few Steps](https://snipcart.com/blog/gatsby-recipes-ecommerce)
- [Snipcart documentation](https://docs.snipcart.com/v3/setup/installation)
4 changes: 2 additions & 2 deletions docs/docs/conceptual/security-in-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you want to protect a page your server will provide an encrypted, hard to gue
</form>
```

When the form is sent, the server will compare the token received with the stored token and block the action if they are not the same. Make sure that malicious websites don't have access to the CSRF token by using [HTTP Access Control](https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Headers/Access-Control-Allow-Origin).
When the form is sent, the server will compare the token received with the stored token and block the action if they are not the same. Make sure that malicious websites don't have access to the CSRF token by using [HTTP Access Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin).

#### Same-Site Cookies Attribute

Expand All @@ -107,7 +107,7 @@ Set-Cookie: example=1; SameSite=Strict
```

Using the `SameSite` attribute allows the server to make sure that the cookies are not being sent by a **cross-site** domain request.
Check out [MDN Docs](https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Headers/Set-Cookie) for more information on configuring a cookie. You will also want to note current browser support which is available on the [Can I Use page](https://caniuse.com/#feat=same-site-cookie-attribute).
Check out [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) for more information on configuring a cookie. You will also want to note current browser support which is available on the [Can I Use page](https://caniuse.com/#feat=same-site-cookie-attribute).

This cookie attribute is not a replacement for a CSRF Token (and vice-versa). They can work together as security layers in your website. Otherwise, a Cross-Site Scripting attack can be used to defeat these CSRF mitigation techniques. Check out [OWASP CSRF prevention cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#samesite-cookie-attribute) for more information.

Expand Down
25 changes: 25 additions & 0 deletions docs/docs/glossary/infrastructure-as-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Infrastructure as Code
disableTableOfContents: true
---

Learn what <q>Infrastructure as Code</q> means, and how you can use code to standardize and automate things.

## What is <q>Infrastructure as Code?</q>

_Infrastructure as Code_, or IaC, is the practice of managing your development, testing, and production environments using configuration files or scripts. Provisioning and configuring environments individually can introduce errors or inconsistencies. You may, for example, find yourself running different versions of Node.js on your laptop and your production servers. Infrastructure as Code minimizes this kind of drift and lets you automate the process of provisioning environments.

Your configuration file describes what resources your project requires. If you're building an API, for example, you might create a configuration file that says, "Please install Node.js 12.16.2, npm 6.14.4, Express 4.17.1, and PostgreSQL 12.2 for Ubuntu Linux." For a Gatsby project, your configuration file may add plugins and themes.

Configuration files, like other code files, are text. That means you can use version control software to store them and track changes to the environment. In short, IaC:

- Creates consistent environments.
- Saves time that would otherwise be spent setting up environments.
- Reduces the risk of errors caused by mismatched environments.
- Lays the groundwork for automation.

## Automating Gatsby site development with Gatsby Recipes

[Gatsby Recipes](/blog/2020-04-15-announcing-gatsby-recipes/) applies the infrastructure as code concept to front-end development. With Gatsby Recipes, you can automate common site building tasks, such as adding a plugin or test suite.

We've discontinued this experiment and you can use Gatsby versions up to `4.4.0` to still use it. The old code still lives [on GitHub](https://github.com/gatsbyjs/gatsby/tree/master/deprecated-packages/gatsby-recipes).
84 changes: 0 additions & 84 deletions docs/docs/glossary/infrastructure-as-code/index.md

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ This framework also has experimental support for the React suspense API and it s

- [Gatsby i18n packages](https://www.gatsbyjs.com/plugins/gatsby-plugin-i18n/?=i18)

- [Gatsby i18n articles](https://www.gatsbyjs.com/blog/tags/i18n/)
- [Gatsby i18n articles](https://www.gatsbyjs.com/blog/tags/localization/)

- [W3C's i18n resources](https://w3c.github.io/i18n-drafts/getting-started/contentdev.en#reference)
Loading

0 comments on commit b656bb0

Please sign in to comment.