3
3
It’s important to update your packages to get new features, bug fixes, and
4
4
security patches.
5
5
[ NPM Check Updates] ( https://www.npmjs.com/package/npm-check-updates ) is a CLI
6
- that will help you safely make those updates.
7
-
8
- ## Install npm-check-updates
9
-
10
- ``` sh
11
- npm i -D npm-check-updates
12
- ```
6
+ that will help you safely make those updates. You can watch
7
+ [ this youtube video] ( https://www.youtube.com/watch?v=0XQXGx3lLaU ) for a
8
+ demonstration of how to do this.
13
9
14
10
## See a list of packages that can be updated
15
11
@@ -18,7 +14,7 @@ show you which packages can be updated and which major, minor, or patch versions
18
14
are available.
19
15
20
16
``` sh
21
- npx ncu
17
+ npx npm-check-updates
22
18
```
23
19
24
20
Notice the colors:
@@ -33,24 +29,23 @@ Since green patch version updates are meant for backward-compatible bug fixes,
33
29
it's ok to update them all at once.
34
30
35
31
``` sh
36
- npx ncu -u -filter < package-with-green-patch-update>
37
- npx ncu -u -filter < package-with-green-patch-update>
38
- npx ncu -u -filter < package-with-green-patch-update>
32
+ npx npm-check-updates -u --target patch
39
33
...
40
34
npm i
41
35
```
42
36
43
- > Note: ` npx ncu -u -t patch ` updates all patch versions, including major
44
- > version zero patch versions, which can break your code. If all your patch
45
- > updates are green, feel free to use this command instead to update them all at
46
- > once.
37
+ > Note: ` npx npm-check-updates -u -t patch ` updates all patch versions,
38
+ > including major version zero patch versions, which can break your code. If all
39
+ > your patch updates are green, feel free to use this command instead to update
40
+ > them all at once.
47
41
48
42
Assuming package maintainers follow semantic versioning, updating patch versions
49
43
shouldn't break anything, but it's good practice to re-run your tests before
50
44
committing these changes.
51
45
52
46
``` sh
53
- npm run test
47
+ npm run test -- run
48
+ npm run test:e2e:run
54
49
```
55
50
56
51
If all tests pass, commit your changes.
@@ -74,7 +69,7 @@ To check for the new package's features, check its release notes on GitHub.
74
69
> package is for your project when choosing which to update first.
75
70
76
71
``` sh
77
- npx ncu -u -filter < package-with-cyan-minor-update>
72
+ npx npm-check-updates -u -filter < package-with-cyan-minor-update>
78
73
npm i
79
74
```
80
75
@@ -83,7 +78,8 @@ versions shouldn't break anything, but it's good practice to re-run your tests
83
78
to make sure.
84
79
85
80
``` sh
86
- npm run test
81
+ npm run test -- run
82
+ npm run test:e2e:run
87
83
```
88
84
89
85
If all tests pass, commit your changes.
@@ -104,19 +100,22 @@ accordingly.
104
100
> for your project when choosing which to update first.
105
101
106
102
``` sh
107
- npx ncu -u -f < package-with-red-version-update>
103
+ npx npm-check-updates -u -f < package-with-red-version-update>
108
104
npm i
109
105
```
110
106
111
107
Make sure you've made all relevant changes and that the tests pass.
112
108
113
109
``` sh
114
- npm run test
110
+ npm run test -- run
111
+ npm run test:e2e:run
115
112
```
116
113
117
114
If all tests pass, commit your changes.
118
115
119
116
``` sh
120
117
git add .
121
- git commit -m " Updated <package-with-red-version-update> patch/minot/ major version"
118
+ git commit -m " Updated <package-with-red-version-update> major version"
122
119
```
120
+
121
+ Then continue for each package.
0 commit comments