Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "doomslayer",
"packageManager": "[email protected]",
"devDependencies": {
"@alauda/doom": "^1.12.7",
"@alauda/doom": "^1.17.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

@alauda/doom npm package breaking changes 1.12.7 to 1.17.1

💡 Result:

I can't find an authoritative changelog for @alauda/doom covering 1.12.7 → 1.17.1 with the searches I ran. Could you confirm the package name and that those exact versions exist (or want me to search npm, GitHub repo, and the package's CHANGELOG.md for breaking changes)? If yes I will run a deeper search and report the breaking changes with sources.


🌐 Web query:

@alauda/doom changelog release notes version history

💡 Result:

You can find @alauda/doom's changelog and release history here:

  • Package page (versions list / links to source & CHANGELOG): Socket / npm mirror for @alauda/doom. [1]
  • Official docs site (Doom) — includes changelog/changes and links to docs: doom.js.org. [2]
  • Libraries.io / npm listing (version history and changelog note). [3]

If you want, I can fetch the CHANGELOG.md contents (or list recent release notes) and paste the latest entries here.


🌐 Web query:

@alauda/doom package documentation migration guide

💡 Result:

Short answer — use the official Doom docs (doom.js.org) migration docs and the package README. Key references and quick steps:

References

  • Doom docs site (usage & configuration) — shows new config formats, defineConfig import, theme/plugin guidance. [1]
  • @alauda/doom npm/package page (README, changelog links). [2]

Quick migration checklist

  1. Install/update package: npm install @alauda/doom (or the desired version). See package README/changelog. [2]
  2. Replace old config with doom.config.{yaml,yml,js,ts} and, for JS/TS configs, export via defineConfig from '@alauda/doom/config'. [1][2]
  3. Move site-wide options into new schema fields (lang, title, logo, base, outDir, api/export/lint/etc.) per Configuration docs. [1]
  4. If you used a custom theme or plugins, export/compose them via the new theme entry (e.g., theme/index.ts export * from '@alauda/doom/theme') and update plugin references to the new plugin API. [1]
  5. Update CLI usage/flags as documented (e.g., -R/--edit-repo, -a/--algolia, -S/--site-url) and rebuild. [1]
  6. Test MDX/MD pipelines and API docs (OpenAPI/CRD) per the API Documentation section; adjust references/export options if needed. [1]

If you want, I can:

  • fetch the specific changelog entries for the version you’re migrating from/to, or
  • produce a concrete patch (diff) for your current doom config if you paste it.

Sources

  1. Doom — Configuration & Usage docs. https://doom.js.org/en/usage/configuration.html. [1]
  2. @alauda/doom package/README (npm / package pages). [2]

Verify migration steps completed for @alauda/doom upgrade.

The upgrade from ^1.12.7 to ^1.17.1 includes breaking changes requiring configuration and setup updates:

  • Configuration format change to doom.config.{yaml,yml,js,ts} with defineConfig export
  • Site-wide options moved to new schema fields (lang, title, logo, base, outDir, api/export/lint, etc.)
  • Theme and plugin API updated—custom themes/plugins must be refactored per the new API
  • CLI flags may have changed

Confirm that all migration steps from the Doom documentation have been completed.

🤖 Prompt for AI Agents
In package.json around line 5, the dependency was upgraded from @alauda/doom
^1.12.7 to ^1.17.1 but the PR did not confirm migration steps; update and
validate the project to the new Doom v1.17 config and APIs by renaming/replacing
legacy config to doom.config.{yaml,yml,js,ts} and exporting via defineConfig,
migrate site-wide options to the new schema fields (lang, title, logo, base,
outDir, api/export/lint, etc.), refactor any custom themes/plugins to the new
theme/plugin API, adjust CLI flags and npm scripts if changed, run the Doom
migration checklist from the docs, build/lint/test the site to ensure no
runtime/config errors, and commit any transformed config/theme/plugin files and
updated scripts.

"@tailwindcss/postcss": "^4.1.12",
"@ts-stack/markdown": "^1.5.0",
"autoprefixer": "^10.4.21",
Expand Down
249 changes: 194 additions & 55 deletions styles/index.css
Original file line number Diff line number Diff line change
@@ -1,55 +1,194 @@
@import "tailwindcss";

.editLink {
color: var(--rp-c-brand);
text-decoration: none;
font-size: 15px;
font-weight: 500;
transition: all 0.2s ease-in-out;
padding-left: 12px;
}

.editLink:hover {
color: var(--rp-c-brand-dark);
}

.paginationItem {
font-weight: 500;
cursor: pointer;
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));

--tw-font-weight: var(--font-weight-medium) /* 500 */;
font-weight: var(--font-weight-medium) /* 500 */;

margin-inline: calc(var(--spacing) * 1.5) /* 0.375rem = 6px */;
padding-inline: calc(var(--spacing) * 3) /* 0.75rem = 12px */;
padding-block: calc(var(--spacing) * 2) /* 0.5rem = 8px */;
display: flex;
align-items: center;
}

.paginationItem:hover {
background-color: var(--rp-c-bg-soft);
cursor: pointer;
color: var(--rp-c-brand-dark);
border-radius: 12px;
}

.paginationItem.active {
background-color: var(--rp-c-bg-soft);
cursor: pointer;
color: var(--rp-c-brand-dark);
border-radius: 12px;
}

.paginationItem.disabled {
cursor: not-allowed;
color: var(--rp-c-gray);
background-color: transparent;
border: none;
}

.rp-font-bold {
font-weight: 600;
}
@import "tailwindcss";

.editLink {
color: var(--rp-c-brand);
text-decoration: none;
font-size: 15px;
font-weight: 500;
transition: all 0.2s ease-in-out;
padding-left: 12px;
}

.editLink:hover {
color: var(--rp-c-brand-dark);
}

.paginationItem {
font-weight: 500;
cursor: pointer;
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));

--tw-font-weight: var(--font-weight-medium) /* 500 */;
font-weight: var(--font-weight-medium) /* 500 */;

margin-inline: calc(var(--spacing) * 1.5) /* 0.375rem = 6px */;
padding-inline: calc(var(--spacing) * 3) /* 0.75rem = 12px */;
padding-block: calc(var(--spacing) * 2) /* 0.5rem = 8px */;
display: flex;
align-items: center;
}
Comment on lines +16 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove duplicate font-weight declaration.

The font-weight property is declared twice (line 17 and line 23), causing the second declaration to override the first. Since line 23 uses the CSS variable var(--font-weight-medium) which evaluates to 500, line 17 is redundant.

Apply this diff to remove the duplicate:

 .paginationItem {
-  font-weight: 500;
   cursor: pointer;
   font-size: var(--text-sm);
   line-height: var(--tw-leading, var(--text-sm--line-height));
 
   --tw-font-weight: var(--font-weight-medium) /* 500 */;
   font-weight: var(--font-weight-medium) /* 500 */;
🧰 Tools
🪛 Biome (2.1.2)

[error] 23-23: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

font-weight is already defined here.

Remove or rename the duplicate property to ensure consistent styling.

(lint/suspicious/noDuplicateProperties)

🤖 Prompt for AI Agents
In styles/index.css around lines 16 to 30, there is a duplicate font-weight
declaration (plain 500 at line 17 and variable-based at line 23); remove the
redundant plain "font-weight: 500;" (the earlier declaration) so only the
variable-based "--tw-font-weight: var(--font-weight-medium)" and "font-weight:
var(--font-weight-medium)" remain, ensuring no duplicate overrides.


.paginationItem:hover {
background-color: var(--rp-c-bg-soft);
cursor: pointer;
color: var(--rp-c-brand-dark);
border-radius: var(--rp-radius);
}

.paginationItem.active {
background-color: var(--rp-c-bg-soft);
cursor: pointer;
color: var(--rp-c-brand-dark);
border-radius: var(--rp-radius);
}

.paginationItem.disabled {
cursor: not-allowed;
color: var(--rp-c-gray);
background-color: transparent;
border: none;
}

.rp-font-bold {
font-weight: 600;
}

.card {
display: block;
border: 1px solid var(--rp-c-divider-light);
border-radius: var(--rp-radius);
background-color: var(--rp-c-bg);
padding: 1rem;
}

.card__title {
font-size: 1.125rem;
font-weight: 600;
margin-bottom: 0.75rem;
color: var(--rp-c-text-1);
}

.card__content {
color: var(--rp-c-text-2);
}

.link-card {
display: block;
border-bottom: 1px solid var(--rp-c-divider-light);
background-color: var(--rp-c-bg);
padding: 1.25rem;
text-decoration: none;
transition-property: color, background-color, border-color;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}

.link-card:hover {
background-color: var(--rp-c-bg-soft);
}

.link-card__title {
font-size: 1.125rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--rp-c-text-1);
line-height: 1.75rem;
}

.link-card__description {
color: var(--rp-c-text-2);
font-size: 0.875rem;
line-height: 1.5rem;
}

.post-meta {
display: flex;
font-size: 0.875rem;
color: var(--rp-c-text-3);
line-height: 1.5rem;
font-weight: 500;
}

@media (min-width: 640px) {
.post-meta {
line-height: 2rem;
}
}

.breadcrumb {
margin-bottom: 2.5rem;
}

.home-footer {
margin-top: 3rem;
padding-top: 2rem;
padding-bottom: 2rem;
padding-left: 1.5rem;
padding-right: 1.5rem;
width: 100%;
border-top: 1px solid var(--rp-c-divider-light);
}

@media (min-width: 640px) {
.home-footer {
padding: 2rem;
}
}

.home-footer__content {
margin: auto;
width: 100%;
text-align: center;
font-weight: 500;
font-size: 0.875rem;
color: var(--rp-c-text-2);
}

.rp-doc-layout__menu {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
background-color: var(--rp-c-bg);
border-bottom: 1px solid var(--rp-c-divider-light);
padding: 0.75rem 1rem;
align-items: center;
gap: 0.5rem;
}

@media (max-width: 1280px) {
.rp-doc-layout__menu {
display: flex;
}
}

.rp-doc-layout__menu-button {
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
padding: 0;
border: none;
background: transparent;
color: var(--rp-c-text-1);
cursor: pointer;
border-radius: var(--rp-radius);
transition: background-color 0.2s;
}

.rp-doc-layout__menu-button:hover {
background-color: var(--rp-c-bg-soft);
}

.rp-doc-layout__menu-button:active {
background-color: var(--rp-c-bg-mute);
}

.rp-doc-layout__menu-button svg {
width: 100%;
height: 100%;
}
4 changes: 2 additions & 2 deletions theme/components/BreadCrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useMemo } from "react";
export const BreadCrumb = () => {
const { page, siteData } = usePageData();
const { base } = siteData;
const t = useI18n();
const t = useI18n<typeof import("i18n")>();

const href = useMemo(() => {
if (!base) {
Expand All @@ -14,7 +14,7 @@ export const BreadCrumb = () => {
}, [page, base]);

return (
<div className="rp-mb-10">
<div className="breadcrumb">
<span className="editLink" style={{ paddingLeft: 0 }}>
<a href={href}>
<span>{t("knowledge_title")}</span>
Expand Down
26 changes: 26 additions & 0 deletions theme/components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";

export interface CardProps {
title?: string;
content?: React.ReactNode;
style?: React.CSSProperties;
className?: string;
children?: React.ReactNode;
}

export const Card: React.FC<CardProps> = ({
title,
content,
style,
className = "",
children,
}) => {
return (
<div className={`card ${className}`} style={style}>
{title && <div className="card__title">{title}</div>}
{content && <div className="card__content">{content}</div>}
{children && <div className="card__content">{children}</div>}
</div>
Comment on lines +19 to +23
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Clarify the intended usage of content vs children.

Both content and children props render to separate <div className="card__content"> elements when provided simultaneously (lines 21-22). This could lead to unexpected styling or layout issues.

Consider one of the following approaches:

  1. Make content and children mutually exclusive (recommended)
  2. Render them in a single container
  3. Document the intended behavior if this is by design

Option 1 (recommended): Mutually exclusive usage

 export const Card: React.FC<CardProps> = ({
   title,
   content,
   style,
   className = "",
   children,
 }) => {
   return (
     <div className={`card ${className}`} style={style}>
       {title && <div className="card__title">{title}</div>}
-      {content && <div className="card__content">{content}</div>}
-      {children && <div className="card__content">{children}</div>}
+      {(content || children) && (
+        <div className="card__content">{content || children}</div>
+      )}
     </div>
   );
 };

Option 2: Single container for both

-      {content && <div className="card__content">{content}</div>}
-      {children && <div className="card__content">{children}</div>}
+      {(content || children) && (
+        <div className="card__content">
+          {content}
+          {children}
+        </div>
+      )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className={`card ${className}`} style={style}>
{title && <div className="card__title">{title}</div>}
{content && <div className="card__content">{content}</div>}
{children && <div className="card__content">{children}</div>}
</div>
<div className={`card ${className}`} style={style}>
{title && <div className="card__title">{title}</div>}
{(content || children) && (
<div className="card__content">{content || children}</div>
)}
</div>
Suggested change
<div className={`card ${className}`} style={style}>
{title && <div className="card__title">{title}</div>}
{content && <div className="card__content">{content}</div>}
{children && <div className="card__content">{children}</div>}
</div>
<div className={`card ${className}`} style={style}>
{title && <div className="card__title">{title}</div>}
{(content || children) && (
<div className="card__content">
{content}
{children}
</div>
)}
</div>
🤖 Prompt for AI Agents
theme/components/Card/index.tsx lines 19-23: the component currently renders
both `content` and `children` into separate <div className="card__content">
blocks which can cause styling/layout surprises; update the component to make
`content` and `children` mutually exclusive by validating props at the top of
the function (throw or console.error and return) when both are provided, update
the render to choose one source (prefer `children` over `content` or vice versa
per design) and update the prop types/TS definitions and component docs/tests to
reflect the exclusive contract.

);
};

1 change: 0 additions & 1 deletion theme/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { forwardRef, useCallback } from "react";
import { useI18n } from "rspress/runtime";

export interface CheckboxProps {
label: string;
Expand Down
2 changes: 1 addition & 1 deletion theme/components/DocID/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const DocID = ({ id }: { id?: string }) => {
return id || (pageData.page.frontmatter.id as string);
}, [id, pageData]);
return docID ? (
<div className="rp-flex rp-text-sm rp-text-text-2 rp-leading-6 sm:rp-leading-8 rp-font-medium">
<div className="post-meta">
ID: {docID}
</div>
) : (
Expand Down
2 changes: 1 addition & 1 deletion theme/components/EditOnGithub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function EditIcon() {

export const EditOnGithub = () => {
const { editLink, issueLink } = useEditLink();
const t = useI18n();
const t = useI18n<typeof import("i18n")>();

return (
<div className="mb-2">
Expand Down
2 changes: 1 addition & 1 deletion theme/components/Empty/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useThemeState } from "@rspress/core/theme";
import { useThemeState } from "@rspress/core/theme-original";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find package.json to check RSPress version
find . -name "package.json" -type f | head -5 | xargs head -30

# Search for theme-original usage in codebase
echo ""
echo "=== Searching for theme-original usage ==="
rg "theme-original" --type ts --type tsx -B 2 -A 2

# Search for useThemeState usage
echo ""
echo "=== Searching for useThemeState usage ==="
rg "useThemeState" --type ts --type tsx -B 2 -A 2

# Check if the import file mentioned exists
echo ""
echo "=== Checking the specific file ==="
cat -n "theme/components/Empty/index.tsx" 2>/dev/null || echo "File not found"

Repository: alauda/knowledge

Length of output: 4692


🏁 Script executed:

#!/bin/bash
# Check yarn.lock or package.json for @rspress/core version
echo "=== Checking for @rspress/core in package files ==="
rg "@rspress/core" . --type yaml --type toml --type json -A 2 | head -50

# Check if node_modules exists and search for theme-original
echo ""
echo "=== Searching node_modules for @rspress/core ==="
if [ -d "node_modules/@rspress/core" ]; then
  ls -la node_modules/@rspress/core/ | head -20
  echo ""
  echo "=== Package.json exports from @rspress/core ==="
  if [ -f "node_modules/@rspress/core/package.json" ]; then
    cat node_modules/@rspress/core/package.json | grep -A 50 '"exports"'
  fi
else
  echo "node_modules/@rspress/core not found"
  # Check what's in @alauda/doom dependencies
  echo ""
  echo "=== Checking @alauda/doom dependencies ==="
  if [ -d "node_modules/@alauda/doom" ]; then
    cat node_modules/@alauda/doom/package.json | head -50
  fi
fi

# Search for theme-original more broadly
echo ""
echo "=== Searching for any theme-original reference ==="
find node_modules -name "*theme*original*" -o -name "*theme-original*" 2>/dev/null | head -10

Repository: alauda/knowledge

Length of output: 294


🏁 Script executed:

#!/bin/bash
# Check for yarn.lock or package-lock.json
echo "=== Looking for lock files ==="
ls -la | grep -E "lock|yarn"

echo ""
echo "=== Checking yarn.lock for @rspress/core ==="
if [ -f "yarn.lock" ]; then
  grep -A 5 "@rspress/core" yarn.lock | head -50
fi

echo ""
echo "=== Checking @alauda/doom package.json for its dependencies ==="
# Check if there's a node_modules/@alauda/doom
if [ -d "node_modules/@alauda/doom" ]; then
  cat node_modules/@alauda/doom/package.json 2>/dev/null | jq '.dependencies, .devDependencies, .peerDependencies' | head -100
else
  echo "node_modules not available. Checking root package.json for all deps"
  cat package.json | jq '.' | head -100
fi

echo ""
echo "=== Checking if there are any RSPress references in codebase ==="
rg "rspress" -i . --type js --type ts --type tsx --type json -B 1 -A 1 | head -50

Repository: alauda/knowledge

Length of output: 2529


🏁 Script executed:

#!/bin/bash
# Check yarn cache or search for @rspress/[email protected] documentation
echo "=== Checking RSPress 2.0.0-rc.2 exports ==="

# Let's look at what the yarn.lock entry says about @rspress/core
echo "Getting full @rspress/core entry from yarn.lock:"
grep -A 30 '"@rspress/core@npm:2.0.0-rc.2":' yarn.lock

# Check if there's any reference to theme-original in the entire yarn.lock
echo ""
echo "=== Searching yarn.lock for 'theme-original' ==="
grep -i "theme-original" yarn.lock

# Check for 'useThemeState' anywhere
echo ""
echo "=== Searching yarn.lock for 'useThemeState' ==="
grep -i "useThemeState" yarn.lock

Repository: alauda/knowledge

Length of output: 1301


🏁 Script executed:

#!/bin/bash
# Let's search for any theme-related imports or exports in RSPress docs/examples
echo "=== Checking if there are other theme imports in project ==="
rg "from ['\"]@rspress" . -A 1 | head -30

# Look at the @alauda/doom version to understand the context better
echo ""
echo "=== Checking @alauda/doom version in yarn.lock ==="
grep -A 10 "@alauda/doom@npm:.*1.17" yarn.lock

Repository: alauda/knowledge

Length of output: 2349


🏁 Script executed:

#!/bin/bash
# Let's verify what exports actually exist in @rspress/core by checking the actual RSPress source
echo "=== Checking if @rspress/core really exports theme-original ==="

# Search for any reference to "theme-original" in the entire project
echo "Files using @rspress/core/theme-original:"
rg "@rspress/core/theme-original" . --type ts --type tsx | wc -l

echo ""
echo "All imports of this path:"
rg "@rspress/core/theme-original" . --type ts --type tsx

Repository: alauda/knowledge

Length of output: 267


🏁 Script executed:

#!/bin/bash
# Check without file type filtering
echo "=== Finding all theme-original references ==="
grep -r "theme-original" . --include="*.ts" --include="*.tsx" 2>/dev/null

echo ""
echo "=== Check if there's a theme-original entry point or custom export ==="
# Check the theme directory structure
find theme -type f -name "*.ts" -o -name "*.tsx" 2>/dev/null | head -20

echo ""
echo "=== Check theme/index.tsx to see what's exported ==="
cat theme/index.tsx

Repository: alauda/knowledge

Length of output: 1769


🏁 Script executed:

#!/bin/bash
# Check if @alauda/doom provides theme-original export
echo "=== Checking @alauda/doom's yarn.lock entry more thoroughly ==="
grep -B 5 -A 50 '"@alauda/doom@npm:1.17.1":' yarn.lock | head -100

echo ""
echo "=== Look for any @rspress references in @alauda/doom dependencies ==="
grep -A 50 '"@alauda/doom@npm:1.17.1":' yarn.lock | grep -i "rspress"

Repository: alauda/knowledge

Length of output: 194


🏁 Script executed:

#!/bin/bash
# Let's search the yarn.lock for @alauda/doom differently
echo "=== Searching for @alauda/doom in yarn.lock ==="
grep "@alauda/doom" yarn.lock | head -20

echo ""
echo "=== Get the full entry for @alauda/doom ==="
awk '/"@alauda\/doom@npm:1\.17\.1":/,/^"[^@]/' yarn.lock | head -100

echo ""
echo "=== Search entire yarn.lock for rspress in dependencies ==="
grep -B 10 "rspress" yarn.lock | grep -E "^\"|rspress"

Repository: alauda/knowledge

Length of output: 3102


🏁 Script executed:

#!/bin/bash
# Check if there's a TypeScript path alias or other configuration mapping theme-original
echo "=== Checking tsconfig.json for path aliases ==="
cat tsconfig.json 2>/dev/null | grep -A 20 "paths"

echo ""
echo "=== Checking rspress.config.ts for any alias configuration ==="
find . -name "rspress.config.ts" -o -name "rspress.config.js" | xargs cat 2>/dev/null

echo ""
echo "=== Check if theme-original might be re-exported from theme/index.tsx ==="
# We already know theme/index.tsx exports from theme-original, but let's confirm what it should be
cat theme/index.tsx

Repository: alauda/knowledge

Length of output: 707


🏁 Script executed:

#!/bin/bash
# Final verification - check what actually exists in @rspress/core exports
echo "=== Checking @rspress/[email protected] package structure from yarn.lock ==="
awk '/"@rspress\/core@npm:2\.0\.0-rc\.2":/,/^"/' yarn.lock | grep -E "exports|bin|main|types" | head -20

echo ""
echo "=== Summary of theme-original usage in codebase ==="
echo "Files importing from @rspress/core/theme-original:"
grep -r "@rspress/core/theme-original" . --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l

echo ""
echo "Functions imported from this path:"
grep -r "from ['\"]@rspress/core/theme-original['\"]" . --include="*.ts" --include="*.tsx" -A 0 2>/dev/null | sed 's/.*from.*//' | sort -u

Repository: alauda/knowledge

Length of output: 280


🏁 Script executed:

#!/bin/bash
# Let's extract the exact imports from each file to understand what's being used
echo "=== Detailed import analysis ==="
grep -B 1 "from ['\"]@rspress/core/theme-original['\"]" . -r --include="*.ts" --include="*.tsx" 2>/dev/null

echo ""
echo "=== Check what components are in standard @rspress/core/theme ==="
# Look at how other @rspress/core/runtime imports work in the project for reference
grep -r "from ['\"]@rspress/core" . --include="*.ts" --include="*.tsx" 2>/dev/null | grep -o "from ['\"]@rspress/core[^'\"]*['\"]" | sort -u

Repository: alauda/knowledge

Length of output: 1199


Replace non-existent @rspress/core/theme-original imports with @rspress/core/theme.

In RSPress v2.0, the package migration is rspress/theme => @rspress/core/theme. The import path @rspress/core/theme-original does not exist in @rspress/[email protected] (the version declared in yarn.lock). Update all imports in the following files:

  • theme/components/Empty/index.tsx (useThemeState)
  • theme/components/HomeContent/index.tsx (useFullTextSearch)
  • theme/components/PostList/index.tsx (Badge)
  • theme/layout/DocLayout/index.tsx (multiple exports)
  • theme/layout/index.tsx (Badge, LastUpdated, Layout)
  • theme/index.tsx (wildcard export)

Change from @rspress/core/theme-original to @rspress/core/theme.

🤖 Prompt for AI Agents
theme/components/Empty/index.tsx (line 1) and the other files listed:
theme/components/HomeContent/index.tsx, theme/components/PostList/index.tsx,
theme/layout/DocLayout/index.tsx, theme/layout/index.tsx, theme/index.tsx —
replace any import source string "@rspress/core/theme-original" with
"@rspress/core/theme"; keep the same named imports (useThemeState,
useFullTextSearch, Badge, LastUpdated, Layout, and any wildcard exports) and
ensure import syntax remains valid for TypeScript/ES modules.

import React from "react";

interface EmptyStateProps {
Expand Down
5 changes: 2 additions & 3 deletions theme/components/HomeBanner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useI18n, usePageData } from "@rspress/runtime";
import { useI18n } from "@rspress/runtime";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check which files use which import paths for useI18n

echo "=== Files using @rspress/core/runtime ==="
rg -n "from ['\"]@rspress/core/runtime['\"]" --type=tsx --type=ts 2>/dev/null || echo "No matches found"

echo ""
echo "=== Files using @rspress/runtime ==="
rg -n "from ['\"]@rspress/runtime['\"]" --type=tsx --type=ts 2>/dev/null || echo "No matches found"

echo ""
echo "=== All @rspress imports ==="
rg -n "from ['\"]@rspress" --type=tsx --type=ts | head -30

echo ""
echo "=== Check package.json for @rspress dependencies ==="
if [ -f "package.json" ]; then
  jq '.dependencies, .devDependencies' package.json 2>/dev/null | grep -i rspress || echo "No rspress deps found"
fi

Repository: alauda/knowledge

Length of output: 324


🏁 Script executed:

#!/bin/bash
# Search more broadly for the file and imports

echo "=== Looking for HomeBanner file ==="
find . -name "HomeBanner" -o -name "index.tsx" | grep -i homebanner

echo ""
echo "=== Looking for any @rspress imports (no type filter) ==="
rg "@rspress" | head -20

echo ""
echo "=== Check if the file exists ==="
[ -f "theme/components/HomeBanner/index.tsx" ] && echo "File exists" || echo "File does not exist"

echo ""
echo "=== List files in theme/components directory ==="
ls -la theme/components/ 2>/dev/null || echo "Directory does not exist"

echo ""
echo "=== Check package.json content ==="
cat package.json 2>/dev/null | head -50

Repository: alauda/knowledge

Length of output: 2982


🏁 Script executed:

#!/bin/bash
# Check the HomeBanner file content
echo "=== Content of theme/components/HomeBanner/index.tsx ==="
cat -n theme/components/HomeBanner/index.tsx

echo ""
echo "=== Search for useI18n imports in codebase ==="
rg "useI18n" --max-count=50

echo ""
echo "=== Check what @rspress exports ==="
rg "import.*from.*@rspress" | head -30

Repository: alauda/knowledge

Length of output: 4277


Change import path to match codebase convention.

The import uses @rspress/runtime while all other components in this project (BreadCrumb, SidebarMenu, PostList, HomeContent, Pagination, EditOnGithub) import from @rspress/core/runtime. Update to import { useI18n } from "@rspress/core/runtime"; for consistency.

🤖 Prompt for AI Agents
In theme/components/HomeBanner/index.tsx at line 1 the import path uses
"@rspress/runtime" which is inconsistent with the project's convention; change
the import to "@rspress/core/runtime" so it reads import { useI18n } from
"@rspress/core/runtime"; to match other components and maintain consistent
module resolution.


interface StyledProps {
className?: string;
Expand All @@ -9,8 +9,7 @@ interface BannerProps extends StyledProps {
}

export const HomeBanner: React.FC<BannerProps> = ({ className }) => {
const pageData = usePageData();
const t = useI18n();
const t = useI18n<typeof import("i18n")>();

// const logo =
// typeof pageData.siteData.logo === "string"
Expand Down
6 changes: 4 additions & 2 deletions theme/components/HomeContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useI18n, usePageData } from "@rspress/core/runtime";
import { Card, useFullTextSearch } from "@rspress/core/theme";
import { useFullTextSearch } from "@rspress/core/theme-original";
import { useCallback, useEffect, useMemo, useState } from "react";

import { PostInfo, postInfos } from "virtual-post-data";
Expand All @@ -13,10 +13,12 @@ import {
usePersistSearchParams,
useSessionStorage,
} from "../../hooks/SessionStorage";
import { Card } from "../Card";
import Checkbox from "../Checkbox";
import Pagination from "../Pagination";
import { PostList } from "../PostList";
import Search from "../Search";
import React from "react";

const SEARCHED_LIMIT = 1000;
const PAGE_SIZE = 10;
Expand All @@ -37,7 +39,7 @@ export const HomeContent: React.FC = () => {
const [searchedPosts, setSearchedPosts] = useState<PostInfo[]>([]);
const { page, siteData } = usePageData();
const [searchInitialized, setSearchInitialized] = useState<Boolean[]>([]);
const t = useI18n();
const t = useI18n<typeof import("i18n")>();

const searchFull = useCallback(
async (keyword: string) => {
Expand Down
Loading