import { getMessages } from '../messages/index.js';
export const EXCLUDES_PADRAO = {
    padroesSistema: ['node_modules', '**/node_modules/**', 'dist/**', '**/dist/**', 'build/**', '**/build/**', '**/*.log', '**/*.lock', 'package.json', 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', '**/.git/**', '.pnpm/**', 'tutanus/**', '**/.tutanus/**', 'preview-tutanus/**', 'tutanus/PREVIEW*', 'PREVIEW*', 'tests/fixtures/**', 'THIRD-PARTY-NOTICES.txt', '**/THIRD-PARTY-NOTICES.txt', '**/*LICENSE*', '**/*NOTICE*', '**/*CHANGELOG*', '**/*.min.js', '**/*.min.css', '**/bundle.*', '**/*generated*', '**/*autogenerated*'],
    nodeJs: ['node_modules/**', '**/node_modules/**', 'npm-debug.log*', 'yarn-debug.log*', 'yarn-error.log*', '.npm', '.yarn', 'coverage/**', '**/coverage/**', '.nyc_output', 'dist/**', '**/dist/**', 'build/**', '**/build/**'],
    typeScript: ['dist/**', '**/dist/**', 'build/**', '**/build/**', '*.tsbuildinfo', '**/*.tsbuildinfo', '.tsbuildinfo', 'out/**', '**/out/**'],
    python: ['__pycache__/**', '**/__pycache__/**', '*.pyc', '**/*.pyc', '*.pyo', '**/*.pyo', '*.pyd', '**/*.pyd', '.Python', 'env/**', 'venv/**', '.env/**', 'pip-log.txt', 'pip-delete-this-directory.txt', '.tox/**', '.coverage', 'htmlcov/**', '.pytest_cache/**', '.mypy_cache/**'],
    dotnet: ['bin/**', '**/bin/**', 'obj/**', '**/obj/**', '*.dll', '**/*.dll', '*.exe', '**/*.exe', '*.pdb', '**/*.pdb', '.vs/**', '**/.vs/**', '*.user', '**/*.user', '*.suo', '**/*.suo', '*.cache', '**/*.cache'],
    ferramentasDev: ['.vscode/**', '.idea/**', '*.swp', '**/*.swp', '*.swo', '**/*.swo', '*~', '**/*~', '.DS_Store', '**/.DS_Store', 'Thumbs.db', '**/Thumbs.db'],
    controleVersao: ['.git/**', '**/.git/**', '.svn/**', '**/.svn/**', '.hg/**', '**/.hg/**', '.bzr/**', '**/.bzr/**'],
    temporarios: ['*.tmp', '**/*.tmp', '*.temp', '**/*.temp', '*.bak', '**/*.bak', '.tmp/**', '**/.tmp/**', 'tmp/**', '**/tmp/**', 'temp/**', '**/temp/**'],
    documentacao: ['docs/**', '**/docs/**', '*.md', '**/*.md', 'README*', '**/README*', 'CHANGELOG*', '**/CHANGELOG*', 'LICENSE*', '**/LICENSE*'],
    metadata: {
        versao: '1.0.0',
        ultimaAtualizacao: '2025-08-29',
        descricao: 'Configuração padrão dos padrões de exclusão do Tutanus'
    }
};
export function getExcludesRecomendados(tipoProjeto = 'generico') {
    const base = [...EXCLUDES_PADRAO.padroesSistema];
    switch (tipoProjeto.toLowerCase()) {
        case 'nodejs':
        case 'javascript':
        case 'typescript':
            return [...base, ...EXCLUDES_PADRAO.nodeJs, ...EXCLUDES_PADRAO.typeScript];
        case 'python':
            return [...base, ...EXCLUDES_PADRAO.python];
        case 'dotnet':
        case 'csharp':
        case 'c#':
            return [...base, ...EXCLUDES_PADRAO.dotnet];
        case 'generico':
        default:
            return [...base, ...EXCLUDES_PADRAO.ferramentasDev, ...EXCLUDES_PADRAO.controleVersao, ...EXCLUDES_PADRAO.temporarios];
    }
}
export function isPadraoExclusaoSeguro(padrao) {
    const padroesPerigosos = ['**/*',
        '*',
        '*/**/*',
        '**',
        ''
    ];
    if (padroesPerigosos.includes(padrao.trim())) {
        return false;
    }
    if (padrao.includes('***') || padrao.includes('****')) {
        return false;
    }
    return true;
}
export function mesclarConfigExcludes(configUsuario, tipoProjeto = 'generico') {
    if (configUsuario && Array.isArray(configUsuario) && configUsuario.length > 0) {
        const padroesValidos = configUsuario.filter(isPadraoExclusaoSeguro);
        if (padroesValidos.length !== configUsuario.length) {
            const { SharedCommonMensagens } = getMessages();
            console.warn(SharedCommonMensagens.exclusaoInsegura(configUsuario.filter(caminho => !isPadraoExclusaoSeguro(caminho)).join(', ')));
        }
        return Array.from(new Set(padroesValidos));
    }
    return getExcludesRecomendados(tipoProjeto);
}
//# sourceMappingURL=excludes-padrao.js.map