Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/green-cobras-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/doom": minor
---

chore: bump rspress to v2.0.0-rc.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.11.0
24.11.1
12 changes: 0 additions & 12 deletions docs/en/usage/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,3 @@ graph TD;
```

With [Markdown Preview Mermaid](https://github.com/mjbvz/vscode-markdown-mermaid), you can preview in real time in VSCode.

## Attribute Extensions {#attributes}

:::warning
Currently only supported in `.md` files, see [related issue](https://github.com/web-infra-dev/rspress/issues/2215#issuecomment-3018371927)
:::

```md
![](/logo.svg){width="100" height="100"}
```

![](/logo.svg){width="100" height="100"}
12 changes: 0 additions & 12 deletions docs/zh/usage/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,3 @@ graph TD;
```

配合 [Markdown Preview Mermaid](https://github.com/mjbvz/vscode-markdown-mermaid) 可以在 VSCode 中实时预览。

## 属性扩展 \{#attributes}

:::warning
当前仅支持在 `.md` 文件中使用,参考[相关 issue](https://github.com/web-infra-dev/rspress/issues/2215#issuecomment-3018371927)
:::

```md
![](/logo.svg){width="100" height="100"}
```

![](/logo.svg){width="100" height="100"}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
"version": "changeset version && yarn --no-immutable"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.7",
"@eslint/js": "^9.38.0",
"@changesets/changelog-github": "^0.5.2",
"@changesets/cli": "^2.29.8",
"@eslint/js": "^9.39.2",
"@swc-node/register": "^1.11.1",
"@swc/core": "^1.14.0",
"@swc/core": "^1.15.4",
"@types/cli-progress": "^3.11.6",
"@types/ejs": "^3.1.5",
"@types/mdast": "^4.0.4",
"@types/node": "^24.0.0",
"@types/node": "^24.10.4",
"@types/picomatch": "^4.0.2",
"@types/pluralize": "^0.0.33",
"@types/react-dom": "^19.2.2",
"@types/react-dom": "^19.2.3",
"@types/swagger2openapi": "^7.0.4",
"@unts/patch-package": "^8.1.1",
"eslint": "^9.38.0",
"eslint": "^9.39.2",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-regexp": "^2.10.0",
"nano-staged": "^0.8.0",
"nano-staged": "^0.9.0",
"npm-run-all2": "^8.0.4",
"prettier": "^3.6.2",
"prettier": "^3.7.4",
"prettier-plugin-pkg": "^0.21.2",
"prettier-plugin-properties": "^0.3.0",
"simple-git-hooks": "^2.13.1",
Expand Down
46 changes: 23 additions & 23 deletions packages/doom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,40 @@
],
"dependencies": {
"@alauda/doom-export": "^0.2.1",
"@cspell/eslint-plugin": "^9.2.2",
"@eslint-react/eslint-plugin": "^2.2.4",
"@inquirer/prompts": "^7.9.0",
"@cspell/eslint-plugin": "^9.4.0",
"@eslint-react/eslint-plugin": "^2.3.13",
"@inquirer/prompts": "^8.1.0",
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
"@rsbuild/plugin-react": "^1.4.1",
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/plugin-sass": "^1.4.0",
"@rsbuild/plugin-svgr": "^1.2.2",
"@rsbuild/plugin-svgr": "^1.2.3",
"@rsbuild/plugin-yaml": "^1.0.3",
"@rspress/core": "2.0.0-beta.34",
"@rspress/plugin-algolia": "2.0.0-beta.34",
"@rspress/plugin-llms": "2.0.0-beta.34",
"@rspress/plugin-sitemap": "2.0.0-beta.34",
"@rspress/shared": "2.0.0-beta.34",
"@shikijs/transformers": "^3.14.0",
"@rspress/core": "2.0.0-rc.2",
"@rspress/plugin-algolia": "2.0.0-rc.2",
"@rspress/plugin-llms": "2.0.0-rc.2",
"@rspress/plugin-sitemap": "2.0.0-rc.2",
"@rspress/shared": "2.0.0-rc.2",
"@shikijs/transformers": "^3.20.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/react": "^19.2.2",
"@types/react": "^19.2.7",
"ab64": "^0.1.6",
"chokidar": "^4.0.3",
"chokidar": "^5.0.0",
"clsx": "^2.1.1",
"commander": "^14.0.2",
"ejs": "^3.1.10",
"es-toolkit": "^1.41.0",
"eslint": "^9.38.0",
"es-toolkit": "^1.43.0",
"eslint": "^9.39.2",
"eslint-plugin-mdx": "^3.6.2",
"globals": "^16.4.0",
"globals": "^16.5.0",
"html-tag-names": "^2.1.0",
"jsencrypt": "^3.5.4",
"mdast-util-mdx": "^3.0.0",
"mdast-util-mdx-jsx": "^3.2.0",
"mdast-util-phrasing": "^4.1.0",
"mdast-util-to-markdown": "^2.1.2",
"mdast-util-to-string": "^4.0.0",
"mermaid": "^11.12.1",
"openai": "^6.7.0",
"mermaid": "^11.12.2",
"openai": "^6.10.0",
"openapi-types": "^12.1.3",
"p-ratelimit": "^1.0.1",
"picomatch": "^4.0.3",
Expand All @@ -95,20 +95,20 @@
"remark-mdx": "^3.1.1",
"remark-message-control": "^8.0.0",
"remark-stringify": "^11.0.0",
"shiki": "^3.14.0",
"simple-git": "^3.28.0",
"shiki": "^3.20.0",
"simple-git": "^3.30.0",
"string-width": "^8.1.0",
"swagger2openapi": "^7.0.8",
"tinyglobby": "^0.2.15",
"type-fest": "^5.1.0",
"type-fest": "^5.3.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2",
"typescript-eslint": "^8.49.0",
"unified": "^11.0.5",
"unified-lint-rule": "^3.0.1",
"unist-util-position": "^5.0.0",
"unist-util-visit-parents": "^6.0.2",
"x-fetch": "^0.2.6",
"yaml": "^2.8.1",
"yaml": "^2.8.2",
"yoctocolors": "^2.1.2"
}
}
62 changes: 17 additions & 45 deletions packages/doom/src/cli/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,41 +63,16 @@ import { defaultGitHubUrl, isDoc } from './helpers.ts'
const DEFAULT_LOGO = '/logo.svg'

const KNOWN_LOCALE_CONFIGS: Partial<
Record<
string,
Omit<LocaleConfig, 'lang' | 'editLink'> & { editLink: { text: string } }
>
Record<string, Omit<LocaleConfig, 'lang'>>
> = {
en: {
label: 'English',
editLink: {
text: '📝 Edit this page on GitHub',
},
},
zh: {
label: '简体中文',
searchPlaceholderText: '搜索文档',
searchNoResultsText: '未搜索到相关结果',
searchSuggestedQueryText: '可更换不同的关键字后重试',
outlineTitle: '本页概览',
prevPageText: '上一页',
nextPageText: '下一页',
editLink: {
text: '📝 在 GitHub 上编辑此页',
},
},
ru: {
label: 'Русский',
searchPlaceholderText: 'Поиск документов',
searchNoResultsText: 'Не найдено соответствующих результатов',
searchSuggestedQueryText:
'Попробуйте изменить ключевые слова и повторить поиск',
outlineTitle: 'Обзор страницы',
prevPageText: 'Предыдущая страница',
nextPageText: 'Следующая страница',
editLink: {
text: '📝 Редактировать эту страницу на GitHub',
},
},
}

Expand Down Expand Up @@ -221,14 +196,6 @@ const getCommonConfig = async ({
lang: name,
label: name,
...KNOWN_LOCALE_CONFIGS[name],
editLink:
editRepoEnabled && editRepoBaseUrl
? {
docRepoBaseUrl: editRepoBaseUrl,
...KNOWN_LOCALE_CONFIGS.en!.editLink,
...KNOWN_LOCALE_CONFIGS[name]?.editLink,
}
: undefined,
})
}
}
Expand All @@ -238,7 +205,7 @@ const getCommonConfig = async ({
locales.map(({ lang }) => lang),
)

const { editLink, ...zhLocale } = KNOWN_LOCALE_CONFIGS.zh!
const zhLocale = KNOWN_LOCALE_CONFIGS.zh!

const algoliaOptions =
((algolia && config.algolia) ??
Expand Down Expand Up @@ -300,17 +267,12 @@ const getCommonConfig = async ({
},
themeConfig: {
enableScrollToTop: true,
// https://github.com/web-infra-dev/rspress/issues/2011
outline: true,
localeRedirect: redirect,
...(fallbackToZh
? editRepoEnabled && editRepoBaseUrl
? {
...zhLocale,
editLink: { ...editLink, docRepoBaseUrl: editRepoBaseUrl },
}
: zhLocale
: { locales }),
...(editRepoEnabled &&
editRepoBaseUrl && {
editLink: { docRepoBaseUrl: editRepoBaseUrl },
}),
...(fallbackToZh ? zhLocale : { locales }),
},
plugins: [
algoliaOptions && pluginAlgolia(),
Expand Down Expand Up @@ -361,6 +323,11 @@ const getCommonConfig = async ({
tools: {
rspack(rspackConfig, { mergeConfig, rspack }) {
return mergeConfig(rspackConfig, {
ignoreWarnings: [
{
module: /\bflexsearch\b/,
},
],
resolve: {
extensionAlias: {
'.js': ['.ts', '.tsx', '.js'],
Expand All @@ -383,6 +350,11 @@ const getCommonConfig = async ({
},
},
},
ssg: {
experimentalWorker: true,
},
// https://github.com/web-infra-dev/rspress/issues/2894
// llms: true,
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/global/AuthCheck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const AuthCheck = () => {
) {
return
}
navigate(
void navigate(
`${lang === site.lang ? '' : `/${lang}`}/login.html?from=${encodeURIComponent(`${pathname}${search}${hash}`)}`,
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/global/SiteOverrides/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect } from 'react'
import { useSiteOverrides } from '@alauda/doom/runtime'

const setNavBarSpans = (logoText: string) => {
const navBarLinks = document.querySelectorAll('[class^=navBarTitle] > a')
const navBarLinks = document.querySelectorAll('.rp-nav__title__link')

if (!navBarLinks.length) {
return
Expand Down
6 changes: 4 additions & 2 deletions packages/doom/src/login/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { clsx } from 'clsx'
import type { ButtonHTMLAttributes } from 'react'

export interface ButtonProps
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
export interface ButtonProps extends Omit<
ButtonHTMLAttributes<HTMLButtonElement>,
'type'
> {
type?: 'primary'
htmlType?: 'submit' | 'reset' | 'button'
block?: boolean
Expand Down
4 changes: 1 addition & 3 deletions packages/doom/src/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ const Login = () => {
const navigate = useNavigate()
const [query] = useSearchParams()
const from = query.get('from')
const onLoggedIn = useCallback(() => {
navigate(from || '/')
}, [from, navigate])
const onLoggedIn = useCallback(() => navigate(from || '/'), [from, navigate])
const dark = useDark()
const t = useTranslation()
return (
Expand Down
8 changes: 2 additions & 6 deletions packages/doom/src/plugins/directives/remark-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const CONTAINER_DIRECTIVE_TYPES = new Set([
'danger',
'info',
'details',
'$$$callout$$$',
])

export const remarkDirectives: Plugin<[], Root> = function () {
Expand All @@ -28,12 +29,7 @@ export const remarkDirectives: Plugin<[], Root> = function () {

if (
node.type === 'containerDirective' &&
(CONTAINER_DIRECTIVE_TYPES.has(node.name) ||
// https://github.com/web-infra-dev/rspress/pull/2403
(!node.name &&
data.hProperties?.class
?.toString()
.startsWith('rspress-directive')))
CONTAINER_DIRECTIVE_TYPES.has(node.name)
) {
return
}
Expand Down
3 changes: 1 addition & 2 deletions packages/doom/src/plugins/replace/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export interface ReferenceItem extends ReferenceItemRemote {
}

export interface NormalizedReferenceSource
extends ReferenceItemRemote,
ReferenceItemSource {
extends ReferenceItemRemote, ReferenceItemSource {
anchor?: string
}

Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/runtime/components/Badge.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Badge, Badge as default } from '@rspress/core/theme'
export { Badge, Badge as default } from '@rspress/core/theme-original'
3 changes: 1 addition & 2 deletions packages/doom/src/runtime/components/ExternalSiteLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { useIsPrint } from '../hooks/index.js'

import { Directive } from './Directive.js'

export interface ExternalSiteLinkProps
extends AnchorHTMLAttributes<HTMLAnchorElement> {
export interface ExternalSiteLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
name: string
children: ReactNode
}
Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/runtime/components/JsonViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeBlockRuntime, Tab, Tabs } from '@rspress/core/theme'
import { CodeBlockRuntime, Tab, Tabs } from '@rspress/core/theme-original'
import type { JsonValue } from 'type-fest'
import { stringify } from 'yaml'

Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/runtime/components/K8sCrd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* modified based on @see https://github.com/crdsdev/doc/blob/main/template/doc.html
*/

import { Badge, Button } from '@rspress/core/theme'
import { Badge, Button } from '@rspress/core/theme-original'
import crdsMap from 'doom-@api-crdsMap'
import type { OpenAPIV3_1 } from 'openapi-types'
import { useCallback, useEffect, useMemo, useState } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion packages/doom/src/runtime/components/OpenAPIPath.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { usePage } from '@rspress/core/runtime'
import { Badge } from '@rspress/core/theme'
import { Badge } from '@rspress/core/theme-original'
import openapisMap from 'doom-@api-openapisMap'
import virtual from 'doom-@api-virtual'
import BananaSlug from 'github-slugger'
Expand Down
Loading
Loading