|
1
|
import fs from "fs/promises" |
|
2
|
import path from "path" |
|
3
|
import { generateHash } from "../utils" |
|
4
|
|
|
5
|
export async function generateCellRendererHash( |
|
6
|
sources: Set<string> |
|
7
|
): Promise<string> { |
|
8
|
const contents: string[] = [] |
|
9
|
|
|
10
|
for (const source of sources) { |
|
11
|
const cellRenderersPath = path.join(source, "cell-renderers.tsx") |
|
12
|
try { |
|
13
|
const content = await fs.readFile(cellRenderersPath, "utf-8") |
|
14
|
contents.push(content) |
|
15
|
} catch { |
|
16
|
// File doesn't exist, skip |
|
17
|
} |
|
18
|
} |
|
19
|
|
|
20
|
const totalContent = contents.join("") |
|
21
|
return generateHash(totalContent) |
|
22
|
} |