@rayburst/cli 0.2.7 → 0.2.8
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.
|
@@ -406,7 +406,15 @@ function detectConfigBasedComponents(sourceFile, nodeMap, edges, projectPath) {
|
|
|
406
406
|
for (const jsxElement of jsxElements) {
|
|
407
407
|
const containingFunc = jsxElement.getFirstAncestorByKind(SyntaxKind.FunctionDeclaration) || jsxElement.getFirstAncestorByKind(SyntaxKind.ArrowFunction);
|
|
408
408
|
if (!containingFunc) continue;
|
|
409
|
-
|
|
409
|
+
let parentName = null;
|
|
410
|
+
if (containingFunc.getKind() === SyntaxKind.FunctionDeclaration) {
|
|
411
|
+
parentName = containingFunc.getName?.();
|
|
412
|
+
} else if (containingFunc.getKind() === SyntaxKind.ArrowFunction) {
|
|
413
|
+
const varDecl = containingFunc.getParent();
|
|
414
|
+
if (varDecl && varDecl.getKind() === SyntaxKind.VariableDeclaration) {
|
|
415
|
+
parentName = varDecl.getName?.();
|
|
416
|
+
}
|
|
417
|
+
}
|
|
410
418
|
if (!parentName) continue;
|
|
411
419
|
const sourceNode = Array.from(nodeMap.values()).find((node) => {
|
|
412
420
|
const nodeName = node.id.split("::")[1];
|
package/dist/index.js
CHANGED
package/dist/vite-plugin.js
CHANGED