@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
- const parentName = containingFunc.getName?.() || containingFunc.getParent()?.asKind(SyntaxKind.VariableDeclaration)?.getName() || null;
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
@@ -9,7 +9,7 @@ import {
9
9
  readLocalMeta,
10
10
  writeLocalAnalysis,
11
11
  writeLocalMeta
12
- } from "./chunk-JMVBDG54.js";
12
+ } from "./chunk-K4NZXXX4.js";
13
13
  export {
14
14
  addGitignoreEntry,
15
15
  analyzeProject,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rayburstPlugin
3
- } from "./chunk-JMVBDG54.js";
3
+ } from "./chunk-K4NZXXX4.js";
4
4
  export {
5
5
  rayburstPlugin
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayburst/cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Rayburst - Automatic code analysis for TypeScript/JavaScript projects via Vite plugin",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",