@wrongstack/plugin-sdk 0.316.2 → 0.317.2
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.
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime.js +14 -1
- package/package.json +3 -3
package/dist/runtime/index.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export declare function collectSourceFiles(root: string, opts: CollectOptions):
|
|
|
176
176
|
export declare function collectSourceFilesAsync(root: string, opts: CollectOptions): Promise<string[]>;
|
|
177
177
|
/**
|
|
178
178
|
* Check whether `p` has one of the given extensions (case-insensitive).
|
|
179
|
+
* Handles extensions with or without a leading dot and normalizes casing/whitespace.
|
|
179
180
|
* Replaces a 6-copy helper that was duplicated identically across
|
|
180
181
|
* source-scan plugins.
|
|
181
182
|
*/
|
package/dist/runtime.js
CHANGED
|
@@ -231,6 +231,9 @@ var BoundedMap = class {
|
|
|
231
231
|
set(key, value) {
|
|
232
232
|
this.map.delete(key);
|
|
233
233
|
this.map.set(key, { value, storedAt: this.now() });
|
|
234
|
+
if (this.map.size > this.max && this.ttlMs !== void 0) {
|
|
235
|
+
this.prune();
|
|
236
|
+
}
|
|
234
237
|
while (this.map.size > this.max) {
|
|
235
238
|
const coldest = this.map.keys().next().value;
|
|
236
239
|
if (coldest === void 0) break;
|
|
@@ -247,6 +250,9 @@ var BoundedMap = class {
|
|
|
247
250
|
this.evictions = 0;
|
|
248
251
|
}
|
|
249
252
|
get size() {
|
|
253
|
+
if (this.ttlMs !== void 0) {
|
|
254
|
+
this.prune();
|
|
255
|
+
}
|
|
250
256
|
return this.map.size;
|
|
251
257
|
}
|
|
252
258
|
/** How many entries have been dropped to respect `max`, since the last clear. */
|
|
@@ -965,7 +971,14 @@ async function collectSourceFilesAsync(root, opts) {
|
|
|
965
971
|
return files;
|
|
966
972
|
}
|
|
967
973
|
function matchesExtension(p, exts) {
|
|
968
|
-
|
|
974
|
+
const fileExt = extname2(p).toLowerCase();
|
|
975
|
+
if (!fileExt) return false;
|
|
976
|
+
return exts.some((ext) => {
|
|
977
|
+
if (!ext || typeof ext !== "string") return false;
|
|
978
|
+
const trimmed = ext.trim().toLowerCase();
|
|
979
|
+
const normalized = trimmed.startsWith(".") ? trimmed : `.${trimmed}`;
|
|
980
|
+
return normalized === fileExt;
|
|
981
|
+
});
|
|
969
982
|
}
|
|
970
983
|
export {
|
|
971
984
|
BoundedMap,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.317.2",
|
|
4
4
|
"description": "Authoring SDK for WrongStack plugins — the plugin contract types, definePlugin, and shared runtime helpers. Third-party plugins should depend on this package only.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ECOSTACK TECHNOLOGY OÜ",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vitest": "^4.1.11"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wrongstack/core": "0.
|
|
33
|
-
"@wrongstack/tools": "0.
|
|
32
|
+
"@wrongstack/core": "0.317.2",
|
|
33
|
+
"@wrongstack/tools": "0.317.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "node ../../scripts/build-package.mjs",
|