Skip to content

feat: warn when a wrapped Next.js app builds via plain next build - #207

Merged
sergak01 merged 1 commit into
developfrom
feat/next-build-parity
Jul 21, 2026
Merged

feat: warn when a wrapped Next.js app builds via plain next build#207
sergak01 merged 1 commit into
developfrom
feat/next-build-parity

Conversation

@sergak01

Copy link
Copy Markdown
Contributor

🚀 Warn when a withPPDev()-wrapped Next.js app builds via plain next build

Summary

Follow-up to #206: since next build alone still silently skips the VERSION/BUILD-MANIFEST/zip
parity that pp-dev next-build provides, withPPDev() now prints a console warning during the
production build phase whenever it detects it's running under a plain next build rather than
pp-dev next-build.

Key changes

  • 🚀 withPPDev() checks phase === PHASE_PRODUCTION_BUILD and process.env.PP_DEV_NEXT_BUILD;
    when the flag is absent it prints a yellow console warning pointing at pp-dev next-build.
  • 🔧 runNextBuildProcess() sets PP_DEV_NEXT_BUILD=1 on the spawned next build child, so both
    pp-dev next-build and the WS-triggered sync build (DistService) stay silent.
  • 🔧 The next-build and next (dev server) CLI commands also set the flag in their own process
    before calling loadConfig(..., PHASE_PRODUCTION_BUILD, ...) directly — that in-process peek
    (used to resolve the export distDir) runs withPPDev() too and would otherwise print a false
    positive on every pp-dev next dev-server startup.
  • 📊 README: short note on the new warning in the "Next.js Build" section.
  • 🧪 Manually verified: plain next build warns (repeated per Next.js config re-evaluation,
    harmless), pp-dev next-build and pp-dev next (dev server) stay silent.

Testing

  • tsc --noEmit clean
  • ✅ Unit 212/212
  • npm run audit:all — 0 vulnerabilities in root and all three fixtures
  • npm run reinstall:all — all fixtures reinstall cleanly
  • ✅ Manual check in tests/test-nextjs: plain next build → warning printed; pp-dev next-build
    → no warning, VERSION/BUILD-MANIFEST/zip still produced; pp-dev next dev server → no warning

Included commits:

  • be6d4c2 feat: warn when a wrapped Next.js app builds via plain next build

Merge Request: origin/feat/next-build-parityorigin/develop

withPPDev() now checks the Next.js build phase and process.env.PP_DEV_NEXT_BUILD:
during PHASE_PRODUCTION_BUILD without that flag (i.e. `next build` invoked
directly, not through `pp-dev next-build`), it prints a console warning
pointing at `pp-dev next-build` so VERSION/BUILD-MANIFEST/zip parity isn't
silently missed.

runNextBuildProcess() sets PP_DEV_NEXT_BUILD=1 on the spawned `next build`
child, so both `pp-dev next-build` and the WS-triggered sync build stay
silent. The `next-build` and `next` (dev server) CLI commands also set it in
their own process before calling loadConfig(..., PHASE_PRODUCTION_BUILD, ...)
directly, since that in-process config peek runs withPPDev() too and would
otherwise fire a false positive on every `pp-dev next` dev server startup.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 52df7a2f-4561-46be-9e4c-dd25782b93b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/next-build-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sergak01 sergak01 self-assigned this Jul 21, 2026
@sergak01
sergak01 merged commit 326bdc7 into develop Jul 21, 2026
3 checks passed
@sergak01
sergak01 deleted the feat/next-build-parity branch July 21, 2026 07:46
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