@ff-labs/fff-bun 0.8.0 → 0.8.1-nightly.e5cdf92

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ff-labs/fff-bun",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-nightly.e5cdf92",
4
4
  "private": false,
5
5
  "description": "High-performance fuzzy file finder for Bun - perfect for LLM agent tools",
6
6
  "type": "module",
@@ -62,14 +62,14 @@
62
62
  },
63
63
  "homepage": "https://github.com/dmtrKovalenko/fff.nvim#readme",
64
64
  "optionalDependencies": {
65
- "@ff-labs/fff-bin-darwin-arm64": "0.8.0",
66
- "@ff-labs/fff-bin-darwin-x64": "0.8.0",
67
- "@ff-labs/fff-bin-linux-x64-gnu": "0.8.0",
68
- "@ff-labs/fff-bin-linux-arm64-gnu": "0.8.0",
69
- "@ff-labs/fff-bin-linux-x64-musl": "0.8.0",
70
- "@ff-labs/fff-bin-linux-arm64-musl": "0.8.0",
71
- "@ff-labs/fff-bin-win32-x64": "0.8.0",
72
- "@ff-labs/fff-bin-win32-arm64": "0.8.0"
65
+ "@ff-labs/fff-bin-darwin-arm64": "0.8.1-nightly.e5cdf92",
66
+ "@ff-labs/fff-bin-darwin-x64": "0.8.1-nightly.e5cdf92",
67
+ "@ff-labs/fff-bin-linux-x64-gnu": "0.8.1-nightly.e5cdf92",
68
+ "@ff-labs/fff-bin-linux-arm64-gnu": "0.8.1-nightly.e5cdf92",
69
+ "@ff-labs/fff-bin-linux-x64-musl": "0.8.1-nightly.e5cdf92",
70
+ "@ff-labs/fff-bin-linux-arm64-musl": "0.8.1-nightly.e5cdf92",
71
+ "@ff-labs/fff-bin-win32-x64": "0.8.1-nightly.e5cdf92",
72
+ "@ff-labs/fff-bin-win32-arm64": "0.8.1-nightly.e5cdf92"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/bun": "^1.3.8",
package/src/finder.ts CHANGED
@@ -321,7 +321,7 @@ export class FileFinder {
321
321
  options?.maxMatchesPerFile ?? 0,
322
322
  options?.smartCase ?? true,
323
323
  options?.cursor?._offset ?? 0,
324
- 0, // page_limit (0 = default 50)
324
+ options?.pageSize ?? 0,
325
325
  options?.timeBudgetMs ?? 0,
326
326
  options?.beforeContext ?? 0,
327
327
  options?.afterContext ?? 0,
@@ -370,7 +370,7 @@ export class FileFinder {
370
370
  options.maxMatchesPerFile ?? 0,
371
371
  options.smartCase ?? true,
372
372
  options.cursor?._offset ?? 0,
373
- 0, // page_limit (0 = default 50)
373
+ options.pageSize ?? 0,
374
374
  options.timeBudgetMs ?? 0,
375
375
  options.beforeContext ?? 0,
376
376
  options.afterContext ?? 0,
package/src/index.test.ts CHANGED
@@ -199,6 +199,28 @@ describe("FileFinder - Full Lifecycle", () => {
199
199
  }
200
200
  });
201
201
 
202
+ test("grep respects pageSize option", () => {
203
+ // Cap to one match per file so pageSize bounds the total deterministically.
204
+ const unbounded = finder.grep("import", {
205
+ mode: "plain",
206
+ maxMatchesPerFile: 1,
207
+ });
208
+ expect(unbounded.ok).toBe(true);
209
+ if (!unbounded.ok) return;
210
+ expect(unbounded.value.items.length).toBeGreaterThan(2);
211
+
212
+ const limited = finder.grep("import", {
213
+ mode: "plain",
214
+ maxMatchesPerFile: 1,
215
+ pageSize: 2,
216
+ });
217
+ expect(limited.ok).toBe(true);
218
+ if (!limited.ok) return;
219
+ expect(limited.value.items.length).toBeLessThanOrEqual(2);
220
+ expect(limited.value.items.length).toBeLessThan(unbounded.value.items.length);
221
+ expect(limited.value.nextCursor).not.toBeNull();
222
+ });
223
+
202
224
  test("grep fuzzy mode returns results with scores", () => {
203
225
  // Intentional typo: "depdnency" instead of "dependency" to exercise fuzzy matching
204
226
  const result = finder.grep("depdnency", {
package/src/types.ts CHANGED
@@ -361,6 +361,8 @@ export interface GrepOptions {
361
361
  beforeContext?: number;
362
362
  /** Number of context lines to include after each match (default: 0) */
363
363
  afterContext?: number;
364
+ /** Maximum matches to return in this page across all files (default: 50) */
365
+ pageSize?: number;
364
366
  }
365
367
 
366
368
  /**
@@ -457,4 +459,6 @@ export interface MultiGrepOptions {
457
459
  beforeContext?: number;
458
460
  /** Number of context lines to include after each match (default: 0) */
459
461
  afterContext?: number;
462
+ /** Maximum matches to return in this page across all files (default: 50) */
463
+ pageSize?: number;
460
464
  }