33 lines
1.3 KiB
PowerShell
33 lines
1.3 KiB
PowerShell
$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 52) { throw "Expected 52 active 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'
|