Skip to content

feat: migration rules for svelte-native #5372

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

Merged
merged 2 commits into from
Oct 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions lib/controllers/migrate-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ export class MigrateController
},
migrateAction: this.migrateNativeScriptAngular.bind(this),
},
{
packageName: "svelte-native",
verifiedVersion: "0.9.4",
Comment on lines +215 to +216
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@halfnelson it's here!

shouldMigrateAction: async (
projectData: IProjectData,
allowInvalidVersions: boolean
) => {
const dependency = {
packageName: "svelte-native",
verifiedVersion: "0.9.0", // minimum version required - anything less will need a migration
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",
Expand Down Expand Up @@ -1285,6 +1309,48 @@ export class MigrateController
return dependencies;
}

private async migrateNativeScriptSvelte(): Promise<IMigrationDependency[]> {
const dependencies: IMigrationDependency[] = [
{
packageName: "svelte-native-nativescript-ui",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this instead be svelte-native and version 0.9.4 otherwise I can't see where svelte-native is ensured

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.1",
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<IMigrationDependency[]> {
const scopedWebpackDeps = [
"@angular-devkit/core",
Expand Down