Repository navigation
fix(upgrade-packages): update projects/* and workspaces pattern folders - #1905
Merged
Merged
Conversation
The file system glob returns files only, so expanding `projects/*` or a `workspaces` pattern to folders never matched anything and only the root `src` was updated for React and Web Components. - match the workspace pattern together with the file patterns instead of expanding it to folders first - always update the root `src`, also when `workspaces` is set - honor `ignorePatterns` in `FsFileSystem.glob` and skip `node_modules` and `dist` inside workspaces - add specs that run against real folders Closes #1858 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved traversal and exclusion bugs can leave nested trial imports unchanged while manifests are upgraded and allow installed dependencies to be rewritten.
4 open issues
What changed in this PR
This PR addresses #1858 by making root-level ig upgrade-packages searches reach React and Web Components projects matched by workspace patterns.
Changes:
- Searches workspace patterns directly and always includes root
src/. - Adds filesystem exclusions for
node_modulesanddist, and deduplicates matched files. - Adds real-filesystem regression tests for nested projects and explicit workspaces.
| File | Description |
|---|---|
spec/unit/update-spec.ts |
Updates mocks and adds on-disk workspace regression tests. |
packages/core/util/FileSystem.ts |
Implements the optional glob exclusion argument. |
packages/core/update/Update.ts |
Revises workspace searches, passes exclusions, and deduplicates files. |
Review effort: Balanced
- NgTreeFileSystem.glob: with ignorePatterns, return the files of every folder instead of the parent's files for leaf folders, and match the pattern relative to dirPath - FsFileSystem.glob: anchor ignorePatterns above a wildcard in dirPath, so a `*` workspace does not reach the root node_modules or dist - update html files inside workspaces, not only in the root - skip package.json files without dependencies instead of throwing Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
kdinev
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
For React and Web Components,
ig upgrade-packagesrun in a repository root only updated the rootpackage.jsonandsrc/. Folders underprojects/*, and folders matched by glob patterns inworkspaces, were never searched:updateWorkspace()expanded those patterns withfs.glob()and kept the results that are directories, butFsFileSystem.glob()usesnodir: trueand returns files only.Changes:
packages/core/update/Update.ts: the workspace pattern is no longer expanded to folders first. It stays in the search root and is matched together with the file patterns (projects/*+**/*.ts), so nested folders such asprojects/charts/bar-chart/are reached too.packages/core/util/FileSystem.ts:FsFileSystem.glob()now honors theignorePatternsargument thatIFileSystemdeclares and that it used to drop. The workspace searches passnode_modulesanddist, so reaching intoprojects/appdoes not rewrite files inprojects/app/node_modules.Two behavior changes beyond the issue:
src/is now always searched for React and Web Components, also whenworkspacesis set. Before, such a root got licensed dependencies inpackage.jsonbut kept the trial imports insrc/.projects/*andprojects/charts/*) are processed once.Related Issue
Closes #1858
Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)Not the full scripts, so the first three boxes are left open. What was run locally (Node 24.18.0, Windows):
tscbuild of the monorepo (without the MCP server build)eslinton the three changed files: cleannpm run jasmine: 986 specs, 5 failures, all in "MCP runtime tool handlers" (docLoader.getBases is not a function). The MCP package is not touched by this PR and was not rebuilt locally; the failures were not investigated.Additional Context
The existing specs mock
globto return directories, which the real file system never does, so they passed with the bug. The newWorkspace folders on diskspecs runupdateWorkspacewith the realFsFileSystemin a temp folder; against the previous sources all three fail.Checked with the built CLI as well (
ig upgrade-packages --skip-installin the root of a Web Components project):package.jsonsrc/main.tsworkspacesset)projects/app/package.jsonprojects/app/src/app.tsprojects/charts/bar-chart/package.jsonprojects/charts/bar-chart/src/index.tsprojects/app/node_modules/dep/*Same result without
workspacesand with"workspaces": ["projects/*", "projects/charts/*"].🤖 Generated with Claude Code