@@ -81,29 +81,6 @@ export class Codebase {
8181 return entries . length
8282 }
8383
84- /**
85- * The main function to process the files in the codebase. The function works in the following
86- * steps:
87- *
88- * 1. Process the files in parallel of size `batchSize` and gather all the nodes in the `nodes` object.
89- * 2. After gathering all the nodes from the files, it's not guranteed that they can't be more than
90- * `batchSize` nodes. So, we need to split the nodes into batches of `batchSize` nodes separately.
91- * 3. Repeat Step 1 and Step 2 for all the files.
92- *
93- * @returns Promise<void>
94- */
95- async process ( ) : Promise < void > {
96- // console.log("🕒 Preparing Nodes\n")
97-
98- let nodesProcessed = 0
99- for ( const [ index , batch ] of this . _batches . entries ( ) ) {
100- const [ start , end ] = batch
101- nodesProcessed += await this . processFilesBatch ( index , start , end )
102- }
103-
104- // console.log(`✅ Prepared ${nodesProcessed} nodes`)
105- }
106-
10784 private async processFilesBatch (
10885 batchNumber : number ,
10986 start : number ,
@@ -143,4 +120,27 @@ export class Codebase {
143120
144121 return nNodesProcessed
145122 }
123+
124+ /**
125+ * The main function to process the files in the codebase. The function works in the following
126+ * steps:
127+ *
128+ * 1. Process the files in parallel of size `batchSize` and gather all the nodes in the `nodes` object.
129+ * 2. After gathering all the nodes from the files, it's not guranteed that they can't be more than
130+ * `batchSize` nodes. So, we need to split the nodes into batches of `batchSize` nodes separately.
131+ * 3. Repeat Step 1 and Step 2 for all the files.
132+ *
133+ * @returns Promise<void>
134+ */
135+ async process ( ) : Promise < void > {
136+ // console.log("🕒 Preparing Nodes\n")
137+
138+ let nodesProcessed = 0
139+ for ( const [ index , batch ] of this . _batches . entries ( ) ) {
140+ const [ start , end ] = batch
141+ nodesProcessed += await this . processFilesBatch ( index , start , end )
142+ }
143+
144+ // console.log(`✅ Prepared ${nodesProcessed} nodes`)
145+ }
146146}
0 commit comments