@rayburst/cli 0.3.0 → 0.3.1
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.
|
@@ -491,6 +491,39 @@ function traceConfigToComponentPaths(configObject, propertyName, projectPath, pr
|
|
|
491
491
|
if (!propertyNode) {
|
|
492
492
|
return [];
|
|
493
493
|
}
|
|
494
|
+
if (propertyNode.getKind() === SyntaxKind.ShorthandPropertyAssignment) {
|
|
495
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Shorthand property found, tracing identifier`);
|
|
496
|
+
const identifier = propertyNode.getChildrenOfKind(SyntaxKind.Identifier)[0];
|
|
497
|
+
if (identifier) {
|
|
498
|
+
const declaration = traceIdentifierToDeclaration(identifier);
|
|
499
|
+
if (declaration) {
|
|
500
|
+
const importDecl = declaration.getFirstAncestorByKind(SyntaxKind.ImportDeclaration);
|
|
501
|
+
if (importDecl) {
|
|
502
|
+
const sourceFile = getImportSourceFile(importDecl);
|
|
503
|
+
if (sourceFile) {
|
|
504
|
+
const filePath = sourceFile.getFilePath();
|
|
505
|
+
const relativePath = filePath.replace(projectPath + "/", "");
|
|
506
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found routeTree file: ${relativePath}`);
|
|
507
|
+
const routeFilePaths = extractComponentPathsFromImports(sourceFile, projectPath);
|
|
508
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found ${routeFilePaths.length} route files`);
|
|
509
|
+
const allComponentPaths = [];
|
|
510
|
+
for (const routePath of routeFilePaths) {
|
|
511
|
+
const routeSourceFile = project.getSourceFile(projectPath + "/" + routePath);
|
|
512
|
+
if (!routeSourceFile) {
|
|
513
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Could not load route file: ${routePath}`);
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Extracting components from route: ${routePath}`);
|
|
517
|
+
const componentPaths = extractComponentsFromRouteFile(routeSourceFile, projectPath);
|
|
518
|
+
console.log(`[DEBUG traceConfigToComponentPaths] Found ${componentPaths.length} components in ${routePath}`);
|
|
519
|
+
allComponentPaths.push(...componentPaths);
|
|
520
|
+
}
|
|
521
|
+
return [...routeFilePaths, ...allComponentPaths];
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
494
527
|
if (isImportDeclaration(propertyNode)) {
|
|
495
528
|
const sourceFile = getImportSourceFile(propertyNode);
|
|
496
529
|
if (sourceFile) {
|
package/dist/index.js
CHANGED
package/dist/vite-plugin.js
CHANGED