-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,339 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "./tools/node_modules/@biomejs/biome/configuration_schema.json", | ||
"formatter": { | ||
"include": [ | ||
"test/**/*.{js,mjs,json}", | ||
"lib/**/*.{js,mjs,json}", | ||
"tools/**/*.{js,mjs,json}" | ||
], | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 120 | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"enabled": true, | ||
"arrowParentheses": "always", | ||
"trailingComma": "all", | ||
"quoteStyle": "single", | ||
"semicolons": "always", | ||
} | ||
}, | ||
"json": { | ||
"formatter": { | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/sh | ||
|
||
# Shell script to update @biomejs/biome in the source tree to the latest release. | ||
|
||
# This script must be in the tools directory when it runs because it uses the | ||
# script source file path to determine directories to work in. | ||
|
||
set -ex | ||
|
||
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | ||
[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" | ||
[ -x "$NODE" ] || NODE=$(command -v node) | ||
NPM="$BASE_DIR/deps/npm/bin/npm-cli.js" | ||
NODE_MODULES_DIR="$BASE_DIR/tools/node_modules" | ||
|
||
# shellcheck disable=SC1091 | ||
. "$BASE_DIR/tools/dep_updaters/utils.sh" | ||
|
||
NEW_VERSION=$("$NODE" "$NPM" view @biomejs/biome dist-tags.latest) | ||
# CURRENT_VERSION=$("$NODE" "$NPM" --prefix './tools/node_modules/@biomejs/biome/' pkg get version) | ||
|
||
# This function exit with 0 if new version and current version are the same | ||
# compare_dependency_version "@biomejs/biome" "$NEW_VERSION" "$CURRENT_VERSION" | ||
|
||
cd "$( dirname "$0" )/../.." || exit | ||
|
||
echo "Making temporary workspace..." | ||
|
||
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
|
||
cleanup () { | ||
EXIT_CODE=$? | ||
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" | ||
exit $EXIT_CODE | ||
} | ||
|
||
trap cleanup INT TERM EXIT | ||
|
||
cd "$WORKSPACE" | ||
|
||
echo "Fetching @biomejs/biome source archive..." | ||
|
||
"$NODE" "$NPM" pack "@biomejs/biome@$NEW_VERSION" | ||
|
||
BIOME_TGZ="biomejs-biome-$NEW_VERSION.tgz" | ||
|
||
log_and_verify_sha256sum "@biomejs/biome" "$BIOME_TGZ" | ||
|
||
rm -r "$NODE_MODULES_DIR/@biomejs/biome"/* | ||
|
||
tar -xf "$BIOME_TGZ" | ||
|
||
mv package/* "$NODE_MODULES_DIR/@biomejs/biome" | ||
|
||
# Biome has optional dependencies that are not installed by default. | ||
# - @biomejs/cli-win32-x64 | ||
# - @biomejs/cli-win32-arm64 | ||
# - @biomejs/cli-darwin-x64 | ||
# - @biomejs/cli-darwin-arm64 | ||
# - @biomejs/cli-linux-x64 | ||
# - @biomejs/cli-linux-arm64 | ||
PLATFORM_DEPS=( | ||
"cli-win32-x64" | ||
"cli-win32-arm64" | ||
"cli-darwin-x64" | ||
"cli-darwin-arm64" | ||
"cli-linux-x64" | ||
"cli-linux-arm64" | ||
) | ||
|
||
for PLATFORM_DEP in "${PLATFORM_DEPS[@]}"; do | ||
echo "Fetching @biomejs/$PLATFORM_DEP source archive..." | ||
|
||
"$NODE" "$NPM" pack "@biomejs/$PLATFORM_DEP@$NEW_VERSION" | ||
|
||
PLATFORM_DEP_TGZ="biomejs-$PLATFORM_DEP-$NEW_VERSION.tgz" | ||
|
||
log_and_verify_sha256sum "@biomejs/$PLATFORM_DEP" "$PLATFORM_DEP_TGZ" | ||
|
||
rm -rf "$NODE_MODULES_DIR/@biomejs/$PLATFORM_DEP"/* | ||
mkdir -p "$NODE_MODULES_DIR/@biomejs/$PLATFORM_DEP" | ||
|
||
tar -xf "$PLATFORM_DEP_TGZ" -C "$NODE_MODULES_DIR/@biomejs/$PLATFORM_DEP" | ||
done | ||
|
||
echo "All done!" | ||
echo "" | ||
echo "Please git add @biomejs/biome, commit the new version:" | ||
echo "" | ||
echo "$ git add -A tools/node_modules/@biomejs/biome" | ||
echo "$ git commit -m \"deps: update @biomejs/biome to $NEW_VERSION\"" | ||
echo "" | ||
|
||
# Update the version number on maintaining-dependencies.md | ||
# and print the new version as the last line of the script as we need | ||
# to add it to $GITHUB_ENV variable | ||
finalize_version_update "@biomejs/biome" "$NEW_VERSION" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.