60%
This commit is contained in:
@@ -1,77 +1,36 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$pages = Get-Content -LiteralPath (Join-Path $root 'pages.json') -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||
$activePaths = @($pages.pages | ForEach-Object { "$($_.path).vue" })
|
||||
$moduleConsumers = @()
|
||||
$remoteBusinessOwners = @(
|
||||
'pages/auth/a01-entry.vue',
|
||||
'pages/auth/a04-register.vue',
|
||||
'pages/auth/a05-reset-password.vue',
|
||||
'pages/genealogy/g01-my-genealogies.vue',
|
||||
'pages/genealogy/g05-genealogy-overview.vue',
|
||||
'pages/tree/t01-tree-overview.vue',
|
||||
'pages/tree/t03-member-profile.vue',
|
||||
'pages/tree/t04-add-relative.vue',
|
||||
'pages/tree/t05-edit-member.vue',
|
||||
'pages/tree/t06-edit-relationship.vue',
|
||||
'pages/profile/m04-change-password.vue',
|
||||
'pages/profile/m07-feedback.vue',
|
||||
'pages/profile/m10-about-settings.vue'
|
||||
)
|
||||
|
||||
foreach ($relativePath in $activePaths) {
|
||||
$fullPath = Join-Path $root $relativePath
|
||||
if (-not (Test-Path -LiteralPath $fullPath)) { throw "Missing active page: $relativePath" }
|
||||
$source = Get-Content -LiteralPath $fullPath -Raw -Encoding UTF8
|
||||
if ($source -match '<ModulePage(?:\s|/|>)|import\s+ModulePage\s+from') { $moduleConsumers += $relativePath }
|
||||
$usesRemoteBusiness = $source -match '@/utils/api\.js|\bappApi\b'
|
||||
if ($usesRemoteBusiness -and $relativePath -notin $remoteBusinessOwners) {
|
||||
throw "$relativePath must remain local-design only until its own tested interface batch"
|
||||
if ($source -match '<ModulePage(?:\s|/|>)|import\s+ModulePage\s+from') {
|
||||
throw "Active page must own its business content instead of ModulePage: $relativePath"
|
||||
}
|
||||
if (-not $usesRemoteBusiness -and $relativePath -in $remoteBusinessOwners) {
|
||||
throw "$relativePath lost its owned remote business interface"
|
||||
if ($source -match 'uni\.(showToast|showModal|showLoading|showActionSheet)') {
|
||||
throw "$relativePath must use project feedback components"
|
||||
}
|
||||
if ($source -match 'uni\.(showToast|showModal|showLoading|showActionSheet)') { throw "$relativePath must use project feedback components" }
|
||||
}
|
||||
|
||||
if ($moduleConsumers.Count -gt 0) {
|
||||
throw "Active pages must own business content instead of ModulePage: $($moduleConsumers -join ', ')"
|
||||
$recordContracts = [ordered]@{
|
||||
'pages/records/r03-gift-list.vue' = @('appApi.getRelativeRecords', 'appApi')
|
||||
'pages/records/r04-gift-editor.vue' = @('appApi.createRelativeRecord', 'pickAndUploadImage')
|
||||
'pages/records/r05-ritual-list.vue' = @('appApi.getCeremonies', 'appApi')
|
||||
'pages/records/r06-ritual-detail.vue' = @('appApi.getCeremonyDetail', 'appApi')
|
||||
'pages/records/r07-ritual-editor.vue' = @('appApi.createCeremony', 'appApi')
|
||||
'pages/records/r08-growth-journal.vue' = @('appApi.getGrowthRecords', 'appApi.createGrowthRecord')
|
||||
'pages/records/r10-memo-list.vue' = @('appApi.getMemos', 'appApi.createMemo')
|
||||
'pages/records/r11-merit-records.vue' = @('appApi.getMeritRecords', 'appApi.createMeritRecord')
|
||||
}
|
||||
|
||||
$contracts = [ordered]@{
|
||||
'pages/family/f03-feed-detail.vue' = @('feedComments', 'commentDraft', 'submitComment', 'feed-state--expired')
|
||||
'pages/family/f04-article-list.vue' = @('articleCategories', 'filteredArticles', 'openArticle', 'createArticle')
|
||||
'pages/family/f05-article-detail.vue' = @('articleParagraphs', 'disabled label=', 'article-state--expired', 'backToArticles')
|
||||
'pages/family/f07-album-list.vue' = @('albums', 'openAlbum', 'createAlbum', 'album-state--empty')
|
||||
'pages/records/r03-gift-list.vue' = @('relativeRecords', 'openRelative', 'createRelativePreview', 'relative-state--empty')
|
||||
'pages/records/r04-gift-editor.vue' = @('relativeForm', 'validateRelative', 'localRelativePreview', 'relativeId')
|
||||
'pages/records/r05-ritual-list.vue' = @('ceremonies', 'openCeremony', 'createCeremonyPreview', 'ceremony-state--empty')
|
||||
'pages/records/r06-ritual-detail.vue' = @('ceremonyDetail', 'invitees', 'editCeremony', 'ceremony-state--expired')
|
||||
'pages/records/r07-ritual-editor.vue' = @('ceremonyForm', 'validateCeremony', 'localCeremonyPreview', 'ceremonyId')
|
||||
'pages/records/r08-growth-journal.vue' = @('growthRecords', 'recordGrowth', 'localGrowthPreview', 'timeline-state--empty')
|
||||
'pages/records/r09-life-events.vue' = @('人生事件接口尚未开放', 'serviceState', 'requestBack')
|
||||
'pages/records/r10-memo-list.vue' = @('memos', 'createMemoPreview', 'localMemoPreview', 'memo-state--empty')
|
||||
'pages/records/r11-merit-records.vue' = @('meritRecords', 'createMeritPreview', 'localMeritPreview', 'totalContribution')
|
||||
'pages/notification/n02-message-detail.vue' = @('findNotificationFixture', 'noticeDetail.unread', 'markAsRead', 'openNoticeTarget', 'notice-state--expired')
|
||||
'pages/profile/m02-edit-profile.vue' = @('profileForm', 'chooseAvatar', 'validateProfile', 'saveProfile')
|
||||
'pages/profile/m03-security-settings.vue' = @('securityItems', 'openSecurityItem', 'device-state--limited', 'currentUser.phone', 'checkSecurity')
|
||||
'pages/profile/m04-change-password.vue' = @('passwordForm', 'validatePassword', 'togglePassword', 'savePassword')
|
||||
'pages/profile/m05-change-phone.vue' = @('phoneForm', 'sendCode', 'validatePhone', 'phone-state--saving', 'savePhone')
|
||||
'pages/profile/m06-help-center.vue' = @('helpCategories', 'filteredQuestions', 'toggleQuestion', 'contactSupport')
|
||||
'pages/profile/m07-feedback.vue' = @('feedbackForm', 'feedbackTypes', 'validateFeedback', 'submitFeedback')
|
||||
'pages/profile/m08-promotion.vue' = @('inviteState', 'openInviteExplanation', 'explanationVisible', 'share-state--unavailable')
|
||||
'pages/profile/m09-vip-orders.vue' = @('serviceBenefits', 'orderState', 'order-state--unavailable', 'openServiceNotice')
|
||||
'pages/profile/m10-about-settings.vue' = @('agreementItems', 'openAgreement', 'confirmLogout', 'appVersion')
|
||||
}
|
||||
|
||||
foreach ($entry in $contracts.GetEnumerator()) {
|
||||
foreach ($entry in $recordContracts.GetEnumerator()) {
|
||||
$source = Get-Content -LiteralPath (Join-Path $root $entry.Key) -Raw -Encoding UTF8
|
||||
foreach ($token in $entry.Value) {
|
||||
if (-not $source.Contains($token)) { throw "$($entry.Key) missing page-owned contract: $token" }
|
||||
}
|
||||
foreach ($shared in @('ModulePageBackground', 'PageHeader')) {
|
||||
if (-not $source.Contains($shared)) { throw "$($entry.Key) must consume shared visual primitive: $shared" }
|
||||
if (-not $source.Contains($token)) { throw "$($entry.Key) missing active interface owner: $token" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user