import {
  detectCI
} from "./chunk-JHVWSHNY.mjs";
import {
  detectDocker
} from "./chunk-5MNAT56X.mjs";
import {
  detectNext
} from "./chunk-AFJCX5SK.mjs";
import {
  detectPrisma
} from "./chunk-SLYSEMYE.mjs";
import {
  require_lib
} from "./chunk-QQAUZGVG.mjs";
import {
  techMap
} from "./chunk-NJ4FK5BO.mjs";
import {
  __toESM
} from "./chunk-4OMBB3R6.mjs";

// src/scanner.ts
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
};
