File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
crates/tauri-cli/src/migrate/migrations/v1 Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @tauri-apps/cli " : patch:enhance
3+ " tauri-cli " : patch:enhance
4+ ---
5+
6+ Migrate the ` $schema ` Tauri configuration to the v2 format.
Original file line number Diff line number Diff line change @@ -684,6 +684,15 @@ mod test {
684684 let mut migrated = original. clone ( ) ;
685685 super :: migrate_config ( & mut migrated) . expect ( "failed to migrate config" ) ;
686686
687+ if original. get ( "$schema" ) . is_some ( ) {
688+ if let Some ( map) = migrated. as_object_mut ( ) {
689+ map. insert (
690+ "$schema" . to_string ( ) ,
691+ serde_json:: Value :: String ( "https://schema.tauri.app/config/2" . to_string ( ) ) ,
692+ ) ;
693+ }
694+ }
695+
687696 if original
688697 . get ( "tauri" )
689698 . and_then ( |v| v. get ( "bundle" ) )
@@ -708,6 +717,7 @@ mod test {
708717 #[ test]
709718 fn migrate_full ( ) {
710719 let original = serde_json:: json!( {
720+ "$schema" : "../node_modules/@tauri-apps/cli/schema.json" ,
711721 "build" : {
712722 "distDir" : "../dist" ,
713723 "devPath" : "http://localhost:1240" ,
@@ -798,6 +808,9 @@ mod test {
798808
799809 let migrated = migrate ( & original) ;
800810
811+ // $schema
812+ assert_eq ! ( migrated[ "$schema" ] , "https://schema.tauri.app/config/2" ) ;
813+
801814 // plugins > updater
802815 assert_eq ! (
803816 migrated[ "plugins" ] [ "updater" ] [ "endpoints" ] ,
You can’t perform that action at this time.
0 commit comments