Skip to content

Commit 94c63ae

Browse files
committed
fix: add trace logs for the shouldMigrate reason.
1 parent 72b9e58 commit 94c63ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/controllers/migrate-controller.ts

+6
Original file line numberDiff line numberDiff line change
@@ -132,31 +132,37 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`;
132132

133133
public async shouldMigrate({ projectDir }: IProjectDir): Promise<boolean> {
134134
const projectData = this.$projectDataService.getProjectData(projectDir);
135+
const shouldMigrateCommonMessage = "The app is not compatible with this CLI version and it should be migrated. Reason: ";
135136

136137
for (let i = 0; i < this.migrationDependencies.length; i++) {
137138
const dependency = this.migrationDependencies[i];
138139
const hasDependency = this.hasDependency(dependency, projectData);
139140

140141
if (hasDependency && dependency.shouldMigrateAction && await dependency.shouldMigrateAction(projectData)) {
142+
this.$logger.trace(`${shouldMigrateCommonMessage}'${dependency.packageName}' requires an update.`);
141143
return true;
142144
}
143145

144146
if (hasDependency && (dependency.replaceWith || dependency.shouldRemove)) {
147+
this.$logger.trace(`${shouldMigrateCommonMessage}'${dependency.packageName}' is deprecated.`);
145148
return true;
146149
}
147150

148151
if (hasDependency && await this.shouldMigrateDependencyVersion(dependency, projectData)) {
152+
this.$logger.trace(`${shouldMigrateCommonMessage}'${dependency.packageName}' should be updated.`);
149153
return true;
150154
}
151155

152156
if (!hasDependency && dependency.shouldAddIfMissing) {
157+
this.$logger.trace(`${shouldMigrateCommonMessage}'${dependency.packageName}' is missing.`);
153158
return true;
154159
}
155160
}
156161

157162
for (const platform in this.$devicePlatformsConstants) {
158163
const hasRuntimeDependency = this.hasRuntimeDependency({ platform, projectData });
159164
if (hasRuntimeDependency && await this.shouldUpdateRuntimeVersion({ targetVersion: this.verifiedPlatformVersions[platform.toLowerCase()], platform, projectData })) {
165+
this.$logger.trace(`${shouldMigrateCommonMessage}Platform '${platform}' should be updated.`);
160166
return true;
161167
}
162168
}

0 commit comments

Comments
 (0)