(baseDir: string)
| 43 | * Read and parse .mcpbignore file patterns |
| 44 | */ |
| 45 | export function readMcpbIgnorePatterns(baseDir: string): string[] { |
| 46 | const mcpbIgnorePath = join(baseDir, ".mcpbignore"); |
| 47 | if (!existsSync(mcpbIgnorePath)) { |
| 48 | return []; |
| 49 | } |
| 50 | |
| 51 | try { |
| 52 | const content = readFileSync(mcpbIgnorePath, "utf-8"); |
| 53 | return content |
| 54 | .split(/\r?\n/) |
| 55 | .map((line) => line.trim()) |
| 56 | .filter((line) => line.length > 0 && !line.startsWith("#")); |
| 57 | } catch (error) { |
| 58 | console.warn( |
| 59 | `Warning: Could not read .mcpbignore file: ${error instanceof Error ? error.message : "Unknown error"}`, |
| 60 | ); |
| 61 | return []; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | function buildIgnoreChecker(additionalPatterns: string[]) { |
| 66 | return ignore().add(EXCLUDE_PATTERNS).add(additionalPatterns); |
no outgoing calls
no test coverage detected
searching dependent graphs…