Skip to content

Update minimatch to v10.2.4 and fix NodeJS.Timer type compatibility#1165

Draft
v-abhishera wants to merge 1 commit intomasterfrom
users/v-abhishera/azuretasklibMinimatchUpdate
Draft

Update minimatch to v10.2.4 and fix NodeJS.Timer type compatibility#1165
v-abhishera wants to merge 1 commit intomasterfrom
users/v-abhishera/azuretasklibMinimatchUpdate

Conversation

@v-abhishera
Copy link
Copy Markdown

@v-abhishera v-abhishera commented Mar 27, 2026

Description:

Summary

Updates minimatch from v3.1.5 to v10.2.4 and addresses compatibility issues for Windows path handling and newer @types/node versions.

Changes

  • Upgraded minimatch from ^3.1.5 to ^10.2.4
  • Removed @types/minimatch devDependency (types are now bundled in minimatch v5+)
  • Added windowsPathsNoEscape support across internal.ts, task.ts, and mock-task.ts to preserve Windows backslash-as-path-separator behavior
  • Fixed NodeJS.Timer type in toolrunner.ts — replaced deprecated NodeJS.Timer with ReturnType<typeof setTimeout> for compatibility with @types/node@20+
  • Version bump to 5.3.0

Why

minimatch v3 is outdated and unmaintained. Starting from v5, minimatch treats \ as a glob escape character instead of a path separator. This breaks Windows path matching (e.g., C:\src\*.js). The windowsPathsNoEscape: true option is now auto-applied on Windows to restore the expected behavior.

The NodeJS.Timer type was deprecated in newer @types/node. Tasks compiled with @types/node@20 or @types/node@24 would encounter type errors when resolving the task-lib's .ts source files.

Backward Compatibility

  • No public API changes — all function signatures and return types remain the same
  • windowsPathsNoEscape is only auto-set on Windows when not explicitly provided by the caller
  • Existing tasks require zero code changes

Testing

  • All 554 tests pass (0 failures, 2 pre-existing pending)
  • Verified locally with npm pack from _build/ and tested against DockerV2 and AzureFileCopyV6 task

Risk

Low — On Windows, the new option restores identical behavior to minimatch v3. On Linux/macOS, nothing changed. No existing task sets windowsPathsNoEscape, so the auto-default always applies.

Files Changed

File Change
package.json Updated minimatch, removed @types/minimatch, version bump
internal.ts Added windowsPathsNoEscape to interface, clone function, _getFindInfoFromPattern()
task.ts Added windowsPathsNoEscape to interface, defaults, match(), findMatch(), filter()
mock-task.ts Added windowsPathsNoEscape to interface
toolrunner.ts NodeJS.TimerReturnType<typeof setTimeout>

@v-abhishera
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant