README
rush-upgrade-self-plugin
Rush plugin for upgrade Rush.js itself in monorepo.
Prerequisite
Rush.js >= 5.57.0
Usage
rush upgrade-self
How it works
- Fetch
microsoft/rushversions bypacote - After choose a version, decides the info of dependencies should be updated.(Prefixes with
@microsoft/or@rushstack/) - Scan all
package.jsonfiles under monorepo - Update dependencies(including devDependencies) in these
package.jsonfiles - Update autoinstallers accordingly.
- Prompt to run
rush update
How to use
- Create an autoinstaller
NOTE: you can also reuse a existing autoinstaller. If so, skip this step.
rush init-autoinstaller --name command-plugins
- Install this plugin into autoinstaller
cd common/autoinstallers/command-plugins
pnpm install rush-upgrade-self-plugin
rush update-autoinstaller --name command-plugins
- Update
common/config/rush/rush-plugins.json
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugins.schema.json",
"plugins": [
{
"packageName": "rush-upgrade-self-plugin",
"pluginName": "rush-upgrade-self-plugin",
"autoinstallerName": "command-plugins" // the name of autoinstaller you created before
}
]
}
- Run
rush update
After rush update, rush-plugin-manifest.json and command-line.json will be synced. They should be committed into git.
All done! Run rush upgrade-self and it should works!
Something went wrong?
First, you can always use git checkout . to revert all changes by this plugin.
Second, this plugin is designed to be idempotent. just run it again!
Finally no goal, you can file a issue
LICENSE
MIT @chengcyber