Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
10 changes: 1 addition & 9 deletions .ado/templates/prep-and-pack-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -122,17 +120,13 @@ 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
parameters:
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) }}:
Expand All @@ -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 }}
7 changes: 5 additions & 2 deletions .ado/templates/prep-and-pack-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ parameters:

steps:

- powershell: gci $(System.DefaultWorkingDirectory)/NugetRoot
displayName: List files in NugetRoot

- ${{ if ne(parameters.slices, '') }}:
- powershell: >
.\StripAdditionalPlatformsFromNuspec.ps1
Expand All @@ -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)
Expand All @@ -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 }}

Expand Down
15 changes: 15 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -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:*)"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix publish pipeline",
"packageName": "@react-native-windows/codegen",
"email": "vmorozov@microsoft.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion docs/managedCodeGen.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<MSBuild>` 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.
Expand Down
2 changes: 1 addition & 1 deletion docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion docs/react-native-windows-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-native-windows/codegen/Document.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default TurboModuleRegistry.getEnforcing<Spec>('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:
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<scope>](https://www.npmjs.com/org/rnw-scripts).
same name as the scope. You can check whether an organization exists by viewing `npmjs.com/org/<scope>`.
See acoates for granting permissions to rnbot.
Loading