From 93392324a27addfcaaaec39c375f1cbcd89edf91 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Sat, 5 Sep 2020 12:44:01 +0200 Subject: [PATCH 1/2] feat: migration rules for svelte-native --- lib/controllers/migrate-controller.ts | 66 +++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 899afff4c8..64c72061f4 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -211,6 +211,30 @@ export class MigrateController }, migrateAction: this.migrateNativeScriptAngular.bind(this), }, + { + packageName: "svelte-native", + verifiedVersion: "0.9.1", + shouldMigrateAction: async ( + projectData: IProjectData, + allowInvalidVersions: boolean + ) => { + const dependency = { + packageName: "svelte-native", + verifiedVersion: "0.9.1", + isDev: false, + }; + const result = + this.hasDependency(dependency, projectData) && + (await this.shouldMigrateDependencyVersion( + dependency, + projectData, + allowInvalidVersions + )); + + return result; + }, + migrateAction: this.migrateNativeScriptSvelte.bind(this), + }, { packageName: "@nativescript/unit-test-runner", verifiedVersion: "1.0.0", @@ -1285,6 +1309,48 @@ export class MigrateController return dependencies; } + private async migrateNativeScriptSvelte(): Promise { + const dependencies: IMigrationDependency[] = [ + { + packageName: "svelte-native-nativescript-ui", + verifiedVersion: "0.9.0", + shouldUseExactVersion: true, + isDev: true, + shouldAddIfMissing: true, + }, + { + packageName: "svelte-native-preprocessor", + verifiedVersion: "0.2.0", + shouldUseExactVersion: true, + isDev: true, + shouldAddIfMissing: true, + }, + { + packageName: "svelte-loader", + shouldRemove: true, + }, + { + packageName: "svelte-loader-hot", + verifiedVersion: "0.3.0", + shouldUseExactVersion: true, + isDev: true, + shouldAddIfMissing: true, + }, + { + packageName: "svelte", + shouldRemove: true, + }, + { + packageName: "svelte", + verifiedVersion: "3.24.1", + shouldUseExactVersion: true, + isDev: true, + }, + ]; + + return dependencies; + } + private async migrateWebpack(): Promise { const scopedWebpackDeps = [ "@angular-devkit/core", From b05553dbd50690ebeb42433fd32434352bff108d Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Fri, 16 Oct 2020 10:20:01 +0000 Subject: [PATCH 2/2] chore: update migration deps --- lib/controllers/migrate-controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 64c72061f4..e321412724 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -213,14 +213,14 @@ export class MigrateController }, { packageName: "svelte-native", - verifiedVersion: "0.9.1", + verifiedVersion: "0.9.4", shouldMigrateAction: async ( projectData: IProjectData, allowInvalidVersions: boolean ) => { const dependency = { packageName: "svelte-native", - verifiedVersion: "0.9.1", + verifiedVersion: "0.9.0", // minimum version required - anything less will need a migration isDev: false, }; const result = @@ -1331,7 +1331,7 @@ export class MigrateController }, { packageName: "svelte-loader-hot", - verifiedVersion: "0.3.0", + verifiedVersion: "0.3.1", shouldUseExactVersion: true, isDev: true, shouldAddIfMissing: true,