修改完成

This commit is contained in:
2026-07-21 07:53:03 +08:00
parent 01d246c47b
commit ff60119277
172 changed files with 7982 additions and 2999 deletions
+50
View File
@@ -0,0 +1,50 @@
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
function Read-Utf8([string]$relativePath) {
return Get-Content -LiteralPath (Join-Path $root $relativePath) -Raw -Encoding UTF8
}
function Assert-Contains([string]$source, [string]$expected, [string]$page) {
if (-not $source.Contains($expected)) { throw "$page missing F business-flow anchor: $expected" }
}
$contracts = [ordered]@{
'pages/family/f03-feed-detail.vue' = @(
'feedComments', 'commentDraft', 'submitComment', 'feed-state--expired',
'feedId', 'comment-state--saving', 'comment-state--error',
'/pages/family/f01-family-feed'
)
'pages/family/f04-article-list.vue' = @(
'articleCategories', 'filteredArticles', 'openArticle', 'createArticle',
'article-list-state--loading', 'article-list-state--empty', 'article-list-state--error',
'/pages/family/f05-article-detail?articleId=', '/pages/family/f06-article-editor?mode=create'
)
'pages/family/f05-article-detail.vue' = @(
'articleParagraphs', 'toggleFavorite', 'article-state--expired', 'backToArticles',
'articleId', 'article-state--privacy', 'article-state--error',
'/pages/family/f04-article-list', '/pages/family/f06-article-editor?mode=edit&articleId='
)
'pages/family/f07-album-list.vue' = @(
'albums', 'openAlbum', 'createAlbum', 'album-state--empty',
'album-list-state--loading', 'album-list-state--error', 'albumNameDraft',
'/pages/family/f08-album-detail?albumId='
)
}
foreach ($entry in $contracts.GetEnumerator()) {
$source = Read-Utf8 $entry.Key
foreach ($anchor in $entry.Value) { Assert-Contains $source $anchor $entry.Key }
foreach ($required in @('ModulePageBackground', 'PageHeader', 'AppButton', 'AppLoading')) {
Assert-Contains $source $required $entry.Key
}
foreach ($forbidden in @('import ModulePage from', 'uni.showToast', 'uni.showModal')) {
if ($source.Contains($forbidden)) { throw "$($entry.Key) retains forbidden implementation: $forbidden" }
}
if ($source -match '<ModulePage(?:\s|/|>)') { throw "$($entry.Key) retains forbidden ModulePage owner" }
if ($source -match '(?im)(?<![-\w])position\s*:') { throw "$($entry.Key) ordinary content must not use position" }
if ($source -match '(?im)overflow\s*:\s*hidden') { throw "$($entry.Key) must not clip data-driven content" }
}
Write-Output 'F-BUSINESS-FLOW-CONTRACT PASS'