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

Don't install node modules locally #401

Closed
DarkDust opened this issue Nov 6, 2018 · 3 comments
Closed

Don't install node modules locally #401

DarkDust opened this issue Nov 6, 2018 · 3 comments
Labels
build-issue Issues occurring when attempting to build codegen Issues related to or arising from code generation
Milestone

Comments

@DarkDust
Copy link

DarkDust commented Nov 6, 2018

Currently, the check-and-run-apollo-cli.sh script automatically installs the missing Apollo node module and its dependencies locally if they're missing. I would prefer the script would not do that but instead exit with a helpful error message.

I was thinking about generating a pull request to patch the script to optionally exit instead of installing automatically but wasn't able to come up with a good solution for that and would like to discuss options here first.

So far I came up with three ideas:

  1. Make the script support an environment variable that controls whether to exit or install.
    • Easy to do, easy to integrate into the Run Script phase, but still feels odd and like users are easy to miss this.
  2. Make the script support a command line argument to control whether to exit or install.
    • Harder to do, would need to filter out that argument before passing to apollo codegen:generate. It might create a lot of confusion.
  3. Create a new script that behaves differently.
    • Would need to refactor the existing script so both can share most of the code; not very hard. The difference in behavior would be very obvious.

So far I think a new script might be a good idea. Thoughts?

@designatednerd designatednerd added build-issue Issues occurring when attempting to build codegen Issues related to or arising from code generation labels Jul 15, 2019
@designatednerd
Copy link
Contributor

This definitely seems like something that'd require an updated build script. I am looking at making some significant changes around this because we want to handle things like not regenerating if it's not required, but I don't have an ETA. I'll definitely keep this in mind as I make those changes though.

@designatednerd
Copy link
Contributor

Note mostly to self: Need to look at whether to switch back to only requiring a major version of node rather than pinning to an exact one.

@designatednerd
Copy link
Contributor

This should now be greatly improved with 0.16.0, which basically removes any need to use NPM.

Please check out our updated installation instructions for setting up a build script for full details. Thank you!

@designatednerd designatednerd added this to the 0.16.0 milestone Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-issue Issues occurring when attempting to build codegen Issues related to or arising from code generation
Projects
None yet
Development

No branches or pull requests

2 participants