Skip to content

Commit 667285b

Browse files
authored
build: set up schematics for version 16 (#26718)
* build: set up schematics for version 16 * fixup! build: set up schematics for version 16 * fixup! build: set up schematics for version 16 * fixup! build: set up schematics for version 16 * fixup! build: set up schematics for version 16
1 parent a1162dd commit 667285b

File tree

9 files changed

+19
-927
lines changed

9 files changed

+19
-927
lines changed

src/cdk/schematics/migration.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
33
"schematics": {
4-
"migration-v15": {
5-
"version": "15.0.0-0",
6-
"description": "Updates the Angular CDK to v15",
7-
"factory": "./ng-update/index#updateToV15"
4+
"migration-v16": {
5+
"version": "16.0.0-0",
6+
"description": "Updates the Angular CDK to v16",
7+
"factory": "./ng-update/index#updateToV16"
88
},
99
"ng-post-update": {
1010
"description": "Prints out results after ng-update.",

src/cdk/schematics/ng-update/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import {createMigrationSchematicRule, NullableDevkitMigration} from './devkit-mi
1313

1414
const cdkMigrations: NullableDevkitMigration[] = [];
1515

16-
/** Entry point for the migration schematics with target of Angular CDK 15.0.0 */
17-
export function updateToV15(): Rule {
16+
/** Entry point for the migration schematics with target of Angular CDK 16.0.0 */
17+
export function updateToV16(): Rule {
1818
return createMigrationSchematicRule(
19-
TargetVersion.V15,
19+
TargetVersion.V16,
2020
cdkMigrations,
2121
cdkUpgradeData,
2222
onMigrationComplete,

src/cdk/schematics/ng-update/migrations/misc-template.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,17 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {TargetVersion} from '../../update-tool/target-version';
109
import {ResolvedResource} from '../../update-tool/component-resource-collector';
1110
import {Migration} from '../../update-tool/migration';
12-
import {findAllSubstringIndices} from '../typescript/literal';
1311
import {UpgradeData} from '../upgrade-data';
1412

1513
/**
1614
* Migration that walks through every template and reports if there are
1715
* instances of outdated Angular CDK API that can't be migrated automatically.
1816
*/
1917
export class MiscTemplateMigration extends Migration<UpgradeData> {
20-
// Only enable this rule if the migration targets version 6. The rule
21-
// currently only includes migrations for V6 deprecations.
22-
enabled = this.targetVersion !== TargetVersion.V15;
18+
// There are currently no migrations for V16 deprecations.
19+
enabled = false;
2320

24-
override visitTemplate(template: ResolvedResource): void {
25-
// Migration for https://github.com/angular/components/pull/10325 (v6)
26-
findAllSubstringIndices(template.content, 'cdk-focus-trap').forEach(offset => {
27-
this.failures.push({
28-
filePath: template.filePath,
29-
position: template.getCharacterAndLineOfPosition(template.start + offset),
30-
message:
31-
`Found deprecated element selector "cdk-focus-trap" which has been ` +
32-
`changed to an attribute selector "[cdkTrapFocus]".`,
33-
});
34-
});
35-
}
21+
override visitTemplate(template: ResolvedResource): void {}
3622
}

src/cdk/schematics/update-tool/target-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Used in an `Object.keys` call below so it can't be `const enum`.
1111
// tslint:disable-next-line:prefer-const-enum
1212
export enum TargetVersion {
13-
V15 = 'version 15',
13+
V16 = 'version 16',
1414
}
1515

1616
/**
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
33
"schematics": {
4-
"migration-v15": {
5-
"version": "15.0.0-0",
6-
"description": "Updates the Angular Material to v15",
7-
"factory": "./ng-update/index_bundled#updateToV15"
4+
"migration-v16": {
5+
"version": "16.0.0-0",
6+
"description": "Updates the Angular Material to v16",
7+
"factory": "./ng-update/index#updateToV16"
88
}
99
}
1010
}

src/material/schematics/ng-update/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ import {
1212
NullableDevkitMigration,
1313
TargetVersion,
1414
} from '@angular/cdk/schematics';
15-
import {LegacyComponentsMigration} from './migrations/legacy-components-v15';
1615

1716
import {materialUpgradeData} from './upgrade-data';
1817

19-
const materialMigrations: NullableDevkitMigration[] = [LegacyComponentsMigration];
18+
const materialMigrations: NullableDevkitMigration[] = [];
2019

21-
/** Entry point for the migration schematics with target of Angular Material v15 */
22-
export function updateToV15(): Rule {
20+
/** Entry point for the migration schematics with target of Angular Material v16 */
21+
export function updateToV16(): Rule {
2322
return createMigrationSchematicRule(
24-
TargetVersion.V15,
23+
TargetVersion.V16,
2524
materialMigrations,
2625
materialUpgradeData,
2726
onMigrationComplete,

src/material/schematics/ng-update/migrations/legacy-components-v15/constants.ts

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)