Skip to content

fix(upgrade-packages): correctly glob files on windows#1511

Merged
damyanpetev merged 1 commit intomasterfrom
dpetev/fix-update-win
Feb 27, 2026
Merged

fix(upgrade-packages): correctly glob files on windows#1511
damyanpetev merged 1 commit intomasterfrom
dpetev/fix-update-win

Conversation

@damyanpetev
Copy link
Member

Closes #1510

Additional information related to this pull request:

Related to the package upgrade in #1378, however, besides also returning native os-style paths, the newer glob versions also treat \ as escape only (see https://github.com/isaacs/node-glob/blob/main/changelog.md#80) and as such win style paths with **\*.ts fail.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the upgrade command fails to update view files and style imports on Windows due to glob pattern handling changes introduced in glob v8+. The core problem is that glob v8+ treats backslashes (\) as escape characters only, not path separators, which causes Windows-style paths with patterns like C:\Work\project\**\*.ts to fail.

Changes:

  • Fixed FsFileSystem.glob() to convert all backslashes to forward slashes before passing patterns to glob.sync, ensuring compatibility with glob v8+
  • Removed redundant path normalization since glob v8+ now returns posix-style paths natively
  • Added comprehensive unit tests covering Windows paths, mixed path styles, and POSIX paths

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/core/util/FileSystem.ts Fixed glob pattern handling by converting backslashes to forward slashes before calling glob.sync; removed redundant result mapping; added type-only import
spec/unit/FsFileSystem-spec.ts Added comprehensive unit tests for Windows and POSIX path handling in glob method
packages/cli/lib/commands/upgrade.ts Added type-only import and explicit type annotation for ProjectTemplate variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@damyanpetev damyanpetev merged commit 64f2735 into master Feb 27, 2026
6 of 7 checks passed
@damyanpetev damyanpetev deleted the dpetev/fix-update-win branch February 27, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update step [command] fails to update view files' and styles imports

3 participants