// Planu — Multi-app detector: app type inference helpers
import { basename } from 'node:path';
const DIR_TYPE_MAP = [
    { keywords: ['web', 'frontend', 'client'], type: 'frontend' },
    { keywords: ['api', 'backend', 'server'], type: 'backend' },
    { keywords: ['mobile', 'app'], type: 'mobile' },
    { keywords: ['shared', 'common', 'lib'], type: 'shared' },
    { keywords: ['docs', 'documentation'], type: 'docs' },
    { keywords: ['worker', 'jobs'], type: 'worker' },
];
/**
 * Infer the app type from its framework and directory name.
 */
export function inferAppType(framework, appPath) {
    const dirName = basename(appPath).toLowerCase();
    for (const { keywords, type } of DIR_TYPE_MAP) {
        if (keywords.some((kw) => dirName.includes(kw))) {
            return type;
        }
    }
    if (framework) {
        if (isFrontendFramework(framework)) {
            return 'frontend';
        }
        if (isBackendFramework(framework)) {
            return 'backend';
        }
        if (isMobileFramework(framework)) {
            return 'mobile';
        }
    }
    return 'backend'; // Default fallback
}
export function isFrontendFramework(fw) {
    return [
        'react',
        'vue',
        'angular',
        'svelte',
        'next.js',
        'nuxt',
        'astro',
        'remix',
        'solidjs',
        'qwik',
        'gatsby',
        'eleventy',
    ].includes(fw);
}
export function isBackendFramework(fw) {
    return [
        'express',
        'fastapi',
        'django',
        'flask',
        'gin',
        'laravel',
        'spring',
        'rails',
        'nestjs',
        'hono',
        'elysia',
        'actix-web',
        'axum',
        'phoenix',
        'ktor',
        'symfony',
        'vapor',
    ].includes(fw);
}
export function isMobileFramework(fw) {
    return ['react-native', 'expo', 'flutter', 'swiftui', 'jetpack-compose'].includes(fw);
}
//# sourceMappingURL=app-type.js.map