Files
kaitranntt 046a37b2a9 feat: implement bootstrap conversion and installer updates (Phase 1-3)
Phase 1 - Bootstrap Scripts:
- Convert lib/ccs to 32-line bootstrap (was 1919 lines)
- Convert lib/ccs.ps1 to 39-line bootstrap (was 1826 lines)
- Delegate all functionality to Node.js via npx

Phase 2 - Help Text Updates:
- Add Requirements section to Node.js help (lines 172-175)
- Bootstrap scripts delegate --help to npx

Phase 3 - Installer Updates:
- Add Node.js 14+ detection with clear warning messages
- Remove deprecated shell deps (bootstrap handles all)
- Update completion messages with Requirements/First Run sections
- Update docs with new architecture

Total code reduction: 3745 → 71 lines (98.1%)
2025-11-27 10:24:37 -05:00

40 lines
1.1 KiB
PowerShell

# CCS - Claude Code Switch (Bootstrap)
# Delegates to Node.js implementation via npx
# https://github.com/kaitranntt/ccs
param(
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$RemainingArgs
)
$ErrorActionPreference = "Stop"
$PACKAGE = "@kaitranntt/ccs"
$MIN_NODE_VERSION = 14
# Check Node.js installed
$NodeCmd = Get-Command node -ErrorAction SilentlyContinue
if (-not $NodeCmd) {
Write-Host "[X] Node.js not found"
Write-Host " Install: https://nodejs.org (LTS recommended)"
exit 127
}
# Check Node.js version (major only)
$NodeVersion = (node -v) -replace '^v', '' -split '\.' | Select-Object -First 1
if ([int]$NodeVersion -lt $MIN_NODE_VERSION) {
Write-Host "[X] Node.js $MIN_NODE_VERSION+ required (found: $(node -v))"
Write-Host " Update: https://nodejs.org"
exit 1
}
# Check npm/npx available
$NpxCmd = Get-Command npx -ErrorAction SilentlyContinue
if (-not $NpxCmd) {
Write-Host "[X] npx not found (requires npm 5.2+)"
exit 127
}
# Execute via npx (auto-installs if needed)
& npx $PACKAGE @RemainingArgs
exit $LASTEXITCODE