76 lines
2.9 KiB
PowerShell
76 lines
2.9 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
function Assert-Contains {
|
|
param([string]$Content, [string]$Expected, [string]$Message)
|
|
if ($Content -notmatch [regex]::Escape($Expected)) { throw $Message }
|
|
}
|
|
|
|
function Assert-NoCssSurface {
|
|
param([string]$Content, [string]$ClassName)
|
|
foreach ($property in @('border', 'background', 'border-radius')) {
|
|
if ($Content -match "(?s)\\.$ClassName\\s*\\{[^}]*\\b$property\\s*:") {
|
|
throw "G11-G12 must not construct .$ClassName with CSS $property"
|
|
}
|
|
}
|
|
}
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$g11 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g11-genealogy-settings.vue') -Raw -Encoding utf8
|
|
$g12 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g12-generation-poems.vue') -Raw -Encoding utf8
|
|
$catalog = Get-Content -LiteralPath (Join-Path $root 'data/page-catalog.js') -Raw -Encoding utf8
|
|
|
|
foreach ($page in @($g11, $g12)) {
|
|
if ($page -match '<ModulePage') { throw 'G11-G12 must not retain the generic ModulePage shell' }
|
|
Assert-Contains $page 'page-paper.jpg' 'G11-G12 must use the accepted genealogy paper background'
|
|
Assert-Contains $page 'g03-create-flow-panel.png' 'G11-G12 forms must reuse the complete genealogy paper panel'
|
|
if ($page -match "@/utils/api\.js|\bappApi\b") { throw 'G11-G12 design phase must not connect the API layer' }
|
|
}
|
|
|
|
foreach ($required in @(
|
|
"const settingsState = ref('loading')",
|
|
'settings-state--form',
|
|
'settings-state--success',
|
|
'settings-state--error',
|
|
'settings-state--no-permission',
|
|
'const nameError = ref',
|
|
'class="settings-feedback"',
|
|
'g06-search-input-wide.png',
|
|
'a01-primary-button.png',
|
|
'const genealogyDraft',
|
|
'query.genealogyId',
|
|
"'MEMBER_ONLY'",
|
|
"'PUBLIC_APPLY'"
|
|
)) { Assert-Contains $g11 $required "Missing G11 settings contract: $required" }
|
|
|
|
foreach ($required in @(
|
|
"const poemState = ref('loading')",
|
|
'poem-state--list',
|
|
'poem-state--empty',
|
|
'poem-state--edit',
|
|
'poem-state--error',
|
|
'poem-state--no-permission',
|
|
'const poemError = ref',
|
|
'class="poem-feedback"',
|
|
'g06-search-input-wide.png',
|
|
'a01-primary-button.png',
|
|
'a01-secondary-button.png',
|
|
'const poemRows',
|
|
'stopMissingOldGeneration',
|
|
'query.genealogyId'
|
|
)) { Assert-Contains $g12 $required "Missing G12 generation-poem contract: $required" }
|
|
|
|
foreach ($page in @($g11, $g12)) {
|
|
foreach ($nativeUi in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) {
|
|
if ($page -match [regex]::Escape($nativeUi)) { throw "G11-G12 must not use native UniApp UI: $nativeUi" }
|
|
}
|
|
}
|
|
|
|
foreach ($className in @('settings-panel', 'settings-action', 'poem-row', 'poem-editor', 'poem-action')) {
|
|
foreach ($page in @($g11, $g12)) { Assert-NoCssSurface $page $className }
|
|
}
|
|
|
|
foreach ($entry in @('g11:', 'g12:')) {
|
|
if ($catalog -match [regex]::Escape($entry)) { throw "Page catalog must remove migrated generic entry: $entry" }
|
|
}
|
|
Write-Output 'G11-G12-SETTINGS-POEMS-CONTRACT PASS'
|