(currentNode: Protocol)
| 35 | let skippedCount = 0; |
| 36 | |
| 37 | const processSingleNode = async (currentNode: Protocol) => { |
| 38 | const componentName = currentNode.data.name || currentNode.data.componentName || 'UnknownComponent'; |
| 39 | const nodeId = currentNode.id; |
| 40 | |
| 41 | // Check if component is already generated |
| 42 | if (isComponentGenerated(cache, nodeId)) { |
| 43 | skippedCount++; |
| 44 | logger.printInfoLog(`[${processedCount + skippedCount}/${total}] ⏭️ Skipping (cached): ${componentName}`); |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | const progressInfo = `[${++processedCount + skippedCount}/${total}]`; |
| 49 | |
| 50 | const isLeaf = !currentNode.children?.length; |
| 51 | if (isLeaf) { |
| 52 | await generateComponent(currentNode, state, assetFilesList, progressInfo); |
| 53 | } else { |
| 54 | await generateFrame(currentNode, state, assetFilesList, progressInfo); |
| 55 | } |
| 56 | |
| 57 | // Mark component as generated and save immediately to prevent cache loss on interruption |
| 58 | saveComponentGenerated(cache, nodeId, state.workspace); |
| 59 | }; |
| 60 | |
| 61 | // Process nodes with concurrency control |
| 62 | await promisePool(flatNodes, processSingleNode); |
nothing calls this directly
no test coverage detected