update-them-all is a convenient command-line tool and npm package designed to help you easily update all your npm dependencies, including Angular CLI and Angular Core, in your project. The package automatically stages and commits changes for each updated package or group of packages, providing a clean commit history and making it simple to track updates.
- Automatically updates Angular CLI and Angular Core in your project.
- Updates all dependencies and devDependencies listed in your package.json file.
- Attempts to update multiple packages simultaneously when possible, falling back to updating one at a time if necessary.
- Stages and commits changes using Git after each successful package update, including a relevant commit message.
- Runs npm audit fix at the end of the update process to address any potential security vulnerabilities.
To use update-them-all as a command-line tool, simply run the following command in your project directory:
npm install update-them-all --save-dev
npx update-them-all
Alternatively, you can install the package globally and run the command:
npm install -g update-them-all
update-them-all
The application provides an option for custom configuration settings to better suit your project requirements. You can achieve this by creating a configuration file in the root directory of your project.
- Create a new file named
update-config.json
at the root directory of your project. - In this file, add your custom settings. Here is an example of the content you can include:
{
"keepAngularMajorVersion": true,
"removeVersioningSymbols": false,
"ignoreDependencies": [],
"ignoreDevDependencies": [],
"autoCommitDuringUpdate": false
}
-
keepAngularMajorVersion: When set to
true
, the application will maintain the major version of Angular in your project. It will still update minor and patch versions. By default, this is set totrue
. -
removeVersioningSymbols: If this is set to
true
, the application will remove any symbols (like^
and~
) that indicate a version range in yourpackage.json
file. This means that npm will install the exact version specified, rather than the latest version that matches the specified range. The default value isfalse
. -
ignoreDependencies: This is an array that you can use to list specific dependencies that you don't want the application to update. By default, this array is empty, meaning the application will attempt to update all dependencies.
-
ignoreDevDependencies: This is an array that you can use to list specific devDependencies that you don't want the application to update. By default, this array is empty, meaning the application will attempt to update all devDependencies.
Create a new branch like "update date[xy]" and then run the script
npx update-them-all
The branch must be clean
The first step is an update of Angular
ng update @angular/cli @angular/core
Then try to update all dependancys and DevDependancys as oneliner with
ng update [x] [y] [z] [...]
If the step does not work, then ng update is performed per dependency.
The last step is
npm audit fix
between each step a git Commit is done, because "ng update" needs a clean branch. With update-them-all, you can keep your npm dependencies up-to-date in a streamlined, organized, and efficient manner.