From 0377662883c5ffda12aadfb954d9e44f9e9022af Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Wed, 1 Jul 2026 14:46:24 -0700 Subject: [PATCH 1/2] chore: onboard to ADO feed --- pipelines/build.yml | 2 ++ pipelines/npm-feed-auth.yml | 26 ++++++++++++++++++++++++++ publish.yml | 2 ++ 3 files changed, 30 insertions(+) create mode 100644 pipelines/npm-feed-auth.yml diff --git a/pipelines/build.yml b/pipelines/build.yml index 0fccecdcb..20ac88066 100644 --- a/pipelines/build.yml +++ b/pipelines/build.yml @@ -13,6 +13,8 @@ steps: addToPath: true displayName: 'Use latest Python 3.x' +- template: pipelines/npm-feed-auth.yml@self + - bash: | if [ "$(uname)" = "Linux" ]; then sudo apt-get update -qq diff --git a/pipelines/npm-feed-auth.yml b/pipelines/npm-feed-auth.yml new file mode 100644 index 000000000..e532072ba --- /dev/null +++ b/pipelines/npm-feed-auth.yml @@ -0,0 +1,26 @@ +steps: + - pwsh: | + $feedRegistry = 'https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/' + $npmrcPath = Join-Path '$(Agent.TempDirectory)' 'vscode-feed.npmrc' + Set-Content -Path $npmrcPath -Encoding utf8 -Value @( + "registry=$feedRegistry" + 'always-auth=true' + ) + + Write-Host "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]$npmrcPath" + + Get-ChildItem -Path '$(Build.SourcesDirectory)' -Filter 'package-lock.json' -Recurse -File | ForEach-Object { + $lockfilePath = $_.FullName + $contents = Get-Content -Path $lockfilePath -Raw + $updatedContents = $contents.Replace('https://registry.npmjs.org/', $feedRegistry).Replace('https://registry.npmjs.com/', $feedRegistry) + + if ($updatedContents -ne $contents) { + Set-Content -Path $lockfilePath -Encoding utf8 -Value $updatedContents -NoNewline + } + } + displayName: 'Configure npm to use Monaco vscode feed' + + - task: npmAuthenticate@0 + displayName: 'Authenticate to Monaco vscode npm feed' + inputs: + workingFile: '$(NPM_CONFIG_USERCONFIG)' diff --git a/publish.yml b/publish.yml index ca0eabd9c..499a6625b 100644 --- a/publish.yml +++ b/publish.yml @@ -49,6 +49,7 @@ extends: branchName: '$(Build.SourceBranch)' artifactName: 'prebuilds-$(Build.SourceVersion)' targetPath: 'prebuilds' + - template: pipelines/npm-feed-auth.yml@self - pwsh: | Get-ChildItem -Path . -Recurse -Directory -Name "_manifest" | Remove-Item -Recurse -Force displayName: 'Delete _manifest folders' @@ -72,6 +73,7 @@ extends: branchName: '$(Build.SourceBranch)' artifactName: 'prebuilds-$(Build.SourceVersion)' targetPath: 'prebuilds' + - template: pipelines/npm-feed-auth.yml@self - bash: chmod +x prebuilds/darwin-*/spawn-helper displayName: 'Ensure spawn-helper is executable' - script: npm ci From c9408cd55bf7ee713ff5422e0ab7c27b05e90c26 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:15:38 -0700 Subject: [PATCH 2/2] Fix relative path --- pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.yml b/pipelines/build.yml index 20ac88066..691960104 100644 --- a/pipelines/build.yml +++ b/pipelines/build.yml @@ -13,7 +13,7 @@ steps: addToPath: true displayName: 'Use latest Python 3.x' -- template: pipelines/npm-feed-auth.yml@self +- template: npm-feed-auth.yml@self - bash: | if [ "$(uname)" = "Linux" ]; then