From 4c5eea4be32762c2a2dbe55a31f98ed883a8f842 Mon Sep 17 00:00:00 2001 From: Evgeniy Tikhomirov Date: Sat, 25 Apr 2026 03:24:01 +0300 Subject: [PATCH] fix(ast-miner): pin encoding on readdirSync for Node 25 type compatibility Add encoding: 'utf-8' to readdirSync calls to fix TypeScript errors in Node 25: - Type 'Dirent[]' not assignable to type 'Dirent[]' - Property 'startsWith' does not exist on type 'NonSharedBuffer' Same pattern as skills-miner.ts:226-229 --- bench/real-world.ts | 2 +- src/miners/ast-miner.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/real-world.ts b/bench/real-world.ts index 098a5c6..0e57ac4 100644 --- a/bench/real-world.ts +++ b/bench/real-world.ts @@ -90,7 +90,7 @@ function collectSourceFiles(root: string, cap: number): string[] { if (out.length >= cap) return; let entries: ReturnType; try { - entries = readdirSync(dir, { withFileTypes: true }); + entries = readdirSync(dir, { withFileTypes: true, encoding: "utf-8" }); } catch { return; } diff --git a/src/miners/ast-miner.ts b/src/miners/ast-miner.ts index 1857723..30b577b 100644 --- a/src/miners/ast-miner.ts +++ b/src/miners/ast-miner.ts @@ -612,7 +612,7 @@ export function extractDirectory( let entries: Dirent[]; try { - entries = readdirSync(dir, { withFileTypes: true }); + entries = readdirSync(dir, { withFileTypes: true, encoding: "utf-8" }); } catch { return; }