rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] Manage multiple autoinstallers more easily

Open elliot-nelson opened this issue 3 years ago • 10 comments

Summary

A small pile of quality-of-life improvements for dealing with autoinstallers:

  • rush update-autoinstaller --name folder1 --name folder2
  • rush update-autoinstaller --all
  • rush update --autoinstallers
  • rush install --autoinstallers
  • All autoinstaller human-readable output now refers to lockfiles instead of shrinkwrap files.
  • Other minor output improvements and bug fixes.

Fixes #3743.

Details

Updating multiple autoinstallers

Following in the vein of rush add, you can now provide the --name parameter multiple times when updating an autoinstaller. Useful for specifically targeting 2 or more autoinstaller folders.

The output of the update-autoinstaller command has been updated to provide a summary of the autoinstallers that were updated and what new lockfiles should be committed to source control.

rush update-autoinstaller --name rush-plugins --name rush-prettier

Updating all autoinstallers

When your monorepo reaches 4-5 autoinstallers, it becomes easier to simply "mass update" them and evaluate the result of the command (ensuring it matches your expectations) rather than typing out specific folder names.

rush update-autoinstaller --all

Convenience method: update + autoinstaller update

After a maintenance update frenzy, with multiple package.json changes spread across project and autoinstaller folders alike, a single command to make sure everything is updated is a nice time saver.

rush update --autoinstallers

# Roughly equivalent to:
rush update && rush update-autoinstaller --all

New functionality: prepare all autoinstallers

A sibling command for rush update --autoinstallers, rush install --autoinstallers is unique in that it provides a feature that doesn't exist in Rush today: a way to prepare all of your autoinstallers for use (without waiting until someone actually calls a related rush global command defined in command-line.json).

This is very useful for situations where processes outside of Rush's control expect autoinstallers to be up-to-date. A great example is the common common/autoinstallers/rush-prettier autoinstaller, which might also be used by VSCode, WebStorm, etc. If you've upgraded prettier or added new prettier plugins to your autoinstaller, rush install --autoinstallers can immediately fix "Missing plugin" errors for your VSCode developers.

How it was tested

  • Tested installs and updates, with and without autoinstallers, in the rushstack repo (and local monorepo)
  • Tested update-autoinstaller with all and with multiple names in local monorepo (and rushstack repo)

Example screenshots

"rush update --autoinstallers": Screen Shot 2022-11-28 at 5 26 46 PM

elliot-nelson avatar Nov 28 '22 22:11 elliot-nelson