From a3c25daf3bc2a4819e9a0a5f70ba576bbf4e5c55 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Mon, 3 Aug 2026 11:57:52 +0530 Subject: [PATCH 1/2] Update pipelines to not use global packages --- .ado/ci.yml | 11 +++++++++-- samples-old/AppServiceDemo/.npmrc | 2 ++ samples-old/CalculatorCoreAppNuGet/.npmrc | 2 ++ samples-old/CalculatorNuGet/.npmrc | 2 ++ samples-old/CameraDemo/.npmrc | 2 ++ samples-old/NativeModuleSample/cppwinrt/.npmrc | 2 ++ samples-old/NativeModuleSample/csharp/.npmrc | 2 ++ samples-old/TodosFeed/TodosFeed/.npmrc | 2 ++ samples-old/rssreader/.npmrc | 2 ++ samples/Calculator/cppwinrt/.npmrc | 2 ++ samples/Calculator/csharp/.npmrc | 2 ++ samples/Calculator/fabric/.npmrc | 2 ++ samples/NativeModuleSample/cpp-lib/.npmrc | 2 ++ samples/NativeModuleSample/cpp-lib/.yarnrc.yml | 3 +++ samples/NativeModuleSample/cpp-lib/example/.npmrc | 2 ++ website/.npmrc | 2 ++ websitev2/.npmrc | 2 ++ 17 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 samples-old/AppServiceDemo/.npmrc create mode 100644 samples-old/CalculatorCoreAppNuGet/.npmrc create mode 100644 samples-old/CalculatorNuGet/.npmrc create mode 100644 samples-old/CameraDemo/.npmrc create mode 100644 samples-old/NativeModuleSample/cppwinrt/.npmrc create mode 100644 samples-old/NativeModuleSample/csharp/.npmrc create mode 100644 samples-old/TodosFeed/TodosFeed/.npmrc create mode 100644 samples-old/rssreader/.npmrc create mode 100644 samples/Calculator/cppwinrt/.npmrc create mode 100644 samples/Calculator/csharp/.npmrc create mode 100644 samples/Calculator/fabric/.npmrc create mode 100644 samples/NativeModuleSample/cpp-lib/.npmrc create mode 100644 samples/NativeModuleSample/cpp-lib/example/.npmrc create mode 100644 website/.npmrc create mode 100644 websitev2/.npmrc diff --git a/.ado/ci.yml b/.ado/ci.yml index 09ed9bf28..8eaedcd3c 100644 --- a/.ado/ci.yml +++ b/.ado/ci.yml @@ -32,6 +32,8 @@ resources: extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3 pool: name: Azure-Pipelines-1ESPT-ExDShared image: windows-2025 @@ -44,11 +46,16 @@ extends: steps: - checkout: self clean: false - + + - task: npmAuthenticate@0 + displayName: Authenticate to Azure Artifacts feed + inputs: + workingFile: ./website/.npmrc + - script: yarn install --frozen-lockfile displayName: Yarn Install (Website) workingDirectory: ./website - + - script: yarn build displayName: Yarn Build (Website) workingDirectory: ./website diff --git a/samples-old/AppServiceDemo/.npmrc b/samples-old/AppServiceDemo/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/AppServiceDemo/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/CalculatorCoreAppNuGet/.npmrc b/samples-old/CalculatorCoreAppNuGet/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/CalculatorCoreAppNuGet/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/CalculatorNuGet/.npmrc b/samples-old/CalculatorNuGet/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/CalculatorNuGet/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/CameraDemo/.npmrc b/samples-old/CameraDemo/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/CameraDemo/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/NativeModuleSample/cppwinrt/.npmrc b/samples-old/NativeModuleSample/cppwinrt/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/NativeModuleSample/cppwinrt/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/NativeModuleSample/csharp/.npmrc b/samples-old/NativeModuleSample/csharp/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/NativeModuleSample/csharp/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/TodosFeed/TodosFeed/.npmrc b/samples-old/TodosFeed/TodosFeed/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/TodosFeed/TodosFeed/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples-old/rssreader/.npmrc b/samples-old/rssreader/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples-old/rssreader/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples/Calculator/cppwinrt/.npmrc b/samples/Calculator/cppwinrt/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples/Calculator/cppwinrt/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples/Calculator/csharp/.npmrc b/samples/Calculator/csharp/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples/Calculator/csharp/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples/Calculator/fabric/.npmrc b/samples/Calculator/fabric/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples/Calculator/fabric/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples/NativeModuleSample/cpp-lib/.npmrc b/samples/NativeModuleSample/cpp-lib/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples/NativeModuleSample/cpp-lib/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/samples/NativeModuleSample/cpp-lib/.yarnrc.yml b/samples/NativeModuleSample/cpp-lib/.yarnrc.yml index 13215d637..c7404de19 100644 --- a/samples/NativeModuleSample/cpp-lib/.yarnrc.yml +++ b/samples/NativeModuleSample/cpp-lib/.yarnrc.yml @@ -1,6 +1,9 @@ nodeLinker: node-modules nmHoistingLimits: workspaces +npmRegistryServer: "https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/" +npmAlwaysAuth: true + plugins: - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs spec: "@yarnpkg/plugin-interactive-tools" diff --git a/samples/NativeModuleSample/cpp-lib/example/.npmrc b/samples/NativeModuleSample/cpp-lib/example/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/samples/NativeModuleSample/cpp-lib/example/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/website/.npmrc b/website/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/website/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true diff --git a/websitev2/.npmrc b/websitev2/.npmrc new file mode 100644 index 000000000..324730a60 --- /dev/null +++ b/websitev2/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ +always-auth=true From a01050d26e94e8f13492228688ad9c223ff91013 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Mon, 3 Aug 2026 12:23:19 +0530 Subject: [PATCH 2/2] final change --- .ado/ci.yml | 35 +++++++++++++++++++ samples-old/AppServiceDemo/.npmrc | 2 -- samples-old/CalculatorCoreAppNuGet/.npmrc | 2 -- samples-old/CalculatorNuGet/.npmrc | 2 -- samples-old/CameraDemo/.npmrc | 2 -- .../NativeModuleSample/cppwinrt/.npmrc | 2 -- samples-old/NativeModuleSample/csharp/.npmrc | 2 -- samples-old/TodosFeed/TodosFeed/.npmrc | 2 -- samples-old/rssreader/.npmrc | 2 -- samples/Calculator/cppwinrt/.npmrc | 2 -- samples/Calculator/csharp/.npmrc | 2 -- samples/Calculator/fabric/.npmrc | 2 -- samples/NativeModuleSample/cpp-lib/.npmrc | 2 -- .../NativeModuleSample/cpp-lib/.yarnrc.yml | 3 -- .../NativeModuleSample/cpp-lib/example/.npmrc | 2 -- website/.npmrc | 2 -- websitev2/.npmrc | 2 -- 17 files changed, 35 insertions(+), 33 deletions(-) delete mode 100644 samples-old/AppServiceDemo/.npmrc delete mode 100644 samples-old/CalculatorCoreAppNuGet/.npmrc delete mode 100644 samples-old/CalculatorNuGet/.npmrc delete mode 100644 samples-old/CameraDemo/.npmrc delete mode 100644 samples-old/NativeModuleSample/cppwinrt/.npmrc delete mode 100644 samples-old/NativeModuleSample/csharp/.npmrc delete mode 100644 samples-old/TodosFeed/TodosFeed/.npmrc delete mode 100644 samples-old/rssreader/.npmrc delete mode 100644 samples/Calculator/cppwinrt/.npmrc delete mode 100644 samples/Calculator/csharp/.npmrc delete mode 100644 samples/Calculator/fabric/.npmrc delete mode 100644 samples/NativeModuleSample/cpp-lib/.npmrc delete mode 100644 samples/NativeModuleSample/cpp-lib/example/.npmrc delete mode 100644 website/.npmrc delete mode 100644 websitev2/.npmrc diff --git a/.ado/ci.yml b/.ado/ci.yml index 8eaedcd3c..9edf17de5 100644 --- a/.ado/ci.yml +++ b/.ado/ci.yml @@ -47,6 +47,41 @@ extends: - checkout: self clean: false + # The Azure Artifacts feed requires authentication, which GitHub + # Actions and external contributors do not have. Configure the + # registry at build time here only, so the committed sources keep + # working on the public npm registry. + - task: PowerShell@2 + displayName: Point Yarn at the Azure Artifacts feed + inputs: + targetType: inline + workingDirectory: ./website + script: | + $feed = 'https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/' + $enc = [Text.UTF8Encoding]::new($false) + + [IO.File]::WriteAllText( + (Join-Path (Get-Location) '.npmrc'), + "registry=$feed`nalways-auth=true`n", + $enc) + + [IO.File]::WriteAllText( + (Join-Path (Get-Location) '.yarnrc'), + "registry `"$feed`"`n", + $enc) + + # Yarn v1 fetches the exact `resolved` URLs recorded in + # yarn.lock regardless of registry config, so rewrite them + # or network isolation will block the restore. + $lock = Get-Content -Path yarn.lock -Raw + $lock = $lock.Replace('https://registry.yarnpkg.com/', $feed) + $lock = $lock.Replace('https://registry.npmjs.org/', $feed) + [IO.File]::WriteAllText((Join-Path (Get-Location) 'yarn.lock'), $lock, $enc) + + if (Select-String -Path yarn.lock -Pattern 'registry\.yarnpkg\.com|registry\.npmjs\.org') { + throw 'yarn.lock still references a public npm registry.' + } + - task: npmAuthenticate@0 displayName: Authenticate to Azure Artifacts feed inputs: diff --git a/samples-old/AppServiceDemo/.npmrc b/samples-old/AppServiceDemo/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/AppServiceDemo/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/CalculatorCoreAppNuGet/.npmrc b/samples-old/CalculatorCoreAppNuGet/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/CalculatorCoreAppNuGet/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/CalculatorNuGet/.npmrc b/samples-old/CalculatorNuGet/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/CalculatorNuGet/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/CameraDemo/.npmrc b/samples-old/CameraDemo/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/CameraDemo/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/NativeModuleSample/cppwinrt/.npmrc b/samples-old/NativeModuleSample/cppwinrt/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/NativeModuleSample/cppwinrt/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/NativeModuleSample/csharp/.npmrc b/samples-old/NativeModuleSample/csharp/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/NativeModuleSample/csharp/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/TodosFeed/TodosFeed/.npmrc b/samples-old/TodosFeed/TodosFeed/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/TodosFeed/TodosFeed/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples-old/rssreader/.npmrc b/samples-old/rssreader/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples-old/rssreader/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples/Calculator/cppwinrt/.npmrc b/samples/Calculator/cppwinrt/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples/Calculator/cppwinrt/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples/Calculator/csharp/.npmrc b/samples/Calculator/csharp/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples/Calculator/csharp/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples/Calculator/fabric/.npmrc b/samples/Calculator/fabric/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples/Calculator/fabric/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples/NativeModuleSample/cpp-lib/.npmrc b/samples/NativeModuleSample/cpp-lib/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples/NativeModuleSample/cpp-lib/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/samples/NativeModuleSample/cpp-lib/.yarnrc.yml b/samples/NativeModuleSample/cpp-lib/.yarnrc.yml index c7404de19..13215d637 100644 --- a/samples/NativeModuleSample/cpp-lib/.yarnrc.yml +++ b/samples/NativeModuleSample/cpp-lib/.yarnrc.yml @@ -1,9 +1,6 @@ nodeLinker: node-modules nmHoistingLimits: workspaces -npmRegistryServer: "https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/" -npmAlwaysAuth: true - plugins: - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs spec: "@yarnpkg/plugin-interactive-tools" diff --git a/samples/NativeModuleSample/cpp-lib/example/.npmrc b/samples/NativeModuleSample/cpp-lib/example/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/samples/NativeModuleSample/cpp-lib/example/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/website/.npmrc b/website/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/website/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true diff --git a/websitev2/.npmrc b/websitev2/.npmrc deleted file mode 100644 index 324730a60..000000000 --- a/websitev2/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -registry=https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/npm/registry/ -always-auth=true