Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0] During bootstrap, detect if plugins have changed and delete the cache #927

Merged
merged 8 commits into from
May 6, 2017
Prev Previous commit
Next Next commit
Fix format for www and examples
  • Loading branch information
KyleAMathews committed May 6, 2017
commit c0b34d430117e19c15375313daa66184ef63f100
10 changes: 5 additions & 5 deletions examples/gatsbygram/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const _ = require("lodash")
const Promise = require("bluebird")
const path = require("path")
const slug = require("slug")
const slash = require("slash")
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const slug = require(`slug`)
const slash = require(`slash`)

// Implement the Gatsby API “createPages”. This is
// called after the Gatsby bootstrap is finished so you have
Expand Down
8 changes: 4 additions & 4 deletions examples/hn/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _ = require("lodash")
const Promise = require("bluebird")
const path = require("path")
const slash = require("slash")
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const slash = require(`slash`)

// Implement the Gatsby API “createPages”. This is
// called after the Gatsby bootstrap is finished so you have
Expand Down
8 changes: 4 additions & 4 deletions examples/using-drupal/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _ = require("lodash")
const Promise = require("bluebird")
const path = require("path")
const slash = require("slash")
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const slash = require(`slash`)

// Implement the Gatsby API “createPages”. This is
// called after the Gatsby bootstrap is finished so you have
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"lint:flow": "babel-node scripts/flow-check.js",
"format-packages": "prettier-eslint --write \"packages/**/src/*.js\"",
"format-gatsby": "prettier-eslint --write \"packages/gatsby/lib/**/*.js\"",
"format-www": "prettier-eslint --write \"www/src/**/*.js\"",
"format-examples": "prettier-eslint --write \"examples/**/src/**/*.js\"",
"format-www": "prettier-eslint --write \"www/*.js\" \"www/src/**/*.js\"",
"format-examples": "prettier-eslint --write \"examples/**/gatsby-node.js\" \"examples/**/src/**/*.js\"",
"format-scripts": "prettier-eslint --write \"scripts/**/*.js\"",
"format": "npm run format-packages && npm run format-gatsby && npm run format-www && npm run format-examples && npm run format-scripts",
"publish-canary": "lerna run build; lerna publish --canary --yes",
Expand Down
12 changes: 6 additions & 6 deletions www/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ module.exports = {
{
resolve: `gatsby-plugin-manifest`,
options: {
name: "GatsbyJS",
short_name: "GatsbyJS",
start_url: "/",
background_color: "#f7f0eb",
theme_color: "#a2466c",
display: "minimal-ui",
name: `GatsbyJS`,
short_name: `GatsbyJS`,
start_url: `/`,
background_color: `#f7f0eb`,
theme_color: `#a2466c`,
display: `minimal-ui`,
},
},
`gatsby-plugin-offline`,
Expand Down
19 changes: 11 additions & 8 deletions www/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const _ = require("lodash")
const Promise = require("bluebird")
const path = require("path")
const parseFilepath = require("parse-filepath")
const fs = require("fs-extra")
const slash = require("slash")
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const parseFilepath = require(`parse-filepath`)
const fs = require(`fs-extra`)
const slash = require(`slash`)

exports.createPages = ({ graphql, boundActionCreators }) => {
const { upsertPage } = boundActionCreators
return new Promise((resolve, reject) => {
const docsTemplate = path.resolve(`src/templates/template-docs-markdown.js`)
const blogPostTemplate = path.resolve(`src/templates/template-blog-post.js`)
const packageTemplate = path.resolve(`src/templates/template-docs-packages.js`)
const packageTemplate = path.resolve(
`src/templates/template-docs-packages.js`
)
// Query for markdown nodes to use in creating pages.
graphql(
`
{
Expand All @@ -30,7 +33,7 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
}

// Create docs pages.
_.each(result.data.allMarkdownRemark.edges, edge => {
result.data.allMarkdownRemark.edges.forEach(edge => {
if (_.includes(edge.node.slug, `/blog/`)) {
upsertPage({
path: `${edge.node.slug}`, // required
Expand Down
4 changes: 1 addition & 3 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"bluebird": "^3.4.6",
"fs-extra": "^2.0.0",
"gatsby": "canary",
"gatsby-link": "canary",
"gatsby-transformer-remark": "canary",
Expand Down Expand Up @@ -36,8 +35,7 @@
"typeface-tex-gyre-schola": "^0.0.10",
"typography": "0.15.x",
"typography-breakpoint-constants": "^0.14.0",
"typography-plugin-code": "0.15.x",
"unist-util-select": "^1.5.0"
"typography-plugin-code": "0.15.x"
},
"devDependencies": {
"gh-pages": "^0.11.0"
Expand Down