From eb997f3c4afd03645795c38daa9361afa159ff7a Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Wed, 18 Mar 2026 17:37:23 -0700 Subject: [PATCH 1/2] Fix publish pipeline --- .ado/publish.yml | 53 ++++++++++++++++--- .ado/templates/prep-and-pack-nuget.yml | 10 +--- .ado/templates/prep-and-pack-single.yml | 7 ++- .claude/settings.local.json | 15 ++++++ docs/managedCodeGen.md | 2 +- docs/monorepo.md | 2 +- docs/react-native-windows-init.md | 2 +- .../@react-native-windows/codegen/Document.md | 2 +- packages/README.md | 2 +- 9 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.ado/publish.yml b/.ado/publish.yml index 07ccbea45bf..08bce326528 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -102,6 +102,18 @@ parameters: BuildConfiguration: Release BuildPlatform: ARM64 UseFabric: true + - Name: X64DebugFabric + BuildConfiguration: Debug + BuildPlatform: x64 + UseFabric: true + - Name: X86DebugFabric + BuildConfiguration: Debug + BuildPlatform: x86 + UseFabric: true + - Name: Arm64DebugFabric + BuildConfiguration: Debug + BuildPlatform: ARM64 + UseFabric: true variables: - template: variables/windows.yml @@ -214,7 +226,7 @@ extends: - template: .ado/templates/msbuild-sln.yml@self parameters: solutionDir: vnext - solutionName: ReactWindows-Desktop.Publish.slnf + solutionName: ReactWindows-Desktop.sln buildPlatform: ${{ matrix.BuildPlatform }} buildConfiguration: ${{ matrix.BuildConfiguration }} oneESMode: true ## Files are only copied to staging, not published @@ -230,13 +242,17 @@ extends: buildPlatform: ${{ matrix.BuildPlatform }} buildConfiguration: ${{ matrix.BuildConfiguration }} contents: | - React.Windows.Desktop\Microsoft.ReactNative.winmd - React.Windows.Desktop.DLL\react-native-win32.* + React.Windows.Desktop\** + React.Windows.Desktop.DLL\** + React.Windows.Desktop.Test.DLL\** - template: .ado/templates/esrp-codesign-binaries.yml@self parameters: displayName: 'CodeSign Desktop Binaries' - folderPath: $(Build.StagingDirectory)/NuGet/Desktop/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} + ${{ if eq(matrix.UseFabric, true) }}: + folderPath: $(Build.StagingDirectory)/NuGet/DesktopFabric/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} + ${{ else }}: + folderPath: $(Build.StagingDirectory)/NuGet/Desktop/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} pattern: | **/react-native-win32.dll @@ -318,14 +334,17 @@ extends: buildPlatform: ${{ matrix.BuildPlatform }} buildConfiguration: ${{ matrix.BuildConfiguration }} contents: | - Microsoft.ReactNative\Microsoft.ReactNative.* - Microsoft.ReactNative.CsWinRT\Microsoft.ReactNative.Projection.* + Microsoft.ReactNative\** + Microsoft.ReactNative.Managed\** Microsoft.ReactNative.Managed.CodeGen\** - template: .ado/templates/esrp-codesign-binaries.yml@self parameters: displayName: 'CodeSign Microsoft.ReactNative Binaries' - folderPath: $(Build.StagingDirectory)/NuGet/ReactWindows/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} + ${{ if eq(matrix.UseFabric, true) }}: + folderPath: $(Build.StagingDirectory)/NuGet/ReactWindowsFabric/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} + ${{ else }}: + folderPath: $(Build.StagingDirectory)/NuGet/ReactWindows/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }} pattern: | **/Microsoft.ReactNative.dll **/Microsoft.ReactNative.winmd @@ -449,6 +468,26 @@ extends: - platform: ARM64EC configuration: Debug + - template: .ado/templates/prep-and-pack-nuget.yml@self + parameters: + artifactName: DesktopFabric + publishCommitId: $(publishCommitId) + npmVersion: $(npmVersion)-Fabric + packDesktop: true + slices: + - platform: x64 + configuration: Release + - platform: x86 + configuration: Release + - platform: ARM64EC + configuration: Release + - platform: x64 + configuration: Debug + - platform: x86 + configuration: Debug + - platform: ARM64EC + configuration: Debug + - template: .ado/templates/esrp-codesign-nuget.yml@self parameters: displayName: 'CodeSign all NuGet packages' diff --git a/.ado/templates/prep-and-pack-nuget.yml b/.ado/templates/prep-and-pack-nuget.yml index b01b99206d6..91f1fcbc060 100644 --- a/.ado/templates/prep-and-pack-nuget.yml +++ b/.ado/templates/prep-and-pack-nuget.yml @@ -14,7 +14,7 @@ parameters: # Note: NuGet pack expects platform-specific file separators ('\' on Windows). - name: nugetroot type: string - default: $(System.DefaultWorkingDirectory)\ReactWindows + default: $(System.DefaultWorkingDirectory)\NugetRoot - name: packDesktop type: boolean @@ -95,8 +95,6 @@ steps: nuspec: Microsoft.ReactNative slices: $(debugSlices) packageVersion: ${{parameters.npmVersion}} - codesignBinaries: ${{ parameters.signMicrosoft }} - codesignNuget: ${{ parameters.signMicrosoft }} buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=Debug;baseplatform=$(debugBasePlatform) - ${{ if containsValue(parameters.slices.*.configuration, 'Release') }}: - template: prep-and-pack-single.yml @@ -122,8 +120,6 @@ steps: nuspec: Microsoft.ReactNative.Managed slices: $(debugSlices) packageVersion: ${{parameters.npmVersion}} - codesignBinaries: ${{ parameters.signMicrosoft }} - codesignNuget: ${{ parameters.signMicrosoft }} buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=Debug;baseplatform=$(debugBasePlatform) - ${{ if containsValue(parameters.slices.*.configuration, 'Release') }}: - template: prep-and-pack-single.yml @@ -131,8 +127,6 @@ steps: outputPackage: Microsoft.ReactNative.Managed slices: $(releaseSlices) packageVersion: ${{parameters.npmVersion}} - codesignBinaries: ${{ parameters.signMicrosoft }} - codesignNuget: ${{ parameters.signMicrosoft }} buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=Release;baseplatform=$(releaseBasePlatform) - ${{ if eq(parameters.packMicrosoftReactNativeManagedCodeGen, true) }}: @@ -141,5 +135,3 @@ steps: outputPackage: Microsoft.ReactNative.Managed.CodeGen packageVersion: ${{parameters.npmVersion}} buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=$(baseConfiguration);baseplatform=$(basePlatform) - codesignBinaries: ${{ parameters.signMicrosoft }} - codesignNuget: ${{ parameters.signMicrosoft }} diff --git a/.ado/templates/prep-and-pack-single.yml b/.ado/templates/prep-and-pack-single.yml index fb81d234475..cdc7d7f4081 100644 --- a/.ado/templates/prep-and-pack-single.yml +++ b/.ado/templates/prep-and-pack-single.yml @@ -25,6 +25,9 @@ parameters: steps: + - powershell: gci $(System.DefaultWorkingDirectory)/NugetRoot + displayName: List files in NugetRoot + - ${{ if ne(parameters.slices, '') }}: - powershell: > .\StripAdditionalPlatformsFromNuspec.ps1 @@ -33,7 +36,7 @@ steps: -slices (ConvertFrom-Json '${{ parameters.slices }}') -debug displayName: '${{ parameters.outputPackage }} - Strip slices from nuspec' - workingDirectory: $(System.DefaultWorkingDirectory)/ReactWindows + workingDirectory: $(System.DefaultWorkingDirectory)/NugetRoot # Binary signing is done in build jobs (ESRP CodeSign before artifact upload) # NuGet signing is done in batch in publish.yml (single ESRP call for all .nupkg) @@ -44,7 +47,7 @@ steps: inputs: command: pack verbosityPack: 'Detailed' - packagesToPack: $(System.DefaultWorkingDirectory)/ReactWindows/${{ parameters.outputPackage }}.nuspec + packagesToPack: $(System.DefaultWorkingDirectory)/NugetRoot/${{ parameters.outputPackage }}.nuspec packDestination: $(System.DefaultWorkingDirectory)/NugetRootFinal buildProperties: version=${{ parameters.packageVersion }};id=${{ parameters.outputPackage }};${{ parameters.buildProperties }} diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000000..6c9af1c3741 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,15 @@ +{ + "permissions": { + "allow": [ + "Bash(npx lage:*)", + "Bash(yarn install:*)", + "Read(//e/GitHub/microsoft/123/**)", + "Bash(yarn why:*)", + "Bash(find e:/GitHub/microsoft/123/node_modules -path *parse-path* -name package.json)", + "Bash(find e:/GitHub/microsoft/123/node_modules -path *@types*parse-path*)", + "Bash(find node_modules -path *@types*parse-path* -maxdepth 6)", + "Bash(yarn build:*)", + "Bash(npx tsc:*)" + ] + } +} diff --git a/docs/managedCodeGen.md b/docs/managedCodeGen.md index 2f33659fbc9..801fb3f76da 100644 --- a/docs/managedCodeGen.md +++ b/docs/managedCodeGen.md @@ -27,7 +27,7 @@ When building the apps that are checked in to our repo for testing, we have to r ## Turning on/off Currently the feature is behind an MSBuild property `$(ReactNativeCodeGenEnabled)`. -The default at the moment is false, it is only turned on for a single project for now which is the [SampleLibraryCS.csproj](https://github.com/microsoft/react-native-windows/blob/main/packages/sample-apps/windows/SampleLibraryCS/SampleLibraryCS.csproj) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. +The default at the moment is false, it is only turned on for a single project for now which is the [SampleLibraryCS.csproj](https://github.com/microsoft/react-native-windows/blob/0.74-stable/packages/sample-apps/windows/SampleLibraryCS/SampleLibraryCS.csproj) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. ## MSBuild/NuGet Complications MSBuild and NuGet spent a long time fighting me in mixing a NetCoreApp3.1 executable and WinRT apps in the same solution and the same build. ProjectReferences cannot be used so I had to use the `` task directly in the targets and it was tricky making it build from both the customer apps as well as our main build solution and unittest (Microsoft.ReactNative.sln). In the end there are a few hacks in place to make this work. diff --git a/docs/monorepo.md b/docs/monorepo.md index 9162e1bb752..2ba314fbf23 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -2,7 +2,7 @@ react-native-windows is a monorepo with several [packages](https://github.com/microsoft/react-native-windows/tree/main/packages) and uses monorepo management tools to install, build, and publish. This page is all about what tools we use to manage this monorepo and some technical details, aimed at folks who are contributing to react-native-windows. # Installation of npm dependencies -react-native-windows uses [yarn workspaces](https://legacy.yarnpkg.com/en/docs/workspaces/) to install all react-native-windows npm dependencies. See "workspaces" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/main/package.json). +react-native-windows uses [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) to install all react-native-windows npm dependencies. See "workspaces" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/main/package.json). # Lage Build react-native-windows uses [lage](https://microsoft.github.io/lage/) to build all the "non-native" parts of react-native-windows. See "scripts" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/main/package.json). Also see [laga.config.js](https://github.com/microsoft/react-native-windows/blob/main/lage.config.js). diff --git a/docs/react-native-windows-init.md b/docs/react-native-windows-init.md index 9b7b44a8a48..db502d3673e 100644 --- a/docs/react-native-windows-init.md +++ b/docs/react-native-windows-init.md @@ -22,7 +22,7 @@ This has the following benefits: * We can now generate a cpp template that use both NuGet AND WinUI3. ### Research before setteling on Mustache -There are several templating schemes we could have chosen. We had a quick discussion and chose [mustache](https://www.npmjs.com/package/mustache) as it is a well-adopted, lightweight library dedicated for templating. +There are several templating schemes we could have chosen. We had a quick discussion and chose [mustache](https://github.com/janl/mustache.js) as it is a well-adopted, lightweight library dedicated for templating. Alternatives considered: * js template expression: This would have required all files to become js programs that needed to be imported and evaluated. Since a lot of files contain data format or code, we would have likely had quite a few ugly escaping cases. * T4: This would have required visual studio to be installed on the users machine and therefore only work on Windows. There were also some perf concerns and we would have to write and ship a standalone executable for the MSBuild tasks so we can call it from JavaScript. diff --git a/packages/@react-native-windows/codegen/Document.md b/packages/@react-native-windows/codegen/Document.md index 527efe2fc0b..078c3dc6ff6 100644 --- a/packages/@react-native-windows/codegen/Document.md +++ b/packages/@react-native-windows/codegen/Document.md @@ -56,7 +56,7 @@ export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); Checkout the following example: - Flow definition: [NativeDialogManagerWindows.js](https://github.com/microsoft/react-native-windows/blob/main/vnext/src-win/Libraries/NativeModules/specs/NativeDialogManagerWindows.js) -- Generated spec file: [NativeDialogManagerWindowsSpec.g.h](https://github.com/microsoft/react-native-windows/blob/main/vnext/codegen/NativeDialogManagerWindowsSpec.g.h) +- Generated spec file: [NativeDialogManagerWindowsSpec.g.h](https://github.com/microsoft/react-native-windows/blob/0.74-stable/vnext/codegen/NativeDialogManagerWindowsSpec.g.h) - Implementation: [AlertModule.h](https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Modules/AlertModule.h) A TurboModule implemetation starts with: diff --git a/packages/README.md b/packages/README.md index 12c8a0ce532..7d0fb5471d5 100644 --- a/packages/README.md +++ b/packages/README.md @@ -41,5 +41,5 @@ After adding a scope directory, add the scope to the list of yarn workspaces in ``` Publishing a scoped package requires that the **rnbot** NPM user is an owner of an **npm organization** with the -same name as the scope. You can check whether an organization exists by viewing [npmjs.com/org/](https://www.npmjs.com/org/rnw-scripts). +same name as the scope. You can check whether an organization exists by viewing `npmjs.com/org/`. See acoates for granting permissions to rnbot. From 0d48b7d482346f3b7744b9afae14411d06f6781e Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Wed, 18 Mar 2026 19:12:48 -0700 Subject: [PATCH 2/2] Change files --- ...ndows-codegen-5eec03c8-b98e-4492-a16b-925464b82d19.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@react-native-windows-codegen-5eec03c8-b98e-4492-a16b-925464b82d19.json diff --git a/change/@react-native-windows-codegen-5eec03c8-b98e-4492-a16b-925464b82d19.json b/change/@react-native-windows-codegen-5eec03c8-b98e-4492-a16b-925464b82d19.json new file mode 100644 index 00000000000..7808b47f8bd --- /dev/null +++ b/change/@react-native-windows-codegen-5eec03c8-b98e-4492-a16b-925464b82d19.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix publish pipeline", + "packageName": "@react-native-windows/codegen", + "email": "vmorozov@microsoft.com", + "dependentChangeType": "patch" +}