Skip to content

Commit 2a4f4f8

Browse files
committed
doc: add guide to maintaining npm
This is based on the guide found on their wiki refs: https://github.com/npm/npm/wiki/CLI-Team-Process#submitting-the-new-latest-x-to-nodejs PR-URL: #16541 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 3807c68 commit 2a4f4f8

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

doc/guides/maintaining-npm.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Maintaining npm in Node.js
2+
3+
## Step 1: Clone npm
4+
5+
```console
6+
$ git clone https://github.com/npm/npm.git
7+
$ cd npm
8+
```
9+
10+
or if you already have npm cloned make sure the repo is up to date
11+
12+
```console
13+
$ git remote update -p
14+
$ git reset --hard origin latest
15+
```
16+
17+
## Step 2: Build release
18+
19+
```console
20+
$ git checkout vX.Y.Z
21+
$ make release
22+
```
23+
24+
Note: please run `npm dist-tag ls npm` and make sure this is the `latest` **dist-tag**. `latest` on git is usually released as `next` when it's time to downstream
25+
26+
## Step 3: Remove old npm
27+
28+
```console
29+
$ cd /path/to/node
30+
$ git remote update -p
31+
$ git checkout -b npm-x.y.z origin/master
32+
$ cd deps
33+
$ rm -rf npm
34+
```
35+
36+
## Step 4: Extract and commit new npm
37+
38+
```console
39+
$ tar zxf /path/to/npm/release/npm-x.y.z.tgz
40+
$ git add -A npm
41+
$ git commit -m "deps: upgrade npm to x.y.z"
42+
$ cd ..
43+
```
44+
45+
## Step 5: Update licenses
46+
47+
```console
48+
$ ./configure
49+
$ make -j4
50+
$ ./tools/license-builder.sh
51+
# The following commands are only necessary if there are changes
52+
$ git add .
53+
$ git commit -m "doc: update npm LICENSE using license-builder.sh"
54+
```
55+
56+
Note: please ensure you are only making the updates that are changed by npm.
57+
58+
## Step 6: Apply Whitespace fix
59+
60+
```console
61+
$ git rebase --whitespace=fix master
62+
```
63+
64+
## Step 7: Test the build
65+
66+
```console
67+
$ make test-npm
68+
```

0 commit comments

Comments
 (0)