This is Part 4 of a 6-part series on Angular Schematics.


🤖 A note on this article: I used Claude to help reformat and structure the content to make it clearer and more presentable for publication.


References


In Part 3 we built an ng add schematic that configured a library on first install. In Part 2 we built ng generate schematics for on-demand code scaffolding and operational tasks.

Both of those are developer-triggered - a human decides when to run them. Part 4 is about the third and final mechanism: ng update, where the CLI automatically applies code transformations the moment a developer upgrades a package version.

This is the mechanism Angular itself uses to ship breaking changes. When you run ng update @angular/core and your code is automatically rewritten to use the new API - that is a migration schematic at work. The same infrastructure is available to every library author.

By the end of this article you will have built a complete migration schematic that:


Table of Contents