Skip to content

Commit d52787e

Browse files
flippeltclaude
andauthored
chore: remove redundant demo build (dist-demo) (#3)
Each public repo's main dist now serves as its own demo, so the separate demo build is gone: drop the build:demo script, the CI 'Build (demo)' step, and the IS_DEMO/--mode demo machinery in codex.ts. The demo:true content flag is kept — the private repo (contracodex) uses it to hide the shared demo campaigns; getCampaigns now simply filters !demo. No behavior change (contracodex still builds only its non-demo campaigns). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d61ab51 commit d52787e

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
run: npm run check
2222
- name: Build (main)
2323
run: npm run build
24-
- name: Build (demo)
25-
run: npm run build:demo
2624
- name: Smoke — assert key files generated
2725
run: |
2826
test -f dist/index.html || (echo "missing dist/index.html"; exit 1)

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"dev": "astro dev",
88
"build": "astro build",
9-
"build:demo": "astro build --mode demo --outDir dist-demo",
109
"check": "astro check",
1110
"preview": "astro preview",
1211
"astro": "astro",

‎src/content.config.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ const campaigns = defineCollection({
2121
cover: z.string().optional(),
2222
coverArt: image().optional(),
2323
order: z.number().default(0),
24-
// Include this campaign in the public demo build (GitHub Pages). Your
25-
// private campaigns stay off the demo unless you opt them in.
24+
// Marks a campaign as a shared demo/showcase campaign. demo:true hides it
25+
// from the build — used by the private repo (contracodex) to keep the
26+
// demo campaigns off its site. This public repo leaves its own campaigns
27+
// unflagged, so its main build IS the public demo.
2628
demo: z.boolean().default(false)
2729
})
2830
})

‎src/lib/codex.ts‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,15 @@ export function entryHref(entry: Entry) {
5252

5353
const visible = (e: Entry) => import.meta.env.DEV || !e.data.draft
5454

55-
// The Pages build runs with `--mode demo`: it publishes ONLY the campaigns
56-
// opted in with `demo: true`. The main build (Netlify) is the inverse — it
57-
// publishes everything EXCEPT the demo campaigns, so the two deploys show
58-
// disjoint sets and the demo campaigns never appear on the main site.
59-
export const IS_DEMO = import.meta.env.MODE === 'demo'
60-
55+
// Campaigns flagged `demo: true` are hidden from the build. This repo's own
56+
// build IS the public showcase (its campaigns aren't flagged, so they show);
57+
// the private repo (contracodex) flags the shared demo campaigns so only its
58+
// real content appears. There's no separate demo build anymore — the main
59+
// dist of each public repo serves as its demo.
6160
export async function getCampaigns(): Promise<Campaign[]> {
6261
const all = await getCollection('campaigns')
6362
return all
64-
.filter((c) => (IS_DEMO ? c.data.demo : !c.data.demo))
63+
.filter((c) => !c.data.demo)
6564
.sort((a, b) => a.data.order - b.data.order || a.data.name.localeCompare(b.data.name))
6665
}
6766

0 commit comments

Comments
 (0)