42 lines
1.8 KiB
PowerShell
42 lines
1.8 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
|
|
foreach ($relativePath in @('components/ModulePage.vue', 'data/page-catalog.js')) {
|
|
if (Test-Path -LiteralPath (Join-Path $root $relativePath)) {
|
|
throw "退役通用页面入口仍然存在:$relativePath"
|
|
}
|
|
}
|
|
|
|
$productionFiles = @(
|
|
Get-ChildItem -LiteralPath (Join-Path $root 'components'), (Join-Path $root 'pages'), (Join-Path $root 'data'), (Join-Path $root 'utils') -Recurse -File |
|
|
Where-Object { $_.Extension -in @('.vue', '.js') }
|
|
)
|
|
foreach ($file in $productionFiles) {
|
|
$content = [System.IO.File]::ReadAllText($file.FullName, [System.Text.Encoding]::UTF8)
|
|
if ($content -match '\bModulePage\b(?!Background)|\bpageCatalog\b|page-catalog') {
|
|
throw "生产源码重新引用了退役通用页面合同:$($file.FullName.Substring($root.Length + 1))"
|
|
}
|
|
}
|
|
|
|
$profiles = [System.IO.File]::ReadAllText(
|
|
(Join-Path $root 'styles/adaptive-frame-profiles.scss'),
|
|
[System.Text.Encoding]::UTF8
|
|
)
|
|
foreach ($retiredMixin in @('adaptive-module-content', 'adaptive-module-field')) {
|
|
if ($profiles.Contains($retiredMixin)) { throw "退役通用页面 mixin 仍然存在:$retiredMixin" }
|
|
}
|
|
|
|
$manifest = [System.IO.File]::ReadAllText(
|
|
(Join-Path $root 'design-pipeline/manifests/application-runtime-assets.json'),
|
|
[System.Text.Encoding]::UTF8
|
|
)
|
|
foreach ($relativePath in @(
|
|
'static/assets/modules/notification/transparent/module-content-frame.png',
|
|
'static/assets/modules/notification/transparent/module-field-frame.png'
|
|
)) {
|
|
if ($manifest.Contains($relativePath)) { throw "退役通知模块资产仍登记在运行时清单:$relativePath" }
|
|
if (Test-Path -LiteralPath (Join-Path $root $relativePath)) { throw "退役通知模块资产仍存在:$relativePath" }
|
|
}
|
|
|
|
Write-Output 'RETIRED-MODULE-PAGE-CONTRACT PASS'
|