Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add undici and acorn to process.versions #45621

Merged
merged 31 commits into from Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
317bfe5
src: add undici and acorn to process.versions
debadree25 Nov 25, 2022
db5993d
tools: update script to use a more portable version of sed
debadree25 Nov 25, 2022
196effe
tools: updated script to remove git commit
debadree25 Nov 25, 2022
7a6cfc7
test: added test for undici version
debadree25 Nov 25, 2022
8c9efc0
src,tools: move the version definitions to a seprate file for undici
debadree25 Nov 25, 2022
7af8793
src,tools: added version information for acorn
debadree25 Nov 25, 2022
dbf55e2
test: added tests for acorn version
debadree25 Nov 25, 2022
f444e8a
src: use proper version for undici
debadree25 Nov 25, 2022
bb7c816
src: src/undici_version.h update file endline
debadree25 Nov 26, 2022
d15264c
src: src/node_metadata.cc update file endline
debadree25 Nov 26, 2022
75480f0
src: added header gaurds to version information header files
debadree25 Nov 26, 2022
109d752
src: fixed linting issues in metadata files
debadree25 Nov 26, 2022
3e3669e
tools: fixed linting issues in js test file
debadree25 Nov 26, 2022
e275998
src: added files are automated comments
debadree25 Dec 2, 2022
95f4921
tools: add comments when rewriting the file
debadree25 Dec 2, 2022
8645541
nit: fix comment
debadree25 Dec 4, 2022
8433bdd
nit: fix comment
debadree25 Dec 4, 2022
1455a91
nit: update comments
debadree25 Dec 4, 2022
122d080
src: bump up undici version
debadree25 Dec 4, 2022
8d11336
fix linting issues
debadree25 Dec 12, 2022
b17c6b4
lint: update test-process-versions.js
debadree25 Dec 12, 2022
6e17865
lint: test/parallel/test-process-versions.js
debadree25 Dec 12, 2022
3cf68e7
lint: src/node_metadata.h
debadree25 Dec 12, 2022
298b01f
test: make list alphabetical
debadree25 Dec 12, 2022
6ce7f89
test: add acorn to test version match
debadree25 Dec 12, 2022
08d8398
bump up undici version
debadree25 Dec 13, 2022
5a77a9d
src: remove undici version if externalised
debadree25 Dec 15, 2022
b1041a3
fix lint
debadree25 Dec 15, 2022
fd75497
test: check if shared undici exists
debadree25 Dec 15, 2022
06a76e4
lint fix again
debadree25 Dec 15, 2022
c2e2d39
test: small refactor
debadree25 Dec 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/acorn_version.h
@@ -0,0 +1,6 @@
// This is an auto generated file, please do not edit.
// Refer to tools/update-acorn.sh
#ifndef SRC_ACORN_VERSION_H_
debadree25 marked this conversation as resolved.
Show resolved Hide resolved
#define SRC_ACORN_VERSION_H_
#define ACORN_VERSION "8.8.1"
#endif // SRC_ACORN_VERSION_H_
4 changes: 4 additions & 0 deletions src/node_metadata.cc
@@ -1,9 +1,11 @@
#include "node_metadata.h"
#include "acorn_version.h"
#include "ares.h"
#include "brotli/encode.h"
#include "llhttp.h"
#include "nghttp2/nghttp2ver.h"
#include "node.h"
#include "undici_version.h"
#include "util.h"
#include "uv.h"
#include "uvwasi.h"
Expand Down Expand Up @@ -90,6 +92,8 @@ Metadata::Versions::Versions() {
std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) +
"." +
std::to_string(BrotliEncoderVersion() & 0xFFF);
undici = UNDICI_VERSION;
acorn = ACORN_VERSION;

uvwasi = UVWASI_VERSION_STRING;

Expand Down
4 changes: 3 additions & 1 deletion src/node_metadata.h
Expand Up @@ -38,7 +38,9 @@ namespace node {
V(nghttp2) \
V(napi) \
V(llhttp) \
V(uvwasi)
V(uvwasi) \
V(acorn) \
V(undici)
RaisinTen marked this conversation as resolved.
Show resolved Hide resolved

#if HAVE_OPENSSL
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
Expand Down
6 changes: 6 additions & 0 deletions src/undici_version.h
@@ -0,0 +1,6 @@
// This is an auto generated file, please do not edit.
// Refer to tools/update-undici.sh
#ifndef SRC_UNDICI_VERSION_H_
#define SRC_UNDICI_VERSION_H_
#define UNDICI_VERSION "5.13.0"
#endif // SRC_UNDICI_VERSION_H_
14 changes: 14 additions & 0 deletions test/parallel/test-process-versions.js
Expand Up @@ -2,6 +2,10 @@
const common = require('../common');
const assert = require('assert');

// Import of pure js deps for comparison
const undici = require('../../deps/undici/src/package.json');
const acorn = require('../../deps/acorn/acorn/package.json');

const expected_keys = [
'ares',
'brotli',
Expand All @@ -14,6 +18,8 @@ const expected_keys = [
'napi',
'llhttp',
'uvwasi',
'undici',
RaisinTen marked this conversation as resolved.
Show resolved Hide resolved
'acorn',
];

if (common.hasCrypto) {
Expand All @@ -39,10 +45,12 @@ assert.deepStrictEqual(actual_keys, expected_keys);

const commonTemplate = /^\d+\.\d+\.\d+(?:-.*)?$/;

assert.match(process.versions.acorn, commonTemplate);
assert.match(process.versions.ares, commonTemplate);
assert.match(process.versions.brotli, commonTemplate);
assert.match(process.versions.llhttp, commonTemplate);
assert.match(process.versions.node, commonTemplate);
assert.match(process.versions.undici, commonTemplate);
assert.match(process.versions.uv, commonTemplate);
assert.match(process.versions.zlib, commonTemplate);

Expand Down Expand Up @@ -70,3 +78,9 @@ for (let i = 0; i < expected_keys.length; i++) {

assert.strictEqual(process.config.variables.napi_build_version,
process.versions.napi);

const expectedUndiciVersion = undici.version;
assert.strictEqual(process.versions.undici, expectedUndiciVersion);
debadree25 marked this conversation as resolved.
Show resolved Hide resolved

const expectedAcornVersion = acorn.version;
assert.strictEqual(process.versions.acorn, expectedAcornVersion);
11 changes: 11 additions & 0 deletions tools/update-acorn.sh
Expand Up @@ -23,6 +23,17 @@ rm -rf deps/acorn/acorn
"$NODE" "$NPM" init --yes

"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts acorn
cd node_modules/acorn
# get acorn version
ACORN_VERSION=$("$NODE" -p "require('./package.json').version")
# update this version information in src/acorn_version.h
FILE_PATH="$ROOT/src/acorn_version.h"
echo "// This is an auto generated file, please do not edit." > "$FILE_PATH"
echo "// Refer to tools/update-acorn.sh" >> "$FILE_PATH"
echo "#ifndef SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
echo "#define SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
echo "#define ACORN_VERSION \"$ACORN_VERSION\"" >> "$FILE_PATH"
echo "#endif // SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
)

mv acorn-tmp/node_modules/acorn deps/acorn
Expand Down
10 changes: 10 additions & 0 deletions tools/update-undici.sh
Expand Up @@ -26,6 +26,16 @@ rm -f deps/undici/undici.js
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts undici
cd node_modules/undici
"$NODE" "$NPM" run build:node
# get the new version of undici
UNDICI_VERSION=$("$NODE" -p "require('./package.json').version")
# update this version information in src/undici_version.h
FILE_PATH="$ROOT/src/undici_version.h"
echo "// This is an auto generated file, please do not edit." > "$FILE_PATH"
echo "// Refer to tools/update-undici.sh" >> "$FILE_PATH"
echo "#ifndef SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
echo "#define SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
echo "#define UNDICI_VERSION \"$UNDICI_VERSION\"" >> "$FILE_PATH"
echo "#endif // SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
)

mv undici-tmp/node_modules/undici deps/undici/src
Expand Down