Skip to content

refactor: add shared nuxt build runner, move builds to ts scripts, centralize redirects generation#49

Merged
toddeTV merged 3 commits into
mainfrom
refactor/nuxt-build-pipeline
May 23, 2026
Merged

refactor: add shared nuxt build runner, move builds to ts scripts, centralize redirects generation#49
toddeTV merged 3 commits into
mainfrom
refactor/nuxt-build-pipeline

Conversation

@toddeTV
Copy link
Copy Markdown
Owner

@toddeTV toddeTV commented May 23, 2026

Summary by CodeRabbit

  • Chores
    • Refactored build system infrastructure to use modularized scripts for improved maintainability and consistency.
    • Separated redirect generation and validation into dedicated build steps for better automation.

Review Change Stack

@toddeTV toddeTV self-assigned this May 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8649a973-3803-4518-b0ad-21b51e7fca05

📥 Commits

Reviewing files that changed from the base of the PR and between 97a74b9 and 07f5b22.

📒 Files selected for processing (5)
  • package.json
  • scripts/build-ssg.ts
  • scripts/build-ssr-cloudflare.ts
  • scripts/build-ssr.ts
  • scripts/utils/run-nuxt-build.ts

📝 Walkthrough

Walkthrough

The PR refactors build script invocation by extracting inline Nuxt commands from package.json into dedicated TypeScript entry scripts (build-ssg.ts, build-ssr.ts, build-ssr-cloudflare.ts) and introduces a shared utility module to compose build environments with metadata, execute commands via vp, and validate Cloudflare presets. Redirect script workflows are also reorganized into separate redirects:generate and redirects:check scripts.

Changes

Build Script Refactoring

Layer / File(s) Summary
Build environment and command execution utilities
scripts/utils/run-nuxt-build.ts
Exports createBuildEnv to compose build metadata and NODE_OPTIONS, runVpCommand to execute vp commands via execFileSync, runNuxtBuild to run Nuxt build/generate, runRedirectArtifactGeneration to orchestrate redirect scripts, and resolveCloudflareNitroPreset to validate and normalize Cloudflare presets.
Build entry point scripts
scripts/build-ssg.ts, scripts/build-ssr.ts, scripts/build-ssr-cloudflare.ts
Three TypeScript entry points that import and invoke shared utilities: build-ssg.ts runs SSG generation then redirect artifacts; build-ssr.ts runs SSR build; build-ssr-cloudflare.ts resolves and injects Cloudflare Nitro preset before building.
Package.json script configuration
package.json
Build scripts (build:ssg, build:ssr, build:ssr:cloudflare) delegate to the new TypeScript entry points via vp dlx tsx@4.21.0; new redirects:generate and redirects:check scripts run redirect tools; test:redirects now chains the redirect scripts via vp run.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • toddeTV/todde.tv#39: Introduces generate-redirects.ts and establishes redirect artifact checking workflow that this PR now wires into dedicated redirects:generate and redirects:check scripts.
  • toddeTV/todde.tv#48: Updates scripts/generate-redirects.ts and redirect-related npm script usage, directly overlapping with this PR's refactoring of the redirect workflow.
  • toddeTV/todde.tv#29: Modifies SSG/SSR build script wiring in package.json, addressing similar build command invocation patterns that this PR refactors further.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the three main changes: adding a shared Nuxt build runner, moving builds to TypeScript scripts, and centralizing redirects generation. It accurately reflects the core refactoring objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@toddeTV toddeTV merged commit bf787fe into main May 23, 2026
6 checks passed
@toddeTV toddeTV deleted the refactor/nuxt-build-pipeline branch May 23, 2026 15:14
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