完成全项目响应式审核与换机交接
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$activeFiles = @(
|
||||
'pages/genealogy/g01-my-genealogies.vue',
|
||||
'pages/genealogy/g03-create-genealogy.vue',
|
||||
'pages/genealogy/g06-search-genealogies.vue'
|
||||
)
|
||||
|
||||
foreach ($file in $activeFiles) {
|
||||
$source = Get-Content $file -Raw -Encoding UTF8
|
||||
foreach ($forbidden in @('location.hash', 'new URLSearchParams', 'hashchange')) {
|
||||
if ($source.Contains($forbidden)) {
|
||||
throw "$file must not read native route state through $forbidden"
|
||||
}
|
||||
}
|
||||
if ($source -notmatch 'onLoad\s*\(\s*\(?\s*query\b') {
|
||||
throw "$file must consume its native query through onLoad(query)"
|
||||
}
|
||||
}
|
||||
|
||||
$g01 = Get-Content 'pages/genealogy/g01-my-genealogies.vue' -Raw -Encoding UTF8
|
||||
$g03 = Get-Content 'pages/genealogy/g03-create-genealogy.vue' -Raw -Encoding UTF8
|
||||
$g06 = Get-Content 'pages/genealogy/g06-search-genealogies.vue' -Raw -Encoding UTF8
|
||||
|
||||
if ($g01 -notmatch 'query\?\.state') { throw 'G01 must normalize presentation state from onLoad query' }
|
||||
if ($g03 -notmatch 'query\?\.step\s*===\s*"ancestor"') { throw 'G03 must whitelist the ancestor step from onLoad query' }
|
||||
if ($g06 -notmatch 'query\?\.mode\s*===\s*"invite"') { throw 'G06 must whitelist invite mode from onLoad query' }
|
||||
|
||||
Write-Output 'NATIVE-ROUTE-QUERY-CONTRACT PASS'
|
||||
Reference in New Issue
Block a user