Skip to content

refactor: rename build & preview scripts to separate SSR and SSG#29

Merged
toddeTV merged 3 commits into
mainfrom
refactor/rename-build-script
Mar 9, 2026
Merged

refactor: rename build & preview scripts to separate SSR and SSG#29
toddeTV merged 3 commits into
mainfrom
refactor/rename-build-script

Conversation

@toddeTV
Copy link
Copy Markdown
Owner

@toddeTV toddeTV commented Mar 9, 2026

This PR refactors the package.json scripts to provide a clearer distinction between Static Site Generation (SSG) and Server-Side Rendering (SSR) build processes.

Summary by CodeRabbit

  • Chores

    • Restructured build and preview scripts to separate static site generation and server-side rendering flows; added dedicated SSG/SSR commands and a local serve dev tool.
    • Updated CI/CD workflow to invoke the new SSG build command.
  • Documentation

    • Expanded lifecycle detection and fallback comments in build configuration to cover additional build lifecycle events.

@toddeTV toddeTV self-assigned this Mar 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 511ae536-0cb8-4185-bbb9-49c19f8950e2

📥 Commits

Reviewing files that changed from the base of the PR and between 6f11fa6 and 6f8aa22.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (2)
  • nuxt.config.ts
  • package.json

📝 Walkthrough

Walkthrough

Build and preview scripts were split into explicit SSG and SSR variants; CI/workflow and Nuxt config were updated to use and detect the new script names and lifecycle events.

Changes

Cohort / File(s) Summary
CI / Workflow
.coderabbit.yml, .github/workflows/build-deploy.yml
SSG invocation changed from pnpm generate (or pnpm run generate) to pnpm run build:ssg. No other workflow steps altered.
Nuxt runtime detection
nuxt.config.ts
Build-time validation updated to detect npm_lifecycle_event values build:ssg and build:ssr (in addition to prior values) with an argv fallback for direct nuxt build/nuxt generate invocations.
Package scripts & deps
package.json
Replaced monolithic build/generate and preview scripts with build:ssg, build:ssr, preview:ssg, preview:ssr. Added serve to devDependencies. Removed the old build, generate, and preview entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: renaming build and preview scripts to distinguish between SSR and SSG paths, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@nuxt.config.ts`:
- Around line 168-172: The current guard uses process.argv to set
isBuildOrGenerate which misses Nuxt subprocess CLI names and skips legal env
validation during real builds; update the detection to use
process.env.npm_lifecycle_event (checking for 'build:ssr' or 'build:ssg') or
alternatively detect Nuxt subcommands directly (e.g., look for 'build' or
'generate' in process.argv) so the guard around the NUXT_PUBLIC_LEGAL_*
validation runs during actual production builds; modify the isBuildOrGenerate
assignment accordingly and keep the existing early return behavior.

In `@package.json`:
- Line 57: The "preview:ssg" npm script currently calls "npx serve
.output/public", which bypasses pnpm and the lockfile; change the script named
"preview:ssg" in package.json to invoke the pinned binary via pnpm (e.g., "pnpm
exec serve .output/public") and add "serve" as a devDependency (with a specific
version) in package.json so the preview uses the repo's locked dependency set
and remains reproducible.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4998c820-4bb1-4b2d-bea7-43015ee88e50

📥 Commits

Reviewing files that changed from the base of the PR and between 83f77ec and 6f11fa6.

📒 Files selected for processing (4)
  • .coderabbit.yml
  • .github/workflows/build-deploy.yml
  • nuxt.config.ts
  • package.json

Comment thread nuxt.config.ts
Comment thread package.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant