@vuepress-plume/plugin-search 1.0.0-rc.152 → 1.0.0-rc.154

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.
@@ -3,13 +3,11 @@ import { SearchBoxLocales, SearchLocaleOptions } from "../../shared/index.js";
3
3
 
4
4
  //#region src/client/composables/locale.d.ts
5
5
  declare function useLocale(locales: MaybeRef<SearchBoxLocales>): ComputedRef<Partial<SearchLocaleOptions>>;
6
-
7
6
  //#endregion
8
7
  //#region src/client/composables/searchIndex.d.ts
9
8
  type SearchIndexData = Record<string, () => Promise<{
10
9
  default: string;
11
10
  }>>;
12
11
  declare function useSearchIndex(): ShallowRef<SearchIndexData>;
13
-
14
12
  //#endregion
15
13
  export { useLocale, useSearchIndex };
@@ -8,5 +8,6 @@ declare class LRUCache<K, V> {
8
8
  set(key: K, val: V): void;
9
9
  first(): K | undefined;
10
10
  clear(): void;
11
- } //#endregion
11
+ }
12
+ //#endregion
12
13
  export { LRUCache };
@@ -4,7 +4,7 @@ var LRUCache = class {
4
4
  cache;
5
5
  constructor(max = 10) {
6
6
  this.max = max;
7
- this.cache = new Map();
7
+ this.cache = /* @__PURE__ */ new Map();
8
8
  }
9
9
  get(key) {
10
10
  const item = this.cache.get(key);
@@ -8,7 +8,6 @@ declare function searchPlugin({
8
8
  isSearchable,
9
9
  ...searchOptions
10
10
  }?: SearchPluginOptions): Plugin;
11
-
12
11
  //#endregion
13
12
  //#region src/node/prepareSearchIndex.d.ts
14
13
  interface SearchIndexOptions {
@@ -21,6 +20,5 @@ declare function prepareSearchIndex({
21
20
  isSearchable,
22
21
  searchOptions
23
22
  }: SearchIndexOptions): Promise<void>;
24
-
25
23
  //#endregion
26
24
  export { prepareSearchIndex, searchPlugin };
package/lib/node/index.js CHANGED
@@ -151,8 +151,8 @@ const SEARCH_LOCALES = [
151
151
  //#endregion
152
152
  //#region src/node/prepareSearchIndex.ts
153
153
  const SEARCH_INDEX_DIR = "internal/minisearchIndex/";
154
- const indexByLocales = new Map();
155
- const indexCache = new Map();
154
+ const indexByLocales = /* @__PURE__ */ new Map();
155
+ const indexCache = /* @__PURE__ */ new Map();
156
156
  function getIndexByLocale(locale, options) {
157
157
  let index = indexByLocales.get(locale);
158
158
  if (!index) {
@@ -326,9 +326,10 @@ function searchPlugin({ locales = {}, isSearchable,...searchOptions } = {}) {
326
326
  searchOptions
327
327
  }),
328
328
  onWatched: (app$1, watchers) => {
329
- const searchIndexWatcher = chokidar.watch("pages/**/*.js", {
329
+ const searchIndexWatcher = chokidar.watch("pages", {
330
330
  cwd: app$1.dir.temp(),
331
- ignoreInitial: true
331
+ ignoreInitial: true,
332
+ ignored: (filepath, stats) => Boolean(stats?.isFile()) && !filepath.endsWith(".js")
332
333
  });
333
334
  searchIndexWatcher.on("add", (filepath) => {
334
335
  onSearchIndexUpdated(filepath, {
@@ -38,5 +38,6 @@ interface SearchOptions {
38
38
  */
39
39
  searchOptions?: Options["searchOptions"];
40
40
  };
41
- } //#endregion
41
+ }
42
+ //#endregion
42
43
  export { SearchBoxLocales, SearchLocaleOptions, SearchOptions, SearchPluginOptions };
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.152",
4
+ "version": "1.0.0-rc.154",
5
5
  "description": "The Plugin for VuePress 2 - local search",
6
6
  "author": "pengzhanbo <volodymyr@foxmail.com>",
7
7
  "license": "MIT",
@@ -34,15 +34,15 @@
34
34
  "vuepress": "2.0.0-rc.23"
35
35
  },
36
36
  "dependencies": {
37
- "@vuepress/helper": "2.0.0-rc.106",
38
- "@vueuse/core": "^13.3.0",
39
- "@vueuse/integrations": "^13.3.0",
40
- "chokidar": "3.6.0",
41
- "focus-trap": "^7.6.4",
37
+ "@vuepress/helper": "2.0.0-rc.110",
38
+ "@vueuse/core": "^13.4.0",
39
+ "@vueuse/integrations": "^13.4.0",
40
+ "chokidar": "4.0.3",
41
+ "focus-trap": "^7.6.5",
42
42
  "mark.js": "^8.11.1",
43
43
  "minisearch": "^7.1.2",
44
44
  "p-map": "^7.0.3",
45
- "vue": "^3.5.15"
45
+ "vue": "^3.5.17"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"