From 2873b106f1abeabe47ca0ca03fce1e4ed883d674 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 19:33:45 +0000 Subject: [PATCH 1/3] Initial plan for issue From bb42c6e7df5830b1cdae41d6eabd605d8ba711af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 19:43:16 +0000 Subject: [PATCH 2/3] Add --follow-symlinks flag to VSCE and simplify build logic Co-authored-by: andyleejordan <2226434+andyleejordan@users.noreply.github.com> --- package.json | 2 +- vscode-powershell.build.ps1 | 32 +++++++++++--------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 9d3dba87a6..1a4e350f33 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "watch": "npm run compile -- --watch", "lint": "eslint src test --ext .ts", "format": "prettier --check '**/*.{ts,json,yml,mjs,code-workspace}'", - "package": "vsce package --out out/ --no-gitHubIssueLinking", + "package": "vsce package --out out/ --no-gitHubIssueLinking --follow-symlinks", "publish": "vsce publish", "pretest": "npm run compile", "test": "vscode-test" diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 4bcc737e33..0fcad12569 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -47,22 +47,18 @@ task RestoreEditorServices -If (Get-EditorServicesPath) { Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration } "Release" { - # When releasing, we ensure the bits are not symlinked but copied, - # and only if they don't already exist. - if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") { - Write-Build DarkRed "Deleting PSES symbolic link" + # With VSCE --follow-symlinks support, we can now use symlinks in Release mode too. + # Create symlink if it doesn't exist, ensuring it points to the correct location. + if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") { + Write-Build DarkMagenta "Creating symbolic link to PSES" Remove-BuildItem ./modules + New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module" } - if (!(Test-Path ./modules)) { - # We only build if it hasn't been built at all. - if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) { - Write-Build DarkGreen "Building PSES" - Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration - } - - Write-Build DarkGreen "Copying PSES" - Copy-Item -Recurse -Force "$(Split-Path (Get-EditorServicesPath))/module" ./modules + # Only build if it hasn't been built at all. + if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) { + Write-Build DarkGreen "Building PSES" + Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration } } } @@ -132,14 +128,8 @@ task Package { Assert-Build (Test-Path ./dist/extension.js) "Extension must be built!" - # Packaging requires a copy of the modules folder, not a symbolic link. But - # we might have built in Debug configuration, not Release, and still want to - # package it. So delete the symlink and copy what we just built. - if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") { - Write-Build DarkRed "PSES is a symbolic link, replacing with copy!" - Remove-BuildItem ./modules - Copy-Item -Recurse -Force "$(Split-Path (Get-EditorServicesPath))/module" ./modules - } + # With --follow-symlinks flag, VSCE can now package symbolic links directly, + # so we no longer need to convert symlinks to copies. if ($version.Minor % 2 -ne 0) { Write-Build DarkRed "This is a pre-release!" From ff522a45634cc679be34854535286f3b221be079 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 19:47:41 +0000 Subject: [PATCH 3/3] Add --follow-symlinks flag to vsce publish command Co-authored-by: andyleejordan <2226434+andyleejordan@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1a4e350f33..2b22baac1c 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "lint": "eslint src test --ext .ts", "format": "prettier --check '**/*.{ts,json,yml,mjs,code-workspace}'", "package": "vsce package --out out/ --no-gitHubIssueLinking --follow-symlinks", - "publish": "vsce publish", + "publish": "vsce publish --follow-symlinks", "pretest": "npm run compile", "test": "vscode-test" },