70 lines
4.7 KiB
PowerShell
70 lines
4.7 KiB
PowerShell
$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/profile/m07-feedback.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 (-not $usesRemoteBusiness -and $relativePath -in $remoteBusinessOwners) {
|
|
throw "$relativePath lost its owned authentication interface"
|
|
}
|
|
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 ', ')"
|
|
}
|
|
|
|
$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()) {
|
|
$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" }
|
|
}
|
|
}
|
|
|
|
Write-Output 'ACTIVE-PAGE-BUSINESS-OWNERSHIP-CONTRACT PASS'
|