Spaces:
Paused
Paused
File size: 2,093 Bytes
5a81b95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Remove Mock Data Script
# This script identifies and helps remove mock data from the codebase
Write-Host "🔍 Scanning for mock data and functions..." -ForegroundColor Yellow
$mockFiles = @()
# Search for mock-related code
$patterns = @(
"mock",
"Mock",
"MOCK",
"placeholder",
"TODO.*mock",
"For now.*mock"
)
foreach ($pattern in $patterns) {
$results = Get-ChildItem -Path "apps\backend\src" -Recurse -Include *.ts, *.tsx -Exclude *.test.ts, *.spec.ts |
Select-String -Pattern $pattern -CaseSensitive:$false
foreach ($result in $results) {
$mockFiles += [PSCustomObject]@{
File = $result.Filename
Path = $result.Path
Line = $result.LineNumber
Content = $result.Line.Trim()
}
}
}
# Display results
Write-Host "`n📋 Found $($mockFiles.Count) potential mock references:" -ForegroundColor Cyan
$mockFiles | Group-Object -Property File | ForEach-Object {
Write-Host "`n📄 $($_.Name) ($($_.Count) occurrences)" -ForegroundColor Yellow
$_.Group | ForEach-Object {
Write-Host " Line $($_.Line): $($_.Content)" -ForegroundColor Gray
}
}
# Critical files to review
$criticalFiles = @(
"apps\backend\src\mcp\cognitive\MultiModalProcessor.ts",
"apps\backend\src\services\llm\llmService.ts",
"apps\backend\src\services\docgen\MCPPowerPointBackend.ts",
"apps\backend\src\services\agent\agentController.ts",
"apps\backend\src\mcp\toolHandlers.ts"
)
Write-Host "`n⚠️ CRITICAL FILES TO REVIEW:" -ForegroundColor Red
foreach ($file in $criticalFiles) {
if (Test-Path $file) {
Write-Host " - $file" -ForegroundColor Yellow
}
}
Write-Host "`n✅ Next Steps:" -ForegroundColor Green
Write-Host "1. Review each file listed above"
Write-Host "2. Replace mock functions with real implementations"
Write-Host "3. Remove placeholder comments"
Write-Host "4. Test thoroughly after changes"
Write-Host "5. Run: npm test"
Write-Host "`n💡 Tip: Use 'git diff' to review changes before committing" -ForegroundColor Cyan
|