Forge
powershelldeeb25a2
1# Vendors monaco-editor min/vs into Assets/cide-editor/monaco/min/vs (offline host, ADR 0162).
2param(
3 [string]$Version = "0.52.2"
4)
5
6$ErrorActionPreference = "Stop"
7$repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
8$TargetRoot = Join-Path $repoRoot "Assets\cide-editor\monaco\min\vs"
9$work = Join-Path $env:TEMP "cide-monaco-vendor-$Version"
10if (Test-Path $work) { Remove-Item $work -Recurse -Force }
11New-Item -ItemType Directory -Path $work | Out-Null
12
13Push-Location $work
14try {
15 npm pack "monaco-editor@$Version" --silent 2>$null | Out-Null
16 $tgz = Get-ChildItem -Filter "monaco-editor-*.tgz" | Select-Object -First 1
17 if (-not $tgz) { throw "npm pack did not produce monaco-editor tarball" }
18 tar -xf $tgz.FullName
19 $src = Join-Path (Join-Path $work "package") "min\vs"
20 if (-not (Test-Path $src)) { throw "package/min/vs missing in $Version" }
21
22 if (Test-Path $TargetRoot) { Remove-Item $TargetRoot -Recurse -Force }
23 New-Item -ItemType Directory -Path $TargetRoot -Force | Out-Null
24 Copy-Item -Path (Join-Path $src "*") -Destination $TargetRoot -Recurse -Force
25 Write-Host "Monaco $Version vendored to $TargetRoot"
26}
27finally {
28 Pop-Location
29 if (Test-Path $work) { Remove-Item $work -Recurse -Force -ErrorAction SilentlyContinue }
30}
31
View only · write via MCP/CIDE