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