MCPcopy Create free account
hub / github.com/MigoXLab/coderio / processSingleNode

Function processSingleNode

src/nodes/code/utils.ts:37–59  ·  view source on GitHub ↗
(currentNode: Protocol)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 4

isComponentGeneratedFunction · 0.90
saveComponentGeneratedFunction · 0.90
generateComponentFunction · 0.85
generateFrameFunction · 0.85

Tested by

no test coverage detected