diff --git a/site/README.md b/site/README.md index 572f365..a4c7cd4 100644 --- a/site/README.md +++ b/site/README.md @@ -61,8 +61,15 @@ project from the `jeremymcs/patchdeck` repository and set: ### One thing to change after the domain is set -The canonical URL currently points at `https://patchdeck.vercel.app/`. Once the -real domain is attached, update it in three places: +The canonical URL points at `https://patchdeck-eta.vercel.app/`, the alias Vercel +assigned this project. + +> Do not "correct" this to `patchdeck.vercel.app`. That hostname is taken by an +> unrelated project ("PatchDeck — Visual Network Designer") and is not ours; +> pointing the canonical, OG image or sitemap at it would hand our SEO and link +> previews to a stranger's site. + +Once a real domain is attached, update it in three places: - `index.html` — ``, the `og:url` / `og:image` / `twitter:image` meta tags, and the `url` field in the JSON-LD block diff --git a/site/build.mjs b/site/build.mjs index cd4147d..835082c 100644 --- a/site/build.mjs +++ b/site/build.mjs @@ -47,10 +47,26 @@ fs.rmSync(DIST, { recursive: true, force: true }); copyStatic(); if (watch) { + // Build the stylesheet once up front. dist/ was just cleared, and the watcher + // below may take a moment (or fail) to produce it — without this the page + // serves with a 404 on styles.css. + const initial = spawnSync(tailwindBin, cssArgs, { stdio: "inherit" }); + if (initial.status !== 0) process.exit(initial.status ?? 1); + fs.watch(path.join(ROOT, "index.html"), () => copyStatic()); fs.watch(PUBLIC, { recursive: true }, () => copyStatic()); - spawn(tailwindBin, [...cssArgs, "--watch"], { stdio: "inherit" }); - console.log("watching — dist/ is live"); + + // stdin must be an open pipe we never write to or close. The Tailwind CLI + // watcher shuts down the moment stdin reaches EOF, which is what both + // "inherit" (when detached) and "ignore" (/dev/null) hand it immediately. + const watcher = spawn(tailwindBin, [...cssArgs, "--watch"], { + stdio: ["pipe", "inherit", "inherit"], + }); + watcher.on("exit", (code) => { + console.error(`tailwind --watch exited (${code}); css is no longer rebuilding`); + }); + + console.log("watching — dist/ is live on the files it has built"); } else { const result = spawnSync(tailwindBin, [...cssArgs, "--minify"], { stdio: "inherit" }); if (result.status !== 0) process.exit(result.status ?? 1); diff --git a/site/index.html b/site/index.html index 343e589..44b71c3 100644 --- a/site/index.html +++ b/site/index.html @@ -9,22 +9,22 @@