Fix/mf ng update migrations - #1123
Merged
Merged
Conversation
`.gitignore` carried a bare `migrations.json` under its Nx section, meant for the file `nx migrate` writes at the workspace root. Bare patterns match at any depth, so it also matched libs/mf/migrations.json: the file was never tracked (no history for that path, no migrations.json in the index at all), and Nx's asset copier skips ignored files, so it never reached dist/libs/mf despite being declared in project.json. The published package therefore pointed `ng-update.migrations` at a file it did not contain, and no migration has ever run for this plugin. Anchor the pattern to `/migrations.json` and track the collection. Also lower the `migrate-to-custom-webpack` gate from 22.1.0 to 22.0.0. `ng update` only runs migrations with version > from && <= to, so at 22.1.0 it would have been skipped by everyone upgrading to 22.0.0 — precisely the release that drops ngx-build-plus, leaving angular.json on builders that are no longer installed.
Drop 22 dependencies with no import site anywhere in the workspace, most notably the postcss and swc toolchains, which no config or executor uses. Removing @angular/animations, @angular/platform-browser-dynamic and @rsbuild/core from "dependencies" also stops shareAll() from federating three packages nothing imports. libs/mf declared callsite, which it never imports, but not chalk, which src/server/colors.ts does import and which therefore shipped undeclared. Update within the ranges Angular 22 allows: nx to ~23.1 to match the @nx/* packages, ESLint to 10, jsonc-eslint-parser to 3, plus cypress, ts-jest and semver. TypeScript stays at ~6.0 (compiler-cli peers >=6.0 <6.1) and @rspack/core at 1.6 (@module-federation/enhanced and @rsbuild/core still require 1.x; @nx/angular-rspack caps it at <1.7). Fallout from those upgrades: - jsonc-eslint-parser 3 dropped its default export. - ESLint 10 no longer hoists @eslint/js, which @nx/eslint-plugin requires. - ESLint 10 enables no-useless-assignment, which flagged two dead assignments in the init schematics. - @angular-devkit/schematics moved magic-string to 1.0 inside its ^22.0.0 range, and 1.0 is ESM-only, so libs/mf has to transpile it rather than skip it with the rest of node_modules. The minimatch and esbuild overrides are gone because those advisories no longer apply. The replacements clear the remaining 25 findings; each is a same-major bump except @hono/node-server, which is reachable only through the Angular CLI's MCP SDK. ts-jest's @babel/core peer is widened rather than pinned: Angular 22 pins @babel/core 8 exactly, ts-jest 29 peers on <8, and ts-jest never invokes babel here.
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.
This pull request primarily updates dependencies and configuration files to improve compatibility and maintainability, especially around ESLint and Jest. It also introduces a new migration schematic for custom webpack support in the
mflibrary. The most important changes are grouped below:Dependency and Compatibility Updates:
package.json, includingjsonc-eslint-parserto^3.2.0,eslintto~10.8.0,cypressto15.20.0,semverto~7.8.5,chalkto^5.6.2,ts-jestto29.4.12, andnxto~23.1.0. Removed or updated several other dependencies for improved compatibility. [1] [2] [3] [4]jsonc-eslint-parserusing theimport * assyntax, aligning with the new major version's requirements. [1] [2] [3] [4]Jest and Testing Configuration:
libs/mf/jest.config.tsto support.mjsfiles, added atransformIgnorePatternsexception formagic-string, and updatedmoduleFileExtensions. This helps with ESM compatibility and ensures proper handling of dependencies.Library and Migration Improvements:
migrate-to-custom-webpack) tolibs/mf/migrations.jsonto help users transition fromngx-build-plusto@angular-builders/custom-webpack.Code Quality and Type Safety:
newMainContentas astringrather than an empty string. [1] [2]