41 lines
1.9 KiB
PowerShell
41 lines
1.9 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$sources = @{
|
|
F01 = Get-Content -Raw -Encoding UTF8 -LiteralPath (Join-Path $root 'pages/family/f01-family-feed.vue')
|
|
F02 = Get-Content -Raw -Encoding UTF8 -LiteralPath (Join-Path $root 'pages/family/f02-publish-feed.vue')
|
|
F03 = Get-Content -Raw -Encoding UTF8 -LiteralPath (Join-Path $root 'pages/family/f03-feed-detail.vue')
|
|
}
|
|
$issues = New-Object System.Collections.Generic.List[string]
|
|
|
|
function Require-Text {
|
|
param([string]$Source, [string]$Text, [string]$Description)
|
|
if (-not $Source.Contains($Text)) { $script:issues.Add($Description) }
|
|
}
|
|
|
|
Require-Text $sources.F01 'feed-source-note' 'F01 must visibly identify its local feed preview'
|
|
Require-Text $sources.F01 'listFamilyFeedFixtures' 'F01 must use the explicit local feed preview owner'
|
|
Require-Text $sources.F01 '尚未读取或提交服务端动态' 'F01 must not present fixtures as server data'
|
|
Require-Text $sources.F02 '生成本地预览' 'F02 must not present a local draft as published'
|
|
Require-Text $sources.F02 '尚未提交服务器' 'F02 must disclose that publishing is unavailable'
|
|
Require-Text $sources.F03 'feed-source-note' 'F03 must visibly identify its local detail preview'
|
|
Require-Text $sources.F03 'findFamilyFeedFixture' 'F03 must use the explicit local detail preview owner'
|
|
Require-Text $sources.F03 '不会提交服务器' 'F03 must disclose that comments are not submitted'
|
|
|
|
foreach ($entry in $sources.GetEnumerator()) {
|
|
if ($entry.Value -match 'appApi\.(getFeeds|getFeed|createFeed)') {
|
|
$issues.Add("$($entry.Key) must not wire a generic feed DTO as a page contract")
|
|
}
|
|
if ($entry.Value -match 'uni\.request\(') {
|
|
$issues.Add("$($entry.Key) must not bypass the shared API owner")
|
|
}
|
|
}
|
|
|
|
if ($issues.Count -gt 0) {
|
|
Write-Output 'FAMILY-FEED-READ-OPENAPI-CONTRACT FAIL'
|
|
foreach ($issue in $issues) { Write-Output "- $issue" }
|
|
exit 1
|
|
}
|
|
|
|
Write-Output 'FAMILY-FEED-READ-OPENAPI-CONTRACT PASS'
|