Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material/schematics): improve logging of mdc-migration ts migrator #26377

Merged
merged 2 commits into from Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,14 +24,24 @@ export class RuntimeCodeMigration extends Migration<ComponentMigrator[], Schemat
private _hasPossibleTemplateMigrations = true;

override visitNode(node: ts.Node): void {
if (ts.isSourceFile(node)) {
this._migrateSourceFileReferences(node);
} else if (this._isComponentDecorator(node)) {
this._migrateComponentDecorator(node as ts.Decorator);
} else if (this._isImportExpression(node)) {
this._migrateModuleSpecifier(node.arguments[0]);
} else if (this._isTypeImportExpression(node)) {
this._migrateModuleSpecifier(node.argument.literal);
try {
if (ts.isSourceFile(node)) {
this._migrateSourceFileReferences(node);
} else if (this._isComponentDecorator(node)) {
this._migrateComponentDecorator(node as ts.Decorator);
} else if (this._isImportExpression(node)) {
this._migrateModuleSpecifier(node.arguments[0]);
} else if (this._isTypeImportExpression(node)) {
this._migrateModuleSpecifier(node.argument.literal);
}
} catch (e) {
this.context.logger.error(`${e}`);
wagnermaciel marked this conversation as resolved.
Show resolved Hide resolved
if (e instanceof Error) {
this.logger.error(`${e.stack}`);
}
this.context.logger.warn(
`Failed to process file: ${node.getSourceFile().fileName} (see error above).`,
);
}
}

Expand Down