chore: trim runtime dependencies — remove enhanced-resolve/semver, swap micromatch → picomatch#1701
chore: trim runtime dependencies — remove enhanced-resolve/semver, swap micromatch → picomatch#1701Copilot wants to merge 11 commits into
Conversation
|
@copilot The comparison tests are reliably failing now - please determine the cause |
Found and fixed. The The fix splits the pattern array into positive and negative groups and applies them separately: const matchPos = picomatch(positivePatterns.length > 0 ? positivePatterns : ['**']);
const matchNeg = negativePatterns.length > 0 ? picomatch(negativePatterns) : null;
if (!matchPos(relativeFileName) || (matchNeg && matchNeg(relativeFileName))) {
return false;
}Fix committed in the latest push. The |
| if ( | ||
| compiler!.version !== undefined && | ||
| semver.gte(compiler!.version, '3.6.3') | ||
| versionGte(compiler!.version, '3.6.3') |
There was a problem hiding this comment.
@copilot please remove versionGte(compiler!.version, '3.6.3') test from the if statement
There was a problem hiding this comment.
Done. Removed versionGte(compiler!.version, '3.6.3') from the condition — the if now simply checks compiler!.version !== undefined. The versionGte helper function was also removed since it had no remaining usages.
| loaderOptions.reportFiles | ||
| // Split positive and negative patterns to replicate micromatch semantics: | ||
| // a file must match a positive pattern AND not match any negative pattern. | ||
| const positivePatterns = loaderOptions.reportFiles.filter( |
There was a problem hiding this comment.
@copilot please replace positivePatterns / negativePatterns creation with one reduce statement instead of 2 filters
There was a problem hiding this comment.
Done — replaced the two filter calls with a single reduce that partitions patterns into positivePatterns and negativePatterns in one pass.
…pattern splitting
The CI failures were caused by the |
|
@copilot increment the version in package.json and add an entry to the changelog.md |
|
@copilot please give this PR a careful review - highlight any issues that might exist |
Review complete. One real bug was found and fixed; two other observations below. Fixed — performance bug in Observation — dead Observation — correct behaviour confirmed:
|
|
Please remove dead else branch @copilot |
Done — the dead |
Update CHANGELOG.md to reflect TypeScript version support changes.
Three runtime dependencies were either dead weight or heavier than necessary. This PR removes them or substitutes lighter alternatives.
Changes
enhanced-resolveremoved — the import inresolver.tswas already unreachable; the resolver body unconditionally throws and has been disabled since v9.4.1semverremoved — sole usage was a singlegte(version, '3.6.3')call; the version check has been dropped entirely since TypeScript versions below 3.6.3 are no longer a concernmicromatch→picomatch— micromatch itself wraps picomatch; the one call-site inutils.tsmaps directly, with negation patterns handled by splitting positive and negative entries and applying them separately to preserve identical glob/negation semanticsdevDependencies
@types/semverand@types/micromatchremoved;@types/picomatchadded.