Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with gatsby-transformer-yaml and gatsby-transformer-json #19

Open
GabeMedrash opened this issue Sep 18, 2018 · 1 comment

Comments

@GabeMedrash
Copy link
Contributor

Thanks for this great plugin!

As I was attempting to transform the output of this plugin with gatsby-transformer-yaml, however, that transformer threw the following error: TypeError: Path must be a string. Received undefined. Fundamentally, it's because gatsby-transformer-yaml (as well as gatsby-transformer-json), attempt to set the type of the node it processes by reading the basename of a node.dir property. For reference, that happens here in the case of gatsby-transformer-json and here in the case of gatsby-transformer-yaml.

Instead of attempting to change the interface of a core transformer package, I figure the more appropriate compatibility change should happen here. I've created a PR that fixes this issue for your review. In that PR, I changed the name of the relativeDir key to dir, as they would otherwise be redundant (and therefore, this would be a breaking change). If you would rather this not be a breaking change, I'm happy to add dir in as an additional property and keep relativeDir.

Thanks in advance for considering the change!

@GabeMedrash
Copy link
Contributor Author

After some further thought on this, what would you think about going a step further and matching the interface of nodes created by gatsby-source-filesystem? Some of those properties might not be feasible give the Octokat API, but I'd be happy to update my PR to try to match as many of the properties on GithubFiles as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant