From 1a60f691fd3c21167bb920e71a6665350392cf4f Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Sat, 16 Jun 2018 23:13:46 -0700 Subject: [PATCH] Merge v2 in master making it the default branch (#5954) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Publish - gatsby-plugin-manifest@2.0.1-7 * fix icon link * Publish - gatsby-plugin-manifest@2.0.1-8 * [v2] Update offline plugin so it doesn't cachebust JS files any more as well as anything in the static directory (#5299) * Publish - gatsby-plugin-offline@2.0.0-alpha.8 * fix lint (#5304) * [v2] Allow for plugins to override core prefetching behavior (#5320) * Always fetch page resources if user mouseenters a link * Allow plugins to stop core prefetching * Misc small fixes * When rendering bundle for generating HTML, target the current node version * Sort matchPath pages last so more explicit matches win * Misc * Revert * Remove stray console.log * Publish - gatsby-link@1.6.38-6 - gatsby-plugin-manifest@2.0.1-9 - gatsby@2.0.0-alpha.29 * Expose dataPaths on window for access by plugins (need to create API) (#5322) * Publish - gatsby@2.0.0-alpha.30 * [v2][tut. part 7] Rename boundActionCreators to actions (#5293) * [v2][tut. part 4] typography peerDependencies (#5292) * Remove this for now, as it's not currently being used (#5325) * [v2] re-add tests for sass and less plugins + update using-sass example (#5223) * update "using-sass" example * [gatsby-plugin-sass] add tests * [gatsby-plugin-less] update tests and README * commit missing file * add missing snapshot * [v2] sourceType: 'unambigious' is a general babel config option, not for @babel/preset-env (#5336) * [v2] sourceType: 'unambigious' is a general babel config option, not for @babel/preset-env * Update snapshots * Publish - gatsby-plugin-less@2.0.0-alpha.9 - gatsby-plugin-sass@2.0.0-alpha.9 - gatsby@2.0.0-alpha.31 * Adding deploy steps for Aerobatic (#4437) * [v2] small refactor of api-runner-browser to fix loader test (#5343) * small refactor of api-runner-browser to fix tests * remove stray '$' and unneeded eslint-disable-next-line * fix sass and less variants of css modules in build-html stage (#5340) * [v2] fix gatsbygram build (#5356) * Publish - gatsby-plugin-less@2.0.0-alpha.10 - gatsby-plugin-sass@2.0.0-alpha.10 - gatsby@2.0.0-alpha.32 * [v2] deleteNode signature (#5222) * Change deleteNode signature to remove nodeId * These tests were failing? * Deprecate old deleteNode method signature * Change touchNode to accept an object * [v2] Initial commit of gatsby-plugin-guess-js & gatsby-source-wikipedia (#5358) * Add gatsby-source-wikipedia * Add gatsby-plugin-guess-js * Only run guess code during builds as can error during development * Set packages to alpha * Add more keywords to gatsby-source-wikipedia * Document plugins * Publish - gatsby-plugin-guess-js@1.0.0-alpha.2 - gatsby-source-contentful@2.0.0-alpha.11 - gatsby-source-drupal@2.1.0-alpha.10 - gatsby-source-filesystem@2.0.0-alpha.9 - gatsby-source-lever@1.0.9-6 - gatsby-source-wikipedia@1.0.0-alpha.2 - gatsby-source-wordpress@2.0.57-8 - gatsby-transformer-screenshot@1.0.3-6 - gatsby@2.0.0-alpha.33 * Run bootstrap * [gatsby-plugin-guess-js] fix a small README (#5361) * Publish - gatsby-plugin-guess-js@1.0.0-alpha.3 * Fix www front page + small edits to tutorial * Add start to part-8 * only look for files when looking for depracated APIs (#5374) `glob.sync` returns files and directories by default. It is not forbidden to name a directory `foo.js` and it would be returned by `glob`. That's an issue because `fs.readFileSync(file)` will then fail with `EISDIR: illegal operation on a directory`. This makes sure that `glob.sync` only returns files * Lint (#5363) * Fix the gatsbygram UI tests (#5362) * Fix typo * [v2] Make default browserslist more futureproof (#5114) * [v2] Make default browserslist more futureproof This is inspired by Jamie Kyle's blog post/issue in babel yesterday on the problems of using "last 2 versions" with @babel/preset-env which includes browsers which aren't receiving updates anymore so "last 2 versions" will always be building for them. To quote his post: >Using market share percentages as your baseline is much better than some arbitrary number of previous versions. If a browser is used by 0 people, then market percentages will reflect that. * https://jamie.build/last-2-versions * https://github.com/babel/babel/issues/7789 * Use recommended browser defaults * Update index.md Fixing Layout closing tag * Update index.md (#5383) Fixing rhythm export * [v2] Pin babel (#5389) * Pin babel version * Update yarn.lock * remove deprecated Tapable.plugin syntax (#5395) * [V2] Docs - Import Link from gatsby. (#5390) * pass pathContext to page component - it's deprecated, not removed (#5387) * Use "you" instead of "we" where appropriate (#5418) https://github.com/gatsbyjs/gatsby/issues/5381 * [v2] Update Babel to 7.0.0-beta.47 (#5399) * Update babel to 7.0.0-beta.46 * Update yarn.lock * Fix ignore paths * Add missing .babelrc files * Add config for Gatsby package * Fix Jest source compilation * Update to beta 47 * Update yarn.lock * Remove unused dependencies (#5401) * [v2][tut. part 1] Use "you" instead of "we" where appropriate (#5420) * [v2][tut. part 2] Use "you" instead of "we" where appropriate (#5421) * [v2][tut. part 3] Use "you" instead of "we" where appropriate (#5422) * [v2] Update ESLint-related dependencies (#5419) * Update ESLint-related dependencies Fixes #5411 * Remove duplicate dependency from gatsby/package.json * [v2][tut. part 4] Use "you" instead of "we" where appropriate (#5428) * [v2][tut. part 5] Use "you" instead of "we" where appropriate (#5429) * [v2][tut. part 6] Use "you" instead of "we" where appropriate (#5430) * [v2][tut. part 8] Use "you" instead of "we" where appropriate (#5431) * [v2][tut. part 1] Bracket consistency (#5432) * [v2][tut. part 2] Bracket consistency on code blocks + fix line number highlights (#5433) * [gatsby-plugin-sharp] tests: mock async/queue to not actually run sharp sizing (#5426) * Use pageContext * Publish - babel-plugin-remove-graphql-queries@2.0.1-5 - gatsby-1-config-css-modules@1.0.10-7 - gatsby-cli@1.1.41-5 - gatsby-dev-cli@1.2.12-4 - gatsby-image@1.0.42-5 - gatsby-link@1.6.38-7 - gatsby-plugin-canonical-urls@1.0.14-6 - gatsby-plugin-catch-links@2.0.1-6 - gatsby-plugin-coffeescript@2.0.0-alpha.9 - gatsby-plugin-create-client-paths@1.0.6-5 - gatsby-plugin-emotion@2.0.0-alpha.6 - gatsby-plugin-facebook-analytics@1.0.4-3 - gatsby-plugin-feed@1.3.19-6 - gatsby-plugin-fullstory@1.0.4-3 - gatsby-plugin-glamor@2.0.0-alpha.9 - gatsby-plugin-google-analytics@1.0.20-6 - gatsby-plugin-google-tagmanager@1.0.15-6 - gatsby-plugin-guess-js@1.0.0-alpha.4 - gatsby-plugin-jss@2.0.1-6 - gatsby-plugin-less@2.0.0-alpha.11 - gatsby-plugin-lodash@3.0.0-alpha.8 - gatsby-plugin-manifest@2.0.1-10 - gatsby-plugin-netlify-cms@1.0.8-7 - gatsby-plugin-netlify@1.0.19-7 - gatsby-plugin-nprogress@2.0.0-alpha.8 - gatsby-plugin-offline@2.0.0-alpha.9 - gatsby-plugin-preact@2.0.1-7 - gatsby-plugin-react-css-modules@2.0.0-alpha.8 - gatsby-plugin-react-helmet@2.0.12-3 - gatsby-plugin-react-next@2.0.1-7 - gatsby-plugin-remove-trailing-slashes@1.0.6-5 - gatsby-plugin-sass@2.0.0-alpha.11 - gatsby-plugin-sharp@2.0.0-alpha.13 - gatsby-plugin-sitemap@1.2.14-5 - gatsby-plugin-styled-components@3.0.0-alpha.3 - gatsby-plugin-styled-jsx@3.0.0-alpha.6 - gatsby-plugin-styletron@1.0.13-6 - gatsby-plugin-stylus@1.1.16-7 - gatsby-plugin-twitter@1.0.18-6 - gatsby-plugin-typescript@1.4.17-7 - gatsby-plugin-typography@2.0.1-7 - gatsby-react-router-scroll@1.0.12-5 - gatsby-remark-autolink-headers@1.4.13-6 - gatsby-remark-code-repls@1.0.10-5 - gatsby-remark-copy-linked-files@1.5.28-6 - gatsby-remark-custom-blocks@1.0.4-7 - gatsby-remark-embed-snippet@1.0.10-7 - gatsby-remark-images@2.0.0-alpha.14 - gatsby-remark-katex@1.0.13-5 - gatsby-remark-prismjs@1.2.16-6 - gatsby-remark-responsive-iframe@1.4.18-6 - gatsby-remark-smartypants@1.4.12-7 - gatsby-source-contentful@2.0.0-alpha.12 - gatsby-source-drupal@2.1.0-alpha.11 - gatsby-source-faker@1.0.3-6 - gatsby-source-filesystem@2.0.0-alpha.10 - gatsby-source-hacker-news@1.0.11-6 - gatsby-source-lever@1.0.9-7 - gatsby-source-medium@1.0.13-6 - gatsby-source-mongodb@1.5.16-6 - gatsby-source-npm-package-search@1.0.9-2 - gatsby-source-wikipedia@1.0.0-alpha.3 - gatsby-source-wordpress@2.0.57-9 - gatsby-transformer-csv@1.3.9-6 - gatsby-transformer-documentationjs@1.4.10-6 - gatsby-transformer-excel@2.0.1-6 - gatsby-transformer-hjson@2.0.1-6 - gatsby-transformer-javascript-frontmatter@1.0.6-5 - gatsby-transformer-javascript-static-exports@2.0.1-6 - gatsby-transformer-json@2.0.1-6 - gatsby-transformer-pdfimages@1.0.6-4 - gatsby-transformer-react-docgen@2.0.1-7 - gatsby-transformer-remark@2.0.1-8 - gatsby-transformer-sharp@2.0.1-6 - gatsby-transformer-toml@2.0.1-6 - gatsby-transformer-xml@1.0.16-3 - gatsby-transformer-yaml@2.0.1-6 - gatsby@2.0.0-alpha.34 - graphql-skip-limit@2.0.0-alpha.3 * Publish - babel-plugin-remove-graphql-queries@2.0.1-6 - gatsby-1-config-css-modules@1.0.10-8 - gatsby-1-config-extract-plugin@1.0.4-3 - gatsby-cli@1.1.41-6 - gatsby-dev-cli@1.2.12-5 - gatsby-image@1.0.42-6 - gatsby-link@1.6.38-8 - gatsby-plugin-canonical-urls@1.0.14-7 - gatsby-plugin-catch-links@2.0.1-7 - gatsby-plugin-coffeescript@2.0.0-alpha.10 - gatsby-plugin-create-client-paths@1.0.6-6 - gatsby-plugin-emotion@2.0.0-alpha.7 - gatsby-plugin-facebook-analytics@1.0.4-4 - gatsby-plugin-feed@1.3.19-7 - gatsby-plugin-fullstory@1.0.4-4 - gatsby-plugin-glamor@2.0.0-alpha.10 - gatsby-plugin-google-analytics@1.0.20-7 - gatsby-plugin-google-tagmanager@1.0.15-7 - gatsby-plugin-guess-js@1.0.0-alpha.5 - gatsby-plugin-jss@2.0.1-7 - gatsby-plugin-less@2.0.0-alpha.12 - gatsby-plugin-lodash@3.0.0-alpha.9 - gatsby-plugin-manifest@2.0.1-11 - gatsby-plugin-netlify-cms@1.0.8-8 - gatsby-plugin-netlify@1.0.19-8 - gatsby-plugin-nprogress@2.0.0-alpha.9 - gatsby-plugin-offline@2.0.0-alpha.10 - gatsby-plugin-preact@2.0.1-8 - gatsby-plugin-react-css-modules@2.0.0-alpha.9 - gatsby-plugin-react-helmet@2.0.12-4 - gatsby-plugin-react-next@2.0.1-8 - gatsby-plugin-remove-trailing-slashes@1.0.6-6 - gatsby-plugin-sass@2.0.0-alpha.12 - gatsby-plugin-sharp@2.0.0-alpha.14 - gatsby-plugin-sitemap@1.2.14-6 - gatsby-plugin-styled-components@3.0.0-alpha.4 - gatsby-plugin-styled-jsx@3.0.0-alpha.7 - gatsby-plugin-styletron@1.0.13-7 - gatsby-plugin-stylus@1.1.16-8 - gatsby-plugin-twitter@1.0.18-7 - gatsby-plugin-typescript@1.4.17-8 - gatsby-plugin-typography@2.0.1-8 - gatsby-react-router-scroll@1.0.12-6 - gatsby-remark-autolink-headers@1.4.13-7 - gatsby-remark-code-repls@1.0.10-6 - gatsby-remark-copy-linked-files@1.5.28-7 - gatsby-remark-custom-blocks@1.0.4-8 - gatsby-remark-embed-snippet@1.0.10-8 - gatsby-remark-images@2.0.0-alpha.15 - gatsby-remark-katex@1.0.13-6 - gatsby-remark-prismjs@1.2.16-7 - gatsby-remark-responsive-iframe@1.4.18-7 - gatsby-remark-smartypants@1.4.12-8 - gatsby-source-contentful@2.0.0-alpha.13 - gatsby-source-drupal@2.1.0-alpha.12 - gatsby-source-faker@1.0.3-7 - gatsby-source-filesystem@2.0.0-alpha.11 - gatsby-source-hacker-news@1.0.11-7 - gatsby-source-lever@1.0.9-8 - gatsby-source-medium@1.0.13-7 - gatsby-source-mongodb@1.5.16-7 - gatsby-source-npm-package-search@1.0.9-3 - gatsby-source-wikipedia@1.0.0-alpha.4 - gatsby-source-wordpress@2.0.57-10 - gatsby-transformer-csv@1.3.9-7 - gatsby-transformer-documentationjs@1.4.10-7 - gatsby-transformer-excel@2.0.1-7 - gatsby-transformer-hjson@2.0.1-7 - gatsby-transformer-javascript-frontmatter@1.0.6-6 - gatsby-transformer-javascript-static-exports@2.0.1-7 - gatsby-transformer-json@2.0.1-7 - gatsby-transformer-pdfimages@1.0.6-5 - gatsby-transformer-react-docgen@2.0.1-8 - gatsby-transformer-remark@2.0.1-9 - gatsby-transformer-screenshot@1.0.3-7 - gatsby-transformer-sharp@2.0.1-7 - gatsby-transformer-toml@2.0.1-7 - gatsby-transformer-xml@1.0.16-4 - gatsby-transformer-yaml@2.0.1-7 - gatsby@2.0.0-alpha.35 - graphql-skip-limit@2.0.0-alpha.4 * Publish - babel-plugin-remove-graphql-queries@2.0.1-7 - gatsby-1-config-css-modules@1.0.10-9 - gatsby-1-config-extract-plugin@1.0.4-4 - gatsby-cli@1.1.41-7 - gatsby-dev-cli@1.2.12-6 - gatsby-image@1.0.42-7 - gatsby-link@1.6.38-9 - gatsby-plugin-canonical-urls@1.0.14-8 - gatsby-plugin-catch-links@2.0.1-8 - gatsby-plugin-coffeescript@2.0.0-alpha.11 - gatsby-plugin-create-client-paths@1.0.6-7 - gatsby-plugin-emotion@2.0.0-alpha.8 - gatsby-plugin-facebook-analytics@1.0.4-5 - gatsby-plugin-feed@1.3.19-8 - gatsby-plugin-fullstory@1.0.4-5 - gatsby-plugin-glamor@2.0.0-alpha.11 - gatsby-plugin-google-analytics@1.0.20-8 - gatsby-plugin-google-tagmanager@1.0.15-8 - gatsby-plugin-guess-js@1.0.0-alpha.6 - gatsby-plugin-jss@2.0.1-8 - gatsby-plugin-less@2.0.0-alpha.13 - gatsby-plugin-lodash@3.0.0-alpha.10 - gatsby-plugin-manifest@2.0.1-12 - gatsby-plugin-netlify-cms@1.0.8-9 - gatsby-plugin-netlify@1.0.19-9 - gatsby-plugin-nprogress@2.0.0-alpha.10 - gatsby-plugin-offline@2.0.0-alpha.11 - gatsby-plugin-preact@2.0.1-9 - gatsby-plugin-react-css-modules@2.0.0-alpha.10 - gatsby-plugin-react-helmet@2.0.12-5 - gatsby-plugin-react-next@2.0.1-9 - gatsby-plugin-remove-trailing-slashes@1.0.6-7 - gatsby-plugin-sass@2.0.0-alpha.13 - gatsby-plugin-sharp@2.0.0-alpha.15 - gatsby-plugin-sitemap@1.2.14-7 - gatsby-plugin-styled-components@3.0.0-alpha.5 - gatsby-plugin-styled-jsx@3.0.0-alpha.8 - gatsby-plugin-styletron@1.0.13-8 - gatsby-plugin-stylus@1.1.16-9 - gatsby-plugin-twitter@1.0.18-8 - gatsby-plugin-typescript@1.4.17-9 - gatsby-plugin-typography@2.0.1-9 - gatsby-react-router-scroll@1.0.12-7 - gatsby-remark-autolink-headers@1.4.13-8 - gatsby-remark-code-repls@1.0.10-7 - gatsby-remark-copy-linked-files@1.5.28-8 - gatsby-remark-custom-blocks@1.0.4-9 - gatsby-remark-embed-snippet@1.0.10-9 - gatsby-remark-images@2.0.0-alpha.16 - gatsby-remark-katex@1.0.13-7 - gatsby-remark-prismjs@1.2.16-8 - gatsby-remark-responsive-iframe@1.4.18-8 - gatsby-remark-smartypants@1.4.12-9 - gatsby-source-contentful@2.0.0-alpha.14 - gatsby-source-drupal@2.1.0-alpha.13 - gatsby-source-faker@1.0.3-8 - gatsby-source-filesystem@2.0.0-alpha.12 - gatsby-source-hacker-news@1.0.11-8 - gatsby-source-lever@1.0.9-9 - gatsby-source-medium@1.0.13-8 - gatsby-source-mongodb@1.5.16-8 - gatsby-source-npm-package-search@1.0.9-4 - gatsby-source-wikipedia@1.0.0-alpha.5 - gatsby-source-wordpress@2.0.57-11 - gatsby-transformer-csv@1.3.9-8 - gatsby-transformer-documentationjs@1.4.10-8 - gatsby-transformer-excel@2.0.1-8 - gatsby-transformer-hjson@2.0.1-8 - gatsby-transformer-javascript-frontmatter@1.0.6-7 - gatsby-transformer-javascript-static-exports@2.0.1-8 - gatsby-transformer-json@2.0.1-8 - gatsby-transformer-pdfimages@1.0.6-6 - gatsby-transformer-react-docgen@2.0.1-9 - gatsby-transformer-remark@2.0.1-10 - gatsby-transformer-screenshot@1.0.3-8 - gatsby-transformer-sharp@2.0.1-8 - gatsby-transformer-toml@2.0.1-8 - gatsby-transformer-xml@1.0.16-5 - gatsby-transformer-yaml@2.0.1-8 - gatsby@2.0.0-alpha.36 - graphql-skip-limit@2.0.0-alpha.5 * Add missing dev dependencies * [v2][tut. part 3] Bracket consistency on code blocks (#5434) * [v2][tut. part 4] Bracket consistency on code blocks (#5435) * Publish - gatsby-remark-katex@1.0.13-8 * Bump version of Gatsby for new build * Publish - gatsby@2.0.0-alpha.38 * [gatsby-remark-images] change gatsby-plugin-sharp version to next to avoid resolving version to outdated canary release (#5443) * Publish - gatsby-remark-images@2.0.0-alpha.17 * [v2][www] Add global layout to pages and templates that don’t have it yet. (#5454) * Added missing package * Added global layout + fix little issues * [v2][tut. pt. 4] No semi (#5449) * [v2][tut. pt. 2] Single to backticks consistency (#5450) * Run bootstrap (#5456) * [v2] merge master into v2 (#5451) * Use index within container Confusing as to what is being asked. Later, the docs say to `import Container from "../components/container";` * Pass through GTM environment params if present Signed-off-by: Spencer Sanchez * Add abinavseelan.com to Showcase * Add Dovetail (dovetailapp.com) to website examples Thanks for creating Gatsby and for all of your hard work! We’ve enjoyed building our new marketing website with it. * change link of `gatsby-advanced-blog` in docs * Remove outdated contributing notes from gatsby-remark-prismjs * Typo: Return to wrong file I was doing the gatsby.js tutorial and I was running into one issue, the tutorial said to return to index.js, but it should be to my-files.js, I eventually figured out that this was probably just a typo, but for a long time I kept changing my index.js file and didn't understand what I was doing wrong, turns out I was editing the wrong file. For so far I have enjoyed gatsby.js, I want to use it for my personal portfolio. * Fix distance between masthead and the icon (#5068) On mobile, the masthead is overlapping with the Gatsby icon. * Update CONTRIBUTING.md * Update README.md Per issue https://github.com/gatsbyjs/gatsby/issues/5073 * Add better-queue to dependencies * Remove index.js for more consistent paths * removing "a" * pre-inferring data sanitazation (#5050) * extractFieldExamples: omit not defined fields this is especially helpful with ___NODE fields - plugins/users don't have to test if there are any values and be confident that empty ___NODE values or arrays will just be omitted and not error out during bootstrap * sanitize field owner key when using createNodeField with name containing ___NODE this fixes issue with inferring fieldOwners types - gatsby would try to link to not existing nodes * Add getRenderer method (#5017) * Add getRenderer method Signed-off-by: slorber * upgrade example versions Signed-off-by: slorber * change name to renderer * Change name to replaceHydrateFunction * document replaceHydrateFunction * fix(gatsby): remove `.js` suffixes in require() to allow transpilation (#5087) In earlier v1, one could write files such as `gatsby-config` in typescript and use babel to transpile the file into js on the fly via `babel-node --presets @babel/preset-typescript --extensions '.ts' gatsby develop`. However, it's no longer possible in recent releases. The reason is that the current implementation put a `.js` suffix on each require(`gatsby-${env}.js`), which blocks `gatsby-{$env}` files being transpiled from other languages via babel. The PR addresses this problem by removing the unnecessary suffix and preserving the integrity. Signed-off-by: Alvis HT Tang * Publish - gatsby-plugin-google-tagmanager@1.0.18 - gatsby-plugin-sitemap@1.2.23 - gatsby-remark-prismjs@2.0.2 - gatsby-source-drupal@2.0.36 - gatsby-source-filesystem@1.5.34 - gatsby-source-wordpress@2.0.82 - gatsby@1.9.254 * stylus plugin tests Signed-off-by: Jan Winterfeld * add learnstorybook.com to showcase * Bump yargs version to get help and version for free by default * Update manifest extension to .webmanifest Reason: https://sonarwhal.com/docs/user-guide/rules/rule-manifest-file-extension/ * Updated link to file * team development workflows (#5084) * team development workflows * Small typos * Revert "Small typos" This reverts commit ee7bc36c2093ba550280330040f89d771c867b47. * Revert "team development workflows" This reverts commit a9e549853e826ef93a96c2b61da4d7fab0883ece. * move doc to blog * excerpt * Publish - gatsby-cli@1.1.51 - gatsby-plugin-manifest@1.0.21 - gatsby-plugin-stylus@1.1.20 - gatsby@1.9.255 * Hyperlinks, optionality, and "easy" (#5154) Added a few changes. This document needs to be reorganized eventually; I just want to add these notes in the fastest way possible now so I don't forget them. * Add bartvanderwaerden.com to showcase (#5152) * I guess I found the wrong word... (#5088) I think line 308's `src/pages/my-files.js` is wrong. It should be `src/pages/index.js` isn't it? * Add two missing spaces (minor validation error) (#5150) My previous commit missed adding a space after the backup blank `src=""` and `alt=""` attributes. This causes an HTML validation error when no `alt` value is supplied. This commit simply adds those missing spaces (i.e. `src="" ` and `alt="" `) so there will always be a space between attributes. * Adjust image processing example queries (#5158) * adjust queries to not use id as way to select by filenames this will stop working in gatsby v2 * add link to code * Update KaTeX to 0.9.0 (#4712) * Update KaTeX to 0.9.0 * Update snapshots * DCO bye-bye (#5165) * source-contentful: Add environment support (#5142) * source-contentful: Add environment support * fix lint * fix default locale logix * log error * Update lock file * Ulog the error * Update package-lock.json * revert lock changes, test shrinkwrap * remove shrinkwrap, it's unused after all, add yarn resolutions * cleanup debug console logs * Link an example that uses gatsby-transformer-json (#5169) * Publish - gatsby-image@1.0.48 - gatsby-remark-katex@1.0.14 - gatsby-source-contentful@1.3.48 - gatsby-transformer-json@1.0.17 * Update RNW plugin and example (#5174) * Update RNW example to use new plugin version Signed-off-by: slorber * Update React in example Signed-off-by: slorber * Enhance RNW example Signed-off-by: slorber * Add link to online demo Signed-off-by: slorber * Add screenshot Signed-off-by: slorber * Update createRemoteFileNode documentation (#5171) * Update createRemoteFileNode documentation * Update README.md * Fix replaceHydrateFunction doc (#5175) * Fix replaceHydrateFunction doc * Add spaces * Update "how gatsby works" documentation (#243) (#5181) * Add a note about CNAME file in `static` * Fix typo in the .eslintrc file (#5173) * added my site (#5172) * Added rafael.do (#5199) * Add Eviction Free NYC blog post and link to site (#5159) * Add evictionfreenyc.org to showcase * Add Eviction Free NYC blog post * Fixing a typo * Copy edits * Self-contained images * [Ready 4 Review] SQIP - Vectorized primitive image previews (#4205) * first working version with Contentful assets only * add readme * respect width, height, aspect ratio, cropping, resize focus and background * add support for gatsby-transformer-sharp * integrate in gatsbygram * avoid useless regeneration cus contentDigest changes * proper way to get absolute path to ImageSharp nodes * queue preview generation and cache results on disk * upgrade to latest node-sqip to get rid of the GoLang dependency * replace custom svg data uri function with package * prepare images via sharp plugin and allow sharp transformations * load cached svg properly from disk * fix queue resolving to early * set contentful images to 400px * implement new sharp transformation awareness feature * WIP - extract generation and write first pseudo test * fix styling for gatsbygram post detail * finalize unit tests for actual sqip implementation * use 256px input image width to match sqip/primitive default * add using-sqip example page * some cleanup * clean up example and enhance polaroid effect * fix using-sqip dependency * remove base64 since it was not implemented and is bad for compression * remove sqip from gatsbygram example * simplify tests * Small change to trigger build * Publish - gatsby-plugin-sharp@1.6.44 - gatsby-remark-images@1.5.63 - gatsby-source-drupal@2.0.37 - gatsby-source-filesystem@1.5.35 - gatsby-source-wordpress@2.0.83 - gatsby-transformer-sharp@1.6.24 - gatsby-transformer-sqip@0.0.2 - gatsby@1.9.256 * Add tutorial on creating a source plugin * Format * Add extensions to .eslintrc (#5206) - Add .json or .yaml extension to .eslintrc files ```shell $ cd ./packages $ rename 's/.eslintrc/.eslintrc.yaml/' `find . -name .eslintrc` $ cd ../ $ rename 's/.eslintrc/.eslintrc.json/' `find . -name .eslintrc` ``` - Tweak plopfile.js to add .json extension to examples to be generated Signed-off-by: Masato Ohba * Add gatsby-starter-bulma-storybook to the starters list (#5208) Signed-off-by: Gianni Valdambrini * fix: style and typo correction - Minor style tweaks (e.g. unlinked "pixabay.com" => "Pixabay") - Typo patrol - De-British some of the language (my apologies to the letter U) * Toodle-pip British u * Adjust heading hierarchy * Use relative urls for gatsbyjs.org links * Pull last few sections up a level * Minor edits and consistency tweaks * Cleanup example for the createPages API (#5216) * Update with @shannonbux's edits * Additional header * Bumps gatsby-plugin-mailchimp to 2.2.2 bc we updated its API to be more user friendly (#5215) * Add YAML data file for site showcase (#5227) * Publish - gatsby-image@1.0.49 - gatsby-link@1.6.42 - gatsby-plugin-catch-links@1.0.20 - gatsby-plugin-styletron@2.0.7 - gatsby-react-router-scroll@1.0.15 - gatsby@1.9.257 * Update to Gitlab pages deploy (#5243) * Update to Gitlab pages deploy Gitlab pages now include a Gatsby template for CI, which makes it a lot easier to add. Have updated the documentation to reflect this. * Edit * Update README.md (#5247) Adding explanation about available option `offsetY` to solve issue #5061 Signed-off-by: Robin Cussol * [gatsby-source-contentful] Fix storing new sync token (#5252) * Add https://emoji.tinder.com/ to showcase (#5257) * Fix typo (#5241) * Link to website in contributing.md (#5249) * Publish - gatsby-remark-autolink-headers@1.4.18 - gatsby-source-contentful@1.3.49 - gatsby-source-wordpress@2.0.84 * Bump versions of packages that failed to publish earlier * Publish - gatsby-image@1.0.51 - gatsby-link@1.6.44 - gatsby-plugin-catch-links@1.0.22 - gatsby-plugin-styletron@2.0.9 - gatsby-react-router-scroll@1.0.17 - gatsby@1.9.259 * Add top padding for tablet masthead (#5266) * wordpress-source-plugin-tutorial (#5235) * wordpress-source-plugin-tutorial Not sure if I got all the code samples formatted correctly. Still need to edit the index.js page so the

tags don't render!! Then, need a screenshot of the final result without

tags! * removed unnecessary backticks and corrected link to Part 7 of tutorial * Make links relative * Use graphql for syntax highlighting + minor copy edits * Image Tutorial (#5236) * Image Tutorial Would be nice to add a screenshot of the finished result. Eventually, a really cool image tutorial could include GIFs. * Remove unneeded backticks around code * Add example gif * Fix image links * added Gatsbygram link, fixed assumption spelling * we --> you * Added some more edits of my own wasn't sure whether you wanted lines 153-155 to stay the same * Changed back to previous lines 149-159 I accidentally deleted necessary stuff in my previous commit, so I'm just starting over * Edited comments per Mike's suggestions * Small tweaks * Add site (#5268) * readme: Add aQuICK QC landing page site * readme: Kill old event specific page * Quick fix for wordpress source plugin tutorial (#5276) Fragments don't work on Graphiql * Minor fix on wordpress source plugin tutorial (#5277) removed typo * Update wordpress-source-plugin-tutorial.md (#5278) * add missing underscore to graphiql URL (#5275) * add missing underscore to graphiql * Update image-tutorial.md * Update wordpress-source-plugin-tutorial.md (#5279) * Update image-tutorial.md (#5281) * Update source-plugin-tutorial.md (#5283) * add missing .npmignore and .babelrc to sqip transformer (#5282) * Publish - gatsby-transformer-sqip@0.0.3 * Fix typos in source-plugin-tutorial (#5284) * Add workshop-in-the-woods.com to the showcase (#5291) * Update README.md (#5288) * Update README.md Missing curly bracket * formatting * Fix doc typo (#5294) * fix: chang the url of blog in readme :bug: (#5302) * feat: :sparkles: add gatsby-new-blog plugin * docs: update showcase :memo: * flag importance of plugin order for prism-js vs embed-snippet (#5313) If gatsby-remark-prism-js is declared before gatsby-remark-embed-snippet, the latter will not pick up the `embed:example.js` syntax because it is looking for an inline-code node and it will have been transformed into a p node by gatsby-remark-prism-js. This needs to be noted as this is far from obvious. * Add manifest.webmanifest to staticFileGlobs (#5300) Signed-off-by: Kaue Machado * Publish - gatsby-plugin-offline@1.0.16 - gatsby-remark-embed-snippet@1.0.22 - gatsby-source-contentful@1.3.50 * Fix post path comment (#5295) * Fix post path * Fix * Expand docs for custom components (#5315) * Expand docs for custom components The docs for custom components only mention defining custom components in the markdown, but don't address one of the most useful aspects - that you can map generic markdown tags/elements to your own components. I've expanded the docs to point this out and added a simple example. * Typo * plugin-feed: Note feed xml file is production only (#5305) Add note that the rss.xml feed is only generated in production. * Fixing grammar around CSS Modules (#5286) * Fix broken link to tutorial for building blog (#5273) I don't know if it's the original article but at least it looks fairly similar * added develop command options to use custom key and certs (#5056) * added develop command options to use custom key and certs * fixed typos in doc * added condition to make sure both --key-file and --cert-file are present * - passing https flag results in automatic https certs [devcert] - --cert-file, --key-file, and --https flags can be used together for custom ssl - if all flags needed for custom ssl are not present an error is displayed to the user - if provided --cert-file and --key-file paths are not real files, node gives a rejection - modified docs to express current behavior * Add portfolio to the created with gatsby section (#5331) * Documentation for images in page components #3380 (#4191) * adding first draft * adding info about fragments * cleaning up language * renaming file, this commit is for issue #3380 * technical edits on working with images in gatsby * technical edits on working with images in gatsby * punctuation and verb tense edits * more punctuation and grammar * commas * Add new docs page to sidebar (#5339) * New issue, feature and question template (#5274) * Basic template for new issues * updated issue template * updated issue template * Update ISSUE_TEMPLATE.md * Update ISSUE_TEMPLATE.md * changed bug report to the new GitHub issue template * add feature request template * question template * fixed title of question and added emojis * added RFC to question template * Update bug_report.md * Update feature_request.md * Update question.md * Typo * Update custom-html.md (#5341) * Update custom-html.md grammar corrections * Revert one change * Actually revert that one change * add plugin option examples (#5345) add plugin option examples * Remove workshop banner now that workshops have finished (#5338) * Update url-loader (#5342) * Update plugins.md * [gatsby-source-contentful]: Add fallback locale support (#5328) * Add fallback locale support * Fix linting * test: Fix test * Publish - gatsby-cli@1.1.52 - gatsby-plugin-feed@1.3.22 - gatsby-source-contentful@1.3.51 - gatsby-transformer-remark@1.7.41 - gatsby@1.9.260 * [gatsby-source-wordpress] check if parent exists (#5373) * [gatsby-source-filesystem] add fs error handling, bump got retry attemps count (#5375) * [gatsby-source-filesystem] catch fs stream errors * [gatsby-source-filesystem] bump got retries from default 2 to 5 * normalize reject payload * Add context to query-runner error log (#5214) * [www] Prevent image twitching in Chrome when hovering a blog index card (#5396) * [gatsby-transformer-yaml] Update docs: GraphQL query mismatch (#5402) GraphQL query references "value" when it should actually reference "character" as per the example output. * [gatsby-transformer-json] Update docs: outdated Readme examples (#5403) `{ internal: { type } }` exists but it would actually be "LettersJson" (according to my GraphiQL checks). Seems better to just remove this, so it at least has parity with gatsby-transformer-yaml readme. * Add "Six Reasons I Chose Gatsby" blog post (#5369) * added "Six Reasons I Chose Gatsby" blog post * added site to showcase * updated content based on review comments * updated Gatsby links to be relative * Fix for IE10 not loading scripts (#5404) * Fix for IE10 not loading scripts * Fixed duplicate declaration. * Update example config for netlify-cms (#5405) Added the public_folder attribute to make the assets accessible. Also added the body field to the collection, so the html attribute of markdownRemark gets filled properly. Figuring out that the field has to be named "body" was a bit cumbersome. https://www.netlifycms.org/docs/configuration-options/#fields * Fix regression with prefix paths and gatsby-plugin-manifest (#5406) as per https://github.com/gatsbyjs/gatsby/commit/69ca24750ecba8945a57f2c662cc5ca44964d76a#diff-079fdad4111264c646208511aa18a321 manifest.webmanifest should start with / it just works (tm) when your site is flat, but when your pages are in sub directory and prefixed, its assumes your manifest files are in the subdirectory, not the root of your site (which might be prefixed). Fixing reversion * Remove old comment (#5407) Code changed in #5404, this comment no longer relevant. * Add gatsby-starter-modern (#5427) * Publish - gatsby-plugin-manifest@1.0.22 - gatsby-source-drupal@2.0.38 - gatsby-source-filesystem@1.5.36 - gatsby-source-wordpress@2.0.85 - gatsby-transformer-json@1.0.18 - gatsby-transformer-yaml@1.5.17 - gatsby@1.9.261 * Mention in building apps docs page that we use React Router under the hood (#5439) * Add a how to add search to your website section (#5272) * Add a how to add search to your website section * Update adding-search.md * Update doc-links.yaml * Update adding-search.md * Better restructuring * Update doc-links.yaml * Update adding-search.md * Address Changes * Rewrite docs * Add the link before the links to stub articles The ones ending with * are stubs * Tidy up * Grammar/punctuation edits and some wording edits * Adding Headers * Edits * More headings * Minor edits * Update adding-search.md (#5448) * regenerate yarn.lock * temporarily disable stylus tests - need to update both tests and example sites to v2 * fix wrong conflict resolution * [v2] update using-stylus example and re-add tests to stylus plugin (#5461) * update stylus tests * update using-stylus example * specify eslint rule we want to disable * format * fix merge conflict remnant * Removed unneeded imports causing no-unused-vars lint errors (#5463) * Add stricter check for `Error:` and placeholder test (#5460) * Publish - gatsby-cli@1.1.41-8 - gatsby-image@1.0.42-8 - gatsby-link@1.6.38-10 - gatsby-plugin-catch-links@2.0.1-9 - gatsby-plugin-feed@1.3.19-9 - gatsby-plugin-google-tagmanager@1.0.15-9 - gatsby-plugin-manifest@2.0.1-13 - gatsby-plugin-offline@2.0.0-alpha.12 - gatsby-plugin-sharp@2.0.0-alpha.16 - gatsby-plugin-sitemap@1.2.14-8 - gatsby-plugin-styletron@1.0.13-9 - gatsby-plugin-stylus@1.1.16-10 - gatsby-react-router-scroll@1.0.12-8 - gatsby-remark-autolink-headers@1.4.13-9 - gatsby-remark-embed-snippet@1.0.10-10 - gatsby-remark-prismjs@1.2.16-9 - gatsby-source-contentful@2.0.0-alpha.15 - gatsby-source-filesystem@2.0.0-alpha.13 - gatsby-source-wordpress@2.0.57-12 - gatsby-transformer-json@2.0.1-9 - gatsby-transformer-remark@2.0.1-11 - gatsby-transformer-sharp@2.0.1-9 - gatsby-transformer-sqip@0.0.4-0 - gatsby-transformer-yaml@2.0.1-9 - gatsby@2.0.0-alpha.39 * [v2][www] Move layout to components folder + import Link from gatsby (#5472) * Move layout to components folder and rename its import to be consistent * Import Link from gatsby instead of gatsby-link * Add preload links to end of headComponents list (#5490) * Publish - gatsby@2.0.0-alpha.40 * Don't infer types for plugin provided GQL types * Update screenshot plugin for Gatsby v2 (#5502) * Publish - gatsby-transformer-screenshot@1.0.3-9 * Simpler bundle and data loading (#5535) * Publish - gatsby@2.0.0-alpha.41 * [v2] [gatsby-plugin-offline] get exact filenames for js staticFileGlob (#5511) * [gatsby-plugin-offline] extract exact filenames for js chunks for app and offline app shell * format * Don't inline webpack-runtime as this prevents the service worker from correctly updating to new version of the site (#5540) * Publish - gatsby-plugin-offline@2.0.0-alpha.13 - gatsby@2.0.0-alpha.42 * [v2][www] Fix remaining lint errors (#5568) * fix: `default-case` lint errors * fix: `eqeqeq` lint error * fix: `array-callback-return` lint error * fix: `no-unused-vars` lint error * fix: `alt-text` lint error * Fix missing blog posts (#5539) (#5551) Quick fix for: https://github.com/gatsbyjs/gatsby/issues/5348#issuecomment-391682881 * Add a valid entry point for the `gatsby` package (#5481) * Fix outdated babel-code-frame import to use @babel/code-frame (#5585) Fix #5584 Signed-off-by: Helder S Ribeiro * [v2] image processing example (#5589) * Upgrade to use gatsby v2 and fix eslint warnings * Fix up fonts on production build * Add back `replaceComponentRenderer` API (#5600) also fix bad merge on lifecycles * Publish - gatsby-cli@1.1.41-9 - gatsby@2.0.0-alpha.43 * Update Contentful example site for Gatsby v2 (#5606) * delete stray console.log * Update babel to 7.0.0-beta.49 * Update yarn.lock * [v2] responsive image types (#5250) * Change image type names from resolutions to fixed resolutions resolutions resolutions fixed fixed fixed fixed fixed fixed * Change image type names from sizes to fluid sizes sizes sizes sizes fluid fluid fluid fluid * Continue renaming sizes to fluid * eslint * Include sizes as part of a fluid node * Update snapshots * Update resolver * Remove references to responsiveResolution and responsiveSizes * Rename GraphQL node types for gatsby-transformer-sharp * Rename GraphQL node types for gatsby-source-contentful * Update image-processing example * fluid() should still return a sizes property * Use unique type names * Fix duplicate deprecation messages * Publish - gatsby-image@1.0.42-9 - gatsby-plugin-manifest@2.0.1-14 - gatsby-plugin-sharp@2.0.0-alpha.17 - gatsby-remark-images@2.0.0-alpha.18 - gatsby-source-contentful@2.0.0-alpha.16 - gatsby-source-wordpress@2.0.57-13 - gatsby-transformer-sharp@2.0.1-10 - gatsby@2.0.0-alpha.44 * [v2] mime dependencies (#5602) * Recreate lockfile * Update dependencies that depend on mime * Move less to a peer dependency * Move node-sass to a peer dependency * Update lockfile * Update README.md * Include node-sass in the sass example site * [v2][www] Abstracted sidebar to layout component (#5537) * Abstracted sidebar to layout component * Hide sidebar on mobile * [v2] Bump gatsby-image version as #5250 is a breaking change for it (#5627) * Publish - gatsby-image@1.0.42-9 - gatsby-plugin-manifest@2.0.1-14 - gatsby-plugin-sharp@2.0.0-alpha.17 - gatsby-remark-images@2.0.0-alpha.18 - gatsby-source-contentful@2.0.0-alpha.16 - gatsby-source-wordpress@2.0.57-13 - gatsby-transformer-sharp@2.0.1-10 - gatsby@2.0.0-alpha.44 * [v2] Bump gatsby-image version as #5250 is a breaking change for it * [v2][www] Move YAML link files to data (#5567) * Move YAML link files to data * Organize sidebar links to a subdirectory of data * Publish - babel-plugin-remove-graphql-queries@2.0.1-8 - gatsby-1-config-css-modules@1.0.10-10 - gatsby-1-config-extract-plugin@1.0.4-5 - gatsby-cli@1.1.41-10 - gatsby-dev-cli@1.2.12-7 - gatsby-image@2.0.0-alpha.2 - gatsby-link@1.6.38-11 - gatsby-plugin-canonical-urls@1.0.14-9 - gatsby-plugin-catch-links@2.0.1-10 - gatsby-plugin-coffeescript@2.0.0-alpha.12 - gatsby-plugin-create-client-paths@1.0.6-8 - gatsby-plugin-emotion@2.0.0-alpha.9 - gatsby-plugin-facebook-analytics@1.0.4-6 - gatsby-plugin-feed@1.3.19-10 - gatsby-plugin-fullstory@1.0.4-6 - gatsby-plugin-glamor@2.0.0-alpha.12 - gatsby-plugin-google-analytics@1.0.20-9 - gatsby-plugin-google-tagmanager@1.0.15-10 - gatsby-plugin-guess-js@1.0.0-alpha.7 - gatsby-plugin-jss@2.0.1-9 - gatsby-plugin-less@2.0.0-alpha.14 - gatsby-plugin-lodash@3.0.0-alpha.11 - gatsby-plugin-manifest@2.0.1-15 - gatsby-plugin-netlify-cms@1.0.8-10 - gatsby-plugin-netlify@1.0.19-10 - gatsby-plugin-nprogress@2.0.0-alpha.11 - gatsby-plugin-offline@2.0.0-alpha.14 - gatsby-plugin-preact@2.0.1-10 - gatsby-plugin-react-css-modules@2.0.0-alpha.11 - gatsby-plugin-react-helmet@2.0.12-6 - gatsby-plugin-react-next@2.0.1-10 - gatsby-plugin-remove-trailing-slashes@1.0.6-8 - gatsby-plugin-sass@2.0.0-alpha.14 - gatsby-plugin-sharp@2.0.0-alpha.18 - gatsby-plugin-sitemap@1.2.14-9 - gatsby-plugin-styled-components@3.0.0-alpha.6 - gatsby-plugin-styled-jsx@3.0.0-alpha.9 - gatsby-plugin-styletron@1.0.13-10 - gatsby-plugin-stylus@1.1.16-11 - gatsby-plugin-twitter@1.0.18-9 - gatsby-plugin-typescript@1.4.17-10 - gatsby-plugin-typography@2.0.1-10 - gatsby-react-router-scroll@1.0.12-9 - gatsby-remark-autolink-headers@1.4.13-10 - gatsby-remark-code-repls@1.0.10-8 - gatsby-remark-copy-linked-files@1.5.28-9 - gatsby-remark-custom-blocks@1.0.4-10 - gatsby-remark-embed-snippet@1.0.10-11 - gatsby-remark-images@2.0.0-alpha.19 - gatsby-remark-katex@1.0.13-9 - gatsby-remark-prismjs@1.2.16-10 - gatsby-remark-responsive-iframe@1.4.18-9 - gatsby-remark-smartypants@1.4.12-10 - gatsby-source-contentful@2.0.0-alpha.17 - gatsby-source-drupal@2.1.0-alpha.14 - gatsby-source-faker@1.0.3-9 - gatsby-source-filesystem@2.0.0-alpha.14 - gatsby-source-hacker-news@1.0.11-9 - gatsby-source-lever@1.0.9-10 - gatsby-source-medium@1.0.13-9 - gatsby-source-mongodb@1.5.16-9 - gatsby-source-npm-package-search@1.0.9-5 - gatsby-source-wikipedia@1.0.0-alpha.6 - gatsby-source-wordpress@2.0.57-14 - gatsby-transformer-csv@1.3.9-9 - gatsby-transformer-documentationjs@1.4.10-9 - gatsby-transformer-excel@2.0.1-9 - gatsby-transformer-hjson@2.0.1-9 - gatsby-transformer-javascript-frontmatter@1.0.6-8 - gatsby-transformer-javascript-static-exports@2.0.1-9 - gatsby-transformer-json@2.0.1-10 - gatsby-transformer-pdfimages@1.0.6-7 - gatsby-transformer-react-docgen@2.0.1-10 - gatsby-transformer-remark@2.0.1-12 - gatsby-transformer-screenshot@1.0.3-10 - gatsby-transformer-sharp@2.0.1-11 - gatsby-transformer-sqip@0.0.4-1 - gatsby-transformer-toml@2.0.1-9 - gatsby-transformer-xml@1.0.16-6 - gatsby-transformer-yaml@2.0.1-10 - gatsby@2.0.0-alpha.45 - graphql-skip-limit@2.0.0-alpha.6 * v1.0.18-9 * v1.0.18-10 * v2.0.0-alpha.20 * revert one change from #5250, this one should use "sizes" (it doesn't use sharp transformer) (#5631) * Publish - gatsby-plugin-manifest@2.0.1-16 * [v2][www] Fix missing search sidebar for plugins/packages pages (#5550) * Add react-instantsearch package required by plugins searchbar * Add package searchbar to pages that require them * Rename searchbar to plugin-searchbar * Fix imports sidebar data * Revert upgrade to babel-beta.49 * Publish - babel-plugin-remove-graphql-queries@2.0.1-9 - gatsby-1-config-css-modules@1.0.10-11 - gatsby-1-config-extract-plugin@1.0.4-6 - gatsby-cli@1.1.41-11 - gatsby-dev-cli@1.2.12-8 - gatsby-image@2.0.0-alpha.3 - gatsby-link@1.6.38-12 - gatsby-plugin-canonical-urls@1.0.14-10 - gatsby-plugin-catch-links@2.0.1-11 - gatsby-plugin-coffeescript@2.0.0-alpha.13 - gatsby-plugin-create-client-paths@1.0.6-9 - gatsby-plugin-emotion@2.0.0-alpha.10 - gatsby-plugin-facebook-analytics@1.0.4-7 - gatsby-plugin-feed@1.3.19-11 - gatsby-plugin-fullstory@1.0.4-7 - gatsby-plugin-glamor@2.0.0-alpha.13 - gatsby-plugin-google-analytics@1.0.20-10 - gatsby-plugin-google-tagmanager@1.0.15-11 - gatsby-plugin-guess-js@1.0.0-alpha.8 - gatsby-plugin-jss@2.0.1-10 - gatsby-plugin-less@2.0.0-alpha.15 - gatsby-plugin-lodash@3.0.0-alpha.12 - gatsby-plugin-manifest@2.0.1-17 - gatsby-plugin-netlify-cms@1.0.8-11 - gatsby-plugin-netlify@1.0.19-11 - gatsby-plugin-nprogress@2.0.0-alpha.12 - gatsby-plugin-offline@2.0.0-alpha.15 - gatsby-plugin-preact@2.0.1-11 - gatsby-plugin-react-css-modules@2.0.0-alpha.12 - gatsby-plugin-react-helmet@2.0.12-7 - gatsby-plugin-react-next@2.0.1-11 - gatsby-plugin-remove-trailing-slashes@1.0.6-9 - gatsby-plugin-sass@2.0.0-alpha.15 - gatsby-plugin-sharp@2.0.0-alpha.19 - gatsby-plugin-sitemap@1.2.14-10 - gatsby-plugin-styled-components@3.0.0-alpha.7 - gatsby-plugin-styled-jsx@3.0.0-alpha.10 - gatsby-plugin-styletron@1.0.13-11 - gatsby-plugin-stylus@1.1.16-12 - gatsby-plugin-twitter@1.0.18-11 - gatsby-plugin-typescript@1.4.17-11 - gatsby-plugin-typography@2.0.1-11 - gatsby-react-router-scroll@1.0.12-10 - gatsby-remark-autolink-headers@1.4.13-11 - gatsby-remark-code-repls@1.0.18-10 - gatsby-remark-copy-linked-files@1.5.28-10 - gatsby-remark-custom-blocks@1.0.4-11 - gatsby-remark-embed-snippet@1.0.10-12 - gatsby-remark-images@2.0.0-alpha.21 - gatsby-remark-katex@1.0.13-10 - gatsby-remark-prismjs@1.2.16-11 - gatsby-remark-responsive-iframe@1.4.18-10 - gatsby-remark-smartypants@1.4.12-11 - gatsby-source-contentful@2.0.0-alpha.18 - gatsby-source-drupal@2.1.0-alpha.15 - gatsby-source-faker@1.0.3-10 - gatsby-source-filesystem@2.0.0-alpha.15 - gatsby-source-hacker-news@1.0.11-10 - gatsby-source-lever@1.0.9-11 - gatsby-source-medium@1.0.13-10 - gatsby-source-mongodb@1.5.16-10 - gatsby-source-npm-package-search@1.0.9-6 - gatsby-source-wikipedia@1.0.0-alpha.7 - gatsby-source-wordpress@2.0.57-15 - gatsby-transformer-csv@1.3.9-10 - gatsby-transformer-documentationjs@1.4.10-10 - gatsby-transformer-excel@2.0.1-10 - gatsby-transformer-hjson@2.0.1-10 - gatsby-transformer-javascript-frontmatter@1.0.6-9 - gatsby-transformer-javascript-static-exports@2.0.1-10 - gatsby-transformer-json@2.0.1-11 - gatsby-transformer-pdfimages@1.0.6-8 - gatsby-transformer-react-docgen@2.0.1-11 - gatsby-transformer-remark@2.0.1-13 - gatsby-transformer-screenshot@1.0.3-11 - gatsby-transformer-sharp@2.0.1-12 - gatsby-transformer-sqip@0.0.4-2 - gatsby-transformer-toml@2.0.1-10 - gatsby-transformer-xml@1.0.16-7 - gatsby-transformer-yaml@2.0.1-11 - gatsby@2.0.0-alpha.46 - graphql-skip-limit@2.0.0-alpha.7 * Publish - gatsby@2.0.0-alpha.48 * Fix a typo in Readme example (#5645) * [v2][doc] v1 to v2 migration guide (WIP) (#5575) * v1 to v2 migration guide doc start * Add sidebar link to v2 migration guide * Update README to show v1 to v2 migration guide * Fix children type in README (#5687) * Update redirects example for Gatsby v2 (#5681) * [v2][gatsby-image] Deepen propTypes declaration (#5684) * Add extensive prop types checking * This works better and is easier to read * Fix webp spelling * [v2][source-contentful] Restore legacy sizes and resolutions fragments (#5678) * [v2] Restore legacy sizes and resolutions fragments * Reword TODO a little bit * [v2] Update csv example (#5703) * [v2] Update medium example (#5704) * [v2] Update no-plugins example (#5705) * Update no-plugins example * update html.js to use all passed props * format * [v2] Update client only paths example (#5706) * [v2] Update using-excel example (#5707) * [WIP][v2] Edit tutorial to use emotion instead of glamorous (#5664) * [v2] Edit tutorial part 4 to use emotion instead of glamorous * Change heading to siteTitle as it makes more sense * Change glamor to emotion + ran markdown formatter * Move css inline * part-six: change to emotion + run through format-markdown * part-seven: add Layout to template + run format-markdown * part-seven: add line highlight numbers to template changes * part-seven: emotion + format-markdown + add line highlight numbers * part-six: change sort syntax so it’s consistent with part-seven * Remove mistakenly added line * [v2][gatsby-transformer-sharp] restore legacy fragments (#5710) * Publish - gatsby-image@2.0.0-alpha.4 - gatsby-source-contentful@2.0.0-alpha.19 - gatsby-transformer-sharp@2.0.1-13 - gatsby@2.0.0-alpha.49 * [v2] Update Emotion example (#5715) * Bump package versions * Add react-helmet and its Gatsby plugin * Migrate from custom html.js to react-helmet * Edit styling method to showcase different Emotion APIs * Add references to README * Change gatsby-plugin-react-helmet version to next * [v2] Update styled-components example (#5717) * Bump package versions * Add gatsby-plugin-react-helmet and gatsby-plugin-typography * Add react react-dom babel-plugin-styled-components * Remove outdated line (Gatsby hot reloads regardless of this line) * Migrate from custom html.js to react-helmet * Bump gatsby-plugin-typography version to next * Flag the new example as version 2.0.0, up from 1.0.0 * Add references to README * [v2] Migration guide updates (#5661) * Remove yarn examples for consistency with other docs * Add rename responsive image queries section * Add postcss plugins section * Remove checklist (moved to issue 3986) * Add mixed CommonJS/ES6 section * Link to Gatsby webpack docs * Add node id section * Add section: remove explicit polyfills * Add section: Change modifyBabelrc to onCreateBabelConfig * Add section: Change `modifyWebpackConfig` to `onCreateWebpackConfig` * Add section: CSS is inlined automatically * Add introduction and small tweaks * Correct line numbers * Improve explanation around movement of libs to peerDependencies * chore: minor capitalization tweak * Add edit link * Split peer dep updates into two sections * Declarative headings * Add table of contents * Use neater Fragment syntax * More detail on deprecation note * Inline comments on code examples * Add Jason's node ID query example * Use markdown diff syntax for before / after examples * Add 'in-progress' note about babel polyfills * Add instructions on how to install Gatsby v2 * [gatsby] added TypeScript typings for StaticQuery component (#5666) This should make StaticQuery calls not give out any type errors in TypeScript. Types are intentionally made weak, as I couldn't figure out how to correctly type any GraphQL calls here. * [v2][gatsby-image][source-contentful] Fix sizes fields that were changed to fluid by mistake (#5714) * Fix sizes field that was changed to fluid by mistake * [gatsby-image] Fix sizes fields that were changed to fluid by mistake * Update test snapshot * [v2] compile cache dir (#5637) * run cache-dir through babel * fix gitignore * watch cache-dir * fix cache-dir linting and update json-store react lifecycle methods * build rawfiles during watch * Publish - gatsby-image@2.0.0-alpha.5 - gatsby-source-contentful@2.0.0-alpha.20 - gatsby@2.0.0-alpha.50 * [v2] Correct inlined css upgrade guide (#5741) v1's default html.js also inlined css https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/default-html.js The change is that with mini-css-extract-plugin, we have css splitting so we handle inlining css in core as it requires understanding webpack's stats object. * [v2] fix build with pathPrefix (#5691) * [v2] fix build with pathPrefix * update test * removed __PREFIX_PATHS__ * fix test * update lock file * address comments * clean * clean * [v2] Update styleguide example (#5712) * Update styleguide example for v2 * Replace boundActionCreators to actions * Use pageContext * Fix exports * [v2] Update redux example (#5713) * Update redux example for v2 * Remove html.js * Use ES6 export * [v2] Update Emotion + PrismJS example (#5720) * Add required packages + upgrade their versions * Refactor layout component to v2 * Migrate from custom html.js to react-helmet * Add references to README * Fix typo + remove semi * Fix typo * Fix lint errors + remove unused console.log * Fix mixed up blog post content * Show proper page titles * remove word * remove word * Update page loading indicator example for Gatsby v2 (#5735) * Update using css modules example for Gatsby v2 (#5736) * [v2] Update plugin-typescript to use Babel (#5709) * Update plugin-typescript to use Babel * Fix code style * Bump the version * Update README * Use npm for install instructions * Add more cheese (#5751) * Update using-styletron example for v2 (#5749) * fix: page renderer behavior (#5759) * [v2] Migration guide: shorten TOC links to just the hash (#5766) * Simplify TOC links to just the hash * Run it through format-markdown script * Publish - gatsby-link@1.6.38-13 - gatsby-plugin-typescript@2.0.0-alpha.2 - gatsby@2.0.0-alpha.51 * [v2] Don't allow unknown keys on node.internal object (#5770) * [v2] Don't allow unknown fields on node.internal object Validate against changes like https://github.com/gatsbyjs/gatsby/pull/5557 * Document the change * Add script for adding new owners to our NPM packages (#5768) * [v2] Update typescript example (#5711) * Improve the TypeScript example * Set up linting and type checking Tweak tsconfig.json * Remove extraneous package * Update using-path-prefix example for v2 (#5752) * [v2] Update using-remark-copy-linked-file example (#5755) * Update using-remark-copy-linked-files example for v2 * Remove react-responsive-grid refs gatsbyjs/gatsby-starter-blog#99 * Use Layout component * [v2] Update Sitemap example (#5767) * [v2] Update using-glamor example (#5757) * Update packages * Remove unused typography packages * Add typography.js * eslint * [docgen] better error handling and update to v3 (#5604) * better error handling and update to v3 * fix rdg version: * update doc-handler * Update package.json * make test more robust * fix test * Update no-trailing-slashes example for v2 (#5781) * Update simple-auth example for v2 (#5782) * Link directly to edit page (#5792) Closes #5791 * Update wording (#5795) * [v2] export graphql package from gatsby (#5415) * export graphql package from gatsby * update after sqip plugin merge * revert weird formatting changes * fix graphql.js packaging * note in Breaking Changes for plugin maintainers * fix typo * remove graphql-type-json from plugins deps * update setFieldsOnGraphQLNodeType docs * update yarn.lock * Typo * Minor edits * update migration guide * Add a word * [v2] Use kebabHash() instead of _.kebabCase() (#5532) * Add dep `kebab-hash` to `packages/gatsby`. #4637 * Replace `_.kebabCase()` with `kebabHash()`. #4637 * Add dep `kebab-hash` to `packages/gatsby`. #4637 * Replace `_.kebabCase()` with `kebabHash()`. #4637 In the `gatsby-plugin-netlify` package. * Bump `kebab-hash` to `0.1.2`. #4637 * Update snapshots for new path ID format. #4637 * [v2] Clarify filenames and update `sizes` to `fluid` (#5809) [v2] Clarify filenames and update `sizes` to `fluid` * fix: upstream fixes (#5815) * webpack hmr path responding appropriately to env GATSBY_WEBPACK_PUBLICPATH * make linter happy * added public path env option for webpack (#5527) * Publish - babel-plugin-remove-graphql-queries@2.0.1-10 - gatsby-plugin-netlify@1.0.19-12 - gatsby-plugin-typescript@2.0.0-alpha.3 - gatsby-source-contentful@2.0.0-alpha.21 - gatsby-source-filesystem@2.0.0-alpha.16 - gatsby-transformer-react-docgen@2.0.1-12 - gatsby-transformer-remark@2.0.1-14 - gatsby-transformer-sharp@2.0.1-14 - gatsby-transformer-sqip@0.0.4-3 - gatsby@2.0.0-alpha.52 * Publish - babel-plugin-remove-graphql-queries@2.0.1-11 - gatsby-1-config-css-modules@1.0.10-12 - gatsby-1-config-extract-plugin@1.0.4-7 - gatsby-cli@1.1.41-12 - gatsby-dev-cli@1.2.12-9 - gatsby-image@2.0.0-alpha.6 - gatsby-link@1.6.38-14 - gatsby-plugin-canonical-urls@1.0.14-11 - gatsby-plugin-catch-links@2.0.1-12 - gatsby-plugin-coffeescript@2.0.0-alpha.14 - gatsby-plugin-create-client-paths@1.0.6-10 - gatsby-plugin-emotion@2.0.0-alpha.11 - gatsby-plugin-facebook-analytics@1.0.4-8 - gatsby-plugin-feed@1.3.19-12 - gatsby-plugin-fullstory@1.0.4-8 - gatsby-plugin-glamor@2.0.0-alpha.14 - gatsby-plugin-google-analytics@1.0.20-11 - gatsby-plugin-google-tagmanager@1.0.15-12 - gatsby-plugin-guess-js@1.0.0-alpha.9 - gatsby-plugin-jss@2.0.1-11 - gatsby-plugin-less@2.0.0-alpha.16 - gatsby-plugin-lodash@3.0.0-alpha.13 - gatsby-plugin-manifest@2.0.1-18 - gatsby-plugin-netlify-cms@1.0.8-12 - gatsby-plugin-netlify@1.0.19-13 - gatsby-plugin-no-sourcemaps@1.0.4-6 - gatsby-plugin-nprogress@2.0.0-alpha.13 - gatsby-plugin-offline@2.0.0-alpha.16 - gatsby-plugin-preact@2.0.1-12 - gatsby-plugin-react-css-modules@2.0.0-alpha.13 - gatsby-plugin-react-helmet@2.0.12-8 - gatsby-plugin-react-next@2.0.1-12 - gatsby-plugin-remove-trailing-slashes@1.0.6-10 - gatsby-plugin-sass@2.0.0-alpha.16 - gatsby-plugin-sharp@2.0.0-alpha.20 - gatsby-plugin-sitemap@1.2.14-11 - gatsby-plugin-styled-components@3.0.0-alpha.8 - gatsby-plugin-styled-jsx@3.0.0-alpha.11 - gatsby-plugin-styletron@1.0.13-12 - gatsby-plugin-stylus@1.1.16-13 - gatsby-plugin-twitter@1.0.18-12 - gatsby-plugin-typescript@2.0.0-alpha.4 - gatsby-plugin-typography@2.0.1-12 - gatsby-react-router-scroll@1.0.12-11 - gatsby-remark-autolink-headers@1.4.13-12 - gatsby-remark-code-repls@1.0.18-11 - gatsby-remark-copy-linked-files@1.5.28-11 - gatsby-remark-custom-blocks@1.0.4-12 - gatsby-remark-embed-snippet@2.0.1-2 - gatsby-remark-images@2.0.0-alpha.22 - gatsby-remark-katex@1.0.13-11 - gatsby-remark-prismjs@2.0.3-2 - gatsby-remark-responsive-iframe@1.4.18-11 - gatsby-remark-smartypants@1.4.12-12 - gatsby-source-contentful@2.0.0-alpha.22 - gatsby-source-drupal@2.1.0-alpha.16 - gatsby-source-faker@1.0.3-11 - gatsby-source-filesystem@2.0.0-alpha.17 - gatsby-source-hacker-news@1.0.11-11 - gatsby-source-lever@1.0.9-12 - gatsby-source-medium@1.0.13-11 - gatsby-source-mongodb@1.5.16-11 - gatsby-source-npm-package-search@1.0.9-7 - gatsby-source-wikipedia@1.0.0-alpha.8 - gatsby-source-wordpress@2.0.57-16 - gatsby-transformer-csv@1.3.9-11 - gatsby-transformer-documentationjs@1.4.10-11 - gatsby-transformer-excel@2.0.1-11 - gatsby-transformer-hjson@2.0.1-11 - gatsby-transformer-javascript-frontmatter@1.0.6-10 - gatsby-transformer-javascript-static-exports@2.0.1-11 - gatsby-transformer-json@2.0.1-12 - gatsby-transformer-pdfimages@1.0.6-9 - gatsby-transformer-react-docgen@2.0.1-13 - gatsby-transformer-remark@2.0.1-15 - gatsby-transformer-screenshot@1.0.3-12 - gatsby-transformer-sharp@2.0.1-15 - gatsby-transformer-sqip@0.0.4-4 - gatsby-transformer-toml@2.0.1-11 - gatsby-transformer-xml@1.0.16-8 - gatsby-transformer-yaml@2.0.1-12 - gatsby@2.0.0-alpha.53 - graphql-skip-limit@2.0.0-alpha.8 * Publish - babel-plugin-remove-graphql-queries@2.0.1-12 - gatsby-1-config-css-modules@1.0.10-13 - gatsby-1-config-extract-plugin@1.0.4-8 - gatsby-cli@1.1.41-13 - gatsby-dev-cli@1.2.12-10 - gatsby-image@2.0.0-alpha.7 - gatsby-link@1.6.38-15 - gatsby-plugin-canonical-urls@1.0.14-12 - gatsby-plugin-catch-links@2.0.1-13 - gatsby-plugin-coffeescript@2.0.0-alpha.15 - gatsby-plugin-create-client-paths@1.0.6-11 - gatsby-plugin-emotion@2.0.0-alpha.12 - gatsby-plugin-facebook-analytics@1.0.4-9 - gatsby-plugin-feed@1.3.19-13 - gatsby-plugin-fullstory@1.0.4-9 - gatsby-plugin-glamor@2.0.0-alpha.15 - gatsby-plugin-google-analytics@1.0.20-12 - gatsby-plugin-google-tagmanager@1.0.15-13 - gatsby-plugin-guess-js@1.0.0-alpha.10 - gatsby-plugin-jss@2.0.1-12 - gatsby-plugin-less@2.0.0-alpha.17 - gatsby-plugin-lodash@3.0.0-alpha.14 - gatsby-plugin-manifest@2.0.1-19 - gatsby-plugin-netlify-cms@1.0.8-13 - gatsby-plugin-netlify@1.0.19-14 - gatsby-plugin-nprogress@2.0.0-alpha.14 - gatsby-plugin-offline@2.0.0-alpha.17 - gatsby-plugin-preact@2.0.1-13 - gatsby-plugin-react-css-modules@2.0.0-alpha.14 - gatsby-plugin-react-helmet@2.0.12-9 - gatsby-plugin-react-next@2.0.1-13 - gatsby-plugin-remove-trailing-slashes@1.0.6-11 - gatsby-plugin-sass@2.0.0-alpha.17 - gatsby-plugin-sharp@2.0.0-alpha.21 - gatsby-plugin-sitemap@1.2.14-12 - gatsby-plugin-styled-components@3.0.0-alpha.9 - gatsby-plugin-styled-jsx@3.0.0-alpha.12 - gatsby-plugin-styletron@1.0.13-13 - gatsby-plugin-stylus@1.1.16-14 - gatsby-plugin-twitter@1.0.18-13 - gatsby-plugin-typescript@2.0.0-alpha.5 - gatsby-plugin-typography@2.0.1-13 - gatsby-react-router-scroll@1.0.12-12 - gatsby-remark-autolink-headers@1.4.13-13 - gatsby-remark-code-repls@1.0.18-12 - gatsby-remark-copy-linked-files@1.5.28-12 - gatsby-remark-custom-blocks@1.0.4-13 - gatsby-remark-embed-snippet@2.0.1-3 - gatsby-remark-images@2.0.0-alpha.23 - gatsby-remark-katex@1.0.13-12 - gatsby-remark-prismjs@2.0.3-3 - gatsby-remark-responsive-iframe@1.4.18-12 - gatsby-remark-smartypants@1.4.12-13 - gatsby-source-contentful@2.0.0-alpha.23 - gatsby-source-drupal@2.1.0-alpha.17 - gatsby-source-faker@1.0.3-12 - gatsby-source-filesystem@2.0.0-alpha.18 - gatsby-source-hacker-news@1.0.11-12 - gatsby-source-lever@1.0.9-13 - gatsby-source-medium@1.0.13-12 - gatsby-source-mongodb@1.5.16-12 - gatsby-source-npm-package-search@1.0.9-8 - gatsby-source-wikipedia@1.0.0-alpha.9 - gatsby-source-wordpress@2.0.57-17 - gatsby-transformer-csv@1.3.9-12 - gatsby-transformer-documentationjs@1.4.10-12 - gatsby-transformer-excel@2.0.1-12 - gatsby-transformer-hjson@2.0.1-12 - gatsby-transformer-javascript-frontmatter@1.0.6-11 - gatsby-transformer-javascript-static-exports@2.0.1-12 - gatsby-transformer-json@2.0.1-13 - gatsby-transformer-pdfimages@1.0.6-10 - gatsby-transformer-react-docgen@2.0.1-14 - gatsby-transformer-remark@2.0.1-16 - gatsby-transformer-screenshot@1.0.3-13 - gatsby-transformer-sharp@2.0.1-16 - gatsby-transformer-sqip@0.0.4-5 - gatsby-transformer-toml@2.0.1-12 - gatsby-transformer-xml@1.0.16-9 - gatsby-transformer-yaml@2.0.1-13 - gatsby@2.0.0-alpha.54 - graphql-skip-limit@2.0.0-alpha.9 * Publish - gatsby@2.0.0-alpha.55 * [v2][www] add prismjs dependency (it was moved to peerDeps in gatsby-remark-prismjs) (#5844) * [v2][www] add prismjs dependency (it was moved to peerDeps in gatsby-remark-prismjs) * add prismjs in examples * [v2] Use replacementComponent directly in page-renderer (#5812) * Run replaced component generated by replaceComponentRenderer * Use first result as replacementComponent * [v2][using-remark] fix build (#5852) * [v2] re-add eslintrc after master merge (#5856) * [v2] Fix styling for remark example (#5857) * Include gatsby-plugin-typography * Lint * Update lockfile * [v2] cleanup MiniCssExtractPlugin from develop stage (#5837) * [v2] Update using-jss example (#5832) * Bump package versions * Add react react-dom react-jss * Flag version 2.0.0 * Revert version * [v2] Add StaticQuery doc (#5827) * StaticQuery doc initial concept * Add links to StaticQuery doc * Use 'Query Variables' instead of 'arguments' * Minor edits * Use contenthash for CSS (#5808) * First draft site showcase submission @fk @thatotherperson @sw-yx Here's the first draft. A few questions: - Is main_url where the screenshot comes from? - Will people know that the //comments// ought to be deleted? - Is 70 characters the length of description we agreed on, @fk? - As I explained different types of categories below, it made me wonder if we need to visibly and functionally separate "type of site" from "content of site" because having them all in one bucket causes confusion and necessitates the kind of explanation in this document. - Also, if people want to create new categories, what should they do? - My featured sites section might be an unecessary commitment to a process nobody has yet talked about hehe. Not sure what to do; people will want to know, so thought it's worth having a section on it so we don't have to answer questions all the time * Publish - gatsby@2.0.0-alpha.56 * Ensure src/cache-dir is never ignored (#5878) * update v2 migration docs about babel configuration (#5881) * section for babel and jest * update language * [v2] remove temporary link (#5885) * [v2][www] eslint fix (#5876) * Add required dependency (#5875) * Add missing import to upgrade docs (#5886) :) * [v2][gatsby-source-contentful] switch sharp dep version to next (#5889) * Fix wrong versions from master merge (#5890) * Versions are confusing (#5891) * [v2] fix builds after master merge (#5892) * [v2] update babel in new plugins * fix missing closing parenthesis * [v2][gatsby-source-contentful] fix deleted entries handling after the merge (#5893) * Publish - gatsby-image@2.0.0-alpha.8 - gatsby-plugin-catch-links@2.0.1-14 - gatsby-plugin-feed@1.3.19-14 - gatsby-plugin-manifest@2.0.1-20 - gatsby-plugin-page-creator@1.0.2-0 - gatsby-remark-copy-linked-files@1.5.28-13 - gatsby-remark-images-contentful@1.0.2-0 - gatsby-source-contentful@2.0.0-alpha.24 - gatsby-transformer-documentationjs@1.4.10-13 - gatsby-transformer-remark@2.0.1-17 - gatsby-transformer-sqip@2.0.0-alpha.2 - gatsby@2.0.0-alpha.57 * docs: update V2 README for beta (#5903) Add relevant notes and links about V2. re gatsbyjs/gatsby#5762 * Add "Link" part to upgrade docs (#5905) Since I couldn't find any paragraph about this change I added something :) * Add example to webpack config (#5906) As I used this today I figured I share it with the other ppl who might want to do the same :) * [v2] fix migrating links in readme (#5896) * [v2] fix migrating links in readme * Adjust URLs * addressed all your comments * title edit * hopefully making it less intimidating * Update babel to beta 51 * Update babylon to @babel/parser * Remove unsupported 'sourceType' option @babel/preset-env doesn't support such an option, @babel/core does * Update tests * Update yarn.lock * Disable gatsby eslint if local found (#5871) * add: disable gatsby eslint if local found * fix: use white list for blog * [v2] update load-plugins snapshot (#5918) * Changed location of submission instructions to doc * updated link and ready to merge * fix: local-eslint-config-finder (#5922) * fix minor warnings in v2/www (#5940) * add noreferrer to rel to kill eslint warning * add tbody to satisfy warning in evaluation-table.js * [v2] Fix v1 / v2 version conflicts (#5899) * Remove old / v1-specific plugins * Fix conflicting versions between v1 and v2, update gatsby peerdep to v2 * Update dependencies for version check * Update snapshot * Update peerDep to match new version * Update webpack.config.js (#5793) * Update yarn.lock * Publish - babel-plugin-remove-graphql-queries@2.0.2-alpha.1 - gatsby-cli@2.0.0-alpha.1 - gatsby-dev-cli@2.0.0-alpha.1 - gatsby-link@2.0.0-alpha.1 - gatsby-plugin-canonical-urls@2.0.0-alpha.1 - gatsby-plugin-catch-links@2.0.2-alpha.1 - gatsby-plugin-coffeescript@2.0.0-alpha.16 - gatsby-plugin-create-client-paths@2.0.0-alpha.1 - gatsby-plugin-emotion@2.0.0-alpha.13 - gatsby-plugin-facebook-analytics@2.0.0-alpha.1 - gatsby-plugin-feed@2.0.0-alpha.1 - gatsby-plugin-fullstory@2.0.0-alpha.1 - gatsby-plugin-google-analytics@2.0.0-alpha.1 - gatsby-plugin-google-tagmanager@2.0.0-alpha.1 - gatsby-plugin-guess-js@1.0.0-alpha.11 - gatsby-plugin-jss@2.0.2-alpha.1 - gatsby-plugin-less@2.0.0-alpha.18 - gatsby-plugin-lodash@3.0.1-alpha.1 - gatsby-plugin-manifest@2.0.2-alpha.1 - gatsby-plugin-netlify-cms@2.0.0-alpha.1 - gatsby-plugin-netlify@2.0.0-alpha.1 - gatsby-plugin-no-sourcemaps@2.0.0-alpha.1 - gatsby-plugin-offline@2.0.0-alpha.18 - gatsby-plugin-page-creator@2.0.0-alpha.1 - gatsby-plugin-preact@2.0.0-alpha.1 - gatsby-plugin-react-css-modules@2.0.0-alpha.15 - gatsby-plugin-react-helmet@3.0.0-alpha.1 - gatsby-plugin-remove-trailing-slashes@2.0.0-alpha.1 - gatsby-plugin-sass@2.0.0-alpha.18 - gatsby-plugin-sharp@2.0.0-alpha.22 - gatsby-plugin-sitemap@2.0.0-alpha.1 - gatsby-plugin-styled-components@3.0.0-alpha.10 - gatsby-plugin-styled-jsx@3.0.1-alpha.13 - gatsby-plugin-styletron@3.0.0-alpha.1 - gatsby-plugin-stylus@2.0.0-alpha.1 - gatsby-plugin-twitter@2.0.0-alpha.1 - gatsby-plugin-typescript@2.0.0-alpha.6 - gatsby-plugin-typography@2.2.0-alpha.1 - gatsby-react-router-scroll@2.0.0-alpha.1 - gatsby-remark-autolink-headers@2.0.0-alpha.1 - gatsby-remark-code-repls@2.0.0-alpha.1 - gatsby-remark-copy-linked-files@2.0.0-alpha.1 - gatsby-remark-custom-blocks@2.0.0-alpha.1 - gatsby-remark-embed-snippet@3.0.0-alpha.1 - gatsby-remark-images-contentful@2.0.0-alpha.1 - gatsby-remark-images@2.0.1-alpha.1 - gatsby-remark-katex@2.0.0-alpha.1 - gatsby-remark-prismjs@3.0.0-alpha.1 - gatsby-remark-responsive-iframe@2.0.0-alpha.1 - gatsby-remark-smartypants@2.0.0-alpha.1 - gatsby-source-contentful@2.0.1-alpha.1 - gatsby-source-drupal@2.2.0-alpha.1 - gatsby-source-faker@2.0.0-alpha.1 - gatsby-source-filesystem@2.0.1-alpha.1 - gatsby-source-hacker-news@2.0.0-alpha.1 - gatsby-source-lever@2.0.0-alpha.1 - gatsby-source-medium@2.0.0-alpha.1 - gatsby-source-mongodb@2.0.0-alpha.1 - gatsby-source-npm-package-search@2.0.0-alpha.1 - gatsby-source-wikipedia@2.0.0-alpha.1 - gatsby-source-wordpress@3.0.0-alpha.1 - gatsby-transformer-csv@2.0.0-alpha.1 - gatsby-transformer-documentationjs@2.0.0-alpha.1 - gatsby-transformer-excel@2.1.1-alpha.1 - gatsby-transformer-hjson@2.1.1-alpha.1 - gatsby-transformer-javascript-frontmatter@2.0.0-alpha.1 - gatsby-transformer-javascript-static-exports@2.1.1-alpha.1 - gatsby-transformer-json@2.1.1-alpha.1 - gatsby-transformer-react-docgen@2.1.1-alpha.1 - gatsby-transformer-remark@2.1.1-alpha.1 - gatsby-transformer-screenshot@2.0.0-alpha.1 - gatsby-transformer-sharp@2.1.1-alpha.1 - gatsby-transformer-sqip@2.0.0-alpha.3 - gatsby-transformer-toml@2.1.1-alpha.1 - gatsby-transformer-xml@2.0.0-alpha.1 - gatsby-transformer-yaml@2.1.1-alpha.1 - gatsby@2.0.0-alpha.58 * Fix yarn.lock * Temp remove plugin * Temp remove another plugin * Topics/showcase rebase v2 (#5941) * Current work on showcase against v2 * Update outdated gatsby-transformer-screenshot * Update gatsby-config to remove vestigial folder * Clean up after merge * make css fixes to showcase: add featured sites at top, make searchbox nicer, cta buttons. put prev and next for permalink pages * Use next versions of sharp plugins * details page is now responsive * main page responsive * add showcase magic icon * Fix production builds * Make mobile sizing work correctly * Fix warning (UNSAFE_componentWillMount) * Sloppy fix for missing node.fields.slug * (WiP) Various „Featured Sites“ fixes * stop Prettier from inserting stray backticks around „View all“ (React.Fragment helped) * add functionality to „View all“ link * typography * add background image to container * fix main layout container horizontal whitespace * Switch from „resolutions“ to „sizes“ for „Featured Sites“ images … which allows us to define different widths per breakpoint for „Featured Sites“ cards. Along the way: * (WiP) add „View all Featured Sites“ card design * „built by“, category typography * fix showcase-magic.svg viewbox * Abandon window.width in favor of CSS media queries * Fix „All featured sites“ card for smaller screens…’n MOAR * add basic styles for search form * add „Featured Sites“ card hover styles * add sticky sidebar/„x Showcase Sites/Search“ header * consolidate button styles for „Submit Site“ and „Load more“ * sidebar UI styles first rinse touching * „collapsible“ header styles * filter item styles * add webkit-scrollbar styles for both `overflow: scroll` containers * Simplify markup, semantics * Showcase card hover, whitespace * Filter item vertical padding, increase gutter for featured cards on Desktop * Allow clicking through the gradient overlay * Don’t let gradient overlay cover scrollbar * Consolidate (not all) card hover styles * Define list card width * UI fixes * Increase modal background opacity * Set modal content width, various modal UI fixes…and Prettier * Add modal close button * Fix modal/close button border radius * Previous/next fontSize, fix source link appearance * Checkboxes for sidebar filter items, „Clear filters“ button…MOAR * support multi-line sidebar filter item titles * add initial design for „Clear filters“ button * align „caret“ icon in header * add arrow forward, downward icons * Adjust modal description, categories appearance * Fix permalink view basic layout * Detail view: Add „Visit Site“ button * Revisit „Clear all Filters“ button UI * Last bits of detail view header design Along the way: color variables, consolidate styles. * Add gutterDesktop * Remove units * Remove duplicate key, order * (WIP) Big prev/next images on permalink pages * „Featured Sites“ „view all“ links: Scroll to filtered showcase list scroll-to-anchor.js by @jlengstorf * Fix „View all Featured Sites“ right margin Ref. https://stackoverflow.com/a/28682628 * Prettier * Underline title when hovering card * Fix #showcase position * Add OpenGraph/Twitter image meta tags Analog to what we do in `blog-post-template.js`. * Add first shot at the „social share“ menu * Mobile improvements * Fix dupe keys * Fix horizontal margin * Link „permalink“ page prev/next images * Whitespace * Square „prev/next“ images for permalink pages * Mobile navigation shouldn’t cover images * Remove image marginBottom * Hide „Featured Sites“ for less than Desktop for now * Implement reduced version of permalink page prev/next link design * Update „Submit site“ href * Update metadata urls * fix package.json * showcase fix rebase & modified hack * more rebase edits * [v2] Build-html static file using the webpack magic comment to provide the link rel. (#5901) * upgrade webpack version to 4.12.0 for webpackPrefetch propose * use stats.toJson() instead of manually parse chunkGroups * WIP: debug static entry * add childAssets to rel link in static-entry :tada: * use stats.toJson with less verbose * WIP: unique link rel and give priority to preload * fixed assetsByChunkName in webpack.stats different from current implementation * add using-prefetching-preloading-modules examples * Don't add prefetched bundles to end of html + move preloading json with other scripts * [v2] Consistently use 'index' as jsonname for the frontpage (#5946) * Prettify * Revert "Temp remove another plugin" This reverts commit 80a21f04630020bcb6dc067df44a2be2bf64c475. * Revert "Temp remove plugin" This reverts commit e328d33fb5b1cd0a71ec060d89711fb43af5d328. * Update yarn.lock * Publish - babel-plugin-remove-graphql-queries@2.0.2-alpha.2 - gatsby-cli@2.0.0-alpha.2 - gatsby-dev-cli@2.0.0-alpha.2 - gatsby-image@2.0.0-alpha.9 - gatsby-link@2.0.0-alpha.2 - gatsby-plugin-canonical-urls@2.0.0-alpha.2 - gatsby-plugin-catch-links@2.0.2-alpha.2 - gatsby-plugin-coffeescript@2.0.0-alpha.17 - gatsby-plugin-create-client-paths@2.0.0-alpha.2 - gatsby-plugin-emotion@2.0.0-alpha.14 - gatsby-plugin-facebook-analytics@2.0.0-alpha.2 - gatsby-plugin-feed@2.0.0-alpha.2 - gatsby-plugin-fullstory@2.0.0-alpha.2 - gatsby-plugin-glamor@2.0.0-alpha.16 - gatsby-plugin-google-analytics@2.0.0-alpha.2 - gatsby-plugin-google-tagmanager@2.0.0-alpha.2 - gatsby-plugin-guess-js@1.0.0-alpha.12 - gatsby-plugin-jss@2.0.2-alpha.2 - gatsby-plugin-less@2.0.0-alpha.19 - gatsby-plugin-lodash@3.0.1-alpha.2 - gatsby-plugin-manifest@2.0.2-alpha.2 - gatsby-plugin-netlify-cms@2.0.0-alpha.2 - gatsby-plugin-netlify@2.0.0-alpha.2 - gatsby-plugin-nprogress@2.0.0-alpha.15 - gatsby-plugin-offline@2.0.0-alpha.19 - gatsby-plugin-page-creator@2.0.0-alpha.2 - gatsby-plugin-preact@2.0.0-alpha.2 - gatsby-plugin-react-css-modules@2.0.0-alpha.16 - gatsby-plugin-react-helmet@3.0.0-alpha.2 - gatsby-plugin-remove-trailing-slashes@2.0.0-alpha.2 - gatsby-plugin-sass@2.0.0-alpha.19 - gatsby-plugin-sharp@2.0.0-alpha.23 - gatsby-plugin-sitemap@2.0.0-alpha.2 - gatsby-plugin-styled-components@3.0.0-alpha.11 - gatsby-plugin-styled-jsx@3.0.1-alpha.14 - gatsby-plugin-styletron@3.0.0-alpha.2 - gatsby-plugin-stylus@2.0.0-alpha.2 - gatsby-plugin-twitter@2.0.0-alpha.2 - gatsby-plugin-typescript@2.0.0-alpha.7 - gatsby-plugin-typography@2.2.0-alpha.2 - gatsby-react-router-scroll@2.0.0-alpha.2 - gatsby-remark-autolink-headers@2.0.0-alpha.2 - gatsby-remark-code-repls@2.0.0-alpha.2 - gatsby-remark-copy-linked-files@2.0.0-alpha.2 - gatsby-remark-custom-blocks@2.0.0-alpha.2 - gatsby-remark-embed-snippet@3.0.0-alpha.2 - gatsby-remark-images-contentful@2.0.0-alpha.2 - gatsby-remark-images@2.0.1-alpha.2 - gatsby-remark-katex@2.0.0-alpha.2 - gatsby-remark-prismjs@3.0.0-alpha.2 - gatsby-remark-responsive-iframe@2.0.0-alpha.2 - gatsby-remark-smartypants@2.0.0-alpha.2 - gatsby-source-contentful@2.0.1-alpha.2 - gatsby-source-drupal@2.2.0-alpha.2 - gatsby-source-faker@2.0.0-alpha.2 - gatsby-source-filesystem@2.0.1-alpha.2 - gatsby-source-hacker-news@2.0.0-alpha.2 - gatsby-source-lever@2.0.0-alpha.2 - gatsby-source-medium@2.0.0-alpha.2 - gatsby-source-mongodb@2.0.0-alpha.2 - gatsby-source-npm-package-search@2.0.0-alpha.2 - gatsby-source-wikipedia@2.0.0-alpha.2 - gatsby-source-wordpress@3.0.0-alpha.2 - gatsby-transformer-csv@2.0.0-alpha.2 - gatsby-transformer-documentationjs@2.0.0-alpha.2 - gatsby-transformer-excel@2.1.1-alpha.2 - gatsby-transformer-hjson@2.1.1-alpha.2 - gatsby-transformer-javascript-frontmatter@2.0.0-alpha.2 - gatsby-transformer-javascript-static-exports@2.1.1-alpha.2 - gatsby-transformer-json@2.1.1-alpha.2 - gatsby-transformer-react-docgen@2.1.1-alpha.2 - gatsby-transformer-remark@2.1.1-alpha.2 - gatsby-transformer-screenshot@2.0.0-alpha.2 - gatsby-transformer-sharp@2.1.1-alpha.2 - gatsby-transformer-sqip@2.0.0-alpha.4 - gatsby-transformer-toml@2.1.1-alpha.2 - gatsby-transformer-xml@2.0.0-alpha.2 - gatsby-transformer-yaml@2.1.1-alpha.2 - gatsby@2.0.0-alpha.59 - graphql-skip-limit@2.0.0-alpha.10 * V2: replace navigateTo with push and replace (#5944) * gatsby-link: add push (deprecates navigateTo) and replace This addresses gatsbyjs/gatsby#5910 * Use push rather than (deprecated) navigateTo throughout * Document change * [v2] PR docs (#5933) * Document pull request policy during v2 betas * Update edit link * Update README.md * Add branch instructions to contributing guide * Prettify * [v2][www] "You're viewing the docs for Gatsby v2 beta" banner (#5915) * initial "You're viewing the docs for Gatsby v2 beta" banner * Small edit * Point to v1.gatsbyjs.org for the v1 docs * Change URL back to gatsbyjs.org * [v2] Merge master (#5948) * Update gatsby-starters.md (#5917) New Gatsby Starter Project: Gatsby eCommerce store using the Moltin eCommerce API * Adding Jersey Watch to list of Gatsby sites (#5923) * [www] Blog Adding "Why Narative loves Gatsby" post (#5883) * Adding why narative loves gatsby blog post * Fixing grammar and removing space from start of image filename * Made a few small copy changes + added a bit of emphasis on the money lines :-) Super nice post! * Fix markdown link syntax * Update yarn.lock + prettier * Publish - gatsby-image@1.0.54 - gatsby-plugin-catch-links@1.0.24 - gatsby-plugin-google-tagmanager@1.0.19 - gatsby-plugin-manifest@1.0.27 - gatsby-plugin-postcss-sass@1.0.22 - gatsby-plugin-sharp@1.6.48 - gatsby-plugin-stylus@1.1.21 - gatsby-plugin-typography@1.7.19 - gatsby-remark-autolink-headers@1.4.19 - gatsby-remark-code-repls@1.0.11 - gatsby-remark-copy-linked-files@1.5.37 - gatsby-remark-embed-snippet@2.0.2 - gatsby-remark-images-contentful@1.0.2 - gatsby-remark-images@1.5.67 - gatsby-remark-prismjs@2.0.4 - gatsby-remark-responsive-iframe@1.4.20 - gatsby-source-contentful@1.3.54 - gatsby-source-drupal@2.0.41 - gatsby-source-filesystem@1.5.39 - gatsby-source-lever@1.0.11 - gatsby-source-mongodb@1.5.21 - gatsby-source-wordpress@2.0.92 - gatsby-transformer-excel@1.0.9 - gatsby-transformer-json@1.0.20 - gatsby-transformer-remark@1.7.44 - gatsby-transformer-sharp@1.6.27 - gatsby-transformer-sqip@0.0.11 - gatsby-transformer-yaml@1.5.18 - gatsby@1.9.272 * Merge from master * Run prettier * Fix merge errors * Publish - gatsby-link@2.0.0-alpha.3 - gatsby-plugin-catch-links@2.0.2-alpha.3 - gatsby-plugin-page-creator@2.0.0-alpha.3 - gatsby-remark-images-contentful@2.0.0-alpha.3 - gatsby@2.0.0-alpha.60 * Fix lint errors * Specify next as gatsby-link version * Publish - gatsby@2.0.0-alpha.61 * Add robots.txt to disallow indexing next.gatsbyjs.org (#5952) * Publish - gatsby-link@2.0.0-alpha.4 - gatsby-plugin-catch-links@2.0.2-alpha.4 - gatsby-plugin-page-creator@2.0.0-alpha.4 - gatsby-remark-images-contentful@2.0.0-alpha.4 - gatsby@2.0.0-alpha.62 --- .babelrc | 5 + README.md | 26 ++--- package.json | 22 ++-- src/__tests__/create-file-node.js | 11 +- src/create-file-node.js | 19 ++-- src/create-remote-file-node.js | 21 +++- src/extend-file-node.js | 2 +- src/gatsby-node.js | 177 +++++++++++++++++++++++++----- 8 files changed, 214 insertions(+), 69 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000000000..b5d6b28d4b5ea --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + ["../../.babel-preset.js"] + ] +} diff --git a/README.md b/README.md index fd80880512d4f..87c1e74f15769 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ module.exports = { }, }, ], -}; +} ``` ## How to query @@ -92,10 +92,10 @@ createFilePath({ The following is taken from [Gatsby Tutorial, Part Seven](https://www.gatsbyjs.org/tutorial/part-seven/) and is used to create URL slugs for markdown pages. ```javascript -const { createFilePath } = require(`gatsby-source-filesystem`); +const { createFilePath } = require(`gatsby-source-filesystem`) exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { - const { createNodeField } = boundActionCreators; + const { createNodeField } = boundActionCreators // Ensures we are processing only markdown files if (node.internal.type === "MarkdownRemark") { // Use `createFilePath` to turn markdown files in our `data/faqs` directory into `/faqs/slug` @@ -103,16 +103,16 @@ exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { node, getNode, basePath: "data/faqs/", - }); + }) // Creates new query'able field with name of 'slug' createNodeField({ node, name: "slug", value: `/faqs${relativeFilePath}`, - }); + }) } -}; +} ``` ### createRemoteFileNode @@ -138,7 +138,7 @@ createRemoteFileNode({ // OPTIONAL // Adds htaccess authentication to the download request if passed in. auth: { htaccess_user: `USER`, htaccess_pass: `PASSWORD` }, -}); +}) ``` #### Example usage @@ -146,11 +146,11 @@ createRemoteFileNode({ The following example is pulled from [gatsby-source-wordpress](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress). Downloaded files are created as `File` nodes and then linked to the WordPress Media node, so it can be queried both as a regular `File` node and from the `localFile` field in the Media node. ```javascript -const { createRemoteFileNode } = require(`gatsby-source-filesystem`); +const { createRemoteFileNode } = require(`gatsby-source-filesystem`) exports.downloadMediaFiles = ({ nodes, store, cache, createNode, _auth }) => { nodes.map(async node => { - let fileNode; + let fileNode // Ensures we are only processing Media Files // `wordpress__wp_media` is the media file type name for Wordpress if (node.__type === `wordpress__wp_media`) { @@ -161,7 +161,7 @@ exports.downloadMediaFiles = ({ nodes, store, cache, createNode, _auth }) => { cache, createNode, auth: _auth, - }); + }) } catch (e) { // Ignore } @@ -170,10 +170,10 @@ exports.downloadMediaFiles = ({ nodes, store, cache, createNode, _auth }) => { // Adds a field `localFile` to the node // ___NODE appendix tells Gatsby that this field will link to another node if (fileNode) { - node.localFile___NODE = fileNode.id; + node.localFile___NODE = fileNode.id } - }); -}; + }) +} ``` The file node can then be queried using GraphQL. See an example of this in the [gatsby-source-wordpress README](/packages/gatsby-source-wordpress/#image-processing) where downloaded images are queried using [gatsby-transformer-sharp](/packages/gatsby-transformer-sharp/) to use in the component [gatsby-image](/packages/gatsby-image/). diff --git a/package.json b/package.json index aa88188c031a1..e972e79be45de 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,29 @@ { "name": "gatsby-source-filesystem", "description": "Gatsby plugin which parses files within a directory for further parsing by other plugins", - "version": "1.5.39", + "version": "2.0.1-alpha.2", "author": "Kyle Mathews ", "bugs": { "url": "https://github.com/gatsbyjs/gatsby/issues" }, "dependencies": { - "babel-cli": "^6.26.0", - "babel-runtime": "^6.26.0", + "@babel/runtime": "7.0.0-beta.51", "better-queue": "^3.8.7", "bluebird": "^3.5.0", "chokidar": "^1.7.0", - "fs-extra": "^4.0.1", + "fs-extra": "^5.0.0", "got": "^7.1.0", "md5-file": "^3.1.1", - "mime": "^1.3.6", + "mime": "^2.2.0", "pretty-bytes": "^4.0.2", "slash": "^1.0.0", - "valid-url": "^1.0.9" + "valid-url": "^1.0.9", + "xstate": "^3.1.0" }, "devDependencies": { - "cross-env": "^5.0.5" + "@babel/cli": "7.0.0-beta.51", + "@babel/core": "7.0.0-beta.51", + "cross-env": "^5.1.4" }, "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem#readme", "keywords": [ @@ -30,12 +32,12 @@ ], "license": "MIT", "peerDependencies": { - "gatsby": "^1.9.250" + "gatsby": ">2.0.0-alpha" }, "repository": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem", "scripts": { - "build": "babel src --out-dir . --ignore __tests__", + "build": "babel src --out-dir . --ignore **/__tests__", "prepublish": "cross-env NODE_ENV=production npm run build", - "watch": "babel -w src --out-dir . --ignore __tests__" + "watch": "babel -w src --out-dir . --ignore **/__tests__" } } diff --git a/src/__tests__/create-file-node.js b/src/__tests__/create-file-node.js index f933f812b77f5..3224b1ad833c4 100644 --- a/src/__tests__/create-file-node.js +++ b/src/__tests__/create-file-node.js @@ -5,6 +5,13 @@ const { createFileNode } = require(`../create-file-node`) // FIXME: This test needs to not use snapshots because of file differences // and locations across users and CI systems describe(`create-file-node`, () => { - it(`creates a file node`, () => - createFileNode(path.resolve(`${__dirname}/fixtures/file.json`), {})) + it(`creates a file node`, () => { + const createNodeId = jest.fn() + createNodeId.mockReturnValue(`uuid-from-gatsby`) + return createFileNode( + path.resolve(`${__dirname}/fixtures/file.json`), + createNodeId, + {} + ) + }) }) diff --git a/src/create-file-node.js b/src/create-file-node.js index 4a1689d011471..e64e86d53fa90 100644 --- a/src/create-file-node.js +++ b/src/create-file-node.js @@ -7,14 +7,11 @@ const prettyBytes = require(`pretty-bytes`) const md5File = require(`bluebird`).promisify(require(`md5-file`)) const crypto = require(`crypto`) -const createId = path => { - const slashed = slash(path) - return `${slashed} absPath of file` -} - -exports.createId = createId - -exports.createFileNode = async (pathToFile, pluginOptions = {}) => { +exports.createFileNode = async ( + pathToFile, + createNodeId, + pluginOptions = {} +) => { const slashed = slash(pathToFile) const parsedSlashed = path.parse(slashed) const slashedFile = { @@ -43,22 +40,22 @@ exports.createFileNode = async (pathToFile, pluginOptions = {}) => { } } else { const contentDigest = await md5File(slashedFile.absolutePath) + const mediaType = mime.getType(slashedFile.ext) internal = { contentDigest, - mediaType: mime.lookup(slashedFile.ext), type: `File`, + mediaType: mediaType ? mediaType : `application/octet-stream`, description: `File "${path.relative(process.cwd(), slashed)}"`, } } - // console.log('createFileNode:stat', slashedFile.absolutePath) // Stringify date objects. return JSON.parse( JSON.stringify({ // Don't actually make the File id the absolute path as otherwise // people will use the id for that and ids shouldn't be treated as // useful information. - id: createId(pathToFile), + id: createNodeId(pathToFile), children: [], parent: `___SOURCE___`, internal, diff --git a/src/create-remote-file-node.js b/src/create-remote-file-node.js index 1672372922ae1..3b65876b1acdc 100644 --- a/src/create-remote-file-node.js +++ b/src/create-remote-file-node.js @@ -166,7 +166,14 @@ const requestRemoteNode = (url, headers, tmpFilename, filename) => * @param {CreateRemoteFileNodePayload} options * @return {Promise} Resolves with the fileNode */ -async function processRemoteNode({ url, store, cache, createNode, auth = {} }) { +async function processRemoteNode({ + url, + store, + cache, + createNode, + auth = {}, + createNodeId, +}) { // Ensure our cache directory exists. const programDir = store.getState().program.directory await fs.ensureDir(path.join(programDir, CACHE_DIR, FS_PLUGIN_DIR)) @@ -213,7 +220,7 @@ async function processRemoteNode({ url, store, cache, createNode, auth = {} }) { } // Create the file node. - const fileNode = await createFileNode(filename, {}) + const fileNode = await createFileNode(filename, createNodeId, {}) fileNode.internal.description = `File "${url}"` // Override the default plugin as gatsby-source-filesystem needs to // be the owner of File nodes or there'll be conflicts if any other @@ -268,7 +275,14 @@ const pushTask = task => * @param {CreateRemoteFileNodePayload} options * @return {Promise} Returns the created node */ -module.exports = ({ url, store, cache, createNode, auth = {} }) => { +module.exports = ({ + url, + store, + cache, + createNode, + auth = {}, + createNodeId, +}) => { // Check if we already requested node for this remote file // and return stored promise if we did. if (processingCache[url]) { @@ -286,6 +300,7 @@ module.exports = ({ url, store, cache, createNode, auth = {} }) => { store, cache, createNode, + createNodeId, auth, })) } diff --git a/src/extend-file-node.js b/src/extend-file-node.js index 38d07c0dd3e98..52991f4d1616f 100644 --- a/src/extend-file-node.js +++ b/src/extend-file-node.js @@ -1,4 +1,4 @@ -const { GraphQLString } = require(`graphql`) +const { GraphQLString } = require(`gatsby/graphql`) const fs = require(`fs-extra`) const path = require(`path`) diff --git a/src/gatsby-node.js b/src/gatsby-node.js index ab9b76a078239..f6659093bee54 100644 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -1,19 +1,78 @@ const chokidar = require(`chokidar`) const fs = require(`fs`) - -const { createId, createFileNode } = require(`./create-file-node`) +const { Machine } = require(`xstate`) + +const { createFileNode } = require(`./create-file-node`) + +/** + * Create a state machine to manage Chokidar's not-ready/ready states and for + * emitting file system events into Gatsby. + * + * On the latter, this solves the problem where if you call createNode for the + * same File node in quick succession, this can leave Gatsby's internal state + * in disarray causing queries to fail. The latter state machine tracks when + * Gatsby is "processing" a node update or when it's "idle". If updates come in + * while Gatsby is processing, we queue them until the system returns to an + * "idle" state. + */ +const fsMachine = Machine({ + key: `emitFSEvents`, + parallel: true, + strict: true, + states: { + CHOKIDAR: { + initial: `CHOKIDAR_NOT_READY`, + states: { + CHOKIDAR_NOT_READY: { + on: { + CHOKIDAR_READY: `CHOKIDAR_WATCHING`, + BOOTSTRAP_FINISHED: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, + }, + }, + CHOKIDAR_WATCHING: { + on: { + BOOTSTRAP_FINISHED: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, + CHOKIDAR_READY: `CHOKIDAR_WATCHING`, + }, + }, + CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED: { + on: { + CHOKIDAR_READY: `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED`, + }, + }, + }, + }, + PROCESSING: { + initial: `BOOTSTRAPPING`, + states: { + BOOTSTRAPPING: { + on: { + BOOTSTRAP_FINISHED: `IDLE`, + }, + }, + IDLE: { + on: { + EMIT_FS_EVENT: `PROCESSING`, + }, + }, + PROCESSING: { + on: { + QUERY_QUEUE_DRAINED: `IDLE`, + TOUCH_NODE: `IDLE`, + }, + }, + }, + }, + }, +}) + +let currentState = fsMachine.initialState exports.sourceNodes = ( - { boundActionCreators, getNode, reporter }, + { actions, getNode, createNodeId, hasNodeChanged, reporter, emitter }, pluginOptions ) => { - if (!(pluginOptions && pluginOptions.path)) { - reporter.panic(` -"path" is a required option for gatsby-source-filesystem - -See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/ - `) - } + const { createNode, deleteNode } = actions // Validate that the path exists. if (!fs.existsSync(pluginOptions.path)) { @@ -23,12 +82,40 @@ The path passed to gatsby-source-filesystem does not exist on your file system: ${pluginOptions.path} Please pick a path to an existing directory. + +See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/ `) } + let fileNodeQueue = new Map() + + // Once bootstrap is finished, we only let one File node update go through + // the system at a time. + emitter.on(`BOOTSTRAP_FINISHED`, () => { + currentState = fsMachine.transition( + currentState.value, + `BOOTSTRAP_FINISHED` + ) + }) + emitter.on(`TOUCH_NODE`, () => { + // If we create a node which is the same as the previous version, createNode + // returns TOUCH_NODE and then nothing else happens so we listen to that + // to return the state back to IDLE. + currentState = fsMachine.transition(currentState.value, `TOUCH_NODE`) + }) - const { createNode, deleteNode } = boundActionCreators - - let ready = false + emitter.on(`QUERY_QUEUE_DRAINED`, () => { + currentState = fsMachine.transition( + currentState.value, + `QUERY_QUEUE_DRAINED` + ) + // If we have any updates queued, run one of them now. + if (fileNodeQueue.size > 0) { + const toProcess = fileNodeQueue.get(Array.from(fileNodeQueue.keys())[0]) + fileNodeQueue.delete(toProcess.id) + currentState = fsMachine.transition(currentState.value, `EMIT_FS_EVENT`) + createNode(toProcess) + } + }) const watcher = chokidar.watch(pluginOptions.path, { ignored: [ @@ -42,8 +129,21 @@ Please pick a path to an existing directory. ], }) - const createAndProcessNode = path => - createFileNode(path, pluginOptions).then(createNode) + const createAndProcessNode = path => { + const fileNodePromise = createFileNode( + path, + createNodeId, + pluginOptions + ).then(fileNode => { + if (currentState.value.PROCESSING === `PROCESSING`) { + fileNodeQueue.set(fileNode.id, fileNode) + } else { + currentState = fsMachine.transition(currentState.value, `EMIT_FS_EVENT`) + createNode(fileNode) + } + }) + return fileNodePromise + } // For every path that is reported before the 'ready' event, we throw them // into a queue and then flush the queue when 'ready' event arrives. @@ -56,8 +156,12 @@ Please pick a path to an existing directory. } watcher.on(`add`, path => { - if (ready) { - reporter.info(`added file at ${path}`) + if (currentState.value.CHOKIDAR !== `CHOKIDAR_NOT_READY`) { + if ( + currentState.value.CHOKIDAR === `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED` + ) { + reporter.info(`added file at ${path}`) + } createAndProcessNode(path).catch(err => reporter.error(err)) } else { pathQueue.push(path) @@ -65,23 +169,36 @@ Please pick a path to an existing directory. }) watcher.on(`change`, path => { - reporter.info(`changed file at ${path}`) + if ( + currentState.value.CHOKIDAR === `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED` + ) { + reporter.info(`changed file at ${path}`) + } createAndProcessNode(path).catch(err => reporter.error(err)) }) watcher.on(`unlink`, path => { - reporter.info(`file deleted at ${path}`) - const node = getNode(createId(path)) + if ( + currentState.value.CHOKIDAR === `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED` + ) { + reporter.info(`file deleted at ${path}`) + } + const node = getNode(createNodeId(path)) // It's possible the file node was never created as sometimes tools will // write and then immediately delete temporary files to the file system. if (node) { - deleteNode(node.id, node) + currentState = fsMachine.transition(currentState.value, `EMIT_FS_EVENT`) + deleteNode({ node }) } }) watcher.on(`addDir`, path => { - if (ready) { - reporter.info(`added directory at ${path}`) + if (currentState.value.CHOKIDAR !== `CHOKIDAR_NOT_READY`) { + if ( + currentState.value.CHOKIDAR === `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED` + ) { + reporter.info(`added directory at ${path}`) + } createAndProcessNode(path).catch(err => reporter.error(err)) } else { pathQueue.push(path) @@ -89,16 +206,18 @@ Please pick a path to an existing directory. }) watcher.on(`unlinkDir`, path => { - reporter.info(`directory deleted at ${path}`) - const node = getNode(createId(path)) - deleteNode(node.id, node) + if ( + currentState.value.CHOKIDAR === `CHOKIDAR_WATCHING_BOOTSTRAP_FINISHED` + ) { + reporter.info(`directory deleted at ${path}`) + } + const node = getNode(createNodeId(path)) + deleteNode({ node }) }) return new Promise((resolve, reject) => { watcher.on(`ready`, () => { - if (ready) return - - ready = true + currentState = fsMachine.transition(currentState.value, `CHOKIDAR_READY`) flushPathQueue().then(resolve, reject) }) })