-
Notifications
You must be signed in to change notification settings - Fork 2
feat: bump rspress to v2.0.0-beta.20 #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: faeb083 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this 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.basewith importedbasein runtime hooks and components - Add
isSidebarSectionHeader/isSingleFilehelpers and update Overview component - Rename
filepathtoconfigFilePathin 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 |
491c823 to
faeb083
Compare
WalkthroughThis 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
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)
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
Possibly related PRs
Suggested labels
Poem
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
eslint.config.jsOops! Something went wrong! :( ESLint: 9.30.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js shim.d.tsOops! Something went wrong! :( ESLint: 9.30.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js src/cli/index.tsOops! Something went wrong! :( ESLint: 9.30.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
baseandvirtual.versionbut 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 forpeaceiris/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 neededNot required for this PR, just a hardening suggestion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis 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: Pinningautofix-ci/actionto an exact commit improves CI reproducibility – LGTM
Locking the action to635ffb0… (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
withoutBaseandmatchNavbarare 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/sharedto the local relative path aligns with the refactoring of moving thematchNavbarfunction 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
withoutBaseto the local helpers file, while also consolidating the remaining@rspress/sharedimports 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
configFilePathto the destructuring aligns with the updatedloadConfigfunction signature and maintains consistency across CLI commands.
87-87: Correct parameter passing to serve function.The inclusion of
configFilePathas a parameter to theservefunction 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
filepathtoconfigFilePathprovides better semantic meaning and aligns with the updatedloadConfigfunction signature.
147-147: Correct parameter passing to dev function.The
configFilePathparameter ensures the development server has access to the configuration file path for proper functionality.
160-161: Improved file watching logic.The conditional logic using
configFilePathensures 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
configFilePathmaintains consistency with other CLI commands and provides necessary configuration context.
231-231: Correct parameter passing to build function.The
configFilePathparameter 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
configFilePathmaintains consistency with other CLI commands and provides necessary configuration context.
259-259: Correct parameter passing to serve function.The
configFilePathparameter 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
usePageDataimport cleans up the code and aligns with the new approach of importingbasedirectly from the virtual runtime config.
5-5: Proper centralization of base URL management.The import of
basefrom '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
siteOverridesUrlusing the importedbaseconstant makes the code more readable and consistent.src/global/VersionsNav/index.tsx (1)
12-12: Consistent base URL centralization.The migration from
siteData.baseto the importedbaseconstant improves consistency across the codebase. The empty dependency array is correct sincebaseis 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
isSidebarSectionHeaderandisSingleFilefollow 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
SidebarSectionHeadertype 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
withBasealigns 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
Summary by CodeRabbit
New Features
Bug Fixes
Chores
@rspresspackages.