File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/migrate/migrations/app-state Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ export function transform_svelte_code(code) {
38
38
} ) ;
39
39
let modified = code . replace ( '$app/stores' , '$app/state' ) ;
40
40
41
+ let needs_navigating_migration_task = false ;
42
+
41
43
for ( const [ store , alias ] of stores ) {
42
44
// if someone uses that they're deep into stores and we better not touch this file
43
45
if ( store === 'getStores' ) return code ;
@@ -68,10 +70,18 @@ export function transform_svelte_code(code) {
68
70
return code ;
69
71
}
70
72
73
+ if ( store === 'navigating' && after [ 0 ] !== '.' ) {
74
+ needs_navigating_migration_task = true ;
75
+ }
76
+
71
77
modified = before . slice ( 0 , - 1 ) + alias + ( store === 'updated' ? '.current' : '' ) + after ;
72
78
count_removed ++ ;
73
79
}
74
80
}
75
81
82
+ if ( needs_navigating_migration_task ) {
83
+ modified = `<!-- @migration task: review uses of \`navigating\` -->\n${ modified } ` ;
84
+ }
85
+
76
86
return modified ;
77
87
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ test('Updates $app/store #2', () => {
40
40
) ;
41
41
assert . equal (
42
42
result ,
43
- `<script>
43
+ `<!-- @migration task: review uses of \`navigating\` -->\n< script>
44
44
import { navigating, updated } from '$app/state';
45
45
updated.current;
46
46
updated.check();
You can’t perform that action at this time.
0 commit comments