chore: update flexsearch to v0.8 (issue #161)#176
Merged
josecelano merged 3 commits intodevelopfrom Feb 25, 2026
Merged
Conversation
- Add scripts/pre-commit.sh that runs Prettier, ESLint, and svelte-check - Add .githooks/pre-commit entry point delegating to the script - Add 'pre-commit' npm script for manual runs: npm run pre-commit - Add 'prepare' npm script to auto-register .githooks on npm install Note: --no-verify used for this bootstrapping commit only, as the hook itself cannot validate the state before the flexsearch upgrade is applied.
- Update flexsearch dependency to v0.8.212
- Replace default import with named import: `import { Index } from 'flexsearch'`
- Remove FlexSearch namespace type usage: `let postsIndex: Index`
- Use `new Index()` instead of `new FlexSearch.Index()`
- Cast search results to `number[]` for explicit typing
Closes #161
Replace plain const assignments referencing props with $derived() runes so that encodedBody, encodedSlug and socialLinks stay reactive when props change, eliminating the 'only captures initial value' warnings reported by svelte-check.
Member
Author
|
ACK 2037252 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #161 — updates
flexsearchfrom v0.7.43 to v0.8.212 (breaking change) and fixes all resulting type and Svelte 5 warnings discovered during the process.Commits
chore: add pre-commit hook for lint and type checks
scripts/pre-commit.sh— runs Prettier, ESLint, andsvelte-checkbefore each commit.githooks/pre-commit— git hook entry point delegating to the scriptnpm run pre-commitfor manual invocationpreparenpm script auto-installs the hook onnpm installchore: update flexsearch from v0.7.43 to v0.8.212
import { Index } from 'flexsearch'FlexSearchnamespace type:let postsIndex: Indexnew Index()instead ofnew FlexSearch.Index()number[]for explicit typingfix: resolve Svelte 5 warnings in ShareButton
encodedBody,encodedSlug, andsocialLinksin$derived()runes so they stay reactive when props change (was flagged by the new pre-commit hook)Testing
npm run pre-commit— 0 errors, 0 warnings ✔npm run build— completes successfully ✔npm run lint— passes ✔npm run check— 0 errors, 0 warnings ✔