@@ -223,17 +223,13 @@ function formatHierarchy(hierarchy, prefix = "", isLast = true) {
223
223
}
224
224
225
225
/**
226
- * Formats a component hierarchy as a markdown list, showing only complete paths
226
+ * Formats a component hierarchy as a list, showing complete paths grouped by location
227
227
* @param {Object } hierarchy - Component hierarchy object
228
228
* @param {string } parentPath - Current path in the component tree
229
229
* @param {Object|null } firstUsageLocation - Location where the first child component uses the target
230
- * @returns {string } Formatted markdown list
230
+ * @returns {string } Formatted list
231
231
*/
232
- function getMarkdownList (
233
- hierarchy ,
234
- parentPath = "" ,
235
- firstUsageLocation = null
236
- ) {
232
+ function getList ( hierarchy , parentPath = "" , firstUsageLocation = null ) {
237
233
let result = "" ;
238
234
const pathsByLocation = new Map ( ) ;
239
235
let totalPaths = 0 ; // Add counter for verification
@@ -418,7 +414,7 @@ async function main() {
418
414
let output = "" ;
419
415
if ( viewResponse . viewList ) {
420
416
if ( viewResponse . format === "markdown" ) {
421
- output = getMarkdownList ( hierarchy ) ;
417
+ output = getList ( hierarchy ) ;
422
418
console . log ( "\nComponent Usage List:" ) ;
423
419
} else {
424
420
output = formatHierarchy ( hierarchy ) ;
@@ -455,4 +451,4 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
455
451
main ( ) ;
456
452
}
457
453
458
- export { analyze , formatHierarchy , getMarkdownList } ;
454
+ export { analyze , formatHierarchy , getList } ;
0 commit comments