Elffuss BraidHub

kikocis/continue public

8cf316c34504 · 4.7 KiBRawPermalink
1# This is used in a task in .vscode/tasks.json when on windows
2# Start developing with:
3# - Run Task -> Install Dependencies
4# - Debug -> Extension
5
6# Everything needs node and npm
7Write-Host "`nChecking for dependencies that may require manual installation...`n" -ForegroundColor White
8
9# $cargo = (get-command cargo -ErrorAction SilentlyContinue)
10# if ($null -eq $cargo) {
11# Write-Host "Not Found " -ForegroundColor Red -NoNewLine
12# Write-Host "cargo"
13# } else {
14# Write-Host "Found " -ForegroundColor Green -NoNewLine
15# & cargo --version
16# }
17
18$node = (get-command node -ErrorAction SilentlyContinue)
19if ($null -eq $node) {
20 Write-Host "Not Found " -ForegroundColor Red -NoNewLine
21 Write-Host "node"
22} else {
23 Write-Host "Found " -ForegroundColor Green -NoNewLine
24 Write-Host "node " -NoNewLine
25 & node --version
26}
27
28# Node.js version check
29if (Test-Path ".nvmrc") {
30 $requiredNodeVersion = Get-Content ".nvmrc"
31 $currentNodeVersion = node -v
32
33 # Remove 'v' prefix from versions for comparison
34 $requiredVersion = $requiredNodeVersion.TrimStart('v')
35 $currentVersion = $currentNodeVersion.TrimStart('v')
36
37 if ($requiredVersion -ne $currentVersion) {
38 Write-Host "`n⚠️ Warning: Your Node.js version ($currentNodeVersion) does not match the required version ($requiredNodeVersion)" -ForegroundColor Yellow
39 Write-Host "Please consider switching to the correct version using: nvm use" -ForegroundColor Yellow
40
41 # Check if running in interactive mode
42 if ([Environment]::UserInteractive -and [Environment]::GetCommandLineArgs().Count -eq 0) {
43 Write-Host "Press Enter to continue with installation anyway..." -NoNewline -ForegroundColor Yellow
44 $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
45 Write-Host "`n" # Add newline after key press
46 } else {
47 Write-Host "Continuing with installation anyway...`n" -ForegroundColor Yellow
48 }
49 }
50}
51
52
53# if ($null -eq $cargo) {
54# Write-Host "`n...`n"
55# Write-Host "Cargo`n" -ForegroundColor White
56# Write-Host "Doesn't appear to be installed or is not on your Path."
57# Write-Host "For how to install cargo see:" -NoNewline
58# Write-Host "https://doc.rust-lang.org/cargo/getting-started/installation.html" -ForegroundColor Green
59# }
60
61if ($null -eq $node) {
62 Write-Host "`n...`n"
63 Write-Host "NodeJS`n" -ForegroundColor White
64 Write-Host "Doesn't appear to be installed or is not on your Path."
65 Write-Host "On most Windows systems you can install node using: " -NoNewLine
66 Write-Host "winget install OpenJS.NodeJS.LTS " -ForegroundColor Green
67 Write-Host "After installing restart your Terminal to update your Path."
68 Write-Host "Alternatively see: " -NoNewLine
69 Write-Host "https://nodejs.org/" -ForegroundColor Yellow
70}
71
72if (($null -eq $node)) {
73 return "`nSome dependencies that may require installation could not be found. Exiting"
74}
75
76Write-Host "`nInstalling root-level dependencies..." -ForegroundColor White
77npm install
78
79Write-Host "`nBuilding config-types..." -ForegroundColor White
80Push-Location packages/config-types
81npm install
82npm run build
83Pop-Location
84
85Write-Host "`nBuilding fetch..." -ForegroundColor White
86Push-Location packages/fetch
87npm install
88npm run build
89Pop-Location
90
91Write-Host "`nBuilding llm-info..." -ForegroundColor White
92Push-Location packages/llm-info
93npm install
94npm run build
95Pop-Location
96
97Write-Host "`nBuilding config-yaml..." -ForegroundColor White
98Push-Location packages/config-yaml
99npm install
100npm run build
101Pop-Location
102
103Write-Host "`nBuilding openai-adapters..." -ForegroundColor White
104Push-Location packages/openai-adapters
105npm install
106npm run build
107Pop-Location
108
109Write-Host "`nBuilding hub..." -ForegroundColor White
110Push-Location packages/hub
111npm install
112npm run build
113Pop-Location
114
115Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White
116Push-Location core
117npm install
118npm link
119Pop-Location
120
121Write-Output "`nInstalling GUI extension dependencies..." -ForegroundColor White
122Push-Location gui
123npm install
124npm link @continuedev/core
125npm run build
126Pop-Location
127
128# VSCode Extension (will also package GUI)
129Write-Output "`nInstalling VSCode extension dependencies..." -ForegroundColor White
130Push-Location extensions/vscode
131
132# This does way too many things inline but is the common denominator between many of the scripts
133npm install
134npm link @continuedev/core
135npm run prepackage
136npm run package
137
138Pop-Location
139
140
141Write-Output "`nInstalling binary dependencies..." -ForegroundColor White
142Push-Location binary
143
144npm install
145npm run build
146
147Pop-Location
148
149Write-Output "`nInstalling docs dependencies..." -ForegroundColor White
150Push-Location docs
151
152npm install
153
154Pop-Location