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

[1.0] Question: have you looked at alternatives to gatsby-dev-cli? #1198

Closed
rstacruz opened this issue Jun 17, 2017 · 4 comments
Closed

[1.0] Question: have you looked at alternatives to gatsby-dev-cli? #1198

rstacruz opened this issue Jun 17, 2017 · 4 comments

Comments

@rstacruz
Copy link
Contributor

Hey, totally off-topic, but...

I'd love to use lerna to manage monorepos. gatsby-dev-cli is great, but only works for Gatsby. As I understand it, its reason for living is to be a glorified npm-link that works for multiple packages.

Have you tried looking for a more general-purpose tool?

@KyleAMathews
Copy link
Contributor

This is (I'm pretty sure) my dream setup yarnpkg/yarn#3294

Also might replace Lerna in time.

I would have loved to use a more general purpose tool but nothing else existed and gatsby-dev-cli was the easiest kludge I could think of until workspaces is ready. npm link flat out doesn't work for Gatsby (several reasons...) so we really needed something like gatsby-dev-cli and making it specific for Gatsby was the cheapest way to do it.

@rstacruz
Copy link
Contributor Author

Thanks for the reply!

Why is npm link not working for gatsby? I imagine it would be simple:

# export your working copies of the packages
cd ~/gatsby-1.0
for f in packages/*; do (cd $f && npm link); done

# link it in new project
cd ~/my-project
npm link gatsby gatsby-link gatsby-plugin-google-analytics gatsby-plugin-manifest ...
# or
(for f in node_modules/gatsby*; do echo $(basename $f); done) | xargs npm link

May have to disable hoisting in lerna though.

@KyleAMathews
Copy link
Contributor

The main thing that tripped me up is npm link means dependencies don't get deduped necessarily which can be fine but in our case graphql really dislikes because it expects global singletons and compares objects against each other so if both code paths A & B load separate GraphQL, GraphQL will then throw errors when doing internal validation.

@rstacruz
Copy link
Contributor Author

ouch, i see.

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

2 participants