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

Method extract

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

* Extract from Vue source

()

Source from the content-addressed store, hash-verified

52 * Extract from Vue source
53 */
54 extract(): ExtractionResult {
55 const startTime = Date.now();
56
57 try {
58 // Create component node for the .vue file itself
59 const componentNode = this.createComponentNode();
60
61 // Extract and process script blocks
62 const scriptBlocks = this.extractScriptBlocks();
63
64 for (const block of scriptBlocks) {
65 this.processScriptBlock(block, componentNode.id);
66 }
67
68 // Extract component usages from the <template> (<ComponentName>).
69 // Without this, a Vue component used only in another component's
70 // markup (incl. through a barrel import) is invisible to callers /
71 // impact (#629 follow-up).
72 this.extractTemplateComponents(componentNode.id);
73 } catch (error) {
74 this.errors.push({
75 message: `Vue extraction error: ${error instanceof Error ? error.message : String(error)}`,
76 severity: 'error',
77 });
78 }
79
80 return {
81 nodes: this.nodes,
82 edges: this.edges,
83 unresolvedReferences: this.unresolvedReferences,
84 errors: this.errors,
85 durationMs: Date.now() - startTime,
86 };
87 }
88
89 /**
90 * Create a component node for the .vue file

Callers

nothing calls this directly

Calls 4

createComponentNodeMethod · 0.95
extractScriptBlocksMethod · 0.95
processScriptBlockMethod · 0.95

Tested by

no test coverage detected