Skip to content

Commit 4b111f4

Browse files
committed
adjust update deps doc
1 parent f47e427 commit 4b111f4

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

docs/how-to-update-npm-packages.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
It’s important to update your packages to get new features, bug fixes, and
44
security patches.
55
[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.
139

1410
## See a list of packages that can be updated
1511

@@ -18,7 +14,7 @@ show you which packages can be updated and which major, minor, or patch versions
1814
are available.
1915

2016
```sh
21-
npx ncu
17+
npx npm-check-updates
2218
```
2319

2420
Notice the colors:
@@ -33,24 +29,23 @@ Since green patch version updates are meant for backward-compatible bug fixes,
3329
it's ok to update them all at once.
3430

3531
```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
3933
...
4034
npm i
4135
```
4236

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.
4741
4842
Assuming package maintainers follow semantic versioning, updating patch versions
4943
shouldn't break anything, but it's good practice to re-run your tests before
5044
committing these changes.
5145

5246
```sh
53-
npm run test
47+
npm run test -- run
48+
npm run test:e2e:run
5449
```
5550

5651
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.
7469
> package is for your project when choosing which to update first.
7570
7671
```sh
77-
npx ncu -u -filter <package-with-cyan-minor-update>
72+
npx npm-check-updates -u -filter <package-with-cyan-minor-update>
7873
npm i
7974
```
8075

@@ -83,7 +78,8 @@ versions shouldn't break anything, but it's good practice to re-run your tests
8378
to make sure.
8479

8580
```sh
86-
npm run test
81+
npm run test -- run
82+
npm run test:e2e:run
8783
```
8884

8985
If all tests pass, commit your changes.
@@ -104,19 +100,22 @@ accordingly.
104100
> for your project when choosing which to update first.
105101
106102
```sh
107-
npx ncu -u -f <package-with-red-version-update>
103+
npx npm-check-updates -u -f <package-with-red-version-update>
108104
npm i
109105
```
110106

111107
Make sure you've made all relevant changes and that the tests pass.
112108

113109
```sh
114-
npm run test
110+
npm run test -- run
111+
npm run test:e2e:run
115112
```
116113

117114
If all tests pass, commit your changes.
118115

119116
```sh
120117
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"
122119
```
120+
121+
Then continue for each package.

0 commit comments

Comments
 (0)