Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cdk/schematics/migration.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"migration-v15": {
"version": "15.0.0-0",
"description": "Updates the Angular CDK to v15",
"factory": "./ng-update/index#updateToV15"
"migration-v16": {
"version": "16.0.0-0",
"description": "Updates the Angular CDK to v16",
"factory": "./ng-update/index#updateToV16"
},
"ng-post-update": {
"description": "Prints out results after ng-update.",
Expand Down
6 changes: 3 additions & 3 deletions src/cdk/schematics/ng-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {createMigrationSchematicRule, NullableDevkitMigration} from './devkit-mi

const cdkMigrations: NullableDevkitMigration[] = [];

/** Entry point for the migration schematics with target of Angular CDK 15.0.0 */
export function updateToV15(): Rule {
/** Entry point for the migration schematics with target of Angular CDK 16.0.0 */
export function updateToV16(): Rule {
return createMigrationSchematicRule(
TargetVersion.V15,
TargetVersion.V16,
cdkMigrations,
cdkUpgradeData,
onMigrationComplete,
Expand Down
20 changes: 3 additions & 17 deletions src/cdk/schematics/ng-update/migrations/misc-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,17 @@
* found in the LICENSE file at https://angular.io/license
*/

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

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

override visitTemplate(template: ResolvedResource): void {
// Migration for https://github.com/angular/components/pull/10325 (v6)
findAllSubstringIndices(template.content, 'cdk-focus-trap').forEach(offset => {
this.failures.push({
filePath: template.filePath,
position: template.getCharacterAndLineOfPosition(template.start + offset),
message:
`Found deprecated element selector "cdk-focus-trap" which has been ` +
`changed to an attribute selector "[cdkTrapFocus]".`,
});
});
}
override visitTemplate(template: ResolvedResource): void {}
}
2 changes: 1 addition & 1 deletion src/cdk/schematics/update-tool/target-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Used in an `Object.keys` call below so it can't be `const enum`.
// tslint:disable-next-line:prefer-const-enum
export enum TargetVersion {
V15 = 'version 15',
V16 = 'version 16',
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/material/schematics/migration.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"migration-v15": {
"version": "15.0.0-0",
"description": "Updates the Angular Material to v15",
"factory": "./ng-update/index_bundled#updateToV15"
"migration-v16": {
"version": "16.0.0-0",
"description": "Updates the Angular Material to v16",
"factory": "./ng-update/index#updateToV16"
}
}
}
9 changes: 4 additions & 5 deletions src/material/schematics/ng-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ import {
NullableDevkitMigration,
TargetVersion,
} from '@angular/cdk/schematics';
import {LegacyComponentsMigration} from './migrations/legacy-components-v15';

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

const materialMigrations: NullableDevkitMigration[] = [LegacyComponentsMigration];
const materialMigrations: NullableDevkitMigration[] = [];

/** Entry point for the migration schematics with target of Angular Material v15 */
export function updateToV15(): Rule {
/** Entry point for the migration schematics with target of Angular Material v16 */
export function updateToV16(): Rule {
return createMigrationSchematicRule(
TargetVersion.V15,
TargetVersion.V16,
materialMigrations,
materialUpgradeData,
onMigrationComplete,
Expand Down

This file was deleted.

Loading