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

Support src/install in the same project configuration #129

Open
whitfin opened this issue Jan 23, 2016 · 2 comments
Open

Support src/install in the same project configuration #129

whitfin opened this issue Jan 23, 2016 · 2 comments

Comments

@whitfin
Copy link

whitfin commented Jan 23, 2016

Disclaimer: I'm new to using clib so apologies if this has been visited in the past and I've missed it.

From what I understand, if you provide "install" in your package.json, your project isn't pulled as a dependency. I used to think that this makes sense, however I'm starting to think that having both should be an option. For example, there might be a library which provides some specific functionality, but the author also wishes to provide a command line wrapper so you can choose whether you want to integrate the lib into your projects, or just use the executable.

I don't think that's too far out there (in fact I hit this recently, which is why I'm here :)). The main issue is that you cannot have separate packages from the same repo (unless I'm missing something). You could always make a new repo to bind the command line tool using the library version as a dependency but it seems... wasteful?

So; how about something like having --src and --binary as flags for install, meaning:

  • if you install a package with only src, and you specify --binary, error
  • if you install a package with only binary, and you specify --src, error
  • if you install a package with only src, specifying no flags, current behaviour
  • if you install a package with only binary, specifying no flags, current behaviour
  • if you install a package with both, specifying no flags, inform user to select one or the other
  • if you install a package with both, and you specify --binary, you get the "install" path
  • if you install a package with both, and you specify --src, you get it as a dependency in ./deps
  • if you install a package with both, and you specify --binary and --src, then you get both

This would allow distribution of a library alongside an example executable without having to have two packages set up.

Thoughts? Again, sorry if I'm bringing up something already decided... it just feels that there's something missing for this use case.

@whitfin
Copy link
Author

whitfin commented Jan 23, 2016

@stephenmathieson FWIW I'll gladly contribute any needed code for this, I just want to make sure that it wouldn't be wasted time before doing so ;)

@stephenmathieson
Copy link
Member

Sure thing, this makes sense to me! If you've got time to add support, please do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants