Skip to content

Commit 81ed843

Browse files
authored
chore(deps): bump yargs and typescript (#5629)
1 parent 02d179a commit 81ed843

14 files changed

+238
-318
lines changed

lib/common/file-system.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class FileSystem implements IFileSystem {
174174
}
175175

176176
public async futureFromEvent(eventEmitter: any, event: string): Promise<any> {
177-
return new Promise((resolve, reject) => {
177+
return new Promise<any>((resolve, reject) => {
178178
eventEmitter.once(event, function () {
179179
const args = _.toArray(arguments);
180180

@@ -186,7 +186,7 @@ export class FileSystem implements IFileSystem {
186186

187187
switch (args.length) {
188188
case 0:
189-
resolve();
189+
resolve(undefined);
190190
break;
191191
case 1:
192192
resolve(args[0]);

lib/common/helpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function settlePromises<T>(promises: Promise<T>[]): Promise<T[]> {
198198
const length = promises.length;
199199

200200
if (!promises.length) {
201-
resolve();
201+
resolve(null);
202202
}
203203

204204
_.forEach(promises, (currentPromise, index) => {
@@ -491,7 +491,7 @@ export async function getFuturesResults<T>(
491491
): Promise<T[] | T[][]> {
492492
const results = await Promise.all(promises);
493493

494-
return _(results).filter(predicate).flatten().value();
494+
return _(results).filter(predicate).flatten().value() as T[] | T[][];
495495
}
496496

497497
/**

lib/common/mobile/application-manager-base.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,25 @@ export abstract class ApplicationManagerBase
117117
}
118118
}
119119

120-
public abstract async installApplication(
120+
public abstract installApplication(
121121
packageFilePath: string,
122122
appIdentifier?: string,
123123
buildData?: IBuildData
124124
): Promise<void>;
125-
public abstract async uninstallApplication(
125+
public abstract uninstallApplication(
126126
appIdentifier: string
127127
): Promise<void>;
128-
public abstract async startApplication(
128+
public abstract startApplication(
129129
appData: Mobile.IApplicationData
130130
): Promise<void>;
131-
public abstract async stopApplication(
131+
public abstract stopApplication(
132132
appData: Mobile.IApplicationData
133133
): Promise<void>;
134-
public abstract async getInstalledApplications(): Promise<string[]>;
135-
public abstract async getDebuggableApps(): Promise<
134+
public abstract getInstalledApplications(): Promise<string[]>;
135+
public abstract getDebuggableApps(): Promise<
136136
Mobile.IDeviceApplicationInformation[]
137137
>;
138-
public abstract async getDebuggableAppViews(
138+
public abstract getDebuggableAppViews(
139139
appIdentifiers: string[]
140140
): Promise<IDictionary<Mobile.IDebugWebViewInfo[]>>;
141141

lib/common/mobile/ios/device/ios-device-operations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class IOSDeviceOperations
8484
}
8585

8686
// We need this because we need to make sure that we have devices.
87-
await new Promise((resolve, reject) => {
87+
await new Promise<void>((resolve, reject) => {
8888
let iterationsCount = 0;
8989
const maxIterationsCount = 3;
9090

lib/common/mobile/ios/ios-device-base.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice {
5757
}, `ios-debug-socket-${this.deviceInfo.identifier}-${appId}.lock`);
5858
}
5959

60-
protected abstract async getDebugSocketCore(
60+
protected abstract getDebugSocketCore(
6161
appId: string
6262
): Promise<net.Socket>;
6363

lib/common/test/unit-tests/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe("helpers", () => {
9999
element: any,
100100
passedChunkSize: number
101101
) => {
102-
return new Promise((resolve) =>
102+
return new Promise<void>((resolve) =>
103103
setImmediate(() => {
104104
const remainingElements = _.difference(
105105
initialDataValues,

lib/common/test/unit-tests/mobile/devices-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function resetDefaultSetInterval(): void {
300300
}
301301

302302
async function assertOnNextTick(assertionFunction: Function): Promise<void> {
303-
await new Promise((resolve) => {
303+
await new Promise<void>((resolve) => {
304304
setTimeout(() => {
305305
assertionFunction();
306306
resolve();

lib/options.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as helpers from "./common/helpers";
2-
import * as yargs from "yargs";
2+
import * as yargs from 'yargs';
3+
import { hideBin } from 'yargs/helpers';
34
import * as _ from "lodash";
45
import {
56
IDictionary,
@@ -366,9 +367,9 @@ export class Options {
366367
opts[this.getDashedOptionName(key)] = value;
367368
});
368369

369-
const parsed = yargs(process.argv.slice(2)).version(false).help(false);
370-
this.initialArgv = parsed.argv;
371-
this.argv = parsed.options(<any>opts).argv;
370+
const parsed = yargs(hideBin(process.argv)).version(false).help(false);
371+
this.initialArgv = parsed.argv as any;
372+
this.argv = parsed.options(<any>opts).argv as any;
372373

373374
// For backwards compatibility
374375
// Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result.

lib/services/debug-service-base.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export abstract class DebugServiceBase
1818

1919
public abstract get platform(): string;
2020

21-
public abstract async debug(
21+
public abstract debug(
2222
debugData: IDebugData,
2323
debugOptions: IDebugOptions
2424
): Promise<IDebugResultInfo>;
2525

26-
public abstract async debugStop(): Promise<void>;
26+
public abstract debugStop(): Promise<void>;
2727

2828
protected getCanExecuteAction(
2929
deviceIdentifier: string

lib/services/livesync/android-device-livesync-service-base.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ export abstract class AndroidDeviceLiveSyncServiceBase extends DeviceLiveSyncSer
1717
super($platformsDataService, device);
1818
}
1919

20-
public abstract async transferFilesOnDevice(
20+
public abstract transferFilesOnDevice(
2121
deviceAppData: Mobile.IDeviceAppData,
2222
localToDevicePaths: Mobile.ILocalToDevicePathData[]
2323
): Promise<void>;
24-
public abstract async transferDirectoryOnDevice(
24+
public abstract transferDirectoryOnDevice(
2525
deviceAppData: Mobile.IDeviceAppData,
2626
localToDevicePaths: Mobile.ILocalToDevicePathData[],
2727
projectFilesPath: string

lib/services/livesync/android-livesync-tool.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool {
292292
await this.writeToSocket(hash);
293293
}
294294

295-
private sendFileContent(filePath: string): Promise<boolean> {
295+
private sendFileContent(filePath: string): Promise<void> {
296296
return new Promise((resolve, reject) => {
297297
if (!this.verifyActiveConnection(reject)) {
298298
return;

0 commit comments

Comments
 (0)