接口开始5%
This commit is contained in:
@@ -20,10 +20,11 @@ $pages = Get-Content -LiteralPath (Join-Path $root 'pages.json') -Raw -Encoding
|
||||
$paths = @($pages.pages.path)
|
||||
$g01 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g01-my-genealogies.vue') -Raw -Encoding utf8
|
||||
$runtimeSmoke = Get-Content -LiteralPath (Join-Path $root 'tests/g01-empty-state-runtime-smoke.js') -Raw -Encoding utf8
|
||||
$panelPath = Join-Path $root 'static/assets/modules/genealogy/opaque/g01-empty-panel.png'
|
||||
$framePath = Join-Path $root 'static/assets/modules/genealogy/transparent/g01-empty-panel-frame.png'
|
||||
$frameManifestPath = Join-Path $root 'design-pipeline/manifests/g01-state-frame-v3.json'
|
||||
$frameMasterPath = Join-Path $root 'docs/design/assets/g01-state/masters/g01-empty-panel-master.png'
|
||||
$pipelinePackage = Get-Content -LiteralPath (Join-Path $root 'design-pipeline/package.json') -Raw -Encoding utf8
|
||||
$frameBuilderPath = Join-Path $root 'design-pipeline/scripts/build-g01-empty-frame.mjs'
|
||||
$frameBuilderPath = Join-Path $root 'design-pipeline/scripts/build-raster-assets.mjs'
|
||||
|
||||
if (-not ($paths -contains 'pages/genealogy/g01-my-genealogies')) { throw 'G01 route missing' }
|
||||
if ($paths -contains 'pages/genealogy/g02-empty-genealogies') { throw 'G02 route must be removed; empty state belongs to G01' }
|
||||
@@ -80,30 +81,36 @@ foreach ($className in @('empty-panel', 'empty-create-action', 'empty-search-act
|
||||
Assert-NoCssSurface -Content $g01 -ClassName $className
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $panelPath)) { throw 'G01 requires its final raster empty-panel asset' }
|
||||
if (-not (Test-Path -LiteralPath $framePath)) { throw 'G01 requires the extracted transparent empty-panel frame asset' }
|
||||
if (-not (Test-Path -LiteralPath $frameManifestPath)) { throw 'G01 transparent frame requires its schema v3 owner' }
|
||||
if (-not (Test-Path -LiteralPath $frameMasterPath)) { throw 'G01 transparent frame requires its traceable master asset' }
|
||||
if (-not (Test-Path -LiteralPath $frameBuilderPath)) { throw 'G01 transparent empty-panel frame must remain reproducible from its builder' }
|
||||
Assert-Match -Content $pipelinePackage -Pattern '"build:g01-empty-frame"\s*:\s*"node scripts/build-g01-empty-frame\.mjs"' -Message 'G01 transparent frame builder is not exposed by the design pipeline'
|
||||
Assert-Match -Content $pipelinePackage -Pattern '"build:g01-state-frame"\s*:\s*"node scripts/build-raster-assets\.mjs design-pipeline/manifests/g01-state-frame-v3\.json"' -Message 'G01 transparent frame builder is not exposed by the design pipeline'
|
||||
$frameManifest = Get-Content -LiteralPath $frameManifestPath -Raw -Encoding utf8 | ConvertFrom-Json
|
||||
if ($frameManifest.kind -ne 'asset-build-manifest' -or $frameManifest.family -ne 'g01-state-frame-v3') {
|
||||
throw 'G01 transparent frame manifest has the wrong owner identity'
|
||||
}
|
||||
if ($frameManifest.assets.Count -ne 1) { throw 'G01 transparent frame manifest must own exactly one output' }
|
||||
$frameAsset = $frameManifest.assets[0]
|
||||
if ($frameAsset.source -ne 'docs/design/assets/g01-state/masters/g01-empty-panel-master.png' -or
|
||||
$frameAsset.output -ne 'static/assets/modules/genealogy/transparent/g01-empty-panel-frame.png' -or
|
||||
$frameAsset.processing.mode -ne 'warm-gold-frame-extract') {
|
||||
throw 'G01 transparent frame manifest no longer owns the approved master, output and extraction algorithm'
|
||||
}
|
||||
$expectedFrameWidth = [int]$frameAsset.outputPixels.width
|
||||
$expectedFrameHeight = [int]$frameAsset.outputPixels.height
|
||||
Assert-Match -Content $runtimeSmoke -Pattern '\{\s*width:\s*412,\s*height:\s*1000\s*\}' -Message 'G01 runtime smoke must include the approved 412x1000 tall-screen stress viewport'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$panel = [System.Drawing.Bitmap]::FromFile($panelPath)
|
||||
try {
|
||||
if ($panel.Width -ne 1122 -or $panel.Height -ne 1402) { throw 'G01 empty-panel asset must remain 1122 x 1402px' }
|
||||
$corners = @(
|
||||
$panel.GetPixel(0, 0).A,
|
||||
$panel.GetPixel(($panel.Width - 1), 0).A,
|
||||
$panel.GetPixel(0, ($panel.Height - 1)).A,
|
||||
$panel.GetPixel(($panel.Width - 1), ($panel.Height - 1)).A
|
||||
)
|
||||
if (($corners | Where-Object { $_ -ne 255 }).Count -ne 0) { throw 'G01 empty-panel asset must have opaque outer corners' }
|
||||
} finally {
|
||||
$panel.Dispose()
|
||||
}
|
||||
|
||||
$frame = [System.Drawing.Bitmap]::FromFile($framePath)
|
||||
try {
|
||||
if ($frame.Width -ne 1122 -or $frame.Height -ne 1402) { throw 'G01 transparent empty-panel frame must remain 1122 x 1402px' }
|
||||
foreach ($point in @(@(0, 0), @(1121, 0), @(0, 1401), @(1121, 1401), @(561, 701))) {
|
||||
if ($frame.Width -ne $expectedFrameWidth -or $frame.Height -ne $expectedFrameHeight) {
|
||||
throw 'G01 transparent empty-panel frame no longer matches its schema v3 owner dimensions'
|
||||
}
|
||||
$lastX = $expectedFrameWidth - 1
|
||||
$lastY = $expectedFrameHeight - 1
|
||||
$centerX = [math]::Floor($expectedFrameWidth / 2)
|
||||
$centerY = [math]::Floor($expectedFrameHeight / 2)
|
||||
foreach ($point in @(@(0, 0), @($lastX, 0), @(0, $lastY), @($lastX, $lastY), @($centerX, $centerY))) {
|
||||
if ($frame.GetPixel($point[0], $point[1]).A -ne 0) { throw 'G01 transparent empty-panel frame retains an opaque background pixel' }
|
||||
}
|
||||
$visible = 0
|
||||
|
||||
Reference in New Issue
Block a user