Skip to content

Fix 'ERESOLVE' errors of the 'npm i' command #7033

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

Merged
merged 2 commits into from
May 17, 2022
Merged
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
21 changes: 18 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,25 @@
"linebreak-style": [2, "unix"],
"no-duplicate-imports": 2,
"comma-dangle": ["error", "always-multiline"],
"prefer-rest-params": 0,
"prefer-spread": 0,
"@typescript-eslint/no-extra-parens": 2,
"@typescript-eslint/no-use-before-define": [2, "nofunc"],
"@typescript-eslint/no-var-requires": [0],
"@typescript-eslint/explicit-function-return-type": [2, { "allowExpressions": true }],
"@typescript-eslint/no-unused-vars": 2
}
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-this-alias": 0
},
overrides: [
{
files: ["*.ts"],
rules: {
"@typescript-eslint/explicit-function-return-type": [2, { "allowExpressions": true }],
"@typescript-eslint/no-empty-function": 2,
"prefer-spread": 2,
"@typescript-eslint/ban-ts-ignore": 0
}
}
]
}
38 changes: 19 additions & 19 deletions .github/workflows/deploy-to-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on:
workflow_dispatch:
inputs:
sha:
description: 'The commit ref or SHA'
description: 'The commit ref or SHA'
required: true
default: 'master'
merged_sha:
description: 'The merge commit SHA'
description: 'The merge commit SHA'
base_sha:
description: 'The base commit SHA'
jobs:
description: 'The base commit SHA'

jobs:
build:
runs-on: ubuntu-latest
outputs:
sha: ${{steps.prep.outputs.sha}}
sha: ${{steps.prep.outputs.sha}}
steps:
- name: Build Info
run: |
Expand All @@ -39,21 +39,21 @@ jobs:
uses: actions/github-script@v3
with:
github-token: ${{ secrets.ACTIVE_TOKEN }}
script: |
script: |
core.setOutput('sha', context.payload.inputs.merged_sha || context.payload.inputs.sha);
- uses: actions/checkout@v2
with:
ref: ${{steps.prep.outputs.sha}}
- run: |
npm i --legacy-peer-deps
npm i
npx gulp build
npm pack
- id: package-name
uses: actions/github-script@v3
with:
script: |
const { name, version } = require(require('path').join(process.env.GITHUB_WORKSPACE, 'package.json'));

core.setOutput('packageName', `${name}-${version}`);
core.setOutput('imageName', `${name}/${name}:${version}`);

Expand All @@ -65,7 +65,7 @@ jobs:
package-lock.json
- run: |
npx gulp docker-build
docker save -o ${{steps.package-name.outputs.packageName}}.tar ${{steps.package-name.outputs.imageName}}
docker save -o ${{steps.package-name.outputs.packageName}}.tar ${{steps.package-name.outputs.imageName}}
- uses: actions/upload-artifact@v2
with:
name: docker
Expand All @@ -82,7 +82,7 @@ jobs:
context: context.workflow,
state: 'failure',
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
});
});
changes:
# TODO: currently cannot generate a list of changes after rebase
runs-on: ubuntu-latest
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build, changes]
environment: CI
steps:
steps:
- uses: actions/download-artifact@v2
with:
name: changes
Expand All @@ -137,7 +137,7 @@ jobs:
script: |
function getInputs () {
const { sha, merged_sha } = context.payload.inputs;

return {
...merged_sha ? { merged_sha } : {},
sha,
Expand All @@ -154,12 +154,12 @@ jobs:
inputs: getInputs()
});
}

// TODO: Optimize by running only necessary tests for corresponding changes
const fileList = require('fs').readFileSync('changes.txt').toString().split('\n').filter(line => line);

const tasks = [];

tasks.push('test-client-desktop.yml');
tasks.push('test-client-mobile.yml');

Expand All @@ -176,11 +176,11 @@ jobs:

tasks.push('test-functional-remote-macos.yml');
tasks.push('test-functional-remote-mobile.yml');

tasks.push('test-server-docker.yml');
tasks.push('test-server-lts.yml');
tasks.push('test-server-stable.yml');

// Temporary disable
// tasks.push('test-cdp.yml');

Expand Down Expand Up @@ -209,4 +209,4 @@ jobs:
context: context.workflow,
state: 'failure',
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
});
});
2 changes: 1 addition & 1 deletion .github/workflows/test-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm i --legacy-peer-deps --package-lock-only
- run: npm i --package-lock-only
- run: npm audit --production
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
"@types/semver": "^7.3.4",
"@types/source-map-support": "^0.5.0",
"@types/useragent": "^2.1.1",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "^3.10.1",
"@typescript-eslint/eslint-plugin": "2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"babel-plugin-add-module-exports": "^0.2.0",
"basic-auth": "^1.1.0",
"body-parser": "^1.17.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class BrowserClient {
});
}

private async _evaluateRuntime (client: remoteChrome.ProtocolApi, expression: string, returnByValue: boolean = false): Promise<Protocol.Runtime.EvaluateResponse> {
private async _evaluateRuntime (client: remoteChrome.ProtocolApi, expression: string, returnByValue = false): Promise<Protocol.Runtime.EvaluateResponse> {
return client.Runtime.evaluate({ expression, returnByValue });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ initializeAdapter({
createMouseClickStrategy,
},

_ensureWindowAndCursorForLegacyTests () {
_ensureWindowAndCursorForLegacyTests () { // eslint-disable-line no-empty-function
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ interface ChromeCdpEventSequenceEventOptions {
}

class ChromeCdpEventSequence {
public constructor () {
}

public async run (currentElement: ServerNode, prevElement: ServerNode, options: ChromeCdpEventSequenceEventOptions): Promise<void> {
const { Input } = clientsManager.getClient();

Expand Down
2 changes: 1 addition & 1 deletion src/client/core/shared-adapter-initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ initializeAdapter({
createMouseClickStrategy: () => new MouseClickStrategyEmpty(),
},

_ensureWindowAndCursorForLegacyTests () {
_ensureWindowAndCursorForLegacyTests () { // eslint-disable-line no-empty-function
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class ClientFunctionNodeTransform implements Transform {
return false;
}

public toSerializable (): void {
public toSerializable (): void { // eslint-disable-line @typescript-eslint/no-empty-function
}

public fromSerializable (): void {
public fromSerializable (): void { // eslint-disable-line @typescript-eslint/no-empty-function
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default class SelectorElementActionTransform implements Transform {
return new ElementActionSnapshot(node);
}

public fromSerializable (): void {
public fromSerializable (): void { // eslint-disable-line @typescript-eslint/no-empty-function
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export default class SelectorNodeTransform implements Transform {
return snapshot;
}

public fromSerializable (): void {
public fromSerializable (): void { // eslint-disable-line no-empty-function
}
}
2 changes: 1 addition & 1 deletion src/client/driver/shared-adapter-initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ initializeAdapter({
createMouseClickStrategy: () => new MouseClickStrategyEmpty(),
},

_ensureWindowAndCursorForLegacyTests () {
_ensureWindowAndCursorForLegacyTests () { // eslint-disable-line no-empty-function
},
},
});
2 changes: 1 addition & 1 deletion src/errors/is-internal-stack-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const INTERNAL_INCLUDES_PATH_SEGMENTS = [
TESTCAFE_HAMMERHEAD,
];

function isInternalFile (filename: string = ''): boolean {
function isInternalFile (filename = ''): boolean {
return !filename ||
!filename.includes(sep) ||
INTERNAL_INCLUDES_PATH_SEGMENTS.some(pathSegment => filename.includes(pathSegment)) ||
Expand Down
2 changes: 1 addition & 1 deletion src/live/keyboard-observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let instance: LiveModeKeyboardEventObserver;

export default class LiveModeKeyboardEventObserver {
private controllers: LiveModeController[] = [];
private lockKeyPress: boolean = false;
private lockKeyPress = false;

public constructor () {
if (!instance) {
Expand Down
2 changes: 1 addition & 1 deletion src/notifications/warning-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class WarningLog {
args = [message].concat(args);

// @ts-ignore
message = renderTemplate.apply(null, args);
message = renderTemplate.apply(null, args); // eslint-disable-line prefer-spread

this.addPlainMessage({ message, actionId });

Expand Down
2 changes: 1 addition & 1 deletion src/reporter/command/command-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class CommandFormatter {
this._elements = Array.isArray(decoded) ? decoded : [decoded];
}

private static _getModifiedOptions (commandOptions: object): Dictionary<object> | null {
private static _getModifiedOptions (commandOptions: object): Dictionary<object> {
const constructor = commandOptions.constructor as ObjectConstructor;
const defaultOptions = new constructor();

Expand Down
5 changes: 3 additions & 2 deletions src/reporter/plugin-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ export default class ReporterPluginHost {
}

// NOTE: It's an optional method
public async init (): Promise<void> {
public async init (): Promise<void> { // eslint-disable-line @typescript-eslint/no-empty-function
// Optional
}

// NOTE: It's an optional method
public async reportWarnings (/* warnings */): Promise<void> {
public async reportWarnings (/* warnings */): Promise<void> { // eslint-disable-line @typescript-eslint/no-empty-function
}
}
2 changes: 1 addition & 1 deletion src/services/compiler/test-run-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TestRunProxy extends AsyncEventEmitter {
public readonly observedCallsites: ObservedCallsitesStorage;
public readonly warningLog: WarningLog;
public fixtureCtx: object;
public debugging: boolean = false;
public debugging = false;
private readonly dispatcher: TestRunDispatcherProtocol;
public ctx: object;
private readonly _options: Dictionary<OptionValue>;
Expand Down
2 changes: 1 addition & 1 deletion src/services/utils/ipc/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface RequestOptions {

export class IPCProxy extends EventEmitter {
private _transport: IPCTransport;
private _requestCounter: number = 0;
private _requestCounter = 0;
private readonly _handlers: { [name: string]: Function };
private _stopped: boolean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { MouseEventArgs } from '../visible-element-automation';

export abstract class MouseClickStrategyBase<E> {
public constructor () {
}

public abstract mousedown (eventArgs: MouseEventArgs<E>): Promise<void>;

public abstract mouseup (element: E, eventArgs: MouseEventArgs<E>): Promise<MouseEventArgs<E>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default class VisibleElementAutomation<E, W extends SharedWindow> extends
return state;
}

protected _ensureElement (useStrictElementCheck: boolean, skipCheckAfterMoving: boolean = false, skipMoving: boolean = false): Promise<ElementStateArgsBase<E>> {
protected _ensureElement (useStrictElementCheck: boolean, skipCheckAfterMoving = false, skipMoving = false): Promise<ElementStateArgsBase<E>> {
return this
._wrapAction(() => this._scrollToElement())
.then(state => VisibleElementAutomation._checkElementState(state, useStrictElementCheck))
Expand Down
2 changes: 1 addition & 1 deletion src/shared/barriers/script-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class ScriptExecutionBarrier<S> {
this._scripts.set(script, loadingTimeout);
}

private _onScriptLoadedOrFailed (script: S, isTimeout: boolean = false): void {
private _onScriptLoadedOrFailed (script: S, isTimeout = false): void {
if (!this._scripts.has(script))
return;

Expand Down
2 changes: 1 addition & 1 deletion src/test-run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default class TestRun extends AsyncEventEmitter {
private asyncJsExpressionCallsites: Map<string, CallsiteRecord>;
public readonly browser: Browser;
private readonly _messageBus?: MessageBus;
private _clientEnvironmentPrepared: boolean = false;
private _clientEnvironmentPrepared = false;
public readonly startRunExecutionTime?: Date;

public constructor ({ test, browserConnection, screenshotCapturer, globalWarningLog, opts, compilerService, messageBus, startRunExecutionTime }: TestRunInit) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getFullPropertyPath (property: string, parentProperty: string): string
return property;
}

function diff (source: Dictionary<object>, modified: Dictionary<object>, result: Dictionary<object>, parentProperty: string = ''): void {
function diff (source: Dictionary<object>, modified: Dictionary<object>, result: Dictionary<object>, parentProperty = ''): void {
for (const property in source) {
const fullPropertyPath = getFullPropertyPath(property, parentProperty);

Expand All @@ -27,7 +27,7 @@ function diff (source: Dictionary<object>, modified: Dictionary<object>, result:
}
}

export default (source: Dictionary<object>, modified: Dictionary<object>) => {
export default (source: Dictionary<object>, modified: Dictionary<object>): Dictionary<object> => {
const result = {};

if (isObjectLike(source) && isObjectLike(modified))
Expand Down
2 changes: 1 addition & 1 deletion src/utils/parse-user-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function calculatePrettyUserAgent (browser: ParsedComponent, os: ParsedComponent
return `${browser.name} ${browser.version} / ${os.name} ${os.version}`;
}

export default function parseUserAgent (userAgent: string = ''): ParsedUserAgent {
export default function parseUserAgent (userAgent = ''): ParsedUserAgent {
const parsedUserAgent = userAgent ? Bowser.parse(userAgent) : EMPTY_PARSED_USER_AGENT;
const browser = calculateBrowser(parsedUserAgent.browser);
const os = calculateOs(parsedUserAgent.os);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/to-posix-path.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sep, posix } from 'path';

export default function (val: string = ''): string {
export default function (val = ''): string {
return val.split(sep)
.join(posix.sep);
}