Compare commits

...

4 Commits

Author SHA1 Message Date
pengzhanbo
e11c7a8fcd build: publish v1.0.0-rc.194 2026-04-14 15:37:37 +08:00
pengzhanbo
1329051536 chore: tweak 2026-04-14 15:36:15 +08:00
pengzhanbo
0677f6749e chore: update deps to latest 2026-04-14 15:31:38 +08:00
pengzhanbo
28963eb419
fix(plugin-search): fix search index race condition on pageUpdated, close #888 (#889) 2026-04-14 15:29:58 +08:00
10 changed files with 1476 additions and 1063 deletions

View File

@ -1,3 +1,10 @@
# [1.0.0-rc.194](https://github.com/pengzhanbo/vuepress-theme-plume/compare/v1.0.0-rc.193...v1.0.0-rc.194) (2026-04-14)
### Bug Fixes
* **plugin-search:** fix search index race condition on pageUpdated, close [#888](https://github.com/pengzhanbo/vuepress-theme-plume/issues/888) ([#889](https://github.com/pengzhanbo/vuepress-theme-plume/issues/889)) ([28963eb](https://github.com/pengzhanbo/vuepress-theme-plume/commit/28963eb419e9a1707157929fe546dc44d1ef771e))
# [1.0.0-rc.193](https://github.com/pengzhanbo/vuepress-theme-plume/compare/v1.0.0-rc.193...v1.0.0-rc.192) (2026-04-02)
### Bug Fixes

View File

@ -1,7 +1,7 @@
{
"name": "create-vuepress-theme-plume",
"type": "module",
"version": "1.0.0-rc.193",
"version": "1.0.0-rc.194",
"description": "The cli for create vuepress-theme-plume's project",
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
"license": "MIT",

View File

@ -1,7 +1,7 @@
{
"name": "vuepress-theme-plume-monorepo",
"type": "module",
"version": "1.0.0-rc.192",
"version": "1.0.0-rc.194",
"private": true,
"packageManager": "pnpm@10.33.0",
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
@ -93,7 +93,7 @@
"@typescript-eslint/types": "catalog:peer",
"@typescript-eslint/utils": "catalog:peer",
"@xmldom/xmldom": ">=0.9.9",
"baseline-browser-mapping": "^2.10.13",
"baseline-browser-mapping": "^2.10.18",
"chokidar": "catalog:prod",
"esbuild": "catalog:prod",
"lodash": ">=4.18.1",

View File

@ -1,7 +1,7 @@
{
"name": "@vuepress-plume/plugin-fonts",
"type": "module",
"version": "1.0.0-rc.193",
"version": "1.0.0-rc.194",
"description": "The Plugin for VuePress 2 - fonts",
"author": "pengzhanbo <volodymyr@foxmail.com>",
"license": "MIT",

View File

@ -1,7 +1,7 @@
{
"name": "vuepress-plugin-md-power",
"type": "module",
"version": "1.0.0-rc.193",
"version": "1.0.0-rc.194",
"description": "The Plugin for VuePress 2 - markdown power",
"author": "pengzhanbo <volodymyr@foxmail.com>",
"license": "MIT",

View File

@ -1,7 +1,7 @@
{
"name": "@vuepress-plume/plugin-search",
"type": "module",
"version": "1.0.0-rc.193",
"version": "1.0.0-rc.194",
"description": "The Plugin for VuePress 2 - local search",
"author": "pengzhanbo <volodymyr@foxmail.com>",
"license": "MIT",

View File

@ -165,6 +165,14 @@ export async function prepareSearchIndex({
}
}
let updateQueue = Promise.resolve()
async function queueUpdateIndexFile({ page, isSearchable, searchOptions }: UpdateSearchIndexOptions) {
updateQueue = updateQueue
.then(() => indexFile(page, searchOptions, isSearchable))
return updateQueue
}
/**
* Handle search index update when a page is modified.
*
@ -187,7 +195,8 @@ export async function onSearchIndexUpdated(
if (isSearchable && !isSearchable(page))
return
await indexFile(page, searchOptions, isSearchable)
// FIXME: onPageUpdated 存在竞态问题,当前使用异步队列避免
await queueUpdateIndexFile({ page, isSearchable, searchOptions })
await writeTemp(app)
}
@ -297,8 +306,11 @@ async function indexFile(page: Page, options: SearchIndexOptions['searchOptions'
${page.contentRendered}`
const sections = splitPageIntoSections(html)
if (cache && cache.length)
index.removeAll(cache)
try {
if (cache && cache.length)
index.removeAll(cache)
}
catch {}
// add sections to the locale index
for await (const section of sections) {

2448
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -24,29 +24,29 @@ catalogs:
'@commitlint/cli': ^20.5.0
'@commitlint/config-conventional': ^20.5.0
'@lunariajs/core': ^0.1.1
'@pengzhanbo/eslint-config-vue': ^2.2.0
'@pengzhanbo/stylelint-config': ^2.2.0
'@pengzhanbo/eslint-config-vue': ^2.3.0
'@pengzhanbo/stylelint-config': ^2.3.0
'@simonwep/pickr': ^1.9.1
'@types/express': ^5.0.6
'@types/js-yaml': ^4.0.9
'@types/less': ^3.0.8
'@types/markdown-it': ^14.1.2
'@types/minimist': ^1.2.5
'@types/node': ^25.5.0
'@types/picomatch': ^4.0.2
'@types/node': ^25.6.0
'@types/picomatch': ^4.0.3
'@types/qrcode': ^1.5.6
'@types/stylus': ^0.48.43
'@types/three': ^0.183.1
'@types/webpack-env': ^1.18.8
'@vitest/coverage-v8': ^4.1.2
'@vitest/coverage-v8': ^4.1.4
bumpp: ^11.0.1
commitizen: ^4.3.1
conventional-changelog: ^7.2.0
conventional-changelog-angular: ^8.3.1
cpx2: ^8.0.0
cpx2: ^8.0.2
cross-env: 7.0.3
cz-conventional-changelog: ^3.3.0
eslint: ^10.1.0
eslint: ^10.2.0
http-server: ^14.1.1
husky: ^9.1.7
less: ^4.6.4
@ -55,34 +55,34 @@ catalogs:
memfs: ^4.57.1
mermaid: ^11.14.0
minimist: ^1.2.8
postcss: ^8.5.8
postcss: ^8.5.9
rimraf: ^6.1.3
stylelint: ^17.6.0
stylelint: ^17.7.0
stylus: ^0.64.0
tsconfig-vuepress: ^7.0.0
tsdown: ^0.21.7
typescript: ^5.9.3
vite: ^8.0.3
vitest: ^4.1.2
wait-on: ^9.0.4
tsdown: ^0.21.8
typescript: ^6.0.2
vite: ^8.0.8
vitest: ^4.1.4
wait-on: ^9.0.5
peer:
'@eslint-community/eslint-utils': ^4.9.1
'@iconify/json': ^2.2.458
'@iconify/json': ^2.2.462
'@mathjax/src': ^4.1.1
'@pinyin-pro/data': ^1.3.1
'@typescript-eslint/types': ^8.58.0
'@typescript-eslint/utils': ^8.58.0
'@typescript-eslint/types': ^8.58.2
'@typescript-eslint/utils': ^8.58.2
artplayer: ^5.4.0
dashjs: ^5.1.1
gsap: ^3.14.2
hls.js: ^1.6.15
gsap: ^3.15.0
hls.js: ^1.6.16
mpegts.js: 1.7.3
ogl: ^1.0.11
pinyin-pro: ^3.28.0
pinyin-pro: ^3.28.1
postprocessing: ^6.39.0
pyodide: ^0.29.3
sass: ^1.98.0
sass-embedded: ^1.98.0
sass: ^1.99.0
sass-embedded: ^1.99.0
swiper: ^12.1.3
three: ^0.183.2
prod:
@ -104,7 +104,7 @@ catalogs:
chokidar: 5.0.0
dayjs: ^1.11.20
echarts: ^6.0.0
esbuild: ^0.27.5
esbuild: ^0.28.0
flowchart.ts: ^3.0.1
focus-trap: ^8.0.1
gray-matter: ^4.0.3
@ -112,9 +112,9 @@ catalogs:
hash-wasm: ^4.12.0
image-size: ^2.0.2
js-yaml: ^4.1.1
katex: ^0.16.44
katex: ^0.16.45
local-pkg: ^1.1.2
lru-cache: ^11.2.7
lru-cache: ^11.3.5
mark.js: ^8.11.1
markdown-it-cjk-friendly: ^2.0.2
markdown-it-container: ^4.0.0
@ -134,7 +134,7 @@ catalogs:
sort-package-json: ^3.6.1
tm-grammars: ^1.31.15
tm-themes: ^1.12.2
vue: ^3.5.31
vue: ^3.5.32
vue-router: ^5.0.4
vuepress:
'@vuepress/bundler-vite': 2.0.0-rc.28

View File

@ -1,7 +1,7 @@
{
"name": "vuepress-theme-plume",
"type": "module",
"version": "1.0.0-rc.193",
"version": "1.0.0-rc.194",
"description": "A Blog&Document Theme for VuePress 2.0",
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
"license": "MIT",