fix(angular): multi-version support compliance#35587
Draft
leosvelperez wants to merge 2 commits intomasterfrom
Draft
fix(angular): multi-version support compliance#35587leosvelperez wants to merge 2 commits intomasterfrom
leosvelperez wants to merge 2 commits intomasterfrom
Conversation
…rnal Standardized helper for first-party plugins to throw a consistent error when a third-party package is detected below the plugin's supported floor. Naming the package, installed version, and floor in one place keeps out-of-window UX uniform across plugins and grep-enforceable. Exposed via `@nx/devkit/internal` only — not part of the public devkit API. Implements NXC-4378.
- Throw via the new `@nx/devkit/internal` `throwForUnsupportedVersion` util when a workspace has @angular/core detected below the supported floor (v19), replacing the silent fall-through to the latest install constants. The fresh-install path (no detected @angular/core) is unchanged. - Gate the three cross-major Module Federation `packageJsonUpdates` entries (`20.2.0-module-federation`, `22.2.0`, `22.6.0-module-federation`) on `@module-federation/enhanced` source ranges so the bumps no longer fire for workspaces below each entry's source major. - Drop the spurious `@angular/core: >=21.0.0` `requires` from the `update-unit-test-runner-option` migration. The migration only rewrites an Nx generator default in nx.json (`unitTestRunner: 'vitest'` → `'vitest-analog'`); the previous gate skipped pre-v21 workspaces that still have the now-invalid default and is unrelated to Angular's installed version. - Pass `keepExistingVersions=true` to `addDependenciesToPackageJson` in the add-linting generator so workspaces with the targeted packages already pinned are not silently bumped. Implements NXC-4381.
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit f7af3dc
☁️ Nx Cloud last updated this comment at |
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.
Current Behavior
@nx/angularsilently falls through to the v21 install constants when a workspace has@angular/coredetected below the supported floor (v19). Generators add v21 packages incompatible with the user's setup instead of failing fast.packageJsonUpdatesentries (20.2.0-module-federation,22.2.0,22.6.0-module-federation) lackrequiresgates, so each bump fires for every workspace regardless of the installed@module-federation/*source major.update-unit-test-runner-optionmigration declares@angular/core: >=21.0.0despite only rewriting an Nx generator default innx.json(unitTestRunner: 'vitest'→'vitest-analog'). Pre-v21 workspaces that already have the stale default never run the migration and stay broken (the value is no longer in the generator schema's enum).add-lintinggenerator overwrites already-installed third-party versions because it doesn't passkeepExistingVersions=truetoaddDependenciesToPackageJson.Expected Behavior
@angular/coredetected below v19 throws with a clear, standardized message naming the package, the installed version, and the supported floor (no silent fall-through). The fresh-install path (no@angular/coredetected) still resolves to the latest supported version.packageJsonUpdatesentry gates on the@module-federation/enhancedsource range it is bumping from, so the bump only fires for workspaces actually in that range.update-unit-test-runner-optionmigration runs for any workspace with the stale generator default, regardless of installed Angular version.add-lintinggenerator preserves already-installed dependency pins.A new internal helper
throwForUnsupportedVersionis added to@nx/devkit/internalso first-party plugins can produce a consistent below-floor error format. It is intentionally not part of the public@nx/devkitsurface — only first-party plugins will consume it as the rest of the multi-version compliance rollout lands.