Set up vs project

This commit is contained in:
Daniel Imms
2024-07-09 10:52:09 -07:00
parent 190e1f014e
commit c30bffc60c
15 changed files with 380 additions and 16 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ const devOptions = {
const prodOptions = {
minify: true,
treeShaking: true,
logLevel: 'debug',
logLevel: 'verbose',
legalComments: 'none',
// TODO: Mangling private and protected properties will reduce bundle size quite a bit, we must
// make sure we don't cast privates to `any` in order to prevent regressions.
+45
View File
@@ -0,0 +1,45 @@
# Get latest vscode repo
if (Test-Path -Path "src/vs/temp") {
Write-Host "`e[32m> Fetching latest`e[0m"
git -C src/vs/temp checkout
git -C src/vs/temp pull
} else {
Write-Host "`e[32m> Cloning microsoft/vscode`e[0m"
$null = New-Item -ItemType Directory -Path "src/vs/temp" -Force
git clone https://github.com/microsoft/vscode src/vs/temp
}
# Delete old base
Write-Host "`e[32m> Deleting old base`e[0m"
$null = Remove-Item -Recurse -Force "src/vs/base"
# Copy base
Write-Host "`e[32m> Copying base`e[0m"
Copy-Item -Path "src/vs/temp/src/vs/base" -Destination "src/vs/base" -Recurse
# Comment out any CSS imports
Write-Host "`e[32m> Commenting out CSS imports`e[0m" -NoNewline
$baseFiles = Get-ChildItem -Path "src/vs/base" -Recurse -File
$count = 0
foreach ($file in $baseFiles) {
$content = Get-Content -Path $file.FullName
$updatedContent = $content | ForEach-Object {
if ($_ -match "^import 'vs/css!") {
Write-Host "`e[32m." -NoNewline
$count++
"// $_"
} else {
$_
}
}
$updatedContent | Set-Content -Path $file.FullName
}
Write-Host " $count files patched"
# Copy typings
Write-Host "`e[32m> Copying typings`e[0m"
Copy-Item -Path "src/vs/temp/src/typings" -Destination "src/vs" -Recurse -Force
# Deleting unwanted typings
Write-Host "`e[32m> Deleting unwanted typings`e[0m"
$null = Remove-Item -Path "src/vs/typings/vscode-globals-modules.d.ts" -Force