Skip to content

Commit faeb083

Browse files
committed
feat: bump rspress to v2.0.0-beta.20
1 parent 6f05b8a commit faeb083

File tree

17 files changed

+409
-351
lines changed

17 files changed

+409
-351
lines changed

.changeset/new-numbers-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/doom": patch
3+
---
4+
5+
feat: bump rspress to v2.0.0-beta.20

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
run: yarn format
3838

3939
- name: Apply autofix.ci
40-
uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1
40+
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # v1.3.2
4141
with:
4242
fail-fast: false

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
rm -rf $tempdir
4545
4646
- name: Deploy to GitHub Pages
47-
uses: peaceiris/actions-gh-pages@v4
47+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
4848
with:
4949
github_token: ${{ secrets.GITHUB_TOKEN }}
5050
publish_dir: ./dist

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default config(
6868
'doom-@global-virtual',
6969
'doom-@permission-functionResourcesMap',
7070
'doom-@permission-roleTemplatesMap',
71+
'virtual-runtime-config',
7172
],
7273
},
7374
],

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"@rsbuild/plugin-sass": "^1.3.3",
6868
"@rsbuild/plugin-svgr": "^1.2.1",
6969
"@rsbuild/plugin-yaml": "^1.0.2",
70-
"@rspress/core": "2.0.0-beta.14",
71-
"@rspress/plugin-algolia": "2.0.0-beta.14",
72-
"@rspress/plugin-llms": "2.0.0-beta.14",
70+
"@rspress/core": "2.0.0-beta.20",
71+
"@rspress/plugin-algolia": "2.0.0-beta.20",
72+
"@rspress/plugin-llms": "2.0.0-beta.20",
7373
"@shikijs/transformers": "^3.7.0",
7474
"@total-typescript/ts-reset": "^0.6.1",
7575
"chokidar": "^4.0.3",

shim.d.ts

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

25+
declare module 'virtual-runtime-config' {
26+
import type { NormalizedRuntimeConfig } from '@rspress/shared'
27+
28+
export const base: NormalizedRuntimeConfig['base']
29+
}
30+
2531
declare module 'md-attr-parser' {
2632
const parseAttrs: (value?: string | null) => {
2733
prop: Record<string, string>

src/cli/export.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const exportCommand = new Command('export')
6060
ServeOptions & GlobalCliOptions
6161
>()
6262

63-
let { config } = await loadConfig(root, {
63+
let { config, configFilePath } = await loadConfig(root, {
6464
...globalOptions,
6565
export: true,
6666
})
@@ -84,7 +84,7 @@ export const exportCommand = new Command('export')
8484

8585
logger.start('Serving...')
8686

87-
await serve({ config, host, port })
87+
await serve({ config, configFilePath, host, port })
8888

8989
const tempDir = path.resolve(outDir, '.doom')
9090

src/cli/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ program
137137
>()
138138

139139
const startDevServer = async () => {
140-
const { config, filepath } = await loadConfig(root, globalOptions)
140+
const { config, configFilePath } = await loadConfig(root, globalOptions)
141141

142142
const docDirectory = config.root!
143143

144144
try {
145145
devServer = await dev({
146146
config,
147+
configFilePath,
147148
appDirectory: CWD,
148149
docDirectory,
149150
extraBuilderConfig: {
@@ -156,8 +157,8 @@ program
156157
}
157158

158159
cliWatcher = watch(
159-
filepath
160-
? [filepath, config.i18nSourcePath!, docDirectory, SITES_FILE]
160+
configFilePath
161+
? [configFilePath, config.i18nSourcePath!, docDirectory, SITES_FILE]
161162
: [...CONFIG_FILES, docDirectory],
162163
{
163164
ignoreInitial: true,
@@ -217,7 +218,7 @@ program
217218
.action(async function (root?: string) {
218219
setNodeEnv('production')
219220

220-
const { config } = await loadConfig(
221+
const { config, configFilePath } = await loadConfig(
221222
root,
222223
this.optsWithGlobals<GlobalCliOptions>(),
223224
)
@@ -227,6 +228,7 @@ program
227228
const runBuild = () =>
228229
build({
229230
config,
231+
configFilePath,
230232
docDirectory,
231233
})
232234

@@ -252,9 +254,9 @@ program
252254
ServeOptions & GlobalCliOptions
253255
>()
254256

255-
const { config } = await loadConfig(root, globalOptions)
257+
const { config, configFilePath } = await loadConfig(root, globalOptions)
256258

257-
await serve({ config, host, port })
259+
await serve({ config, configFilePath, host, port })
258260
})
259261

260262
program.addCommand(newCommand)

src/cli/load-config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ const getCommonConfig = async ({
328328
server: {
329329
open,
330330
},
331+
performance: {
332+
buildCache: {
333+
cacheDigest: [root, configFilePath, base, version],
334+
},
335+
},
331336
tools: {
332337
rspack(rspackConfig, { mergeConfig, rspack }) {
333338
return mergeConfig(rspackConfig, {
@@ -387,7 +392,7 @@ export async function loadConfig(
387392
}: GlobalCliOptions = {},
388393
): Promise<{
389394
config: UserConfig
390-
filepath?: string
395+
configFilePath: string
391396
}> {
392397
let configFilePath: string | undefined
393398

@@ -538,13 +543,9 @@ export async function loadConfig(
538543
(isExplicitlyUnversioned(version) ? UNVERSIONED : outDir ? version : '')
539544
}`
540545

541-
if (mergedConfig.builderConfig?.server?.open === true) {
542-
mergedConfig.builderConfig.server.open = mergedConfig.base
543-
}
544-
545546
return {
546547
config: mergedConfig,
547-
filepath: configFilePath,
548+
configFilePath: configFilePath || '',
548549
}
549550
}
550551

src/global/VersionsNav/NavMenuGroup.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { Tag } from '@rspress/core/theme'
22
import {
33
isExternalUrl,
4-
matchNavbar,
54
type NavItem,
65
type NavItemWithChildren,
76
type NavItemWithLink,
87
type NavItemWithLinkAndChildren,
98
} from '@rspress/shared'
109
import { useRef, useState, type ReactNode } from 'react'
1110

11+
import { matchNavbar } from '../../shared/index.js'
12+
1213
import { Down } from './Down.js'
1314
import {
1415
NavMenuSingleItem,

0 commit comments

Comments
 (0)