Skip to content

Commit da95cce

Browse files
committed
chore(deps): bump rspress to v2.0.0-beta.29
1 parent c40c221 commit da95cce

File tree

9 files changed

+289
-321
lines changed

9 files changed

+289
-321
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default config(
6868
'doom-@global-virtual',
6969
'doom-@permission-functionResourcesMap',
7070
'doom-@permission-roleTemplatesMap',
71-
'virtual-runtime-config',
71+
'virtual-site-data',
7272
],
7373
},
7474
],

fixture-docs/en/link.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
[my long link text that exceeds the maximum length]()
44

55
[我的长链接文本超过最大长度最大长度](/zh/)
6+
7+
[data.sql](/data.sql)

fixture-docs/public/data.sql

Whitespace-only changes.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"@types/node": "^22.18.0",
4343
"@types/picomatch": "^4.0.2",
4444
"@types/pluralize": "^0.0.33",
45-
"@types/react": "^19.1.11",
46-
"@types/react-dom": "^19.1.8",
45+
"@types/react": "^19.1.12",
46+
"@types/react-dom": "^19.1.9",
4747
"@types/swagger2openapi": "^7.0.4",
4848
"@unts/patch-package": "^8.1.1",
4949
"eslint": "^9.34.0",

packages/doom/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@
4242
"dependencies": {
4343
"@alauda/doom-export": "^0.1.0",
4444
"@cspell/eslint-plugin": "^8.19.4 || ^9.2.0",
45-
"@eslint-react/eslint-plugin": "^1.52.6",
45+
"@eslint-react/eslint-plugin": "^1.52.7",
4646
"@inquirer/prompts": "^7.8.4",
4747
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
4848
"@playwright/browser-chromium": "^1.55.0",
49-
"@rsbuild/plugin-react": "^1.3.5",
49+
"@rsbuild/plugin-react": "^1.4.0",
5050
"@rsbuild/plugin-sass": "^1.4.0",
5151
"@rsbuild/plugin-svgr": "^1.2.2",
5252
"@rsbuild/plugin-yaml": "^1.0.3",
53-
"@rspress/core": "2.0.0-beta.28",
54-
"@rspress/plugin-algolia": "2.0.0-beta.28",
55-
"@rspress/plugin-llms": "2.0.0-beta.28",
56-
"@rspress/plugin-sitemap": "2.0.0-beta.28",
57-
"@rspress/shared": "2.0.0-beta.28",
53+
"@rspress/core": "2.0.0-beta.29",
54+
"@rspress/plugin-algolia": "2.0.0-beta.29",
55+
"@rspress/plugin-llms": "2.0.0-beta.29",
56+
"@rspress/plugin-sitemap": "2.0.0-beta.29",
57+
"@rspress/shared": "2.0.0-beta.29",
5858
"@shikijs/transformers": "^3.12.0",
5959
"@total-typescript/ts-reset": "^0.6.1",
6060
"ab64": "^0.1.6",

packages/doom/shim.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ declare module 'doom-@permission-roleTemplatesMap' {
2222
export default roleTemplatesMap
2323
}
2424

25-
declare module 'virtual-runtime-config' {
26-
import type { NormalizedRuntimeConfig } from '@rspress/shared'
25+
declare module 'virtual-site-data' {
26+
import { SiteData } from '@rspress/shared'
2727

28-
export const base: NormalizedRuntimeConfig['base']
28+
const data: SiteData
29+
export default data
2930
}
3031

3132
declare module 'md-attr-parser' {

packages/doom/src/cli/load-config.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fs_ from 'node:fs'
12
import fs from 'node:fs/promises'
23
import path from 'node:path'
34
import { fileURLToPath } from 'node:url'
@@ -234,6 +235,8 @@ const getCommonConfig = async ({
234235
: algolia === 'alauda-ru' && ALAUDA_RU_ALGOLIA_OPTIONS)) ||
235236
null
236237

238+
const publicPath = path.resolve(root, 'public')
239+
237240
return {
238241
userBase,
239242
root,
@@ -255,6 +258,17 @@ const getCommonConfig = async ({
255258
},
256259
markdown: {
257260
defaultWrapCode: export_,
261+
link: {
262+
checkDeadLinks: {
263+
excludes(url) {
264+
if (!url.startsWith('/')) {
265+
return false
266+
}
267+
const { pathname } = new URL(url, 'https://example.com')
268+
return fs_.existsSync(path.resolve(publicPath, pathname.slice(1)))
269+
},
270+
},
271+
},
258272
shiki: {
259273
transformers: [
260274
// builtin transformers
@@ -517,7 +531,7 @@ export async function loadConfig(
517531
}
518532

519533
if (ensureDefaultLogo) {
520-
const publicPath = path.resolve(mergedConfig.root!, `public`)
534+
const publicPath = path.resolve(mergedConfig.root!, 'public')
521535
await fs.mkdir(publicPath, { recursive: true })
522536
const logoPath = path.resolve(publicPath, removeLeadingSlash(DEFAULT_LOGO))
523537

packages/doom/src/global/VersionsNav/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import virtual from 'doom-@global-virtual'
44
import { noop } from 'es-toolkit'
55
import { useEffect, useMemo, useState } from 'react'
66
import { createPortal } from 'react-dom'
7-
import { base } from 'virtual-runtime-config'
7+
import siteData from 'virtual-site-data'
88
import { parse } from 'yaml'
99

1010
import {
@@ -66,7 +66,7 @@ const VersionsNav_ = () => {
6666
return [
6767
isExplicitlyUnversioned(virtual.version)
6868
? undefined
69-
: base.slice(0, -unversionedVersion.length - 1),
69+
: siteData.base.slice(0, -unversionedVersion.length - 1),
7070
unversionedVersion,
7171
]
7272
}, [])
@@ -83,7 +83,7 @@ const VersionsNav_ = () => {
8383
}
8484
} else {
8585
const res = await fetch(
86-
`${isProduction() ? versionsBase : base}/versions.yaml`,
86+
`${isProduction() ? versionsBase : siteData.base}/versions.yaml`,
8787
)
8888
if (!res.ok) {
8989
return
@@ -162,7 +162,7 @@ const VersionsNav_ = () => {
162162
text={version}
163163
base={versionsBase}
164164
items={navItems}
165-
pathname={base}
165+
pathname={siteData.base}
166166
/>
167167
)}
168168
</>,

0 commit comments

Comments
 (0)