Skip to content

Commit b5f66d9

Browse files
committed
feat: improved migrations
1 parent d0916ce commit b5f66d9

File tree

7 files changed

+407
-162
lines changed

7 files changed

+407
-162
lines changed

lib/bootstrap.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ injector.requirePublicClass("constants", "./constants-provider");
1010
injector.require("projectData", "./project-data");
1111
injector.requirePublic("projectDataService", "./services/project-data-service");
1212
injector.requirePublic(
13-
"projectConfigService",
14-
"./services/project-config-service"
13+
"projectBackupService",
14+
"./services/project-backup-service"
1515
);
1616
injector.requirePublic(
1717
"projectCleanupService",
1818
"./services/project-cleanup-service"
1919
);
20+
injector.requirePublic(
21+
"projectConfigService",
22+
"./services/project-config-service"
23+
);
2024
injector.require("performanceService", "./services/performance-service");
2125
injector.requirePublic("projectService", "./services/project-service");
2226
injector.require("androidProjectService", "./services/android-project-service");

lib/commands/migrate.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { IProjectData } from "../definitions/project";
22
import { IMigrateController } from "../definitions/migrate";
33
import { ICommand, ICommandParameter } from "../common/definitions/commands";
44
import { injector } from "../common/yok";
5-
import { ShouldMigrate } from "../constants";
65

76
export class MigrateCommand implements ICommand {
87
public allowedParameters: ICommandParameter[] = [];
@@ -28,18 +27,19 @@ export class MigrateCommand implements ICommand {
2827
migrationData
2928
);
3029

31-
if (shouldMigrateResult.shouldMigrate === ShouldMigrate.NO) {
30+
if (!shouldMigrateResult) {
3231
this.$logger.printMarkdown(
3332
'__Project is compatible with NativeScript "v7.0.0". To get the latest NativeScript packages execute "ns update".__'
3433
);
3534
return;
36-
} else if (shouldMigrateResult.shouldMigrate === ShouldMigrate.ADVISED) {
37-
// todo: this shouldn't be here, because this is already the `ns migrate` path.
38-
this.$logger.printMarkdown(
39-
'__Project should work with NativeScript "v7.0.0" but a migration is advised. Run ns migrate to migrate.__'
40-
);
41-
return;
4235
}
36+
// else if (shouldMigrateResult.shouldMigrate === ShouldMigrate.ADVISED) {
37+
// // todo: this shouldn't be here, because this is already the `ns migrate` path.
38+
// this.$logger.printMarkdown(
39+
// '__Project should work with NativeScript "v7.0.0" but a migration is advised. Run ns migrate to migrate.__'
40+
// );
41+
// return;
42+
// }
4343

4444
await this.$migrateController.migrate(migrationData);
4545
}

0 commit comments

Comments
 (0)