Conversation
🦋 Changeset detectedLatest commit: 87d9abd 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 |
WalkthroughA new changeset file was added to document a patch update for the Changes
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
src/runtime/components/_utils.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/runtime/hooks/useSiteOverrides.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 (
|
Signed-off-by: JounQin <admin@1stg.me>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes incorrect index route path matching that was introduced in #119. The changes remove redundant path matching logic and simplify the implementation by using the withBase utility function more consistently.
- Removed unnecessary
baseparameter fromfetchSiteOverridesfunction and its usage - Simplified route path matching logic in
findItemByRoutePathby removing redundant comparisons - Updated imports to use
withBaseutility function instead of manual base path handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/runtime/hooks/useSiteOverrides.ts |
Removes base parameter from fetchSiteOverrides and uses withBase utility for URL construction |
src/runtime/components/_utils.ts |
Simplifies route path matching by removing redundant withBase comparisons |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/runtime/components/_utils.ts (1)
67-67: Handle undefined links explicitly to prevent incorrect matching.The fallback value '/' may cause incorrect matching behavior when
item.linkis undefined or empty, potentially matching unintended routes. Consider handling undefined links explicitly.- const removeIndexUrl = removeIndex(item.link || '/') + if (!item.link) { + return false + } + const removeIndexUrl = removeIndex(item.link)
🧹 Nitpick comments (1)
.changeset/eleven-hotels-behave.md (1)
5-5: Fix spelling error in changeset description.The word "dismatch" should be "mismatch" to properly describe the issue being fixed.
-fix: incorrect dismatch index route paths +fix: incorrect mismatch index route paths
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.changeset/eleven-hotels-behave.md(1 hunks)src/runtime/components/_utils.ts(1 hunks)src/runtime/hooks/useSiteOverrides.ts(3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
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.
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#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#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
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.
.changeset/eleven-hotels-behave.md (5)
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#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
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#117
File: src/remark-lint/constants.ts:1-1
Timestamp: 2025-07-09T02:31:06.588Z
Learning: In the @alauda/doom project, PUNCTUATION_REGEX in src/remark-lint/constants.ts is only used for test() operations, so the global flag is not needed and the current implementation /\p{P}/u is correct.
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.
src/runtime/hooks/useSiteOverrides.ts (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#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.
src/runtime/components/_utils.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.
🪛 LanguageTool
.changeset/eleven-hotels-behave.md
[grammar] ~5-~5: Ensure spelling is correct
Context: --- "@alauda/doom": patch --- fix: incorrect dismatch index route paths
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (1)
src/runtime/hooks/useSiteOverrides.ts (1)
1-1: LGTM! Centralized base path handling improves maintainability.The changes successfully centralize base path handling using
withBase, simplifying the function signature and URL construction. This refactoring makes the code more maintainable and consistent with the overall approach to handle base paths.Also applies to: 64-64, 122-122
introduced by #119
Summary by CodeRabbit
Bug Fixes
Refactor
Chores