* Create a component node for the .vue file
()
| 90 | * Create a component node for the .vue file |
| 91 | */ |
| 92 | private createComponentNode(): Node { |
| 93 | const lines = this.source.split('\n'); |
| 94 | const fileName = this.filePath.split(/[/\\]/).pop() || this.filePath; |
| 95 | const componentName = fileName.replace(/\.vue$/, ''); |
| 96 | const id = generateNodeId(this.filePath, 'component', componentName, 1); |
| 97 | |
| 98 | const node: Node = { |
| 99 | id, |
| 100 | kind: 'component', |
| 101 | name: componentName, |
| 102 | qualifiedName: `${this.filePath}::${componentName}`, |
| 103 | filePath: this.filePath, |
| 104 | language: 'vue', |
| 105 | startLine: 1, |
| 106 | endLine: lines.length, |
| 107 | startColumn: 0, |
| 108 | endColumn: lines[lines.length - 1]?.length || 0, |
| 109 | isExported: true, // Vue components are always importable |
| 110 | updatedAt: Date.now(), |
| 111 | }; |
| 112 | |
| 113 | this.nodes.push(node); |
| 114 | return node; |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Extract <script> and <script setup> blocks from the Vue source |
no test coverage detected