microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.81k stars 592 forks source link

[rush] Feature Request - rush `upgrade-interactive` #3388

Open TheLarkInn opened 2 years ago

TheLarkInn commented 2 years ago

Summary

Updating packages in large scale projects today involves having to fuss with package.json files, reference approved versions, and manually making entries and running rush update. This can be quite cumbersome, and this high barrier to management seems to create atrophy in staying up to date with dependencies across a monorepository.

We can lower this barrier to management by leveraging prior work from tools like yarn upgrade-interactive and npm-check to provide visual terminal prompts helping users manage their project dependencies.

npm-check has a UI like this: Example from npm-check repository

yarn upgrade-interactive looks like this: image

Design Outline

rush upgrade-interactive

TheLarkInn commented 2 years ago

I have not reviewed the API surface for @dylang 's npm-check but I very much like the UI and it would be great to reuse a lot of its capabilities instead of rewriting our own visualizer, picker, prompter, etc. I will research this.

iclanton commented 2 years ago

The would make a great plugin.

TheLarkInn commented 2 years ago

I've been able to generate a prompt for packages and updating, but I'd like some design discussion around how we go about updates.

Questions to discuss:

h-parker-higgins commented 2 years ago

I've been doing an analysis of rushstack from a developer experience perspective and this this is the missing feature we were looking for. An easy way to update outdated packages and address vulnerabilities across an entire monorepo. Would be great to see it treated as a first class citizen in rush. My vote would also be "I'm leaning towards all packages with an optional flag for one package" @TheLarkInn @iclanton

h-parker-higgins commented 2 years ago

Cross sharing here: there definitely sounds like there's some demand coming from the Renovate community: https://github.com/renovatebot/renovate/discussions/13818

TheLarkInn commented 2 years ago

@h-parker-higgins this sounds reasonable enough. Some repositories have hundreds of packages and thousands of dependencies, so scale has to also be taken into consideration. When I draft the design review for this I'll try to cover both scenarios.

TheLarkInn commented 1 year ago

Remaining Work:

yume-chan commented 1 year ago

Before rush upgrade-interactive --all is implemented, I found that if the monorepo is using pnpm workspace, I can run pnpm recursive upgrade --interactive --latest in common/temp folder, followed by rush update to upgrade dependencies of all packages.

It also alphabetically sorts dependency list in package.json, refs #2496

elliot-nelson commented 1 year ago

A minor usability nit: I watched someone relatively new to Rush run upgrade-interactive yesterday, and on an older Mac in our monorepo, it took ~15 seconds to load up the CLI interface (they started pressing random keys about 2 seconds in 😆).

Some kind of progress bar while it scrapes together package info would definitely help.

Faithfinder commented 1 year ago

I posted my feedback on Zulip before, but it was in a somewhat random thread, so, duplicating here, in no particular order: