Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@
"private": true,
"scripts": {
"postinstall": "lerna bootstrap --hoist",
"build": "lerna exec build",
"build": "lerna run build",
"lint": "eslint --ext .js,.jsx --ignore-path .gitignore .",
"lint:flow": "babel-node scripts/flow-check.js",
"format-packages": "prettier --trailing-comma es5 --no-semi --write packages/**/src/*.js",
"format-gatsby": "prettier --trailing-comma es5 --no-semi --write packages/gatsby/lib/**/*.js",
"format-www": "find www -iname *.js | grep -v node_modules | grep -v public | grep -v .cache | xargs prettier --write --trailing-comma es5 --no-semi",
"format-examples": "find examples -iname *.js | grep -v node_modules | grep -v public | grep -v .cache | xargs prettier --write --trailing-comma es5 --no-semi",
"format": "npm run format-packages && npm run format-gatsby && npm run format-www && npm run format-examples",
"publish-canary": "lerna exec build; lerna publish --canary --yes",
"publish-next": "lerna exec build; lerna publish --npm-tag=next",
"publish-canary": "lerna run build; lerna publish --canary --yes",
"publish-next": "lerna run build; lerna publish --npm-tag=next",
"test": "jest",
"test_bkup": "npm run lint && npm run test-node && npm run test-integration",
"watch": "lerna exec watch --no-sort --stream --concurrency 999"
"watch": "lerna run watch --no-sort --stream --concurrency 999"
},
"devDependencies": {
"babel-preset-flow": "^6.23.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-typegen-remark-copy-linked-files/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ module.exports = ({ files, markdownNode, markdownAST, getNode }) => {
const newPath = path.join(
process.cwd(),
`public`,
`${linkNode.hash}.${linkNode.extension}`
`${linkNode.contentDigest}.${linkNode.extension}`
)
const relativePath = path.join(
`/${linkNode.hash}.${linkNode.extension}`
`/${linkNode.contentDigest}.${linkNode.extension}`
)
link.url = `${relativePath}`
if (!fsExtra.existsSync(newPath)) {
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby-typegen-remark/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ exports.extendNodeType = (
}

pluginsCacheStr = pluginOptions.plugins.map(p => p.name).join("")
console.log("pluginsCacheStr", pluginsCacheStr)

return new Promise((resolve, reject) => {
const files = allNodes.filter(n => n.type === `File`)
Expand Down
18 changes: 10 additions & 8 deletions packages/gatsby/lib/query-runner/page-query-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ checkpointsPromise({
// Find paths without data dependencies and run them (just in case?)
const paths = findPathsWithoutDataDependencies()
// Run these pages
paths.forEach(path => {
const page = state.pages.find(p => p.path === path)
const component = state.pageComponents[page.component]
queryRunner(page, component)
Promise.all(
paths.map(path => {
const page = state.pages.find(p => p.path === path)
const component = state.pageComponents[page.component]
return queryRunner(page, component)
})
).then(() => {
// Tell everyone who cares that we're done.
callbacks.forEach(cb => cb())
})

// Tell everyone who cares that we're done.
callbacks.forEach(cb => cb())
})
})

Expand Down Expand Up @@ -96,7 +98,7 @@ const findAndRunQueriesForDirtyPaths = actions => {
})

if (dirtyPaths.length > 0) {
console.log(`all pages invalidated by node change`, dirtyPaths)
console.log(`all pages invalidated by node change`, _.uniq(dirtyPaths))

// Run these pages
return Promise.all(
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/lib/redux/actions/add-page-dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.addPageDependency = ({ path, nodeId, connection }) => {
}
if (
connection &&
_.has(state, `pageDataDependencies.connections.${connection}`)
_.includes(state.pageDataDependencies.connections, connection)
) {
connectionDependencyExists = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,20 @@ describe(`add page data dependency`, () => {
connection: `Markdown.Remark`,
},
}
const action2 = {
type: `ADD_PAGE_DEPENDENCY`,
payload: {
path: `/hi2/`,
connection: `Markdown.Remark`,
},
}

expect(reducer(undefined, action)).toEqual({
let state = reducer(undefined, action)
state = reducer(state, action2)

expect(state).toEqual({
connections: {
"Markdown.Remark": ["/hi/"],
"Markdown.Remark": ["/hi/", "/hi2/"],
},
nodes: {},
})
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby/lib/schema/build-node-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ module.exports = async () =>
name: _.camelCase(`${typeName} field`),
type: nodeType.nodeObjectType,
resolve: (node, a, context, { fieldName }) => {
const fieldSelector = `${node.___path}.${fieldName}`
let fieldValue = node[fieldName]
const sourceFileNode = _.find(
getNodes(),
Expand Down
9 changes: 0 additions & 9 deletions packages/gatsby/lib/schema/infer-graphql-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ const inferObjectStructureFromNodes = (exports.inferObjectStructureFromNodes = (
})
})

// Add the "path" to each subnode as we'll need this later when resolving
// mapped fields to types in GraphQL land. We do that here (after creating
// field examples) so our special field is not added to the GraphQL type.
if (selector) {
nodes.forEach(node => {
_.set(node, `${selector}.___path`, `${type}.${selector}`)
})
}

// Remove fields common to the top-level of all nodes. We add these
// elsewhere so don't need to infer there type.
if (!selector) {
Expand Down