Skip to content
New issue

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

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

Already on GitHub? # to your account

Fail in cleaner fashion if user runs gatsby develop in a non-gatsby directory #379

Closed
KyleAMathews opened this issue Aug 4, 2016 · 7 comments
Labels
help wanted Issue with a clear description that the community can help with.

Comments

@KyleAMathews
Copy link
Contributor

Right now it complains about their not being a local gatsby install and throws out a bunch of cryptic errors and then quits. I was helping a friend setup Gatsby and they got stuck for a bit as they hadn't entered the new gatsby directory after running gatsby new.

It's now been ~6 months since we added support for Gatsby being a local install. I think at the next minor version we should enforce this and not run gatsby develop/build unless gatsby can find itself (haha) in node_modules.

@KyleAMathews KyleAMathews added help wanted Issue with a clear description that the community can help with. Hacktoberfest labels Oct 12, 2016
@nason
Copy link
Contributor

nason commented Nov 19, 2016

Hi @KyleAMathews, I'm going to take this one too if that's alright with you.

I'm thinking adding a check towards the top of lib/bin/cli.js, before I get too far I could use a little input on what the signal(s) for being in a valid gatsby directory should be. For example:

  • Do you still want to support a globally installed gatsby package or is a local install required?
  • Should anything besides is gatsby in node_modules be considered?

@KyleAMathews
Copy link
Contributor Author

Hey great! Yeah disable global install working at all. An html.js is
required and I think config.toml might be required (though it should be
optional). There's a few other required files e.g. _template.js and an
index.* in the pages directory.
On Sat, Nov 19, 2016 at 11:52 AM Mike Nason notifications@github.com
wrote:

Hi @KyleAMathews https://github.com/KyleAMathews, I'm going to take
this one too if that's alright with you.

I'm thinking adding a check towards the top of lib/bin/cli.js, before I
get too far I could use a little input on what the signal(s) for being in a
valid gatsby directory should be. For example:

  • Do you still want to support a globally installed gatsby package or
    is a local install required?
  • Should anything besides is gatsby in node_modules be considered?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#379 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVh0jBTyoLn6GGt_E0A2IUMD-mq6q-ks5q_1NpgaJpZM4JdK4j
.

@vinnymac
Copy link
Contributor

vinnymac commented Nov 29, 2016

@nason @KyleAMathews I was actually creating this exact ticket when I discovered that one already existed. May I recommend that we use this to provide some good UX around telling the user what files gatsby needs in order to be used properly. We should make sure it works well across various gatsby commands. Thoughts?

It seems the config.toml file is also a required file, but that is changing in 1.0 afaik.

@KyleAMathews
Copy link
Contributor Author

@vinnymac that function looks perfect! CRA does it again 😀 they're our UX design agency basically.

@nason what's the status on your PR for this?

We can reuse the same pattern in 1.0 but with a different list of required files.

@nason
Copy link
Contributor

nason commented Nov 29, 2016

@vinnymac thanks! CRA is great inspiration. it was super simple to drop-in that module and replace the one I had started on.

@KyleAMathews sorry last week got a bit busy for me! I opened PR #583, let's chat about it there

@jbolda
Copy link
Contributor

jbolda commented Jun 5, 2017

The related PRs have been closed already. Closing this.

@jbolda jbolda closed this as completed Jun 5, 2017
@whmountains
Copy link

If this is done can we move it to the "done" section on the roadmap?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
help wanted Issue with a clear description that the community can help with.
Projects
None yet
Development

No branches or pull requests

5 participants