Skip to content

Commit 9962d48

Browse files
Address review feedback: remove --follow-symlinks from publish, simplify build logic, add assertion
Co-authored-by: andyleejordan <2226434+andyleejordan@users.noreply.github.com>
1 parent ff522a4 commit 9962d48

File tree

2 files changed

+15
-32
lines changed

2 files changed

+15
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"lint": "eslint src test --ext .ts",
107107
"format": "prettier --check '**/*.{ts,json,yml,mjs,code-workspace}'",
108108
"package": "vsce package --out out/ --no-gitHubIssueLinking --follow-symlinks",
109-
"publish": "vsce publish --follow-symlinks",
109+
"publish": "vsce publish",
110110
"pretest": "npm run compile",
111111
"test": "vscode-test"
112112
},

vscode-powershell.build.ps1

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,19 @@ task RestoreNodeOptional -If { !(Test-Path ./node_modules/eslint) } {
3333
}
3434

3535
task RestoreEditorServices -If (Get-EditorServicesPath) {
36-
switch ($Configuration) {
37-
"Debug" {
38-
# When debugging, we always rebuild PSES and ensure its symlinked so
39-
# that developers always have the latest local bits.
40-
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") {
41-
Write-Build DarkMagenta "Creating symbolic link to PSES"
42-
Remove-BuildItem ./modules
43-
New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module"
44-
}
45-
46-
Write-Build DarkGreen "Building PSES"
47-
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration
48-
}
49-
"Release" {
50-
# With VSCE --follow-symlinks support, we can now use symlinks in Release mode too.
51-
# Create symlink if it doesn't exist, ensuring it points to the correct location.
52-
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") {
53-
Write-Build DarkMagenta "Creating symbolic link to PSES"
54-
Remove-BuildItem ./modules
55-
New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module"
56-
}
57-
58-
# Only build if it hasn't been built at all.
59-
if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) {
60-
Write-Build DarkGreen "Building PSES"
61-
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration
62-
}
63-
}
36+
# With VSCE --follow-symlinks support, we can now use symlinks consistently
37+
# for both Debug and Release configurations.
38+
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") {
39+
Write-Build DarkMagenta "Creating symbolic link to PSES"
40+
Remove-BuildItem ./modules
41+
New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module"
42+
}
43+
44+
# For Debug configuration, always rebuild to ensure latest local bits.
45+
# For Release configuration, only build if it hasn't been built at all.
46+
if ($Configuration -eq "Debug" -or !(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) {
47+
Write-Build DarkGreen "Building PSES"
48+
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration
6449
}
6550
}
6651

@@ -127,9 +112,7 @@ task Package {
127112
New-Item -ItemType Directory -Force out | Out-Null
128113

129114
Assert-Build (Test-Path ./dist/extension.js) "Extension must be built!"
130-
131-
# With --follow-symlinks flag, VSCE can now package symbolic links directly,
132-
# so we no longer need to convert symlinks to copies.
115+
Assert-Build (Test-Path ./modules/PowerShellEditorServices/bin) "PowerShell Editor Services must be built under modules!"
133116

134117
if ($version.Minor % 2 -ne 0) {
135118
Write-Build DarkRed "This is a pre-release!"

0 commit comments

Comments
 (0)