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