Skip to content

Commit e9602af

Browse files
authored
Update script and native API docs for 0.80 release (#1086)
## Description ### Why What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits. Do a pass on API Docs using UpdateNativeApiDocs.ps1 script Resolves microsoft/react-native-windows#14871 CI build 0.80-stable latest: https://dev.azure.com/ms/react-native-windows/_build/results?buildId=623873&view=artifacts&pathAsName=false&type=publishedArtifacts ## Screenshots Add any relevant screen captures here from before or after your changes. https://github.com/user-attachments/assets/4d7e230d-bfa2-4522-8a6b-fc7f83036e36
1 parent 86ca0d4 commit e9602af

File tree

245 files changed

+881
-610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+881
-610
lines changed

.github/scripts/UpdateNativeApiDocs.ps1

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# UpdateNativeApiDocs.ps1 is a PowerShell script designed to download the
32
# API docs from the specified RNW CI build in ADO and integrate them into
43
# our docs folder, properly tagged with New/Old architecture tags
@@ -48,7 +47,7 @@ Function Create-WinRtApiDocWithBadge([string]$SourceDocPath, [string]$DestDocPat
4847
$Content = $Content.Trim()
4948

5049
# Write final file
51-
$Content | Out-File -Encoding utf8NoBOM $DestDocPath
50+
$Content | Out-File -Encoding utf8 $DestDocPath
5251
}
5352

5453
Function Get-DocKind([string]$DocPath) {
@@ -130,7 +129,7 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
130129
$OldContent = $OldContent -replace "---(.*\r\n){1,}---\r\n\r\n", "`r`n`r`n# Old Architecture`r`n`r`n"
131130
$OldContent = $OldContent -replace "\r\n#", "`r`n##"
132131

133-
($NewContent + $OldContent) | Out-File -Encoding utf8NoBOM -NoNewline $MergedFilePath
132+
($NewContent + $OldContent) | Out-File -Encoding utf8 -NoNewline $MergedFilePath
134133
Create-WinRtApiDocWithBadge -SourceDocPath $MergedFilePath -DestDocPath (Join-Path $OutputDocsPath $_) -BadgeMd $NewAndOldArchBadgeMd
135134
}
136135
$Kind = Get-DocKind -DocPath (Join-Path $OutputDocsPath $_)
@@ -140,12 +139,16 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
140139

141140
# Clean up links to enum type values (workaround for https://github.com/asklar/winmd2md/issues/10)
142141
(Get-ChildItem -Path $OutputDocsPath -File -Filter *-api-windows.md) | ForEach-Object {
143-
$FilePath = $_
144-
$FileContent = (Get-Content $FilePath -Raw)
145-
$AllTypesByKind['enum'] | ForEach-Object {
146-
$FileContent = $FileContent -replace "\($_#\w+\)", "($_)"
142+
$FilePath = $_.FullName
143+
if (Test-Path $FilePath) {
144+
$FileContent = Get-Content $FilePath -Raw
145+
if ($AllTypesByKind.ContainsKey('enum')) {
146+
$AllTypesByKind['enum'] | ForEach-Object {
147+
$FileContent = $FileContent -replace "\($_#\w+\)", "($_)"
148+
}
149+
}
150+
$FileContent | Out-File -Encoding utf8 $FilePath
147151
}
148-
$FileContent | Out-File -Encoding utf8NoBOM -NoNewLine $FilePath
149152
}
150153

151154
# Recreate index (workaround for https://github.com/asklar/winmd2md/issues/10)
@@ -159,7 +162,9 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
159162
$IndexContent += "`r`n"
160163

161164
$AllTypesByKind.Keys | Where-Object { $_ -ne 'unknown' } | Sort-Object | ForEach-Object {
162-
$IndexContent += "## $($_.Substring(0,1).ToUpper())$($_.Substring(1))$($_.EndsWith("s") ? "es" : "s")`r`n"
165+
$KindLabel = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))"
166+
if ($_.EndsWith("s")) { $KindLabel += "es" } else { $KindLabel += "s" }
167+
$IndexContent += "## $KindLabel`r`n"
163168
$AllTypesByKind[$_] | Sort-Object | ForEach-Object {
164169
$IndexContent += "- [$_]($_)`r`n"
165170
}
@@ -171,7 +176,7 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
171176
$IndexPath = (Join-Path $OutputDocsPath "index-api-windows.md")
172177

173178
Write-Host "Creating `"$IndexPath`""
174-
$IndexContent | Out-File -Encoding utf8NoBOM $IndexPath
179+
$IndexContent | Out-File -Encoding utf8 $IndexPath
175180

176181
# Update sidebar
177182
$SidebarsFile = Join-Path $RepoRoot "website/sidebars.json"
@@ -181,9 +186,11 @@ Function Merge-WinRtApiDocs([string]$OldArchDocsPath, [string]$NewArchDocsPath,
181186
$NativeApiEntries += "native-api/Native-API-Reference"
182187

183188
$AllTypesByKind.Keys | Where-Object { $_ -ne 'unknown' } | Sort-Object | ForEach-Object {
189+
$KindLabel = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))"
190+
if ($_.EndsWith("s")) { $KindLabel += "es" } else { $KindLabel += "s" }
184191
$KindObject = @{}
185192
$KindObject['type'] = 'subcategory'
186-
$KindObject['label'] = "$($_.Substring(0,1).ToUpper())$($_.Substring(1))$($_.EndsWith("s") ? "es" : "s")"
193+
$KindObject['label'] = $KindLabel
187194
$KindObject['ids'] = @()
188195
$AllTypesByKind[$_] | Sort-Object | ForEach-Object {
189196
$KindObject['ids'] += "native-api/$_"
@@ -228,4 +235,4 @@ finally
228235
Set-Location -Path $StartingLocation
229236
}
230237

231-
exit 0
238+
exit 0

docs/native-api/AccessibilityAction-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityAction
33
title: AccessibilityAction
44
---
@@ -16,3 +16,4 @@ Type: `string`
1616

1717
## Referenced by
1818
- [`AccessibilityActionEventHandler`](AccessibilityActionEventHandler)
19+

docs/native-api/AccessibilityActionEventHandler-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityActionEventHandler
33
title: AccessibilityActionEventHandler
44
---
@@ -12,3 +12,4 @@ void **`Invoke`**([`AccessibilityAction`](AccessibilityAction) action)
1212

1313
## Referenced by
1414
- [`DynamicAutomationProperties`](DynamicAutomationProperties)
15+

docs/native-api/AccessibilityInvokeEventHandler-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityInvokeEventHandler
33
title: AccessibilityInvokeEventHandler
44
---
@@ -12,3 +12,4 @@ void **`Invoke`**()
1212

1313
## Referenced by
1414
- [`DynamicAutomationProperties`](DynamicAutomationProperties)
15+

docs/native-api/AccessibilityRoles-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityRoles
33
title: AccessibilityRoles
44
---
@@ -44,3 +44,4 @@ Kind: `enum`
4444

4545
## Referenced by
4646
- [`DynamicAutomationProperties`](DynamicAutomationProperties)
47+

docs/native-api/AccessibilityStateCheckedValue-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityStateCheckedValue
33
title: AccessibilityStateCheckedValue
44
---
@@ -15,3 +15,4 @@ Kind: `enum`
1515

1616
## Referenced by
1717
- [`DynamicAutomationProperties`](DynamicAutomationProperties)
18+

docs/native-api/AccessibilityStates-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityStates
33
title: AccessibilityStates
44
---
@@ -15,3 +15,4 @@ Kind: `enum`
1515
|`Busy` | 0x3 | |
1616
|`Expanded` | 0x4 | |
1717
|`CountStates` | 0x5 | |
18+

docs/native-api/AccessibilityValue-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AccessibilityValue
33
title: AccessibilityValue
44
---
@@ -13,3 +13,4 @@ Kind: `enum`
1313
|`Max` | 0x1 | |
1414
|`Now` | 0x2 | |
1515
|`Text` | 0x3 | |
16+

docs/native-api/ActivityIndicatorComponentView-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: ActivityIndicatorComponentView
33
title: ActivityIndicatorComponentView
44
---
@@ -10,3 +10,4 @@ Kind: `class`
1010
Extends: [`ViewComponentView`](ViewComponentView)
1111

1212
> **EXPERIMENTAL**
13+

docs/native-api/AnimationClass-api-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
id: AnimationClass
33
title: AnimationClass
44
---
@@ -17,3 +17,4 @@ Kind: `enum`
1717

1818
## Referenced by
1919
- [`IVisual`](IVisual)
20+

0 commit comments

Comments
 (0)