feat: enhance layout components, data layer and global styles
- SidebarRail, TopBar, FilterBar: improved navigation and filtering UX - metrics.js, requests.js: expanded data with multi-range trend series - composables: enhanced useChat, useNavigation, useRequests - global.css: refined design tokens and utility classes - Add DocFilterBar component and LoginView page Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
71
start.sh
71
start.sh
@@ -32,59 +32,48 @@ fi
|
||||
info "Node.js $(node -v) | npm $(npm -v)"
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Detect WSL + Windows node_modules platform mismatch
|
||||
# WSL on a Windows-mounted repo should reuse Windows Node
|
||||
# ----------------------------------------------------------
|
||||
is_wsl() {
|
||||
grep -qi microsoft /proc/version 2>/dev/null
|
||||
}
|
||||
|
||||
check_platform_mismatch() {
|
||||
local rollup_dir="node_modules/@rollup"
|
||||
if [ ! -d "$rollup_dir" ]; then
|
||||
return 1
|
||||
fi
|
||||
# List installed rollup platform packages
|
||||
local platforms
|
||||
platforms="$(ls -1 "$rollup_dir" 2>/dev/null | grep -E '^rollup-(win|linux)')"
|
||||
if [ -z "$platforms" ]; then
|
||||
return 1
|
||||
fi
|
||||
# Running on WSL/Linux but has Windows rollup bindings
|
||||
if echo "$platforms" | grep -q "win32"; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
is_windows_mount() {
|
||||
case "$SCRIPT_DIR" in
|
||||
/mnt/*) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Install dependencies if node_modules is missing or mismatched
|
||||
# ----------------------------------------------------------
|
||||
NEED_INSTALL=false
|
||||
|
||||
if [ ! -d "node_modules" ]; then
|
||||
warn "node_modules not found"
|
||||
NEED_INSTALL=true
|
||||
elif is_wsl && check_platform_mismatch; then
|
||||
warn "Detected WSL with Windows node_modules (rollup platform mismatch)"
|
||||
warn "Removing node_modules to reinstall with correct platform bindings..."
|
||||
# WSL can't delete locked Windows .exe/.node files, use PowerShell instead
|
||||
if is_wsl && is_windows_mount && command -v powershell.exe &>/dev/null && command -v wslpath &>/dev/null; then
|
||||
WIN_PATH="$(wslpath -w "$SCRIPT_DIR")"
|
||||
if command -v powershell.exe &>/dev/null; then
|
||||
powershell.exe -NoProfile -Command "Remove-Item -Recurse -Force '${WIN_PATH}\\node_modules','${WIN_PATH}\\package-lock.json'" 2>/dev/null || true
|
||||
elif command -v cmd.exe &>/dev/null; then
|
||||
cmd.exe /c "rd /s /q \"${WIN_PATH}\\node_modules\"" 2>/dev/null || true
|
||||
cmd.exe /c "del /f /q \"${WIN_PATH}\\package-lock.json\"" 2>/dev/null || true
|
||||
else
|
||||
rm -rf node_modules package-lock.json 2>/dev/null || true
|
||||
fi
|
||||
# Fallback: clean up anything remaining via WSL
|
||||
rm -rf node_modules package-lock.json 2>/dev/null || true
|
||||
NEED_INSTALL=true
|
||||
WIN_PATH_PS="${WIN_PATH//\'/\'\'}"
|
||||
info "Detected WSL on a Windows-mounted project"
|
||||
info "Using Windows npm to avoid cross-platform node_modules installs"
|
||||
info "Access: http://127.0.0.1:5173"
|
||||
echo ""
|
||||
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Set-Location -LiteralPath '$WIN_PATH_PS'; npm start"
|
||||
fi
|
||||
|
||||
if [ "$NEED_INSTALL" = true ]; then
|
||||
# ----------------------------------------------------------
|
||||
# Install dependencies only when they are missing or unusable
|
||||
# ----------------------------------------------------------
|
||||
dependencies_ready() {
|
||||
[ -d "node_modules" ] || return 1
|
||||
[ -f "node_modules/vite/bin/vite.js" ] || return 1
|
||||
[ -e "node_modules/.bin/vite" ] || [ -e "node_modules/.bin/vite.cmd" ] || return 1
|
||||
|
||||
node -e "require('rollup')" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
if ! dependencies_ready; then
|
||||
warn "Dependencies are missing or incomplete"
|
||||
info "Running npm install..."
|
||||
npm install
|
||||
|
||||
if ! dependencies_ready; then
|
||||
error "Dependencies are still incomplete after npm install. Try deleting node_modules and running npm install manually."
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user