Skip to content

fix package json vul - #639

Merged
MSghais merged 3 commits into
AFK-AlignedFamKernel:mainfrom
MSghais:feat/fix_package_next
Dec 10, 2025
Merged

MSghais merged 3 commits into
AFK-AlignedFamKernel:mainfrom
MSghais:feat/fix_package_next

Conversation

@MSghais

@MSghais MSghais commented Dec 10, 2025 •

Copy link
Copy Markdown
Member
  • update nextjs
  • update react

Summary by CodeRabbit

  • Chores
    • Updated Next.js to 16.0.8 across apps.
    • Updated React and React‑DOM to 19.2.1 across apps and packages.
    • PWA build now runs Next.js with webpack.
    • Removed an obsolete package configuration file.
    • Adjusted dev-dependencies: upgraded some tooling packages and removed an eslint-plugin-react-hooks entry.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 10, 2025 •

Copy link
Copy Markdown

Walkthrough

Update of multiple package.json files across the monorepo: Next.js bumped 15.1.7 → 16.0.8, React and React-DOM bumped 19.0.0 → 19.2.1; apps/pwa build script changed to use next build --webpack; a stray package config file (packages/afk_nostr_sdk/package copy.json) was removed; minor devDependency edits in packages.

Changes

Cohort / File(s) Change Summary
Monorepo root & apps
package.json, apps/art-game/package.json, apps/website/package.json
Bumped next 15.1.7 → 16.0.8; bumped react & react-dom 19.0.0 → 19.2.1.
PWA app
apps/pwa/package.json
Same dependency bumps as above; updated build script to next build --webpack.
AFK Nostr SDK package removal
packages/afk_nostr_sdk/package copy.json
Removed entire configuration file (deleted package JSON content).
AFK Nostr SDK dev deps
packages/afk_nostr_sdk/package.json
Updated devDependency versions (e.g., eslint-plugin-react-hooks and react/react-dom in devDependencies bumped to 19.2.1).
Common package dev deps
packages/common/package.json
Removed devDependency eslint-plugin-react-hooks (v^4.6.0).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check compatibility/migration notes for Next.js 16 and React 19 in each app (root, art-game, pwa, website).
  • Validate apps/pwa build script change (--webpack) is intentional and supported by Next.js 16.
  • Confirm removal of packages/afk_nostr_sdk/package copy.json is deliberate and not a needed config.
  • Review peerDependencies and lockfile updates for version mismatches.
  • Quick smoke test build for each app to detect runtime regressions.

Poem

🐰 I nibbled package.json leaves at night,
Pushed versions up beneath the moonlight,
Next and React now prance and play,
A tiny hop for code, hooray—🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix package json vul' is vague and incomplete, using abbreviations and not clearly conveying the actual changes (Next.js and React version bumps across multiple packages). Consider revising to something more descriptive like 'Update Next.js and React dependencies across packages' to clearly indicate the scope and nature of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/pwa/package.json (1)

105-106: Fix dev dependencies version mismatch with production React versions.

The devDependencies still specify React 19.0.0 and React-DOM 19.0.0 while the main dependencies specify 19.2.1. This inconsistency will cause the development environment and tests to use a different React version than production, potentially masking or introducing bugs.

Update devDependencies to match the production versions:

  "devDependencies": {
    ...
-   "react": "19.0.0",
-   "react-dom": "19.0.0",
+   "react": "19.2.1",
+   "react-dom": "19.2.1",
    ...
  }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3a1c91 and 5a934de.

📒 Files selected for processing (1)
  • apps/pwa/package.json (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: check-app
  • GitHub Check: check-app
🔇 Additional comments (2)
apps/pwa/package.json (2)

90-90: Verify codebase compatibility with Next.js 16 major version upgrade.

Next.js 15.1.7 → 16.0.8 introduces breaking changes including asynchronous request APIs (cookies(), headers(), draftMode, params, searchParams now require await) and caching semantic changes. Manual inspection of the codebase is needed to ensure:

  • All request API calls have been updated to use await
  • Route handlers are configured with appropriate caching directives
  • Other breaking changes have been addressed per the Next.js 16 migration guide

13-13: The --webpack flag is supported in Next.js 16.0.8 — no action needed for this flag.

The --webpack build flag remains the official opt-out mechanism in Next.js 16 to continue using Webpack instead of the new default Turbopack bundler. This flag is explicitly documented and supported. However, verify that any custom webpack configuration in next.config.js (loaders, plugins, aliases, etc.) will be ignored by Turbopack if the flag is not used; if custom webpack behavior is required, the --webpack flag ensures those settings are respected.

Likely an incorrect or invalid review comment.

Comment thread apps/pwa/package.json
"qs": "^6.12.3",
"quill": "2.0.3",
"react": "19.0.0",
"react": "19.2.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for eslint-plugin-react-hooks in package.json files

echo "=== Checking apps/pwa/package.json ==="
if [ -f apps/pwa/package.json ]; then
  cat apps/pwa/package.json | jq '.devDependencies["eslint-plugin-react-hooks"], .dependencies["eslint-plugin-react-hooks"]' 2>/dev/null
fi

echo "=== Checking root package.json ==="
if [ -f package.json ]; then
  cat package.json | jq '.devDependencies["eslint-plugin-react-hooks"], .dependencies["eslint-plugin-react-hooks"]' 2>/dev/null
fi

echo "=== All references to eslint-plugin-react-hooks ==="
rg 'eslint-plugin-react-hooks' --type json -A 1

Repository: AFK-AlignedFamKernel/afk_monorepo

Length of output: 210


🌐 Web query:

React 19.2 eslint-plugin-react-hooks version requirements compatibility

💡 Result:

Short answer: React 19.2 expects/ships eslint-plugin-react-hooks v6 (the React 19.2 blog calls out "eslint-plugin-react-hooks v6"). Use the plugin v6 (or the plugin version recommended in the React 19.2 docs) with React 19.2. [1][2]

Notes/compatibility caveats:

  • There have been peer-dependency / ESLint-version issues reported for older plugin releases (and users saw conflicts when mixing older eslint-plugin-react-hooks versions with newer ESLint 9). If you hit install/peer errors, upgrade eslint-plugin-react-hooks to the v6-series recommended for React 19.2 and ensure your ESLint version meets the plugin's peerDependency requirements. See the GitHub discussion about ESLint 9/peer-dep conflicts for background. [3][2]

Sources:

  • React 19.2 release notes (mentions eslint-plugin-react-hooks v6). [1]
  • eslint-plugin-react-hooks npm package / install notes. [2]
  • React GitHub issues on eslint-plugin-react-hooks / ESLint compatibility. [3]

Verify eslint-plugin-react-hooks version meets React 19.2.1 requirements.

React 19.2 requires eslint-plugin-react-hooks v6 or newer. Check that the current version in your dependencies satisfies this requirement, as older versions are incompatible with React 19.2.

🤖 Prompt for AI Agents
In apps/pwa/package.json around line 71, React is bumped to 19.2.1 but the
eslint-plugin-react-hooks version must be v6+ for compatibility; verify the
plugin entry in dependencies or devDependencies and if it is older than 6.x
update it to "eslint-plugin-react-hooks": "^6.0.0" (or the latest v6+), run your
package manager to install and update the lockfile, and then run your linter/CI
to confirm no rule or compatibility errors remain.

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/afk_nostr_sdk/package.json (1)

64-65: Update TypeScript type definitions to React 19.

The package is running React 19.2.1 in devDependencies (lines 76–77), but the TypeScript type definitions are still pinned to React 18. This will cause type mismatches and TypeScript compilation errors.

Per the React 19 upgrade guide, you must update type definitions to match the runtime version.

Apply this diff to update the type definitions:

-    "@types/react": "^18.3.1",
-    "@types/react-dom": "^18.3.0",
+    "@types/react": "^19.0.0",
+    "@types/react-dom": "^19.0.0",
🧹 Nitpick comments (1)
packages/common/package.json (1)

35-35: Remove the blank line left after eslint-plugin-react-hooks removal.

Line 35 contains an unnecessary blank line where the dependency was removed. Clean up the formatting by removing this empty line.

Apply this diff:

     "eslint-plugin-react": "^7.34.1",
-    
     "prettier": "^3.2.5"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a934de and f477ddd.

📒 Files selected for processing (3)
  • packages/afk_nostr_sdk/package copy.json (0 hunks)
  • packages/afk_nostr_sdk/package.json (1 hunks)
  • packages/common/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/afk_nostr_sdk/package copy.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: check-app
  • GitHub Check: check-app

@MSghais
MSghais merged commit a7980af into AFK-AlignedFamKernel:main Dec 10, 2025
3 of 5 checks passed
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