FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Implement package-lock update command for bump-version

Open arinwt opened this issue 6 years ago • 1 comments

When one project/mono-repo depends on another, currently we can bump the dependency the first time per release using bump-version. For example to bump all dependencies to the latest prerelease version of the Server project/mono-repo, the command is:

npm run bump-version -- -d server

If the server API is changed again within the same release, however, running this command again will not work, since we are already depending on version x.x.0-0. In a simple single package dependency case, running npm update could be used to refresh the package-lock to get a later semver matching package. With our lerna projects and monorepo structure, this is not an option.

Workaround

I've found a workaround is to manually find-replace all dependencies to the latest prerelease version (the one needed). And then run fluid-build --reinstall - which will update the lerna-package-lock.json to the latest version. Then I can revert the changes to the package.json files back to x.x.0-0 and commit the package-lock(s) only.

For example, I might do a regex find-replace limited to only package.json files under the packages/ and examples/ folders (i.e. only the ones found in the client project/monorepo). It might look like this, given server version x and latest build: b:

  • Search for: (@fluidframework/server-[a-z-]+": "\^0.x.0)-0"
  • Replace with $1-b"

Suggestion

It might be nice to have a command that can specifically update dependencies on packages or projects/mono-repos, similar to the effect of npm update but for an entire project/mono-repo.

As a side-note, lerna does not have any project-level npm update equivalent either. There are existing workaround solutions. https://github.com/lerna/lerna/issues/2142

arinwt avatar Sep 23 '20 23:09 arinwt

This issue has been automatically marked as stale because it has had no activity for 180 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!

ghost avatar Jun 08 '21 00:06 ghost