From 44bbfe15dbce69b25bdad59e1f35f9dacbe851fe Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 8 Jul 2026 20:35:07 -0700 Subject: [PATCH] Fix Starlight site CI: sed, esbuild/sharp builds, direct astro bin. Nixery lacked sed (pnpm's .bin/astro shim) and pnpm 10 ignored dependency install scripts; call astro via node and allow esbuild/sharp. Document that Tangled Sites must be Saved before the pages branch is live. Co-authored-by: Cursor --- .tangled/workflows/site.yml | 5 +++++ site/package.json | 13 ++++++++----- tools/site-build.sh | 6 +++++- wiki/log/DEVLOG.md | 11 +++++++++++ wiki/process/workflows.md | 13 +++++++++++-- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.tangled/workflows/site.yml b/.tangled/workflows/site.yml index 1b00fd5..cd1c126 100644 --- a/.tangled/workflows/site.yml +++ b/.tangled/workflows/site.yml @@ -26,6 +26,11 @@ dependencies: - git - bash - coreutils + # pnpm's node_modules/.bin/astro shim shells out to sed. + - gnused + # sharp's install script needs these for the prebuilt binary path. + - gnutar + - gzip steps: - name: "site build (Starlight)" diff --git a/site/package.json b/site/package.json index f6a82e9..24373ad 100644 --- a/site/package.json +++ b/site/package.json @@ -5,12 +5,15 @@ "private": true, "scripts": { "sync": "node scripts/sync-wiki.mjs", - "dev": "node scripts/sync-wiki.mjs && SITE_BASE=/ astro dev", + "dev": "node scripts/sync-wiki.mjs && SITE_BASE=/ node ./node_modules/astro/bin/astro.mjs dev", "start": "pnpm dev", - "build": "node scripts/sync-wiki.mjs && astro build", - "build:local": "node scripts/sync-wiki.mjs && SITE_BASE=/ astro build", - "preview": "astro preview", - "astro": "astro" + "build": "node scripts/sync-wiki.mjs && node ./node_modules/astro/bin/astro.mjs build", + "build:local": "node scripts/sync-wiki.mjs && SITE_BASE=/ node ./node_modules/astro/bin/astro.mjs build", + "preview": "node ./node_modules/astro/bin/astro.mjs preview", + "astro": "node ./node_modules/astro/bin/astro.mjs" + }, + "pnpm": { + "onlyBuiltDependencies": ["esbuild", "sharp"] }, "dependencies": { "@astrojs/starlight": "^0.41.3", diff --git a/tools/site-build.sh b/tools/site-build.sh index 7a435d5..0a4a598 100755 --- a/tools/site-build.sh +++ b/tools/site-build.sh @@ -20,10 +20,14 @@ cd "$SITE" if [ ! -d node_modules ]; then echo "site-build: installing dependencies..." + # pnpm 10 ignores dependency build scripts unless listed in + # package.json pnpm.onlyBuiltDependencies (esbuild, sharp). pnpm install --frozen-lockfile fi echo "site-build: syncing wiki + building (base=${SITE_BASE:-/misaligned})..." -pnpm build +# Call the build script via pnpm; package.json invokes astro through +# node directly so the .bin shim (which needs sed) is not required. +pnpm run build echo "site-build: OK → $SITE/dist" diff --git a/wiki/log/DEVLOG.md b/wiki/log/DEVLOG.md index d78dd20..51a41d7 100644 --- a/wiki/log/DEVLOG.md +++ b/wiki/log/DEVLOG.md @@ -5,6 +5,17 @@ Type: log ``` Reverse chronological implementation notes. Keep this factual: what changed, why, checks, and spec impact. +## 2026-07-08 - Starlight site CI: sed + pnpm build scripts + +- Intent: `.tangled/workflows/site.yml` failed — pnpm's `astro` shim + needs `sed`, and pnpm 10 ignored `esbuild`/`sharp` install scripts. +- Changed: nixery deps `gnused`/`gnutar`/`gzip`; package.json invokes + `node ./node_modules/astro/bin/astro.mjs` and lists + `pnpm.onlyBuiltDependencies`; workflows.md clarifies Sites Save is + required (pushing `pages` alone leaves `cameron.tngl.io/misaligned/` + as plain Not Found). +- Checks: `pnpm --dir site run build`. + ## 2026-07-08 - Tangled Starlight wiki site - Intent: public wiki on Tangled Sites from an orphan `pages` branch; diff --git a/wiki/process/workflows.md b/wiki/process/workflows.md index 2a7282b..918ca44 100644 --- a/wiki/process/workflows.md +++ b/wiki/process/workflows.md @@ -40,14 +40,23 @@ pnpm --dir site dev # sync wiki + local preview (base=/) ./tools/site-deploy.sh # build, then force-push orphan pages branch ``` -Tangled Sites config (Settings → Sites on the repo): +Tangled Sites config (Settings → Sites on the repo) — **required**; +pushing `pages` alone does not publish. Until this is saved, Tangled's +edge returns plain `Not Found` at `cameron.tngl.io/misaligned/` even +though `origin/pages` has a valid `index.html`: - Branch: `pages` - Deploy directory: `/` (the orphan branch root is `index.html`) - Site type: sub-path (served as `/misaligned`) +After Save, check **Recent Deploys** on that settings page — a successful +deploy copies the branch into Tangled's object store. Re-save or push +`pages` again if the deploy list is empty. + `site/astro.config.mjs` sets `base: '/misaligned'` to match Tangled's -sub-path hosting. Local `pnpm --dir site dev` overrides with `SITE_BASE=/`. +sub-path hosting (the edge strips `/misaligned` before looking up files; +Starlight still needs the base so asset URLs are correct). Local +`pnpm --dir site dev` overrides with `SITE_BASE=/`. `.tangled/workflows/site.yml` runs `./tools/site-build.sh` on every push to `main` so the builder stays green. **Publishing `pages` from CI is -- 2.51.2