* Create a component node for the .vue file
()
| 100 | * Create a component node for the .vue file |
| 101 | */ |
| 102 | private createComponentNode(): Node { |
| 103 | const lines = this.source.split('\n'); |
| 104 | const fileName = this.filePath.split(/[/\\]/).pop() || this.filePath; |
| 105 | const componentName = fileName.replace(/\.vue$/, ''); |
| 106 | const id = generateNodeId(this.filePath, 'component', componentName, 1); |
| 107 | |
| 108 | const node: Node = { |
| 109 | id, |
| 110 | kind: 'component', |
| 111 | name: componentName, |
| 112 | qualifiedName: `${this.filePath}::${componentName}`, |
| 113 | filePath: this.filePath, |
| 114 | language: 'vue', |
| 115 | startLine: 1, |
| 116 | endLine: lines.length, |
| 117 | startColumn: 0, |
| 118 | endColumn: lines[lines.length - 1]?.length || 0, |
| 119 | isExported: true, // Vue components are always importable |
| 120 | updatedAt: Date.now(), |
| 121 | }; |
| 122 | |
| 123 | this.nodes.push(node); |
| 124 | return node; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Method nodes for an Options API component's members (see |
no test coverage detected