-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Expand file tree
/
Copy pathindex.ts
More file actions
42 lines (37 loc) · 1.28 KB
/
index.ts
File metadata and controls
42 lines (37 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* @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.dev/license
*/
import {Rule, SchematicContext} from '@angular-devkit/schematics';
import {TargetVersion} from '../update-tool/target-version';
import {cdkUpgradeData} from './upgrade-data';
import {createMigrationSchematicRule, NullableDevkitMigration} from './devkit-migration-rule';
const cdkMigrations: NullableDevkitMigration[] = [];
/** Entry point for the migration schematics with target of Angular CDK 22.0.0 */
export function updateToV22(): Rule {
return createMigrationSchematicRule(
TargetVersion.V22,
cdkMigrations,
cdkUpgradeData,
onMigrationComplete,
);
}
/** Function that will be called when the migration completed. */
function onMigrationComplete(
context: SchematicContext,
targetVersion: TargetVersion,
hasFailures: boolean,
) {
context.logger.info('');
context.logger.info(` ✓ Updated Angular CDK to ${targetVersion}`);
context.logger.info('');
if (hasFailures) {
context.logger.warn(
' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
'output above and fix these issues manually.',
);
}
}