Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Sep 17, 2025

close IDP-1307

Summary by CodeRabbit

  • New Features

    • Added “Edit this page” link with styling.
    • CLI: edit-repo now supports a fixed language code.
    • Search auto-switches to Algolia when environment variables are set.
  • Documentation

    • EN/ZH docs updated: clearer CLI help, translation flow, PDF export, and scaffolding wording; reformatted command help; documented edit-repo language variant.
  • Refactor

    • Theme exports reorganized and entry point consolidated; updated path alias.
  • Chores

    • Updated dependencies.
    • Added changeset for a minor release.
    • Config: edit links now point to file view (blob) instead of tree.

Copilot AI review requested due to automatic review settings September 17, 2025 07:29
@changeset-bot
Copy link

changeset-bot bot commented Sep 17, 2025

🦋 Changeset detected

Latest commit: 1fe6845

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 Minor

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 Sep 17, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds language-aware edit-repo option and config handling, restructures theme exports via a new barrel, introduces EditLink and a conditional Algolia-backed Search, updates documentation (EN/ZH), adjusts edit-page base URL in config, bumps dependencies, and points theme export to a new index entry.

Changes

Cohort / File(s) Summary
Docs (EN/ZH) CLI and wording updates
docs/en/start.mdx, docs/zh/start.mdx
Refreshes content and help formatting; extends -R/--edit-repo to accept [boolean
CLI option and config resolution
packages/doom/src/cli/index.ts, packages/doom/src/cli/load-config.ts
-R option signature updated to include lang; config loader now composes editRepoBaseUrl from simple repo names or uses full URLs based on slashes.
Theme components: Edit link
packages/doom/src/theme/EditLink.tsx, packages/doom/src/theme/useEditLink.ts, packages/doom/styles/edit-link.module.scss
Adds useEditLink hook to build edit links with optional fixed language; introduces EditLink component and styles.
Theme search and layout restructuring
packages/doom/src/theme/Search.tsx, packages/doom/src/theme/Layout.tsx
Moves Search logic to its own file with Algolia fallback; Layout removes previous Search export and cleans imports/paths.
Theme barrel and exports
packages/doom/src/theme/index.ts, packages/doom/package.json, tsconfig.json
Adds theme index barrel re-exporting core and local components; updates package export to ./lib/theme/index.js; tsconfig path points to new entry.
Site config edit link base
doom.config.yml
Changes editRepoBaseUrl from tree view to blob view path.
Dependency updates
package.json, packages/doom/package.json
Bumps dev/prod dependencies (eslint, rspress plugins, openai, mermaid, etc.); widens type-fest range.
Changeset metadata
.changeset/hungry-suits-play.md
Adds minor release note for fixed language support in edit repo.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as CLI (-R/--edit-repo)
  participant Loader as load-config:getCommonConfig
  participant Site as Runtime Theme

  User->>CLI: doom ... -R [boolean|url|lang]
  CLI-->>Loader: editRepo option value
  Loader->>Loader: if value contains "/" -> use as base URL
  Loader->>Loader: else if base exists -> append value as segment
  Loader-->>Site: resolved editRepoBaseUrl (+ optional fixed lang)
  Site->>Site: useEditLink builds final edit link (lang-aware)
  Site-->>User: Edit link rendered (external)
Loading
sequenceDiagram
  autonumber
  participant Env as Env Vars
  participant Theme as Theme/Search
  participant Algolia as AlgoliaSearch
  participant CoreSearch as Core Search

  Env-->>Theme: ALGOLIA_* present?
  alt All present
    Theme->>Theme: useMemo(docSearchProps with facetFilters: lang)
    Theme->>Algolia: render with props + locales
  else Missing any
    Theme->>CoreSearch: render fallback search
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

feature, enhancement, documentation

Poem

I hop through docs with tidy paws,
A link to edit—now obeys language laws.
Search blooms with facets, swift and bright,
If keys are set, Algolia takes flight.
New barrels stacked, exports neat—
Carrot-approved code, squeaky-clean and sweet. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: support fixed language for edit repo" succinctly and accurately describes the primary change: adding language-aware edit-repo behavior across CLI, config handling, and theme utilities. It follows conventional commit style, is concise, and focuses on the main feature rather than implementation details. The title matches the PR objectives and the diffs that introduce CLI, config, and hook changes to support a fixed language edit repo.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/edit_link

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: JounQin <admin@1stg.me>
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 adds support for fixed language configuration in edit repository URLs, allowing documentation to be edited from a repository that has language-specific subdirectories.

  • Adds new EditLink component with useEditLink hook to handle language-aware edit URLs
  • Restructures theme exports by moving Search component to separate file
  • Updates CLI help text to reflect new language parameter support for edit-repo option

Reviewed Changes

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

Show a summary per file
File Description
packages/doom/styles/edit-link.module.scss Adds CSS styles for the new EditLink component
packages/doom/src/theme/useEditLink.ts Creates hook to generate edit URLs with fixed language support
packages/doom/src/theme/index.ts Updates theme exports to include new components
packages/doom/src/theme/Search.tsx Extracts Search component from Layout.tsx
packages/doom/src/theme/Layout.tsx Refactors to remove Search component and update imports
packages/doom/src/theme/EditLink.tsx Implements new EditLink component using the useEditLink hook
packages/doom/src/cli/load-config.ts Adds logic to handle language-based edit repository configuration
packages/doom/src/cli/index.ts Updates CLI help text for edit-repo parameter
packages/doom/package.json Updates package exports path and dependency versions
package.json Updates development dependency versions
doom.config.yml Changes edit repository URL from tree to blob format
docs/zh/start.mdx Updates CLI help documentation in Chinese
docs/en/start.mdx Updates CLI help documentation and improves wording

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 17, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@178.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@178.tgz

commit: 1fe6845

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 (3)
packages/doom/src/cli/load-config.ts (1)

171-178: Ensure robust slash handling when appending repo/lang segment

The current logic can yield inconsistent trailing slashes and is brittle if the base already ends with a different segment. Normalize with leading/trailing slash helpers and avoid double-appending.

Apply:

-    if (editRepo.includes('/')) {
-      editRepoBaseUrl = editRepo
-    } else if (editRepoBaseUrl) {
-      editRepoBaseUrl = addTrailingSlash(editRepoBaseUrl)
-      if (!editRepoBaseUrl.endsWith(`/${editRepo}/`)) {
-        editRepoBaseUrl += editRepo
-      }
-    }
+    if (editRepo.includes('/')) {
+      editRepoBaseUrl = editRepo
+    } else if (editRepoBaseUrl) {
+      const base = addTrailingSlash(editRepoBaseUrl)
+      const segment = removeLeadingSlash(editRepo)
+      editRepoBaseUrl = base.endsWith(`/${segment}/`)
+        ? base
+        : addTrailingSlash(base + segment)
+    }
#!/bin/bash
# Quick sanity checks for combinations
node - <<'JS'
function addTrailingSlash(s){return s.endsWith('/')?s:s+'/'}
function removeLeadingSlash(s){return s.startsWith('/')?s.slice(1):s}
function build(base, seg){
  const b=addTrailingSlash(base); const s=removeLeadingSlash(seg);
  return (b.endsWith(`/${s}/`) ? b : addTrailingSlash(b+s))
}
console.log(build('alauda/doom/blob/main/docs','en'))        // .../docs/en/
console.log(build('alauda/doom/blob/main/docs/','en'))       // .../docs/en/
console.log(build('alauda/doom/blob/main/docs/en','en'))     // .../docs/en/
console.log(build('alauda/doom/blob/main/docs/en/','en'))    // .../docs/en/
JS
packages/doom/src/theme/useEditLink.ts (2)

20-21: Avoid .at(-2); validate and handle short URLs

More explicit and compatible with older runtimes. Also guards empty segments.

-  const lastSegment = docRepoBaseUrl.split('/').at(-2)
+  const segments = docRepoBaseUrl.split('/').filter(Boolean)
+  const lastSegment = segments.length ? segments[segments.length - 1] : undefined

27-27: Improve readability by extracting the final page path

The current ternary inside template string hurts clarity.

-  const link = `${docRepoBaseUrl}${fixedLang ? relativePagePath.split('/').slice(1).join('/') : relativePagePath}`
+  const finalPagePath = fixedLang
+    ? relativePagePath.split('/').slice(1).join('/')
+    : relativePagePath
+  const link = `${docRepoBaseUrl}${finalPagePath}`
🧹 Nitpick comments (20)
doom.config.yml (1)

28-28: Blob vs. Edit route mismatch with CTA

If the UI text says “Edit this page on GitHub”, consider using the /edit/<branch>/ route instead of /blob/ to land users directly on the editor. Please confirm this aligns with useEditLink behavior; otherwise switch to /edit/.

Would you like me to adjust the base to alauda/doom/edit/main/docs and verify end-to-end?

packages/doom/styles/edit-link.module.scss (1)

1-11: Improve a11y and avoid transitioning all properties

  • Add visible focus styles and restore underline on hover/focus for link discoverability.
  • Limit transition to color to reduce layout/repaint work.

Apply:

 .editLink {
-  color: var(--rp-c-brand);
-  text-decoration: none;
+  color: var(--rp-c-brand);
+  text-decoration: none;
   font-size: 15px;
   font-weight: 500;
   margin: 20px 0;
-  transition: all 0.2s ease-in-out;
+  transition: color 0.2s ease-in-out;
   &:hover {
-    color: var(--rp-c-brand-dark);
+    color: var(--rp-c-brand-dark);
+    text-decoration: underline;
   }
+  &:focus-visible {
+    outline: 2px solid var(--rp-c-brand);
+    outline-offset: 2px;
+    text-decoration: underline;
+  }
 }
packages/doom/src/cli/load-config.ts (1)

181-189: CLI help promises ‘lang’ variant; ensure UX when base missing

If users pass -R <lang> without editRepoBaseUrl in config, we log an error and do nothing. Consider upgrading the message to hint that editRepoBaseUrl is required for the lang variant.

packages/doom/src/cli/index.ts (1)

99-101: Include alauda-ru in help text

load-config.ts supports 'alauda-ru'; reflect it here for consistency: [boolean|alauda|alauda-ru].

Apply:

-  .option(
-    '-R, --edit-repo [boolean|url|lang]',
-    'Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted; if a language code is provided, all other languages will use the same repo but with the language code as sub-path',
+  .option(
+    '-R, --edit-repo [boolean|url|lang]',
+    'Enable or override `editRepoBaseUrl`. `https://github.com/` prefix may be omitted; if a language code is provided, all languages use the same repo with that code as a sub-path',
     parseBooleanOrString,
     false,
   )

Also consider noting that the lang variant requires editRepoBaseUrl in config.

docs/zh/start.mdx (1)

99-101: 文档与实现不一致:Algolia 还支持 alauda-ru

CLI 实现支持 alauda-ru 预设,帮助文案仅写了 alauda。建议更新为 [boolean|alauda|alauda-ru]

Apply:

-  -a, --algolia [boolean|alauda]      Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
+  -a, --algolia [boolean|alauda|alauda-ru]  Whether to enable or use the alauda (docs.alauda.io) or alauda-ru preset for Algolia search (default: false)
packages/doom/package.json (1)

103-107: type-fest major‑range expansion: double‑check TS compatibility

Allowing ^5.x is probably fine (you’re on TS ^5.9), but it’s a types-only package with occasional breaking changes. Make sure CI type checks still pass across consumers.

Suggestion: if downstream repos compile against this package, run a full tsc -b there or add an integration job to catch cross‑package type regressions.

docs/en/start.mdx (2)

103-104: Clarify the new -R/--edit-repo [boolean|url|lang] with a concrete example

Great addition. Consider adding one example for the lang case to remove ambiguity.

For example:

  • doom dev -R zh -> all languages share the same repo, using zh as a fixed sub-path.
  • doom dev -R https://github.com/org/repo/tree/main/docs/zh/

191-191: Nit: “Specially” → “Specifically”

Minor wording tweak for standard phrasing.

- Specially, if you use `-g '*'` for full translation, ...
+ Specifically, if you use `-g '*'` for full translation, ...
packages/doom/src/theme/index.ts (1)

1-6: Scope the ESLint disable to the star re‑export

Prefer limiting suppression to the offending line to avoid masking future issues.

-/* eslint-disable import-x/export */
-
-export * from '@rspress/core/theme'
+// eslint-disable-next-line import-x/export
+export * from '@rspress/core/theme'
 export { EditLink } from './EditLink.tsx'
 export { Layout } from './Layout.tsx'
 export { Search } from './Search.tsx'
packages/doom/src/theme/EditLink.tsx (1)

16-18: Add rel="noopener noreferrer" for external link security

Opening a new tab should include rel to prevent reverse‑tabnabbing.

-    <a href={link} target="_blank" className={classes.editLink}>
+    <a
+      href={link}
+      target="_blank"
+      rel="noopener noreferrer"
+      className={classes.editLink}
+    >
       {text}
     </a>
packages/doom/src/theme/Layout.tsx (4)

10-10: Style import consistency

Elsewhere you import CSS via the package subpath (@alauda/doom/styles/...). Consider aligning here for consistency, or keep it consistently relative—either way, pick one convention.


51-57: Guard optional flattenScope to avoid runtime errors

flattenScope! will throw if undefined. Use optional chaining.

-      if (exportItem.flattenScope!.includes(sidebar._fileKey)) {
+      if (exportItem.flattenScope?.includes(sidebar._fileKey)) {
         matched = {
           sidebar,
           exportItem,
           depth,
         }
       }

109-116: Handle missing themeConfig.locales safely

Accessing .length on possibly undefined can crash. Use optional chaining and provide a sane fallback.

-    if (themeConfig.locales.length) {
+    if (themeConfig.locales?.length) {
       let found: MatchedSidebar | undefined
-
-      for (const { lang, sidebar } of themeConfig.locales) {
-        const sidebarItems = sidebar[
-          siteLang === lang ? '/' : `/${lang}`
-        ] as DoomSidebar[]
+      for (const { lang, sidebar } of themeConfig.locales) {
+        const base = siteLang === lang ? '/' : `/${lang}`
+        const sidebarItems = (sidebar[base] ?? sidebar['/']) as DoomSidebar[]
         found ??= getClosestSidebar(sidebarItems, pathname)
         if (found) {
           return found
         }
       }

129-134: Safer PDF filename

Sidebar text may contain spaces or symbols. Normalize before composing the filename to avoid broken links on some hosts.

-  const pdfLink = useMemo(
-    () =>
-      found &&
-      withBase(`${found.exportItem.name ?? found.sidebar.text}-${lang}.pdf`),
+  const pdfLink = useMemo(() => {
+    if (!found) return undefined
+    const base = (found.exportItem.name ?? found.sidebar.text).trim()
+    const safe = base.replace(/[^\w.-]+/g, '-')
+    return withBase(`${safe}-${lang}.pdf`)
+  },
     [found, lang],
   )
packages/doom/src/theme/useEditLink.ts (2)

26-28: Harden page path access to avoid runtime crash

page._relativePath may be undefined on some routes; the cast masks this and .replace will throw.

Apply:

-  const relativePagePath = (page._relativePath as string).replace(/\\/g, '/')
+  if (!page?._relativePath) return null
+  const relativePagePath = page._relativePath.replace(/\\/g, '/')

3-3: Add an explicit return type for the hook

Clarifies the public API and prevents accidental type drift.

-export function useEditLink() {
+export function useEditLink(): { text: string; link: string } | null {
packages/doom/src/theme/Search.tsx (4)

27-28: Scope locales to current language and normalize facet lang

Unconditionally passing ZH_LOCALES shows Chinese UI for non‑ZH users. Also, Algolia facets often use base language (e.g., zh vs zh-CN).

-        const docSearchProps = useMemo(
-          () => ({
+        const docSearchProps = useMemo(
+          () => ({
             appId: process.env.ALGOLIA_APP_ID!,
             apiKey: process.env.ALGOLIA_API_KEY!,
             indexName: process.env.ALGOLIA_INDEX_NAME!,
             searchParameters: {
-              facetFilters: [`lang:${lang}`],
+              facetFilters: [`lang:${lang.split('-')[0]}`],
             },
           }),
           [lang],
         )
         return (
-          <AlgoliaSearch docSearchProps={docSearchProps} locales={ZH_LOCALES} />
+          <AlgoliaSearch
+            docSearchProps={docSearchProps}
+            locales={lang.startsWith('zh') ? ZH_LOCALES : undefined}
+          />
         )

Also applies to: 14-25


1-1: Annotate component type and compute a clear feature flag

Helps typing and readability; no behavioral change.

-import { useLang } from '@rspress/core/runtime'
+import { useLang } from '@rspress/core/runtime'
+import type { FC } from 'react'
@@
-export const Search =
+const HAS_ALGOLIA =
   process.env.ALGOLIA_APP_ID &&
   process.env.ALGOLIA_API_KEY &&
   process.env.ALGOLIA_INDEX_NAME
-    ? () => {
+export const Search: FC = HAS_ALGOLIA
+    ? () => {
@@
-    : OriginalSearch
+    : OriginalSearch

Also applies to: 9-13


3-6: Optional: avoid bundling Algolia code when disabled

Static imports can keep Algolia in the bundle even when env vars are missing. Consider lazy loading to trim baseline size.

I can provide a lazy(() => import(...)) variant behind HAS_ALGOLIA if you want to pursue this optimization.

Also applies to: 9-13


1-1: Use local typed useLang

packages/doom/src/runtime/hooks/useTranslation.ts exports a typed useLang — import that in the theme to keep Language consistent.

Change in packages/doom/src/theme/Search.tsx:

  • from: import { useLang } from '@rspress/core/runtime'
  • to: import { useLang } from '../runtime/hooks/useTranslation'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec42a3 and 1fe6845.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • .changeset/hungry-suits-play.md (1 hunks)
  • docs/en/start.mdx (9 hunks)
  • docs/zh/start.mdx (1 hunks)
  • doom.config.yml (1 hunks)
  • package.json (1 hunks)
  • packages/doom/package.json (4 hunks)
  • packages/doom/src/cli/index.ts (1 hunks)
  • packages/doom/src/cli/load-config.ts (1 hunks)
  • packages/doom/src/theme/EditLink.tsx (1 hunks)
  • packages/doom/src/theme/Layout.tsx (1 hunks)
  • packages/doom/src/theme/Search.tsx (1 hunks)
  • packages/doom/src/theme/index.ts (1 hunks)
  • packages/doom/src/theme/useEditLink.ts (1 hunks)
  • packages/doom/styles/edit-link.module.scss (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-05-26T08:59:41.491Z
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.

Applied to files:

  • packages/doom/src/theme/index.ts
  • tsconfig.json
  • packages/doom/package.json
📚 Learning: 2025-05-26T09:09:21.339Z
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.

Applied to files:

  • packages/doom/src/theme/index.ts
  • tsconfig.json
  • packages/doom/package.json
📚 Learning: 2025-05-29T16:25:28.086Z
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.

Applied to files:

  • packages/doom/src/theme/index.ts
📚 Learning: 2025-06-06T07:08:55.881Z
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.

Applied to files:

  • package.json
  • packages/doom/package.json
📚 Learning: 2025-05-26T09:09:21.339Z
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.

Applied to files:

  • packages/doom/package.json
🧬 Code graph analysis (2)
packages/doom/src/theme/EditLink.tsx (2)
packages/doom/src/theme/index.ts (1)
  • EditLink (4-4)
packages/doom/src/theme/useEditLink.ts (1)
  • useEditLink (3-33)
packages/doom/src/theme/Search.tsx (2)
packages/doom/src/theme/index.ts (1)
  • Search (6-6)
packages/doom/src/runtime/hooks/useTranslation.ts (1)
  • useLang (7-7)
🔇 Additional comments (9)
.changeset/hungry-suits-play.md (1)

1-6: Changeset metadata is correct

Minor bump for the new edit-repo language feature is appropriate.

package.json (1)

35-37: Dev dep bumps look good — verify dedupe & lockfile

Incremental bumps look fine; yarn-berry-deduplicate is unavailable in this environment (command not found). Ensure the lockfile is updated and run locally: yarn-berry-deduplicate --list && yarn-berry-deduplicate — confirm no duplicate ranges and commit the updated lockfile.
Applies to package.json lines 35–37 (also 42, 45, 49).

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

238-244: Help string mismatch — include 'alauda-ru' in CLI help

packages/doom/src/cli/load-config.ts (lines 238–244) accepts 'alauda-ru', but the CLI help only documents 'alauda'. Update the CLI help text to mention 'alauda-ru' for discoverability.

tsconfig.json (1)

8-8: Approve — tsconfig alias and package export are consistent

tsconfig.json maps "@alauda/doom/theme" → ./packages/doom/src/theme/index.ts and packages/doom/package.json exports "./theme" → "./lib/theme/index.js" — confirmed. packages/doom/lib is not checked into the repo (build artifact); ensure lib/theme/index.js is produced and included when publishing.

docs/en/start.mdx (1)

88-118: Docs polish looks good

Help text and command sections read clearly, options are consistent with the CLI. Nice work.

packages/doom/src/theme/index.ts (1)

3-6: Re‑export precedence: confirm no ambiguous export warnings

export * plus named re‑exports is fine; your named Layout/Search will take precedence over the core ones. Just confirm bundler/ESLint doesn’t flag ambiguous exports.

Given the project’s Yarn v4 + subpath‑exports setup (per our past learnings), this pattern should resolve cleanly.

packages/doom/src/theme/Layout.tsx (1)

137-153: PDF link injection LGTM

Good UX: conditional render, MDX component wrapper, and proper rel on the anchor.

packages/doom/package.json (2)

53-58: Approve — @RsPress packages aligned; no stragglers found.
ripgrep shows only packages/doom/package.json (lines 53–57) containing @RsPress deps and all are 2.0.0-beta.32.


24-26: Exports: verify barrel build output and export types for TS consumers

tsconfig.base.json sets "moduleResolution": "NodeNext" (confirmed); "allowImportingTsExtensions" not found. Ensure the build emits lib/theme/index.js and lib/theme/index.d.ts. To surface types via subpath exports, consider:

  "exports": {
-    "./theme": "./lib/theme/index.js",
+    "./theme": {
+      "types": "./lib/theme/index.d.ts",
+      "default": "./lib/theme/index.js"
+    },
    "./types": "./lib/types.js",
    "./package.json": "./package.json"
  },

@JounQin JounQin merged commit ba7a139 into main Sep 17, 2025
16 checks passed
@JounQin JounQin deleted the feat/edit_link branch September 17, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants