Skip to content

Commit

Permalink
tools: harmonize dep_updaters scripts
Browse files Browse the repository at this point in the history
PR-URL: #48201
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
  • Loading branch information
aduh95 authored May 29, 2023
1 parent 40b89c5 commit 2fac041
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 34 deletions.
21 changes: 11 additions & 10 deletions tools/dep_updaters/update-acorn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ rm -rf deps/acorn/acorn
"$NODE" "$NPM" init --yes

"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "acorn@$NEW_VERSION"
cd node_modules/acorn
# 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 \"$NEW_VERSION\"" >> "$FILE_PATH"
echo "#endif // SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
)

# update version information in src/acorn_version.h
cat > "$ROOT/src/acorn_version.h" <<EOF
// This is an auto generated file, please do not edit.
// Refer to tools/update-acorn.sh
#ifndef SRC_ACORN_VERSION_H_
#define SRC_ACORN_VERSION_H_
#define ACORN_VERSION "$NEW_VERSION"
#endif // SRC_ACORN_VERSION_H_
EOF

mv acorn-tmp/node_modules/acorn deps/acorn

rm -rf acorn-tmp/
Expand All @@ -53,7 +54,7 @@ echo "All done!"
echo ""
echo "Please git add acorn, commit the new version:"
echo ""
echo "$ git add -A deps/acorn"
echo "$ git add -A deps/acorn src/acorn_version.h"
echo "$ git commit -m \"deps: update acorn to $NEW_VERSION\""
echo ""

Expand Down
16 changes: 8 additions & 8 deletions tools/dep_updaters/update-base64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ mv "$WORKSPACE/base64" "$DEPS_DIR/base64/"
# to work, we create it and leave it empty.
echo "// Intentionally empty" >> "$DEPS_DIR/base64/base64/lib/config.h"

echo "All done!"
echo ""
echo "Please git add base64/base64, commit the new version:"
echo ""
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.
Expand All @@ -82,6 +74,14 @@ cat > "$BASE_DIR/src/base64_version.h" << EOL
#endif // SRC_BASE64_VERSION_H_
EOL

echo "All done!"
echo ""
echo "Please git add base64/base64, commit the new version:"
echo ""
echo "$ git add -A deps/base64/base64 src/base64_version.h"
echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\""
echo ""

# 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"
16 changes: 8 additions & 8 deletions tools/dep_updaters/update-cjs-module-lexer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ rm -rf "$DEPS_DIR/cjs-module-lexer"

mv node_modules/cjs-module-lexer "$DEPS_DIR/cjs-module-lexer"

echo "All done!"
echo ""
echo "Please git add cjs-module-lexer, commit the new version:"
echo ""
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.
Expand All @@ -73,6 +65,14 @@ cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL
#endif // SRC_CJS_MODULE_LEXER_VERSION_H_
EOL

echo "All done!"
echo ""
echo "Please git add cjs-module-lexer, commit the new version:"
echo ""
echo "$ git add -A deps/cjs-module-lexer src/cjs_module_lexer_version.h"
echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\""
echo ""

# 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"
26 changes: 18 additions & 8 deletions tools/dep_updaters/update-undici.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,32 @@ rm -f deps/undici/undici.js
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "undici@$NEW_VERSION"
cd node_modules/undici
"$NODE" "$NPM" run build:node
# 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_UNDICI_VERSION_H_" >> "$FILE_PATH"
echo "#define SRC_UNDICI_VERSION_H_" >> "$FILE_PATH"
echo "#define UNDICI_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH"
echo "#endif // SRC_UNDICI_VERSION_H_" >> "$FILE_PATH"
)

# update version information in src/undici_version.h
cat > "$ROOT/src/undici_version.h" <<EOF
// 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 "$NEW_VERSION"
#endif // SRC_UNDICI_VERSION_H_
EOF

mv undici-tmp/node_modules/undici deps/undici/src
mv deps/undici/src/undici-fetch.js deps/undici/undici.js
cp deps/undici/src/LICENSE deps/undici/LICENSE

rm -rf undici-tmp/

echo "All done!"
echo ""
echo "Please git add and commit the new version:"
echo ""
echo "$ git add -A deps/undici src/undici_version.h"
echo "$ git commit -m \"deps: update Undici to $NEW_VERSION\""
echo ""

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

0 comments on commit 2fac041

Please sign in to comment.