@@ -52,6 +52,27 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
5252 } ) ;
5353 }
5454
55+ public async syncFiles ( data : IPreviewAppLiveSyncData , filesToSync : string [ ] , filesToRemove : string [ ] ) : Promise < void > {
56+ this . showWarningsForNativeFiles ( filesToSync ) ;
57+
58+ for ( const device of this . $previewSdkService . connectedDevices ) {
59+ await this . $previewAppPluginsService . comparePluginsOnDevice ( data , device ) ;
60+ }
61+
62+ const platforms = _ ( this . $previewSdkService . connectedDevices )
63+ . map ( device => device . platform )
64+ . uniq ( )
65+ . value ( ) ;
66+
67+ for ( const platform of platforms ) {
68+ await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
69+ }
70+ }
71+
72+ public async stopLiveSync ( ) : Promise < void > {
73+ this . $previewSdkService . stop ( ) ;
74+ }
75+
5576 private async initializePreviewForDevice ( data : IPreviewAppLiveSyncData , device : Device ) : Promise < FilesPayload > {
5677 const filesToSyncMap : IDictionary < string [ ] > = { } ;
5778 const hmrData : IDictionary < IPlatformHmrData > = { } ;
@@ -98,27 +119,6 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
98119 return payloads ;
99120 }
100121
101- public async syncFiles ( data : IPreviewAppLiveSyncData , filesToSync : string [ ] , filesToRemove : string [ ] ) : Promise < void > {
102- this . showWarningsForNativeFiles ( filesToSync ) ;
103-
104- for ( const device of this . $previewSdkService . connectedDevices ) {
105- await this . $previewAppPluginsService . comparePluginsOnDevice ( data , device ) ;
106- }
107-
108- const platforms = _ ( this . $previewSdkService . connectedDevices )
109- . map ( device => device . platform )
110- . uniq ( )
111- . value ( ) ;
112-
113- for ( const platform of platforms ) {
114- await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
115- }
116- }
117-
118- public async stopLiveSync ( ) : Promise < void > {
119- this . $previewSdkService . stop ( ) ;
120- }
121-
122122 private async syncFilesForPlatformSafe ( data : IPreviewAppLiveSyncData , platform : string , opts ?: ISyncFilesOptions ) : Promise < FilesPayload > {
123123 this . $logger . info ( `Start syncing changes for platform ${ platform } .` ) ;
124124
0 commit comments