* Extract from Vue source
()
| 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 |
nothing calls this directly
no test coverage detected