Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 10, 2025

Summary by CodeRabbit

  • Chores
    • Updated several dependencies to their latest versions, including packages related to linting, TypeScript, OpenAI, and Rspress.
  • Refactor
    • Removed TypeScript type declarations for the default Rspress theme, eliminating static type information for related theme hooks and functions.
    • Improved navigation menu interaction with smoother dropdown behavior and updated styling for consistency.
  • Bug Fixes
    • Fixed a style regression issue in the VersionsNav component for improved visual consistency.

@JounQin JounQin self-assigned this Jun 10, 2025
Copilot AI review requested due to automatic review settings June 10, 2025 11:40
@JounQin JounQin added the dependencies Pull requests that update a dependency file label Jun 10, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 10, 2025

🦋 Changeset detected

Latest commit: e82b65d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 10, 2025

Walkthrough

The changes update several dependencies in package.json, including ESLint, Rspress, OpenAI, and TypeScript-related packages. Additionally, a patch removes the entire TypeScript declaration file index.d.ts from the @rspress/theme-default package, eliminating all its type definitions and exported function signatures. Several React components in the VersionsNav directory were refactored or renamed to improve dropdown behavior, styling consistency, and class naming conventions.

Changes

File(s) Change Summary
package.json Updated dependency versions for @eslint-react/eslint-plugin, @rspress/core, @rspress/plugin-algolia, @rspress/plugin-llms, openai, typescript-eslint, @swc/core, @types/node, and @types/react.
patches/@RsPress+theme-default+2.0.0-beta.11.patch Removed index.d.ts TypeScript declaration file from @rspress/theme-default, deleting all type exports and function declarations.
src/global/VersionsNav/Down.tsx Renamed exported React component from SvgDown to Down without changing implementation.
src/global/VersionsNav/NavMenuGroup.tsx Refactored dropdown menu logic with mouse event handlers, close timer, active link matching update, CSS class prefixing, and icon rename.
src/global/VersionsNav/NavMenuSingleItem.tsx Updated CSS class names to prefixed variants and added an extra active class when isActive is true; no logic changes.

Poem

In the warren of code, new versions hop in,
Old types are whisked away with a whisker-thin spin.
Dropdowns dance with timers and style,
Icons renamed with a joyful smile.
Dependencies freshen, the patch clears the field,
The garden of imports, now lighter, revealed!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates project dependencies to their latest patch/minor versions and removes an outdated theme-default patch.

  • Remove the v2.0.0-beta.11 patch for @rspress/theme-default
  • Bump @rspress/* packages to v2.0.0-beta.12 and other dependencies (e.g., openai, typescript-eslint, @types/node, @types/react)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
patches/@RsPress+theme-default+2.0.0-beta.11.patch Delete outdated patch for @rspress/theme-default v2.0.0-beta.11
package.json Bump multiple dependencies to newer versions
Comments suppressed due to low confidence (1)

patches/@RsPress+theme-default+2.0.0-beta.11.patch:1

  • The patch file name still references v2.0.0-beta.11 even though dependencies were bumped to v2.0.0-beta.12. If theme-default still needs adjustment, please add a new patch file named @rspress+theme-default+2.0.0-beta.12.patch; otherwise, confirm that removing the old patch is sufficient.
-diff --git a/node_modules/@rspress/theme-default/dist/index.d.ts b/node_modules/@rspress/theme-default/dist/index.d.ts

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@alauda/doom@84

commit: f957d0e

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 03bbc4f and 44a81c9.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • package.json (4 hunks)
  • patches/@rspress+theme-default+2.0.0-beta.11.patch (0 hunks)
💤 Files with no reviewable changes (1)
  • patches/@RsPress+theme-default+2.0.0-beta.11.patch
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: autofix
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
🔇 Additional comments (5)
package.json (5)

61-61: Confirm ESLint React plugin bump compatibility
The @eslint-react/eslint-plugin version has been updated to ^1.51.3. Please verify there are no breaking changes or new rules that require adjustments to your ESLint configuration.


69-71: Validate Rspress beta dependency versioning
@rspress/core, @rspress/plugin-algolia, and @rspress/plugin-llms are now pinned to 2.0.0-beta.12 (exact versions). Ensure this aligns with your versioning policy for beta releases and verify any necessary migrations after the removal of index.d.ts in @rspress/theme-default.


86-86: Verify OpenAI SDK upgrade
Upgrading openai from ^5.1.1 to ^5.2.0 could introduce API changes. Run your integration tests against the OpenAI endpoints and review the changelog for potential breaking changes.


105-105: Upgrade TypeScript-ESLint plugin
Bumping typescript-eslint to ^8.34.0 likely adds lint support for newer TS syntax. Re-run yarn lint and confirm that no rules have been deprecated or require new configurations.


118-118: Align Node.js type definitions with engine constraints
The update to @types/node at ^22.15.31 may expose Node 22 typings. Confirm compatibility with your declared engine range (>=18.17.0 <20 || >=20.1.0) and ensure no unintended Node 22–specific APIs are used.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 0bd0e79 and 24446a5.

📒 Files selected for processing (3)
  • src/global/VersionsNav/Down.tsx (1 hunks)
  • src/global/VersionsNav/NavMenuGroup.tsx (6 hunks)
  • src/global/VersionsNav/NavMenuSingleItem.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/global/VersionsNav/Down.tsx
  • src/global/VersionsNav/NavMenuSingleItem.tsx
🧰 Additional context used
🪛 ESLint
src/global/VersionsNav/NavMenuGroup.tsx

[error] 9-9: Unable to resolve path to module '@rspress/shared'.

(import-x/no-unresolved)


[error] 10-10: Unable to resolve path to module 'react'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
🔇 Additional comments (2)
src/global/VersionsNav/NavMenuGroup.tsx (2)

91-106: Well-implemented dropdown interaction pattern!

The 150ms delay on mouse leave and the mouse enter handler on the dropdown content effectively prevent accidental closure when moving diagonally between the trigger and content. This is a good UX improvement.

Also applies to: 169-169


108-108: Good refactor to use the dedicated matchNavbar utility.

Using a centralized utility function for navbar matching is more maintainable than inline regex logic.

JounQin added 2 commits June 11, 2025 09:41
Signed-off-by: JounQin <admin@1stg.me>
Signed-off-by: JounQin <admin@1stg.me>
@JounQin
Copy link
Member Author

JounQin commented Jun 11, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jun 11, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
package.json (1)

115-120: Minor type-lib bumps look safe

@swc/core, @types/node, and @types/react are all patch bumps; no API churn expected. Given the earlier discussion, the React-types mismatch is no longer an issue if you are indeed on React 19.

src/global/VersionsNav/NavMenuGroup.tsx (1)

82-101: ⚠️ Potential issue

Add cleanup for the timer to prevent memory leaks.

The timer reference should be cleaned up when the component unmounts to prevent potential memory leaks.

Apply this diff to add proper cleanup:

-import { useRef, useState, type ReactNode } from 'react'
+import { useEffect, useRef, useState, type ReactNode } from 'react'

Then add this cleanup effect after the state declarations:

 const [isOpen, setIsOpen] = useState(false)
 const closeTimerRef = useRef<number>(null)
+
+useEffect(() => {
+  return () => {
+    clearCloseTimer()
+  }
+}, [])
🧹 Nitpick comments (3)
package.json (1)

69-71: Tar-ball URLs may break repeatable installs

Locking the three @rspress/* deps to a commit tar-ball will work, but:

  1. Those URLs are not cached by the public npm registry – any rebased/force-pushed commit will invalidate them.
  2. Yarn’s offline-mirror / npm’s --prefer-offline can’t cache them reliably.
  3. Renovate / Dependabot will no longer detect new releases.

Consider switching back to the beta tag (2.0.0-beta.12) once the fixes you need are published, or use a git+ssh URL that pins the SHA.

src/global/VersionsNav/Down.tsx (1)

1-5: Nit: mark as memo to prevent needless re-renders

The icon is static – wrapping the export with memo avoids re-rendering when parents update.

-import React, { memo } from 'react'
-
-export const Down = () => (
+import React, { memo } from 'react'
+
+export const Down = memo(() => (
   <svg width="1em" height="1em" viewBox="0 0 32 32">
     <path fill="currentColor" d="M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z" />
   </svg>
-)
+))
src/global/VersionsNav/NavMenuSingleItem.tsx (1)

48-50: String-concatenated classNames are getting hard to read

Manually interpolating long utility strings is error-prone and hurts diff-reviewability. Consider clsx/classnames:

-import clsx from 'clsx'
-
-<div
-  className={`rspress-nav-menu-item ${styles.singleItem} ${
-    isActive ? `${styles.activeItem} rspress-nav-menu-item-active` : ''
-  } rp-text-sm rp-font-medium ${compact ? 'rp-mx-0.5' : 'rp-mx-1.5'} rp-px-3 rp-py-2 rp-flex rp-items-center`}
->
+import clsx from 'clsx'
+
+<div
+  className={clsx(
+    'rspress-nav-menu-item',
+    styles.singleItem,
+    'rp-text-sm rp-font-medium rp-px-3 rp-py-2 rp-flex rp-items-center',
+    compact ? 'rp-mx-0.5' : 'rp-mx-1.5',
+    isActive && [styles.activeItem, 'rspress-nav-menu-item-active'],
+  )}
+>

The intent stays the same while remaining maintainable.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03bbc4f and 6b1bf7e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • .changeset/sour-wombats-hunt.md (1 hunks)
  • .changeset/tiny-ghosts-sell.md (1 hunks)
  • package.json (4 hunks)
  • patches/@rspress+theme-default+2.0.0-beta.11.patch (0 hunks)
  • src/global/VersionsNav/Down.tsx (1 hunks)
  • src/global/VersionsNav/NavMenuGroup.tsx (6 hunks)
  • src/global/VersionsNav/NavMenuSingleItem.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • patches/@RsPress+theme-default+2.0.0-beta.11.patch
🧰 Additional context used
🪛 ESLint
src/global/VersionsNav/NavMenuGroup.tsx

[error] 9-9: Unable to resolve path to module '@rspress/shared'.

(import-x/no-unresolved)


[error] 10-10: Unable to resolve path to module 'react'.

(import-x/no-unresolved)

🔇 Additional comments (9)
package.json (3)

61-61: Check the minor-version bump for @eslint-react/eslint-plugin

The update is a patch bump only, so it is low-risk. Just make sure the new rules (if any) don’t suddenly surface additional lint errors in CI.


86-86: Verify breaking-change surface for openai@5.3.x

5.2.0 → 5.3.0 introduced stricter TypeScript signatures around streaming payloads. If you reference Stream-specific generics, compilation may fail. Make sure the CI type-check still passes.


105-105: typescript-eslint@8.34.0 drops support for TS ≤ 5.4

Your typescript runtime is ^5.8.3, so that’s fine, but double-check that the parserOptions.tsconfigRootDir is still correctly resolved – this version tightened path checks.

.changeset/tiny-ghosts-sell.md (1)

1-6: LGTM – clear, concise changeset note

.changeset/sour-wombats-hunt.md (1)

1-6: LGTM – good to see the regression called out explicitly

src/global/VersionsNav/NavMenuGroup.tsx (4)

91-106: Well-implemented dropdown interaction with smooth UX!

The 150ms delay pattern with mouse enter/leave handlers provides excellent user experience by allowing diagonal mouse movement to the dropdown content. The clear documentation is also appreciated.

Also applies to: 169-169


108-108: Good refactoring to use the centralized matchNavbar utility!

This improves consistency across the codebase and ensures uniform active link detection logic.


38-39: Excellent CSS class naming standardization!

The consistent use of the rp- prefix throughout the component improves maintainability and prevents potential naming conflicts.

Also applies to: 44-44, 51-51, 58-58, 63-63, 123-123, 134-134, 139-139, 149-149, 162-162, 172-172


132-191: Clean refactoring of the component structure!

The unified approach with a single container element and consistent event handling greatly improves code maintainability and readability. The separation between the trigger button and dropdown content is well-organized.

@JounQin JounQin merged commit 7d0f0ec into main Jun 11, 2025
19 of 20 checks passed
@JounQin JounQin deleted the chore/bump branch June 11, 2025 01:53
github-actions bot pushed a commit that referenced this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants