Merge branch 'main' into main

pull/4735/head
Guo 4 months ago committed by GitHub
commit 6ae2c38edc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -16,6 +16,6 @@
"postcss-rtlcss": "^5.7.0", "postcss-rtlcss": "^5.7.0",
"vitepress": "workspace:*", "vitepress": "workspace:*",
"vitepress-plugin-group-icons": "^1.5.2", "vitepress-plugin-group-icons": "^1.5.2",
"vitepress-plugin-llms": "^1.1.0" "vitepress-plugin-llms": "^1.1.3"
} }
} }

@ -97,24 +97,24 @@
"dependencies": { "dependencies": {
"@docsearch/css": "^3.9.0", "@docsearch/css": "^3.9.0",
"@docsearch/js": "^3.9.0", "@docsearch/js": "^3.9.0",
"@iconify-json/simple-icons": "^1.2.32", "@iconify-json/simple-icons": "^1.2.33",
"@shikijs/core": "^3.2.2", "@shikijs/core": "^3.4.0",
"@shikijs/transformers": "^3.2.2", "@shikijs/transformers": "^3.4.0",
"@shikijs/types": "^3.2.2", "@shikijs/types": "^3.4.0",
"@vitejs/plugin-vue": "^5.2.3", "@vitejs/plugin-vue": "^5.2.4",
"@vue/devtools-api": "^7.7.5", "@vue/devtools-api": "^7.7.6",
"@vue/shared": "^3.5.13", "@vue/shared": "^3.5.13",
"@vueuse/core": "^13.1.0", "@vueuse/core": "^13.1.0",
"@vueuse/integrations": "^13.1.0", "@vueuse/integrations": "^13.1.0",
"focus-trap": "^7.6.4", "focus-trap": "^7.6.4",
"mark.js": "8.11.1", "mark.js": "8.11.1",
"minisearch": "^7.1.2", "minisearch": "^7.1.2",
"shiki": "^3.2.2", "shiki": "^3.4.0",
"vite": "^6.3.2", "vite": "^6.3.5",
"vue": "^3.5.13" "vue": "^3.5.13"
}, },
"devDependencies": { "devDependencies": {
"@clack/prompts": "^0.10.1", "@clack/prompts": "^1.0.0-alpha.0",
"@iconify/utils": "^2.3.0", "@iconify/utils": "^2.3.0",
"@mdit-vue/plugin-component": "^2.1.4", "@mdit-vue/plugin-component": "^2.1.4",
"@mdit-vue/plugin-frontmatter": "^2.1.4", "@mdit-vue/plugin-frontmatter": "^2.1.4",
@ -139,7 +139,7 @@
"@types/markdown-it-container": "^2.0.10", "@types/markdown-it-container": "^2.0.10",
"@types/markdown-it-emoji": "^3.0.1", "@types/markdown-it-emoji": "^3.0.1",
"@types/minimist": "^1.2.5", "@types/minimist": "^1.2.5",
"@types/node": "^22.14.1", "@types/node": "^22.15.17",
"@types/picomatch": "^4.0.0", "@types/picomatch": "^4.0.0",
"@types/postcss-prefix-selector": "^1.16.3", "@types/postcss-prefix-selector": "^1.16.3",
"@types/prompts": "^2.4.9", "@types/prompts": "^2.4.9",
@ -147,12 +147,12 @@
"conventional-changelog-cli": "^5.0.0", "conventional-changelog-cli": "^5.0.0",
"cross-spawn": "^7.0.6", "cross-spawn": "^7.0.6",
"debug": "^4.4.0", "debug": "^4.4.0",
"esbuild": "^0.25.2", "esbuild": "^0.25.4",
"execa": "^9.5.2", "execa": "^9.5.3",
"fs-extra": "^11.3.0", "fs-extra": "^11.3.0",
"get-port": "^7.1.0", "get-port": "^7.1.0",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"lint-staged": "^15.5.1", "lint-staged": "^15.5.2",
"lodash.template": "^4.5.0", "lodash.template": "^4.5.0",
"lru-cache": "^11.1.0", "lru-cache": "^11.1.0",
"markdown-it": "^14.1.0", "markdown-it": "^14.1.0",
@ -177,17 +177,17 @@
"prompts": "^2.4.2", "prompts": "^2.4.2",
"punycode": "^2.3.1", "punycode": "^2.3.1",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"rollup": "^4.40.0", "rollup": "^4.40.2",
"rollup-plugin-dts": "6.1.1", "rollup-plugin-dts": "6.1.1",
"rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-esbuild": "^6.2.1",
"semver": "^7.7.1", "semver": "^7.7.1",
"simple-git-hooks": "^2.12.1", "simple-git-hooks": "^2.13.0",
"sirv": "^3.0.1", "sirv": "^3.0.1",
"sitemap": "^8.0.0", "sitemap": "^8.0.0",
"tinyglobby": "^0.2.13", "tinyglobby": "^0.2.13",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vitest": "^3.1.2", "vitest": "^3.1.3",
"vue-tsc": "^2.2.8", "vue-tsc": "^3.0.0-alpha.6",
"wait-on": "^8.0.3" "wait-on": "^8.0.3"
}, },
"peerDependencies": { "peerDependencies": {
@ -202,7 +202,7 @@
"optional": true "optional": true
} }
}, },
"packageManager": "pnpm@9.15.4", "packageManager": "pnpm@10.10.0",
"pnpm": { "pnpm": {
"peerDependencyRules": { "peerDependencyRules": {
"ignoreMissing": [ "ignoreMissing": [
@ -218,10 +218,6 @@
"@types/mdurl@2.0.0": "patches/@types__mdurl@2.0.0.patch", "@types/mdurl@2.0.0": "patches/@types__mdurl@2.0.0.patch",
"markdown-it-anchor@9.2.0": "patches/markdown-it-anchor@9.2.0.patch" "markdown-it-anchor@9.2.0": "patches/markdown-it-anchor@9.2.0.patch"
}, },
"onlyBuiltDependencies": [ "neverBuiltDependencies": []
"esbuild",
"playwright-chromium",
"simple-git-hooks"
]
} }
} }

File diff suppressed because it is too large Load Diff

@ -317,6 +317,8 @@
padding: 20px 0; padding: 20px 0;
background: transparent; background: transparent;
overflow-x: auto; overflow-x: auto;
/*rtl:ignore*/
text-align: left;
} }
.vp-doc [class*='language-'] code { .vp-doc [class*='language-'] code {

@ -329,12 +329,17 @@ export async function createMarkdownRenderer(
md.use(mathPlugin.default ?? mathPlugin, { md.use(mathPlugin.default ?? mathPlugin, {
...(typeof options.math === 'boolean' ? {} : options.math) ...(typeof options.math === 'boolean' ? {} : options.math)
}) })
const orig = md.renderer.rules.math_block! const origMathInline = md.renderer.rules.math_inline!
md.renderer.rules.math_block = (tokens, idx, options, env, self) => { md.renderer.rules.math_inline = function (...args) {
return orig(tokens, idx, options, env, self).replace( return origMathInline
/^<mjx-container /, .apply(this, args)
'<mjx-container tabindex="0" ' .replace(/^<mjx-container /, '<mjx-container v-pre ')
) }
const origMathBlock = md.renderer.rules.math_block!
md.renderer.rules.math_block = function (...args) {
return origMathBlock
.apply(this, args)
.replace(/^<mjx-container /, '<mjx-container v-pre tabindex="0" ')
} }
} catch (error) { } catch (error) {
throw new Error( throw new Error(

@ -85,31 +85,12 @@ export async function createVitePressPlugin(
} = siteConfig } = siteConfig
let markdownToVue: Awaited<ReturnType<typeof createMarkdownToVueRenderFn>> let markdownToVue: Awaited<ReturnType<typeof createMarkdownToVueRenderFn>>
const userCustomElementChecker =
userVuePluginOptions?.template?.compilerOptions?.isCustomElement
let isCustomElement = userCustomElementChecker
if (markdown?.math) {
isCustomElement = (tag) => {
if (tag.startsWith('mjx-')) {
return true
}
return userCustomElementChecker?.(tag) ?? false
}
}
// lazy require plugin-vue to respect NODE_ENV in @vue/compiler-x // lazy require plugin-vue to respect NODE_ENV in @vue/compiler-x
const vuePlugin = await import('@vitejs/plugin-vue').then((r) => const vuePlugin = await import('@vitejs/plugin-vue').then((r) =>
r.default({ r.default({
include: /\.(?:vue|md)$/, include: /\.(?:vue|md)$/,
...userVuePluginOptions, ...userVuePluginOptions
template: {
...userVuePluginOptions?.template,
compilerOptions: {
...userVuePluginOptions?.template?.compilerOptions,
isCustomElement
}
}
}) })
) )
@ -353,14 +334,18 @@ export async function createVitePressPlugin(
return null return null
}, },
generateBundle(_options, bundle) { generateBundle: {
order: ssr ? null : 'post',
handler(_options, bundle) {
if (ssr) { if (ssr) {
this.emitFile({ this.emitFile({
type: 'asset', type: 'asset',
fileName: 'package.json', fileName: 'package.json',
source: '{ "private": true, "type": "module" }' source: '{ "private": true, "type": "module" }'
}) })
} else { return
}
// client build: // client build:
// for each .md entry chunk, adjust its name to its correct path. // for each .md entry chunk, adjust its name to its correct path.
for (const name in bundle) { for (const name in bundle) {

Loading…
Cancel
Save