Skip to content

Commit ace4972

Browse files
authored
chore: bump all dependencies (#327)
1 parent d3e9231 commit ace4972

18 files changed

Lines changed: 817 additions & 1494 deletions

File tree

.changeset/quiet-rivers-check.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@alauda/doom": minor
3+
---
4+
5+
chore: update dependencies and compatibility fixes
6+
7+
- Update Rspress, Mermaid, OpenAI, YAML, and related dependencies.
8+
- Use Rspress shared helpers for gray matter and GitHub slug generation.
9+
- Adapt runtime component typings for updated dependencies.
10+
- Handle assistant responses without a readable stream body.
11+
- Check image links during dead-link linting.

fixture-docs/zh/code-block.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sourceSHA: f9e3e3db6c15cb555df9be82c0e5642c4d27852d2a247365e2110253d0eaf521
2+
sourceSHA: 39b5943f98ff68b446f214ad4509025b0075d1c46fc78696643c66e826e5f366
33
---
44

55
```yaml before file="../en/assets/reference.yaml" after title="Whatever"

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,35 @@
3333
"version": "changeset version && yarn --no-immutable"
3434
},
3535
"devDependencies": {
36-
"@changesets/changelog-github": "^0.6.0",
37-
"@changesets/cli": "^2.30.0",
38-
"@rstest/core": "^0.9.6",
39-
"@rstest/coverage-istanbul": "^0.3.1",
36+
"@changesets/changelog-github": "^0.7.0",
37+
"@changesets/cli": "^2.31.0",
38+
"@rstest/core": "^0.9.10",
39+
"@rstest/coverage-istanbul": "^0.3.2",
4040
"@swc-node/register": "^1.11.1",
41-
"@swc/core": "^1.15.24",
41+
"@swc/core": "^1.15.33",
4242
"@types/cli-progress": "^3.11.6",
4343
"@types/ejs": "^3.1.5",
4444
"@types/masonry-layout": "^4.2.8",
4545
"@types/mdast": "^4.0.4",
46-
"@types/node": "^24.12.2",
46+
"@types/node": "^24.12.4",
4747
"@types/picomatch": "^4.0.3",
4848
"@types/pluralize": "^0.0.33",
4949
"@types/react-dom": "^19.2.3",
5050
"@types/swagger2openapi": "^7.0.4",
5151
"@unts/patch-package": "^8.1.1",
52-
"eslint": "^10.2.0",
52+
"eslint": "^10.3.0",
5353
"eslint-import-resolver-typescript": "^4.4.4",
5454
"eslint-plugin-import-x": "^4.16.2",
55-
"eslint-plugin-react-hooks": "^7.0.1",
55+
"eslint-plugin-react-hooks": "^7.1.1",
5656
"eslint-plugin-regexp": "^3.1.0",
57-
"nano-staged": "^1.0.0",
57+
"nano-staged": "^1.0.2",
5858
"npm-run-all2": "^8.0.4",
59-
"prettier": "^3.8.1",
59+
"prettier": "^3.8.3",
6060
"prettier-plugin-pkg": "^0.22.1",
6161
"prettier-plugin-properties": "^0.3.1",
6262
"simple-git-hooks": "^2.13.1",
6363
"type-coverage": "^2.29.7",
64-
"typescript": "^6.0.2",
64+
"typescript": "^6.0.3",
6565
"yarn-berry-deduplicate": "^6.1.3"
6666
},
6767
"typeCoverage": {

packages/doom/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,28 @@
4848
"@cspell/eslint-plugin": "^10.0.0",
4949
"@eslint-react/eslint-plugin": "^4.2.3",
5050
"@eslint/js": "^10.0.1",
51-
"@inquirer/prompts": "^8.4.1",
51+
"@inquirer/prompts": "^8.4.3",
5252
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
53-
"@rsbuild/plugin-react": "^1.4.6",
54-
"@rsbuild/plugin-sass": "^1.5.1",
55-
"@rsbuild/plugin-svgr": "^1.3.1",
53+
"@rsbuild/plugin-react": "^2.0.0",
54+
"@rsbuild/plugin-sass": "^1.5.2",
55+
"@rsbuild/plugin-svgr": "^2.0.2",
5656
"@rsbuild/plugin-yaml": "^1.0.4",
57-
"@rspress/core": "2.0.8",
58-
"@rspress/plugin-algolia": "2.0.8",
59-
"@rspress/plugin-sitemap": "2.0.8",
60-
"@rspress/shared": "2.0.8",
57+
"@rspress/core": "2.0.11",
58+
"@rspress/plugin-algolia": "2.0.11",
59+
"@rspress/plugin-sitemap": "2.0.11",
60+
"@rspress/shared": "2.0.11",
6161
"@shikijs/transformers": "^4.0.2",
6262
"@total-typescript/ts-reset": "^0.6.1",
6363
"@types/react": "^19.2.14",
6464
"ab64": "^0.1.6",
6565
"chokidar": "^5.0.0",
6666
"clsx": "^2.1.1",
6767
"commander": "^14.0.3",
68-
"ejs": "^5.0.1",
69-
"es-toolkit": "^1.45.1",
70-
"eslint": "^10.2.0",
68+
"ejs": "^5.0.2",
69+
"es-toolkit": "^1.46.1",
70+
"eslint": "^10.3.0",
7171
"eslint-plugin-mdx": "^3.7.0",
72-
"globals": "^17.4.0",
72+
"globals": "^17.6.0",
7373
"hastscript": "^9.0.1",
7474
"html-tag-names": "^2.1.0",
7575
"jsencrypt": "^3.5.4",
@@ -79,14 +79,14 @@
7979
"mdast-util-phrasing": "^4.1.0",
8080
"mdast-util-to-markdown": "^2.1.2",
8181
"mdast-util-to-string": "^4.0.0",
82-
"mermaid": "^11.14.0",
83-
"openai": "^6.33.0",
82+
"mermaid": "^11.15.0",
83+
"openai": "^6.37.0",
8484
"openapi-types": "^12.1.3",
8585
"p-ratelimit": "^1.0.1",
8686
"picomatch": "^4.0.4",
8787
"pluralize": "^8.0.0",
8888
"react-markdown": "^10.1.0",
89-
"react-tooltip": "^5.30.0",
89+
"react-tooltip": "^6.0.2",
9090
"rehype-raw": "^7.0.0",
9191
"rehype-sanitize": "^6.0.0",
9292
"remark-directive": "^4.0.0",
@@ -101,19 +101,19 @@
101101
"remark-mdx": "^3.1.1",
102102
"remark-message-control": "^8.0.0",
103103
"remark-stringify": "^11.0.0",
104-
"simple-git": "^3.35.2",
105-
"string-width": "^8.2.0",
104+
"simple-git": "^3.36.0",
105+
"string-width": "^8.2.1",
106106
"swagger2openapi": "^7.0.8",
107107
"tinyglobby": "^0.2.16",
108-
"type-fest": "^5.5.0",
109-
"typescript": "^6.0.2",
110-
"typescript-eslint": "^8.58.1",
108+
"type-fest": "^5.6.0",
109+
"typescript": "^6.0.3",
110+
"typescript-eslint": "^8.59.3",
111111
"unified": "^11.0.5",
112112
"unified-lint-rule": "^3.0.1",
113113
"unist-util-position": "^5.0.0",
114114
"unist-util-visit-parents": "^6.0.2",
115115
"x-fetch": "^0.2.6",
116-
"yaml": "^2.8.3",
116+
"yaml": "^2.9.0",
117117
"yoctocolors": "^2.1.2"
118118
}
119119
}

packages/doom/src/cli/helpers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RootContent } from 'mdast'
55
import { glob } from 'tinyglobby'
66
import { visit } from 'unist-util-visit'
77
import { xfetch } from 'x-fetch'
8-
import { parse } from 'yaml'
8+
import { parse, stringify } from 'yaml'
99

1010
import { FALSY_VALUES, TRUTHY_VALUES } from '../shared/index.ts'
1111
import type { NormalizedTermItem } from '../terms.ts'
@@ -39,6 +39,12 @@ export const getMatchedDocFilePaths = (matched: string[]) =>
3939
}),
4040
)
4141

42+
export const stringifyMatter = (frontmatter: object, content: string) =>
43+
'---\n' +
44+
stringify(frontmatter) +
45+
'---\n' +
46+
(content.startsWith('\n') ? content : '\n' + content)
47+
4248
/**
4349
* Support custom id like `#hello world {#custom-id}`
4450
* Avoid https://mdxjs.com/docs/troubleshooting-mdx/#could-not-parse-expression-with-acorn-error

packages/doom/src/cli/translate.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { isDeepStrictEqual } from 'node:util'
66

77
import { logger } from '@rspress/core'
88
import { removeLeadingSlash } from '@rspress/shared'
9+
import matter from '@rspress/shared/gray-matter'
910
import { Command } from 'commander'
1011
import ejs from 'ejs'
11-
import matter from 'gray-matter'
1212
import { OpenAI, RateLimitError } from 'openai'
1313
import { pRateLimit } from 'p-ratelimit'
1414
import { glob } from 'tinyglobby'
@@ -33,6 +33,7 @@ import {
3333
getMatchedDocFilePaths,
3434
parseBoolean,
3535
parseTerms,
36+
stringifyMatter,
3637
translateCodeFile,
3738
} from './helpers.js'
3839
import { loadConfig } from './load-config.js'
@@ -479,7 +480,7 @@ export const translateCommand = new Command('translate')
479480
if (await pathExists(targetFilePath, 'file')) {
480481
targetContent = await fs.readFile(targetFilePath, 'utf-8')
481482

482-
targetFrontmatter = matter(targetContent).data as I18nFrontmatter
483+
targetFrontmatter = matter(targetContent).data
483484

484485
if (!force && targetFrontmatter.sourceSHA === sourceSHA) {
485486
allSourceFilePaths.delete(sourceFilePath)
@@ -504,10 +505,7 @@ export const translateCommand = new Command('translate')
504505

505506
const { content } = matter(sourceContent)
506507

507-
targetContent = matter.stringify(
508-
content.startsWith('\n') ? content : '\n' + content,
509-
newFrontmatter,
510-
)
508+
targetContent = stringifyMatter(newFrontmatter, content)
511509

512510
const targetBase = path.dirname(targetFilePath)
513511
await fs.mkdir(targetBase, { recursive: true })
@@ -589,10 +587,7 @@ export const translateCommand = new Command('translate')
589587
delete newFrontmatter.title
590588
}
591589

592-
targetContent = matter.stringify(
593-
content.startsWith('\n') ? content : '\n' + content,
594-
newFrontmatter,
595-
)
590+
targetContent = stringifyMatter(newFrontmatter, content)
596591

597592
await fs.mkdir(targetBase, { recursive: true })
598593

packages/doom/src/global/Intelligence/AIAssistant/index.tsx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,34 +139,29 @@ export const AIAssistant = ({ open, onOpenChange }: AIAssistantProps) => {
139139
},
140140
})
141141

142-
const syncAssistantMessage = (nextMessage: {
143-
content: string
144-
thoughtProcess: string
145-
refDocs: ChatMessage['refDocs']
146-
}) => {
147-
if (sessionId !== sessionIdRef.current) {
148-
return
149-
}
150-
151-
flushMessages((messages) => [
152-
...messages.slice(0, index),
153-
{
154-
...messages[index],
155-
content: nextMessage.content,
156-
thoughtProcess: nextMessage.thoughtProcess || undefined,
157-
refDocs: nextMessage.refDocs,
158-
},
159-
...messages.slice(index + 1),
160-
])
142+
if (!res.body) {
143+
return
161144
}
162145

163-
await consumeSmartDocDisplayStream(
164-
res.body! as ReadableStream<Uint8Array | string>,
165-
{
166-
ignoreDocsBlocks: false,
167-
onDisplayMessage: syncAssistantMessage,
146+
await consumeSmartDocDisplayStream(res.body, {
147+
ignoreDocsBlocks: false,
148+
onDisplayMessage(nextMessage) {
149+
if (sessionId !== sessionIdRef.current) {
150+
return
151+
}
152+
153+
flushMessages((messages) => [
154+
...messages.slice(0, index),
155+
{
156+
...messages[index],
157+
content: nextMessage.content,
158+
thoughtProcess: nextMessage.thoughtProcess || undefined,
159+
refDocs: nextMessage.refDocs,
160+
},
161+
...messages.slice(index + 1),
162+
])
168163
},
169-
)
164+
})
170165
}
171166

172167
const [loading, setLoading] = useState(false)

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ export const SiteOverrides = () => {
5454
site.originalTitle ??= site.title
5555
site.title = title
5656

57-
let newTitle = (frontmatter.title as string) || articleTitle
57+
let newTitle = frontmatter.title || articleTitle
5858

5959
if (newTitle && pageType === 'doc') {
6060
// append main title as a suffix
61-
newTitle = concatTitle(
62-
newTitle,
63-
(frontmatter.titleSuffix as string) || title,
64-
)
61+
newTitle = concatTitle(newTitle, frontmatter.titleSuffix || title)
6562
} else if (pageType === 'home') {
66-
newTitle = concatTitle(title, frontmatter.titleSuffix as string)
63+
newTitle = concatTitle(title, frontmatter.titleSuffix)
6764
} else if (pageType === '404') {
6865
newTitle = concatTitle('404', title)
6966
} else {

packages/doom/src/plugins/replace/parse-toc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import Slugger from '@rspress/shared/github-slugger'
12
import { extractTextAndId } from '@rspress/shared/node-utils'
2-
import Slugger from 'github-slugger'
33
import type { Root } from 'mdast'
44
import { visitChildren } from 'unist-util-visit-children'
55

packages/doom/src/remark-lint/check-dead-links.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import path from 'node:path'
22

3-
import { PluginDriver, RouteService, remarkLink } from '@rspress/core'
3+
import {
4+
PluginDriver,
5+
RouteService,
6+
remarkImage,
7+
remarkLink,
8+
} from '@rspress/core'
49
import { isProduction } from '@rspress/shared'
510
import type { Root } from 'mdast'
611
import { lintRule } from 'unified-lint-rule'
@@ -41,5 +46,11 @@ export const checkDeadLinks = lintRule<Root>(
4146
remarkLinkOptions: config.markdown?.link,
4247
lint: true,
4348
})(tree, vfile)
49+
50+
remarkImage({
51+
docDirectory: config.root!,
52+
remarkImageOptions: config.markdown?.image,
53+
lint: true,
54+
})(tree, vfile)
4455
},
4556
)

0 commit comments

Comments
 (0)