import {
  detectCI
} from "./chunk-ATNEVZPV.mjs";
import {
  detectDocker
} from "./chunk-Q7X2R7N7.mjs";
import {
  detectNext
} from "./chunk-3LPZV7KA.mjs";
import {
  detectPrisma
} from "./chunk-E3OD2BXY.mjs";
import {
  techMap
} from "./chunk-D2DOGM2Y.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
};
