feat: warn when a wrapped Next.js app builds via plain next build - #207
Merged
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Warn when a
withPPDev()-wrapped Next.js app builds via plainnext buildSummary
Follow-up to #206: since
next buildalone still silently skips the VERSION/BUILD-MANIFEST/zipparity that
pp-dev next-buildprovides,withPPDev()now prints a console warning during theproduction build phase whenever it detects it's running under a plain
next buildrather thanpp-dev next-build.Key changes
withPPDev()checksphase === PHASE_PRODUCTION_BUILDandprocess.env.PP_DEV_NEXT_BUILD;when the flag is absent it prints a yellow console warning pointing at
pp-dev next-build.runNextBuildProcess()setsPP_DEV_NEXT_BUILD=1on the spawnednext buildchild, so bothpp-dev next-buildand the WS-triggered sync build (DistService) stay silent.next-buildandnext(dev server) CLI commands also set the flag in their own processbefore calling
loadConfig(..., PHASE_PRODUCTION_BUILD, ...)directly — that in-process peek(used to resolve the export
distDir) runswithPPDev()too and would otherwise print a falsepositive on every
pp-dev nextdev-server startup.next buildwarns (repeated per Next.js config re-evaluation,harmless),
pp-dev next-buildandpp-dev next(dev server) stay silent.Testing
tsc --noEmitcleannpm run audit:all— 0 vulnerabilities in root and all three fixturesnpm run reinstall:all— all fixtures reinstall cleanlytests/test-nextjs: plainnext build→ warning printed;pp-dev next-build→ no warning, VERSION/BUILD-MANIFEST/zip still produced;
pp-dev nextdev server → no warningIncluded commits:
be6d4c2feat: warn when a wrapped Next.js app builds via plainnext buildMerge Request:
origin/feat/next-build-parity→origin/develop