Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jul 9, 2025

Summary by CodeRabbit

  • New Features

    • Improved sidebar navigation by adding support for section headers and enhancing type handling in sidebar components.
    • Introduced new utilities for URL path normalization and navigation matching.
  • Bug Fixes

    • Simplified and unified the use of the base URL throughout the application, ensuring consistent URL handling for site overrides and navigation.
  • Chores

    • Updated dependencies to newer versions, including several @rspress packages.
    • Refined GitHub Actions workflows for more reliable automation.
    • Enhanced ESLint configuration to prevent false positives for certain virtual modules.
    • Improved internal type declarations to support new sidebar features.

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

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: faeb083

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 9, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@119.tgz

commit: 689de49

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 upgrades @rspress packages to 2.0.0-beta.20, replaces usage of siteData.base with the new imported base, adds new helper predicates for sidebar section headers, and aligns CLI config handling to use configFilePath.

  • Bump core and plugin versions to 2.0.0-beta.20
  • Replace siteData.base with imported base in runtime hooks and components
  • Add isSidebarSectionHeader / isSingleFile helpers and update Overview component
  • Rename filepath to configFilePath in CLI functions and update commands
  • Update CI workflows to specific action versions

Reviewed Changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/shared/helpers.ts Add withoutBase and matchNavbar, drop unreachable code
src/runtime/hooks/useSiteOverrides.ts Use imported base, drop usePageData, adjust effect deps
src/runtime/components/_utils.ts Add isSidebarSectionHeader/isSingleFile helpers
src/runtime/components/Overview.tsx Import new predicates, remove withBase usage
src/global/VersionsNav/index.tsx Use imported base, drop removeTrailingSlash
src/global/VersionsNav/NavMenuSingleItem.tsx Consolidate imports, use shared withoutBase
src/global/VersionsNav/NavMenuGroup.tsx Import matchNavbar from shared helpers
src/cli/load-config.ts Add buildCache.digest, rename return field to configFilePath
src/cli/index.ts Update destructuring and watcher to configFilePath
src/cli/export.ts Update serve call to pass configFilePath
package.json Bump @rspress dependencies to beta.20
eslint.config.js Whitelist new virtual-runtime-config module
.github/workflows/gh-pages.yml Pin actions-gh-pages to specific commit
.github/workflows/autofix.yml Update autofix-ci/action to v1.3.2

@JounQin JounQin force-pushed the feat/bump_rspress branch from 491c823 to faeb083 Compare July 9, 2025 10:12
@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

Walkthrough

This update synchronizes multiple internal and dependency versions, refines ESLint and workflow configurations, and introduces new helper functions for navigation and URL handling. It enhances sidebar and navigation logic, centralizes base URL management, and improves type safety and modularity in both CLI and runtime components, especially for configuration and sidebar processing.

Changes

File(s) Change Summary
.changeset/new-numbers-tell.md, package.json Updated @rspress dependencies to 2.0.0-beta.20 and added a patch-level changeset for @alauda/doom.
.github/workflows/autofix.yml, .github/workflows/gh-pages.yml Pinned GitHub Actions to specific commit SHAs for more deterministic CI/CD execution.
eslint.config.js Added 'virtual-runtime-config' to ESLint's unresolved import ignore list.
shim.d.ts Added module declaration for 'virtual-runtime-config' exporting base.
src/cli/export.ts, src/cli/index.ts, src/cli/load-config.ts Refactored config loading to consistently use configFilePath, updated function signatures, and improved cache digest handling.
src/global/VersionsNav/NavMenuGroup.tsx, src/global/VersionsNav/NavMenuSingleItem.tsx Updated imports for navigation helpers to use local shared helpers.
src/global/VersionsNav/index.tsx, src/runtime/hooks/useSiteOverrides.ts Centralized base URL usage by importing base from 'virtual-runtime-config', removed redundant logic.
src/runtime/components/Overview.tsx, src/runtime/components/_utils.ts Improved sidebar logic: added section header support, refined type guards, and streamlined filtering and normalization.
src/shared/helpers.ts Added withoutBase and matchNavbar helper functions for navigation and path handling.

Sequence Diagram(s)

sequenceDiagram
    participant CLI
    participant ConfigLoader
    participant Serve/Build/Dev
    CLI->>ConfigLoader: loadConfig()
    ConfigLoader-->>CLI: { config, configFilePath }
    CLI->>Serve/Build/Dev: serve/build/dev(config, configFilePath)
Loading
sequenceDiagram
    participant UI
    participant VirtualConfig
    participant SharedHelpers
    participant Sidebar
    UI->>VirtualConfig: import base
    UI->>SharedHelpers: import withoutBase, matchNavbar
    UI->>Sidebar: process sidebar items (including section headers)
    Sidebar->>SharedHelpers: isSidebarSectionHeader, isSingleFile
Loading

Possibly related PRs

  • alauda/doom#84: Updates rspress dependencies to v2.0.0-beta.12, similar to this PR's dependency update.
  • alauda/doom#86: Updates rspress dependency versions and adds a changeset for @alauda/doom, directly related to this PR's changes.

Suggested labels

enhancement

Poem

A bunny hopped and tweaked the base,
With helpers shared in every place.
Sidebars sorted, configs neat,
Version bumps that can't be beat!
From workflows pinned to types anew,
This patch brings harmony—hippity-hoo!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

eslint.config.js

Oops! Something went wrong! :(

ESLint: 9.30.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

shim.d.ts

Oops! Something went wrong! :(

ESLint: 9.30.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

src/cli/index.ts

Oops! Something went wrong! :(

ESLint: 9.30.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 9 others
✨ 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

@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

♻️ Duplicate comments (1)
src/runtime/hooks/useSiteOverrides.ts (1)

124-127: Missing dependencies in effect hook.

The effect callback uses base and virtual.version but only lists [acpSite] as dependencies. This could cause stale closures and missed updates when these values change.

Add the missing dependencies to the dependency array:

-  }, [acpSite])
+  }, [acpSite, base, virtual.version])
🧹 Nitpick comments (1)
.github/workflows/gh-pages.yml (1)

46-47: Good practice: commit-hash pin for peaceiris/actions-gh-pages; optionally tighten permissions
The hash pin strengthens supply-chain security and mirrors the pattern used elsewhere in the repo—nice consistency.
Minor nit: for newer GitHub Pages deployments you can reduce the token surface by adding job-level permissions:

permissions:
  contents: write       # keep for action-generated commits
  pages: write          # optional – required only with official gh-pages deploy
  id-token: write       # optional – OIDC if ever needed

Not required for this PR, just a hardening suggestion.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6f05b8a and faeb083.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (16)
  • .changeset/new-numbers-tell.md (1 hunks)
  • .github/workflows/autofix.yml (1 hunks)
  • .github/workflows/gh-pages.yml (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (1 hunks)
  • shim.d.ts (1 hunks)
  • src/cli/export.ts (2 hunks)
  • src/cli/index.ts (5 hunks)
  • src/cli/load-config.ts (3 hunks)
  • src/global/VersionsNav/NavMenuGroup.tsx (1 hunks)
  • src/global/VersionsNav/NavMenuSingleItem.tsx (1 hunks)
  • src/global/VersionsNav/index.tsx (4 hunks)
  • src/runtime/components/Overview.tsx (7 hunks)
  • src/runtime/components/_utils.ts (1 hunks)
  • src/runtime/hooks/useSiteOverrides.ts (3 hunks)
  • src/shared/helpers.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
.changeset/new-numbers-tell.md (4)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/cli/export.ts (1)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
package.json (6)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#69
File: package.json:101-101
Timestamp: 2025-06-06T07:08:55.881Z
Learning: When a package has peer dependencies that require TypeScript (like `@eslint-react/eslint-plugin`), TypeScript should be moved from devDependencies to dependencies to satisfy the peer dependency requirement.
Learnt from: JounQin
PR: alauda/doom#69
File: package.json:101-101
Timestamp: 2025-06-06T07:08:55.881Z
Learning: When a package has peer dependencies that require TypeScript (like `@eslint-react/eslint-plugin`), TypeScript should be moved from devDependencies to dependencies to satisfy the peer dependency requirement.
shim.d.ts (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/global/VersionsNav/index.tsx (3)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/global/VersionsNav/NavMenuGroup.tsx (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/runtime/hooks/useSiteOverrides.ts (6)
Learnt from: JounQin
PR: alauda/doom#69
File: package.json:101-101
Timestamp: 2025-06-06T07:08:55.881Z
Learning: When a package has peer dependencies that require TypeScript (like `@eslint-react/eslint-plugin`), TypeScript should be moved from devDependencies to dependencies to satisfy the peer dependency requirement.
Learnt from: JounQin
PR: alauda/doom#69
File: package.json:101-101
Timestamp: 2025-06-06T07:08:55.881Z
Learning: When a package has peer dependencies that require TypeScript (like `@eslint-react/eslint-plugin`), TypeScript should be moved from devDependencies to dependencies to satisfy the peer dependency requirement.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
eslint.config.js (5)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:09:17.876Z
Learning: When ESLint shows "Unable to resolve path to module" errors for packages that are listed in package.json dependencies, the issue is usually that npm install hasn't been run yet, not that the packages are missing from dependencies or that there's an ESLint configuration problem.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/global/VersionsNav/NavMenuSingleItem.tsx (4)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
src/shared/helpers.ts (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
🧬 Code Graph Analysis (5)
src/cli/export.ts (1)
src/cli/load-config.ts (1)
  • loadConfig (372-550)
src/global/VersionsNav/index.tsx (1)
shim.d.ts (1)
  • base (28-28)
src/runtime/hooks/useSiteOverrides.ts (1)
shim.d.ts (1)
  • base (28-28)
src/cli/index.ts (2)
src/cli/load-config.ts (1)
  • loadConfig (372-550)
src/cli/constants.ts (1)
  • SITES_FILE (32-32)
src/runtime/components/Overview.tsx (1)
src/runtime/components/_utils.ts (2)
  • isSidebarDivider (16-24)
  • isSidebarSectionHeader (26-34)
⏰ 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). (7)
  • GitHub Check: Build and Lint with Node.js 24 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 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 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
🔇 Additional comments (27)
.github/workflows/autofix.yml (1)

39-41: Pinning autofix-ci/action to an exact commit improves CI reproducibility – LGTM
Locking the action to 635ffb0… (v1.3.2) eliminates the risk of silent upstream changes. No further concerns.

src/shared/helpers.ts (1)

48-58: LGTM! Clean implementation of navigation helper functions.

Both withoutBase and matchNavbar are well-implemented utility functions that properly handle path normalization and navigation matching logic. The code is concise, uses proper TypeScript types, and follows good functional programming practices.

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

11-11: LGTM! Correctly updated import path.

The import change from @rspress/shared to the local relative path aligns with the refactoring of moving the matchNavbar function to the local helpers file.

.changeset/new-numbers-tell.md (1)

1-6: LGTM! Properly formatted changeset.

The changeset correctly documents the rspress version bump to v2.0.0-beta.20 using standard changeset format.

eslint.config.js (1)

71-71: LGTM! Correctly added virtual module to ESLint ignore list.

Adding 'virtual-runtime-config' to the ignore list is necessary to prevent false positive import resolution errors for this virtual module.

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

2-6: LGTM! Correctly refactored imports.

The import changes properly reflect the refactoring of moving withoutBase to the local helpers file, while also consolidating the remaining @rspress/shared imports for better organization.

package.json (1)

70-72: Version bumps look good and align with PR objectives.

The consistent upgrade of all @RsPress packages to version 2.0.0-beta.20 ensures compatibility and addresses the PR's goal of bumping rspress to this version.

shim.d.ts (1)

25-29: Well-structured virtual module declaration.

The new module declaration for 'virtual-runtime-config' provides proper TypeScript typing for the base constant, supporting the centralization of base URL management across the application.

src/cli/export.ts (2)

63-63: Consistent destructuring pattern with other CLI commands.

The addition of configFilePath to the destructuring aligns with the updated loadConfig function signature and maintains consistency across CLI commands.


87-87: Correct parameter passing to serve function.

The inclusion of configFilePath as a parameter to the serve function ensures consistent configuration file path handling across all CLI commands.

src/cli/index.ts (7)

140-140: Consistent variable naming improves code clarity.

The renaming from filepath to configFilePath provides better semantic meaning and aligns with the updated loadConfig function signature.


147-147: Correct parameter passing to dev function.

The configFilePath parameter ensures the development server has access to the configuration file path for proper functionality.


160-161: Improved file watching logic.

The conditional logic using configFilePath ensures appropriate files are watched based on whether a configuration file was found, improving the development experience.


221-221: Consistent destructuring pattern in build command.

The destructuring of configFilePath maintains consistency with other CLI commands and provides necessary configuration context.


231-231: Correct parameter passing to build function.

The configFilePath parameter ensures the build process has access to the configuration file path for proper functionality.


257-257: Consistent destructuring pattern in preview command.

The destructuring of configFilePath maintains consistency with other CLI commands and provides necessary configuration context.


259-259: Correct parameter passing to serve function.

The configFilePath parameter ensures the preview server has access to the configuration file path for proper functionality.

src/runtime/hooks/useSiteOverrides.ts (3)

1-1: Good refactoring to remove unused import.

Removing the unused usePageData import cleans up the code and aligns with the new approach of importing base directly from the virtual runtime config.


5-5: Proper centralization of base URL management.

The import of base from 'virtual-runtime-config' provides a centralized and consistent way to access the base URL across the application.


66-66: Simplified URL construction.

The simplified construction of siteOverridesUrl using the imported base constant makes the code more readable and consistent.

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

12-12: Consistent base URL centralization.

The migration from siteData.base to the imported base constant improves consistency across the codebase. The empty dependency array is correct since base is now a compile-time constant.

Also applies to: 74-74, 77-77, 91-91, 170-170

src/cli/load-config.ts (1)

395-395: Improved type safety for configFilePath.

The non-optional return type with a default empty string ensures consistent handling in downstream consumers.

Also applies to: 548-548

src/runtime/components/_utils.ts (2)

26-44: Well-structured type guards for sidebar items.

The new type guards isSidebarSectionHeader and isSingleFile follow established patterns and provide clear, focused functionality for identifying specific sidebar item types.


49-67: Consistent handling of non-navigable sidebar items.

The updated route matching logic correctly excludes both dividers and section headers, maintaining consistency in sidebar navigation behavior.

src/runtime/components/Overview.tsx (3)

12-12: Comprehensive support for SidebarSectionHeader.

The addition of SidebarSectionHeader type support is consistently implemented throughout the component, with proper type guards and filtering logic.

Also applies to: 18-23, 38-42, 100-110, 142-147


73-74: Correct path comparison without base normalization.

The removal of withBase aligns with the comment indicating that sidebar item links don't include the base path, while page route paths do.


166-166: Cleaner filtering with Boolean constructor.

Using .filter(Boolean) is more idiomatic and concise than manual type filtering.

Also applies to: 172-172, 186-186

@JounQin JounQin merged commit a8488e0 into main Jul 9, 2025
16 checks passed
@JounQin JounQin deleted the feat/bump_rspress branch July 9, 2025 10:36
github-actions bot pushed a commit that referenced this pull request Jul 9, 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