Skip to content

Commit

Permalink
build: update schematics for v18
Browse files Browse the repository at this point in the history
  • Loading branch information
zarend committed Mar 14, 2024
1 parent 0853cd9 commit 93a6c60
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 1,011 deletions.
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-v17": {
"version": "17.0.0-0",
"description": "Updates the Angular CDK to v17",
"factory": "./ng-update/index#updateToV17"
"migration-v18": {
"version": "18.0.0-0",
"description": "Updates the Angular CDK to v18",
"factory": "./ng-update/index#updateToV18"
},
"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 17.0.0 */
export function updateToV17(): Rule {
/** Entry point for the migration schematics with target of Angular CDK 18.0.0 */
export function updateToV18(): Rule {
return createMigrationSchematicRule(
TargetVersion.V17,
TargetVersion.V18,
cdkMigrations,
cdkUpgradeData,
onMigrationComplete,
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/ng-update/migrations/misc-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {UpgradeData} from '../upgrade-data';
* instances of outdated Angular CDK API that can't be migrated automatically.
*/
export class MiscTemplateMigration extends Migration<UpgradeData> {
// There are currently no migrations for V17 deprecations.
// There are currently no migrations for V18 deprecations.
enabled = false;

override visitTemplate(template: ResolvedResource): void {}
Expand Down
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 @@

// tslint:disable-next-line:prefer-const-enum
export enum TargetVersion {
V17 = 'version 17',
V18 = 'version 18',
}

/**
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-v17": {
"version": "17.0.0-0",
"description": "Updates Angular Material to v17",
"factory": "./ng-update/index_bundled#updateToV17"
"migration-v18": {
"version": "18.0.0-0",
"description": "Updates Angular Material to v18",
"factory": "./ng-update/index_bundled#updateToV18"
}
}
}
22 changes: 9 additions & 13 deletions src/material/schematics/ng-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,20 @@ import {
TargetVersion,
} from '@angular/cdk/schematics';

import {legacyImportsError} from './migrations/legacy-imports-error';
import {materialUpgradeData} from './upgrade-data';
import {ThemeBaseMigration} from './migrations/theme-base-v17';

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

/** Entry point for the migration schematics with target of Angular Material v17 */
export function updateToV17(): Rule {
// We pass the v17 migration rule as a callback, instead of using `chain()`, because the
/** Entry point for the migration schematics with target of Angular Material v18 */
export function updateToV18(): Rule {
// We pass the v18 migration rule as a callback, instead of using `chain()`, because the
// legacy imports error only logs an error message, it doesn't actually interrupt the migration
// process and we don't want to execute migrations if there are leftover legacy imports.
return legacyImportsError(
createMigrationSchematicRule(
TargetVersion.V17,
materialMigrations,
materialUpgradeData,
onMigrationComplete,
),
return createMigrationSchematicRule(
TargetVersion.V18,
materialMigrations,
materialUpgradeData,
onMigrationComplete,
);
}

Expand Down
104 changes: 0 additions & 104 deletions src/material/schematics/ng-update/migrations/legacy-imports-error.ts

This file was deleted.

133 changes: 0 additions & 133 deletions src/material/schematics/ng-update/migrations/theme-base-v17/index.ts

This file was deleted.

Loading

0 comments on commit 93a6c60

Please sign in to comment.