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