Skip to content

Commit 9339232

Browse files
committed
feat: migration rules for svelte-native
1 parent 57add5b commit 9339232

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

lib/controllers/migrate-controller.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,30 @@ export class MigrateController
211211
},
212212
migrateAction: this.migrateNativeScriptAngular.bind(this),
213213
},
214+
{
215+
packageName: "svelte-native",
216+
verifiedVersion: "0.9.1",
217+
shouldMigrateAction: async (
218+
projectData: IProjectData,
219+
allowInvalidVersions: boolean
220+
) => {
221+
const dependency = {
222+
packageName: "svelte-native",
223+
verifiedVersion: "0.9.1",
224+
isDev: false,
225+
};
226+
const result =
227+
this.hasDependency(dependency, projectData) &&
228+
(await this.shouldMigrateDependencyVersion(
229+
dependency,
230+
projectData,
231+
allowInvalidVersions
232+
));
233+
234+
return result;
235+
},
236+
migrateAction: this.migrateNativeScriptSvelte.bind(this),
237+
},
214238
{
215239
packageName: "@nativescript/unit-test-runner",
216240
verifiedVersion: "1.0.0",
@@ -1285,6 +1309,48 @@ export class MigrateController
12851309
return dependencies;
12861310
}
12871311

1312+
private async migrateNativeScriptSvelte(): Promise<IMigrationDependency[]> {
1313+
const dependencies: IMigrationDependency[] = [
1314+
{
1315+
packageName: "svelte-native-nativescript-ui",
1316+
verifiedVersion: "0.9.0",
1317+
shouldUseExactVersion: true,
1318+
isDev: true,
1319+
shouldAddIfMissing: true,
1320+
},
1321+
{
1322+
packageName: "svelte-native-preprocessor",
1323+
verifiedVersion: "0.2.0",
1324+
shouldUseExactVersion: true,
1325+
isDev: true,
1326+
shouldAddIfMissing: true,
1327+
},
1328+
{
1329+
packageName: "svelte-loader",
1330+
shouldRemove: true,
1331+
},
1332+
{
1333+
packageName: "svelte-loader-hot",
1334+
verifiedVersion: "0.3.0",
1335+
shouldUseExactVersion: true,
1336+
isDev: true,
1337+
shouldAddIfMissing: true,
1338+
},
1339+
{
1340+
packageName: "svelte",
1341+
shouldRemove: true,
1342+
},
1343+
{
1344+
packageName: "svelte",
1345+
verifiedVersion: "3.24.1",
1346+
shouldUseExactVersion: true,
1347+
isDev: true,
1348+
},
1349+
];
1350+
1351+
return dependencies;
1352+
}
1353+
12881354
private async migrateWebpack(): Promise<IMigrationDependency[]> {
12891355
const scopedWebpackDeps = [
12901356
"@angular-devkit/core",

0 commit comments

Comments
 (0)