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 cjs_module_lexer_version and base64_version #45629

Merged
merged 1 commit into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/base64_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This is an auto generated file, please do not edit.
// Refer to tools/dep_updaters/update-base64.sh
#ifndef SRC_BASE64_VERSION_H_
#define SRC_BASE64_VERSION_H_
#define BASE64_VERSION "0.5.0"
#endif // SRC_BASE64_VERSION_H_
6 changes: 6 additions & 0 deletions src/cjs_module_lexer_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This is an auto generated file, please do not edit.
// Refer to tools/dep_updaters/update-cjs-module-lexer.sh
#ifndef SRC_CJS_MODULE_LEXER_VERSION_H_
#define SRC_CJS_MODULE_LEXER_VERSION_H_
#define CJS_MODULE_LEXER_VERSION "1.2.2"
#endif // SRC_CJS_MODULE_LEXER_VERSION_H_
6 changes: 5 additions & 1 deletion src/node_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include "acorn_version.h"
#include "ada.h"
#include "ares.h"
#include "base64_version.h"
#include "brotli/encode.h"
#include "cjs_module_lexer_version.h"
#include "llhttp.h"
#include "nghttp2/nghttp2ver.h"
#include "node.h"
Expand Down Expand Up @@ -97,8 +99,10 @@ Metadata::Versions::Versions() {
#ifndef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
undici = UNDICI_VERSION;
#endif
acorn = ACORN_VERSION;

acorn = ACORN_VERSION;
cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
base64 = BASE64_VERSION;
uvwasi = UVWASI_VERSION_STRING;

#if HAVE_OPENSSL
Expand Down
4 changes: 3 additions & 1 deletion src/node_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ namespace node {
V(acorn) \
V(simdutf) \
V(ada) \
NODE_VERSIONS_KEY_UNDICI(V)
NODE_VERSIONS_KEY_UNDICI(V) \
V(cjs_module_lexer) \
V(base64)

#if HAVE_OPENSSL
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const assert = require('assert');

// Import of pure js (non-shared) deps for comparison
const acorn = require('../../deps/acorn/acorn/package.json');
const cjs_module_lexer = require('../../deps/cjs-module-lexer/package.json');

const expected_keys = [
'ares',
Expand All @@ -19,6 +20,8 @@ const expected_keys = [
'acorn',
'simdutf',
'ada',
'cjs_module_lexer',
'base64',
];

const hasUndici = process.config.variables.node_builtin_shareable_builtins.includes('deps/undici/undici.js');
Expand Down Expand Up @@ -69,6 +72,7 @@ assert.match(
/^\d+\.\d+\.\d+(?:\.\d+)?-node\.\d+(?: \(candidate\))?$/
);
assert.match(process.versions.modules, /^\d+$/);
assert.match(process.versions.cjs_module_lexer, commonTemplate);

if (common.hasCrypto) {
const versionRegex = common.hasOpenSSL3 ?
Expand Down Expand Up @@ -97,3 +101,5 @@ if (hasUndici) {

const expectedAcornVersion = acorn.version;
assert.strictEqual(process.versions.acorn, expectedAcornVersion);
const expectedCjsModuleLexerVersion = cjs_module_lexer.version;
assert.strictEqual(process.versions.cjs_module_lexer, expectedCjsModuleLexerVersion);
10 changes: 10 additions & 0 deletions tools/dep_updaters/update-base64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ echo "$ git add -A deps/base64/base64"
echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\""
echo ""

# update the base64_version.h
cat > "$BASE_DIR/src/base64_version.h" << EOL
// This is an auto generated file, please do not edit.
// Refer to tools/dep_updaters/update-base64.sh
#ifndef SRC_BASE64_VERSION_H_
#define SRC_BASE64_VERSION_H_
#define BASE64_VERSION "$NEW_VERSION"
#endif // SRC_BASE64_VERSION_H_
EOL

# The last line of the script should always print the new version,
# as we need to add it to $GITHUB_ENV variable.
echo "NEW_VERSION=$NEW_VERSION"
10 changes: 10 additions & 0 deletions tools/dep_updaters/update-cjs-module-lexer.sh
MrJithil marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ echo "$ git add -A deps/cjs-module-lexer"
echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\""
echo ""

# update cjs_module_lexer_version.h
cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL
// This is an auto generated file, please do not edit.
// Refer to tools/dep_updaters/update-cjs-module-lexer.sh
#ifndef SRC_CJS_MODULE_LEXER_VERSION_H_
#define SRC_CJS_MODULE_LEXER_VERSION_H_
#define CJS_MODULE_LEXER_VERSION "$NEW_VERSION"
#endif // SRC_CJS_MODULE_LEXER_VERSION_H_
EOL

# The last line of the script should always print the new version,
# as we need to add it to $GITHUB_ENV variable.
echo "NEW_VERSION=$NEW_VERSION"