开始审核样式
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$pages = Get-Content -LiteralPath (Join-Path $root 'pages.json') -Raw -Encoding utf8 | ConvertFrom-Json
|
||||
$legacyPage = Join-Path $root 'pages/auth/a02-login.vue'
|
||||
|
||||
if ($pages.pages.Count -ne 53) { throw "Expected 53 routes, found $($pages.pages.Count)." }
|
||||
if ($pages.pages.path -contains 'pages/auth/a02-login') { throw 'Legacy A02 route still exists.' }
|
||||
if (Test-Path -LiteralPath $legacyPage) { throw 'Legacy A02 page file still exists.' }
|
||||
|
||||
$ownedFiles = @(
|
||||
'pages/auth/a01-entry.vue',
|
||||
'pages/auth/a04-register.vue',
|
||||
'pages/auth/a05-reset-password.vue',
|
||||
'pages/auth/a06-auth-status.vue',
|
||||
'scripts/capture-chrome-page.js'
|
||||
)
|
||||
foreach ($relativePath in $ownedFiles) {
|
||||
$content = Get-Content -LiteralPath (Join-Path $root $relativePath) -Raw -Encoding utf8
|
||||
if ($content -match '/pages/auth/a02-login') {
|
||||
throw "Legacy A02 navigation remains in $relativePath."
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($returnPage in @('pages/auth/a04-register.vue', 'pages/auth/a05-reset-password.vue', 'pages/auth/a06-auth-status.vue')) {
|
||||
$content = Get-Content -LiteralPath (Join-Path $root $returnPage) -Raw -Encoding utf8
|
||||
if ($content -notmatch [regex]::Escape("url: '/pages/auth/a01-entry'")) {
|
||||
throw "$returnPage must return to A01."
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output 'A02-ROUTE-REMOVAL-CONTRACT PASS'
|
||||
Reference in New Issue
Block a user