arei / npmbox

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.
MIT License
245 stars 34 forks source link

Add git support. Fixes #44 #53

Closed letalumil closed 8 years ago

letalumil commented 8 years ago

Hey @arei, thanks for the great package and I hope this PR will make it even cooler. I needed to create npmboxes from git repositories, the same problem that was described in #44.

I took some inspiration from the npm install.js implementation, where npm-package-arg is used to determine what type of package is being installed, and npm.commands.cache.add is used to clone a package from a git repository.

As you can see from the code, I added 2 more steps between init and rack:

I also moved nested dependencies gathering into the lookupPackageDependencies function in order to reuse it for git and usual packages.

These changes solved my pain, but let me know if I can do anything it order to make it better.

arei commented 8 years ago

Merged but not published yet. Doing a 3.0 release with a handful fixes.

arei commented 8 years ago

If I did not convey this before... Super excited for this change. Thank you so, so much for the pr. Gold star for you! :star2:

letalumil commented 8 years ago

My pleasure. Thanks for accepting the PR!