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

tools: harmonize dep_updaters scripts #48201

Merged
merged 1 commit into from
May 29, 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
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 @@ -59,14 +59,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 @@ -77,6 +69,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 @@ -50,14 +50,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 @@ -68,6 +60,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"