| 395 | } |
| 396 | |
| 397 | export async function buildHermesWrapper() { |
| 398 | const dist = path.join(dashboardRoot, "hermes-wrapper/dist"); |
| 399 | await fs.mkdir(dist, { recursive: true }); |
| 400 | await fs.copyFile(path.join(dashboardRoot, "hermes-wrapper/src/entry.js"), path.join(dist, "index.js")); |
| 401 | await fs.copyFile(path.join(dashboardRoot, "holographic/dist/index.js"), path.join(dist, "holographic.js")); |
| 402 | await fs.copyFile(path.join(dashboardRoot, "lcm/dist/index.js"), path.join(dist, "lcm.js")); |
| 403 | await fs.copyFile(path.join(dashboardRoot, "graph/dist/index.js"), path.join(dist, "graph.js")); |
| 404 | await fs.copyFile(path.join(dashboardRoot, "savings/dist/index.js"), path.join(dist, "savings.js")); |
| 405 | const css = await Promise.all([ |
| 406 | fs.readFile(path.join(dashboardRoot, "hermes-wrapper/src/wrapper.css"), "utf8"), |
| 407 | fs.readFile(path.join(dashboardRoot, "holographic/dist/style.css"), "utf8"), |
| 408 | fs.readFile(path.join(dashboardRoot, "lcm/dist/style.css"), "utf8"), |
| 409 | fs.readFile(path.join(dashboardRoot, "graph/dist/style.css"), "utf8"), |
| 410 | fs.readFile(path.join(dashboardRoot, "savings/dist/style.css"), "utf8"), |
| 411 | ]); |
| 412 | await fs.writeFile(path.join(dist, "style.css"), css.join("\n"), "utf8"); |
| 413 | } |
| 414 | |
| 415 | function fnvHashBytes(hash, bytes) { |
| 416 | for (const byte of bytes) { |