mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
chore(deps): upgrade fuse.js from v6.6.2 to v7.4.2
- Update CDN paths to dist/fuse.cjs in jsdelivr.yml and unpkg.yml - Replace local assets/lib/fuse/fuse.min.js with fuse.js (from dist/fuse.cjs) - Update librarybot.yml version to 7.4.2 - Update Hugo template fallback path to lib/fuse/fuse.js close #778
This commit is contained in:
@@ -34,8 +34,6 @@ libFiles:
|
||||
echartsJS: echarts@6.1.0/dist/echarts.min.js
|
||||
# @fortawesome/fontawesome-free@7.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@7.2.0/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.8.0 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.8.0/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.8.0/dist/gitalk.min.js
|
||||
|
||||
@@ -34,8 +34,6 @@ libFiles:
|
||||
echartsJS: echarts@6.1.0/dist/echarts.min.js
|
||||
# @fortawesome/fontawesome-free@7.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@7.2.0/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.8.0 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.8.0/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.8.0/dist/gitalk.min.js
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Fuse.js integration for FixIt.
|
||||
*
|
||||
* Responsibilities:
|
||||
* - Import ESM fuse.mjs and expose window.Fuse for search module.
|
||||
*/
|
||||
import Fuse from '../../lib/fuse/fuse.mjs'
|
||||
|
||||
window.Fuse = Fuse
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Third-party module declarations used by vendored libraries.
|
||||
*
|
||||
* Add future per-library declarations here when importing files that do not
|
||||
* ship TypeScript types (for example, local .mjs/.js vendor files).
|
||||
*/
|
||||
|
||||
declare module '../../lib/fuse/fuse.mjs' {
|
||||
export interface FuseSearchResult<T> {
|
||||
item: T
|
||||
refIndex: number
|
||||
score?: number
|
||||
matches?: Array<Record<string, any>>
|
||||
}
|
||||
|
||||
export interface FuseSearchOptions {
|
||||
limit?: number
|
||||
}
|
||||
|
||||
export default class Fuse<T> {
|
||||
constructor(list: readonly T[], options?: Record<string, any>, index?: unknown)
|
||||
search(pattern: string, options?: FuseSearchOptions): FuseSearchResult<T>[]
|
||||
setCollection(docs: readonly T[], index?: unknown): void
|
||||
}
|
||||
}
|
||||
|
||||
// Generic fallback for vendored ESM modules without declarations.
|
||||
declare module '*.mjs' {
|
||||
const mod: any
|
||||
export default mod
|
||||
}
|
||||
Vendored
-9
File diff suppressed because one or more lines are too long
Vendored
+1623
File diff suppressed because it is too large
Load Diff
@@ -42,8 +42,7 @@
|
||||
{{- with .Site.Home.OutputFormats.Get "search" -}}
|
||||
{{- $config = dict "type" "fuse" "fuseIndexURL" .RelPermalink | dict "search" | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- $source := $cdn.fuseJS | default "lib/fuse/fuse.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
|
||||
{{- dict "Source" "js/lib/fuse.ts" "Build" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
|
||||
{{- $config = dict "isCaseSensitive" $search.fuse.isCaseSensitive "minMatchCharLength" $search.fuse.minMatchCharLength "findAllMatches" $search.fuse.findAllMatches "location" $search.fuse.location "threshold" $search.fuse.threshold "distance" $search.fuse.distance "ignoreLocation" $search.fuse.ignoreLocation "useExtendedSearch" $search.fuse.useExtendedSearch "ignoreFieldNorm" $search.fuse.ignoreFieldNorm | dict "search" | merge $config -}}
|
||||
{{- else if eq $search.type "pagefind" -}}
|
||||
{{- $pagefind := $search.pagefind | default dict -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mq8yc9xg" -}}
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mq97iric" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
+3
-3
@@ -64,11 +64,11 @@ libraries:
|
||||
- from: css/all.min.css
|
||||
to: fontawesome-free/all.min.css
|
||||
- npm: fuse.js
|
||||
version: 7.3.0
|
||||
version: 7.4.2
|
||||
local:
|
||||
items:
|
||||
- from: dist/fuse.min.js
|
||||
to: fuse/fuse.min.js
|
||||
- from: dist/fuse.mjs
|
||||
to: fuse/fuse.mjs
|
||||
- npm: gitalk
|
||||
version: 1.8.0
|
||||
local:
|
||||
|
||||
Reference in New Issue
Block a user