Conversation
|
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 You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 80-82: Update the axios dependency in package.json from "axios":
"^1.13.4" to at least "axios": "^1.13.5" to remediate CVE-2026-25639; run your
package manager (npm/yarn/pnpm) to reinstall and then run tests to catch
behavioral changes introduced in v1.13.3 (notably AxiosError becoming a native
Error and silentJSONParsing behavior) and adjust any error handling/parsing in
code paths that rely on axios if tests surface regressions.
In `@src/cli.ts`:
- Around line 932-934: The RegExp construction using `base` in the
`isIndexRegExp` assignment can misbehave if `base` (derived from `templateName`)
contains regex metacharacters; update the code that builds `isIndexRegExp` to
escape `base` before interpolating it (e.g., add a helper like `escapeRegExp`
and use it when creating `isIndexRegExp`), so `initLoadPPData(isIndexRegExp, mi,
{...})` gets a safe pattern; locate the `isIndexRegExp` declaration and replace
direct use of `base` with the escaped version and add the small escape helper
function near related CLI initialization code.
- Around line 534-538: Update the thrown Error message that begins with "Next.js
is required but not available..." so the version constraint matches the package
peer dependency; change the text "This package requires Next.js >=13 <16 as a
peer dependency." to "This package requires Next.js >=13 <17 as a peer
dependency." in the throw new Error(...) statement in src/cli.ts.
In `@src/plugins/client-injection-plugin.ts`:
- Around line 95-100: The ESM branch sets DIRNAME incorrectly by wrapping
fileURLToPath(new URL(".", import.meta.url)) with path.dirname, which moves up
one directory; update the ESM branch in src/plugins/client-injection-plugin.ts
so DIRNAME is assigned directly to fileURLToPath(new URL(".", import.meta.url))
(referencing the DIRNAME variable, import.meta.url and fileURLToPath usage)
instead of calling path.dirname around it to ensure the resolved directory
matches the templates location.
In `@tests/test-nextjs-cjs/package.json`:
- Around line 12-16: Update the package.json dependency pins for react and
react-dom to satisfy Next 16 peer requirements: change the "react" and
"react-dom" entries from "^18" to "^18.2.0" so they are compatible with the
existing "next": "^16.1.6" dependency; edit the dependencies object and replace
the "react" and "react-dom" version strings accordingly.
In `@tests/test-nextjs/package.json`:
- Around line 27-31: Update the React and ReactDOM dependency versions in
package.json to match Next.js 16's peer dependency minimums: replace the loose
"react": "^18" and add/replace "react-dom": "^18" (if present) with explicit
"react": "^18.2.0" and "react-dom": "^18.2.0" so they align with Next.js (refer
to the "react" and "react-dom" entries alongside "next" in the dependencies
block).
In `@tests/test-nextjs/tsconfig.json`:
- Around line 31-42: The tsconfig.json currently lists "dist/types/**/*.ts" and
"dist/dev/types/**/*.ts" in "include" but also excludes "dist", which overrides
those includes; update the config by either removing "dist" from the "exclude"
array or narrowing the exclude to a more specific pattern (e.g., replace "dist"
with the directories you truly want excluded such as "dist/generated") so that
the included globs ("dist/types/**/*.ts" and "dist/dev/types/**/*.ts") are
actually picked up by TypeScript.
🧹 Nitpick comments (5)
tests/test-nextjs-cjs/next.config.js (1)
1-26: Consider removing the commented-out config block.It adds noise and can drift from the active config.
🧹 Suggested cleanup
-// const { withPPDev } = require('@metricinsights/pp-dev'); - -// /** `@type` {import('next').NextConfig} */ -// const nextConfig = withPPDev({ -// output: 'export', -// cleanDistDir: true, -// reactStrictMode: true, -// distDir: 'dist', -// images: { -// unoptimized: true, -// }, -// assetPrefix: '/pt/next-with-template', -// basePath: '/p/next-with-template', -// experimental: { -// esmExternals: true -// } -// }); - const nextConfig = {src/cli.ts (4)
1034-1086: DuplicategracefulShutdownfunctions with overlapping responsibility.There are two
gracefulShutdownfunctions: one inside thehttpServer.listen()callback (lines 1034-1086) and another at the outer scope (lines 1186-1220). Both register with process signals, which can lead to double cleanup attempts and confusing shutdown behavior. Consider consolidating into a single shutdown handler.Also applies to: 1186-1220
1088-1148: Inconsistentprocess.onavailability checks.The inner shutdown handler (lines 1088-1148) defensively checks whether
process.onis a function before registering event handlers, but the outer handler registration (lines 1222-1234) does not. Either both should include the defensive check, or the inner one should be removed if the outer registration is always sufficient.Also applies to: 1222-1234
545-550: Complex module access pattern forloadConfig.The fallback chain
importConfig.default.default || importConfig['module.exports'].default || importConfig.defaultis fragile. Consider using optional chaining for safer access.♻️ Suggested improvement
- const loadConfig = - importConfig.default.default || - importConfig['module.exports'].default || - importConfig.default; + const loadConfig = + importConfig.default?.default ?? + (importConfig as any)['module.exports']?.default ?? + importConfig.default;
818-824: Middleware chains declared after they are referenced in the request handler closure.The
fullMiddlewareChainandessentialMiddlewareChainarrays are declared after the HTTP server request handler that references them. While this works because the server doesn't accept connections untillisten()is called (after middleware initialization), hoisting these declarations beforecreateServer()would improve code clarity and prevent future maintenance issues.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@rollup.config.ts`:
- Line 41: Add the missing CJS validation by updating the CI test job that runs
the npm script "test:all" to include the test directories "tests/test-commonjs"
and "tests/test-nextjs-cjs" so CommonJS consumers are exercised; locate the CI
workflow or script that invokes "test:all" (the test pipeline configuration) and
modify it to run or pass these two directories into the test runner (or ensure
they are not excluded from the test:all invocation) so the rollup dual-export
settings (exports: "auto", interop: "compat") are validated by the suite.
In `@src/cli.ts`:
- Around line 1170-1178: The Next.js version in the error output is inconsistent
(some places show next@^16, this block shows next@^15); update the error
messaging in the CLI error-handling block that writes via logger.error (the
lines that print 'Next.js Peer Dependency Error' and the subsequent install
suggestions) to use a single, accurate recommendation matching the peer
dependency (use a generic range such as "next@>=13 <17" or a clear statement
like "Next.js v13–v16") so all messages are consistent; locate the code that
formats these install suggestions around the logger.error calls and replace the
hard-coded version tokens (e.g., next@^15) with the unified range string.
In `@tests/test-nextjs/package.json`:
- Around line 21-40: The package.json currently includes Vite and related
plugins which are incompatible with Next.js 16; remove the "vite" dependency and
any Vite-specific plugins (e.g., "vite-plugin-image-optimizer",
"vite-plugin-zip-pack") from dependencies/devDependencies so the Next.js app
uses its supported bundler, and update "eslint-config-next" to a 16.x compatible
version (e.g., ^16.x) to match "next"@^16.1.6; ensure you run install after
modifying package.json to update lockfiles.
🧹 Nitpick comments (4)
tests/test-nextjs-cjs/package.json (1)
24-25: Version mismatch betweeneslint-config-nextandnext.The
eslint-config-nextis still at version13.5.4whilenexthas been updated to^16.1.6. This version mismatch may cause ESLint rule incompatibilities or miss new linting rules specific to Next.js 16 features.Consider updating to align with the Next.js version:
- "eslint-config-next": "13.5.4", + "eslint-config-next": "^16.1.6",src/cli.ts (3)
821-828: Middleware chains referenced before initialization.The
fullMiddlewareChainandessentialMiddlewareChainarrays are declared at lines 823-828, but they're referenced in the request handler callback starting at line 724. While JavaScript hoistsletdeclarations (making them exist but uninitialized), the callback doesn't execute until after the arrays are populated, so this works at runtime.However, the code structure is confusing because the server is created (line 716) and the request handler references these variables before they're visibly initialized in the code flow.
Consider restructuring to initialize the middleware chains before creating the HTTP server for better readability:
Suggested restructure
Move lines 821-1005 (middleware initialization) to appear before line 716 (createServer call), ensuring the middleware chains are populated before being referenced in the request handler.
1038-1090: Duplicate gracefulShutdown functions with different scopes.There are two
gracefulShutdownfunctions:
- Inner function (lines 1038-1090) defined inside
httpServer.listen()callback with access toopenSocketsandshutdownTimeout- Outer function (lines 1189-1224) defined at the
startNextServeraction levelThe inner function is more comprehensive (handles socket cleanup and timeout), while the outer function is used for the top-level signal handlers at lines 1227-1238.
This works but is confusing. The outer handler will attempt cleanup but won't have access to the socket tracking or timeout logic. Consider consolidating these into a single shutdown mechanism.
Also applies to: 1189-1224
573-574: ShadowedprojectRootvariable.The variable
projectRootis declared at line 505 and then re-declared at line 574 using the same calculation. This shadows the outer variable unnecessarily.Suggested fix
Remove the redundant re-declaration at line 574 since
projectRootis already defined with the same value at line 505:- // Load project root - const projectRoot = root ? join(process.cwd(), root) : process.cwd();
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/test-nextjs-cjs/tsconfig.json (1)
4-28:⚠️ Potential issue | 🟠 MajorRemove
dist/types/**/*.tsanddist/dev/types/**/*.tsfromincludeor adjust theexcludelist.The
excludedirective with"dist"takes precedence and will exclude the paths you've added toincludethat point intodist/. Either remove those specific dist paths frominclude, or changeexcludeto["node_modules"]and explicitly exclude only what you need.The
"jsx": "react-jsx"and"moduleResolution": "bundler"configuration with"module": "commonjs"is compatible and standard for Next.js projects.rollup.config.ts (1)
41-128:⚠️ Potential issue | 🟡 MinorCJS interop setting should clarify practical recommendation, not default.
output.exports: "auto"is indeed the Rollup 4 default for CJS builds. However,output.interop: "compat"is not a default (the default is"default"); it's a practical recommendation for better compatibility with external dependencies when duck-typing default imports. This choice is reasonable, but the comment should note it's a compatibility optimization rather than a Rollup 4 default setting.
🤖 Fix all issues with AI agents
In `@src/cli.ts`:
- Around line 56-79: The watcher’s ignored regex (/((^|[\/\\])\..)/) currently
skips all dotfiles so your .env and .env.* entries in configFiles/watchPatterns
never trigger; update the watcher creation (where watcher is created) to exclude
dotfiles except .env files by changing the ignored option to either a function
that returns false for filenames matching /^\.env(\.|$)/ or to a more specific
pattern that ignores dotfiles but whitelists /^\.env($|\.).*/ — adjust the
ignored value passed to watch(...) (near the configFiles, watchPatterns, watcher
symbols) so .env and its variants are not ignored.
- Around line 536-542: The guard uses isNextAvailable() but forgets to await the
async function, so the condition is ineffective; update the check to await
isNextAvailable() (i.e., if (!(await isNextAvailable())) { ... }) and ensure the
enclosing function (or caller) is async so awaiting is valid; keep the existing
error throw unchanged but perform the await on isNextAvailable() to make the
check work.
In `@tests/test-nextjs/package.json`:
- Around line 21-32: Update the peer ESLint package to match Next.js 16: in
package.json replace the "eslint-config-next" version (currently ^15.4.6) with a
^16.x range (e.g., ^16.1.6) so it aligns with the existing "next": "^16.1.6"
entry and the React/React-DOM peers; also update any linting script that uses
"next lint" to instead invoke the ESLint CLI (e.g., "eslint .") and ensure the
project uses the new flat config file name eslint.config.mjs (or point ESLint to
the correct config) so linting works with Next.js 16 flat config changes.
| const configFiles = [ | ||
| ...PP_DEV_CONFIG_NAMES, | ||
| ...PP_WATCH_CONFIG_NAMES, | ||
| "package.json", | ||
| "next.config.js", | ||
| "next.config.mjs", | ||
| "next.config.ts", | ||
| "vite.config.js", | ||
| "vite.config.mjs", | ||
| "vite.config.ts", | ||
| ".env", | ||
| ".env.local", | ||
| ".env.development", | ||
| ".env.development.local" | ||
| 'package.json', | ||
| 'next.config.js', | ||
| 'next.config.mjs', | ||
| 'next.config.ts', | ||
| 'vite.config.js', | ||
| 'vite.config.mjs', | ||
| 'vite.config.ts', | ||
| '.env', | ||
| '.env.local', | ||
| '.env.development', | ||
| '.env.development.local', | ||
| ]; | ||
|
|
||
| const watchPatterns = configFiles.map(file => path.join(projectRoot, file)); | ||
| const watchPatterns = configFiles.map((file) => path.join(projectRoot, file)); | ||
|
|
||
| const watcher = watch(watchPatterns, { | ||
| ignored: /(^|[\/\\])\../, // ignore dotfiles | ||
| persistent: true, | ||
| ignoreInitial: true, | ||
| followSymlinks: false | ||
| followSymlinks: false, | ||
| }); |
There was a problem hiding this comment.
.env* files won’t be watched due to dotfile ignore rule.
You added .env* to the watch list, but the ignored regex skips dotfiles, so those changes won’t trigger restarts.
🛠️ Suggested fix
- const watcher = watch(watchPatterns, {
- ignored: /(^|[\/\\])\../, // ignore dotfiles
+ const watcher = watch(watchPatterns, {
+ ignored: (filePath) => {
+ const base = path.basename(filePath);
+ return /(^|[\/\\])\../.test(filePath) && !base.startsWith('.env');
+ }, // ignore dotfiles except .env*
persistent: true,
ignoreInitial: true,
followSymlinks: false,
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const configFiles = [ | |
| ...PP_DEV_CONFIG_NAMES, | |
| ...PP_WATCH_CONFIG_NAMES, | |
| "package.json", | |
| "next.config.js", | |
| "next.config.mjs", | |
| "next.config.ts", | |
| "vite.config.js", | |
| "vite.config.mjs", | |
| "vite.config.ts", | |
| ".env", | |
| ".env.local", | |
| ".env.development", | |
| ".env.development.local" | |
| 'package.json', | |
| 'next.config.js', | |
| 'next.config.mjs', | |
| 'next.config.ts', | |
| 'vite.config.js', | |
| 'vite.config.mjs', | |
| 'vite.config.ts', | |
| '.env', | |
| '.env.local', | |
| '.env.development', | |
| '.env.development.local', | |
| ]; | |
| const watchPatterns = configFiles.map(file => path.join(projectRoot, file)); | |
| const watchPatterns = configFiles.map((file) => path.join(projectRoot, file)); | |
| const watcher = watch(watchPatterns, { | |
| ignored: /(^|[\/\\])\../, // ignore dotfiles | |
| persistent: true, | |
| ignoreInitial: true, | |
| followSymlinks: false | |
| followSymlinks: false, | |
| }); | |
| const configFiles = [ | |
| ...PP_DEV_CONFIG_NAMES, | |
| ...PP_WATCH_CONFIG_NAMES, | |
| 'package.json', | |
| 'next.config.js', | |
| 'next.config.mjs', | |
| 'next.config.ts', | |
| 'vite.config.js', | |
| 'vite.config.mjs', | |
| 'vite.config.ts', | |
| '.env', | |
| '.env.local', | |
| '.env.development', | |
| '.env.development.local', | |
| ]; | |
| const watchPatterns = configFiles.map((file) => path.join(projectRoot, file)); | |
| const watcher = watch(watchPatterns, { | |
| ignored: (filePath) => { | |
| const base = path.basename(filePath); | |
| return /(^|[\/\\])\../.test(filePath) && !base.startsWith('.env'); | |
| }, // ignore dotfiles except .env* | |
| persistent: true, | |
| ignoreInitial: true, | |
| followSymlinks: false, | |
| }); |
🤖 Prompt for AI Agents
In `@src/cli.ts` around lines 56 - 79, The watcher’s ignored regex
(/((^|[\/\\])\..)/) currently skips all dotfiles so your .env and .env.* entries
in configFiles/watchPatterns never trigger; update the watcher creation (where
watcher is created) to exclude dotfiles except .env files by changing the
ignored option to either a function that returns false for filenames matching
/^\.env(\.|$)/ or to a more specific pattern that ignores dotfiles but
whitelists /^\.env($|\.).*/ — adjust the ignored value passed to watch(...)
(near the configFiles, watchPatterns, watcher symbols) so .env and its variants
are not ignored.
| "express": "^4.22.1", | ||
| "extract-zip": "^2.0.1", | ||
| "file-type": "^19.6.0", | ||
| "formdata-node": "^6.0.3", | ||
| "http-proxy-middleware": "^3.0.3", | ||
| "isbinaryfile": "^5.0.4", | ||
| "jsdom": "^25.0.1", | ||
| "memory-cache": "^0.2.0", | ||
| "next": "^14.0.3", | ||
| "next": "^16.1.6", | ||
| "picocolors": "^1.1.1", | ||
| "react": "^18", | ||
| "react-dom": "^18", | ||
| "react": "^18.2.0", | ||
| "react-dom": "^18.2.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Next.js 16.1.6 peer dependencies requirements React React-DOM
💡 Result:
For next@16.1.6, the peer dependency requirements are: (app.unpkg.com)
- react:
^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 - react-dom:
^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
Citations:
🌐 Web query:
Express 4.22.1 HTTP server middleware compatibility
💡 Result:
Express 4.22.1 remains compatible with the standard Express/Connect-style HTTP middleware interface: functions shaped like (req, res, next) mounted via app.use(...) (or router.use(...)). Express 4’s middleware pipeline is stable and is designed to work with the broader Node/Connect middleware ecosystem. (expressjs.com)
Key compatibility notes:
- No bundled “Connect” middleware in Express 4 (except
express.static). If you previously relied on old built-ins (body parsing, cookie parsing, sessions, etc.), you must use the standalone middleware packages (e.g.,express.json(),express.urlencoded(),cookie-parser,express-session, etc.). (expressjs.com) - 4.22.1 specifically reverted a breaking change from 4.22.0 involving the extended query parser. So if any middleware or app code behaved differently on 4.22.0 due to that query parsing behavior, 4.22.1 restores the prior behavior. (github.com)
- Node.js support: Express v4.x is documented as supporting Node >= 0.10.0 (Express v5 is where Node <18 support is dropped). (expressjs.com)
Citations:
- 1: https://expressjs.com/en/guide/migrating-4.html?utm_source=openai
- 2: https://expressjs.com/en/guide/migrating-4.html?utm_source=openai
- 3: https://github.com/expressjs/express/releases?utm_source=openai
- 4: https://expressjs.com/en/support?utm_source=openai
🏁 Script executed:
# Check the full context of tests/test-nextjs/package.json to understand line 51 reference
cat -n tests/test-nextjs/package.json | head -60Repository: mi-examples/pp-dev
Length of output: 2051
🌐 Web query:
eslint-config-next version compatibility Next.js 16
💡 Result:
eslint-config-nextis versioned in lockstep withnext(same repo/release train). For Next.js 16, you should useeslint-config-next@^16(or the exact same16.x.yas yournextversion) to avoid peer-dependency/config mismatches. (nextjs.org)- In Next.js 16,
next lintis removed and linting is expected to be run via the ESLint CLI. Next’s ESLint setup now centers around flat config (eslint.config.*) and the Next plugin defaults toward flat-config behavior. (nextjs.org) - Practical install guidance for Next 16:
- Install ESLint + Next config:
pnpm add -D eslint eslint-config-next(or npm/yarn/bun equivalent), then use the documentedeslint.config.mjsapproach. (nextjs.org)
- Install ESLint + Next config:
Citations:
- 1: https://nextjs.org/blog/next-16?utm_source=openai
- 2: https://nextjs.org/docs/app/guides/upgrading/version-16?utm_source=openai
- 3: https://nextjs.org/docs/pages/api-reference/config/eslint?utm_source=openai
Update eslint-config-next to ^16.x to match Next.js 16.1.6.
React (^18.2.0) and React-DOM (^18.2.0) peer dependencies are correct for Next.js 16.1.6. However, eslint-config-next must be versioned in lockstep with next. The current ^15.4.6 will cause peer-dependency and configuration mismatches; upgrade to ^16.1.6 (or latest ^16.x). Additionally, Next.js 16 removed the next lint command and now uses flat config (eslint.config.mjs), so ensure ESLint CLI is used directly for linting.
🤖 Prompt for AI Agents
In `@tests/test-nextjs/package.json` around lines 21 - 32, Update the peer ESLint
package to match Next.js 16: in package.json replace the "eslint-config-next"
version (currently ^15.4.6) with a ^16.x range (e.g., ^16.1.6) so it aligns with
the existing "next": "^16.1.6" entry and the React/React-DOM peers; also update
any linting script that uses "next lint" to instead invoke the ESLint CLI (e.g.,
"eslint .") and ensure the project uses the new flat config file name
eslint.config.mjs (or point ESLint to the correct config) so linting works with
Next.js 16 flat config changes.
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/test-nextjs/package.json (1)
11-11:⚠️ Potential issue | 🟡 MinorThe
next lintcommand was removed in Next.js 16.Next.js 16 removed the built-in
next lintcommand in favor of running ESLint directly via CLI. Update the lint script to use the ESLint CLI instead.Suggested fix
- "lint": "next lint" + "lint": "eslint ."Additionally, ensure you have an
eslint.config.mjs(flat config) file, as Next.js 16's ESLint setup uses flat config by default.
🤖 Fix all issues with AI agents
In `@src/cli.ts`:
- Around line 1235-1247: The file registers process signal handlers twice which
can cause duplicate shutdowns; remove this duplicate block (the
process.on('SIGINT'...), process.on('SIGTERM'...),
process.on('uncaughtException'...), process.on('unhandledRejection'...)
registrations) and rely on the single set of handlers already installed inside
the httpServer.listen callback; keep the gracefulShutdown function calls intact
and ensure only the handlers in the httpServer.listen callback reference
gracefulShutdown and logger to avoid double process.exit() calls.
In `@tests/test-nextjs-cjs/package.json`:
- Around line 24-25: Update the ESLint Next config version to match the
installed Next.js major version: change the "eslint-config-next" entry in
package.json to a caret range compatible with Next v16 (e.g., "^16.x") so it
aligns with "next@^16.1.6" and avoids peer-dependency/configuration mismatches;
ensure the package.json dependency line for "eslint-config-next" reflects the
new version and run install to update lockfile.
In `@tests/test-nextjs-cjs/tsconfig.json`:
- Around line 31-42: The include patterns "dist/types/**/*.ts" and
"dist/dev/types/**/*.ts" are being ignored because the exclude array contains
"dist" which matches everything under dist; either remove "dist" from the
"exclude" array or narrow the exclude so it doesn't filter the type folders
(e.g., replace "dist" with a more specific pattern that excludes build artifacts
but not types), and ensure the tsconfig's "include" and "exclude" arrays are
updated consistently so the "dist/types/**" and "dist/dev/types/**" entries are
actually matched during type-checking.
🧹 Nitpick comments (2)
tests/test-nextjs-cjs/package.json (1)
30-33: Clarify the purpose of vite/esbuild overrides in a Next.js project.Next.js uses Webpack/Turbopack as its bundler, not Vite. These overrides likely exist to satisfy transitive dependencies from
@metricinsights/pp-dev. Consider adding a comment explaining why these overrides are needed to prevent confusion during future maintenance.tests/test-nextjs-cjs/next.config.js (1)
1-17: Consider removing the commented-out code block.Large commented-out code blocks can become stale and reduce readability. If this serves as documentation for how to use
withPPDev, consider either:
- Removing it entirely (git history preserves the old version), or
- Converting it to a brief comment explaining the alternative pattern
Suggested simplification
-// const { withPPDev } = require('@metricinsights/pp-dev'); - -// /** `@type` {import('next').NextConfig} */ -// const nextConfig = withPPDev({ -// output: 'export', -// cleanDistDir: true, -// reactStrictMode: true, -// distDir: 'dist', -// images: { -// unoptimized: true, -// }, -// assetPrefix: '/pt/next-with-template', -// basePath: '/p/next-with-template', -// experimental: { -// esmExternals: true -// } -// }); +// To use pp-dev wrapper, import withPPDev from '@metricinsights/pp-dev' and wrap the config + const nextConfig = {
Summary by CodeRabbit
Release Notes