(ctx: CmdRunContext)
| 86 | } |
| 87 | |
| 88 | async function getWatchPatterns(ctx: CmdRunContext): Promise<string[]> { |
| 89 | if (!ctx.config) return []; |
| 90 | |
| 91 | const buckets = getBuckets(ctx.config); |
| 92 | const patterns: string[] = []; |
| 93 | |
| 94 | for (const bucket of buckets) { |
| 95 | // Skip if specific buckets are filtered |
| 96 | if (ctx.flags.bucket && !ctx.flags.bucket.includes(bucket.type)) { |
| 97 | continue; |
| 98 | } |
| 99 | |
| 100 | for (const bucketPath of bucket.paths) { |
| 101 | // Skip if specific files are filtered |
| 102 | if (ctx.flags.file) { |
| 103 | if ( |
| 104 | !ctx.flags.file.some( |
| 105 | (f) => |
| 106 | bucketPath.pathPattern.includes(f) || |
| 107 | minimatch(bucketPath.pathPattern, f), |
| 108 | ) |
| 109 | ) { |
| 110 | continue; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // Get the source locale pattern (replace [locale] with source locale) |
| 115 | const sourceLocale = ctx.flags.sourceLocale || ctx.config.locale.source; |
| 116 | const sourcePattern = bucketPath.pathPattern.replace( |
| 117 | "[locale]", |
| 118 | sourceLocale, |
| 119 | ); |
| 120 | |
| 121 | patterns.push(sourcePattern); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | return patterns; |
| 126 | } |
| 127 | |
| 128 | function handleFileChange( |
| 129 | filePath: string, |
no test coverage detected