-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(material/schematics): implement basic ts import migrations (#24797)
* feat(material/schematics): implement basic ts import migrations * move runtime migration files into new ts-migration folder * move button runtime test to the ts-migration folder * define basic replacements in import-replacements.ts * use basic replacements to generically implement RuntimeMigrator for all components
- Loading branch information
1 parent
825688f
commit 1e5dc8a
Showing
7 changed files
with
140 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/material/schematics/ng-generate/mdc-migration/rules/components/button/button-runtime.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
src/material/schematics/ng-generate/mdc-migration/rules/ts-migration/import-replacements.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
export const IMPORT_REPLACEMENTS: {[component: string]: {old: string; new: string}} = { | ||
'button': { | ||
old: '@angular/material/button', | ||
new: '@angular/material-experimental/mdc-button', | ||
}, | ||
'card': { | ||
old: '@angular/material/card', | ||
new: '@angular/material-experimental/mdc-card', | ||
}, | ||
'checkbox': { | ||
old: '@angular/material/checkbox', | ||
new: '@angular/material-experimental/mdc-checkbox', | ||
}, | ||
'chips': { | ||
old: '@angular/material/chips', | ||
new: '@angular/material-experimental/mdc-chips', | ||
}, | ||
'dialog': { | ||
old: '@angular/material/dialog', | ||
new: '@angular/material-experimental/mdc-dialog', | ||
}, | ||
'autocomplete': { | ||
old: '@angular/material/autocomplete', | ||
new: '@angular/material-experimental/mdc-autocomplete', | ||
}, | ||
'form-field': { | ||
old: '@angular/material/form-field', | ||
new: '@angular/material-experimental/mdc-form-field', | ||
}, | ||
'input': { | ||
old: '@angular/material/input', | ||
new: '@angular/material-experimental/mdc-input', | ||
}, | ||
'select': { | ||
old: '@angular/material/select', | ||
new: '@angular/material-experimental/mdc-select', | ||
}, | ||
'core': { | ||
old: '@angular/material/core', | ||
new: '@angular/material-experimental/mdc-core', | ||
}, | ||
'list': { | ||
old: '@angular/material/list', | ||
new: '@angular/material-experimental/mdc-list', | ||
}, | ||
'menu': { | ||
old: '@angular/material/menu', | ||
new: '@angular/material-experimental/mdc-menu', | ||
}, | ||
'progress-bar': { | ||
old: '@angular/material/progress-bar', | ||
new: '@angular/material-experimental/mdc-progress-bar', | ||
}, | ||
'progress-spinner': { | ||
old: '@angular/material/progress-spinner', | ||
new: '@angular/material-experimental/mdc-progress-spinner', | ||
}, | ||
'radio': { | ||
old: '@angular/material/radio', | ||
new: '@angular/material-experimental/mdc-radio', | ||
}, | ||
'sidenav': { | ||
old: '@angular/material/sidenav', | ||
new: '@angular/material-experimental/mdc-sidenav', | ||
}, | ||
'slide-toggle': { | ||
old: '@angular/material/slide-toggle', | ||
new: '@angular/material-experimental/mdc-slide-toggle', | ||
}, | ||
'slider': { | ||
old: '@angular/material/slider', | ||
new: '@angular/material-experimental/mdc-slider', | ||
}, | ||
'snack-bar': { | ||
old: '@angular/material/snack-bar', | ||
new: '@angular/material-experimental/mdc-snack-bar', | ||
}, | ||
'table': { | ||
old: '@angular/material/table', | ||
new: '@angular/material-experimental/mdc-table', | ||
}, | ||
'tabs': { | ||
old: '@angular/material/tabs', | ||
new: '@angular/material-experimental/mdc-tabs', | ||
}, | ||
'paginator': { | ||
old: '@angular/material/paginator', | ||
new: '@angular/material-experimental/mdc-paginator', | ||
}, | ||
'tooltip': { | ||
old: '@angular/material/tooltip', | ||
new: '@angular/material-experimental/mdc-tooltip', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
.../components/button/button-runtime.spec.ts → ...les/ts-migration/runtime-migrator.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters