From 58a08259985ea4c0a9677b59d534bdefc95262be Mon Sep 17 00:00:00 2001 From: connerkup Date: Mon, 15 Jun 2026 21:56:35 -0700 Subject: [PATCH 1/2] Fix Cloudflare Pages build output. Root npm run build now includes the Starlight site; wrangler.toml pins website/dist for Pages. Co-authored-by: Cursor --- package.json | 2 +- website/README.md | 4 +++- wrangler.toml | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 wrangler.toml diff --git a/package.json b/package.json index 3f5a473..725e15e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "website" ], "scripts": { - "build": "npm run build -w @shieldedshell/core && npm run build -w @shieldedshell/cli", + "build": "npm run build -w @shieldedshell/core && npm run build -w @shieldedshell/cli && npm run build -w website", "test": "npm run test -w @shieldedshell/core", "lint": "npm run build", "website:dev": "npm run dev -w website", diff --git a/website/README.md b/website/README.md index d3b924a..c0b38f0 100644 --- a/website/README.md +++ b/website/README.md @@ -22,7 +22,9 @@ Output: `dist/`. ## Deploy -Static site suitable for Vercel, Netlify, Cloudflare Pages, or GitHub Pages. Set build command to `npm run build` and output directory to `dist`. +**Cloudflare Pages (production):** connect the repo root, set build command to `npm run build`, output directory to `website/dist`, and Node 22. `wrangler.toml` pins the output dir; root `npm run build` includes the Starlight site. + +**Other hosts:** use `npm run website:build` and publish `website/dist`. From monorepo root: diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..8979903 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,4 @@ +# Cloudflare Pages — https://developers.cloudflare.com/pages/functions/wrangler-configuration/ +name = "shielded-shell" +compatibility_date = "2026-06-15" +pages_build_output_dir = "./website/dist" From 9d819e4c9f27c6bc21ea46a9f293fdaf4a44f22c Mon Sep 17 00:00:00 2001 From: connerkup Date: Mon, 15 Jun 2026 22:00:30 -0700 Subject: [PATCH 2/2] Use CF_PAGES-aware build script for Cloudflare Pages. Keeps CI package build on Node 20; Cloudflare npm run build emits website/dist when CF_PAGES=1. Co-authored-by: Cursor --- package.json | 2 +- scripts/build.mjs | 11 +++++++++++ website/README.md | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 scripts/build.mjs diff --git a/package.json b/package.json index 725e15e..9879922 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "website" ], "scripts": { - "build": "npm run build -w @shieldedshell/core && npm run build -w @shieldedshell/cli && npm run build -w website", + "build": "node scripts/build.mjs", "test": "npm run test -w @shieldedshell/core", "lint": "npm run build", "website:dev": "npm run dev -w website", diff --git a/scripts/build.mjs b/scripts/build.mjs new file mode 100644 index 0000000..703d2a7 --- /dev/null +++ b/scripts/build.mjs @@ -0,0 +1,11 @@ +import { execSync } from "node:child_process"; + +function run(command) { + execSync(command, { stdio: "inherit", shell: true }); +} + +if (process.env.CF_PAGES === "1") { + run("npm run build -w website"); +} else { + run("npm run build -w @shieldedshell/core && npm run build -w @shieldedshell/cli"); +} diff --git a/website/README.md b/website/README.md index c0b38f0..8d3df1d 100644 --- a/website/README.md +++ b/website/README.md @@ -22,7 +22,7 @@ Output: `dist/`. ## Deploy -**Cloudflare Pages (production):** connect the repo root, set build command to `npm run build`, output directory to `website/dist`, and Node 22. `wrangler.toml` pins the output dir; root `npm run build` includes the Starlight site. +**Cloudflare Pages (production):** connect the repo root. Cloudflare sets `CF_PAGES=1`, so root `npm run build` builds only the Starlight site into `website/dist`. Set output directory to `website/dist` and Node 22. `wrangler.toml` pins the output path. **Other hosts:** use `npm run website:build` and publish `website/dist`.