Files
danyang-match/scripts/audit-ui-obsolete-files.ps1
T

23 lines
720 B
PowerShell
Raw Permalink Normal View History

2026-09-13 20:15:33 +08:00
param(
[string]$Root = (Resolve-Path "$PSScriptRoot\..")
)
$miniappPages = (Get-Content -Raw -Encoding UTF8 "$Root\miniapp\app.json" | ConvertFrom-Json).pages
$status = git -C $Root status --short
$pairs = Get-ChildItem "$Root\miniapp" -Recurse -Filter *.ts | ForEach-Object {
$js = [IO.Path]::ChangeExtension($_.FullName, '.js')
if (Test-Path -LiteralPath $js) {
[PSCustomObject]@{
TypeScript = $_.FullName.Substring($Root.Length + 1)
JavaScript = $js.Substring($Root.Length + 1)
}
}
}
[PSCustomObject]@{
activePageCount = $miniappPages.Count
activePages = $miniappPages
duplicateSources = $pairs
gitStatus = $status
} | ConvertTo-Json -Depth 5