Skip to content

Commit 14f6a60

Browse files
authored
Merge pull request #3 from ReactiveBayes/claude/benchmarks-rxinfer-rendering-39T8i
2 parents 86750b6 + 0069e40 commit 14f6a60

7 files changed

Lines changed: 30 additions & 16 deletions

File tree

.github/workflows/pages.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ jobs:
4141
- run: npm run typecheck
4242
- run: npm run test
4343
- run: npm run build
44-
env:
45-
GITHUB_PAGES: "true"
4644
- name: Verify the build is fully static (hard rule)
4745
run: npm run check-static
4846
- uses: actions/configure-pages@v5

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,5 @@ jobs:
107107
- run: npm run typecheck
108108
- run: npm run test
109109
- run: npm run build
110-
env:
111-
GITHUB_PAGES: "true"
112110
- name: Verify the build is fully static (hard rule)
113111
run: npm run check-static

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ frontend-dev: ## Dashboard dev server against local data/ (http://localhost:3000
9393

9494
.PHONY: frontend-build
9595
frontend-build: ## Static export build into frontend/out/
96-
GITHUB_PAGES=true $(NPM) run build
96+
$(NPM) run build
9797

9898
.PHONY: frontend-check-static
9999
frontend-check-static: ## Verify the build is fully static (no dynamic pages)

design/frontend.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ and contains **no server runtime remnants**. Builds that render dynamic pages ar
1616

1717
## Deployment & data loading
1818

19-
- GitHub Pages **project page**`basePath`/`assetPrefix` `/RxInferBenchmarks.jl`, enabled when
20-
`GITHUB_PAGES=true` (CI); local dev stays at `/`. `public/.nojekyll` prevents Jekyll mangling.
19+
- Served from the **custom domain** `https://benchmarks.rxinfer.com`, which maps to the site
20+
**root** (`/`) — *not* a GitHub Pages project page. So **no `basePath`/`assetPrefix`**: assets
21+
and routes resolve from `/` in both local dev and prod. `public/CNAME` (`benchmarks.rxinfer.com`)
22+
pins the domain across deploys and `public/.nojekyll` prevents Jekyll from mangling `_next/`.
23+
`npm run check-static` guards against a project-page basePath regression (which would 404 every
24+
asset on the custom domain and leave the page unstyled).
2125
- **Data is not bundled.** The app fetches JSON at runtime:
2226
- prod: `https://raw.githubusercontent.com/<owner>/RxInferBenchmarks.jl/main/data`
2327
- dev: `/local-data` — a gitignored symlink `frontend/public/local-data → ../../data`,

frontend/next.config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import type { NextConfig } from "next";
22

3-
// GitHub Pages serves this app as a *project page* under /RxInferBenchmarks.jl.
4-
// The base path is enabled only for the Pages build (GITHUB_PAGES=true) so that
5-
// local dev and local static previews stay at /.
6-
const isGitHubPages = process.env.GITHUB_PAGES === "true";
7-
const basePath = "/RxInferBenchmarks.jl";
8-
3+
// The dashboard is served from the custom domain https://benchmarks.rxinfer.com,
4+
// which maps to the site root ("/"). It is therefore NOT a GitHub Pages *project
5+
// page* (those live under /<repo>/), so no basePath/assetPrefix is needed: assets
6+
// and routes resolve from "/" in both local dev and the deployed site.
7+
// `public/CNAME` pins the custom domain across deploys; `public/.nojekyll`
8+
// prevents Jekyll from mangling the `_next/` asset directory.
99
const nextConfig: NextConfig = {
1010
// Hard rule (CLAUDE.md): the build must be fully static. `output: "export"`
1111
// makes `next build` fail on any dynamically rendered page; scripts/check-static.mjs
1212
// additionally verifies the exported artifact.
1313
output: "export",
1414
trailingSlash: true,
1515
images: { unoptimized: true },
16-
...(isGitHubPages ? { basePath, assetPrefix: `${basePath}/` } : {}),
1716
};
1817

1918
export default nextConfig;

frontend/public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
benchmarks.rxinfer.com

frontend/scripts/check-static.mjs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
// this script verifies the exported artifact as a second line of defense:
44
// - out/ exists with the expected entry points
55
// - no server runtime remnants are present in the artifact
6+
// - the custom domain (CNAME) is pinned and assets resolve from the site root
7+
// — no /RxInferBenchmarks.jl/ project-page prefix, which 404s on the custom
8+
// domain and leaves the page unstyled
69
// Exits non-zero when the build is not a pure static export.
7-
import { existsSync, readdirSync, statSync } from "node:fs";
10+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
811
import { resolve, dirname, join } from "node:path";
912
import { fileURLToPath } from "node:url";
1013

@@ -15,11 +18,22 @@ const failures = [];
1518
if (!existsSync(out)) {
1619
fail(`out/ does not exist — run \`npm run build\` first (output: "export" must be set)`);
1720
} else {
18-
for (const required of ["index.html", "404.html", ".nojekyll"]) {
21+
for (const required of ["index.html", "404.html", ".nojekyll", "CNAME"]) {
1922
if (!existsSync(join(out, required))) {
2023
failures.push(`missing required static file: out/${required}`);
2124
}
2225
}
26+
// The site is served from the custom domain at the root. A project-page
27+
// basePath/assetPrefix would point assets at /RxInferBenchmarks.jl/_next/...,
28+
// which 404s on benchmarks.rxinfer.com (page renders without styles/JS).
29+
for (const html of walk(out).filter((f) => f.endsWith(".html"))) {
30+
if (readFileSync(html, "utf8").includes("/RxInferBenchmarks.jl/_next/")) {
31+
failures.push(
32+
`asset references a project-page basePath (/RxInferBenchmarks.jl/_next/) in ${html} — ` +
33+
`the custom domain serves from "/"; remove basePath/assetPrefix in next.config.ts`,
34+
);
35+
}
36+
}
2337
// Server runtime remnants must never appear in a static export.
2438
const forbidden = ["server", "standalone", "cache", "BUILD_ID"].filter((name) =>
2539
existsSync(join(out, name)),

0 commit comments

Comments
 (0)