import {
  detectNext
} from "./chunk-PFQIKEIL.mjs";
import {
  detectPrisma
} from "./chunk-X3ATBJ5Q.mjs";
import {
  techMap
} from "./chunk-HBJEQ63D.mjs";
import {
  detectCI
} from "./chunk-P24PKCUA.mjs";
import {
  detectDocker
} from "./chunk-K4BNSVJP.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
};
