From de1e9a778ae3124275e17421783bb8f4834799b4 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 5 Sep 2024 17:47:27 +0000 Subject: [PATCH 1/3] doc: update documentation for externalizing deps 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 --- .../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..f26e4f1bd4e63f 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 depenency. Use one of the existing + externalized dependencies like undici as an example of how to + do that. Make sure to run the tests with the dependency externalized + as the tests will also need to be updated to handle this properly. + For example, test/parallel/test-process-versions.js. + ## Supporting non-externalized dependencies with JavaScript code If the dependency consists of JavaScript in the From be0a84464c17ad0af491fbb1bbf069837b2f701b Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 5 Sep 2024 14:07:51 -0400 Subject: [PATCH 2/3] Update doc/contributing/maintaining/maintaining-dependencies.md Co-authored-by: Aviv Keller --- .../maintaining/maintaining-dependencies.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index f26e4f1bd4e63f..5d2bb8d05f09ce 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -126,16 +126,16 @@ 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 +* 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 depenency. Use one of the existing - externalized dependencies like undici as an example of how to - do that. Make sure to run the tests with the dependency externalized - as the tests will also need to be updated to handle this properly. - For example, test/parallel/test-process-versions.js. + 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 From 0fcf106a47aac85ffc9628b7ab22d63599e5c681 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 9 Sep 2024 11:11:18 -0400 Subject: [PATCH 3/3] Update doc/contributing/maintaining/maintaining-dependencies.md Co-authored-by: Antoine du Hamel --- doc/contributing/maintaining/maintaining-dependencies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contributing/maintaining/maintaining-dependencies.md b/doc/contributing/maintaining/maintaining-dependencies.md index 5d2bb8d05f09ce..8ebbd3f7bb8924 100644 --- a/doc/contributing/maintaining/maintaining-dependencies.md +++ b/doc/contributing/maintaining/maintaining-dependencies.md @@ -132,7 +132,7 @@ can be added by: 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 + 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.