Skip to content

Commit 137d67a

Browse files
Merge pull request #3263 from NativeScript/vladimirov/cherry-pick-fixes
Cherry-pick fixes from master
2 parents 37c6e97 + 3e24cb0 commit 137d67a

10 files changed

+167
-23
lines changed

PublicAPI.md

+2
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ const liveSyncData = {
589589
projectDir,
590590
skipWatcher: false,
591591
watchAllFiles: false,
592+
bundle: false,
593+
release: false,
592594
useLiveEdit: false
593595
};
594596

lib/declarations.d.ts

-8
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,6 @@ interface IInfoService {
432432
printComponentsInfo(): Promise<void>;
433433
}
434434

435-
/**
436-
* Describes standard username/password type credentials.
437-
*/
438-
interface ICredentials {
439-
username: string;
440-
password: string;
441-
}
442-
443435
/**
444436
* Describes properties needed for uploading a package to iTunes Connect
445437
*/

lib/definitions/livesync.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ interface ILiveSyncDeviceInfo extends IOptionalOutputPath, IOptionalDebuggingOpt
111111
/**
112112
* Describes a LiveSync operation.
113113
*/
114-
interface ILiveSyncInfo extends IProjectDir, IEnvOptions {
114+
interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IBundle, IRelease {
115115
/**
116116
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
117117
*/
@@ -152,7 +152,7 @@ interface IProjectDataComposition {
152152
/**
153153
* Desribes object that can be passed to ensureLatestAppPackageIsInstalledOnDevice method.
154154
*/
155-
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions {
155+
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions, IBundle, IRelease {
156156
device: Mobile.IDevice;
157157
preparedPlatforms: string[];
158158
rebuiltInformation: ILiveSyncBuildInfo[];

lib/services/analytics/google-analytics-provider.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
1010
constructor(private clientId: string,
1111
private $staticConfig: IStaticConfig,
1212
private $analyticsSettingsService: IAnalyticsSettingsService,
13-
private $logger: ILogger) {
13+
private $logger: ILogger,
14+
private $proxyService: IProxyService) {
1415
}
1516

1617
public async trackHit(trackInfo: IGoogleAnalyticsData): Promise<void> {
@@ -27,11 +28,16 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
2728
}
2829

2930
private async track(gaTrackingId: string, trackInfo: IGoogleAnalyticsData, sessionId: string): Promise<void> {
31+
const proxySettings = await this.$proxyService.getCache();
32+
const proxy = proxySettings && proxySettings.proxy;
3033
const visitor = ua({
3134
tid: gaTrackingId,
3235
cid: this.clientId,
3336
headers: {
3437
["User-Agent"]: this.$analyticsSettingsService.getUserAgentString(`tnsCli/${this.$staticConfig.version}`)
38+
},
39+
requestOptions: {
40+
proxy
3541
}
3642
});
3743

lib/services/livesync/livesync-command-helper.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
3232
this.$iosDeviceOperations.setShouldDispose(false);
3333
}
3434

35-
if (this.$options.release || this.$options.bundle) {
35+
if (this.$options.release) {
3636
await this.runInReleaseMode(platform);
3737
return;
3838
}
@@ -75,11 +75,12 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
7575
skipWatcher: !this.$options.watch,
7676
watchAllFiles: this.$options.syncAllFiles,
7777
clean: this.$options.clean,
78+
bundle: !!this.$options.bundle,
79+
release: this.$options.release,
7880
env: this.$options.env
7981
};
8082

8183
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);
82-
8384
}
8485

8586
private async runInReleaseMode(platform: string): Promise<void> {

lib/services/livesync/livesync-service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
362362
const prepareInfo: IPreparePlatformInfo = {
363363
platform,
364364
appFilesUpdaterOptions: {
365-
bundle: false,
366-
release: false,
365+
bundle: options.bundle,
366+
release: options.release,
367367
},
368368
projectData: options.projectData,
369369
env: options.env,
@@ -459,6 +459,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
459459
deviceBuildInfoDescriptor,
460460
liveSyncData,
461461
settings,
462+
bundle: liveSyncData.bundle,
463+
release: liveSyncData.release,
462464
env: liveSyncData.env
463465
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
464466

@@ -564,6 +566,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
564566
deviceBuildInfoDescriptor,
565567
settings: latestAppPackageInstalledSettings,
566568
modifiedFiles: allModifiedFiles,
569+
bundle: liveSyncData.bundle,
570+
release: liveSyncData.release,
567571
env: liveSyncData.env
568572
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
569573

lib/services/test-execution-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class TestExecutionService implements ITestExecutionService {
123123
projectDir: projectData.projectDir,
124124
skipWatcher: !this.$options.watch || this.$options.justlaunch,
125125
watchAllFiles: this.$options.syncAllFiles,
126+
bundle: !!this.$options.bundle,
127+
release: this.$options.release,
126128
env: this.$options.env
127129
};
128130

@@ -248,6 +250,8 @@ class TestExecutionService implements ITestExecutionService {
248250
projectDir: projectData.projectDir,
249251
skipWatcher: !this.$options.watch || this.$options.justlaunch,
250252
watchAllFiles: this.$options.syncAllFiles,
253+
bundle: !!this.$options.bundle,
254+
release: this.$options.release,
251255
env: this.$options.env
252256
};
253257

npm-shrinkwrap.json

+140-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"marked-terminal": "2.0.0",
5555
"minimatch": "3.0.2",
5656
"mkdirp": "0.5.1",
57-
"moment": "2.10.6",
5857
"mute-stream": "0.0.5",
5958
"open": "0.0.5",
6059
"osenv": "0.1.3",
@@ -64,6 +63,7 @@
6463
"plistlib": "0.2.1",
6564
"progress-stream": "1.1.1",
6665
"properties-parser": "0.2.3",
66+
"proxy-lib": "0.2.0",
6767
"qr-image": "3.2.0",
6868
"request": "2.81.0",
6969
"semver": "5.3.0",
@@ -113,6 +113,6 @@
113113
},
114114
"license": "Apache-2.0",
115115
"engines": {
116-
"node": ">=6.0.0 <9.0.0"
116+
"node": ">=6.0.0 <10.0.0"
117117
}
118118
}

0 commit comments

Comments
 (0)