|
| 1 | +# Dependency update scripts |
| 2 | + |
| 3 | +This folder contains scripts used to automatically update a Node.js dependency. |
| 4 | +These scripts are usually run by CI (see `.github/workflows/tools.yml`) in order |
| 5 | +to download a new dependency version, and replace the old version with it. |
| 6 | + |
| 7 | +Since these scripts only update to the upstream code, changes might be needed in |
| 8 | +this repository in order to successfully update (e.g: changing API calls to |
| 9 | +conform to upstream changes, updating GYP build files, etc.) |
| 10 | + |
| 11 | +## libuv |
| 12 | + |
| 13 | +The `update-libuv.sh` script takes the target version to update as its only |
| 14 | +argument, downloads it from the [GitHub repo](https://github.com/libuv/libuv) |
| 15 | +and uses it to replace the contents of `deps/uv/`. The contents are replaced |
| 16 | +entirely except for the `*.gyp` and `*.gypi` build files, which are part of the |
| 17 | +Node.js build definitions and are not present in the upstream repo. |
| 18 | + |
| 19 | +For example, in order to update to version `1.44.2`, the following command can |
| 20 | +be run: |
| 21 | + |
| 22 | +```bash |
| 23 | +./tools/dep_updaters/update-libuv.sh 1.44.2 |
| 24 | +``` |
| 25 | + |
| 26 | +Once the script has run (either manually, or by CI in which case a PR will have |
| 27 | +been created with the changes), do the following: |
| 28 | + |
| 29 | +1. Check the [changelog](https://github.com/libuv/libuv/blob/v1.x/ChangeLog) for |
| 30 | + things that might require changes in Node.js. |
| 31 | +2. If necessary, update `common.gypi` and `uv.gyp` with build-related changes. |
| 32 | +3. Check that Node.js compiles without errors and the tests pass. |
| 33 | +4. Create a commit for the update and in the commit message include the |
| 34 | + important/relevant items from the changelog (see [`c61870c`][] for an |
| 35 | + example). |
| 36 | + |
| 37 | +[`c61870c`]: https://github.com/nodejs/node/commit/c61870c376e2f5b0dbaa939972c46745e21cdbdd |
0 commit comments