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

npx sv migrate app-state only migrates some files #368

Open
benmccann opened this issue Dec 20, 2024 · 1 comment
Open

npx sv migrate app-state only migrates some files #368

benmccann opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working pkg:migrate svelte-migrate

Comments

@benmccann
Copy link
Member

benmccann commented Dec 20, 2024

Run it in the web directory of https://github.com/immich-app/immich and it won't migrate anything. Some stuff was already migrated in immich-app/immich#14807, but it only got 9 out of 22 occurrences of $app/stores

@manuel3108 manuel3108 added bug Something isn't working pkg:migrate svelte-migrate labels Dec 23, 2024
@manuel3108
Copy link
Member

Here is a failing test (note the word page in an unrelated import). I tried fixing the bug but failed.

test('Updates $app/store #4', () => {
	const result = transform_svelte_code(
		`<script>
	import { page } from '$app/stores';
	import Comp from '$lib/page/Comp.svelte'
</script>

<div>{$page.url}</div>
<button onclick={() => {
	console.log($page.state);
}}></button>
`
	);
	assert.equal(
		result,
		`<script>
	import { page } from '$app/state';
	import Comp from '$lib/page/Comp.svelte'
</script>

<div>{page.url}</div>
<button onclick={() => {
	console.log(page.state);
}}></button>
`
	);
});

FYI @dummdidumm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:migrate svelte-migrate
Projects
None yet
Development

No branches or pull requests

2 participants