import {
  detectNext
} from "./chunk-6MIRBLO4.mjs";
import {
  detectPrisma
} from "./chunk-6A4WEZDZ.mjs";
import {
  techMap
} from "./chunk-VSWWWPO7.mjs";
import {
  detectCI
} from "./chunk-IILZ43EE.mjs";
import {
  detectDocker
} from "./chunk-VFD26CTJ.mjs";

// src/scanner.ts
import fs from "fs-extra";
import path from "path";
async function scanRepo(repoPath, config) {
  const pkgPath = path.join(repoPath, "package.json");
  if (!fs.existsSync(pkgPath)) throw new Error("package.json not found");
  const pkg = await fs.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
};
