Fix: Inline deleted JSON components to resolve build errors

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-18 21:58:04 +00:00
parent 56aeb492e6
commit 1bb2eadbe8
9 changed files with 174 additions and 46 deletions

View File

@@ -18,7 +18,6 @@ async function analyzeComponent(category: string, component: string): Promise<vo
// Check if it's pure composition (only uses UI primitives)
const hasBusinessLogic = /useState|useEffect|useCallback|useMemo|useReducer|useRef/.test(content)
const hasComplexLogic = /if\s*\(.*\{|switch\s*\(|for\s*\(|while\s*\(/.test(content)
const hasCustomFunctions = /function\s+\w+\(|const\s+\w+\s*=\s*\([^)]*\)\s*=>/.test(content)
// Extract what it imports
const imports = content.match(/import\s+\{[^}]+\}\s+from\s+['"][^'"]+['"]/g) || []

View File

@@ -38,12 +38,11 @@ const targetComponents = {
atoms: ['Input']
}
async function refactorFile(filePath: string): Promise<boolean> {
export async function refactorFile(filePath: string): Promise<boolean> {
let content = await fs.readFile(filePath, 'utf-8')
let modified = false
// Find all imports to replace
const importLines: string[] = []
const componentsToLoad = new Set<string>()
for (const [category, components] of Object.entries(targetComponents)) {