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

Method createComponentNode

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

* Create a component node for the .vue file

()

Source from the content-addressed store, hash-verified

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

Callers 1

extractMethod · 0.95

Calls 2

generateNodeIdFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected