import * as path from "node:path";
import { pathExists, readJsonOrNull } from "../../utils/index.js";
/**
 * Detector for Expo (React Native) projects
 * Detects by presence of app.json, eas.json, or expo dependency
 */
export class ExpoDetector {
    type = "expo";
    /**
     * Detect if the project uses Expo
     * @param destDir - Project directory to check
     * @returns True if Expo is detected
     */
    async detect(destDir) {
        // Check for app.json
        const appJsonPath = path.join(destDir, "app.json");
        if (await pathExists(appJsonPath)) {
            return true;
        }
        // Check for eas.json
        const easJsonPath = path.join(destDir, "eas.json");
        if (await pathExists(easJsonPath)) {
            return true;
        }
        // Check for expo in package.json
        const packageJsonPath = path.join(destDir, "package.json");
        const packageJson = await readJsonOrNull(packageJsonPath);
        if (!packageJson) {
            return false;
        }
        return (packageJson.dependencies?.["expo"] !== undefined ||
            packageJson.devDependencies?.["expo"] !== undefined);
    }
}
//# sourceMappingURL=expo.js.map