Skip to content

Commit 3b1d99c

Browse files
committed
src: add cjs_module_lexer_version base64_version
src: add cjs_module_lexer_version base64_version src: add cjs_module_lexer_version base64_version src: add cjs_module_lexer_version base64_version
1 parent c6c3eea commit 3b1d99c

7 files changed

+38
-1
lines changed

src/base64_version.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define BASE64_VERSION "0.5.0" // NOLINT(build/header_guard)

src/cjs_module_lexer_version.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define CJS_MODULE_LEXER_VERSION "1.2.2" // NOLINT(build/header_guard)

src/node_metadata.cc

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "node_metadata.h"
22
#include "ares.h"
3+
#include "base64_version.h"
34
#include "brotli/encode.h"
5+
#include "cjs_module_lexer_version.h"
46
#include "llhttp.h"
57
#include "nghttp2/nghttp2ver.h"
68
#include "node.h"
@@ -90,6 +92,8 @@ Metadata::Versions::Versions() {
9092
std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) +
9193
"." +
9294
std::to_string(BrotliEncoderVersion() & 0xFFF);
95+
cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
96+
base64 = BASE64_VERSION;
9397

9498
uvwasi = UVWASI_VERSION_STRING;
9599

src/node_metadata.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ namespace node {
3838
V(nghttp2) \
3939
V(napi) \
4040
V(llhttp) \
41-
V(uvwasi)
41+
V(uvwasi) \
42+
V(cjs_module_lexer) \
43+
V(base64)
4244

4345
#if HAVE_OPENSSL
4446
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)

test/parallel/test-process-versions.js

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
const common = require('../common');
33
const assert = require('assert');
44

5+
const cjs_module_lexer = require('../../deps/cjs-module-lexer/package.json');
6+
57
const expected_keys = [
68
'ares',
79
'brotli',
@@ -14,6 +16,8 @@ const expected_keys = [
1416
'napi',
1517
'llhttp',
1618
'uvwasi',
19+
'cjs_module_lexer',
20+
'base64',
1721
];
1822

1923
if (common.hasCrypto) {
@@ -51,6 +55,7 @@ assert.match(
5155
/^\d+\.\d+\.\d+(?:\.\d+)?-node\.\d+(?: \(candidate\))?$/
5256
);
5357
assert.match(process.versions.modules, /^\d+$/);
58+
assert.match(process.versions.cjs_module_lexer, commonTemplate);
5459

5560
if (common.hasCrypto) {
5661
const versionRegex = common.hasOpenSSL3 ?
@@ -70,3 +75,6 @@ for (let i = 0; i < expected_keys.length; i++) {
7075

7176
assert.strictEqual(process.config.variables.napi_build_version,
7277
process.versions.napi);
78+
79+
const expectedCjsModuleLexerVersion = cjs_module_lexer.version;
80+
assert.strictEqual(process.versions.cjs_module_lexer, expectedCjsModuleLexerVersion);

tools/update-base64.sh

+2
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ echo ""
4545
echo "$ git add -A deps/base64/base64"
4646
echo "$ git commit -m \"deps: update base64 to $BASE64_VERSION\""
4747
echo ""
48+
49+
echo "#define BASE64_VERSION \"$BASE64_VERSION\" // NOLINT(build/header_guard)" > "$BASE_DIR/src/base64_version.h"

tools/update-deps-version-files.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
# Shell script to update version file of the deps in the source tree.
4+
# This script could be used to update the version file for deps that do not have their
5+
# own update scripts
6+
7+
# update cjs_module_lexer_version.h
8+
{
9+
ROOT="$PWD/"
10+
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
11+
[ -x "$NODE" ] || NODE=$(command -v node)
12+
13+
# cjs-module-lexer
14+
cd deps/cjs-module-lexer || exit
15+
# get cjs-module-lexer version
16+
CJS_MODULE_LEXER_VERSION=$("$NODE" -p "require('./package.json').version")
17+
# update this version information in src/cjs_module_lexer_version.h
18+
echo "#define CJS_MODULE_LEXER_VERSION \"$CJS_MODULE_LEXER_VERSION\" // NOLINT(build/header_guard)" > "$ROOT/src/cjs_module_lexer_version.h"
19+
}

0 commit comments

Comments
 (0)