11cb0ef41Sopenharmony_ci# Dependency update scripts 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciThis folder contains scripts used to automatically update a Node.js dependency. 41cb0ef41Sopenharmony_ciThese scripts are usually run by CI (see `.github/workflows/tools.yml`) in order 51cb0ef41Sopenharmony_cito download a new dependency version, and replace the old version with it. 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciSince these scripts only update to the upstream code, changes might be needed in 81cb0ef41Sopenharmony_cithis repository in order to successfully update (e.g: changing API calls to 91cb0ef41Sopenharmony_ciconform to upstream changes, updating GYP build files, etc.) 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci## libuv 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ciThe `update-libuv.sh` script takes the target version to update as its only 141cb0ef41Sopenharmony_ciargument, downloads it from the [GitHub repo](https://github.com/libuv/libuv) 151cb0ef41Sopenharmony_ciand uses it to replace the contents of `deps/uv/`. The contents are replaced 161cb0ef41Sopenharmony_cientirely except for the `*.gyp` and `*.gypi` build files, which are part of the 171cb0ef41Sopenharmony_ciNode.js build definitions and are not present in the upstream repo. 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciFor example, in order to update to version `1.44.2`, the following command can 201cb0ef41Sopenharmony_cibe run: 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci```bash 231cb0ef41Sopenharmony_ci./tools/dep_updaters/update-libuv.sh 1.44.2 241cb0ef41Sopenharmony_ci``` 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ciOnce the script has run (either manually, or by CI in which case a PR will have 271cb0ef41Sopenharmony_cibeen created with the changes), do the following: 281cb0ef41Sopenharmony_ci 291cb0ef41Sopenharmony_ci1. Check the [changelog](https://github.com/libuv/libuv/blob/v1.x/ChangeLog) for 301cb0ef41Sopenharmony_ci things that might require changes in Node.js. 311cb0ef41Sopenharmony_ci2. If necessary, update `common.gypi` and `uv.gyp` with build-related changes. 321cb0ef41Sopenharmony_ci3. Check that Node.js compiles without errors and the tests pass. 331cb0ef41Sopenharmony_ci4. Create a commit for the update and in the commit message include the 341cb0ef41Sopenharmony_ci important/relevant items from the changelog (see [`c61870c`][] for an 351cb0ef41Sopenharmony_ci example). 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci[`c61870c`]: https://github.com/nodejs/node/commit/c61870c376e2f5b0dbaa939972c46745e21cdbdd 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci## simdutf 401cb0ef41Sopenharmony_ci 411cb0ef41Sopenharmony_ciThe `update-simdutf.sh` script takes the target version to update as its only 421cb0ef41Sopenharmony_ciargument, downloads it from the [GitHub repo](https://github.com/simdutf/simdutf) 431cb0ef41Sopenharmony_ciand uses it to replace the contents of `deps/simdutf/`. The contents are replaced 441cb0ef41Sopenharmony_cientirely except for the `*.gyp` and `*.gypi` build files, which are part of the 451cb0ef41Sopenharmony_ciNode.js build definitions and are not present in the upstream repo. 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ciFor example, in order to update to version `2.0.7`, the following command can 481cb0ef41Sopenharmony_cibe run: 491cb0ef41Sopenharmony_ci 501cb0ef41Sopenharmony_ci```bash 511cb0ef41Sopenharmony_ci./tools/dep_updaters/update-simdutf.sh 2.0.7 521cb0ef41Sopenharmony_ci``` 531cb0ef41Sopenharmony_ci 541cb0ef41Sopenharmony_ciOnce the script has run (either manually, or by CI in which case a PR will have 551cb0ef41Sopenharmony_cibeen created with the changes), do the following: 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ci1. Check the [changelog](https://github.com/simdutf/simdutf/releases/tag/v2.0.7) for 581cb0ef41Sopenharmony_ci things that might require changes in Node.js. 591cb0ef41Sopenharmony_ci2. If necessary, update `simdutf.gyp` with build-related changes. 601cb0ef41Sopenharmony_ci3. Check that Node.js compiles without errors and the tests pass. 611cb0ef41Sopenharmony_ci4. Create a commit for the update and in the commit message include the 621cb0ef41Sopenharmony_ci important/relevant items from the changelog. 631cb0ef41Sopenharmony_ci 641cb0ef41Sopenharmony_ci## postject 651cb0ef41Sopenharmony_ci 661cb0ef41Sopenharmony_ciThe `update-postject.sh` script downloads postject from the [npm package](http://npmjs.com/package/postject) 671cb0ef41Sopenharmony_ciand uses it to replace the contents of `test/fixtures/postject-copy`. 681cb0ef41Sopenharmony_ci 691cb0ef41Sopenharmony_ciIn order to update, the following command can be run: 701cb0ef41Sopenharmony_ci 711cb0ef41Sopenharmony_ci```bash 721cb0ef41Sopenharmony_ci./tools/dep_updaters/update-postject.sh 731cb0ef41Sopenharmony_ci``` 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ciOnce the script has run (either manually, or by CI in which case a PR will have 761cb0ef41Sopenharmony_cibeen created with the changes), do the following: 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ci1. Check the [changelog](https://github.com/nodejs/postject/releases/tag/v1.0.0-alpha.4) 791cb0ef41Sopenharmony_ci for things that might require changes in Node.js. 801cb0ef41Sopenharmony_ci2. Check that Node.js compiles without errors and the tests pass. 811cb0ef41Sopenharmony_ci3. Create a commit for the update and in the commit message include the 821cb0ef41Sopenharmony_ci important/relevant items from the changelog. 83