Skip to content

Fix/mf ng update migrations - #1123

Merged
Aukevanoost merged 2 commits into
mainfrom
fix/mf-ng-update-migrations
Aug 7, 2026
Merged

Fix/mf ng update migrations#1123
Aukevanoost merged 2 commits into
mainfrom
fix/mf-ng-update-migrations

Conversation

@Aukevanoost

Copy link
Copy Markdown
Collaborator

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 mf library. The most important changes are grouped below:

Dependency and Compatibility Updates:

  • Upgraded several dependencies in package.json, including jsonc-eslint-parser to ^3.2.0, eslint to ~10.8.0, cypress to 15.20.0, semver to ~7.8.5, chalk to ^5.6.2, ts-jest to 29.4.12, and nx to ~23.1.0. Removed or updated several other dependencies for improved compatibility. [1] [2] [3] [4]
  • Updated all ESLint configuration files to import jsonc-eslint-parser using the import * as syntax, aligning with the new major version's requirements. [1] [2] [3] [4]

Jest and Testing Configuration:

  • Enhanced Jest configuration in libs/mf/jest.config.ts to support .mjs files, added a transformIgnorePatterns exception for magic-string, and updated moduleFileExtensions. This helps with ESM compatibility and ensures proper handling of dependencies.

Library and Migration Improvements:

  • Added a new schematic migration (migrate-to-custom-webpack) to libs/mf/migrations.json to help users transition from ngx-build-plus to @angular-builders/custom-webpack.

Code Quality and Type Safety:

  • Improved type safety in schematic files by initializing newMainContent as a string rather than an empty string. [1] [2]

`.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.
@Aukevanoost
Aukevanoost merged commit cddd50a into main Aug 7, 2026
1 check passed
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