* Create a file node for the Liquid template
()
| 80 | * Create a file node for the Liquid template |
| 81 | */ |
| 82 | private createFileNode(): Node { |
| 83 | const lines = this.source.split('\n'); |
| 84 | const id = generateNodeId(this.filePath, 'file', this.filePath, 1); |
| 85 | |
| 86 | const fileNode: Node = { |
| 87 | id, |
| 88 | kind: 'file', |
| 89 | name: this.filePath.split('/').pop() || this.filePath, |
| 90 | qualifiedName: this.filePath, |
| 91 | filePath: this.filePath, |
| 92 | language: 'liquid', |
| 93 | startLine: 1, |
| 94 | endLine: lines.length, |
| 95 | startColumn: 0, |
| 96 | endColumn: lines[lines.length - 1]?.length || 0, |
| 97 | updatedAt: Date.now(), |
| 98 | }; |
| 99 | |
| 100 | this.nodes.push(fileNode); |
| 101 | return fileNode; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Shopify OS 2.0 JSON template / section group. Both have a `sections` object |
no test coverage detected