I now realise that it wasn't the intended behaviour of npx sv migrate svelte-5 but when run from the root of a mono repo the script doesn't quite do the right thing. Raising as a bug, to see if this could be improved or documented for others.
The key problem is that it fiddles with the package.json at the root of the monorepo but this doesn't contain the svelte dependencies. It's the sub-folders that contain the 'real' package.json files.
It also only offers the children of the current directory when asking which directory to process.
When asked for a directory to process it offered docs, packages and sites. So I selected sites (which only contains one).
The script happily processed the .svelte files, but didn't touch the package.json in sites/www/package.json
So what's the behaviour I'd expect?
I guess an error would have helped ('Your package.json does not contain svelte 4'), but the user may want to continue regardless.
Maybe process each package.json it finds (i.e. the one(s) in sites/www).
Or spotted that it was a monorepo and asked me to re-run in each svelte folder?
Raised here rather than sv repo because migration says: This migration is experimental — please report any bugs to https://github.com/sveltejs/svelte/issues
Reproduction
None given, but same mono-repo structure as svelte or kit.
Describe the bug
I now realise that it wasn't the intended behaviour of
npx sv migrate svelte-5
but when run from the root of a mono repo the script doesn't quite do the right thing. Raising as a bug, to see if this could be improved or documented for others.The key problem is that it fiddles with the package.json at the root of the monorepo but this doesn't contain the svelte dependencies. It's the sub-folders that contain the 'real' package.json files. It also only offers the children of the current directory when asking which directory to process.
In my case, I've got pnpm workspaces setup just like the main svelte repo https://github.com/sveltejs/svelte and from the root I ran:
sv version was 0.57
When asked for a directory to process it offered docs, packages and sites. So I selected sites (which only contains one). The script happily processed the .svelte files, but didn't touch the package.json in sites/www/package.json
So what's the behaviour I'd expect? I guess an error would have helped ('Your package.json does not contain svelte 4'), but the user may want to continue regardless. Maybe process each package.json it finds (i.e. the one(s) in sites/www). Or spotted that it was a monorepo and asked me to re-run in each svelte folder?
Raised here rather than sv repo because migration says:
This migration is experimental — please report any bugs to https://github.com/sveltejs/svelte/issues
Reproduction
None given, but same mono-repo structure as svelte or kit.
Logs
No response
System Info
Severity
annoyance