Skip to content

Commit

Permalink
Handle scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed Aug 31, 2019
1 parent 270a02a commit b8bec09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/gatsby/src/schema/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ const addTypes = ({ schemaComposer, types, parentSpan }) => {
})
}

const GATSBY_THEME = /^(?:@\w+\/)?gatsby-theme-/

const mergeTypes = ({
schemaComposer,
typeComposer,
Expand All @@ -306,8 +308,7 @@ const mergeTypes = ({
!plugin ||
plugin.name === typeOwner ||
plugin.name === `default-site-plugin` ||
(plugin.name.startsWith(`gatsby-theme-`) &&
!typeOwner.startsWith(`gatsby-theme-`))
(plugin.name.match(GATSBY_THEME) && !typeOwner.match(GATSBY_THEME))
) {
typeComposer.merge(type)
if (isNamedTypeComposer(type)) {
Expand Down

0 comments on commit b8bec09

Please sign in to comment.