mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* feat(windows): a per-user Setup.exe installer for the managed layout * feat(release): build, test, and publish Setup.exe installers and the GitHub download mirror * fix(onboarding): name the tray on Windows and the background service on Linux; keep Apps & Features on the updated version * feat(site): one site with a platform-aware download section; retire hex.kitlangton.com * feat(site): prerender the page, add robots, sitemap, llms.txt, JSON-LD, and favicon.ico
16 lines
806 B
TypeScript
16 lines
806 B
TypeScript
// Puts the server-rendered Mac page into dist/index.html, so the copy and the
|
|
// download button are in the HTML before JavaScript runs; main.tsx hydrates it.
|
|
// Also stamps the release version into the JSON-LD.
|
|
import { readFileSync, rmSync, writeFileSync } from "node:fs"
|
|
import { render } from "../dist-server/prerender.js"
|
|
import { MAC_VERSION } from "../src/release"
|
|
|
|
const path = new URL("../dist/index.html", import.meta.url)
|
|
const html = readFileSync(path, "utf8")
|
|
const marker = '<div id="root"></div>'
|
|
if (!html.includes(marker)) throw new Error(`dist/index.html has no ${marker}`)
|
|
writeFileSync(
|
|
path,
|
|
html.replace(marker, `<div id="root">${render()}</div>`).replaceAll("__HEX_VERSION__", MAC_VERSION),
|
|
)
|
|
rmSync(new URL("../dist-server", import.meta.url), { recursive: true, force: true })
|