Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coderabbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ reviews:
ESLint configured.
No runtime env vars. Legal page data (address, VAT ID) is injected via `NUXT_PUBLIC_LEGAL_*` env vars at build time through GitHub Variables.
Env var naming convention: GitHub Actions Variables and Secrets must be named exactly the same as in `.env.example`. The `env:` block in the workflow maps them into the build environment via `${{ vars.VAR_NAME }}` / `${{ secrets.SECRET_NAME }}`.
Static site generation (SSG) via `pnpm generate`. Hosted on Cloudflare Pages (static). Deployed via GitHub Actions on every push to `main` and on a twice-weekly scheduled cron.
Static site generation (SSG) via `pnpm run build:ssg`. Hosted on Cloudflare Pages (static). Deployed via GitHub Actions on every push to `main` and on a twice-weekly scheduled cron.

### SSG constraint (CRITICAL)
This project uses static site generation only. No SSR runtime exists in production.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: pnpm i --frozen-lockfile --prefer-offline

- name: Generate static site
run: pnpm generate
run: pnpm run build:ssg
env:
NUXT_PUBLIC_LEGAL_ADDRESS_STREET: ${{ vars.NUXT_PUBLIC_LEGAL_ADDRESS_STREET }}
NUXT_PUBLIC_LEGAL_ADDRESS_CITY: ${{ vars.NUXT_PUBLIC_LEGAL_ADDRESS_CITY }}
Expand Down
12 changes: 10 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,18 @@ export default defineNuxtConfig({
/**
* Validate that all required legal env vars are set and non-empty.
* Prevents building a site with broken/incomplete legal pages.
* Only runs during `nuxt build` / `nuxt generate` - skipped during
* Only runs during `pnpm run build:ssr` / `pnpm run build:ssg` - skipped during
* `nuxt prepare` (postinstall), `nuxt dev`, and `nuxt typecheck`.
*
* Detection uses `npm_lifecycle_event` (set by the package manager to the
* script name, e.g. `build:ssg`) with a fallback to Nuxt CLI subcommands
* in `process.argv` for direct `nuxt build` / `nuxt generate` invocations.
*/
const isBuildOrGenerate = process.argv.some(a => a === 'build' || a === 'generate')
const lifecycle = process.env.npm_lifecycle_event
const isBuildOrGenerate
= lifecycle === 'build:ssr'
|| lifecycle === 'build:ssg'
|| process.argv.some(a => a === 'build' || a === 'generate')
if (!isBuildOrGenerate) return
Comment thread
coderabbitai[bot] marked this conversation as resolved.

const required = [
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@
"pnpm": "10.x"
},
"scripts": {
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 nuxt build",
"build:ssg": "cross-env NODE_OPTIONS=--max-old-space-size=8192 nuxt generate",
"build:ssr": "cross-env NODE_OPTIONS=--max-old-space-size=8192 nuxt build",
"dev": "nuxt dev",
"dev:preset": "nuxt dev --port 3000 --public",
"fix:lint": "run-s \"test:lint --fix\"",
"generate": "cross-env NODE_OPTIONS=--max-old-space-size=8192 nuxt generate",
"nuxi": "nuxi",
"nuxt": "nuxt",
"prepare": "nuxt prepare",
"preview": "nuxt preview",
"preview:ssg": "pnpm exec serve .output/public",
"preview:ssr": "nuxt preview",
"reset": "rimraf node_modules .nuxt .output dist .data",
"test": "run-s test:*",
"test:lint": "eslint .",
Expand Down Expand Up @@ -86,6 +87,7 @@
"nuxi": "~3.33.1",
"prettier": "~3.8.1",
"rimraf": "~6.1.3",
"serve": "~14.2.6",
"tailwindcss": "~4.2.1",
"typescript": "~5.9.3",
"vue-tsc": "~3.2.5",
Expand Down
Loading