@rayburst/cli 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -415,6 +415,9 @@ function createConfigBasedEdges(sourceNode, targetFilePaths, nodeMap, edges, edg
|
|
|
415
415
|
for (const targetFilePath of targetFilePaths) {
|
|
416
416
|
const targetNodes = findNodesInFile(targetFilePath, nodeMap);
|
|
417
417
|
for (const targetNode of targetNodes) {
|
|
418
|
+
if (targetNode.type !== "component") {
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
418
421
|
if (sourceNode.id === targetNode.id) {
|
|
419
422
|
continue;
|
|
420
423
|
}
|
|
@@ -494,31 +497,38 @@ function traceConfigToComponentPaths(configObject, propertyName, projectPath, pr
|
|
|
494
497
|
if (propertyNode.getKind() === SyntaxKind.ShorthandPropertyAssignment) {
|
|
495
498
|
console.log(`[DEBUG traceConfigToComponentPaths] Shorthand property found, tracing identifier`);
|
|
496
499
|
const identifier = propertyNode.getChildrenOfKind(SyntaxKind.Identifier)[0];
|
|
500
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Identifier: ${identifier ? identifier.getText() : "NULL"}`);
|
|
497
501
|
if (identifier) {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
console.log(`[DEBUG traceConfigToComponentPaths] Found
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
502
|
+
const sourceFile = identifier.getSourceFile();
|
|
503
|
+
const identifierName = identifier.getText();
|
|
504
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Looking for import of: ${identifierName}`);
|
|
505
|
+
const importDecls = sourceFile.getImportDeclarations();
|
|
506
|
+
for (const importDecl of importDecls) {
|
|
507
|
+
const namedImports = importDecl.getNamedImports();
|
|
508
|
+
for (const namedImport of namedImports) {
|
|
509
|
+
if (namedImport.getName() === identifierName) {
|
|
510
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found import for ${identifierName}!`);
|
|
511
|
+
const importedSourceFile = getImportSourceFile(importDecl);
|
|
512
|
+
if (importedSourceFile) {
|
|
513
|
+
const filePath = importedSourceFile.getFilePath();
|
|
514
|
+
const relativePath = filePath.replace(projectPath + "/", "");
|
|
515
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found routeTree file: ${relativePath}`);
|
|
516
|
+
const routeFilePaths = extractComponentPathsFromImports(importedSourceFile, projectPath);
|
|
517
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found ${routeFilePaths.length} route files`);
|
|
518
|
+
const allComponentPaths = [];
|
|
519
|
+
for (const routePath of routeFilePaths) {
|
|
520
|
+
const routeSourceFile = project.getSourceFile(projectPath + "/" + routePath);
|
|
521
|
+
if (!routeSourceFile) {
|
|
522
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Could not load route file: ${routePath}`);
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Extracting components from route: ${routePath}`);
|
|
526
|
+
const componentPaths = extractComponentsFromRouteFile(routeSourceFile, projectPath);
|
|
527
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found ${componentPaths.length} components in ${routePath}`);
|
|
528
|
+
allComponentPaths.push(...componentPaths);
|
|
515
529
|
}
|
|
516
|
-
|
|
517
|
-
const componentPaths = extractComponentsFromRouteFile(routeSourceFile, projectPath);
|
|
518
|
-
console.log(`[DEBUG traceConfigToComponentPaths] Found ${componentPaths.length} components in ${routePath}`);
|
|
519
|
-
allComponentPaths.push(...componentPaths);
|
|
530
|
+
return [...routeFilePaths, ...allComponentPaths];
|
|
520
531
|
}
|
|
521
|
-
return [...routeFilePaths, ...allComponentPaths];
|
|
522
532
|
}
|
|
523
533
|
}
|
|
524
534
|
}
|
package/dist/index.js
CHANGED
package/dist/vite-plugin.js
CHANGED