@vuepress-plume/plugin-search 1.0.0-rc.55 → 1.0.0-rc.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import MiniSearch from 'minisearch';
|
|
2
2
|
import pMap from 'p-map';
|
|
3
|
+
import { colors, logger } from 'vuepress/utils';
|
|
3
4
|
const SEARCH_INDEX_DIR = 'internal/minisearchIndex/';
|
|
4
5
|
const indexByLocales = new Map();
|
|
5
6
|
const indexCache = new Map();
|
|
@@ -24,11 +25,15 @@ function getIndexCache(filepath) {
|
|
|
24
25
|
return index;
|
|
25
26
|
}
|
|
26
27
|
export async function prepareSearchIndex({ app, isSearchable, searchOptions, }) {
|
|
28
|
+
const start = performance.now();
|
|
27
29
|
const pages = isSearchable ? app.pages.filter(isSearchable) : app.pages;
|
|
28
30
|
await pMap(pages, p => indexFile(p, searchOptions), {
|
|
29
31
|
concurrency: 64,
|
|
30
32
|
});
|
|
31
33
|
await writeTemp(app);
|
|
34
|
+
if (app.env.isDebug) {
|
|
35
|
+
logger.info(`\n[${colors.green('@vuepress-plume/plugin-search')}] prepare search time spent: ${(performance.now() - start).toFixed(2)}ms`);
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
export async function onSearchIndexUpdated(filepath, { app, isSearchable, searchOptions, }) {
|
|
34
39
|
const pages = isSearchable ? app.pages.filter(isSearchable) : app.pages;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress-plume/plugin-search",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.56",
|
|
5
5
|
"description": "The Plugin for VuePres 2 - local search",
|
|
6
6
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"vuepress": "2.0.0-rc.9"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
37
|
+
"@vuepress/helper": "2.0.0-rc.28",
|
|
38
38
|
"@vueuse/core": "^10.9.0",
|
|
39
39
|
"@vueuse/integrations": "^10.9.0",
|
|
40
40
|
"chokidar": "^3.6.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"mark.js": "^8.11.1",
|
|
43
43
|
"minisearch": "^6.3.0",
|
|
44
44
|
"p-map": "^7.0.2",
|
|
45
|
-
"vue": "^3.4.
|
|
45
|
+
"vue": "^3.4.27"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|