Skip to content

Commit 317bfe5

Browse files
committedDec 12, 2022
src: add undici and acorn to process.versions
Attempted to update undici version when the update scripts are run Fixes: nodejs#45260 Refs: nodejs#45599
1 parent 2483da7 commit 317bfe5

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
 

‎src/node_metadata.cc

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include <unicode/uversion.h>
3030
#endif // NODE_HAVE_I18N_SUPPORT
3131

32+
// version definitions of pure js deps
33+
#define UNDICI_VERSION "5.12.0"
34+
3235
namespace node {
3336

3437
namespace per_process {
@@ -90,6 +93,7 @@ Metadata::Versions::Versions() {
9093
std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) +
9194
"." +
9295
std::to_string(BrotliEncoderVersion() & 0xFFF);
96+
undici = UNDICI_VERSION;
9397

9498
uvwasi = UVWASI_VERSION_STRING;
9599

‎src/node_metadata.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ namespace node {
3838
V(nghttp2) \
3939
V(napi) \
4040
V(llhttp) \
41-
V(uvwasi)
41+
V(uvwasi) \
42+
V(undici)
4243

4344
#if HAVE_OPENSSL
4445
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
@@ -57,8 +58,8 @@ namespace node {
5758
#endif // NODE_HAVE_I18N_SUPPORT
5859

5960
#ifdef OPENSSL_INFO_QUIC
60-
#define NODE_VERSIONS_KEY_QUIC(V) \
61-
V(ngtcp2) \
61+
#define NODE_VERSIONS_KEY_QUIC(V) \
62+
V(ngtcp2) \
6263
V(nghttp3)
6364
#else
6465
#define NODE_VERSIONS_KEY_QUIC(V)

‎tools/update-undici.sh

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ rm -f deps/undici/undici.js
2626
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts undici
2727
cd node_modules/undici
2828
"$NODE" "$NPM" run build:node
29+
# get the new version of undici
30+
UNDICI_VERSION=$("$NODE" -p "require('./package.json').version")
31+
# update this version information in src/node_metadata.cc
32+
sed -i '' "s/UNDICI_VERSION \"[0-9.]*\"/UNDICI_VERSION \"$UNDICI_VERSION\"/" "$ROOT/src/node_metadata.cc"
33+
# commit these changes
34+
git add "$ROOT/src/node_metadata.cc"
35+
git commit -m "src: update undici version to $UNDICI_VERSION"
2936
)
3037

3138
mv undici-tmp/node_modules/undici deps/undici/src

0 commit comments

Comments
 (0)
Please sign in to comment.