@@ -39,15 +39,10 @@ interface IPlatformService extends NodeJS.EventEmitter {
39
39
* When there are changes to be prepared, it prepares the native project for the specified platform.
40
40
* When finishes, prepare saves the .nsprepareinfo file in platform folder.
41
41
* This file contains information about current project configuration and allows skipping unnecessary build, deploy and livesync steps.
42
- * @param {string } platform The platform to be prepared.
43
- * @param {IAppFilesUpdaterOptions } appFilesUpdaterOptions Options needed to instantiate AppFilesUpdater class.
44
- * @param {string } platformTemplate The name of the platform template.
45
- * @param {IProjectData } projectData DTO with information about the project.
46
- * @param {IAddPlatformCoreOptions } config Options required for project preparation/creation.
47
- * @param {Array } filesToSync Files about to be synced to device.
42
+ * @param {IPreparePlatformInfo } platformInfo Options to control the preparation.
48
43
* @returns {boolean } true indicates that the platform was prepared.
49
44
*/
50
- preparePlatform ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions , filesToSync ?: Array < String > , nativePrepare ?: INativePrepare ) : Promise < boolean > ;
45
+ preparePlatform ( platformInfo : IPreparePlatformInfo ) : Promise < boolean > ;
51
46
52
47
/**
53
48
* Determines whether a build is necessary. A build is necessary when one of the following is true:
@@ -106,14 +101,10 @@ interface IPlatformService extends NodeJS.EventEmitter {
106
101
/**
107
102
* Executes prepare, build and installOnPlatform when necessary to ensure that the latest version of the app is installed on specified platform.
108
103
* - When --clean option is specified it builds the app on every change. If not, build is executed only when there are native changes.
109
- * @param {string } platform The platform to deploy.
110
- * @param {IAppFilesUpdaterOptions } appFilesUpdaterOptions Options needed to instantiate AppFilesUpdater class.
111
- * @param {IDeployPlatformOptions } deployOptions Various options that can manage the deploy operation.
112
- * @param {IProjectData } projectData DTO with information about the project.
113
- * @param {IAddPlatformCoreOptions } config Options required for project preparation/creation.
104
+ * @param {IDeployPlatformInfo } deployInfo Options required for project preparation and deployment.
114
105
* @returns {void }
115
106
*/
116
- deployPlatform ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , deployOptions : IDeployPlatformOptions , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > ;
107
+ deployPlatform ( deployInfo : IDeployPlatformInfo ) : Promise < void > ;
117
108
118
109
/**
119
110
* Runs the application on specified platform. Assumes that the application is already build and installed. Fails if this is not true.
@@ -276,9 +267,19 @@ interface IPlatformsData {
276
267
getPlatformData ( platform : string , projectData : IProjectData ) : IPlatformData ;
277
268
}
278
269
270
+ interface IAppFilesUpdaterOptionsComposition {
271
+ appFilesUpdaterOptions : IAppFilesUpdaterOptions ;
272
+ }
273
+
274
+ interface IJsNodeModulesData extends IPlatform , IProjectDataComposition , IAppFilesUpdaterOptionsComposition {
275
+ absoluteOutputPath : string ;
276
+ lastModifiedTime : Date ;
277
+ projectFilesConfig : IProjectFilesConfig ;
278
+ }
279
+
279
280
interface INodeModulesBuilder {
280
281
prepareNodeModules ( absoluteOutputPath : string , platform : string , lastModifiedTime : Date , projectData : IProjectData , projectFilesConfig : IProjectFilesConfig ) : Promise < void > ;
281
- prepareJSNodeModules ( absoluteOutputPath : string , platform : string , lastModifiedTime : Date , projectData : IProjectData , projectFilesConfig : IProjectFilesConfig ) : Promise < void > ;
282
+ prepareJSNodeModules ( jsNodeModulesData : IJsNodeModulesData ) : Promise < void > ;
282
283
cleanNodeModules ( absoluteOutputPath : string , platform : string ) : void ;
283
284
}
284
285
@@ -291,15 +292,44 @@ interface IBuildInfo {
291
292
buildTime : string ;
292
293
}
293
294
294
- interface IPreparePlatformService extends NodeJS . EventEmitter {
295
- addPlatform ( platformData : IPlatformData , frameworkDir : string , installedVersion : string , projectData : IProjectData , config : IPlatformOptions , platformTemplate ?: string , ) : Promise < void > ;
296
- preparePlatform ( platform : string , platformData : IPlatformData , appFilesUpdaterOptions : IAppFilesUpdaterOptions , projectData : IProjectData , platformSpecificData : IPlatformSpecificData , changesInfo ?: IProjectChangesInfo , filesToSync ?: Array < String > , projectFilesConfig ?: IProjectFilesConfig ) : Promise < void > ;
295
+ interface IPlatformDataComposition {
296
+ platformData : IPlatformData ;
297
297
}
298
298
299
- interface IPreparePlatformJSService extends IPreparePlatformService {
299
+ interface ICopyAppFilesData extends IProjectDataComposition , IAppFilesUpdaterOptionsComposition , IPlatformDataComposition { }
300
+
301
+ interface IPreparePlatformService {
302
+ addPlatform ( info : IAddPlatformInfo ) : Promise < void > ;
303
+ preparePlatform ( config : IPreparePlatformJSInfo ) : Promise < void > ;
304
+ }
300
305
306
+ interface IAddPlatformInfo extends IProjectDataComposition , IPlatformDataComposition {
307
+ frameworkDir : string ;
308
+ installedVersion : string ;
309
+ config : IPlatformOptions ;
310
+ platformTemplate ?: string ;
301
311
}
302
312
303
- interface IPreparePlatformNativeService extends IPreparePlatformService {
313
+ interface IPreparePlatformJSInfo extends IPreparePlatformCoreInfo , ICopyAppFilesData {
314
+ projectFilesConfig ?: IProjectFilesConfig ;
315
+ }
304
316
305
- }
317
+ interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase {
318
+ platformSpecificData : IPlatformSpecificData
319
+ changesInfo ?: IProjectChangesInfo ;
320
+ }
321
+
322
+ interface IPreparePlatformInfo extends IPreparePlatformInfoBase , IPlatformConfig , IPlatformTemplate { }
323
+
324
+ interface IPlatformConfig {
325
+ config : IPlatformOptions ;
326
+ }
327
+
328
+ interface IPreparePlatformInfoBase extends IPlatform , IAppFilesUpdaterOptionsComposition , IProjectDataComposition , IEnvOptions {
329
+ filesToSync ?: string [ ] ;
330
+ nativePrepare ?: INativePrepare ;
331
+ }
332
+
333
+ interface IDeployPlatformInfo extends IPlatform , IAppFilesUpdaterOptionsComposition , IProjectDataComposition , IPlatformConfig , IEnvOptions {
334
+ deployOptions : IDeployPlatformOptions
335
+ }
0 commit comments