Skip to content

Commit 8dab4c3

Browse files
authoredMar 10, 2020
fix(gatsby-dev-cli): Include theme src directories (#22147)
Themes aren't built/compiled like most packages in the gatsby monorepo so we shouldn't ignore their src directories.
1 parent 7022721 commit 8dab4c3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
 

‎packages/gatsby-dev-cli/src/__tests__/watch.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ const monoRepoPackages = [
262262
`gatsby-source-shopify`,
263263
`gatsby-source-wikipedia`,
264264
`gatsby-source-wordpress`,
265+
`gatsby-theme-blog`,
266+
`gatsby-theme-blog-core`,
267+
`gatsby-theme-notes`,
265268
`gatsby-telemetry`,
266269
`gatsby-transformer-asciidoc`,
267270
`gatsby-transformer-csv`,
@@ -312,7 +315,7 @@ jest.mock(`../utils/promisified-spawn`, () => {
312315
}
313316
})
314317

315-
describe(`dependency changs`, () => {
318+
describe(`dependency changes`, () => {
316319
const { publishPackage } = require(`../local-npm-registry/publish-package`)
317320
const { installPackages } = require(`../local-npm-registry/install-packages`)
318321
const { checkDepsChanges } = require(`../utils/check-deps-changes`)

‎packages/gatsby-dev-cli/src/watch.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ async function watch(
151151
return
152152
}
153153

154+
const allPackagesIgnoringThemesToWatch = allPackagesToWatch.filter(
155+
pkgName => !pkgName.startsWith(`gatsby-theme`)
156+
)
157+
154158
const ignored = [
155159
/[/\\]node_modules[/\\]/i,
156160
/\.git/i,
@@ -159,7 +163,9 @@ async function watch(
159163
/[/\\]__mocks__[/\\]/i,
160164
/\.npmrc/i,
161165
].concat(
162-
allPackagesToWatch.map(p => new RegExp(`${p}[\\/\\\\]src[\\/\\\\]`, `i`))
166+
allPackagesIgnoringThemesToWatch.map(
167+
p => new RegExp(`${p}[\\/\\\\]src[\\/\\\\]`, `i`)
168+
)
163169
)
164170
const watchers = _.uniq(
165171
allPackagesToWatch

0 commit comments

Comments
 (0)
Please sign in to comment.