JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

API and responsibilities #11

Closed Raynos closed 9 years ago

Raynos commented 9 years ago

I looked at this tool and the README and became pretty excited!

I ran shrinkpack -h and it immediately did rm -rf node_modules; rm npm-shrinkwrap.json; npm install. I was surprised and a bit sad as I forgot to git add .

I would like to propose that this program does not run .clean(). Deleting all of these files is going to generate a lot of churn and also take a lot of time.

Furthermore running .rebuild() is also not a good idea. The application developer should drive npm install and shrinkwrap itself. I have an npm-shrinkwrap module ( https://github.com/uber/npm-shrinkwrap ) that I use as a better shrinkwrap and I want to use this module as well.

I would like to propose that this program only does the .save() path.

I'd be willing to open a pull request (with tests!!) to implement this if the feature is welcome.

I would also implement a -h and --help output.

JamieMason commented 9 years ago

Please give me your thoughts on 0.3.0 @Raynos. Shrinkpack now only manages the contents of node_shrinkwrap based on the contents of the npm-shrinkwrap.json - and no longer creates it for you.

It should now also be much faster, as it only removes redundant packages and adds new ones - with the others being left as they were.

Ideas or changes welcome, thanks.