diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44acdeab905ad..54f2f965d8c5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,8 +33,7 @@ The usual contributing steps are: * Run `npm run watch` from the root of the repo to first do an initial Babel build of all packages and then watch for changes to packages' source code and compile these changes on-the-fly as you work. -* Install [gatsby-dev-cli](/packages/gatsby-dev-cli/) globally: `yarn global add - gatsby-dev-cli` +* Install [gatsby-dev-cli](/packages/gatsby-dev-cli/) globally: `yarn global add gatsby-dev-cli` * For each of your Gatsby test sites, run the `gatsby-dev` command there to copy the built files from your cloned copy of Gatsby. It'll watch for your changes to Gatsby packages and copy them into the site. For more detailed instructions 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 80b183694e363..80f2c102c2fbf 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 @@ -185,8 +185,8 @@ along with a modern css-in-js library uses [Redux](http://redux.js.org/) to communicate with their Django API. The marketing portion of the site loads quickly with minimal JavaScript. When a -potential customer goes to sign-up for the app, there's no *awkward jump from -the marketing website to the web app*—just a simple page change which seamlessly +potential customer goes to sign-up for the app, there's no _awkward jump from +the marketing website to the web app_—just a simple page change which seamlessly loads in the needed JavaScript. The _team is sharing components and styles across the site_ without stepping on each others shoes as they rapidly iterate on features. diff --git a/docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md b/docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md index f6430d0eb99aa..02c8c7372e25b 100644 --- a/docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md +++ b/docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md @@ -50,8 +50,7 @@ project), `gatsby develop` (launch a hot-reload enabled web development server), etc. We can now begin the exciting task of _actually_ developing on the site, and -creating a functional, modern blog. You'll generally want to use `gatsby -develop` to launch the local development server to validate functionality as we +creating a functional, modern blog. You'll generally want to use `gatsby develop` to launch the local development server to validate functionality as we progress through the steps. ## Adding necessary plugins @@ -87,8 +86,7 @@ with the following command: yarn add gatsby-plugin-catch-links gatsby-plugin-react-helmet ``` -We're using [yarn][yarn], but npm can just as easily be used with `npm i --save -[deps]`. +We're using [yarn][yarn], but npm can just as easily be used with `npm i --save [deps]`. After installing each of these functional plugins, we'll edit `gatsby-config.js`, which Gatsby loads at build-time to implement the exposed diff --git a/docs/blog/2017-10-17-building-i18n-with-gatsby/index.md b/docs/blog/2017-10-17-building-i18n-with-gatsby/index.md index a574f4867c7e3..8794ce0b854e5 100644 --- a/docs/blog/2017-10-17-building-i18n-with-gatsby/index.md +++ b/docs/blog/2017-10-17-building-i18n-with-gatsby/index.md @@ -73,8 +73,7 @@ implementation in other projects. To get started, you'll need to install a few packages: -`npm i -S i18next i18next-xhr-backend i18next-browser-languagedetector -react-i18next` +`npm i -S i18next i18next-xhr-backend i18next-browser-languagedetector react-i18next` ## Setting up diff --git a/docs/blog/2017-11-08-migrate-from-jekyll-to-gatsby/index.md b/docs/blog/2017-11-08-migrate-from-jekyll-to-gatsby/index.md index ff0f0e45d3902..da28fb4da1eb9 100644 --- a/docs/blog/2017-11-08-migrate-from-jekyll-to-gatsby/index.md +++ b/docs/blog/2017-11-08-migrate-from-jekyll-to-gatsby/index.md @@ -101,9 +101,10 @@ exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { ) // create a new slug concatenating everything - const slug = `/${slugify(categories.concat([date]).join("-"), "/")}/${ - title - }/` + const slug = `/${slugify( + categories.concat([date]).join("-"), + "/" + )}/${title}/` createNodeField({ node, name: `slug`, value: slug }) diff --git a/docs/blog/gatsby-v1.md b/docs/blog/gatsby-v1.md index e5c74105c4ef8..43f7cdbe5bfad 100644 --- a/docs/blog/gatsby-v1.md +++ b/docs/blog/gatsby-v1.md @@ -296,8 +296,8 @@ along with a modern css-in-js library uses [Redux](http://redux.js.org/) to communicate with their Django API. The marketing portion of the site loads quickly with minimal JavaScript. When a -potential customer goes to sign-up for the app, there's no *awkward jump from -the marketing website to the web app*—just a simple page change which seamlessly +potential customer goes to sign-up for the app, there's no _awkward jump from +the marketing website to the web app_—just a simple page change which seamlessly loads in the needed JavaScript. The _team is sharing components and styles across the site_ without stepping on each others shoes as they rapidly iterate on features. diff --git a/docs/docs/api-proxy.md b/docs/docs/api-proxy.md index e7f0977c7e156..2cd3a1ab94075 100644 --- a/docs/docs/api-proxy.md +++ b/docs/docs/api-proxy.md @@ -21,6 +21,5 @@ This way, when you `fetch('/api/todos')` in development, the development server will recognize that it’s not a static asset, and will proxy your request to `http://dev-mysite.com/api/todos` as a fallback. -Keep in mind that `proxy` only has effect in development (with `gatsby -develop`), and it is up to you to ensure that URLs like `/api/todos` point to +Keep in mind that `proxy` only has effect in development (with `gatsby develop`), and it is up to you to ensure that URLs like `/api/todos` point to the right place in production. diff --git a/docs/docs/custom-html.md b/docs/docs/custom-html.md index d081049b54d69..b4dfbaa331c02 100644 --- a/docs/docs/custom-html.md +++ b/docs/docs/custom-html.md @@ -29,8 +29,7 @@ the client like other components. If you want to dynamically update your ### Target container -If you see this error: `Uncaught Error: _registerComponent(...): Target -container is not a DOM element.` it means your `html.js` is missing the required +If you see this error: `Uncaught Error: _registerComponent(...): Target container is not a DOM element.` it means your `html.js` is missing the required "target container". Inside your `` you must have a div with an id of `___gatsby` like: diff --git a/docs/docs/deploy-gatsby.md b/docs/docs/deploy-gatsby.md index 643773d90df3f..5fbb99240afb0 100644 --- a/docs/docs/deploy-gatsby.md +++ b/docs/docs/deploy-gatsby.md @@ -62,8 +62,7 @@ module.exports = { If you have not yet initialized a git repository in your working gatsby site repo, set up git in your project with `git init`. Then tell Gatsby where to deploy your site by adding the git remote address with https or ssh. Here is how -to do it with https: `git remote add origin -git@github.com:username/project-name.git`. +to do it with https: `git remote add origin git@github.com:username/project-name.git`. Now run `yarn deploy` or `npm run deploy`. Preview changes in your GitHub page `https://username.github.io/project-name/`. You can also find the link to your diff --git a/docs/docs/gatsby-on-windows.md b/docs/docs/gatsby-on-windows.md index f6f32e0de7b76..043f8304b2a55 100644 --- a/docs/docs/gatsby-on-windows.md +++ b/docs/docs/gatsby-on-windows.md @@ -29,8 +29,7 @@ see compilation errors such as `node-gyp` or `sharp` or `binding.gyp not found`. If you suspect this is your problem, download the [Visual Studio Community 2015 Package](https://www.visualstudio.com/products/visual-studio-community-vs) -and install only the part of the package that interests us : `Programming -languages > Visual C++ > Common tools for Visual Studio 2015`. Be sure to +and install only the part of the package that interests us : `Programming languages > Visual C++ > Common tools for Visual Studio 2015`. Be sure to download the 2015 version of VS Community, not the 2017 version (see Note 1 below) ; you'll have to use the [search bar on the VS site](https://www.visualstudio.com/products/visual-studio-community-vs) diff --git a/docs/docs/gatsby-style-guide.md b/docs/docs/gatsby-style-guide.md index 22547ceaff1c8..ba9576aa15f40 100644 --- a/docs/docs/gatsby-style-guide.md +++ b/docs/docs/gatsby-style-guide.md @@ -70,8 +70,7 @@ If you prefer to write locally before submitting a PR, then follow these steps: 3. Add a remote upstream so git knows where the official Gatsby Guides repository is located by running the command `git remote add upstream` _incomplete code here_ -4. Create a new branch for your work with the command `git checkout -b - NEW-BRANCH-NAME`. Try to name your branch in a way that describes your +4. Create a new branch for your work with the command `git checkout -b NEW-BRANCH-NAME`. Try to name your branch in a way that describes your article topic, like `fix/ArticleHTMLElements` 5. Write your article, commit your changes locally, and push your new branch to GitHub with the command `git push origin NEW-BRANCH-NAME` @@ -79,8 +78,7 @@ If you prefer to write locally before submitting a PR, then follow these steps: Make sure to maintain your local fork going forward so it stays up-to-date with the Gatsby guides repository. The next time you want to contribute, checkout -your local `master` branch and run the command `git pull --rebase upstream -master` before creating a new branch. This will grab all the changes on the +your local `master` branch and run the command `git pull --rebase upstream master` before creating a new branch. This will grab all the changes on the official master branch without making an additional commit in your local repository. @@ -90,9 +88,7 @@ Finally, if you want to run a version of the guides repository locally, follow these steps: 1. Ensure you have the yarn package manager installed `npm install -g yarn` -2. Fork this repository 👇 `git clone - https://github.com/YOUR-GITHUB-USERNAME/guides.git` `cd guides` `yarn - install` `yarn run dev` +2. Fork this repository 👇 `git clone https://github.com/YOUR-GITHUB-USERNAME/guides.git` `cd guides` `yarn install` `yarn run dev` In this project we are using `yarn` because [`Netlify`](https://www.netlify.com/) builds our site with `yarn`. diff --git a/docs/docs/migrating-from-v0-to-v1.md b/docs/docs/migrating-from-v0-to-v1.md index c03655c6b613e..95f3ac70d504e 100644 --- a/docs/docs/migrating-from-v0-to-v1.md +++ b/docs/docs/migrating-from-v0-to-v1.md @@ -123,10 +123,7 @@ Here's an example of migrating a markdown wrapper to Gatsby v1. Install Gatsby plugins for handling markdown files. -`npm install --save gatsby-source-filesystem@next gatsby-transformer-remark@next -gatsby-remark-copy-linked-files@next gatsby-remark-prismjs@next -gatsby-remark-responsive-iframe@next gatsby-remark-images@next -gatsby-remark-smartypants@next gatsby-plugin-sharp@next` +`npm install --save gatsby-source-filesystem@next gatsby-transformer-remark@next gatsby-remark-copy-linked-files@next gatsby-remark-prismjs@next gatsby-remark-responsive-iframe@next gatsby-remark-images@next gatsby-remark-smartypants@next gatsby-plugin-sharp@next` Next add them to your `gatsby-config.js` file. Make your config file look something like the following: @@ -300,8 +297,7 @@ but in the meantime, check out http://graphql.org/ and play around on Gatsby's built-in GraphQL IDE (Graph*i*QL) which can be reached when you start the development server. -At this point you should have working markdown pages when you run `gatsby -develop`! Now start gradually adding back what you had in your wrapper component +At this point you should have working markdown pages when you run `gatsby develop`! Now start gradually adding back what you had in your wrapper component adding HTML elements, styles, and extending the GraphQL query as needed. Repeat this process for other wrapper components you were using. @@ -323,12 +319,12 @@ your `html.js` should look like: ``` -## _template.js is now src/layouts/index.js +## \_template.js is now src/layouts/index.js You should be able to copy your `_template.js` file directly making only one change making `this.props.children` a function call so `this.props.children()`. The rational for this change is described [in this PR comment](https://github.com/gatsbyjs/gatsby/pull/940#issuecomment-300878300). -Nested layouts (similar to the nested _template feature) are _not_ supported yet +Nested layouts (similar to the nested _template feature) are \_not_ supported yet but are on the roadmap for v1. diff --git a/docs/tutorial/part-four/index.md b/docs/tutorial/part-four/index.md index 209dba8f0c232..31e59751f73bf 100644 --- a/docs/tutorial/part-four/index.md +++ b/docs/tutorial/part-four/index.md @@ -742,7 +742,7 @@ Let's get started. So far, we've created pages by placing React components in `src/pages`. We'll now learn how to _programmatically_ create pages from _data_. Gatsby is _not_ limited to making pages from files like many static site generators. Gatsby lets -you use GraphQL to query your _data_ and _map_ the data to *pages*—all at build +you use GraphQL to query your _data_ and _map_ the data to _pages_—all at build time. This is a really powerful idea. We'll be exploring its implications and ways to use it for the remainder of the tutorial. diff --git a/docs/tutorial/part-one/index.md b/docs/tutorial/part-one/index.md index 9b10b76177002..cb101a80e3ede 100644 --- a/docs/tutorial/part-one/index.md +++ b/docs/tutorial/part-one/index.md @@ -24,8 +24,7 @@ Open a terminal window. See [these instructions](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/) for Mac users and [these other instructions](https://www.quora.com/How-do-I-open-terminal-in-windows) -for Windows users. In your terminal window, type `node --version` then `npm ---version`. +for Windows users. In your terminal window, type `node --version` then `npm --version`. You should see something like: @@ -71,8 +70,7 @@ cd tutorial-part-one gatsby develop ``` -You should see shortly some text that says `The development server is listening -at:` [http://localhost:8000](http://localhost:8000). Open that address in your +You should see shortly some text that says `The development server is listening at:` [http://localhost:8000](http://localhost:8000). Open that address in your browser and... ![Gatsby.js hello world](hello-world.png) diff --git a/examples/using-remark/src/utils/typography.js b/examples/using-remark/src/utils/typography.js index ec622afe9accf..aa80061d47e5a 100644 --- a/examples/using-remark/src/utils/typography.js +++ b/examples/using-remark/src/utils/typography.js @@ -179,14 +179,10 @@ const options = { // https://github.com/comfusion/after-dark/ // @see https://github.com/comfusion/after-dark/blob/8fdbe2f480ac40315cf0e01cece785d2b5c4b0c3/layouts/partials/critical-theme.css#L36-L39 ".post a[href*='//']:after": { - content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${ - linkRaw - }'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`, + content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${linkRaw}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`, }, ".post a[href*='//']:hover:after": { - content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${ - linkHoverRaw - }'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`, + content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${linkHoverRaw}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`, }, // Increase base font-size for phablet and desktop. [presets.Phablet]: { diff --git a/package.json b/package.json index daa73a12ee394..accfd0693bdca 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "jest-cli": "^20.0.4", "lerna": "^2.1.1", "plop": "^1.8.1", - "prettier": "^1.8.2", + "prettier": "^1.9.1", "prettier-eslint-cli": "4.2.x", "remotedev-server": "^0.2.3", "rimraf": "^2.6.1" diff --git a/packages/gatsby-1-config-css-modules/src/index.js b/packages/gatsby-1-config-css-modules/src/index.js index 34068d3d04b8d..48d7f378e42bd 100644 --- a/packages/gatsby-1-config-css-modules/src/index.js +++ b/packages/gatsby-1-config-css-modules/src/index.js @@ -2,8 +2,6 @@ const LOCAL_IDENT_NAME = `[path]---[name]---[local]---[hash:base64:5]` exports.LOCAL_IDENT_NAME = LOCAL_IDENT_NAME exports.cssModulesConfig = stage => { - const loader = `css?modules&minimize&importLoaders=1&localIdentName=${ - LOCAL_IDENT_NAME - }` + const loader = `css?modules&minimize&importLoaders=1&localIdentName=${LOCAL_IDENT_NAME}` return stage.startsWith(`build`) ? loader : `${loader}&sourceMap` } diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 99842cd06f176..1b305a3dd83ad 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -43,9 +43,7 @@ function buildLocalCommands(cli, isLocalSite) { resolveCwd.silent(`gatsby/dist/utils/${command}`) if (!cmdPath) return report.panic( - `There was a problem loading the local ${ - command - } command. Gatsby may not be installed.` + `There was a problem loading the local ${command} command. Gatsby may not be installed.` ) report.verbose(`loading local command from: ${cmdPath}`) @@ -53,9 +51,7 @@ function buildLocalCommands(cli, isLocalSite) { } catch (err) { cli.showHelp() return report.panic( - `There was a problem loading the local ${ - command - } command. Gatsby may not be installed.`, + `There was a problem loading the local ${command} command. Gatsby may not be installed.`, err ) } diff --git a/packages/gatsby-plugin-google-analytics/README.md b/packages/gatsby-plugin-google-analytics/README.md index 921fa028ca688..75b8f237668c5 100644 --- a/packages/gatsby-plugin-google-analytics/README.md +++ b/packages/gatsby-plugin-google-analytics/README.md @@ -25,7 +25,7 @@ plugins: [ ## The "anonymize" option Some countries (such as Germany) require you to use the -[_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for +[\_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for Google Analytics. Otherwise you are not allowed to use it. The option adds two blocks to the code: diff --git a/packages/gatsby-plugin-netlify/src/build-headers-program.js b/packages/gatsby-plugin-netlify/src/build-headers-program.js index 71d485a7df244..e07f3dbacad1b 100644 --- a/packages/gatsby-plugin-netlify/src/build-headers-program.js +++ b/packages/gatsby-plugin-netlify/src/build-headers-program.js @@ -96,9 +96,7 @@ function transformLink(manifest, publicFolder, pathPrefix) { return `${prefix}${pathPrefix}${file}${suffix}` } else { throw new Error( - `Could not find the file specified in the Link header \`${ - header - }\`.` + + `Could not find the file specified in the Link header \`${header}\`.` + `The gatsby-plugin-netlify is looking for a matching file (with or without a ` + `webpack hash). Check the public folder and your gatsby-config.js to ensure you are ` + `pointing to a public file.` @@ -140,9 +138,7 @@ const validateUserOptions = pluginOptions => headers => { mergeOption => { if (!_.isBoolean(pluginOptions[mergeOption])) { throw new Error( - `The "${ - mergeOption - }" option to gatsby-plugin-netlify must be a boolean. ` + + `The "${mergeOption}" option to gatsby-plugin-netlify must be a boolean. ` + `Check your gatsby-config.js.` ) } diff --git a/packages/gatsby-plugin-sharp/src/index.js b/packages/gatsby-plugin-sharp/src/index.js index 4fc228d874133..ebe27c7bef9a8 100644 --- a/packages/gatsby-plugin-sharp/src/index.js +++ b/packages/gatsby-plugin-sharp/src/index.js @@ -262,9 +262,9 @@ function queueImageResizing({ file, args = {} }) { const argsDigestShort = argsDigest.substr(argsDigest.length - 5) - const imgSrc = `/${file.name}-${file.internal.contentDigest}-${ - argsDigestShort - }.${fileExtension}` + const imgSrc = `/${file.name}-${ + file.internal.contentDigest + }-${argsDigestShort}.${fileExtension}` const filePath = path.join(process.cwd(), `public`, `static`, imgSrc) // Create function to call when the image is finished. @@ -413,9 +413,7 @@ async function responsiveSizes({ file, args = {} }) { // If the users didn't set a default sizes, we'll make one. if (!options.sizes) { - options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${ - presentationWidth - }px` + options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${presentationWidth}px` } // Create sizes (in width) for the image. If the max width of the container diff --git a/packages/gatsby-plugin-styled-components/README.md b/packages/gatsby-plugin-styled-components/README.md index a673280744298..2129d1d0ac7c4 100644 --- a/packages/gatsby-plugin-styled-components/README.md +++ b/packages/gatsby-plugin-styled-components/README.md @@ -23,5 +23,4 @@ plugins: [`gatsby-plugin-styled-components`] #### v2.0.1 `styled-components` is moved to a peer dependency. Installing the package -alongside `gatsby-plugin-styled-components` is now required. Use `yarn add -styled-components --save` +alongside `gatsby-plugin-styled-components` is now required. Use `yarn add styled-components --save` diff --git a/packages/gatsby-plugin-styled-jsx/README.md b/packages/gatsby-plugin-styled-jsx/README.md index 98e289e92dcd3..f0f6aff769834 100644 --- a/packages/gatsby-plugin-styled-jsx/README.md +++ b/packages/gatsby-plugin-styled-jsx/README.md @@ -8,8 +8,7 @@ Provides drop-in support for [styled-jsx](https://github.com/zeit/styled-jsx). ## How to use -Add the plugin to the plugins array in your `gatsby-config.js` and use `