Skip to content

Commit

Permalink
fix(gatsby-dev-cli): Include theme src directories
Browse files Browse the repository at this point in the history
Themes aren't built/compiled like most packages in
the gatsby monorepo so we shouldn't ignore their
src directories.
  • Loading branch information
johno committed Mar 10, 2020
1 parent f356cc9 commit cd95a62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/gatsby-dev-cli/src/__tests__/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ const monoRepoPackages = [
`gatsby-source-shopify`,
`gatsby-source-wikipedia`,
`gatsby-source-wordpress`,
`gatsby-theme-blog`,
`gatsby-theme-blog-core`,
`gatsby-theme-notes`,
`gatsby-telemetry`,
`gatsby-transformer-asciidoc`,
`gatsby-transformer-csv`,
Expand Down Expand Up @@ -312,7 +315,7 @@ jest.mock(`../utils/promisified-spawn`, () => {
}
})

describe(`dependency changs`, () => {
describe(`dependency changes`, () => {
const { publishPackage } = require(`../local-npm-registry/publish-package`)
const { installPackages } = require(`../local-npm-registry/install-packages`)
const { checkDepsChanges } = require(`../utils/check-deps-changes`)
Expand Down
8 changes: 7 additions & 1 deletion packages/gatsby-dev-cli/src/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ async function watch(
return
}

const allPackagesIgnoringThemesToWatch = allPackagesToWatch.filter(
pkgName => !pkgName.startsWith(`gatsby-theme`)
)

const ignored = [
/[/\\]node_modules[/\\]/i,
/\.git/i,
Expand All @@ -159,7 +163,9 @@ async function watch(
/[/\\]__mocks__[/\\]/i,
/\.npmrc/i,
].concat(
allPackagesToWatch.map(p => new RegExp(`${p}[\\/\\\\]src[\\/\\\\]`, `i`))
allPackagesIgnoringThemesToWatch.map(
p => new RegExp(`${p}[\\/\\\\]src[\\/\\\\]`, `i`)
)
)
const watchers = _.uniq(
allPackagesToWatch
Expand Down

0 comments on commit cd95a62

Please sign in to comment.