Skip to content

This PR brings develop into main with Next.js 16 support, config watcher improvements, plugin fixes, and test project modernization. - #10

Merged
sergak01 merged 11 commits into
mainfrom
develop
Feb 11, 2026
Merged

This PR brings develop into main with Next.js 16 support, config watcher improvements, plugin fixes, and test project modernization.#10
sergak01 merged 11 commits into
mainfrom
develop

Conversation

@sergak01

@sergak01 sergak01 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Technical Improvements

🚀 New Features

  • CLI: support Next.js 16 and fix base path regex escaping
  • CLI: watch .env, .pp-dev, and .pp-watch config files in config watcher
  • CLI: await Next.js availability check before build
  • Plugin: enhance integrateMiTopBar with selective configuration options

🔧 Fixes

  • Plugin: correct DIRNAME path resolution in client injection
  • Plugin: add null check for integrateMiTopBar validation

🧹 Maintenance & Dependencies

  • Update axios to 1.13.5
  • Add chokidar overrides, remove unused npm dependencies
  • Update test-nextjs and test-nextjs-cjs dependencies (React, Vite, sharp, etc.)
  • Remove Vite and related build dependencies from test-nextjs
  • Update eslint to v9 and eslint-config-next to ^16 in test project

📚 Documentation

  • Update Next.js install hints to ^16 in CLI error messages

🧪 Testing

  • Add tests for integrateMiTopBar object configuration

Commit References

Commit Message
9182d2a feat(cli): support Next.js 16 and fix base path regex escaping
dce83d7 fix(plugin): correct DIRNAME path resolution in client injection
69a07f0 feat(cli): watch .env and pp-dev config files, await Next.js check
cbb9a6c feat(plugin): enhance integrateMiTopBar with selective configuration options
df35e2a fix(plugin): add null check for integrateMiTopBar validation
4e18c6c chore(deps): update axios to 1.13.5
22d84b9 docs(cli): update Next.js install hints to ^16 in error messages
a1113ec chore(test-nextjs): update test project deps and tsconfig
39c39c5 chore(test-nextjs): remove vite and related build dependencies
6187b5e chore(test-nextjs): update eslint to v9 and eslint-config-next to ^16

Breaking Changes / Compatibility

  • Next.js: peer dependency now supports >=13 <17 (Next.js 16 included)
  • ✅ No breaking changes for existing configurations

Summary by CodeRabbit

Release Notes – v0.13.0-beta.2

  • Bug Fixes

    • Fixed plugin path resolution for client injection
    • Fixed base path regex escaping for Next.js 16 compatibility
  • New Features

    • CLI now watches .env and dev config files for changes
    • CLI waits for Next.js check completion before proceeding
  • Chores

    • Extended Next.js support to v16
    • Updated dependencies including axios and peer dependencies
    • Improved internal caching and module initialization logic

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Version bump to 0.13.0-beta.2 with Next.js 16 support (peer dependency widened), CLI enhancements (config watching, path escaping), DIRNAME resolution supporting CJS/ESM contexts, lazy-loading of Vite plugin, defensive storage initialization, and updated test dependencies across multiple packages.

Changes

Cohort / File(s) Summary
Version and Changelog
CHANGELOG.md, package.json
Bumped version to 0.13.0-beta.2, widened Next.js peer dependency to <17, and upgraded axios from ^1.7.8 to ^1.13.5.
Core Module Exports
src/plugin.ts
Added named export for vitePPDev alongside existing default export.
Lazy Loading and Import Strategy
src/index.ts
Converted combined value+type import to type-only import for NormalizedVitePPDevOptions, and moved plugin instantiation inside getViteConfig via dynamic import for deferred loading.
Logger Defensive Initialization
src/lib/logger.ts
Added guard to reinitialize in-module storage cache if falsy or missing required methods before use.
Plugin DIRNAME Resolution
src/plugins/client-injection-plugin.ts
Enhanced DIRNAME memoization with CJS/ESM fallback chain (__filenameimport.meta.urlprocess.cwd()); added explicit cache type declarations.
CLI Refactoring and Enhancements
src/cli.ts
Extensive refactoring: quote style conversions, config watcher improvements (selective file ignoring, .env file watching), error message enrichment, signature changes to stopProfiler and cleanOptions, GlobalCLIOptions type adjustments, and escapeRegExp helper introduction for regex path handling.
Build Configuration
rollup.config.ts
CJS build exports changed from 'named' to 'auto' with added interop 'compat'; formatting alignment in ESM block; minor syntax adjustments.
Next.js CJS Test Config
tests/test-nextjs-cjs/next.config.js
Replaced withPPDev wrapper with plain object config; removed assetPrefix, basePath, and experimental settings.
Test Package Dependencies (CJS)
tests/test-nextjs-cjs/package.json
Updated next to ^16.1.6, react/react-dom to ^18.2.0, sharp to ^0.33.5; added overrides for vite and esbuild.
Test TypeScript and Imports (CJS)
tests/test-nextjs-cjs/tsconfig.json, tests/test-nextjs-cjs/src/pages/index.tsx
Changed JSX runtime from "preserve" to "react-jsx"; added dist types to include; expanded paths; corrected relative import paths in page component.
Test Package Dependencies (ESM)
tests/test-nextjs/package.json
Updated express, next, react/react-dom versions; upgraded ESLint from 8 to 9 with config update; removed vite-related entries.
Test TypeScript Config (ESM)
tests/test-nextjs/tsconfig.json
Changed JSX runtime from "preserve" to "react-jsx"; expanded include and paths; simplified exclude to "node_modules" only.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

Sixteen's the version that Next.js now brings,
Our CLI hops better on config-watching wings,
DIRNAME's escaping, lazy loads take flight,
Cache initialization keeps everything tight,
Beta-two's hopping with performance and might! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: Next.js 16 support, config watcher improvements, plugin fixes, and test project modernization, all of which are clearly reflected in the raw summary.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@rollup.config.ts`:
- Around line 41-42: Ensure the built CommonJS output shape matches how
consumers require your package: add or confirm Rollup's output option interop:
'compat' and keep exports: 'auto' (or change to 'default' if you only export a
single default) in your rollup config, then run a post-build check by requiring
the built CJS bundle (e.g., require('./dist/cjs/index.js')) and inspect
Object.keys(...) and whether .default exists to confirm consumers expect a
namespace object (mixed named + default) vs direct module.exports = <default>;
adjust the rollup output.exports setting accordingly and re-run the test until
the observed shape matches your consumption expectations.

In `@src/cli.ts`:
- Around line 1236-1247: Duplicate signal handlers are being registered causing
gracefulShutdown to run multiple times; remove the inner registration inside the
Next.js server's listen callback and keep only the outer process.on handlers
(the handlers that call gracefulShutdown('SIGINT'), gracefulShutdown('SIGTERM'),
gracefulShutdown('uncaughtException'), and
gracefulShutdown('unhandledRejection')); specifically delete the block that
registers process.on(...) inside the server.listen(...) callback and leave the
outer process.on(...) registrations at the action scope so gracefulShutdown is
only invoked once per signal.

In `@tests/test-nextjs-cjs/package.json`:
- Around line 14-33: The package.json has mismatched Next and ESLint configs;
update devDependencies so eslint is bumped to a ^9.x release and
eslint-config-next is updated to ^16.1.6 to match next@^16.1.6 (edit the
"devDependencies" block replacing "eslint": "^8.57.0" with "eslint": "^9" and
"eslint-config-next": "13.5.4" with "eslint-config-next": "^16.1.6"), then run
install/lint to verify compatibility.

In `@tests/test-nextjs-cjs/tsconfig.json`:
- Around line 31-43: The tsconfig.json currently lists "dist/types/**/*.ts" and
"dist/dev/types/**/*.ts" in "include" but also has "dist" in "exclude",
preventing those generated types from being picked up; update the tsconfig.json
to stop excluding the whole dist directory (e.g., remove "dist" from the
"exclude" array and keep only "node_modules", or narrow the exclude so it
doesn't exclude dist/types) so that the include entries ("dist/types/**/*.ts"
and "dist/dev/types/**/*.ts") are actually type-checked.
🧹 Nitpick comments (1)
src/cli.ts (1)

583-583: Redundant projectRoot redeclaration shadows outer variable.

projectRoot is already computed at lines 514-516 with the same logic. This redeclaration at line 583 shadows the outer variable unnecessarily.

♻️ Suggested fix
-          // Load project root
-          const projectRoot = root ? join(process.cwd(), root) : process.cwd();
+          // projectRoot is already defined at outer scope

Comment thread rollup.config.ts
Comment thread src/cli.ts
Comment thread tests/test-nextjs-cjs/package.json
Comment thread tests/test-nextjs-cjs/tsconfig.json
@sergak01

sergak01 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

PP-2741

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.

3 participants