import {
  detectCI
} from "./chunk-SNKLZ7VB.mjs";
import {
  detectDocker
} from "./chunk-MLAUEAUQ.mjs";
import {
  detectNext
} from "./chunk-JLFOQXQG.mjs";
import {
  detectPrisma
} from "./chunk-WPU2XV5B.mjs";
import {
  require_lib
} from "./chunk-RIIQA6S6.mjs";
import {
  techMap
} from "./chunk-H7WNQ3SS.mjs";
import {
  init_esm_shims
} from "./chunk-RDFZ4GVM.mjs";
import {
  __toESM
} from "./chunk-7KF2HEU2.mjs";

// src/scanner.ts
init_esm_shims();
var import_fs_extra = __toESM(require_lib());
import path from "path";
async function scanRepo(repoPath, config) {
  const pkgPath = path.join(repoPath, "package.json");
  if (!import_fs_extra.default.existsSync(pkgPath)) throw new Error("package.json not found");
  const pkg = await import_fs_extra.default.readJSON(pkgPath);
  const deps = {
    ...pkg.dependencies,
    ...pkg.devDependencies
  };
  const results = [];
  for (const dep of Object.keys(deps)) {
    if (config.ignore?.includes(dep)) continue;
    if (techMap[dep]) {
      results.push(techMap[dep]);
    }
  }
  const detectors = [detectNext, detectPrisma, detectCI, detectDocker];
  for (const detector of detectors) {
    const out = await detector(repoPath);
    if (out) results.push(out);
  }
  return results;
}

export {
  scanRepo
};
