Skip to content

build(deps): update dependencies #5566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions lib/common/definitions/cli-global.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { IInjector } from "./yok";

declare var _: _.LoDashStatic;

declare global {
namespace NodeJS {
interface Global {}
}
}

/**
* Defines additional properties added to global object from CLI.
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/common/file-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class FileSystem implements IFileSystem {
}

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

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

switch (args.length) {
case 0:
resolve();
resolve(void 0);
break;
case 1:
resolve(args[0]);
Expand Down Expand Up @@ -483,7 +483,7 @@ export class FileSystem implements IFileSystem {

public async getFileShasum(
fileName: string,
options?: { algorithm?: string; encoding?: crypto.HexBase64Latin1Encoding }
options?: { algorithm?: string; encoding?: crypto.BinaryToTextEncoding }
): Promise<string> {
return new Promise<string>((resolve, reject) => {
const algorithm = (options && options.algorithm) || "sha1";
Expand Down
12 changes: 8 additions & 4 deletions lib/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function settlePromises<T>(promises: Promise<T>[]): Promise<T[]> {
const length = promises.length;

if (!promises.length) {
resolve();
resolve(void 0);
}

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

return _(results).filter(predicate).flatten().value();
return _(results as any)
.filter(predicate)
.flatten()
.value();
}

/**
Expand Down Expand Up @@ -650,7 +653,7 @@ export async function connectEventually(

export function getHash(
str: string,
options?: { algorithm?: string; encoding?: crypto.HexBase64Latin1Encoding }
options?: { algorithm?: string; encoding?: crypto.BinaryToTextEncoding }
): string {
return crypto
.createHash((options && options.algorithm) || "sha256")
Expand Down Expand Up @@ -845,7 +848,8 @@ export function getFormattedMilliseconds(date: Date): string {

const CLASS_NAME = /class\s+([A-Z].+?)(?:\s+.*?)?\{/;
const CONSTRUCTOR_ARGS = /constructor\s*([^\(]*)\(\s*([^\)]*)\)/m;
const FN_NAME_AND_ARGS = /^(?:function)?\s*([^\(]*)\(\s*([^\)]*)\)\s*(=>)?\s*[{_]/m;
const FN_NAME_AND_ARGS =
/^(?:function)?\s*([^\(]*)\(\s*([^\)]*)\)\s*(=>)?\s*[{_]/m;
const FN_ARG_SPLIT = /,/;
const FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;

Expand Down
32 changes: 15 additions & 17 deletions lib/common/mobile/application-manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import * as _ from "lodash";

export abstract class ApplicationManagerBase
extends EventEmitter
implements Mobile.IDeviceApplicationManager {
implements Mobile.IDeviceApplicationManager
{
private lastInstalledAppIdentifiers: string[];
private lastAvailableDebuggableApps: Mobile.IDeviceApplicationInformation[];
private lastAvailableDebuggableAppViews: IDictionary<
Expand Down Expand Up @@ -65,7 +66,8 @@ export abstract class ApplicationManagerBase
// use locking, so the next executions will not get into the body, while the first one is still working.
// In case we do not break the next executions, we'll report each app as newly installed several times.
try {
const currentlyInstalledAppIdentifiers = await this.getInstalledApplications();
const currentlyInstalledAppIdentifiers =
await this.getInstalledApplications();
const previouslyInstalledAppIdentifiers =
this.lastInstalledAppIdentifiers || [];

Expand Down Expand Up @@ -117,25 +119,23 @@ export abstract class ApplicationManagerBase
}
}

public abstract async installApplication(
public abstract installApplication(
packageFilePath: string,
appIdentifier?: string,
buildData?: IBuildData
): Promise<void>;
public abstract async uninstallApplication(
appIdentifier: string
): Promise<void>;
public abstract async startApplication(
public abstract uninstallApplication(appIdentifier: string): Promise<void>;
public abstract startApplication(
appData: Mobile.IApplicationData
): Promise<void>;
public abstract async stopApplication(
public abstract stopApplication(
appData: Mobile.IApplicationData
): Promise<void>;
public abstract async getInstalledApplications(): Promise<string[]>;
public abstract async getDebuggableApps(): Promise<
public abstract getInstalledApplications(): Promise<string[]>;
public abstract getDebuggableApps(): Promise<
Mobile.IDeviceApplicationInformation[]
>;
public abstract async getDebuggableAppViews(
public abstract getDebuggableAppViews(
appIdentifiers: string[]
): Promise<IDictionary<Mobile.IDebugWebViewInfo[]>>;

Expand Down Expand Up @@ -190,9 +190,8 @@ export abstract class ApplicationManagerBase
_.each(
currentlyAvailableAppViews,
(currentlyAvailableViews, appIdentifier) => {
const previouslyAvailableViews = this.lastAvailableDebuggableAppViews[
appIdentifier
];
const previouslyAvailableViews =
this.lastAvailableDebuggableAppViews[appIdentifier];

const newAvailableViews = _.differenceBy(
currentlyAvailableViews,
Expand Down Expand Up @@ -229,9 +228,8 @@ export abstract class ApplicationManagerBase
}
});

this.lastAvailableDebuggableAppViews[
appIdentifier
] = currentlyAvailableViews;
this.lastAvailableDebuggableAppViews[appIdentifier] =
currentlyAvailableViews;
}
);
}
Expand Down
5 changes: 3 additions & 2 deletions lib/common/mobile/ios/device/ios-device-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { injector } from "../../../yok";

export class IOSDeviceOperations
extends EventEmitter
implements IIOSDeviceOperations, IDisposable, IShouldDispose {
implements IIOSDeviceOperations, IDisposable, IShouldDispose
{
public isInitialized: boolean;
public shouldDispose: boolean;
private deviceLib: IOSDeviceLib.IOSDeviceLib;
Expand Down Expand Up @@ -84,7 +85,7 @@ export class IOSDeviceOperations
}

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

Expand Down
4 changes: 1 addition & 3 deletions lib/common/mobile/ios/ios-device-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice {
}, `ios-debug-socket-${this.deviceInfo.identifier}-${appId}.lock`);
}

protected abstract async getDebugSocketCore(
appId: string
): Promise<net.Socket>;
protected abstract getDebugSocketCore(appId: string): Promise<net.Socket>;

protected async attachToDebuggerFoundEvent(
appId: string,
Expand Down
8 changes: 3 additions & 5 deletions lib/common/test/unit-tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("helpers", () => {
element: any,
passedChunkSize: number
) => {
return new Promise((resolve) =>
return new Promise<void>((resolve) =>
setImmediate(() => {
const remainingElements = _.difference(
initialDataValues,
Expand Down Expand Up @@ -845,14 +845,12 @@ describe("helpers", () => {
expectedOutput: false,
},
{
name:
"returns false when neither -g/--global are passed on terminal, but similar flag is passed",
name: "returns false when neither -g/--global are passed on terminal, but similar flag is passed",
input: ["install", "nativescript", "--globalEnv"],
expectedOutput: false,
},
{
name:
"returns false when neither -g/--global are passed on terminal, but trying to install global package",
name: "returns false when neither -g/--global are passed on terminal, but trying to install global package",
input: ["install", "global"],
expectedOutput: false,
},
Expand Down
Loading