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 NPM modules from my apps dependencies #50

Closed
danielcompton opened this issue Jan 28, 2017 · 2 comments
Closed

Don't install NPM modules from my apps dependencies #50

danielcompton opened this issue Jan 28, 2017 · 2 comments

Comments

@danielcompton
Copy link
Contributor

danielcompton commented Jan 28, 2017

Currently lein-npm looks inside all of the JARs on the classpath to find any project.clj's with lein-npm dependencies specified. I'm not 100% sure of the use case for this, but I guess it's so that library writers can ensure that their dependencies are downloaded. This behaviour is a little bit counterintuitive for people (see: http://stackoverflow.com/questions/41910529/lein-npm-downloads-dependencies-of-dependencies-re-frame-template), and I've had the same thing happen to me in the past. This is hinted at in

I am not convinced that pulling node dependencies of maven dependencies is the right thing to do. I'd like to get a better understanding of why this is done.

I'm not really sure what the right answer here is:

  • Leave it as is
  • Don't install devDependencies from my dependencies project.clj
  • Add the ability for people to specify (via metadata, or a new key) that an NPM dependency is really required to be downloaded as part of the project, and assume the rest aren't needed.

My feeling is that lein-npm would mostly be used for tooling/processing purposes, but that it is unlikely that consumers of a project that uses lein-npm would need the node modules to be downloaded themselves.

@RyanMcG
Copy link
Owner

RyanMcG commented Jan 30, 2017

Hey @danielcompton, thanks for commenting.

Honestly, I don't use this library much anymore. If you think not resolving deps makes sense, let's at least provide the option. I'd say per-dep metadata to indicate that npm deps are necessary is the way to go.

A PR would be very welcome.

@danielcompton
Copy link
Contributor Author

I think devDependencies is the right place for this. I'm pretty sure the current behaviour is correct. I'll try and provide a docs PR to make this option clearer for people and let them know about the implications of both.

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