MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / createComponentNode

Method createComponentNode

src/extraction/vue-extractor.ts:92–115  ·  view source on GitHub ↗

* Create a component node for the .vue file

()

Source from the content-addressed store, hash-verified

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

Callers 1

extractMethod · 0.95

Calls 1

generateNodeIdFunction · 0.90

Tested by

no test coverage detected