src: add cjs_module_lexer_version base64_version

src: add cjs_module_lexer_version base64_version
PR-URL: https://github.com/nodejs/node/pull/45629
Refs: https://github.com/nodejs/node/issues/45260
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Jithil P Ponnan
2023-05-14 22:16:47 +10:00
committed by GitHub
parent cdd20cfd71
commit abb1c45af7
7 changed files with 46 additions and 2 deletions

6
src/base64_version.h Normal file
View File

@@ -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_

View File

@@ -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_

View File

@@ -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"
@@ -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

View File

@@ -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)

View File

@@ -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',
@@ -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');
@@ -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 ?
@@ -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);

View File

@@ -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"

View File

@@ -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"