From 7feff2434dab5a45ba1fe4f4bc72cf521ebd28c5 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 5 Sep 2024 17:47:27 +0000 Subject: [PATCH] doc: update documentation for externalizing deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/54646 - Add instructions to update how process.versions is reported as I missed that in a recent addition. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/54792 Reviewed-By: Richard Lau Reviewed-By: Yagiz Nizipli Reviewed-By: Akhil Marsonya Reviewed-By: Chengzhong Wu Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Rafael Gonzaga Reviewed-By: Ulises Gascón --- .../maintaining/maintaining-dependencies.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index d7e884514bfe16..8ebbd3f7bb8924 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -126,6 +126,17 @@ can be added by: paste one of the existing entries and then update to match the import name for the dependency and the #define generated. +* if the version of the dependency is reported in `process.versions`, + update `src/node_metadata.h` and `src/node_metadata.cc` so that the + version is not reported when the dependency is externalized. + Not reporting the version is better than incorrectly reporting + the version of the dependency bundled with Node.js, instead of the + version for the externalized dependency. Use one of the existing + externalized dependencies, like Undici, as an example of how to + update these files correctly. Make sure to run the tests with the + dependency externalized, as the tests will also need to be updated + to handle this properly. + ## Supporting non-externalized dependencies with JavaScript code If the dependency consists of JavaScript in the