Migrate ng-inline-svg to angular-svg-icon (code changes)

Proprietary

Replaces the unmaintained ng-inline-svg with angular-svg-icon: InlineSVGModule becomes AngularSvgIconModule, InlineSVGDirective becomes SvgIconComponent (AngularSvgIconModule before Angular 16), and each [inlineSVG] of a template becomes an <svg-icon [src]> inside the element it was on. A project that never called forRoot() imports AngularSvgIconModule.forRoot() in its @NgModules, since <svg-icon> needs the registry it provides. forRoot configuration, template options without a counterpart, and the imports left over are flagged for a hand migration. A project with a flagged template keeps InlineSVGModule and InlineSVGDirective for it, with their angular-svg-icon counterparts beside them. Projects before Angular 7, or whose package.json does not tell the Angular major within one major, are left as they are, with their imports flagged.

org.openrewrite.angular.nginlinesvg.MigrateNgInlineSvgCodeChanges
mod run . --recipe=org.openrewrite.angular.nginlinesvg.MigrateNgInlineSvgCodeChanges

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.