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

Method createComponentNode

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

* Create a component node for the .vue file

()

Source from the content-addressed store, hash-verified

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

Callers 1

extractMethod · 0.95

Calls 2

generateNodeIdFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected