Last active
November 24, 2021 22:15
-
-
Save jahed/f0d583897bcc301d9fdc97f1ea5b9b33 to your computer and use it in GitHub Desktop.
Upgrade NPM Dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
echo "SETTING UP" | |
npm ci | |
npm install npm-check-updates | |
npm upgrade npm-check-updates | |
echo | |
echo "UPGRADING MINOR VERSIONS" | |
npx ncu --deep --format repo --target minor --upgrade | |
npm install | |
git add package-lock.json '*package.json' | |
if ! git diff --quiet --cached --exit-code; then | |
git commit -m 'build(deps): upgrade minor versions' | |
fi | |
echo | |
echo "UPGRADING TRANSITIVES" | |
npm upgrade | |
npm install # workaround for consistency | |
git add package-lock.json '*package.json' | |
if ! git diff --quiet --cached --exit-code; then | |
git commit -m 'build(deps): upgrade transitive dependencies' | |
fi | |
echo | |
echo "CHECKING MAJOR VERSIONS" | |
npx ncu --deep --format repo --target latest | |
echo | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment