All files / src/lib/scan index.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74                                                                                                                                                   
// biome-ignore-all lint/performance/noBarrelFile: intentional public API
/**
 * Scan module — pure-TS ripgrep-compatible file scanner.
 *
 * PR 1 exports the file-walking foundation. PR 2 adds the grep and
 * glob engines (`grepFiles`, `globFiles` + collect helpers). PR 3
 * will migrate the DSN scanner to this module.
 *
 * @example
 * ```ts
 * import { walkFiles, TEXT_EXTENSIONS } from "./lib/scan/index.js";
 *
 * for await (const entry of walkFiles({ cwd, extensions: TEXT_EXTENSIONS })) {
 *   if (!entry.isBinary) console.log(entry.relativePath);
 * }
 * ```
 *
 * @example
 * ```ts
 * import { collectGrep } from "./lib/scan/index.js";
 *
 * const { matches, stats } = await collectGrep({
 *   cwd: "/path/to/repo",
 *   pattern: "(?i)TODO",
 *   include: "*.ts",
 *   maxResults: 100,
 * });
 * ```
 */
 
export {
  classifyByExtension,
  isLikelyBinary,
  readHeadAndSniff,
} from "./binary.js";
export type { ConcurrentOptions, MapFilesOptions } from "./concurrent.js";
export {
  mapFilesConcurrent,
  mapFilesConcurrentStream,
} from "./concurrent.js";
export {
  BINARY_SNIFF_BYTES,
  CONCURRENCY_LIMIT,
  DEFAULT_SKIP_DIRS,
  DSN_ADDITIONAL_SKIP_DIRS,
  isMonorepoPackageDir,
  MAX_FILE_SIZE,
  MONOREPO_ROOTS,
  normalizePath,
  TEXT_EXTENSIONS,
} from "./constants.js";
export { collectGlob, globFiles } from "./glob.js";
export { collectGrep, grepFiles } from "./grep.js";
export type { IgnoreStackOptions } from "./ignore.js";
export { IgnoreStack } from "./ignore.js";
export type { CompilePatternOptions } from "./regex.js";
export {
  compilePattern,
  ensureGlobalFlag,
  extractInlineFlags,
} from "./regex.js";
export type {
  GlobOptions,
  GlobResult,
  GrepMatch,
  GrepOptions,
  GrepResult,
  GrepStats,
  IgnoreMatcher,
  WalkEntry,
  WalkOptions,
} from "./types.js";
export { bulkConcurrency, walkFiles } from "./walker.js";