mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-12 05:12:21 +00:00
Clears all 29 open SonarCloud issues. - `examples/plugin-catalog/scripts/validate.sh`: `[[ ]]` in place of `[ ]` for bash tests (SonarCloud shell:S7688). Every script has a bash shebang; no test uses `-a`/`-o`, escaped parentheses or an unquoted pattern on the right of `=`. - `crates/expr/src/prelude.js`, `crates/script/src/prelude.js`, `crates/script/src/scriptui.js`: `Number.isFinite` / `Number.isNaN` / `Number.parseInt` (javascript:S7773). Every call already has a number (a `typeof` check or `Number()` before it), and `Number.parseInt === parseInt`, so nothing changes in boa. - `packaging/windows/test-legacy-fixture.ps1`: dot-sources `[scriptblock]::Create($block)` in place of `Invoke-Expression $block` (powershelldre:S8659). It runs in the same scope, so `$LegacyWxs` is still set after it. - `sonar-project.properties`: S7773 and S8786 are not raised on `*.jsx`. Those are After Effects ExtendScript (ES3), which also runs in After Effects and has no `Number.isFinite` or `String.prototype.trim`. The ignore covers 7 issues in `Ease Presets.jsx` and `Rename Layers.jsx`.
22 lines
1.3 KiB
PowerShell
22 lines
1.3 KiB
PowerShell
<# Exercise the legacy source transformation without building or installing. #>
|
|
param([Parameter(Mandatory = $true)] [string] $Work)
|
|
$ErrorActionPreference = 'Stop'
|
|
[void](New-Item -ItemType Directory -Force -Path $Work)
|
|
$source = Get-Content -Raw (Join-Path $PSScriptRoot 'test-msi.ps1')
|
|
$start = $source.IndexOf('$Wxs =')
|
|
$end = $source.IndexOf('$Msi = @{}', $start)
|
|
if ($start -lt 0 -or $end -le $start) { throw 'Could not locate the legacy source transformation.' }
|
|
# Run the test harness's exact source-producing block, with only scratch outputs.
|
|
$block = $source.Substring($start, $end - $start).Replace('$PSScriptRoot', ("'" + $PSScriptRoot.Replace("'", "''") + "'"))
|
|
. ([scriptblock]::Create($block))
|
|
[xml]$legacy = Get-Content -Raw $LegacyWxs
|
|
$ns = New-Object Xml.XmlNamespaceManager($legacy.NameTable)
|
|
$ns.AddNamespace('w', 'http://wixtoolset.org/schemas/v4/wxs')
|
|
if ($legacy.SelectNodes('//w:RegistryValue[@Name="Path" or @Name="InstallDir" or @Name="InstallFolder"]', $ns).Count) {
|
|
throw 'Legacy fixture must omit every modern folder record so discovery uses the executable fallback.'
|
|
}
|
|
if (-not $legacy.SelectNodes('//w:RegistryValue[contains(@Value,"EffectcraftExe")]', $ns).Count) {
|
|
throw 'Legacy fixture must retain its executable registration.'
|
|
}
|
|
Write-Output 'PASS legacy fixture exposes only the executable-path fallback.'
|