Skip to content
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

chore: Remove on-commit hooks #909

Merged
merged 2 commits into from
Jan 26, 2024
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
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

11 changes: 0 additions & 11 deletions commitlint.config.js

This file was deleted.

20 changes: 11 additions & 9 deletions lib/commands/context/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,17 @@ async function getFreePort() {
* @returns {Promise<object[]>}
*/
async function cdpGetRequest(host, port, endpoint) {
return (await axios({
url: `http://${host}:${port}${endpoint}`,
timeout: CDP_REQ_TIMEOUT,
// We need to set this from Node.js v19 onwards.
// Otherwise, in situation with multiple webviews,
// the preceding webview pages will be incorrectly retrieved as the current ones.
// https://nodejs.org/en/blog/announcements/v19-release-announce#https11-keepalive-by-default
httpAgent: new http.Agent({keepAlive: false}),
})).data;
return (
await axios({
url: `http://${host}:${port}${endpoint}`,
timeout: CDP_REQ_TIMEOUT,
// We need to set this from Node.js v19 onwards.
// Otherwise, in situation with multiple webviews,
// the preceding webview pages will be incorrectly retrieved as the current ones.
// https://nodejs.org/en/blog/announcements/v19-release-announce#https11-keepalive-by-default
httpAgent: new http.Agent({keepAlive: false}),
})
).data;
}

/**
Expand Down
13 changes: 6 additions & 7 deletions lib/commands/device/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@ export async function getDeviceInfoFromCaps() {
continue;
}

const pvMajor = /** @type {semver.SemVer} */ (semverPV).major;
const pvMinor = /** @type {semver.SemVer} */ (semverPV).minor;
const dvMajor = /** @type {semver.SemVer} */ (semverDO).major;
const dvMinor = /** @type {semver.SemVer} */ (semverDO).minor;
if (
((!_.includes(this.opts.platformVersion, '.') &&
/** @type {semver.SemVer} */ (semverPV).major ===
/** @type {semver.SemVer} */ (semverDO).major) ||
(/** @type {semver.SemVer} */ (semverPV).major ===
/** @type {semver.SemVer} */ (semverDO).major &&
/** @type {semver.SemVer} */ (semverPV).minor ===
/** @type {semver.SemVer} */ (semverDO).minor)) &&
((!_.includes(this.opts.platformVersion, '.') && pvMajor === dvMajor) ||
(pvMajor === dvMajor && pvMinor === dvMinor)) &&
// Got a partial match - make sure we consider the most recent
// device version available on the host system
((partialMatchCandidate && semver.gt(deviceOS, _.values(partialMatchCandidate)[0])) ||
Expand Down
1 change: 0 additions & 1 deletion lib/commands/lock/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from './helpers';
import _ from 'lodash';


/**
* @this {AndroidDriver}
* @param {import('../types').LockOpts} opts
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function extractStringsFromResources(language, opts = null) {
app = await this.adb.pullApk(caps.appPackage, tmpRoot);
} catch (e) {
throw new Error(
`Could not extract app strings, failed to pull an apk from '${caps.appPackage}'. Original error: ${e.message}`
`Could not extract app strings, failed to pull an apk from '${caps.appPackage}'. Original error: ${e.message}`,
);
}
}
Expand Down
10 changes: 5 additions & 5 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import {install} from 'source-map-support';
install();

import {AndroidDriver} from './driver';
import { getChromePkg } from './commands/context/helpers';
import { parseArray, requireArgs } from './utils';
import {getChromePkg} from './commands/context/helpers';
import {parseArray, requireArgs} from './utils';
export const utils = {
getChromePkg,
parseArray,
requireArgs,
getChromePkg,
parseArray,
requireArgs,
} as const;
export type * from './commands/types';
export {ANDROID_DRIVER_CONSTRAINTS as commonCapConstraints} from './constraints';
Expand Down
15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,12 @@
"clean": "npm run build -- --clean",
"dev": "npm run build -- --watch",
"lint": "eslint .",
"lint:commit": "commitlint",
"lint:fix": "npm run lint -- --fix",
"lint:staged": "lint-staged",
"prepare": "husky install; npm run rebuild",
"prepare": "npm run rebuild",
"rebuild": "npm run clean; npm run build",
"format": "prettier -w ./lib",
"test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.js\""
},
"lint-staged": {
"*.(js|ts)": [
"eslint --fix",
"prettier --write"
]
},
"prettier": {
"bracketSpacing": false,
"printWidth": 100,
Expand Down Expand Up @@ -80,8 +73,6 @@
"@appium/test-support": "^3.0.20",
"@appium/tsconfig": "^0.x",
"@appium/types": "^0.x",
"@commitlint/cli": "^18.0.0",
"@commitlint/config-conventional": "^18.0.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/bluebird": "^3.5.38",
Expand Down Expand Up @@ -110,8 +101,6 @@
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-promise": "^6.1.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.1",
"mocha": "^10.0.0",
"prettier": "^3.0.1",
"rimraf": "^5.0.0",
Expand Down
Loading