-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·71 lines (58 loc) · 1.73 KB
/
setup.sh
File metadata and controls
executable file
·71 lines (58 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Quick setup script for RangeLink
set -e
# Helper function to display Node.js installation instructions
print_install_node_instructions() {
echo "To fix this, run:"
echo " nvm install && nvm use"
echo ""
echo "Or install Node.js 22 manually from: https://nodejs.org/"
}
# Helper function to display "run setup.sh again" instructions
print_rerun_instructions() {
echo "After fixing this, run setup again:"
echo " ./setup.sh"
exit 1
}
echo "🚀 Setting up RangeLink..."
# Check if we're in the right directory
if [[ ! -f "package.json" ]]; then
echo "❌ Error: Please run this script from the project root."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Error: Node.js is not installed."
echo ""
print_install_node_instructions
echo ""
print_rerun_instructions
fi
# Check Node.js version (requires version 22)
NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
REQUIRED_VERSION=22
if [[ "$NODE_VERSION" -lt "$REQUIRED_VERSION" ]]; then
echo "❌ Error: Node.js version 22 or higher is required (currently on v$NODE_VERSION)."
echo ""
print_install_node_instructions
echo ""
print_rerun_instructions
fi
echo "✓ Node.js version: $(node -v)"
# Enable corepack
echo "📦 Enabling pnpm via corepack..."
npm run enable-pnpm
# Install dependencies
echo "📥 Installing dependencies..."
pnpm install
# Compile
echo "🔨 Compiling TypeScript..."
pnpm compile
echo ""
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo " 1. Press F5 in VS Code to launch Extension Development Host"
echo " 2. Test your changes with Ctrl+R Ctrl+L (Windows) or Cmd+R Cmd+L (Mac)"
echo ""
echo "See DEVELOPMENT.md for more details."