mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 11:05:31 +08:00
be4f8eb465
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
# Check if bun version matches package.json
|
|
# keep in sync with packages/script/src/index.ts semver qualifier
|
|
bun -e '
|
|
import { semver } from "bun";
|
|
const pkg = await Bun.file("package.json").json();
|
|
const expectedBunVersion = pkg.packageManager?.split("@")[1];
|
|
if (!expectedBunVersion) {
|
|
throw new Error("packageManager field not found in root package.json");
|
|
}
|
|
const expectedBunVersionRange = `^${expectedBunVersion}`;
|
|
if (!semver.satisfies(process.versions.bun, expectedBunVersionRange)) {
|
|
throw new Error(`This script requires bun@${expectedBunVersionRange}, but you are using bun@${process.versions.bun}`);
|
|
}
|
|
if (process.versions.bun !== expectedBunVersion) {
|
|
console.warn(`Warning: Bun version ${process.versions.bun} differs from expected ${expectedBunVersion}`);
|
|
}
|
|
'
|
|
|
|
# kilocode_change start
|
|
jetbrains=0
|
|
zero=0000000000000000000000000000000000000000
|
|
|
|
while read -r local_ref local_oid remote_ref remote_oid; do
|
|
if [ "$local_oid" = "$zero" ]; then
|
|
continue
|
|
fi
|
|
|
|
base="$remote_oid"
|
|
if [ "$remote_oid" = "$zero" ]; then
|
|
base=$(git merge-base "$local_oid" "$1/main" 2>/dev/null || git hash-object -t tree /dev/null)
|
|
fi
|
|
|
|
if ! git diff --quiet "$base" "$local_oid" -- . \
|
|
':(exclude).changeset/**' \
|
|
':(exclude)packages/kilo-vscode/**' \
|
|
':(exclude)packages/kilo-docs/**'; then
|
|
jetbrains=1
|
|
fi
|
|
done
|
|
|
|
bun typecheck --filter='!@kilocode/kilo-jetbrains'
|
|
|
|
if [ "$jetbrains" -eq 1 ]; then
|
|
bun typecheck --filter='@kilocode/kilo-jetbrains'
|
|
else
|
|
echo "Skipping JetBrains typecheck (no relevant changes)"
|
|
fi
|
|
# kilocode_change end
|