Expected Behavior
DevDependencies can be shared amongst the root package and sub-packages. For example, it's nice to be able to run tests in a specific package and at the root directory. This mean all packages (including root) share the same test runner.
Lerna is able to hoist shared dependencies to the top (which is nice).
However, when updating shared dependencies offer no help to bump version in all packages. Of course I can use lerna exec -- npm update whatever, but NPM will actually install the new version in each packages which can take forever.
Possible Solution
A command like lerna update could run over every package.json and match the version with the root.
Alternatively, in order to not rely in the root package, lerna update [email protected] could be used to define the required version.
Steps to Reproduce (for bugs)
- Have a lot of sub-packages with outdated dependencies
- Be using
lerna bootstrap --hoist
- Wish to update all sub-packages
Context
All my sub-packages and root share AVA, nyc and esm. It means I can run npm test in the root to test everything (in CI for example) or in any sub-directory (while adding a new feature for example).
Updating these dependencies can turn into a nightmare. Running lerna exec -- npm update ava nyc esm take way too long and moreover actually install the package when I just want to update the package.json.
Copy-pasting the version to all package.json and running lerna bootstrap --hoist is viable, but as the number of sub-packages grows it becomes more and more tedious.
Your Environment
| Executable |
Version |
lerna --version |
3.15.0 |
npm --version |
6.7.0 |
node --version |
11.13.0 |
| OS |
Version |
| Windows 10 |
1803 |
Expected Behavior
DevDependencies can be shared amongst the root package and sub-packages. For example, it's nice to be able to run tests in a specific package and at the root directory. This mean all packages (including root) share the same test runner.
Lerna is able to hoist shared dependencies to the top (which is nice).
However, when updating shared dependencies offer no help to bump version in all packages. Of course I can use
lerna exec -- npm update whatever, but NPM will actually install the new version in each packages which can take forever.Possible Solution
A command like
lerna updatecould run over everypackage.jsonand match the version with the root.Alternatively, in order to not rely in the root package,
lerna update [email protected]could be used to define the required version.Steps to Reproduce (for bugs)
lerna bootstrap --hoistContext
All my sub-packages and root share
AVA,nycandesm. It means I can runnpm testin the root to test everything (in CI for example) or in any sub-directory (while adding a new feature for example).Updating these dependencies can turn into a nightmare. Running
lerna exec -- npm update ava nyc esmtake way too long and moreover actually install the package when I just want to update thepackage.json.Copy-pasting the version to all
package.jsonand runninglerna bootstrap --hoistis viable, but as the number of sub-packages grows it becomes more and more tedious.Your Environment
lerna --versionnpm --versionnode --version