jekyll-client-search 0.3.3 → 0.3.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -0
- data/assets/client-search-base.js +2 -2
- data/assets/client-search-dropdown.js +2 -2
- data/assets/client-search-related.js +1 -1
- data/assets/query-embedders/transformers-worker.js +3 -0
- data/lib/jekyll/client_search/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74262c7813a4c946b9a4c9c7d7a19aa1d866dedfdf82781131e5edbe9aabbdef
|
|
4
|
+
data.tar.gz: 6ebbd6018cfc419d586d50d60d7d346c5a6c0a7b442275caf55fc22d3420a797
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 402221144b4bbf95e1daf759430c6a59fad8025d650f4f84624146ed44951de2e34755a1e335f478aeabe2fbec693f2b95c74c64aad1ff19e54b3a1e30213ee8
|
|
7
|
+
data.tar.gz: 84d405d332fdd45895885b43dc408a46574b97f26f2b1742513ad97f9910e0ed96f6bb4ddff0c4cf0148751b2a0348b97b5adaa41aab57ba5c724c07f0827d5e
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.3.4 — 2026-09-11
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- SonarQube Cloud badge in README.md (project key: `gundestrup_jekyll-client-search`)
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Verify `event.origin` in transformers-worker.js `message` listener to prevent cross-origin message injection (SonarQube: `javascript:S2819`, CRITICAL)
|
|
12
|
+
- Add `--ignore-scripts` to `npm ci` in CI to prevent lifecycle script execution during dependency installation (SonarQube: `githubactions:S6505`)
|
|
13
|
+
- Pin Semgrep to `1.176.0` with `--only-binary :all:` in CI to prevent setup script execution and lock resolved versions (SonarQube: `githubactions:S8541`, `githubactions:S8544`)
|
|
14
|
+
- Wrap `normalize` and `resultElement` callbacks in anonymous functions in `.map()` calls to avoid passing unexpected iterator arguments (SonarQube: `javascript:S7727`)
|
|
15
|
+
- Wrap `search` callback in anonymous function in `.forEach()` call in benchmark (SonarQube: `javascript:S7727`)
|
|
16
|
+
- Replace `parseInt` with `Number.parseInt` in dropdown and related runtimes (SonarQube: `javascript:S7773`)
|
|
17
|
+
|
|
5
18
|
## 0.3.3 — 2026-09-11
|
|
6
19
|
|
|
7
20
|
### Refactored
|
data/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
[](#testing-strategy)
|
|
11
11
|
[](https://semgrep.dev)
|
|
12
12
|
[](https://www.codefactor.io/repository/github/gundestrup/jekyll-client-search)
|
|
13
|
+
[](https://sonarcloud.io/project/overview?id=gundestrup_jekyll-client-search)
|
|
13
14
|
|
|
14
15
|
A Jekyll plugin that generates a JSON document index for client-side search.
|
|
15
16
|
Supports lexical search ([MiniSearch](https://lucaong.github.io/minisearch/),
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
throw new TypeError("Search index must be an array");
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
var documents = data.map(normalize).filter(Boolean);
|
|
69
|
+
var documents = data.map(function (entry) { return normalize(entry); }).filter(Boolean);
|
|
70
70
|
documentsById = new Map(documents.map(function (entry) {
|
|
71
71
|
return [entry.id, entry];
|
|
72
72
|
}));
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
}
|
|
233
233
|
results.replaceChildren.apply(
|
|
234
234
|
results,
|
|
235
|
-
matches.map(resultElement).filter(Boolean)
|
|
235
|
+
matches.map(function (match) { return resultElement(match); }).filter(Boolean)
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
if (!Array.isArray(data)) {
|
|
68
68
|
throw new TypeError("Search index must be an array");
|
|
69
69
|
}
|
|
70
|
-
var documents = data.map(normalize).filter(Boolean);
|
|
70
|
+
var documents = data.map(function (entry) { return normalize(entry); }).filter(Boolean);
|
|
71
71
|
var adapter = window.ClientSearchAdapters &&
|
|
72
72
|
(window.ClientSearchAdapters[config.engine] ||
|
|
73
73
|
window.ClientSearchAdapters.minisearch);
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
this.input = root.querySelector("[data-cs-dropdown-input]");
|
|
178
178
|
this.results = root.querySelector("[data-cs-dropdown-results]");
|
|
179
179
|
this.config = config;
|
|
180
|
-
this.maxItems = parseInt(this.results.dataset.maxItems, 10) || config.maxItems || 5;
|
|
180
|
+
this.maxItems = Number.parseInt(this.results.dataset.maxItems, 10) || config.maxItems || 5;
|
|
181
181
|
this.selectedIndex = -1;
|
|
182
182
|
this.currentItems = [];
|
|
183
183
|
this.debounceTimer = null;
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (container.dataset.relatedMax) {
|
|
156
|
-
options.maxItems = parseInt(container.dataset.relatedMax, 10) || 0;
|
|
156
|
+
options.maxItems = Number.parseInt(container.dataset.relatedMax, 10) || 0;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
return fetch(options.relationsUrl, { headers: { Accept: "application/json" } })
|
|
@@ -106,6 +106,9 @@ async function embed(query) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
self.addEventListener("message", function (event) {
|
|
109
|
+
if (event.origin !== self.location.origin) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
109
112
|
var message = event.data || {};
|
|
110
113
|
activeConfig = activeConfig || message.config || {};
|
|
111
114
|
latestRequestId = message.id;
|