Do not add dependencies of dependencies to package.json file
zanona opened this issue · comments
I have manually set package.json
file with all dependencies my project uses.
However, when a dependency of a first-level dependency is required, volo will automatically add those to the bottom of the dependencies
property of volo
in package.json
file.
This sometimes, may cause confusion to developers and project maintainers since they won't know which dependencies are vital for the project to work in case of a first-level dependency has been upgraded at some point and no longer requires another library. (i.e: jquery)
A common use case:
December 2013
volo add user/my-widget # depends on jquery
package.json file after process finishes
{
"volo": {
"dependencies": {
"my-widget": "user/repo/v0.0.2",
"jquery": "jquery/jquery/v1.10.0"
}
}
}
December 2014
volo add user/my-widget -f # no longer depends on jquery
package.json file after process finishes
{
"volo": {
"dependencies": {
"my-widget": "user/repo/v1.0.4",
"jquery": "jquery/jquery/v1.10.0" // No longer needed but still being required
}
}
}
Considering this, jquery
persists on package.json
file and it is a difficult to know whether it is still required for the project to function and it also downloads those dependencies without being required anymore.
Since dependency check is performed by the time each repository is downloaded, perhaps it is not necessary to add those dependencies to the package.json
file.
I believe that currently, bower and npm currently also work as suggested.
I just found out about the option -nostamp
which does exactly what I wanted ;)
I am just not sure why volo add -nostamp
is not the default?