Skip to content
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

List out options for npx sv migrate #302

Open
sacrosanctic opened this issue Nov 14, 2024 · 5 comments · May be fixed by #376
Open

List out options for npx sv migrate #302

sacrosanctic opened this issue Nov 14, 2024 · 5 comments · May be fixed by #376
Labels
enhancement New feature or request pkg:migrate svelte-migrate

Comments

@sacrosanctic
Copy link
Contributor

sacrosanctic commented Nov 14, 2024

Expected

> npx sv migrate
( ) svelte-5
( ) svelte-4
( ) sveltekit-2
( ) ...

list of current commands: https://svelte.dev/docs/cli/sv-migrate#Migrations

Actual

> npx sv migrate
error: missing required argument 'migration'
@manuel3108 manuel3108 added enhancement New feature or request pkg:migrate svelte-migrate labels Nov 29, 2024
@GauBen
Copy link

GauBen commented Dec 18, 2024

That would be awesome, especially if multiple migrations can be chosen and run in the correct order!

@manuel3108
Copy link
Member

Running the migrations in the correct order brings other problems though. What if the first migration fails or introduces @migration-task? Only allowing the user to select one migration at a time would make stuff a lot easier.

@GauBen
Copy link

GauBen commented Dec 23, 2024

What if the first migration fails or introduces @migration-task?

git rebase offers a good example of what can be done, ux-wise:

  • on the happy path, if all goes well, all commits (migrations) are applied in order
  • if git encounters a conflict, it pauses and let the user handle it manually. sv could do the same: The svelte-5 migration requires manual action: look for "@migration-task" in your codebase and update the code. Once done, commit your changes and resume the migration train with "npx sv migrate migration1 migration2"

That may not be worth the work though

@sacrosanctic
Copy link
Contributor Author

You'd still have to put them in the correct order. Will the devs guard against that too? Not worth the complexity in my opinion. Just a single select seems like a quick win.

@GauBen
Copy link

GauBen commented Dec 23, 2024

Will the devs guard against that too? Not worth the complexity in my opinion.

Each migration declares its dependencies (it already kind of does!) and svelte-migrate resolves the dependency tree to process the migrations in the right order. No need for the user to specify the migrations in the right order or to have guards this way.

@manuel3108 manuel3108 linked a pull request Dec 27, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:migrate svelte-migrate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants