diff --git a/PublicAPI.md b/PublicAPI.md index 8501addc33..c6a768e317 100644 --- a/PublicAPI.md +++ b/PublicAPI.md @@ -589,6 +589,8 @@ const liveSyncData = { projectDir, skipWatcher: false, watchAllFiles: false, + bundle: false, + release: false, useLiveEdit: false }; diff --git a/lib/common b/lib/common index 5e24712f70..1bb198eab6 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 5e24712f70bcef854c42512a41cbc8a68376deb6 +Subproject commit 1bb198eab65994f69d7db7e334eea461233da1f0 diff --git a/lib/declarations.d.ts b/lib/declarations.d.ts index d2b11d0cb3..e302f966b9 100644 --- a/lib/declarations.d.ts +++ b/lib/declarations.d.ts @@ -432,14 +432,6 @@ interface IInfoService { printComponentsInfo(): Promise; } -/** - * Describes standard username/password type credentials. - */ -interface ICredentials { - username: string; - password: string; -} - /** * Describes properties needed for uploading a package to iTunes Connect */ diff --git a/lib/definitions/livesync.d.ts b/lib/definitions/livesync.d.ts index 6062d02fa7..6d5db2d7f7 100644 --- a/lib/definitions/livesync.d.ts +++ b/lib/definitions/livesync.d.ts @@ -111,7 +111,7 @@ interface ILiveSyncDeviceInfo extends IOptionalOutputPath, IOptionalDebuggingOpt /** * Describes a LiveSync operation. */ -interface ILiveSyncInfo extends IProjectDir, IEnvOptions { +interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IBundle, IRelease { /** * Defines if the watcher should be skipped. If not passed, fs.Watcher will be started. */ @@ -152,7 +152,7 @@ interface IProjectDataComposition { /** * Desribes object that can be passed to ensureLatestAppPackageIsInstalledOnDevice method. */ -interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions { +interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions, IBundle, IRelease { device: Mobile.IDevice; preparedPlatforms: string[]; rebuiltInformation: ILiveSyncBuildInfo[]; diff --git a/lib/services/analytics/google-analytics-provider.ts b/lib/services/analytics/google-analytics-provider.ts index 0fefd753b2..347625b9e8 100644 --- a/lib/services/analytics/google-analytics-provider.ts +++ b/lib/services/analytics/google-analytics-provider.ts @@ -10,7 +10,8 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider { constructor(private clientId: string, private $staticConfig: IStaticConfig, private $analyticsSettingsService: IAnalyticsSettingsService, - private $logger: ILogger) { + private $logger: ILogger, + private $proxyService: IProxyService) { } public async trackHit(trackInfo: IGoogleAnalyticsData): Promise { @@ -27,11 +28,16 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider { } private async track(gaTrackingId: string, trackInfo: IGoogleAnalyticsData, sessionId: string): Promise { + const proxySettings = await this.$proxyService.getCache(); + const proxy = proxySettings && proxySettings.proxy; const visitor = ua({ tid: gaTrackingId, cid: this.clientId, headers: { ["User-Agent"]: this.$analyticsSettingsService.getUserAgentString(`tnsCli/${this.$staticConfig.version}`) + }, + requestOptions: { + proxy } }); diff --git a/lib/services/livesync/livesync-command-helper.ts b/lib/services/livesync/livesync-command-helper.ts index 2cf9f9b8c1..8624bfb7e7 100644 --- a/lib/services/livesync/livesync-command-helper.ts +++ b/lib/services/livesync/livesync-command-helper.ts @@ -32,7 +32,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper { this.$iosDeviceOperations.setShouldDispose(false); } - if (this.$options.release || this.$options.bundle) { + if (this.$options.release) { await this.runInReleaseMode(platform); return; } @@ -75,11 +75,12 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper { skipWatcher: !this.$options.watch, watchAllFiles: this.$options.syncAllFiles, clean: this.$options.clean, + bundle: !!this.$options.bundle, + release: this.$options.release, env: this.$options.env }; await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo); - } private async runInReleaseMode(platform: string): Promise { diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index ed6c301ddf..8b4c53d104 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -362,8 +362,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi const prepareInfo: IPreparePlatformInfo = { platform, appFilesUpdaterOptions: { - bundle: false, - release: false, + bundle: options.bundle, + release: options.release, }, projectData: options.projectData, env: options.env, @@ -459,6 +459,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi deviceBuildInfoDescriptor, liveSyncData, settings, + bundle: liveSyncData.bundle, + release: liveSyncData.release, env: liveSyncData.env }, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare }); @@ -564,6 +566,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi deviceBuildInfoDescriptor, settings: latestAppPackageInstalledSettings, modifiedFiles: allModifiedFiles, + bundle: liveSyncData.bundle, + release: liveSyncData.release, env: liveSyncData.env }, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare }); diff --git a/lib/services/test-execution-service.ts b/lib/services/test-execution-service.ts index 3ddc6e09b6..b0b5119004 100644 --- a/lib/services/test-execution-service.ts +++ b/lib/services/test-execution-service.ts @@ -123,6 +123,8 @@ class TestExecutionService implements ITestExecutionService { projectDir: projectData.projectDir, skipWatcher: !this.$options.watch || this.$options.justlaunch, watchAllFiles: this.$options.syncAllFiles, + bundle: !!this.$options.bundle, + release: this.$options.release, env: this.$options.env }; @@ -248,6 +250,8 @@ class TestExecutionService implements ITestExecutionService { projectDir: projectData.projectDir, skipWatcher: !this.$options.watch || this.$options.justlaunch, watchAllFiles: this.$options.syncAllFiles, + bundle: !!this.$options.bundle, + release: this.$options.release, env: this.$options.env }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index af2b67a0c1..854925e2a1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -74,6 +74,12 @@ "integrity": "sha1-p6/cS+5xPAgRFM2BG1G+EJB9e64=", "dev": true }, + "@types/sinon": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-4.0.0.tgz", + "integrity": "sha512-cuK4xM8Lg2wd8cxshcQa8RG4IK/xfyB6TNE6tNVvkrShR4xdrYgsV04q6Dp6v1Lp6biEFdzD8k8zg/ujQeiw+A==", + "dev": true + }, "@types/source-map": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@types/source-map/-/source-map-0.5.0.tgz", @@ -1468,6 +1474,15 @@ "mime-types": "2.1.15" } }, + "formatio": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", + "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", + "dev": true, + "requires": { + "samsam": "1.3.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3359,6 +3374,12 @@ } } }, + "just-extend": { + "version": "1.1.27", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", + "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -3475,6 +3496,12 @@ "lodash._isiterateecall": "3.0.9" } }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", @@ -3513,6 +3540,12 @@ "streamroller": "0.2.2" } }, + "lolex": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.1.tgz", + "integrity": "sha512-mQuW55GhduF3ppo+ZRUTz1PRjEh1hS5BbqU7d8D0ez2OKxHDod7StPPeAVKisZR5aLkHZjdGWSL42LSONUJsZw==", + "dev": true + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -3733,11 +3766,6 @@ } } }, - "moment": { - "version": "2.10.6", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.10.6.tgz", - "integrity": "sha1-bLIZZ8ecunsMpeZmRPFzZis++nc=" - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3771,6 +3799,27 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz", "integrity": "sha1-ddpKkn7liH45BliABltzNkE7MQ0=" }, + "nise": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.2.0.tgz", + "integrity": "sha512-q9jXh3UNsMV28KeqI43ILz5+c3l+RiNW8mhurEwCKckuHQbL+hTJIKKTiUlCPKlgQ/OukFvSnKB/Jk3+sFbkGA==", + "dev": true, + "requires": { + "formatio": "1.2.0", + "just-extend": "1.1.27", + "lolex": "1.6.0", + "path-to-regexp": "1.7.0", + "text-encoding": "0.6.4" + }, + "dependencies": { + "lolex": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz", + "integrity": "sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY=", + "dev": true + } + } + }, "node-emoji": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.7.0.tgz", @@ -3998,6 +4047,23 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -4177,6 +4243,25 @@ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz", "integrity": "sha1-91kSVfcHq7/yJ8e1a2N9uwNzoQ8=" }, + "proxy-lib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/proxy-lib/-/proxy-lib-0.2.0.tgz", + "integrity": "sha1-xgmTDtxmvz8qoGgKnA1QI6EfjfM=", + "requires": { + "osenv": "0.1.4" + }, + "dependencies": { + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + } + } + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -4499,6 +4584,12 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "dev": true + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -4611,6 +4702,44 @@ "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-0.3.1.tgz", "integrity": "sha1-p61lB/IYzl3+FsS/LWWSRkGeegY=" }, + "sinon": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.1.2.tgz", + "integrity": "sha512-5uLBZPdCWl59Lpbf45ygKj7Z0LVol+ftBe7RDIXOQV/sF58pcFmbK8raA7bt6eljNuGnvBP+/ZxlicVn0emDjA==", + "dev": true, + "requires": { + "diff": "3.4.0", + "formatio": "1.2.0", + "lodash.get": "4.4.2", + "lolex": "2.3.1", + "nise": "1.2.0", + "supports-color": "4.5.0", + "type-detect": "4.0.3" + }, + "dependencies": { + "diff": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, "slice-ansi": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", @@ -4883,6 +5012,12 @@ "rimraf": "2.2.8" } }, + "text-encoding": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", + "dev": true + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index 912d7dfa70..530fe6dfae 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "marked-terminal": "2.0.0", "minimatch": "3.0.2", "mkdirp": "0.5.1", - "moment": "2.10.6", "mute-stream": "0.0.5", "open": "0.0.5", "osenv": "0.1.3", @@ -64,6 +63,7 @@ "plistlib": "0.2.1", "progress-stream": "1.1.1", "properties-parser": "0.2.3", + "proxy-lib": "0.2.0", "qr-image": "3.2.0", "request": "2.81.0", "semver": "5.3.0", @@ -113,6 +113,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=6.0.0 <9.0.0" + "node": ">=6.0.0 <10.0.0" } }