diff --git a/data-notes.md b/data-notes.md index 8affc13c369d8..a8b7a156635b7 100644 --- a/data-notes.md +++ b/data-notes.md @@ -1,3 +1,4 @@ +``` new SourceDirectory({ parsers: [ { @@ -12,6 +13,7 @@ new SourceDirectory({ }, ] }) +``` Just copy Jekyll? diff --git a/docs/blog/2018-04-04-gatsby-contentful-starter-tutorial/index.md b/docs/blog/2018-04-04-gatsby-contentful-starter-tutorial/index.md index a8ff8d5758ac7..52f592326b520 100644 --- a/docs/blog/2018-04-04-gatsby-contentful-starter-tutorial/index.md +++ b/docs/blog/2018-04-04-gatsby-contentful-starter-tutorial/index.md @@ -17,14 +17,14 @@ This piece will walk you through getting your GatsbyJS website up and running wi Here’s an overview of what’s involved: -- Create a free Contentful account -- Clone a sample repo -- Create a space on Contentful to store content -- Generate your Content Management and Content Delivery API access tokens -- Import data into your space -- Tweak your configuration file -- Preview a production build -- Publish and go live +* Create a free Contentful account +* Clone a sample repo +* Create a space on Contentful to store content +* Generate your Content Management and Content Delivery API access tokens +* Import data into your space +* Tweak your configuration file +* Preview a production build +* Publish and go live ###Getting started @@ -32,21 +32,21 @@ This guide assumes that you have [GatsbyJS installed](/docs/) and, optionally, a Start by using this with the Gatsby CLI: -~~~bash +```bash gatsby new contentful-starter https://github.com/contentful-userland/gatsby-contentful-starter -~~~ +``` Alternatively, you can also clone a sample repo from Github: -~~~bash +```bash git clone git@github.com:contentful-userland/gatsby-contentful-starter.git -~~~ +``` And go into the directory and install the required dependencies with: -~~~bash +```bash npm install -~~~ +``` ###Create a new space to store content @@ -56,15 +56,13 @@ Create a new empty space by opening the sidebar menu and adding a Space. Give th ![create a new space](new_space.png) - - ###Generate access tokens Before getting to the exciting part of setting up your website, you first need to generate three access tokens to get your Contentful-powered website up and running by fetching data from the API. -- [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/) -- [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/) -- [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/) +* [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/) +* [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/) +* [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/) Head over to your Space Settings dropdown menu and navigate to the APIs section. From there, navigate to the tab for the API token you would like to generate. @@ -84,20 +82,19 @@ Start setting things up with the npm run setup command, which first prompts you After that, it writes the credentials you provided into a file named .contentful.json into lines of code that look like so: - -~~~json -{ - "development":{ - "host":"preview.contentful.com", - "spaceId":"...", - "accessToken":"..." - }, - "production":{ - "spaceId":"...", - "accessToken":"..." - } +```json +{ + "development": { + "host": "preview.contentful.com", + "spaceId": "...", + "accessToken": "..." + }, + "production": { + "spaceId": "...", + "accessToken": "..." + } } -~~~ +``` Using the credentials in the .contentful.json file, [content can now be imported](https://www.contentful.com/developers/docs/tutorials/general/import-and-export/) into your space to being displayed on your website via our API. @@ -119,6 +116,6 @@ Contentful ensures your website and its users can access your content quickly an That’s a quick overview of how to get your website up and running from scratch using Contentful and GatsbyJS. -Contentful's platform offers speed, flexibility, and ease of integration with your code, supporting any stack you use with SDKs for common languages like [Javascript](https://www.contentful.com/developers/docs/javascript/sdks/), [Python](https://www.contentful.com/developers/docs/python/sdks/), and [PHP](https://www.contentful.com/developers/docs/php/sdks/). Unlike a CMS, Contentful provides you with separation between content and presentation, allowing you to focus on developing your website and leave content delivery to Contentful. +Contentful's platform offers speed, flexibility, and ease of integration with your code, supporting any stack you use with SDKs for common languages like [Javascript](https://www.contentful.com/developers/docs/javascript/sdks/), [Python](https://www.contentful.com/developers/docs/python/sdks/), and [PHP](https://www.contentful.com/developers/docs/php/sdks/). Unlike a CMS, Contentful provides you with separation between content and presentation, allowing you to focus on developing your website and leave content delivery to Contentful. -If you're curious to learn more about Contentful, you can check out the Contentful [Developer Center](https://www.contentful.com/developers/docs/) to learn more on how the technology works, or head over to the [Guides and tutorials](https://www.contentful.com/guides/) section. +If you're curious to learn more about Contentful, you can check out the Contentful [Developer Center](https://www.contentful.com/developers/docs/) to learn more on how the technology works, or head over to the [Guides and tutorials](https://www.contentful.com/guides/) section. diff --git a/docs/blog/2018-04-05-gatsby-video-tutorials/index.md b/docs/blog/2018-04-05-gatsby-video-tutorials/index.md index 3c2c10278a07f..9121bbf774a1c 100644 --- a/docs/blog/2018-04-05-gatsby-video-tutorials/index.md +++ b/docs/blog/2018-04-05-gatsby-video-tutorials/index.md @@ -12,11 +12,11 @@ _This blog post was originally posted on the [Contentful Blog](https://www.conte Contentful developer and Gatsby contributor Khaled Garbaya has released a [4-part video series](https://www.youtube.com/watch?v=Ek4o40w1tH4&list=PL8KiuH6vpACV-F7jXribe4YveGBhBeG9A) to help you build a “blazing fast” website with Gatsby and Contentful. The series begins by transforming the Gatsby’s getting started example to a Contentful-powered site. From there, each video walks you through a new aspect of production, from automating deployment with CircleCI to integrating the Contentful webhooks feature. -*-“I wanted these videos to act as documentation,”* says Khaled. *-“There were a lot of people asking around about how to do this. And I think it’s important to show not only how to do this thing with Gatsby or how to do that with Contentful, but from start to finish how you can actually deploy, use webhooks, and so on. These are hidden gems that not everyone will look for.”* +_-“I wanted these videos to act as documentation,”_ says Khaled. _-“There were a lot of people asking around about how to do this. And I think it’s important to show not only how to do this thing with Gatsby or how to do that with Contentful, but from start to finish how you can actually deploy, use webhooks, and so on. These are hidden gems that not everyone will look for.”_ -Those hidden gems Khaled is talking about are part of what he believes makes Gatsby and Contentful a compelling combination. Additionally, there are structural aspects of both platforms that add to this: *-“Gatsby works with React and React is component-based. And you can also think of Contentful in this way, if you think of your content as components”* he explains. *-“So that’s made a really perfect match because you can have this component that renders a specific content type and then this can be shared across your website.”* +Those hidden gems Khaled is talking about are part of what he believes makes Gatsby and Contentful a compelling combination. Additionally, there are structural aspects of both platforms that add to this: _-“Gatsby works with React and React is component-based. And you can also think of Contentful in this way, if you think of your content as components”_ he explains. _-“So that’s made a really perfect match because you can have this component that renders a specific content type and then this can be shared across your website.”_ -Another unique distinction is the complementary ways Contentful and Gatsby process data. *-“Contentful has the sync endpoint, so this can actually improve the ability to process a lot,”* Khaled says. *-“Because the first time, you get all of the data. The next time, you only get the entries that changed so it takes less time to parse the JSON and so on. Also Gatsby is good because all of the data you have from Contentful would be in a GraphQL schema, so you can query your data that way.”* +Another unique distinction is the complementary ways Contentful and Gatsby process data. _-“Contentful has the sync endpoint, so this can actually improve the ability to process a lot,”_ Khaled says. _-“Because the first time, you get all of the data. The next time, you only get the entries that changed so it takes less time to parse the JSON and so on. Also Gatsby is good because all of the data you have from Contentful would be in a GraphQL schema, so you can query your data that way.”_ Ready to dive in? [All four parts of Khaled’s video series are now available on YouTube](https://www.youtube.com/watch?v=Ek4o40w1tH4&list=PL8KiuH6vpACV-F7jXribe4YveGBhBeG9A). You can also [find the source code on GitHub](https://github.com/Khaledgarbaya/gatsby-contentful-site). diff --git a/docs/docs/add-custom-webpack-config.md b/docs/docs/add-custom-webpack-config.md index 542bb6ef6860a..e8dc60957dc25 100644 --- a/docs/docs/add-custom-webpack-config.md +++ b/docs/docs/add-custom-webpack-config.md @@ -19,13 +19,13 @@ you to modify the default webpack config using Gatsby does multiple webpack builds with somewhat different configuration. We call each build type a "stage". The following stages exist: -1. develop: when running the `gatsby develop` command. Has configuration for hot - reloading and CSS injection into page -2. develop-html: same as develop but without react-hmre in the babel config for - rendering the HTML component. -3. build-javascript: production JavaScript and CSS build. Creates route JS bundles as well - as commons chunks for JS and CSS. -4. build-html: production build static HTML pages +1. develop: when running the `gatsby develop` command. Has configuration for hot + reloading and CSS injection into page +2. develop-html: same as develop but without react-hmre in the babel config for + rendering the HTML component. +3. build-javascript: production JavaScript and CSS build. Creates route JS bundles as well + as commons chunks for JS and CSS. +4. build-html: production build static HTML pages Check [webpack.config.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/webpack.config.js) diff --git a/docs/docs/debugging-html-builds.md b/docs/docs/debugging-html-builds.md index ee8a3ffc11093..93536bcf3ddbb 100644 --- a/docs/docs/debugging-html-builds.md +++ b/docs/docs/debugging-html-builds.md @@ -55,10 +55,10 @@ exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { { test: /bad-module/, use: loaders.null(), - } - ] - } - }) + }, + ], + }, + }); } }; ``` diff --git a/docs/docs/gatsby-starters.md b/docs/docs/gatsby-starters.md index 8b0a80623406c..ff4a9f7cb110f 100644 --- a/docs/docs/gatsby-starters.md +++ b/docs/docs/gatsby-starters.md @@ -174,12 +174,12 @@ Community: Features: * localization (Multilanguage) - + * [gatsby-starter-datocms](https://github.com/datocms/gatsby-portfolio) [(demo)](http://cranky-edison-12166d.netlify.com/) Features: - + * Simple portfolio to quick start a site with DatoCMS * Contents and media from DatoCMS * Custom sass style diff --git a/docs/tutorial/part-two/index.md b/docs/tutorial/part-two/index.md index 23d18fb848d23..2eac1d1bbcb4c 100644 --- a/docs/tutorial/part-two/index.md +++ b/docs/tutorial/part-two/index.md @@ -325,7 +325,6 @@ While we won't cover CSS-in-JS in this initial tutorial, we encourage you to exp as well as [Mark Dalgleish's more recent post "A Unified Styling Language"](https://medium.com/seek-blog/a-unified-styling-language-d0c208de2660). - ### CSS Modules Let's explore **CSS Modules**. diff --git a/examples/gatsbygram/src/layouts/index.js b/examples/gatsbygram/src/layouts/index.js index 0ca6fed38e05b..270c231a1f633 100644 --- a/examples/gatsbygram/src/layouts/index.js +++ b/examples/gatsbygram/src/layouts/index.js @@ -10,7 +10,7 @@ import { rhythm, scale } from "../utils/typography" import presets from "../utils/presets" let Modal -import("../components/modal").then(modal => { +import(`../components/modal`).then(modal => { Modal = modal.default }) diff --git a/examples/simple-auth/package.json b/examples/simple-auth/package.json index 79a04f37e4f3c..3f1c0ca95b455 100644 --- a/examples/simple-auth/package.json +++ b/examples/simple-auth/package.json @@ -18,8 +18,5 @@ "develop": "gatsby develop", "format": "prettier --write 'src/**/*.js'", "test": "echo \"Error: no test specified\" && exit 1" - }, - "devDependencies": { - "prettier": "^1.11.1" } } diff --git a/examples/using-faker/package.json b/examples/using-faker/package.json index 102ccbc697c5d..adc3e9cc9326f 100644 --- a/examples/using-faker/package.json +++ b/examples/using-faker/package.json @@ -12,18 +12,14 @@ "react-dom": "^16.3.2", "react-helmet": "^5.2.0" }, - "keywords": [ - "gatsby" - ], + "keywords": ["gatsby"], "license": "MIT", "main": "n/a", "scripts": { "build": "gatsby build", "develop": "gatsby develop", - "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"", + "format": + "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"", "test": "echo \"Error: no test specified\" && exit 1" - }, - "devDependencies": { - "prettier": "^1.9.2" } } diff --git a/examples/using-page-transitions/package.json b/examples/using-page-transitions/package.json index ff19e5d98483a..e2228bad4c106 100644 --- a/examples/using-page-transitions/package.json +++ b/examples/using-page-transitions/package.json @@ -9,18 +9,14 @@ "react-helmet": "^5.2.0", "react-transition-group": "^2.2.1" }, - "keywords": [ - "gatsby" - ], + "keywords": ["gatsby"], "license": "MIT", "main": "n/a", "scripts": { "build": "gatsby build", "develop": "gatsby develop", - "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", + "format": + "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", "test": "echo \"Error: no test specified\" && exit 1" - }, - "devDependencies": { - "prettier": "^1.7.4" } -} \ No newline at end of file +} diff --git a/examples/using-remark-copy-linked-files/package.json b/examples/using-remark-copy-linked-files/package.json index 435d01eb28b2f..56a7a05a4af28 100644 --- a/examples/using-remark-copy-linked-files/package.json +++ b/examples/using-remark-copy-linked-files/package.json @@ -29,19 +29,21 @@ "devDependencies": { "eslint": "^4.9.0", "eslint-plugin-react": "^7.4.0", - "gh-pages": "^0.12.0", - "prettier": "^1.8.1" + "gh-pages": "^0.12.0" }, "license": "MIT", "main": "n/a", "scripts": { "dev": "gatsby develop", - "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", + "lint": + "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", "test": "echo \"Error: no test specified\" && exit 1", - "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", + "format": + "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", "develop": "gatsby develop", "build": "gatsby build", "deploy": "gatsby build --prefix-paths && gh-pages -d public", - "fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js" + "fix-semi": + "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js" } -} \ No newline at end of file +} diff --git a/package.json b/package.json index d75c546e3881f..3534dc66fca80 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,12 @@ "cross-env": "^5.1.4", "eslint": "^4.19.1", "eslint-config-google": "^0.9.1", - "eslint-config-prettier": "^2.5.0", + "eslint-config-prettier": "^2.9.0", "eslint-plugin-flow-vars": "^0.5.0", "eslint-plugin-flowtype": "^2.46.1", "eslint-plugin-import": "^2.9.0", "eslint-plugin-jsx-a11y": "^6.0.2", - "eslint-plugin-prettier": "^2.2.0", + "eslint-plugin-prettier": "^2.6.0", "eslint-plugin-react": "^7.7.0", "flow-bin": "^0.42.0", "glob": "^7.1.1", @@ -28,7 +28,7 @@ "lerna": "^2.1.1", "npm-run-all": "4.1.2", "plop": "^1.8.1", - "prettier": "^1.11.1", + "prettier": "^1.12", "prettier-eslint-cli": "4.7.1", "remotedev-server": "^0.2.3", "rimraf": "^2.6.1", @@ -37,17 +37,17 @@ "engines": { "yarn": "^1.2.1" }, - "eslintIgnore": [ - "interfaces", - "**/__tests__/fixtures/" - ], + "eslintIgnore": ["interfaces", "**/__tests__/fixtures/"], "private": true, "scripts": { "bootstrap": "npm-run-all -s check-versions lerna-prepublish", "check-versions": "babel-node scripts/check-versions.js", - "format": "npm-run-all -p format-packages format-cache-dir format-www format-examples format-scripts format-markdown", - "format-cache-dir": "prettier-eslint --write \"packages/gatsby/cache-dir/*.js\"", - "format-examples": "prettier-eslint --write \"examples/**/gatsby-node.js\" \"examples/**/gatsby-config.js\" \"examples/**/src/**/*.js\"", + "format": + "npm-run-all -p format-packages format-cache-dir format-www format-examples format-scripts format-markdown", + "format-cache-dir": + "prettier-eslint --write \"packages/gatsby/cache-dir/*.js\"", + "format-examples": + "prettier-eslint --write \"examples/**/gatsby-node.js\" \"examples/**/gatsby-config.js\" \"examples/**/src/**/*.js\"", "format-markdown": "prettier --write \"**/*.md\" --semi", "format-packages": "prettier-eslint --write \"packages/*/src/**/*.js\"", "format-scripts": "prettier-eslint --write \"scripts/**/*.js\"", @@ -69,7 +69,5 @@ "test_bkup": "npm-run-all -s lint test-node test-integration", "watch": "lerna run watch --no-sort --stream --concurrency 999" }, - "workspaces": [ - "packages/*" - ] + "workspaces": ["packages/*"] } diff --git a/packages/babel-plugin-remove-graphql-queries/src/__tests__/index.js b/packages/babel-plugin-remove-graphql-queries/src/__tests__/index.js index db4193f4b69bb..0d988cf81c627 100644 --- a/packages/babel-plugin-remove-graphql-queries/src/__tests__/index.js +++ b/packages/babel-plugin-remove-graphql-queries/src/__tests__/index.js @@ -1,6 +1,6 @@ -const babel = require("babel-core") -const reactPreset = require("@babel/preset-react") -const plugin = require("../") +const babel = require(`babel-core`) +const reactPreset = require(`@babel/preset-react`) +const plugin = require(`../`) var staticQuery = ` import React from 'react' @@ -28,7 +28,7 @@ export const query = graphql\` \` ` -it("Transforms queries in ", () => { +it(`Transforms queries in `, () => { const { code } = babel.transform(staticQuery, { presets: [reactPreset], plugins: [plugin], @@ -36,7 +36,7 @@ it("Transforms queries in ", () => { expect(code).toMatchSnapshot() }) -it("Transforms queries in page components", () => { +it(`Transforms queries in page components`, () => { const { code } = babel.transform(pageComponent, { presets: [reactPreset], plugins: [plugin], diff --git a/packages/babel-plugin-remove-graphql-queries/src/index.js b/packages/babel-plugin-remove-graphql-queries/src/index.js index cd32bd6e13796..25b850f259b06 100644 --- a/packages/babel-plugin-remove-graphql-queries/src/index.js +++ b/packages/babel-plugin-remove-graphql-queries/src/index.js @@ -1,6 +1,6 @@ /* eslint-disable new-cap */ const graphql = require(`graphql`) -const murmurhash = require("./murmur") +const murmurhash = require(`./murmur`) const nodePath = require(`path`) function getGraphQLTag(path) { @@ -46,7 +46,7 @@ export default function({ types: t }) { [`production`, `test`].includes(process.env.NODE_ENV) && path2.isJSXIdentifier({ name: `StaticQuery` }) ) { - const identifier = t.identifier("staticQueryData") + const identifier = t.identifier(`staticQueryData`) const filename = state.file.opts.filename const shortResultPath = `public/static/d/${this.queryHash}.json` const resultPath = nodePath.join(process.cwd(), shortResultPath) @@ -72,7 +72,7 @@ export default function({ types: t }) { : shortResultPath ) ) - path.unshiftContainer("body", importDeclaration) + path.unshiftContainer(`body`, importDeclaration) } }, } diff --git a/packages/gatsby-plugin-less/README.md b/packages/gatsby-plugin-less/README.md index 8121d80e7af7e..c5d49e3f46d72 100644 --- a/packages/gatsby-plugin-less/README.md +++ b/packages/gatsby-plugin-less/README.md @@ -8,8 +8,8 @@ Provides drop-in support for Less stylesheets ## How to use -1. Include the plugin in your `gatsby-config.js` file. -2. Write your stylesheets in Less and require or import them as normal. +1. Include the plugin in your `gatsby-config.js` file. +2. Write your stylesheets in Less and require or import them as normal. ```javascript // in gatsby-config.js diff --git a/packages/gatsby-plugin-postcss-sass/README.md b/packages/gatsby-plugin-postcss-sass/README.md index e69de29bb2d1d..8b137891791fe 100644 --- a/packages/gatsby-plugin-postcss-sass/README.md +++ b/packages/gatsby-plugin-postcss-sass/README.md @@ -0,0 +1 @@ + diff --git a/packages/gatsby-source-filesystem/src/gatsby-node.js b/packages/gatsby-source-filesystem/src/gatsby-node.js index cdbf1ff137ada..907119c150be5 100644 --- a/packages/gatsby-source-filesystem/src/gatsby-node.js +++ b/packages/gatsby-source-filesystem/src/gatsby-node.js @@ -16,7 +16,7 @@ const { createFileNode } = require(`./create-file-node`) * "idle" state. */ const fsMachine = Machine({ - key: "emitFSEvents", + key: `emitFSEvents`, parallel: true, strict: true, states: { @@ -25,19 +25,19 @@ const fsMachine = Machine({ states: { CHOKIDAR_NOT_READY: { on: { - CHOKIDAR_READY: "CHOKIDAR_WATCHING", - BOOTSTRAP_FINISHED: "CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED", + CHOKIDAR_READY: `CHOKIDAR_WATCHING`, + BOOTSTRAP_FINISHED: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, }, }, CHOKIDAR_WATCHING: { on: { - BOOTSTRAP_FINISHED: "CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED", - CHOKIDAR_READY: "CHOKIDAR_WATCHING", + BOOTSTRAP_FINISHED: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, + CHOKIDAR_READY: `CHOKIDAR_WATCHING`, }, }, CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED: { on: { - CHOKIDAR_READY: "CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED", + CHOKIDAR_READY: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, }, }, }, @@ -47,7 +47,7 @@ const fsMachine = Machine({ states: { BOOTSTRAPPING: { on: { - BOOTSTRAP_FINISHED: "IDLE", + BOOTSTRAP_FINISHED: `IDLE`, }, }, IDLE: { diff --git a/packages/gatsby-transformer-hjson/README.md b/packages/gatsby-transformer-hjson/README.md index 9e2b95b3a7ec2..c342f23f74a3f 100644 --- a/packages/gatsby-transformer-hjson/README.md +++ b/packages/gatsby-transformer-hjson/README.md @@ -15,8 +15,8 @@ points to your files. ```javascript // In your gatsby-config.js module.exports = { - plugins: [`gatsby-transformer-hjson`] -} + plugins: [`gatsby-transformer-hjson`], +}; ``` ## Parsing algorithm diff --git a/packages/gatsby/cache-dir/json-store.js b/packages/gatsby/cache-dir/json-store.js index 5117b5709863a..760ee3401a3c5 100644 --- a/packages/gatsby/cache-dir/json-store.js +++ b/packages/gatsby/cache-dir/json-store.js @@ -35,14 +35,14 @@ class JSONStore extends React.Component { componentDidMount() { if (process.env.NODE_ENV !== `production`) { this.registerPath(getPathFromProps(this.props)) - ___emitter.on("*", this.handleMittEvent) + ___emitter.on(`*`, this.handleMittEvent) } } componentWillUnmount() { if (process.env.NODE_ENV !== `production`) { this.unregisterPath(this.state.path) - ___emitter.off("*", this.handleMittEvent) + ___emitter.off(`*`, this.handleMittEvent) } } diff --git a/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js b/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js index a58b6669e43a4..037de2f73b139 100644 --- a/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js +++ b/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js @@ -149,15 +149,14 @@ class Runner { return compiledNodes } - // relay-compiler v1.5.0 added "StripUnusedVariablesTransform" to + // relay-compiler v1.5.0 added "StripUnusedVariablesTransform" to // printTransforms. Unfortunately it currently doesn't detect variables - // in input objects widely used in gatsby, and therefore removing + // in input objects widely used in gatsby, and therefore removing // variable declaration from queries. // As a temporary workaround remove that transform by slicing printTransforms. - const printContext = printTransforms.slice(0, -1).reduce( - (ctx, transform) => transform(ctx, this.schema), - compilerContext - ) + const printContext = printTransforms + .slice(0, -1) + .reduce((ctx, transform) => transform(ctx, this.schema), compilerContext) compilerContext.documents().forEach((node: { name: string }) => { if (node.kind !== `Root`) return diff --git a/packages/gatsby/src/internal-plugins/query-runner/query-runner.js b/packages/gatsby/src/internal-plugins/query-runner/query-runner.js index 61d7eb1ae3f88..8fcf7f9b7a879 100644 --- a/packages/gatsby/src/internal-plugins/query-runner/query-runner.js +++ b/packages/gatsby/src/internal-plugins/query-runner/query-runner.js @@ -68,14 +68,14 @@ module.exports = async (queryJob: QueryJob, component: Any) => { } const resultJSON = JSON.stringify(result) - const resultHash = require("crypto") - .createHash("sha1") + const resultHash = require(`crypto`) + .createHash(`sha1`) .update(resultJSON) - .digest("base64") + .digest(`base64`) // Remove potentially unsafe characters. This increases chances of collisions // slightly but it should still be very safe + we get a shorter // url vs hex. - .replace(/[^a-zA-Z0-9-_]/g, "") + .replace(/[^a-zA-Z0-9-_]/g, ``) let dataPath if (queryJob?.isPage) { diff --git a/packages/gatsby/src/utils/websocket-manager.js b/packages/gatsby/src/utils/websocket-manager.js index b632938bca9e4..36ae69fd005dc 100644 --- a/packages/gatsby/src/utils/websocket-manager.js +++ b/packages/gatsby/src/utils/websocket-manager.js @@ -88,7 +88,7 @@ class WebsocketManager { }) } }) - + s.on(`disconnect`, s => { leaveRoom(activePath) }) diff --git a/www/gatsby-config.js b/www/gatsby-config.js index ccba5acee8fa0..192f5250673e3 100644 --- a/www/gatsby-config.js +++ b/www/gatsby-config.js @@ -174,7 +174,7 @@ module.exports = { { resolve: `gatsby-plugin-mailchimp`, options: { - endpoint: `https://gatsbyjs.us17.list-manage.com/subscribe/post-json?u=1dc33f19eb115f7ebe4afe5ee&id=f366064ba7`, + endpoint: `https://gatsbyjs.us17.list-manage.com/subscribe/post-json?u=1dc33f19eb115f7ebe4afe5ee&id=f366064ba7`, }, }, ],