ChristopherBiscardi / gatsby-theme-examples

Examples of using gatsby themes
141 stars 11 forks source link

Shadow component logging #24

Closed loremipson closed 5 years ago

loremipson commented 5 years ago

When shadowing components, it can easily become pretty confusing to know where in this folder structure the shadowing is actually happening, especially when it is several levels deep. It would be nice if Gatsby, when themes are used, could show when/where it happens.

Perhaps just showing something in the terminal logs, could visually display the shadowing chain? Not really sure the best way to go about this, but thinking of something like this:

ComponentX originated in gatsby-theme-core
ComponentX was shadowed by gatsby-theme-blog-a
ComponentX was shadowed by gastby-theme-blog-b
ChristopherBiscardi commented 5 years ago

We're planning some CLI tooling for this, including ejection support and displaying shadowed paths. Have not begun work on it yet though.

ChristopherBiscardi commented 5 years ago

in the meantime, there are debug logs that will display checked paths for components. DEBUG=gatsby* gatsby develop will show them.

loremipson commented 5 years ago

Thanks, I don't have debug in mine, but can certainly add it in until something more integrated is supported.

ChristopherBiscardi commented 5 years ago

debug comes with gatsby, so you should be able to use it from the cli as I showed above without doing custom implementation work.