Skip to content

Commit 96c77bc

Browse files
chore(deps): update dev-dependencies (#927)
* chore(deps): update dev-dependencies * fix: search updates when bumping flexsearch * fix: index files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Derek Croote <dcroote@users.noreply.github.com>
1 parent bc4d74e commit 96c77bc

22 files changed

Lines changed: 33 additions & 82 deletions

docs/_components/search/SearchBtn.vue

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ export default {
114114
// Store the search words into localStorage
115115
localStorage.setItem('search-words', val.toLowerCase());
116116
this.sendEvent();
117-
let ids = this.index.search({
118-
query: val.toLowerCase(),
119-
index: ['content'],
120-
limit: 1000,
121-
});
117+
let ids = this.index.search(val.toLowerCase(), { limit: 1000 });
122118
this.found = ids.length;
123119
124120
// Cut the results array down to 100 rows
@@ -181,35 +177,16 @@ export default {
181177
this.index = new FlexSearch.Index({
182178
tokenize: 'full',
183179
});
184-
let cfg,
185-
ctx,
186-
map,
187-
reg = undefined;
180+
181+
// flexsearch 0.8.x uses different export format: 1.map.json, 1.reg.json
182+
// Use relative paths - works for dev, serve, and production since files are in public/
183+
let mapData, regData;
188184
// console.log('buildIndex() MODE', import.meta.env.MODE);
189-
if (import.meta.env.MODE === 'development') {
190-
cfg = await axios.get(`/indexes/${name}/cfg.json`);
191-
ctx = await axios.get(`/indexes/${name}/ctx.json`);
192-
map = await axios.get(`/indexes/${name}/map.json`);
193-
reg = await axios.get(`/indexes/${name}/reg.json`);
194-
} else {
195-
cfg = await axios.get(
196-
`https://raw.githubusercontent.com/api3dao/airnode-docs/main/docs/public/indexes/${name}/cfg.json`
197-
);
198-
ctx = await axios.get(
199-
`https://raw.githubusercontent.com/api3dao/airnode-docs/main/docs/public/indexes/${name}/ctx.json`
200-
);
201-
map = await axios.get(
202-
`https://raw.githubusercontent.com/api3dao/airnode-docs/main/docs/public/indexes/${name}/map.json`
203-
);
204-
reg = await axios.get(
205-
`https://raw.githubusercontent.com/api3dao/airnode-docs/main/docs/public/indexes/${name}/reg.json`
206-
);
207-
}
185+
mapData = await axios.get(`/indexes/${name}/1.map.json`);
186+
regData = await axios.get(`/indexes/${name}/1.reg.json`);
208187
209-
this.index.import('cfg', cfg.data);
210-
this.index.import('ctx', ctx.data);
211-
this.index.import('map', map.data);
212-
this.index.import('reg', reg.data);
188+
this.index.import('1.map', mapData.data);
189+
this.index.import('1.reg', regData.data);
213190
this.isIndexLoaded = true;
214191
},
215192
},

docs/public/indexes/all-dev/1.map.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341]

docs/public/indexes/all-dev/cfg.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/public/indexes/all-dev/ctx.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/public/indexes/all-dev/map.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/public/indexes/all-dev/reg.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/public/indexes/all/1.map.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/public/indexes/all/1.reg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334]

docs/public/indexes/all/cfg.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)