migration.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.dev/license
  7. */
  8. import { Rule } from '@angular-devkit/schematics';
  9. /**
  10. * Main entry point for the migration rule.
  11. *
  12. * This schematic migration performs updates to the Angular workspace configuration
  13. * to ensure that application projects are properly configured with polyfills
  14. * required for internationalization (`localize`).
  15. *
  16. * It specifically targets application projects that use either the `application`
  17. * or `browser-esbuild` builders.
  18. *
  19. * The migration process involves:
  20. *
  21. * 1. Iterating over all projects in the workspace.
  22. * 2. Checking each project to determine if it is an application-type project.
  23. * 3. For each application project, examining the associated build targets.
  24. * 4. If a build target's `localize` option is enabled but the polyfill
  25. * `@angular/localize/init` is missing from the `polyfills` array, the polyfill
  26. * is automatically added to ensure proper internationalization support.
  27. *
  28. * Additionally, this migration updates projects that use the `dev-server` or `extract-i18n`
  29. * builders to ensure that deprecated `browserTarget` options are migrated to the
  30. * newer `buildTarget` field.
  31. *
  32. */
  33. export default function (): Rule;