@openrewrite/recipes-angular 1.27.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +227 -4
- package/dist/index.js.map +1 -1
- package/dist/libraries/cdk/find-cdk-signature-changes.d.ts +0 -2
- package/dist/libraries/cdk/find-cdk-signature-changes.d.ts.map +1 -1
- package/dist/libraries/cdk/find-cdk-signature-changes.js +2 -8
- package/dist/libraries/cdk/find-cdk-signature-changes.js.map +1 -1
- package/dist/libraries/cdk/migrate-cdk-sass-imports.d.ts.map +1 -1
- package/dist/libraries/cdk/migrate-cdk-sass-imports.js +4 -7
- package/dist/libraries/cdk/migrate-cdk-sass-imports.js.map +1 -1
- package/dist/libraries/cdk/migrate-cdk-stepper.js +1 -1
- package/dist/libraries/cdk/migrate-cdk-stepper.js.map +1 -1
- package/dist/libraries/cdk/migrate-deprecated-overlay-sass.d.ts.map +1 -1
- package/dist/libraries/cdk/migrate-deprecated-overlay-sass.js +2 -4
- package/dist/libraries/cdk/migrate-deprecated-overlay-sass.js.map +1 -1
- package/dist/libraries/cdk/migrate-focus-trap-factory-create.d.ts.map +1 -1
- package/dist/libraries/cdk/migrate-focus-trap-factory-create.js +2 -1
- package/dist/libraries/cdk/migrate-focus-trap-factory-create.js.map +1 -1
- package/dist/libraries/cdk/remove-cdk-super-arguments.d.ts.map +1 -1
- package/dist/libraries/cdk/remove-cdk-super-arguments.js +1 -2
- package/dist/libraries/cdk/remove-cdk-super-arguments.js.map +1 -1
- package/dist/libraries/cdk/remove-portal-factory-resolver-arguments.d.ts.map +1 -1
- package/dist/libraries/cdk/remove-portal-factory-resolver-arguments.js +5 -7
- package/dist/libraries/cdk/remove-portal-factory-resolver-arguments.js.map +1 -1
- package/dist/libraries/cdk/rename-portal-template-selectors.d.ts.map +1 -1
- package/dist/libraries/cdk/rename-portal-template-selectors.js +3 -4
- package/dist/libraries/cdk/rename-portal-template-selectors.js.map +1 -1
- package/dist/libraries/cdk/upgrade-to-cdk.d.ts.map +1 -1
- package/dist/libraries/cdk/upgrade-to-cdk.js +7 -12
- package/dist/libraries/cdk/upgrade-to-cdk.js.map +1 -1
- package/dist/libraries/components/lst.d.ts +11 -0
- package/dist/libraries/components/lst.d.ts.map +1 -1
- package/dist/libraries/components/lst.js +40 -0
- package/dist/libraries/components/lst.js.map +1 -1
- package/dist/libraries/components/style-sources.d.ts +12 -0
- package/dist/libraries/components/style-sources.d.ts.map +1 -0
- package/dist/libraries/components/style-sources.js +93 -0
- package/dist/libraries/components/style-sources.js.map +1 -0
- package/dist/libraries/components/stylesheets.d.ts +13 -0
- package/dist/libraries/components/stylesheets.d.ts.map +1 -1
- package/dist/libraries/components/stylesheets.js +55 -17
- package/dist/libraries/components/stylesheets.js.map +1 -1
- package/dist/libraries/components/symbols.d.ts +4 -1
- package/dist/libraries/components/symbols.d.ts.map +1 -1
- package/dist/libraries/components/symbols.js +6 -3
- package/dist/libraries/components/symbols.js.map +1 -1
- package/dist/libraries/components/template-elements.d.ts +40 -0
- package/dist/libraries/components/template-elements.d.ts.map +1 -0
- package/dist/libraries/components/template-elements.js +96 -0
- package/dist/libraries/components/template-elements.js.map +1 -0
- package/dist/libraries/components/templates.d.ts +7 -0
- package/dist/libraries/components/templates.d.ts.map +1 -1
- package/dist/libraries/components/templates.js +59 -48
- package/dist/libraries/components/templates.js.map +1 -1
- package/dist/libraries/material/add-system-variables-prefix.d.ts +11 -0
- package/dist/libraries/material/add-system-variables-prefix.d.ts.map +1 -0
- package/dist/libraries/material/add-system-variables-prefix.js +98 -0
- package/dist/libraries/material/add-system-variables-prefix.js.map +1 -0
- package/dist/libraries/material/add-theme-base-mixins.d.ts +19 -0
- package/dist/libraries/material/add-theme-base-mixins.d.ts.map +1 -0
- package/dist/libraries/material/add-theme-base-mixins.js +176 -0
- package/dist/libraries/material/add-theme-base-mixins.js.map +1 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.d.ts +8 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.d.ts.map +1 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.js +94 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.js.map +1 -0
- package/dist/libraries/material/find-legacy-material-usage.d.ts +8 -0
- package/dist/libraries/material/find-legacy-material-usage.d.ts.map +1 -0
- package/dist/libraries/material/find-legacy-material-usage.js +95 -0
- package/dist/libraries/material/find-legacy-material-usage.js.map +1 -0
- package/dist/libraries/material/find-material-constructor-changes.d.ts +74 -0
- package/dist/libraries/material/find-material-constructor-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-material-constructor-changes.js +266 -0
- package/dist/libraries/material/find-material-constructor-changes.js.map +1 -0
- package/dist/libraries/material/find-mdc-breaking-changes.d.ts +45 -0
- package/dist/libraries/material/find-mdc-breaking-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-mdc-breaking-changes.js +312 -0
- package/dist/libraries/material/find-mdc-breaking-changes.js.map +1 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.d.ts +8 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.js +125 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.js.map +1 -0
- package/dist/libraries/material/find-raw-palette-themes.d.ts +28 -0
- package/dist/libraries/material/find-raw-palette-themes.d.ts.map +1 -0
- package/dist/libraries/material/find-raw-palette-themes.js +122 -0
- package/dist/libraries/material/find-raw-palette-themes.js.map +1 -0
- package/dist/libraries/material/find-removed-material-apis.d.ts +20 -0
- package/dist/libraries/material/find-removed-material-apis.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-apis.js +60 -0
- package/dist/libraries/material/find-removed-material-apis.js.map +1 -0
- package/dist/libraries/material/find-removed-material-classes.d.ts +13 -0
- package/dist/libraries/material/find-removed-material-classes.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-classes.js +144 -0
- package/dist/libraries/material/find-removed-material-classes.js.map +1 -0
- package/dist/libraries/material/find-removed-material-members.d.ts +67 -0
- package/dist/libraries/material/find-removed-material-members.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-members.js +167 -0
- package/dist/libraries/material/find-removed-material-members.js.map +1 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.d.ts +10 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.d.ts.map +1 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.js +96 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.js.map +1 -0
- package/dist/libraries/material/material-15-classes.d.ts +6 -0
- package/dist/libraries/material/material-15-classes.d.ts.map +1 -0
- package/dist/libraries/material/material-15-classes.js +435 -0
- package/dist/libraries/material/material-15-classes.js.map +1 -0
- package/dist/libraries/material/material-entry-points.d.ts +3 -0
- package/dist/libraries/material/material-entry-points.d.ts.map +1 -0
- package/dist/libraries/material/material-entry-points.js +201 -0
- package/dist/libraries/material/material-entry-points.js.map +1 -0
- package/dist/libraries/material/material-legacy-symbols.d.ts +2 -0
- package/dist/libraries/material/material-legacy-symbols.d.ts.map +1 -0
- package/dist/libraries/material/material-legacy-symbols.js +559 -0
- package/dist/libraries/material/material-legacy-symbols.js.map +1 -0
- package/dist/libraries/material/material-theming-api.d.ts +23 -0
- package/dist/libraries/material/material-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/material-theming-api.js +446 -0
- package/dist/libraries/material/material-theming-api.js.map +1 -0
- package/dist/libraries/material/material-version.d.ts +38 -0
- package/dist/libraries/material/material-version.d.ts.map +1 -0
- package/dist/libraries/material/material-version.js +190 -0
- package/dist/libraries/material/material-version.js.map +1 -0
- package/dist/libraries/material/migrate-legacy-material.d.ts +60 -0
- package/dist/libraries/material/migrate-legacy-material.d.ts.map +1 -0
- package/dist/libraries/material/migrate-legacy-material.js +224 -0
- package/dist/libraries/material/migrate-legacy-material.js.map +1 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.d.ts +8 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.d.ts.map +1 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.js +62 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.js.map +1 -0
- package/dist/libraries/material/migrate-m2-theming-api.d.ts +12 -0
- package/dist/libraries/material/migrate-m2-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/migrate-m2-theming-api.js +117 -0
- package/dist/libraries/material/migrate-m2-theming-api.js.map +1 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.d.ts +11 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.js +48 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.js.map +1 -0
- package/dist/libraries/material/migrate-material-15-typography.d.ts +21 -0
- package/dist/libraries/material/migrate-material-15-typography.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-15-typography.js +174 -0
- package/dist/libraries/material/migrate-material-15-typography.js.map +1 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.d.ts +8 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.js +196 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.js.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts +18 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.js +199 -0
- package/dist/libraries/material/migrate-material-theming-api.js.map +1 -0
- package/dist/libraries/material/migrate-mdc-styles.d.ts +23 -0
- package/dist/libraries/material/migrate-mdc-styles.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mdc-styles.js +136 -0
- package/dist/libraries/material/migrate-mdc-styles.js.map +1 -0
- package/dist/libraries/material/migrate-mdc-templates.d.ts +18 -0
- package/dist/libraries/material/migrate-mdc-templates.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mdc-templates.js +330 -0
- package/dist/libraries/material/migrate-mdc-templates.js.map +1 -0
- package/dist/libraries/material/migrate-selection-list-change-option.d.ts +8 -0
- package/dist/libraries/material/migrate-selection-list-change-option.d.ts.map +1 -0
- package/dist/libraries/material/migrate-selection-list-change-option.js +49 -0
- package/dist/libraries/material/migrate-selection-list-change-option.js.map +1 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.d.ts +8 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.d.ts.map +1 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.js +71 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.js.map +1 -0
- package/dist/libraries/material/remove-update-active-link-argument.d.ts +8 -0
- package/dist/libraries/material/remove-update-active-link-argument.d.ts.map +1 -0
- package/dist/libraries/material/remove-update-active-link-argument.js +53 -0
- package/dist/libraries/material/remove-update-active-link-argument.js.map +1 -0
- package/dist/libraries/material/rename-material-members.d.ts +51 -0
- package/dist/libraries/material/rename-material-members.d.ts.map +1 -0
- package/dist/libraries/material/rename-material-members.js +125 -0
- package/dist/libraries/material/rename-material-members.js.map +1 -0
- package/dist/libraries/material/rename-material-style-names.d.ts +35 -0
- package/dist/libraries/material/rename-material-style-names.d.ts.map +1 -0
- package/dist/libraries/material/rename-material-style-names.js +182 -0
- package/dist/libraries/material/rename-material-style-names.js.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts +10 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.js +47 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.js.map +1 -0
- package/dist/libraries/material/upgrade-to-material.d.ts +74 -0
- package/dist/libraries/material/upgrade-to-material.d.ts.map +1 -0
- package/dist/libraries/material/upgrade-to-material.js +312 -0
- package/dist/libraries/material/upgrade-to-material.js.map +1 -0
- package/dist/migration/js-support.d.ts +1 -1
- package/dist/migration/js-support.d.ts.map +1 -1
- package/dist/migration/js-support.js +2 -2
- package/dist/migration/js-support.js.map +1 -1
- package/dist/migration/json-support.d.ts +11 -0
- package/dist/migration/json-support.d.ts.map +1 -1
- package/dist/migration/json-support.js +50 -0
- package/dist/migration/json-support.js.map +1 -1
- package/dist/migration/move-common-engine-to-ssr-node.d.ts +8 -0
- package/dist/migration/move-common-engine-to-ssr-node.d.ts.map +1 -0
- package/dist/migration/move-common-engine-to-ssr-node.js +68 -0
- package/dist/migration/move-common-engine-to-ssr-node.js.map +1 -0
- package/dist/migration/remove-guard-and-resolve-interfaces.d.ts +8 -0
- package/dist/migration/remove-guard-and-resolve-interfaces.d.ts.map +1 -0
- package/dist/migration/remove-guard-and-resolve-interfaces.js +117 -0
- package/dist/migration/remove-guard-and-resolve-interfaces.js.map +1 -0
- package/dist/migration/remove-show-circular-dependencies.d.ts +8 -0
- package/dist/migration/remove-show-circular-dependencies.d.ts.map +1 -0
- package/dist/migration/remove-show-circular-dependencies.js +57 -0
- package/dist/migration/remove-show-circular-dependencies.js.map +1 -0
- package/dist/migration/rename-ssr-experimental-platform.d.ts.map +1 -1
- package/dist/migration/rename-ssr-experimental-platform.js +10 -47
- package/dist/migration/rename-ssr-experimental-platform.js.map +1 -1
- package/dist/migration/replace-browser-target.d.ts +8 -0
- package/dist/migration/replace-browser-target.d.ts.map +1 -0
- package/dist/migration/replace-browser-target.js +62 -0
- package/dist/migration/replace-browser-target.js.map +1 -0
- package/dist/migration/replace-default-collection.d.ts +8 -0
- package/dist/migration/replace-default-collection.d.ts.map +1 -0
- package/dist/migration/replace-default-collection.js +59 -0
- package/dist/migration/replace-default-collection.js.map +1 -0
- package/dist/migration/replace-get-current-navigation.d.ts +8 -0
- package/dist/migration/replace-get-current-navigation.d.ts.map +1 -0
- package/dist/migration/replace-get-current-navigation.js +69 -0
- package/dist/migration/replace-get-current-navigation.js.map +1 -0
- package/dist/migration/replace-initializer-providers.d.ts +8 -0
- package/dist/migration/replace-initializer-providers.d.ts.map +1 -0
- package/dist/migration/replace-initializer-providers.js +169 -0
- package/dist/migration/replace-initializer-providers.js.map +1 -0
- package/dist/migration/replace-preserve-query-params.d.ts +8 -0
- package/dist/migration/replace-preserve-query-params.d.ts.map +1 -0
- package/dist/migration/replace-preserve-query-params.js +115 -0
- package/dist/migration/replace-preserve-query-params.js.map +1 -0
- package/dist/migration/replace-provide-server-routing.d.ts +8 -0
- package/dist/migration/replace-provide-server-routing.d.ts.map +1 -0
- package/dist/migration/replace-provide-server-routing.js +98 -0
- package/dist/migration/replace-provide-server-routing.js.map +1 -0
- package/dist/migration/upgrade-to-angular-10.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-10.js +4 -1
- package/dist/migration/upgrade-to-angular-10.js.map +1 -1
- package/dist/migration/upgrade-to-angular-11.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-11.js +13 -2
- package/dist/migration/upgrade-to-angular-11.js.map +1 -1
- package/dist/migration/upgrade-to-angular-12.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-12.js +4 -1
- package/dist/migration/upgrade-to-angular-12.js.map +1 -1
- package/dist/migration/upgrade-to-angular-13.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-13.js +4 -1
- package/dist/migration/upgrade-to-angular-13.js.map +1 -1
- package/dist/migration/upgrade-to-angular-14.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-14.js +11 -1
- package/dist/migration/upgrade-to-angular-14.js.map +1 -1
- package/dist/migration/upgrade-to-angular-15.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-15.js +4 -1
- package/dist/migration/upgrade-to-angular-15.js.map +1 -1
- package/dist/migration/upgrade-to-angular-16.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-16.js +3 -0
- package/dist/migration/upgrade-to-angular-16.js.map +1 -1
- package/dist/migration/upgrade-to-angular-17.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-17.js +4 -1
- package/dist/migration/upgrade-to-angular-17.js.map +1 -1
- package/dist/migration/upgrade-to-angular-18.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-18.js +4 -1
- package/dist/migration/upgrade-to-angular-18.js.map +1 -1
- package/dist/migration/upgrade-to-angular-19.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-19.js +14 -2
- package/dist/migration/upgrade-to-angular-19.js.map +1 -1
- package/dist/migration/upgrade-to-angular-20.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-20.js +14 -1
- package/dist/migration/upgrade-to-angular-20.js.map +1 -1
- package/dist/migration/upgrade-to-angular-21.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-21.js +3 -0
- package/dist/migration/upgrade-to-angular-21.js.map +1 -1
- package/dist/migration/upgrade-to-angular-8.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-8.js +4 -1
- package/dist/migration/upgrade-to-angular-8.js.map +1 -1
- package/dist/migration/upgrade-to-angular-9.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-9.js +4 -1
- package/dist/migration/upgrade-to-angular-9.js.map +1 -1
- package/package.json +6 -5
- package/src/index.ts +216 -0
- package/src/libraries/cdk/find-cdk-signature-changes.ts +1 -6
- package/src/libraries/cdk/migrate-cdk-sass-imports.ts +4 -7
- package/src/libraries/cdk/migrate-cdk-stepper.ts +2 -2
- package/src/libraries/cdk/migrate-deprecated-overlay-sass.ts +2 -4
- package/src/libraries/cdk/migrate-focus-trap-factory-create.ts +2 -1
- package/src/libraries/cdk/remove-cdk-super-arguments.ts +1 -2
- package/src/libraries/cdk/remove-portal-factory-resolver-arguments.ts +4 -6
- package/src/libraries/cdk/rename-portal-template-selectors.ts +3 -4
- package/src/libraries/cdk/upgrade-to-cdk.ts +7 -12
- package/src/libraries/components/lst.ts +29 -2
- package/src/libraries/components/style-sources.ts +69 -0
- package/src/libraries/components/stylesheets.ts +50 -10
- package/src/libraries/components/symbols.ts +5 -4
- package/src/libraries/components/template-elements.ts +118 -0
- package/src/libraries/components/templates.ts +48 -35
- package/src/libraries/material/add-system-variables-prefix.ts +87 -0
- package/src/libraries/material/add-theme-base-mixins.ts +159 -0
- package/src/libraries/material/find-chip-input-event-without-chip-input.ts +62 -0
- package/src/libraries/material/find-legacy-material-usage.ts +67 -0
- package/src/libraries/material/find-material-constructor-changes.ts +230 -0
- package/src/libraries/material/find-mdc-breaking-changes.ts +262 -0
- package/src/libraries/material/find-mixin-error-state-without-state-changes.ts +89 -0
- package/src/libraries/material/find-raw-palette-themes.ts +98 -0
- package/src/libraries/material/find-removed-material-apis.ts +54 -0
- package/src/libraries/material/find-removed-material-classes.ts +119 -0
- package/src/libraries/material/find-removed-material-members.ts +145 -0
- package/src/libraries/material/find-slide-toggle-drag-options.ts +66 -0
- package/src/libraries/material/material-15-classes.ts +435 -0
- package/src/libraries/material/material-entry-points.ts +198 -0
- package/src/libraries/material/material-legacy-symbols.ts +557 -0
- package/src/libraries/material/material-theming-api.ts +454 -0
- package/src/libraries/material/material-version.ts +174 -0
- package/src/libraries/material/migrate-legacy-material.ts +196 -0
- package/src/libraries/material/migrate-list-item-harness-content-loader.ts +39 -0
- package/src/libraries/material/migrate-m2-theming-api.ts +95 -0
- package/src/libraries/material/migrate-mat-core-to-elevation-classes.ts +35 -0
- package/src/libraries/material/migrate-material-15-typography.ts +145 -0
- package/src/libraries/material/migrate-material-secondary-entry-points.ts +186 -0
- package/src/libraries/material/migrate-material-theming-api.ts +197 -0
- package/src/libraries/material/migrate-mdc-styles.ts +110 -0
- package/src/libraries/material/migrate-mdc-templates.ts +292 -0
- package/src/libraries/material/migrate-selection-list-change-option.ts +28 -0
- package/src/libraries/material/remove-mat-stepper-document-argument.ts +43 -0
- package/src/libraries/material/remove-update-active-link-argument.ts +32 -0
- package/src/libraries/material/rename-material-members.ts +109 -0
- package/src/libraries/material/rename-material-style-names.ts +164 -0
- package/src/libraries/material/rename-textarea-autosize-attributes.ts +35 -0
- package/src/libraries/material/upgrade-to-material.ts +274 -0
- package/src/migration/js-support.ts +2 -2
- package/src/migration/json-support.ts +50 -1
- package/src/migration/move-common-engine-to-ssr-node.ts +46 -0
- package/src/migration/remove-guard-and-resolve-interfaces.ts +89 -0
- package/src/migration/remove-show-circular-dependencies.ts +40 -0
- package/src/migration/rename-ssr-experimental-platform.ts +8 -49
- package/src/migration/replace-browser-target.ts +45 -0
- package/src/migration/replace-default-collection.ts +45 -0
- package/src/migration/replace-get-current-navigation.ts +50 -0
- package/src/migration/replace-initializer-providers.ts +153 -0
- package/src/migration/replace-preserve-query-params.ts +88 -0
- package/src/migration/replace-provide-server-routing.ts +79 -0
- package/src/migration/upgrade-to-angular-10.ts +4 -1
- package/src/migration/upgrade-to-angular-11.ts +13 -2
- package/src/migration/upgrade-to-angular-12.ts +4 -1
- package/src/migration/upgrade-to-angular-13.ts +4 -1
- package/src/migration/upgrade-to-angular-14.ts +11 -1
- package/src/migration/upgrade-to-angular-15.ts +4 -1
- package/src/migration/upgrade-to-angular-16.ts +3 -0
- package/src/migration/upgrade-to-angular-17.ts +4 -1
- package/src/migration/upgrade-to-angular-18.ts +4 -1
- package/src/migration/upgrade-to-angular-19.ts +14 -2
- package/src/migration/upgrade-to-angular-20.ts +14 -1
- package/src/migration/upgrade-to-angular-21.ts +3 -0
- package/src/migration/upgrade-to-angular-8.ts +4 -1
- package/src/migration/upgrade-to-angular-9.ts +4 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {ExecutionContext, Recipe, TreeVisitor} from "@openrewrite/rewrite";
|
|
8
|
+
import {JavaScriptVisitor, maybeAddImport, maybeRemoveImport, Template} from "@openrewrite/rewrite/javascript";
|
|
9
|
+
import {isIdentifier, J} from "@openrewrite/rewrite/java";
|
|
10
|
+
|
|
11
|
+
const SSR_MODULE = '@angular/ssr';
|
|
12
|
+
|
|
13
|
+
const ROUTING_PROVIDERS = new Set(['provideServerRouting', 'provideServerRoutesConfig']);
|
|
14
|
+
|
|
15
|
+
export class ReplaceProvideServerRouting extends Recipe {
|
|
16
|
+
readonly name = "org.openrewrite.angular.migration.replace-provide-server-routing";
|
|
17
|
+
readonly displayName: string = "Replace `provideServerRouting` with `provideServerRendering(withRoutes())`";
|
|
18
|
+
readonly description: string = "Folds `provideServerRouting(routes)` and `provideServerRoutesConfig(routes, options)` " +
|
|
19
|
+
"into `provideServerRendering(withRoutes(routes), options)` and drops a bare `provideServerRendering()` " +
|
|
20
|
+
"from the same providers array. Angular 20 removed both functions. " +
|
|
21
|
+
"Matches the `replace-provide-server-routing` schematic.";
|
|
22
|
+
|
|
23
|
+
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
24
|
+
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
25
|
+
protected async visitNewArray(newArray: J.NewArray, p: ExecutionContext): Promise<J | undefined> {
|
|
26
|
+
const a = await super.visitNewArray(newArray, p) as J.NewArray;
|
|
27
|
+
const elements = a.initializer?.elements;
|
|
28
|
+
if (!elements?.some(rp => routingProviderName(rp.element))) return a;
|
|
29
|
+
|
|
30
|
+
const rewritten = [];
|
|
31
|
+
for (const rp of elements) {
|
|
32
|
+
const call = rp.element as J.MethodInvocation;
|
|
33
|
+
const routingProvider = routingProviderName(rp.element);
|
|
34
|
+
|
|
35
|
+
if (routingProvider) {
|
|
36
|
+
maybeRemoveImport(this, SSR_MODULE, routingProvider);
|
|
37
|
+
maybeAddImport(this, {module: SSR_MODULE, member: 'provideServerRendering'});
|
|
38
|
+
maybeAddImport(this, {module: SSR_MODULE, member: 'withRoutes'});
|
|
39
|
+
rewritten.push({...rp, element: await buildRendering(call).apply(call, this.cursor) as J});
|
|
40
|
+
} else if (!isBareProvideServerRendering(rp.element)) {
|
|
41
|
+
rewritten.push(rp);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The first surviving entry takes the array's leading space.
|
|
46
|
+
rewritten[0] = {...rewritten[0], element: {...rewritten[0].element, prefix: elements[0].element.prefix}};
|
|
47
|
+
return {...a, initializer: {...a.initializer!, elements: rewritten}} as J.NewArray;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function calledName(node: J): string | undefined {
|
|
54
|
+
if (node.kind !== J.Kind.MethodInvocation) return undefined;
|
|
55
|
+
const call = node as J.MethodInvocation;
|
|
56
|
+
return !call.select && isIdentifier(call.name) ? call.name.simpleName : undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function routingProviderName(node: J): string | undefined {
|
|
60
|
+
const name = calledName(node);
|
|
61
|
+
return name && ROUTING_PROVIDERS.has(name) ? name : undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** A no-argument `provideServerRendering()`, which the folded call stands in for. */
|
|
65
|
+
function isBareProvideServerRendering(node: J): boolean {
|
|
66
|
+
if (calledName(node) !== 'provideServerRendering') return false;
|
|
67
|
+
const args = (node as J.MethodInvocation).arguments?.elements ?? [];
|
|
68
|
+
return args.every(rp => rp.element.kind === J.Kind.Empty);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function buildRendering(call: J.MethodInvocation): Template {
|
|
72
|
+
const args = (call.arguments?.elements ?? []).filter(rp => rp.element.kind !== J.Kind.Empty);
|
|
73
|
+
const b = Template.builder().code('provideServerRendering(withRoutes(');
|
|
74
|
+
b.param({...args[0].element, type: undefined} as J).code(')');
|
|
75
|
+
for (const rest of args.slice(1)) {
|
|
76
|
+
b.code(', ').param({...rest.element, type: undefined} as J);
|
|
77
|
+
}
|
|
78
|
+
return b.code(')').build();
|
|
79
|
+
}
|
|
@@ -12,6 +12,7 @@ import {FindBareModuleWithProviders} from "../search/find-bare-module-with-provi
|
|
|
12
12
|
import {ReplaceValidatorWithValidators} from "./replace-validator-with-validators";
|
|
13
13
|
import {MigrateToSolutionStyleTsconfig} from "./migrate-to-solution-style-tsconfig";
|
|
14
14
|
import {RenameFile} from "./rename-file";
|
|
15
|
+
import {UpgradeToMaterial10CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
15
16
|
|
|
16
17
|
export class UpgradeToAngular10CodeChanges extends Recipe {
|
|
17
18
|
readonly name = "org.openrewrite.angular.UpgradeToAngular10CodeChanges";
|
|
@@ -30,6 +31,7 @@ export class UpgradeToAngular10CodeChanges extends Recipe {
|
|
|
30
31
|
new FindBareModuleWithProviders(),
|
|
31
32
|
// Rename browserslist → .browserslistrc
|
|
32
33
|
new RenameFile({fileMatcher: "**/browserslist", fileName: ".browserslistrc"}),
|
|
34
|
+
new UpgradeToMaterial10CodeChanges(),
|
|
33
35
|
];
|
|
34
36
|
}
|
|
35
37
|
}
|
|
@@ -42,7 +44,8 @@ export class UpgradeToAngular10 extends Recipe {
|
|
|
42
44
|
"renaming deprecated `validator`/`asyncValidator` to their plural forms, " +
|
|
43
45
|
"renaming `browserslist` to `.browserslistrc`, " +
|
|
44
46
|
"migrating to solution-style `tsconfig.json`, " +
|
|
45
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
47
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
48
|
+
" It includes the Angular Material code changes of version 10.";
|
|
46
49
|
|
|
47
50
|
async recipeList(): Promise<Recipe[]> {
|
|
48
51
|
return [
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {removeDependency} from "@openrewrite/rewrite/javascript";
|
|
8
9
|
import {upgradeAngularDependencies} from "./upgrade-angular-dependencies";
|
|
9
10
|
import {UpgradeToAngular10CodeChanges} from "./upgrade-to-angular-10";
|
|
10
11
|
import {ReplaceViewEncapsulationNative} from "./replace-view-encapsulation-native";
|
|
@@ -13,6 +14,8 @@ import {FindPreserveQueryParamsUsage} from "../search/find-preserve-query-params
|
|
|
13
14
|
import {FindPreserveFragmentUsage} from "../search/find-preserve-fragment-usage";
|
|
14
15
|
import {FindWrappedValueUsage} from "../search/find-wrapped-value-usage";
|
|
15
16
|
import {ReplaceInitialNavigation} from "./replace-initial-navigation";
|
|
17
|
+
import {ReplacePreserveQueryParams} from "./replace-preserve-query-params";
|
|
18
|
+
import {UpgradeToMaterial11CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
16
19
|
|
|
17
20
|
export class UpgradeToAngular11CodeChanges extends Recipe {
|
|
18
21
|
readonly name = "org.openrewrite.angular.UpgradeToAngular11CodeChanges";
|
|
@@ -27,10 +30,15 @@ export class UpgradeToAngular11CodeChanges extends Recipe {
|
|
|
27
30
|
new ReplaceViewEncapsulationNative(),
|
|
28
31
|
new RemoveExtractCss(),
|
|
29
32
|
new ReplaceInitialNavigation(),
|
|
33
|
+
new ReplacePreserveQueryParams(),
|
|
30
34
|
// Search: deprecated APIs
|
|
31
35
|
new FindPreserveQueryParamsUsage(),
|
|
32
36
|
new FindPreserveFragmentUsage(),
|
|
33
37
|
new FindWrappedValueUsage(),
|
|
38
|
+
new UpgradeToMaterial11CodeChanges(),
|
|
39
|
+
// The last releases of these packages pin an exact Angular 10 peer, and `FindPlatformWebworkerUsage` is what flags their imports.
|
|
40
|
+
await removeDependency({packageName: "@angular/platform-webworker"}),
|
|
41
|
+
await removeDependency({packageName: "@angular/platform-webworker-dynamic"}),
|
|
34
42
|
];
|
|
35
43
|
}
|
|
36
44
|
}
|
|
@@ -41,8 +49,11 @@ export class UpgradeToAngular11 extends Recipe {
|
|
|
41
49
|
readonly description = "Migrates Angular 10.x applications to Angular 11. " +
|
|
42
50
|
"This includes replacing `ViewEncapsulation.Native` with `ViewEncapsulation.ShadowDom`, " +
|
|
43
51
|
"removing the deprecated `extractCss` build option from `angular.json`, " +
|
|
44
|
-
"
|
|
45
|
-
"
|
|
52
|
+
"rewriting `preserveQueryParams` navigation extras to `queryParamsHandling`, " +
|
|
53
|
+
"flagging deprecated string-based `loadChildren` and any remaining `preserveQueryParams` usage, " +
|
|
54
|
+
"removing the `@angular/platform-webworker` packages, " +
|
|
55
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
56
|
+
" It includes the Angular Material code changes of version 11.";
|
|
46
57
|
|
|
47
58
|
async recipeList(): Promise<Recipe[]> {
|
|
48
59
|
return [
|
|
@@ -11,6 +11,7 @@ import {AddDefaultConfiguration} from "./add-default-configuration";
|
|
|
11
11
|
import {ReplaceNodeSassWithSass} from "./replace-node-sass-with-sass";
|
|
12
12
|
import {FindAsyncTestHelperUsage} from "../search/find-async-test-helper-usage";
|
|
13
13
|
import {FindCompilerFactoryUsage} from "../search/find-compiler-factory-usage";
|
|
14
|
+
import {UpgradeToMaterial12CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
14
15
|
|
|
15
16
|
export class UpgradeToAngular12CodeChanges extends Recipe {
|
|
16
17
|
readonly name = "org.openrewrite.angular.UpgradeToAngular12CodeChanges";
|
|
@@ -27,6 +28,7 @@ export class UpgradeToAngular12CodeChanges extends Recipe {
|
|
|
27
28
|
// Search: deprecated APIs
|
|
28
29
|
new FindAsyncTestHelperUsage(),
|
|
29
30
|
new FindCompilerFactoryUsage(),
|
|
31
|
+
new UpgradeToMaterial12CodeChanges(),
|
|
30
32
|
];
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -37,7 +39,8 @@ export class UpgradeToAngular12 extends Recipe {
|
|
|
37
39
|
readonly description = "Migrates Angular 11.x applications to Angular 12. " +
|
|
38
40
|
"This includes adding `defaultConfiguration: \"production\"` to build targets in `angular.json`, " +
|
|
39
41
|
"replacing `node-sass` with `sass` (Dart Sass), flagging deprecated `async` test helper and View Engine APIs, " +
|
|
40
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
42
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
43
|
+
" It includes the Angular Material code changes of version 12.";
|
|
41
44
|
|
|
42
45
|
async recipeList(): Promise<Recipe[]> {
|
|
43
46
|
return [
|
|
@@ -13,6 +13,7 @@ import {RemoveDefaultProject} from "./remove-default-project";
|
|
|
13
13
|
import {AddTestBedTeardown} from "./add-testbed-teardown";
|
|
14
14
|
import {RemoveComponentFactoryResolver} from "./remove-component-factory-resolver";
|
|
15
15
|
import {UpgradeToCdk13CodeChanges} from "../libraries/cdk/upgrade-to-cdk";
|
|
16
|
+
import {UpgradeToMaterial13CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
16
17
|
|
|
17
18
|
export class UpgradeToAngular13CodeChanges extends Recipe {
|
|
18
19
|
readonly name = "org.openrewrite.angular.UpgradeToAngular13CodeChanges";
|
|
@@ -30,6 +31,7 @@ export class UpgradeToAngular13CodeChanges extends Recipe {
|
|
|
30
31
|
new AddTestBedTeardown(),
|
|
31
32
|
new RemoveComponentFactoryResolver(),
|
|
32
33
|
new UpgradeToCdk13CodeChanges(),
|
|
34
|
+
new UpgradeToMaterial13CodeChanges(),
|
|
33
35
|
];
|
|
34
36
|
}
|
|
35
37
|
}
|
|
@@ -41,7 +43,8 @@ export class UpgradeToAngular13 extends Recipe {
|
|
|
41
43
|
"This includes updating `tsconfig.json` target to `es2017`, removing IE11 polyfills, " +
|
|
42
44
|
"removing `defaultProject` from `angular.json`, adding TestBed module teardown, " +
|
|
43
45
|
"simplifying `ComponentFactoryResolver` usage, " +
|
|
44
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
46
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
47
|
+
" It includes the Angular Material code changes of version 13.";
|
|
45
48
|
|
|
46
49
|
async recipeList(): Promise<Recipe[]> {
|
|
47
50
|
return [
|
|
@@ -9,8 +9,11 @@ import {upgradeAngularDependencies} from "./upgrade-angular-dependencies";
|
|
|
9
9
|
import {UpgradeToAngular13CodeChanges} from "./upgrade-to-angular-13";
|
|
10
10
|
import {ReplaceUntypedForms} from "./replace-untyped-forms";
|
|
11
11
|
import {RemoveAotSummaries} from "./remove-aot-summaries";
|
|
12
|
+
import {ReplaceDefaultCollection} from "./replace-default-collection";
|
|
13
|
+
import {RemoveShowCircularDependencies} from "./remove-show-circular-dependencies";
|
|
12
14
|
import {FindPathMatchTypeUsage} from "../search/find-path-match-type-usage";
|
|
13
15
|
import {UpgradeToCdk14CodeChanges} from "../libraries/cdk/upgrade-to-cdk";
|
|
16
|
+
import {UpgradeToMaterial14CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
14
17
|
|
|
15
18
|
export class UpgradeToAngular14CodeChanges extends Recipe {
|
|
16
19
|
readonly name = "org.openrewrite.angular.UpgradeToAngular14CodeChanges";
|
|
@@ -24,9 +27,13 @@ export class UpgradeToAngular14CodeChanges extends Recipe {
|
|
|
24
27
|
// Code transformations
|
|
25
28
|
new ReplaceUntypedForms(),
|
|
26
29
|
new RemoveAotSummaries(),
|
|
30
|
+
// Workspace configuration
|
|
31
|
+
new ReplaceDefaultCollection(),
|
|
32
|
+
new RemoveShowCircularDependencies(),
|
|
27
33
|
// Search: type changes
|
|
28
34
|
new FindPathMatchTypeUsage(),
|
|
29
35
|
new UpgradeToCdk14CodeChanges(),
|
|
36
|
+
new UpgradeToMaterial14CodeChanges(),
|
|
30
37
|
];
|
|
31
38
|
}
|
|
32
39
|
}
|
|
@@ -38,7 +45,10 @@ export class UpgradeToAngular14 extends Recipe {
|
|
|
38
45
|
"This includes replacing form classes with their `Untyped*` equivalents for backward compatibility with typed forms, " +
|
|
39
46
|
"updating deprecated `initialNavigation` router option values, " +
|
|
40
47
|
"removing `aotSummaries` from TestBed calls, " +
|
|
41
|
-
"
|
|
48
|
+
"replacing the `cli.defaultCollection` workspace option with `cli.schematicCollections`, " +
|
|
49
|
+
"removing the `showCircularDependencies` builder option, " +
|
|
50
|
+
"and flagging `pathMatch` properties that may need type narrowing." +
|
|
51
|
+
" It includes the Angular Material code changes of version 14.";
|
|
42
52
|
|
|
43
53
|
async recipeList(): Promise<Recipe[]> {
|
|
44
54
|
return [
|
|
@@ -11,6 +11,7 @@ import {RemoveRelativeLinkResolution} from "./remove-relative-link-resolution";
|
|
|
11
11
|
import {RemoveEnableIvy} from "./remove-enable-ivy";
|
|
12
12
|
import {FindDatePipeDefaultTimezoneUsage} from "../search/find-date-pipe-default-timezone-usage";
|
|
13
13
|
import {FindProvidedInDeprecatedUsage} from "../search/find-provided-in-deprecated-usage";
|
|
14
|
+
import {UpgradeToMaterial15CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
14
15
|
|
|
15
16
|
export class UpgradeToAngular15CodeChanges extends Recipe {
|
|
16
17
|
readonly name = "org.openrewrite.angular.UpgradeToAngular15CodeChanges";
|
|
@@ -27,6 +28,7 @@ export class UpgradeToAngular15CodeChanges extends Recipe {
|
|
|
27
28
|
// Search: deprecated APIs
|
|
28
29
|
new FindDatePipeDefaultTimezoneUsage(),
|
|
29
30
|
new FindProvidedInDeprecatedUsage(),
|
|
31
|
+
new UpgradeToMaterial15CodeChanges(),
|
|
30
32
|
];
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -38,7 +40,8 @@ export class UpgradeToAngular15 extends Recipe {
|
|
|
38
40
|
"This includes removing the `relativeLinkResolution` option from `RouterModule.forRoot()`, " +
|
|
39
41
|
"removing the `enableIvy` compiler option from `tsconfig.json`, " +
|
|
40
42
|
"flagging the deprecated `DATE_PIPE_DEFAULT_TIMEZONE` token and `providedIn: NgModule`/`'any'` usage, " +
|
|
41
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
43
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
44
|
+
" It includes the Angular Material code changes of version 15.";
|
|
42
45
|
|
|
43
46
|
async recipeList(): Promise<Recipe[]> {
|
|
44
47
|
return [
|
|
@@ -10,6 +10,7 @@ import {upgradeAngularDependencies} from "./upgrade-angular-dependencies";
|
|
|
10
10
|
import {UpgradeToAngular15CodeChanges} from "./upgrade-to-angular-15";
|
|
11
11
|
import {RemoveEntryComponents} from "./remove-entry-components";
|
|
12
12
|
import {RemoveModuleId} from "./remove-module-id";
|
|
13
|
+
import {RemoveGuardAndResolveInterfaces} from "./remove-guard-and-resolve-interfaces";
|
|
13
14
|
import {ReplaceRouterLinkWithHref} from "./replace-router-link-with-href";
|
|
14
15
|
import {FindReflectiveInjectorUsage} from "../search/find-reflective-injector-usage";
|
|
15
16
|
import {FindRenderModuleFactoryUsage} from "../search/find-render-module-factory-usage";
|
|
@@ -28,6 +29,7 @@ export class UpgradeToAngular16CodeChanges extends Recipe {
|
|
|
28
29
|
// Code transformations
|
|
29
30
|
new RemoveEntryComponents(),
|
|
30
31
|
new RemoveModuleId(),
|
|
32
|
+
new RemoveGuardAndResolveInterfaces(),
|
|
31
33
|
new ReplaceRouterLinkWithHref(),
|
|
32
34
|
// Import moves
|
|
33
35
|
new ChangeImport({
|
|
@@ -49,6 +51,7 @@ export class UpgradeToAngular16 extends Recipe {
|
|
|
49
51
|
readonly displayName = "Upgrade to Angular 16";
|
|
50
52
|
readonly description = "Migrates Angular 15.x applications to Angular 16. " +
|
|
51
53
|
"This includes removing `entryComponents` and `moduleId` from decorators, replacing `RouterLinkWithHref` with `RouterLink`, " +
|
|
54
|
+
"removing the deprecated router guard and resolver interfaces from `implements` clauses, " +
|
|
52
55
|
"moving the `XhrFactory` import to `@angular/common`, and flagging removed APIs " +
|
|
53
56
|
"like `ReflectiveInjector`, `renderModuleFactory`, and `BrowserTransferStateModule`.";
|
|
54
57
|
|
|
@@ -11,6 +11,7 @@ import {ReplaceDeepZoneJsImports} from "./replace-deep-zone-js-imports";
|
|
|
11
11
|
import {FindWithNoDomReuseUsage} from "../search/find-with-no-dom-reuse-usage";
|
|
12
12
|
import {FindSetupTestingRouterUsage} from "../search/find-setup-testing-router-usage";
|
|
13
13
|
import {UpgradeToCdk17CodeChanges} from "../libraries/cdk/upgrade-to-cdk";
|
|
14
|
+
import {UpgradeToMaterial17CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
14
15
|
|
|
15
16
|
export class UpgradeToAngular17CodeChanges extends Recipe {
|
|
16
17
|
readonly name = "org.openrewrite.angular.UpgradeToAngular17CodeChanges";
|
|
@@ -27,6 +28,7 @@ export class UpgradeToAngular17CodeChanges extends Recipe {
|
|
|
27
28
|
new FindWithNoDomReuseUsage(),
|
|
28
29
|
new FindSetupTestingRouterUsage(),
|
|
29
30
|
new UpgradeToCdk17CodeChanges(),
|
|
31
|
+
new UpgradeToMaterial17CodeChanges(),
|
|
30
32
|
];
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -37,7 +39,8 @@ export class UpgradeToAngular17 extends Recipe {
|
|
|
37
39
|
readonly description = "Migrates Angular 16.x applications to Angular 17. " +
|
|
38
40
|
"This includes updating Angular package versions, replacing legacy deep `zone.js` imports, " +
|
|
39
41
|
"flagging the removed `withNoDomReuse` and `setupTestingRouter` APIs, " +
|
|
40
|
-
"and upgrading TypeScript and `zone.js` dependencies."
|
|
42
|
+
"and upgrading TypeScript and `zone.js` dependencies." +
|
|
43
|
+
" It includes the Angular Material code changes of version 17.";
|
|
41
44
|
|
|
42
45
|
async recipeList(): Promise<Recipe[]> {
|
|
43
46
|
return [
|
|
@@ -17,6 +17,7 @@ import {FindServerTransferStateModuleUsage} from "../search/find-server-transfer
|
|
|
17
17
|
import {FindResourceCacheProviderUsage} from "../search/find-resource-cache-provider-usage";
|
|
18
18
|
import {FindTestabilityPendingRequestUsage} from "../search/find-testability-pending-request-usage";
|
|
19
19
|
import {FindAnimationDriverMatchesElement} from "../search/find-animation-driver-matches-element";
|
|
20
|
+
import {UpgradeToMaterial18CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
20
21
|
|
|
21
22
|
export class UpgradeToAngular18CodeChanges extends Recipe {
|
|
22
23
|
readonly name = "org.openrewrite.angular.UpgradeToAngular18CodeChanges";
|
|
@@ -57,6 +58,7 @@ export class UpgradeToAngular18CodeChanges extends Recipe {
|
|
|
57
58
|
// There is no 19/20/21 equivalent yet, so this stays in the chained half: without it a
|
|
58
59
|
// migration to a later major would leave these libraries on a pre-18 line entirely.
|
|
59
60
|
new UpgradeAngularPeerLibsTo18(),
|
|
61
|
+
new UpgradeToMaterial18CodeChanges(),
|
|
60
62
|
];
|
|
61
63
|
}
|
|
62
64
|
}
|
|
@@ -67,7 +69,8 @@ export class UpgradeToAngular18 extends Recipe {
|
|
|
67
69
|
readonly description = "Migrates Angular 17.x applications to Angular 18. " +
|
|
68
70
|
"This includes replacing the deprecated `async` test helper with `waitForAsync`, " +
|
|
69
71
|
"migrating `HttpClientModule` to `provideHttpClient()`, moving Transfer State APIs " +
|
|
70
|
-
"to `@angular/core`, and flagging removed platform APIs."
|
|
72
|
+
"to `@angular/core`, and flagging removed platform APIs." +
|
|
73
|
+
" It includes the Angular Material code changes of version 18.";
|
|
71
74
|
|
|
72
75
|
async recipeList(): Promise<Recipe[]> {
|
|
73
76
|
return [
|
|
@@ -10,9 +10,13 @@ import {upgradeAngularDependencies} from "./upgrade-angular-dependencies";
|
|
|
10
10
|
import {UpgradeToAngular18CodeChanges} from "./upgrade-to-angular-18";
|
|
11
11
|
import {ExplicitStandaloneFlag} from "./explicit-standalone-flag";
|
|
12
12
|
import {RenamePendingTasks} from "./rename-pending-tasks";
|
|
13
|
+
import {ReplaceInitializerProviders} from "./replace-initializer-providers";
|
|
13
14
|
import {RemoveBrowserModuleWithServerTransition} from "./remove-browser-module-with-server-transition";
|
|
15
|
+
import {MoveCommonEngineToSsrNode} from "./move-common-engine-to-ssr-node";
|
|
16
|
+
import {ReplaceBrowserTarget} from "./replace-browser-target";
|
|
14
17
|
import {FindEffectTimingUsage} from "../search/find-effect-timing-usage";
|
|
15
18
|
import {FindEmptyProjectableNodes} from "../search/find-empty-projectable-nodes";
|
|
19
|
+
import {UpgradeToMaterial19CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
16
20
|
|
|
17
21
|
export class UpgradeToAngular19CodeChanges extends Recipe {
|
|
18
22
|
readonly name = "org.openrewrite.angular.UpgradeToAngular19CodeChanges";
|
|
@@ -26,15 +30,20 @@ export class UpgradeToAngular19CodeChanges extends Recipe {
|
|
|
26
30
|
// Code transformations
|
|
27
31
|
new ExplicitStandaloneFlag(),
|
|
28
32
|
new RenamePendingTasks(),
|
|
33
|
+
new ReplaceInitializerProviders(),
|
|
29
34
|
new ChangeImport({
|
|
30
35
|
oldModule: "@angular/platform-browser",
|
|
31
36
|
oldMember: "ApplicationConfig",
|
|
32
37
|
newModule: "@angular/core",
|
|
33
38
|
}),
|
|
34
39
|
new RemoveBrowserModuleWithServerTransition(),
|
|
40
|
+
new MoveCommonEngineToSsrNode(),
|
|
41
|
+
// Workspace configuration
|
|
42
|
+
new ReplaceBrowserTarget(),
|
|
35
43
|
// Behavioral change warnings
|
|
36
44
|
new FindEffectTimingUsage(),
|
|
37
45
|
new FindEmptyProjectableNodes(),
|
|
46
|
+
new UpgradeToMaterial19CodeChanges(),
|
|
38
47
|
];
|
|
39
48
|
}
|
|
40
49
|
}
|
|
@@ -44,8 +53,11 @@ export class UpgradeToAngular19 extends Recipe {
|
|
|
44
53
|
readonly displayName = "Upgrade to Angular 19";
|
|
45
54
|
readonly description = "Migrates Angular 18.x applications to Angular 19. " +
|
|
46
55
|
"This includes updating Angular package versions, adjusting the standalone default, " +
|
|
47
|
-
"renaming `ExperimentalPendingTasks` to `PendingTasks`,
|
|
48
|
-
"
|
|
56
|
+
"renaming `ExperimentalPendingTasks` to `PendingTasks`, replacing the `APP_INITIALIZER`, " +
|
|
57
|
+
"`ENVIRONMENT_INITIALIZER`, and `PLATFORM_INITIALIZER` tokens with their provider functions, " +
|
|
58
|
+
"moving the `ApplicationConfig` import to `@angular/core`, moving `CommonEngine` imports to " +
|
|
59
|
+
"`@angular/ssr/node`, renaming the `browserTarget` builder option to `buildTarget`, and updating `zone.js`." +
|
|
60
|
+
" It includes the Angular Material code changes of version 19.";
|
|
49
61
|
|
|
50
62
|
async recipeList(): Promise<Recipe[]> {
|
|
51
63
|
return [
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport} from "@openrewrite/rewrite/javascript";
|
|
8
9
|
import {upgradeAngularDependencies} from "./upgrade-angular-dependencies";
|
|
9
10
|
import {UpgradeToAngular19CodeChanges} from "./upgrade-to-angular-19";
|
|
10
11
|
import {RenameZonelessProvider} from "./rename-zoneless-provider";
|
|
@@ -14,7 +15,9 @@ import {ReplaceInjectFlags} from "./replace-inject-flags";
|
|
|
14
15
|
import {MoveDocumentImport} from "./move-document-to-core";
|
|
15
16
|
import {RemoveStandaloneTrue} from "./remove-standalone-true";
|
|
16
17
|
import {RemoveZoneJsPolyfill} from "./remove-zone-js-polyfill";
|
|
18
|
+
import {ReplaceProvideServerRouting} from "./replace-provide-server-routing";
|
|
17
19
|
import {UpgradeToCdk20CodeChanges} from "../libraries/cdk/upgrade-to-cdk";
|
|
20
|
+
import {UpgradeToMaterial20CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
18
21
|
|
|
19
22
|
export class UpgradeToAngular20CodeChanges extends Recipe {
|
|
20
23
|
readonly name = "org.openrewrite.angular.UpgradeToAngular20CodeChanges";
|
|
@@ -33,7 +36,15 @@ export class UpgradeToAngular20CodeChanges extends Recipe {
|
|
|
33
36
|
new MoveDocumentImport(),
|
|
34
37
|
new RemoveStandaloneTrue(),
|
|
35
38
|
new RemoveZoneJsPolyfill(),
|
|
39
|
+
// Server-side rendering moved out of `@angular/platform-server`
|
|
40
|
+
new ChangeImport({
|
|
41
|
+
oldModule: "@angular/platform-server",
|
|
42
|
+
oldMember: "provideServerRendering",
|
|
43
|
+
newModule: "@angular/ssr",
|
|
44
|
+
}),
|
|
45
|
+
new ReplaceProvideServerRouting(),
|
|
36
46
|
new UpgradeToCdk20CodeChanges(),
|
|
47
|
+
new UpgradeToMaterial20CodeChanges(),
|
|
37
48
|
];
|
|
38
49
|
}
|
|
39
50
|
}
|
|
@@ -43,7 +54,9 @@ export class UpgradeToAngular20 extends Recipe {
|
|
|
43
54
|
readonly displayName = "Upgrade to Angular 20";
|
|
44
55
|
readonly description = "Migrates Angular 19.x applications to Angular 20. " +
|
|
45
56
|
"This includes running the Angular 19 migration first, then updating Angular package versions, " +
|
|
46
|
-
"renaming experimental APIs promoted to stable,
|
|
57
|
+
"renaming experimental APIs promoted to stable, moving `provideServerRendering` to `@angular/ssr` and " +
|
|
58
|
+
"folding `provideServerRouting` into it, and upgrading TypeScript to 5.8.x." +
|
|
59
|
+
" It includes the Angular Material code changes of version 20.";
|
|
47
60
|
|
|
48
61
|
async recipeList(): Promise<Recipe[]> {
|
|
49
62
|
return [
|
|
@@ -13,6 +13,7 @@ import {FindNgClassUsage} from "../search/find-ng-class-usage";
|
|
|
13
13
|
import {FindNgStyleUsage} from "../search/find-ng-style-usage";
|
|
14
14
|
import {FindFakeAsyncUsage} from "../search/find-fake-async-usage";
|
|
15
15
|
import {MigrateConstructorToInject} from "./migrate-constructor-to-inject";
|
|
16
|
+
import {ReplaceGetCurrentNavigation} from "./replace-get-current-navigation";
|
|
16
17
|
import {MigrateInputToSignal} from "./migrate-input-to-signal";
|
|
17
18
|
import {MigrateOutputToSignal} from "./migrate-output-to-signal";
|
|
18
19
|
import {MigrateQueryToSignal} from "./migrate-query-to-signal";
|
|
@@ -36,6 +37,7 @@ export class UpgradeToAngular21CodeChanges extends Recipe {
|
|
|
36
37
|
new FindFakeAsyncUsage(),
|
|
37
38
|
// Constructor DI → inject()
|
|
38
39
|
new MigrateConstructorToInject(),
|
|
40
|
+
new ReplaceGetCurrentNavigation(),
|
|
39
41
|
new MigrateInputToSignal(),
|
|
40
42
|
new MigrateOutputToSignal(),
|
|
41
43
|
new MigrateQueryToSignal(),
|
|
@@ -52,6 +54,7 @@ export class UpgradeToAngular21 extends Recipe {
|
|
|
52
54
|
readonly description = "Migrates Angular 20.x applications to Angular 21. " +
|
|
53
55
|
"This includes running the Angular 20 migration first, flagging Karma test runner usage " +
|
|
54
56
|
"for Vitest migration, deprecated NgClass, zone.js-dependent test helpers, " +
|
|
57
|
+
"replacing `Router.getCurrentNavigation()` with the `Router.currentNavigation()` signal, " +
|
|
55
58
|
"and upgrading TypeScript to 5.9.x.";
|
|
56
59
|
|
|
57
60
|
async recipeList(): Promise<Recipe[]> {
|
|
@@ -12,6 +12,7 @@ import {MigrateAngularHttpToCommonHttp} from "./migrate-angular-http-to-common-h
|
|
|
12
12
|
import {FindPlatformWebworkerUsage} from "../search/find-platform-webworker-usage";
|
|
13
13
|
import {FindRxjsCompatUsage} from "../search/find-rxjs-compat-usage";
|
|
14
14
|
import {ReplaceLoadChildrenString} from "./replace-load-children-string";
|
|
15
|
+
import {UpgradeToMaterial8CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Source changes only. Later majors chain this instead of `UpgradeToAngular8` so they don't
|
|
@@ -33,6 +34,7 @@ export class UpgradeToAngular8CodeChanges extends Recipe {
|
|
|
33
34
|
new FindRxjsCompatUsage(),
|
|
34
35
|
new ReplaceLoadChildrenString(),
|
|
35
36
|
new FindPlatformWebworkerUsage(),
|
|
37
|
+
new UpgradeToMaterial8CodeChanges(),
|
|
36
38
|
// Remove rxjs-compat (RxJS 5→6 shim no longer needed). A one-shot removal rather than a
|
|
37
39
|
// version bump, so it lives here where migrations to later majors still pick it up.
|
|
38
40
|
await removeDependency({packageName: "rxjs-compat"}),
|
|
@@ -49,7 +51,8 @@ export class UpgradeToAngular8 extends Recipe {
|
|
|
49
51
|
"removing `rxjs-compat` and flagging any remaining RxJS 5-style imports, " +
|
|
50
52
|
"migrating `@angular/http` to `@angular/common/http` and flagging what has no equivalent, " +
|
|
51
53
|
"converting deprecated string-based `loadChildren` to dynamic imports, " +
|
|
52
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
54
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
55
|
+
" It includes the Angular Material code changes of version 8.";
|
|
53
56
|
|
|
54
57
|
async recipeList(): Promise<Recipe[]> {
|
|
55
58
|
return [
|
|
@@ -20,6 +20,7 @@ import {FindMissingInjectable} from "../search/find-missing-injectable";
|
|
|
20
20
|
import {FindAnalyzeForEntryComponentsUsage} from "../search/find-analyze-for-entry-components-usage";
|
|
21
21
|
import {ReplaceTestBedGetWithInject} from "./replace-testbed-get-with-inject";
|
|
22
22
|
import {AddModuleWithProvidersGeneric} from "./add-module-with-providers-generic";
|
|
23
|
+
import {UpgradeToMaterial9CodeChanges} from "../libraries/material/upgrade-to-material";
|
|
23
24
|
|
|
24
25
|
export class UpgradeToAngular9CodeChanges extends Recipe {
|
|
25
26
|
readonly name = "org.openrewrite.angular.UpgradeToAngular9CodeChanges";
|
|
@@ -45,6 +46,7 @@ export class UpgradeToAngular9CodeChanges extends Recipe {
|
|
|
45
46
|
new FindUndecoratedAngularClass(),
|
|
46
47
|
new FindMissingInjectable(),
|
|
47
48
|
new FindAnalyzeForEntryComponentsUsage(),
|
|
49
|
+
new UpgradeToMaterial9CodeChanges(),
|
|
48
50
|
];
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -59,7 +61,8 @@ export class UpgradeToAngular9 extends Recipe {
|
|
|
59
61
|
"enabling AOT compilation in `angular.json`, " +
|
|
60
62
|
"updating `tsconfig.json` module settings for Ivy, " +
|
|
61
63
|
"flagging removed View Engine APIs (`Renderer`, `RenderComponentType`, `RootRenderer`), " +
|
|
62
|
-
"and upgrading Angular, TypeScript, and related dependency versions."
|
|
64
|
+
"and upgrading Angular, TypeScript, and related dependency versions." +
|
|
65
|
+
" It includes the Angular Material code changes of version 9.";
|
|
63
66
|
|
|
64
67
|
async recipeList(): Promise<Recipe[]> {
|
|
65
68
|
return [
|