@openrewrite/recipes-angular 1.26.0 → 1.28.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 +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +188 -1
- package/dist/index.js.map +1 -1
- package/dist/libraries/components/lst.d.ts +7 -0
- package/dist/libraries/components/lst.d.ts.map +1 -1
- package/dist/libraries/components/lst.js +12 -0
- package/dist/libraries/components/lst.js.map +1 -1
- package/dist/libraries/components/style-sources.d.ts +15 -0
- package/dist/libraries/components/style-sources.d.ts.map +1 -0
- package/dist/libraries/components/style-sources.js +108 -0
- package/dist/libraries/components/style-sources.js.map +1 -0
- package/dist/libraries/components/stylesheets.d.ts +12 -0
- package/dist/libraries/components/stylesheets.d.ts.map +1 -1
- package/dist/libraries/components/stylesheets.js +37 -1
- package/dist/libraries/components/stylesheets.js.map +1 -1
- package/dist/libraries/components/symbols.d.ts +21 -1
- package/dist/libraries/components/symbols.d.ts.map +1 -1
- package/dist/libraries/components/symbols.js +124 -9
- package/dist/libraries/components/symbols.js.map +1 -1
- package/dist/libraries/components/template-elements.d.ts +38 -0
- package/dist/libraries/components/template-elements.d.ts.map +1 -0
- package/dist/libraries/components/template-elements.js +90 -0
- package/dist/libraries/components/template-elements.js.map +1 -0
- package/dist/libraries/components/templates.d.ts +6 -0
- package/dist/libraries/components/templates.d.ts.map +1 -1
- package/dist/libraries/components/templates.js +17 -2
- package/dist/libraries/components/templates.js.map +1 -1
- package/dist/libraries/material/add-system-variables-prefix.d.ts +9 -0
- package/dist/libraries/material/add-system-variables-prefix.d.ts.map +1 -0
- package/dist/libraries/material/add-system-variables-prefix.js +74 -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 +95 -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 +103 -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 +267 -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 +326 -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 +124 -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 +154 -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 +168 -0
- package/dist/libraries/material/find-removed-material-members.js.map +1 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.d.ts +8 -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 +102 -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 +24 -0
- package/dist/libraries/material/material-version.d.ts.map +1 -0
- package/dist/libraries/material/material-version.js +160 -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 +230 -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 +120 -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 +9 -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 +36 -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 +185 -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 +157 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.js.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts +17 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.js +190 -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 +145 -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 +306 -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 +72 -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 +54 -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 +28 -0
- package/dist/libraries/material/rename-material-style-names.d.ts.map +1 -0
- package/dist/libraries/material/rename-material-style-names.js +148 -0
- package/dist/libraries/material/rename-material-style-names.js.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts +20 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.js +32 -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 +324 -0
- package/dist/libraries/material/upgrade-to-material.js.map +1 -0
- package/dist/libraries/primeng/18/migrate-primeng-config.d.ts.map +1 -1
- package/dist/libraries/primeng/18/migrate-primeng-config.js +0 -59
- package/dist/libraries/primeng/18/migrate-primeng-config.js.map +1 -1
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.js +0 -65
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.js.map +1 -1
- package/dist/libraries/primeng/18/rename-dropdown-to-select.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-dropdown-to-select.js +0 -65
- package/dist/libraries/primeng/18/rename-dropdown-to-select.js.map +1 -1
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.js +0 -65
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.js.map +1 -1
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.js +0 -65
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.js.map +1 -1
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.js +0 -65
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.js.map +1 -1
- package/dist/migration/rename-after-render.d.ts +2 -2
- package/dist/migration/rename-after-render.d.ts.map +1 -1
- package/dist/migration/rename-after-render.js +9 -25
- package/dist/migration/rename-after-render.js.map +1 -1
- package/dist/migration/rename-check-no-changes.d.ts +2 -2
- package/dist/migration/rename-check-no-changes.d.ts.map +1 -1
- package/dist/migration/rename-check-no-changes.js +23 -19
- package/dist/migration/rename-check-no-changes.js.map +1 -1
- package/dist/migration/rename-pending-tasks.d.ts +2 -2
- package/dist/migration/rename-pending-tasks.d.ts.map +1 -1
- package/dist/migration/rename-pending-tasks.js +9 -22
- package/dist/migration/rename-pending-tasks.js.map +1 -1
- package/dist/migration/rename-zoneless-provider.d.ts +2 -2
- package/dist/migration/rename-zoneless-provider.d.ts.map +1 -1
- package/dist/migration/rename-zoneless-provider.js +9 -21
- package/dist/migration/rename-zoneless-provider.js.map +1 -1
- package/dist/migration/upgrade-angular-dependencies.d.ts +2 -0
- package/dist/migration/upgrade-angular-dependencies.d.ts.map +1 -1
- package/dist/migration/upgrade-angular-dependencies.js +6 -0
- package/dist/migration/upgrade-angular-dependencies.js.map +1 -1
- package/dist/migration/upgrade-to-angular-10.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-10.js +5 -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 +10 -1
- 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 +5 -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 +5 -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 +5 -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 +5 -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 +2 -1
- 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 +5 -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 +5 -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 +5 -1
- 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 +5 -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 +2 -1
- package/dist/migration/upgrade-to-angular-21.js.map +1 -1
- package/dist/migration/upgrade-to-angular-22.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-22.js +2 -1
- package/dist/migration/upgrade-to-angular-22.js.map +1 -1
- package/dist/migration/upgrade-to-angular-8.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-8.js +6 -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 +5 -1
- package/dist/migration/upgrade-to-angular-9.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +189 -0
- package/src/libraries/components/lst.ts +13 -2
- package/src/libraries/components/style-sources.ts +80 -0
- package/src/libraries/components/stylesheets.ts +37 -0
- package/src/libraries/components/symbols.ts +95 -10
- package/src/libraries/components/template-elements.ts +113 -0
- package/src/libraries/components/templates.ts +18 -4
- package/src/libraries/material/add-system-variables-prefix.ts +71 -0
- package/src/libraries/material/add-theme-base-mixins.ts +159 -0
- package/src/libraries/material/find-chip-input-event-without-chip-input.ts +63 -0
- package/src/libraries/material/find-legacy-material-usage.ts +73 -0
- package/src/libraries/material/find-material-constructor-changes.ts +231 -0
- package/src/libraries/material/find-mdc-breaking-changes.ts +273 -0
- package/src/libraries/material/find-mixin-error-state-without-state-changes.ts +89 -0
- package/src/libraries/material/find-raw-palette-themes.ts +100 -0
- package/src/libraries/material/find-removed-material-apis.ts +54 -0
- package/src/libraries/material/find-removed-material-classes.ts +127 -0
- package/src/libraries/material/find-removed-material-members.ts +146 -0
- package/src/libraries/material/find-slide-toggle-drag-options.ts +69 -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 +142 -0
- package/src/libraries/material/migrate-legacy-material.ts +202 -0
- package/src/libraries/material/migrate-list-item-harness-content-loader.ts +39 -0
- package/src/libraries/material/migrate-m2-theming-api.ts +98 -0
- package/src/libraries/material/migrate-mat-core-to-elevation-classes.ts +32 -0
- package/src/libraries/material/migrate-material-15-typography.ts +153 -0
- package/src/libraries/material/migrate-material-secondary-entry-points.ts +154 -0
- package/src/libraries/material/migrate-material-theming-api.ts +189 -0
- package/src/libraries/material/migrate-mdc-styles.ts +117 -0
- package/src/libraries/material/migrate-mdc-templates.ts +269 -0
- package/src/libraries/material/migrate-selection-list-change-option.ts +28 -0
- package/src/libraries/material/remove-mat-stepper-document-argument.ts +44 -0
- package/src/libraries/material/remove-update-active-link-argument.ts +33 -0
- package/src/libraries/material/rename-material-members.ts +109 -0
- package/src/libraries/material/rename-material-style-names.ts +116 -0
- package/src/libraries/material/rename-textarea-autosize-attributes.ts +27 -0
- package/src/libraries/material/upgrade-to-material.ts +286 -0
- package/src/libraries/primeng/18/migrate-primeng-config.ts +2 -43
- package/src/libraries/primeng/18/rename-calendar-to-datepicker.ts +2 -50
- package/src/libraries/primeng/18/rename-dropdown-to-select.ts +2 -50
- package/src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts +2 -50
- package/src/libraries/primeng/18/rename-overlaypanel-to-popover.ts +2 -50
- package/src/libraries/primeng/18/rename-sidebar-to-drawer.ts +2 -50
- package/src/migration/rename-after-render.ts +11 -24
- package/src/migration/rename-check-no-changes.ts +21 -18
- package/src/migration/rename-pending-tasks.ts +11 -22
- package/src/migration/rename-zoneless-provider.ts +11 -21
- package/src/migration/upgrade-angular-dependencies.ts +6 -0
- package/src/migration/upgrade-to-angular-10.ts +6 -2
- package/src/migration/upgrade-to-angular-11.ts +11 -2
- package/src/migration/upgrade-to-angular-12.ts +6 -2
- package/src/migration/upgrade-to-angular-13.ts +6 -2
- package/src/migration/upgrade-to-angular-14.ts +6 -2
- package/src/migration/upgrade-to-angular-15.ts +6 -2
- package/src/migration/upgrade-to-angular-16.ts +3 -2
- package/src/migration/upgrade-to-angular-17.ts +6 -2
- package/src/migration/upgrade-to-angular-18.ts +6 -2
- package/src/migration/upgrade-to-angular-19.ts +6 -2
- package/src/migration/upgrade-to-angular-20.ts +6 -2
- package/src/migration/upgrade-to-angular-21.ts +3 -2
- package/src/migration/upgrade-to-angular-22.ts +3 -2
- package/src/migration/upgrade-to-angular-8.ts +6 -1
- package/src/migration/upgrade-to-angular-9.ts +6 -2
|
@@ -0,0 +1,286 @@
|
|
|
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 {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {renameSymbols} from "../components/symbols";
|
|
9
|
+
import {MigrateMaterialSecondaryEntryPoints} from "./migrate-material-secondary-entry-points";
|
|
10
|
+
import {RenameMaterial11Members, RenameMaterial13Members, RenameMaterial9Members} from "./rename-material-members";
|
|
11
|
+
import {RenameTextareaAutosizeAttributes} from "./rename-textarea-autosize-attributes";
|
|
12
|
+
import {RemoveUpdateActiveLinkArgument} from "./remove-update-active-link-argument";
|
|
13
|
+
import {FindRemovedMaterial10Apis, FindRemovedMaterial11Apis, FindRemovedMaterial13Apis} from "./find-removed-material-apis";
|
|
14
|
+
import {FindSlideToggleDragOptions} from "./find-slide-toggle-drag-options";
|
|
15
|
+
import {FindMdcTemplateChanges, FindRemovedMaterial15Apis, FindRemovedMaterial15Members} from "./find-mdc-breaking-changes";
|
|
16
|
+
import {RenameLegacyPrebuiltThemes, RenameListItemAvatarClass, RenameMaterial18Tokens, RenameMaterial20Tokens} from "./rename-material-style-names";
|
|
17
|
+
import {FindLegacyRawPaletteThemes, FindRawPaletteThemes} from "./find-raw-palette-themes";
|
|
18
|
+
import {AddThemeBaseMixins} from "./add-theme-base-mixins";
|
|
19
|
+
import {FindLegacyMaterialUsage} from "./find-legacy-material-usage";
|
|
20
|
+
import {MigrateM2ThemingApi} from "./migrate-m2-theming-api";
|
|
21
|
+
import {AddSystemVariablesPrefix} from "./add-system-variables-prefix";
|
|
22
|
+
import {MigrateMatCoreToElevationClasses} from "./migrate-mat-core-to-elevation-classes";
|
|
23
|
+
import {MigrateMaterialThemingApi} from "./migrate-material-theming-api";
|
|
24
|
+
import {
|
|
25
|
+
FindRemovedMaterial10Members,
|
|
26
|
+
FindRemovedMaterial11Members,
|
|
27
|
+
FindRemovedMaterial13Members,
|
|
28
|
+
FindRemovedMaterial14Members
|
|
29
|
+
} from "./find-removed-material-members";
|
|
30
|
+
import {FindRemovedMaterialClasses} from "./find-removed-material-classes";
|
|
31
|
+
import {MigrateMaterial15Typography} from "./migrate-material-15-typography";
|
|
32
|
+
import {MigrateMdcTemplates} from "./migrate-mdc-templates";
|
|
33
|
+
import {MigrateMdcStyles} from "./migrate-mdc-styles";
|
|
34
|
+
import {
|
|
35
|
+
FindLegacyMaterialClasses,
|
|
36
|
+
FindLegacyMaterialMembers,
|
|
37
|
+
FindLegacyMdcTemplateChanges,
|
|
38
|
+
MigrateLegacyMaterialImports,
|
|
39
|
+
MigrateLegacyMaterialStyles,
|
|
40
|
+
MigrateLegacyMaterialTemplates
|
|
41
|
+
} from "./migrate-legacy-material";
|
|
42
|
+
import {FindChipInputEventWithoutChipInput} from "./find-chip-input-event-without-chip-input";
|
|
43
|
+
import {FindMixinErrorStateWithoutStateChanges} from "./find-mixin-error-state-without-state-changes";
|
|
44
|
+
import {MigrateListItemHarnessContentLoader} from "./migrate-list-item-harness-content-loader";
|
|
45
|
+
import {MigrateSelectionListChangeOption} from "./migrate-selection-list-change-option";
|
|
46
|
+
import {RemoveMatStepperDocumentArgument} from "./remove-mat-stepper-document-argument";
|
|
47
|
+
import {
|
|
48
|
+
FindMaterial10ConstructorChanges,
|
|
49
|
+
FindMaterial11ConstructorChanges,
|
|
50
|
+
FindMaterial12ConstructorChanges,
|
|
51
|
+
FindMaterial13ConstructorChanges,
|
|
52
|
+
FindMaterial14ConstructorChanges,
|
|
53
|
+
FindMaterial15ConstructorChanges,
|
|
54
|
+
FindMaterial8ConstructorChanges,
|
|
55
|
+
FindMaterial9ConstructorChanges
|
|
56
|
+
} from "./find-material-constructor-changes";
|
|
57
|
+
|
|
58
|
+
// The `@angular/material` version bump is part of `UpgradeToAngularN`, which runs these composites as well.
|
|
59
|
+
|
|
60
|
+
export class UpgradeToMaterial8CodeChanges extends Recipe {
|
|
61
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial8CodeChanges";
|
|
62
|
+
readonly displayName = "Angular Material 8 code changes";
|
|
63
|
+
readonly description = "The `@angular/material` source changes of the version 8 migration: moves imports from the " +
|
|
64
|
+
"deprecated `@angular/material` entry point to the secondary entry points, and finds constructor calls that " +
|
|
65
|
+
"no longer fit the changed constructors. `UpgradeToAngular8` includes this recipe.";
|
|
66
|
+
|
|
67
|
+
async recipeList(): Promise<Recipe[]> {
|
|
68
|
+
return [
|
|
69
|
+
new MigrateMaterialSecondaryEntryPoints(),
|
|
70
|
+
new FindMaterial8ConstructorChanges(),
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class UpgradeToMaterial9CodeChanges extends Recipe {
|
|
76
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial9CodeChanges";
|
|
77
|
+
readonly displayName = "Angular Material 9 code changes";
|
|
78
|
+
readonly description = "The `@angular/material` source changes of the version 9 migration: renames the removed " +
|
|
79
|
+
"`afterOpen` and `beforeClose` dialog members, and finds constructor calls that no longer fit the changed " +
|
|
80
|
+
"constructors. `UpgradeToAngular9` includes this recipe.";
|
|
81
|
+
|
|
82
|
+
async recipeList(): Promise<Recipe[]> {
|
|
83
|
+
return [
|
|
84
|
+
new RenameMaterial9Members(),
|
|
85
|
+
new FindMaterial9ConstructorChanges(),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export class UpgradeToMaterial10CodeChanges extends Recipe {
|
|
91
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial10CodeChanges";
|
|
92
|
+
readonly displayName = "Angular Material 10 code changes";
|
|
93
|
+
readonly description = "The `@angular/material` source changes of the version 10 migration: renames " +
|
|
94
|
+
"`MatButtonToggleGroupMultiple` to `MatButtonToggleGroup`, and finds the removed HammerJS gesture APIs, the " +
|
|
95
|
+
"removed slide toggle drag options and events, and constructor calls that no longer fit the changed " +
|
|
96
|
+
"constructors. `UpgradeToAngular10` includes this recipe.";
|
|
97
|
+
|
|
98
|
+
async recipeList(): Promise<Recipe[]> {
|
|
99
|
+
return [
|
|
100
|
+
...renameSymbols([
|
|
101
|
+
{module: '@angular/material/button-toggle', name: 'MatButtonToggleGroupMultiple', newName: 'MatButtonToggleGroup'},
|
|
102
|
+
]),
|
|
103
|
+
new FindRemovedMaterial10Apis(),
|
|
104
|
+
new FindSlideToggleDragOptions(),
|
|
105
|
+
new FindRemovedMaterial10Members(),
|
|
106
|
+
new FindMaterial10ConstructorChanges(),
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class UpgradeToMaterial11CodeChanges extends Recipe {
|
|
112
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial11CodeChanges";
|
|
113
|
+
readonly displayName = "Angular Material 11 code changes";
|
|
114
|
+
readonly description = "The `@angular/material` source changes of the version 11 migration: renames " +
|
|
115
|
+
"`MatDatepickerInput.getPopupConnectionElementRef` to `getConnectedOverlayOrigin`, removes the argument of " +
|
|
116
|
+
"`MatTabNav.updateActiveLink`, and finds the removed month constants and `MAT_CHECKBOX_CLICK_ACTION`, calls of " +
|
|
117
|
+
"`MatSnackBarHarness.getRole`, and constructor calls that no longer fit the changed constructors. " +
|
|
118
|
+
"`UpgradeToAngular11` includes this recipe.";
|
|
119
|
+
|
|
120
|
+
async recipeList(): Promise<Recipe[]> {
|
|
121
|
+
return [
|
|
122
|
+
new RenameMaterial11Members(),
|
|
123
|
+
new RemoveUpdateActiveLinkArgument(),
|
|
124
|
+
new FindRemovedMaterial11Apis(),
|
|
125
|
+
new FindRemovedMaterial11Members(),
|
|
126
|
+
new FindMaterial11ConstructorChanges(),
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export class UpgradeToMaterial12CodeChanges extends Recipe {
|
|
132
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial12CodeChanges";
|
|
133
|
+
readonly displayName = "Angular Material 12 code changes";
|
|
134
|
+
readonly description = "The `@angular/material` source changes of the version 12 migration: moves stylesheets from " +
|
|
135
|
+
"`@import` of `@angular/material/theming` to the `@use '@angular/material'` theming API, and finds constructor " +
|
|
136
|
+
"calls that no longer fit the changed constructors. `UpgradeToAngular12` includes this recipe.";
|
|
137
|
+
|
|
138
|
+
async recipeList(): Promise<Recipe[]> {
|
|
139
|
+
return [
|
|
140
|
+
new MigrateMaterialThemingApi(),
|
|
141
|
+
new FindMaterial12ConstructorChanges(),
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export class UpgradeToMaterial13CodeChanges extends Recipe {
|
|
147
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial13CodeChanges";
|
|
148
|
+
readonly displayName = "Angular Material 13 code changes";
|
|
149
|
+
readonly description = "The `@angular/material` source changes of the version 13 migration: replaces the removed " +
|
|
150
|
+
"`MatTextareaAutosize` with `CdkTextareaAutosize` in code and templates, and finds the removed mixin constructor " +
|
|
151
|
+
"types, `MatFormField.underlineRef`, the removed form field and tab harness loaders, and constructor calls that " +
|
|
152
|
+
"no longer fit the changed constructors. `UpgradeToAngular13` includes this recipe.";
|
|
153
|
+
|
|
154
|
+
async recipeList(): Promise<Recipe[]> {
|
|
155
|
+
return [
|
|
156
|
+
new RenameMaterial13Members(),
|
|
157
|
+
...renameSymbols([
|
|
158
|
+
{module: '@angular/material/input', name: 'MatTextareaAutosize', newName: 'CdkTextareaAutosize', newModule: '@angular/cdk/text-field'},
|
|
159
|
+
]),
|
|
160
|
+
new RenameTextareaAutosizeAttributes(),
|
|
161
|
+
new FindRemovedMaterial13Apis(),
|
|
162
|
+
new FindRemovedMaterial13Members(),
|
|
163
|
+
new FindMaterial13ConstructorChanges(),
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export class UpgradeToMaterial14CodeChanges extends Recipe {
|
|
169
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial14CodeChanges";
|
|
170
|
+
readonly displayName = "Angular Material 14 code changes";
|
|
171
|
+
readonly description = "The `@angular/material` source changes of the version 14 migration: replaces " +
|
|
172
|
+
"`MatVerticalStepper` and `MatHorizontalStepper` with `MatStepper` and drops its `_document` argument, replaces " +
|
|
173
|
+
"`MatSelectionListChange.option` and the `getHarnessLoaderForContent` of list item harnesses, renames the " +
|
|
174
|
+
"`mat-list-item-avatar` class, and finds chip input " +
|
|
175
|
+
"events without `chipInput`, `mixinErrorState` classes without `stateChanges`, `MatSelectionList.tabIndex`, and " +
|
|
176
|
+
"constructor calls that no longer fit the changed constructors. `UpgradeToAngular14` includes this recipe.";
|
|
177
|
+
|
|
178
|
+
async recipeList(): Promise<Recipe[]> {
|
|
179
|
+
return [
|
|
180
|
+
...renameSymbols([
|
|
181
|
+
{module: '@angular/material/stepper', name: 'MatVerticalStepper', newName: 'MatStepper'},
|
|
182
|
+
{module: '@angular/material/stepper', name: 'MatHorizontalStepper', newName: 'MatStepper'},
|
|
183
|
+
]),
|
|
184
|
+
new RemoveMatStepperDocumentArgument(),
|
|
185
|
+
new RenameListItemAvatarClass(),
|
|
186
|
+
new MigrateSelectionListChangeOption(),
|
|
187
|
+
new MigrateListItemHarnessContentLoader(),
|
|
188
|
+
new FindChipInputEventWithoutChipInput(),
|
|
189
|
+
new FindMixinErrorStateWithoutStateChanges(),
|
|
190
|
+
new FindRemovedMaterial14Members(),
|
|
191
|
+
new FindMaterial14ConstructorChanges(),
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export class UpgradeToMaterial15CodeChanges extends Recipe {
|
|
197
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial15CodeChanges";
|
|
198
|
+
readonly displayName = "Angular Material 15 code changes";
|
|
199
|
+
readonly description = "The `@angular/material` source changes of the version 15 migration. Imports stay on the " +
|
|
200
|
+
"MDC-based components rather than the deprecated `legacy-*` entry points that Material 17 removed. Templates " +
|
|
201
|
+
"and styles move to those components as the `mdc-migration` schematic does: chips, slider, form field " +
|
|
202
|
+
"appearances, typography classes, renamed class selectors and the themes the components rely on. It finds " +
|
|
203
|
+
"the rest: list directives, the tab nav bar panel, form field labels, removed exports and members, custom " +
|
|
204
|
+
"snack bar content, themes built from palette maps without `define-palette`, and constructor calls that no " +
|
|
205
|
+
"longer fit. `UpgradeToAngular15` includes this recipe.";
|
|
206
|
+
|
|
207
|
+
async recipeList(): Promise<Recipe[]> {
|
|
208
|
+
return [
|
|
209
|
+
new FindRemovedMaterial15Apis(),
|
|
210
|
+
new MigrateMaterial15Typography(),
|
|
211
|
+
new MigrateMdcTemplates(),
|
|
212
|
+
new MigrateMdcStyles(),
|
|
213
|
+
new FindRemovedMaterial15Members(),
|
|
214
|
+
new FindMdcTemplateChanges(),
|
|
215
|
+
new FindRemovedMaterialClasses(),
|
|
216
|
+
new FindRawPaletteThemes(),
|
|
217
|
+
new FindMaterial15ConstructorChanges(),
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export class UpgradeToMaterial17CodeChanges extends Recipe {
|
|
223
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial17CodeChanges";
|
|
224
|
+
readonly displayName = "Angular Material 17 code changes";
|
|
225
|
+
readonly description = "The `@angular/material` source changes of the version 17 migration. Projects that still " +
|
|
226
|
+
"use the `legacy-*` components that Material 17 removed move to the MDC-based components, as the Material 15 " +
|
|
227
|
+
"`mdc-migration` schematic does: imports, templates, styles and prebuilt themes, with the remaining API changes " +
|
|
228
|
+
"marked. Then adds the theme base mixins that the color, typography and density mixins stopped including, and " +
|
|
229
|
+
"finds the legacy component uses left. `UpgradeToAngular17` includes this recipe.";
|
|
230
|
+
|
|
231
|
+
async recipeList(): Promise<Recipe[]> {
|
|
232
|
+
return [
|
|
233
|
+
new MigrateLegacyMaterialImports(),
|
|
234
|
+
new MigrateLegacyMaterialTemplates(),
|
|
235
|
+
new MigrateLegacyMaterialStyles(),
|
|
236
|
+
new RenameLegacyPrebuiltThemes(),
|
|
237
|
+
new AddThemeBaseMixins(),
|
|
238
|
+
new FindLegacyMaterialMembers(),
|
|
239
|
+
new FindLegacyMdcTemplateChanges(),
|
|
240
|
+
new FindLegacyMaterialClasses(),
|
|
241
|
+
new FindLegacyRawPaletteThemes(),
|
|
242
|
+
new FindLegacyMaterialUsage(),
|
|
243
|
+
];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export class UpgradeToMaterial18CodeChanges extends Recipe {
|
|
248
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial18CodeChanges";
|
|
249
|
+
readonly displayName = "Angular Material 18 code changes";
|
|
250
|
+
readonly description = "The `@angular/material` source changes of the version 18 migration: renames the M2 theming " +
|
|
251
|
+
"API to its `m2-` names, moves the M3 API out of `@angular/material-experimental`, and renames the checkbox " +
|
|
252
|
+
"label tokens. `UpgradeToAngular18` includes this recipe.";
|
|
253
|
+
|
|
254
|
+
async recipeList(): Promise<Recipe[]> {
|
|
255
|
+
return [
|
|
256
|
+
new MigrateM2ThemingApi(),
|
|
257
|
+
new RenameMaterial18Tokens(),
|
|
258
|
+
];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export class UpgradeToMaterial19CodeChanges extends Recipe {
|
|
263
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial19CodeChanges";
|
|
264
|
+
readonly displayName = "Angular Material 19 code changes";
|
|
265
|
+
readonly description = "The `@angular/material` source changes of the version 19 migration: replaces the deprecated " +
|
|
266
|
+
"`mat.core()` with `mat.elevation-classes()` and `mat.app-background()`, and sets the prefix of system " +
|
|
267
|
+
"variables explicitly. `UpgradeToAngular19` includes this recipe.";
|
|
268
|
+
|
|
269
|
+
async recipeList(): Promise<Recipe[]> {
|
|
270
|
+
return [
|
|
271
|
+
new MigrateMatCoreToElevationClasses(),
|
|
272
|
+
new AddSystemVariablesPrefix(),
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export class UpgradeToMaterial20CodeChanges extends Recipe {
|
|
278
|
+
readonly name = "org.openrewrite.angular.material.UpgradeToMaterial20CodeChanges";
|
|
279
|
+
readonly displayName = "Angular Material 20 code changes";
|
|
280
|
+
readonly description = "The `@angular/material` source changes of the version 20 migration: renames the `--mdc-` " +
|
|
281
|
+
"CSS tokens to `--mat-` and the renamed component token prefixes. `UpgradeToAngular20` includes this recipe.";
|
|
282
|
+
|
|
283
|
+
async recipeList(): Promise<Recipe[]> {
|
|
284
|
+
return [new RenameMaterial20Tokens()];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -4,52 +4,12 @@
|
|
|
4
4
|
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {ExecutionContext, foundSearchResult,
|
|
8
|
-
import {ChangeImport, JavaScriptVisitor
|
|
7
|
+
import {ExecutionContext, foundSearchResult, Recipe, TreeVisitor} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport, JavaScriptVisitor} from "@openrewrite/rewrite/javascript";
|
|
9
9
|
import {J, isIdentifier} from "@openrewrite/rewrite/java";
|
|
10
10
|
|
|
11
11
|
const CONFIG_NAMES = new Set(['PrimeNGConfig', 'PrimeNG']);
|
|
12
12
|
|
|
13
|
-
class RenamePrimeNGConfigIdentifiers extends Recipe {
|
|
14
|
-
readonly name = "org.openrewrite.primeng.MigratePrimeNgConfigToPrimeNG.identifiers";
|
|
15
|
-
readonly displayName = "Rename `PrimeNGConfig` identifiers to `PrimeNG`";
|
|
16
|
-
readonly description = "Renames `PrimeNGConfig` identifier usages in files importing it from `primeng/api`.";
|
|
17
|
-
|
|
18
|
-
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
19
|
-
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
20
|
-
private hasImport = false;
|
|
21
|
-
|
|
22
|
-
protected async visitImportDeclaration(jsImport: JS.Import, p: ExecutionContext): Promise<J | undefined> {
|
|
23
|
-
const imp = await super.visitImportDeclaration(jsImport, p) as JS.Import;
|
|
24
|
-
if (!imp?.moduleSpecifier) return imp;
|
|
25
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
26
|
-
if (moduleSpec.kind !== J.Kind.Literal) return imp;
|
|
27
|
-
if ((moduleSpec as J.Literal).value !== "primeng/api") return imp;
|
|
28
|
-
|
|
29
|
-
const namedBindings = imp.importClause?.namedBindings;
|
|
30
|
-
if (namedBindings?.kind === JS.Kind.NamedImports) {
|
|
31
|
-
for (const specifier of (namedBindings as JS.NamedImports).elements.elements) {
|
|
32
|
-
const spec = specifier.element as JS.ImportSpecifier;
|
|
33
|
-
if (isIdentifier(spec.specifier) && (spec.specifier as J.Identifier).simpleName === 'PrimeNGConfig') {
|
|
34
|
-
this.hasImport = true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return imp;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
override async visitIdentifier(identifier: J.Identifier, p: ExecutionContext): Promise<J | undefined> {
|
|
42
|
-
const id = await super.visitIdentifier(identifier, p) as J.Identifier;
|
|
43
|
-
if (!id) return id;
|
|
44
|
-
if (this.hasImport && id.simpleName === 'PrimeNGConfig') {
|
|
45
|
-
return produceAsync(id, async draft => { draft.simpleName = 'PrimeNG'; });
|
|
46
|
-
}
|
|
47
|
-
return id;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
13
|
class FindPrimeNGConfigInjection extends Recipe {
|
|
54
14
|
readonly name = "org.openrewrite.primeng.MigratePrimeNgConfigToPrimeNG.find-injection";
|
|
55
15
|
readonly displayName = "Find `PrimeNGConfig` / `PrimeNG` service injection";
|
|
@@ -99,7 +59,6 @@ export class MigratePrimeNgConfigToPrimeNG extends Recipe {
|
|
|
99
59
|
|
|
100
60
|
async recipeList(): Promise<Recipe[]> {
|
|
101
61
|
return [
|
|
102
|
-
new RenamePrimeNGConfigIdentifiers(),
|
|
103
62
|
new ChangeImport({
|
|
104
63
|
oldModule: "primeng/api",
|
|
105
64
|
oldMember: "PrimeNGConfig",
|
|
@@ -4,55 +4,8 @@
|
|
|
4
4
|
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {ChangeImport
|
|
9
|
-
import {J, isIdentifier} from "@openrewrite/rewrite/java";
|
|
10
|
-
|
|
11
|
-
const RENAMES: Record<string, string> = {
|
|
12
|
-
Calendar: "DatePicker",
|
|
13
|
-
CalendarModule: "DatePickerModule",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
class RenameCalendarIdentifiers extends Recipe {
|
|
17
|
-
readonly name = "org.openrewrite.primeng.RenameCalendarToDatePicker.identifiers";
|
|
18
|
-
readonly displayName = "Rename `Calendar` identifiers to `DatePicker`";
|
|
19
|
-
readonly description = "Renames `Calendar` and `CalendarModule` identifier usages in files importing them from `primeng/calendar`.";
|
|
20
|
-
|
|
21
|
-
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
22
|
-
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
23
|
-
private importedNames = new Set<string>();
|
|
24
|
-
|
|
25
|
-
protected async visitImportDeclaration(jsImport: JS.Import, p: ExecutionContext): Promise<J | undefined> {
|
|
26
|
-
const imp = await super.visitImportDeclaration(jsImport, p) as JS.Import;
|
|
27
|
-
if (!imp?.moduleSpecifier) return imp;
|
|
28
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
29
|
-
if (moduleSpec.kind !== J.Kind.Literal) return imp;
|
|
30
|
-
if ((moduleSpec as J.Literal).value !== "primeng/calendar") return imp;
|
|
31
|
-
|
|
32
|
-
const namedBindings = imp.importClause?.namedBindings;
|
|
33
|
-
if (namedBindings?.kind === JS.Kind.NamedImports) {
|
|
34
|
-
for (const specifier of (namedBindings as JS.NamedImports).elements.elements) {
|
|
35
|
-
const spec = specifier.element as JS.ImportSpecifier;
|
|
36
|
-
if (isIdentifier(spec.specifier) && RENAMES[(spec.specifier as J.Identifier).simpleName]) {
|
|
37
|
-
this.importedNames.add((spec.specifier as J.Identifier).simpleName);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return imp;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override async visitIdentifier(identifier: J.Identifier, p: ExecutionContext): Promise<J | undefined> {
|
|
45
|
-
const id = await super.visitIdentifier(identifier, p) as J.Identifier;
|
|
46
|
-
if (!id) return id;
|
|
47
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
48
|
-
const newName = RENAMES[id.simpleName];
|
|
49
|
-
return produceAsync(id, async draft => { draft.simpleName = newName; });
|
|
50
|
-
}
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
7
|
+
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport} from "@openrewrite/rewrite/javascript";
|
|
56
9
|
|
|
57
10
|
export class RenameCalendarToDatePicker extends Recipe {
|
|
58
11
|
readonly name = "org.openrewrite.primeng.RenameCalendarToDatePicker";
|
|
@@ -63,7 +16,6 @@ export class RenameCalendarToDatePicker extends Recipe {
|
|
|
63
16
|
|
|
64
17
|
async recipeList(): Promise<Recipe[]> {
|
|
65
18
|
return [
|
|
66
|
-
new RenameCalendarIdentifiers(),
|
|
67
19
|
new ChangeImport({
|
|
68
20
|
oldModule: "primeng/calendar",
|
|
69
21
|
oldMember: "CalendarModule",
|
|
@@ -4,55 +4,8 @@
|
|
|
4
4
|
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {ChangeImport
|
|
9
|
-
import {J, isIdentifier} from "@openrewrite/rewrite/java";
|
|
10
|
-
|
|
11
|
-
const RENAMES: Record<string, string> = {
|
|
12
|
-
Dropdown: "Select",
|
|
13
|
-
DropdownModule: "SelectModule",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
class RenameDropdownIdentifiers extends Recipe {
|
|
17
|
-
readonly name = "org.openrewrite.primeng.RenameDropdownToSelect.identifiers";
|
|
18
|
-
readonly displayName = "Rename `Dropdown` identifiers to `Select`";
|
|
19
|
-
readonly description = "Renames `Dropdown` and `DropdownModule` identifier usages in files importing them from `primeng/dropdown`.";
|
|
20
|
-
|
|
21
|
-
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
22
|
-
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
23
|
-
private importedNames = new Set<string>();
|
|
24
|
-
|
|
25
|
-
protected async visitImportDeclaration(jsImport: JS.Import, p: ExecutionContext): Promise<J | undefined> {
|
|
26
|
-
const imp = await super.visitImportDeclaration(jsImport, p) as JS.Import;
|
|
27
|
-
if (!imp?.moduleSpecifier) return imp;
|
|
28
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
29
|
-
if (moduleSpec.kind !== J.Kind.Literal) return imp;
|
|
30
|
-
if ((moduleSpec as J.Literal).value !== "primeng/dropdown") return imp;
|
|
31
|
-
|
|
32
|
-
const namedBindings = imp.importClause?.namedBindings;
|
|
33
|
-
if (namedBindings?.kind === JS.Kind.NamedImports) {
|
|
34
|
-
for (const specifier of (namedBindings as JS.NamedImports).elements.elements) {
|
|
35
|
-
const spec = specifier.element as JS.ImportSpecifier;
|
|
36
|
-
if (isIdentifier(spec.specifier) && RENAMES[(spec.specifier as J.Identifier).simpleName]) {
|
|
37
|
-
this.importedNames.add((spec.specifier as J.Identifier).simpleName);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return imp;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override async visitIdentifier(identifier: J.Identifier, p: ExecutionContext): Promise<J | undefined> {
|
|
45
|
-
const id = await super.visitIdentifier(identifier, p) as J.Identifier;
|
|
46
|
-
if (!id) return id;
|
|
47
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
48
|
-
const newName = RENAMES[id.simpleName];
|
|
49
|
-
return produceAsync(id, async draft => { draft.simpleName = newName; });
|
|
50
|
-
}
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
7
|
+
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport} from "@openrewrite/rewrite/javascript";
|
|
56
9
|
|
|
57
10
|
export class RenameDropdownToSelect extends Recipe {
|
|
58
11
|
readonly name = "org.openrewrite.primeng.RenameDropdownToSelect";
|
|
@@ -63,7 +16,6 @@ export class RenameDropdownToSelect extends Recipe {
|
|
|
63
16
|
|
|
64
17
|
async recipeList(): Promise<Recipe[]> {
|
|
65
18
|
return [
|
|
66
|
-
new RenameDropdownIdentifiers(),
|
|
67
19
|
new ChangeImport({
|
|
68
20
|
oldModule: "primeng/dropdown",
|
|
69
21
|
oldMember: "DropdownModule",
|
|
@@ -4,55 +4,8 @@
|
|
|
4
4
|
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {ChangeImport
|
|
9
|
-
import {J, isIdentifier} from "@openrewrite/rewrite/java";
|
|
10
|
-
|
|
11
|
-
const RENAMES: Record<string, string> = {
|
|
12
|
-
InputSwitch: "ToggleSwitch",
|
|
13
|
-
InputSwitchModule: "ToggleSwitchModule",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
class RenameInputSwitchIdentifiers extends Recipe {
|
|
17
|
-
readonly name = "org.openrewrite.primeng.RenameInputSwitchToToggleSwitch.identifiers";
|
|
18
|
-
readonly displayName = "Rename `InputSwitch` identifiers to `ToggleSwitch`";
|
|
19
|
-
readonly description = "Renames `InputSwitch` and `InputSwitchModule` identifier usages in files importing them from `primeng/inputswitch`.";
|
|
20
|
-
|
|
21
|
-
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
22
|
-
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
23
|
-
private importedNames = new Set<string>();
|
|
24
|
-
|
|
25
|
-
protected async visitImportDeclaration(jsImport: JS.Import, p: ExecutionContext): Promise<J | undefined> {
|
|
26
|
-
const imp = await super.visitImportDeclaration(jsImport, p) as JS.Import;
|
|
27
|
-
if (!imp?.moduleSpecifier) return imp;
|
|
28
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
29
|
-
if (moduleSpec.kind !== J.Kind.Literal) return imp;
|
|
30
|
-
if ((moduleSpec as J.Literal).value !== "primeng/inputswitch") return imp;
|
|
31
|
-
|
|
32
|
-
const namedBindings = imp.importClause?.namedBindings;
|
|
33
|
-
if (namedBindings?.kind === JS.Kind.NamedImports) {
|
|
34
|
-
for (const specifier of (namedBindings as JS.NamedImports).elements.elements) {
|
|
35
|
-
const spec = specifier.element as JS.ImportSpecifier;
|
|
36
|
-
if (isIdentifier(spec.specifier) && RENAMES[(spec.specifier as J.Identifier).simpleName]) {
|
|
37
|
-
this.importedNames.add((spec.specifier as J.Identifier).simpleName);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return imp;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override async visitIdentifier(identifier: J.Identifier, p: ExecutionContext): Promise<J | undefined> {
|
|
45
|
-
const id = await super.visitIdentifier(identifier, p) as J.Identifier;
|
|
46
|
-
if (!id) return id;
|
|
47
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
48
|
-
const newName = RENAMES[id.simpleName];
|
|
49
|
-
return produceAsync(id, async draft => { draft.simpleName = newName; });
|
|
50
|
-
}
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
7
|
+
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport} from "@openrewrite/rewrite/javascript";
|
|
56
9
|
|
|
57
10
|
export class RenameInputSwitchToToggleSwitch extends Recipe {
|
|
58
11
|
readonly name = "org.openrewrite.primeng.RenameInputSwitchToToggleSwitch";
|
|
@@ -63,7 +16,6 @@ export class RenameInputSwitchToToggleSwitch extends Recipe {
|
|
|
63
16
|
|
|
64
17
|
async recipeList(): Promise<Recipe[]> {
|
|
65
18
|
return [
|
|
66
|
-
new RenameInputSwitchIdentifiers(),
|
|
67
19
|
new ChangeImport({
|
|
68
20
|
oldModule: "primeng/inputswitch",
|
|
69
21
|
oldMember: "InputSwitchModule",
|
|
@@ -4,55 +4,8 @@
|
|
|
4
4
|
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {ChangeImport
|
|
9
|
-
import {J, isIdentifier} from "@openrewrite/rewrite/java";
|
|
10
|
-
|
|
11
|
-
const RENAMES: Record<string, string> = {
|
|
12
|
-
OverlayPanel: "Popover",
|
|
13
|
-
OverlayPanelModule: "PopoverModule",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
class RenameOverlayPanelIdentifiers extends Recipe {
|
|
17
|
-
readonly name = "org.openrewrite.primeng.RenameOverlayPanelToPopover.identifiers";
|
|
18
|
-
readonly displayName = "Rename `OverlayPanel` identifiers to `Popover`";
|
|
19
|
-
readonly description = "Renames `OverlayPanel` and `OverlayPanelModule` identifier usages in files importing them from `primeng/overlaypanel`.";
|
|
20
|
-
|
|
21
|
-
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
22
|
-
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
23
|
-
private importedNames = new Set<string>();
|
|
24
|
-
|
|
25
|
-
protected async visitImportDeclaration(jsImport: JS.Import, p: ExecutionContext): Promise<J | undefined> {
|
|
26
|
-
const imp = await super.visitImportDeclaration(jsImport, p) as JS.Import;
|
|
27
|
-
if (!imp?.moduleSpecifier) return imp;
|
|
28
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
29
|
-
if (moduleSpec.kind !== J.Kind.Literal) return imp;
|
|
30
|
-
if ((moduleSpec as J.Literal).value !== "primeng/overlaypanel") return imp;
|
|
31
|
-
|
|
32
|
-
const namedBindings = imp.importClause?.namedBindings;
|
|
33
|
-
if (namedBindings?.kind === JS.Kind.NamedImports) {
|
|
34
|
-
for (const specifier of (namedBindings as JS.NamedImports).elements.elements) {
|
|
35
|
-
const spec = specifier.element as JS.ImportSpecifier;
|
|
36
|
-
if (isIdentifier(spec.specifier) && RENAMES[(spec.specifier as J.Identifier).simpleName]) {
|
|
37
|
-
this.importedNames.add((spec.specifier as J.Identifier).simpleName);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return imp;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override async visitIdentifier(identifier: J.Identifier, p: ExecutionContext): Promise<J | undefined> {
|
|
45
|
-
const id = await super.visitIdentifier(identifier, p) as J.Identifier;
|
|
46
|
-
if (!id) return id;
|
|
47
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
48
|
-
const newName = RENAMES[id.simpleName];
|
|
49
|
-
return produceAsync(id, async draft => { draft.simpleName = newName; });
|
|
50
|
-
}
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
7
|
+
import {Recipe} from "@openrewrite/rewrite";
|
|
8
|
+
import {ChangeImport} from "@openrewrite/rewrite/javascript";
|
|
56
9
|
|
|
57
10
|
export class RenameOverlayPanelToPopover extends Recipe {
|
|
58
11
|
readonly name = "org.openrewrite.primeng.RenameOverlayPanelToPopover";
|
|
@@ -63,7 +16,6 @@ export class RenameOverlayPanelToPopover extends Recipe {
|
|
|
63
16
|
|
|
64
17
|
async recipeList(): Promise<Recipe[]> {
|
|
65
18
|
return [
|
|
66
|
-
new RenameOverlayPanelIdentifiers(),
|
|
67
19
|
new ChangeImport({
|
|
68
20
|
oldModule: "primeng/overlaypanel",
|
|
69
21
|
oldMember: "OverlayPanelModule",
|