Skip to content

Commit 0a6c298

Browse files
committed
The System.Object[] happened later, inside the publish step, because the publish script was turning the JSON into a nested array and then joining/printing it poorly — which then produced an invalid CLI arg: --allow-proposed-apis System.Object[].
I’ve fixed that parsing/flattening in publish.yml, so the publish log should now show: enabledApiProposals (from EnabledApiProposalsJson): portsAttributes, debugVisualization, contribViewsWelcome and the npx ... publish command should include: --allow-proposed-apis portsAttributes debugVisualization contribViewsWelcome
1 parent b3ab855 commit 0a6c298

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

build/templates/publish.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,20 @@ steps:
113113
Write-Host "EnabledApiProposalsJson is not set; publishing without --allow-proposed-apis."
114114
} else {
115115
try {
116-
$enabledApiProposals = @($enabledApiProposalsJson | ConvertFrom-Json)
116+
$parsedEnabledApiProposals = ConvertFrom-Json -InputObject $enabledApiProposalsJson
117+
$enabledApiProposals = @()
118+
119+
if ($null -ne $parsedEnabledApiProposals) {
120+
foreach ($proposal in @($parsedEnabledApiProposals)) {
121+
if (-not [string]::IsNullOrWhiteSpace([string]$proposal)) {
122+
$enabledApiProposals += [string]$proposal
123+
}
124+
}
125+
}
126+
117127
if ($enabledApiProposals.Count -gt 0) {
118128
Write-Host ("enabledApiProposals (from EnabledApiProposalsJson): " + ($enabledApiProposals -join ', '))
119-
$allowProposedApisArgs = @('--allow-proposed-apis') + @($enabledApiProposals)
129+
$allowProposedApisArgs = @('--allow-proposed-apis') + $enabledApiProposals
120130
} else {
121131
Write-Host "EnabledApiProposalsJson parsed as empty; no proposed API allowlist flags needed."
122132
}

0 commit comments

Comments
 (0)