Compare commits

...
72 changed files with 397 additions and 100 deletions
+297 -4
View File
@@ -212,9 +212,9 @@
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.25.9",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
"version": "7.28.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -6291,6 +6291,15 @@
"version": "1.0.0",
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
"version": "2.9.15",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.15.tgz",
"integrity": "sha512-kX8h7K2srmDyYnXRIppo4AH/wYgzWVCs+eKr3RusRSQ5PvRYoEFmR/I0PbdTjKFAoKqp5+kbxnNTFO9jOfSVJg==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.js"
}
},
"node_modules/basic-auth": {
"version": "2.0.1",
"license": "MIT",
@@ -6599,6 +6608,39 @@
"pako": "~1.0.5"
}
},
"node_modules/browserslist": {
"version": "4.28.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
"integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
"electron-to-chromium": "^1.5.263",
"node-releases": "^2.0.27",
"update-browserslist-db": "^1.2.0"
},
"bin": {
"browserslist": "cli.js"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/buffer": {
"version": "5.7.1",
"funding": [
@@ -6638,6 +6680,18 @@
"dev": true,
"license": "MIT"
},
"node_modules/builtin-modules": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz",
"integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==",
"license": "MIT",
"engines": {
"node": ">=18.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/builtin-status-codes": {
"version": "3.0.0",
"dev": true,
@@ -6919,6 +6973,26 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001764",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz",
"integrity": "sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0"
},
"node_modules/chai": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
@@ -6972,6 +7046,12 @@
"node": ">=4"
}
},
"node_modules/change-case": {
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz",
"integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==",
"license": "MIT"
},
"node_modules/chardet": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz",
@@ -7082,6 +7162,18 @@
"node": ">= 0.10"
}
},
"node_modules/clean-regexp": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz",
"integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==",
"license": "MIT",
"dependencies": {
"escape-string-regexp": "^1.0.5"
},
"engines": {
"node": ">=4"
}
},
"node_modules/clean-stack": {
"version": "2.2.0",
"dev": true,
@@ -7671,6 +7763,19 @@
"hasInstallScript": true,
"license": "MIT"
},
"node_modules/core-js-compat": {
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.47.0.tgz",
"integrity": "sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==",
"license": "MIT",
"dependencies": {
"browserslist": "^4.28.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/core-util-is": {
"version": "1.0.2",
"license": "MIT"
@@ -8591,6 +8696,12 @@
"node": ">=0.10.0"
}
},
"node_modules/electron-to-chromium": {
"version": "1.5.267",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz",
"integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==",
"license": "ISC"
},
"node_modules/elliptic": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz",
@@ -8796,7 +8907,6 @@
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.8.0"
@@ -9239,6 +9349,104 @@
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
}
},
"node_modules/eslint-plugin-unicorn": {
"version": "62.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-62.0.0.tgz",
"integrity": "sha512-HIlIkGLkvf29YEiS/ImuDZQbP12gWyx5i3C6XrRxMvVdqMroCI9qoVYCoIl17ChN+U89pn9sVwLxhIWj5nEc7g==",
"license": "MIT",
"dependencies": {
"@babel/helper-validator-identifier": "^7.28.5",
"@eslint-community/eslint-utils": "^4.9.0",
"@eslint/plugin-kit": "^0.4.0",
"change-case": "^5.4.4",
"ci-info": "^4.3.1",
"clean-regexp": "^1.0.0",
"core-js-compat": "^3.46.0",
"esquery": "^1.6.0",
"find-up-simple": "^1.0.1",
"globals": "^16.4.0",
"indent-string": "^5.0.0",
"is-builtin-module": "^5.0.0",
"jsesc": "^3.1.0",
"pluralize": "^8.0.0",
"regexp-tree": "^0.1.27",
"regjsparser": "^0.13.0",
"semver": "^7.7.3",
"strip-indent": "^4.1.1"
},
"engines": {
"node": "^20.10.0 || >=21.0.0"
},
"funding": {
"url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1"
},
"peerDependencies": {
"eslint": ">=9.38.0"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/ci-info": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz",
"integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/sibiraj-s"
}
],
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/globals": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz",
"integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/indent-string": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",
"integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==",
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/semver": {
"version": "7.7.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/strip-indent": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.1.1.tgz",
"integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==",
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint-rule-docs": {
"version": "1.1.235",
"dev": true,
@@ -11198,6 +11406,21 @@
"dev": true,
"license": "MIT"
},
"node_modules/is-builtin-module": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz",
"integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==",
"license": "MIT",
"dependencies": {
"builtin-modules": "^5.0.0"
},
"engines": {
"node": ">=18.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-bun-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz",
@@ -11667,6 +11890,18 @@
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
"license": "MIT"
},
"node_modules/jsesc": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
"integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
"license": "MIT",
"bin": {
"jsesc": "bin/jsesc"
},
"engines": {
"node": ">=6"
}
},
"node_modules/jsftp": {
"version": "2.1.3",
"license": "MIT",
@@ -14287,6 +14522,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/node-releases": {
"version": "2.0.27",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
"integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",
"license": "MIT"
},
"node_modules/nopt": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz",
@@ -16697,6 +16938,27 @@
"node": ">=8"
}
},
"node_modules/regexp-tree": {
"version": "0.1.27",
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz",
"integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==",
"license": "MIT",
"bin": {
"regexp-tree": "bin/regexp-tree"
}
},
"node_modules/regjsparser": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.0.tgz",
"integrity": "sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==",
"license": "BSD-2-Clause",
"dependencies": {
"jsesc": "~3.1.0"
},
"bin": {
"regjsparser": "bin/parser"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"license": "MIT",
@@ -19096,6 +19358,36 @@
"yarn": "*"
}
},
"node_modules/update-browserslist-db": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
"integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"escalade": "^3.2.0",
"picocolors": "^1.1.1"
},
"bin": {
"update-browserslist-db": "cli.js"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
}
},
"node_modules/uri-js": {
"version": "4.4.1",
"license": "BSD-2-Clause",
@@ -20687,6 +20979,7 @@
"eslint-plugin-mocha": "11.2.0",
"eslint-plugin-n": "17.23.2",
"eslint-plugin-promise": "7.2.1",
"eslint-plugin-unicorn": "62.0.0",
"typescript-eslint": "8.53.0"
},
"engines": {
+1 -1
View File
@@ -20,7 +20,7 @@ const {
DOCS_REMOTE,
LATEST_ALIAS,
} = require('./utils');
const path = require('path');
const path = require('node:path');
const semver = require('semver');
const {version} = require('../../package.json');
@@ -3,7 +3,7 @@
/* eslint-disable promise/prefer-await-to-callbacks */
/* eslint-disable promise/prefer-await-to-then */
const path = require('path');
const path = require('node:path');
const {fs} = require('@appium/support');
const {AppiumConfigJsonSchema} = require('@appium/schema');
+1 -1
View File
@@ -3,7 +3,7 @@
// for simplicity this file is not transpiled and is run directly via an npm script
//
const {logger} = require('@appium/support');
const path = require('path');
const path = require('node:path');
const log = logger.getLogger('Docs');
+3 -3
View File
@@ -1,6 +1,6 @@
import B from 'bluebird';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {npm, util, env, console, fs, system} from '@appium/support';
import {spinWith, RingBuffer} from './utils';
import {
@@ -12,9 +12,9 @@ import {
} from '../extension/extension-config';
import {SubProcess} from 'teen_process';
import {packageDidChange} from '../extension/package-changed';
import {spawn} from 'child_process';
import {spawn} from 'node:child_process';
import {inspect} from 'node:util';
import {pathToFileURL} from 'url';
import {pathToFileURL} from 'node:url';
import {Doctor, EXIT_CODE as DOCTOR_EXIT_CODE} from '../doctor/doctor';
import {getAppiumModuleRoot, npmPackage} from '../utils';
import * as semver from 'semver';
+1 -1
View File
@@ -1,7 +1,7 @@
import {fs} from '@appium/support';
import {ArgumentParser} from 'argparse';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {
DRIVER_TYPE,
EXT_SUBCOMMAND_DOCTOR,
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
/**
* The name of the extension type for drivers
@@ -1,7 +1,7 @@
import {util, fs, system} from '@appium/support';
import B from 'bluebird';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import resolveFrom from 'resolve-from';
import {satisfies} from 'semver';
import {commandClasses} from '../cli/extension';
@@ -12,7 +12,7 @@ import {
isAllowedSchemaFileExtension,
registerSchema,
} from '../schema/schema';
import { pathToFileURL } from 'url';
import { pathToFileURL } from 'node:url';
const DEFAULT_ENTRY_POINT = 'index.js';
/**
+1 -1
View File
@@ -5,7 +5,7 @@
import B from 'bluebird';
import {env, fs} from '@appium/support';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import * as YAML from 'yaml';
import {CURRENT_SCHEMA_REV, DRIVER_TYPE, PLUGIN_TYPE} from '../constants';
import {INSTALL_TYPE_NPM, INSTALL_TYPE_DEV} from './extension-config';
@@ -1,6 +1,6 @@
import {fs} from '@appium/support';
import {isPackageChanged} from 'package-changed';
import path from 'path';
import path from 'node:path';
import {PKG_HASHFILE_RELATIVE_PATH} from '../constants';
import log from '../logger';
@@ -1,5 +1,5 @@
import {ArgumentTypeError} from 'argparse';
import {readFileSync, existsSync} from 'fs';
import {readFileSync, existsSync} from 'node:fs';
/**
* This module provides custom keywords for Appium schemas, as well as
+1 -1
View File
@@ -1,7 +1,7 @@
import {Ajv} from 'ajv';
import addFormats from 'ajv-formats';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {DRIVER_TYPE, PLUGIN_TYPE} from '../constants';
import {AppiumConfigJsonSchema} from '@appium/schema';
import {APPIUM_CONFIG_SCHEMA_ID, ArgSpec, SERVER_PROP_NAME} from './arg-spec';
+3 -3
View File
@@ -6,9 +6,9 @@ import {
errors,
isW3cCaps,
} from '@appium/base-driver';
import {inspect as dump} from 'util';
import {inspect as dump} from 'node:util';
import {node, fs} from '@appium/support';
import path from 'path';
import path from 'node:path';
import {SERVER_SUBCOMMAND, DRIVER_TYPE, PLUGIN_TYPE, SETUP_SUBCOMMAND} from './constants';
import os from 'node:os';
@@ -229,7 +229,7 @@ export function adjustNodePath() {
// See https://gist.github.com/branneman/8048520#7-the-hack
// @ts-ignore see above comment
require('module').Module._initPaths();
require('node:module').Module._initPaths();
return true;
} catch {
return false;
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const path = require('path');
const childProcess = require('child_process');
const path = require('node:path');
const childProcess = require('node:child_process');
const _ = require('lodash');
const res = JSON.parse(
@@ -2,7 +2,7 @@
// @ts-check
const path = require('path');
const path = require('node:path');
const yaml = require('yaml');
const {fs, util, logger} = require('@appium/support');
const Handlebars = require('handlebars');
@@ -2,7 +2,7 @@
import {exec} from 'teen_process';
import {fs, system, tempDir, util} from '@appium/support';
import path from 'path';
import path from 'node:path';
import resolveFrom from 'resolve-from';
import {
DRIVER_TYPE,
+1 -1
View File
@@ -6,7 +6,7 @@
import {console, fs} from '@appium/support';
import '@colors/colors';
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {exec} from 'teen_process';
import {APPIUM_ROOT, resolveFixture} from '../helpers';
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-check
import {fs, tempDir} from '@appium/support';
import path from 'path';
import path from 'node:path';
import {DRIVER_TYPE} from '../../lib/constants';
import {resolveFixture} from '../helpers';
import {installLocalExtension, runAppium} from './e2e-helpers';
+1 -1
View File
@@ -1,7 +1,7 @@
// @ts-check
import getPort from 'get-port';
import path from 'path';
import path from 'node:path';
import rewiremock, {addPlugin, overrideEntryPoint, plugins} from 'rewiremock';
import {insertAppiumPrefixes} from '../lib/utils';
@@ -1,6 +1,6 @@
// @ts-check
import fs from 'fs';
import fs from 'node:fs';
import {createSandbox} from 'sinon';
import * as YAML from 'yaml';
import * as schema from '../../lib/schema/schema';
@@ -1,6 +1,6 @@
// @ts-check
import {promises as fs} from 'fs';
import {promises as fs} from 'node:fs';
import {Manifest} from '../../../lib/extension/manifest';
import {resetSchema} from '../../../lib/schema';
import {resolveFixture, rewiremock} from '../../helpers';
@@ -1,5 +1,5 @@
import {DRIVER_TYPE} from '../../../lib/constants';
import path from 'path';
import path from 'node:path';
import {version as APPIUM_VER} from '../../../package.json';
import {FAKE_DRIVER_DIR, PROJECT_ROOT, rewiremock} from '../../helpers';
import {initMocks} from './mocks';
@@ -1,11 +1,11 @@
// @ts-check
import B from 'bluebird';
import {promises as fs} from 'fs';
import {promises as fs} from 'node:fs';
import {DRIVER_TYPE, PLUGIN_TYPE} from '../../../lib/constants';
import {resolveFixture, rewiremock} from '../../helpers';
import {initMocks} from './mocks';
import {version as APPIUM_VER} from '../../../package.json';
import EventEmitter from 'events';
import EventEmitter from 'node:events';
describe('Manifest', function () {
/**
+2 -2
View File
@@ -5,8 +5,8 @@
* A collection of mocks reused across unit tests.
*/
import {EventEmitter} from 'events';
import path from 'path';
import {EventEmitter} from 'node:events';
import path from 'node:path';
import {createSandbox} from 'sinon';
import {version as APPIUM_VER} from '../../../package.json';
@@ -1,5 +1,5 @@
// @ts-check
import path from 'path';
import path from 'node:path';
import {PKG_HASHFILE_RELATIVE_PATH} from '../../../lib/constants';
import {rewiremock} from '../../helpers';
import {initMocks} from './mocks';
@@ -1,6 +1,6 @@
// @ts-check
import {promises as fs} from 'fs';
import {promises as fs} from 'node:fs';
import {Manifest} from '../../../lib/extension/manifest';
import {resetSchema} from '../../../lib/schema';
import {resolveFixture, rewiremock} from '../../helpers';
@@ -1,5 +1,5 @@
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import logger from './logger';
import {tempDir, fs, util, timing, node} from '@appium/support';
import { LRUCache } from 'lru-cache';
@@ -1,7 +1,7 @@
import log from './logger';
import { LRUCache } from 'lru-cache';
import _ from 'lodash';
import {EventEmitter} from 'events';
import {EventEmitter} from 'node:events';
const IDEMPOTENT_RESPONSES = new LRUCache({
max: 64,
+2 -2
View File
@@ -1,7 +1,7 @@
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import express from 'express';
import http from 'http';
import http from 'node:http';
import favicon from 'serve-favicon';
import bodyParser from 'body-parser';
import methodOverride from 'method-override';
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import log from './logger';
import _ from 'lodash';
import {fs} from '@appium/support';
@@ -12,8 +12,8 @@ import {isSessionCommand, routeToCommandName} from '../protocol';
import {MAX_LOG_BODY_LENGTH, DEFAULT_BASE_PATH, PROTOCOLS} from '../constants';
import ProtocolConverter from './protocol-converter';
import {formatResponseValue, ensureW3cResponse} from '../protocol/helpers';
import http from 'http';
import https from 'https';
import http from 'node:http';
import https from 'node:https';
import { match as pathToRegexMatch } from 'path-to-regexp';
import nodeUrl from 'node:url';
import { ProxyRequest } from './proxy-request';
@@ -1,7 +1,7 @@
import path from 'path';
import path from 'node:path';
import {fs} from '@appium/support';
import {configureApp} from '../../../lib/basedriver/helpers';
import http from 'http';
import http from 'node:http';
import finalhandler from 'finalhandler';
import serveStatic from 'serve-static';
import contentDisposition from 'content-disposition';
@@ -2,7 +2,7 @@ import {errors, errorFromMJSONWPStatusCode, errorFromW3CJsonCode, isErrorType} f
import {BadParametersError, getResponseForW3CError} from '../../../lib/protocol/errors';
import _ from 'lodash';
import {StatusCodes as HTTPStatusCodes} from 'http-status-codes';
import path from 'path';
import path from 'node:path';
const basename = path.basename(__filename);
@@ -1,6 +1,6 @@
import _ from 'lodash';
import {METHOD_MAP, routeToCommandName} from '../../../lib/protocol';
import crypto from 'crypto';
import crypto from 'node:crypto';
describe('Routes', function () {
// TODO test against an explicit protocol rather than a hash of a previous
@@ -13,6 +13,7 @@ import {importX} from 'eslint-plugin-import-x';
import mochaPlugin from 'eslint-plugin-mocha';
import nodePlugin from 'eslint-plugin-n';
import {configs as tsConfigs} from 'typescript-eslint';
import unicorn from 'eslint-plugin-unicorn';
const gitignorePath = path.resolve(process.cwd(), '.gitignore');
@@ -35,6 +36,7 @@ export default defineConfig([
js,
n: nodePlugin,
promise: pluginPromise,
unicorn
},
extends: [
'js/recommended',
@@ -146,6 +148,7 @@ export default defineConfig([
* `return await somePromise` have their own use-cases.
*/
'require-await': 'off',
'unicorn/prefer-node-protocol': 'error'
}
},
@@ -38,6 +38,7 @@
"eslint-plugin-mocha": "11.2.0",
"eslint-plugin-n": "17.23.2",
"eslint-plugin-promise": "7.2.1",
"eslint-plugin-unicorn": "62.0.0",
"typescript-eslint": "8.53.0"
},
"peerDependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
import {BasePlugin} from 'appium/plugin';
import _ from 'lodash';
import cp from 'child_process';
import cp from 'node:child_process';
import {timing} from 'appium/support';
import B from 'bluebird';
@@ -1,6 +1,6 @@
// @ts-check
import path from 'path';
import path from 'node:path';
import {pluginE2EHarness} from '@appium/plugin-test-support';
import {remote as wdio} from 'webdriverio';
+2 -2
View File
@@ -1,6 +1,6 @@
import {fs} from 'appium/support';
import {readFileSync} from 'fs';
import path from 'path';
import {readFileSync} from 'node:fs';
import path from 'node:path';
import XMLDom from '@xmldom/xmldom';
import * as xpath from 'xpath';
import log from './logger';
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import {remote as wdio} from 'webdriverio';
const TEST_HOST = '127.0.0.1';
@@ -1,5 +1,5 @@
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {remote as wdio} from 'webdriverio';
import {MATCH_FEATURES_MODE, GET_SIMILARITY_MODE} from '../../lib/constants';
import {TEST_IMG_1_B64, TEST_IMG_2_B64, APPSTORE_IMG_PATH} from '../fixtures/index.cjs';
+2 -2
View File
@@ -1,5 +1,5 @@
import path from 'path';
import fs from 'fs';
import path from 'node:path';
import fs from 'node:fs';
const TINY_PNG = 'iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQwIDc5LjE2MDQ1MSwgMjAxNy8wNS8wNi0wMTowODoyMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0NDMDM4MDM4N0U2MTFFOEEzMzhGMTRFNUUwNzIwNUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0NDMDM4MDQ4N0U2MTFFOEEzMzhGMTRFNUUwNzIwNUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3Q0MwMzgwMTg3RTYxMUU4QTMzOEYxNEU1RTA3MjA1QiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3Q0MwMzgwMjg3RTYxMUU4QTMzOEYxNEU1RTA3MjA1QiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpdvJjQAAAAlSURBVHjaJInBEQAACIKw/Xe2Ul5wYBtwmJqkk4+zfvUQVoABAEg0EfrZwc0hAAAAAElFTkSuQmCC';
const TiNY_PNG_BUF = Buffer.from(TINY_PNG, 'base64');
+1 -1
View File
@@ -1,5 +1,5 @@
import _ from 'lodash';
import {Buffer} from 'buffer';
import {Buffer} from 'node:buffer';
import B from 'bluebird';
import sharp from 'sharp';
import { OpenCvAutoreleasePool } from './autorelease-pool';
+1 -1
View File
@@ -1,5 +1,5 @@
import {getImagesMatches, getImagesSimilarity, getImageOccurrence} from '../../lib';
import path from 'path';
import path from 'node:path';
import {fs} from '@appium/support';
const FIXTURES_ROOT = path.resolve(__dirname, 'images');
@@ -7,8 +7,8 @@
* then outputs the result.
*/
const path = require('path');
const {writeFile, mkdir} = require('fs').promises;
const path = require('node:path');
const {writeFile, mkdir} = require('node:fs').promises;
const logSymbols = require('log-symbols');
const {error, info, success} = logSymbols.default;
@@ -1,5 +1,5 @@
import _ from 'lodash';
import path from 'path';
import path from 'node:path';
import {remote as wdio} from 'webdriverio';
import {pluginE2EHarness} from '@appium/plugin-test-support';
import {tempDir, fs} from '@appium/support';
+2 -2
View File
@@ -1,9 +1,9 @@
import _ from 'lodash';
import {createSupportsColor} from 'supports-color';
import {Console as NodeConsole} from 'console';
import {Console as NodeConsole} from 'node:console';
import '@colors/colors';
import symbols from 'log-symbols';
import {Writable} from 'stream';
import {Writable} from 'node:stream';
/**
* Stream to nowhere. Used when we want to disable any output other than JSON output.
+2 -2
View File
@@ -1,7 +1,7 @@
// @ts-check
import _ from 'lodash';
import {homedir} from 'os';
import path from 'path';
import {homedir} from 'node:os';
import path from 'node:path';
import {readPackage} from 'read-pkg';
import * as semver from 'semver';
+3 -3
View File
@@ -1,7 +1,7 @@
// @ts-check
import B from 'bluebird';
import crypto from 'crypto';
import crypto from 'node:crypto';
import {
close,
constants,
@@ -12,13 +12,13 @@ import {
write,
rmSync,
open,
} from 'fs';
} from 'node:fs';
import { glob } from 'glob';
import klaw from 'klaw';
import _ from 'lodash';
import ncp from 'ncp';
import {packageDirectorySync} from 'package-directory';
import path from 'path';
import path from 'node:path';
import {readPackageSync} from 'read-pkg';
import sanitize from 'sanitize-filename';
import which from 'which';
+1 -1
View File
@@ -2,7 +2,7 @@ import _ from 'lodash';
import log from './logger';
import B from 'bluebird';
import {requireSharp} from './image-util';
import {Writable} from 'stream';
import {Writable} from 'node:stream';
import {requirePackage} from './node';
import axios from 'axios';
+2 -2
View File
@@ -2,8 +2,8 @@ import {isWindows} from './system';
import log from './logger';
import _ from 'lodash';
import {exec} from 'teen_process';
import path from 'path';
import _fs from 'fs';
import path from 'node:path';
import _fs from 'node:fs';
import {v4 as uuidV4} from 'uuid';
const ECMA_SIZES = Object.freeze({
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-check
import path from 'path';
import path from 'node:path';
import * as semver from 'semver';
import {hasAppiumDependency} from './env';
import {exec} from 'teen_process';
+1 -1
View File
@@ -1,6 +1,6 @@
import {exec} from 'teen_process';
import _ from 'lodash';
import os from 'os';
import os from 'node:os';
const VERSION_PATTERN = /^(\d+\.\d+)/m;
+2 -2
View File
@@ -1,7 +1,7 @@
/* This library is originated from temp.js at http://github.com/bruce/node-temp */
import {fs} from './fs';
import os from 'os';
import nodePath from 'path';
import os from 'node:os';
import nodePath from 'node:path';
import {constants} from 'node:fs';
import log from './logger';
+3 -3
View File
@@ -1,7 +1,7 @@
import B from 'bluebird';
import _ from 'lodash';
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';
import { fs } from './fs';
import * as semver from 'semver';
import {
@@ -10,7 +10,7 @@ import {
parse as shellParse,
} from 'shell-quote';
import pluralizeLib from 'pluralize';
import stream from 'stream';
import stream from 'node:stream';
import {Base64Encode} from 'base64-stream';
import {
// https://www.npmjs.com/package/uuid
+3 -3
View File
@@ -2,9 +2,9 @@ import _ from 'lodash';
import B from 'bluebird';
import * as yauzl from 'yauzl';
import archiver from 'archiver';
import {createWriteStream} from 'fs';
import path from 'path';
import stream from 'stream';
import {createWriteStream} from 'node:fs';
import path from 'node:path';
import stream from 'node:stream';
import {fs} from './fs';
import {isWindows} from './system';
import {Base64Encode} from 'base64-stream';
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-check
import path from 'path';
import path from 'node:path';
import {fs, tempDir} from '../../lib';
import {
DEFAULT_APPIUM_HOME,
@@ -1,5 +1,5 @@
import {cropBase64Image} from '../../lib/image-util';
import path from 'path';
import path from 'node:path';
import sharp from 'sharp';
import {fs} from '../../lib';
+1 -1
View File
@@ -1,7 +1,7 @@
import _ from 'lodash';
import {mjpeg} from '../../lib';
import B from 'bluebird';
import http from 'http';
import http from 'node:http';
import mJpegServer from 'mjpeg-server';
import getPort from 'get-port';
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import {downloadFile} from '../../lib/net';
import {tempDir, fs} from '../../lib/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import B from 'bluebird';
import path from 'path';
import path from 'node:path';
import * as util from '../../lib/util';
import {tempDir, fs} from '../../lib/index';
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import * as zip from '../../lib/zip';
import {tempDir, fs} from '../../lib/index';
import {MockReadWriteStream} from '../helpers';
+1 -1
View File
@@ -1,4 +1,4 @@
import {EventEmitter} from 'events';
import {EventEmitter} from 'node:events';
import rewiremock, {addPlugin, overrideEntryPoint, plugins} from 'rewiremock';
overrideEntryPoint(module);
+1 -1
View File
@@ -5,7 +5,7 @@
* A collection of mocks reused across unit tests.
*/
import path from 'path';
import path from 'node:path';
import {createSandbox} from 'sinon';
export function initMocks(sandbox = createSandbox()) {
+1 -1
View File
@@ -1,7 +1,7 @@
// @ts-check
import path from 'path';
import path from 'node:path';
import {rewiremock} from '../helpers';
import {initMocks} from '../mocks';
+1 -1
View File
@@ -1,5 +1,5 @@
import {fs, system, tempDir} from '../../lib';
import path from 'path';
import path from 'node:path';
import {createSandbox} from 'sinon';
import {exec} from 'teen_process';
import _ from 'lodash';
+1 -1
View File
@@ -1,5 +1,5 @@
import {node} from '../../lib';
import path from 'path';
import path from 'node:path';
import _ from 'lodash';
describe('node utilities', function () {
+1 -1
View File
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import {plist, tempDir, fs} from '../../lib';
const binaryPlistPath = path.join(__dirname, 'assets', 'sample_binary.plist');
+1 -1
View File
@@ -1,5 +1,5 @@
import {system} from '../../lib';
import os from 'os';
import os from 'node:os';
import {createSandbox} from 'sinon';
import * as teen_process from 'teen_process';
import _ from 'lodash';
+2 -2
View File
@@ -1,8 +1,8 @@
import {util, fs, tempDir} from '../../lib';
import B from 'bluebird';
import {createSandbox} from 'sinon';
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';
import _ from 'lodash';
const {W3C_WEB_ELEMENT_IDENTIFIER} = util;
@@ -6,8 +6,8 @@
*/
const {compileFromFile} = require('json-schema-to-typescript');
const path = require('path');
const {promises: fs} = require('fs');
const path = require('node:path');
const {promises: fs} = require('node:fs');
const logSymbols = require('log-symbols');
const {error, info, success} = logSymbols.default;
+2 -2
View File
@@ -1,5 +1,5 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
const XML_IOS = fs.readFileSync(path.resolve(__dirname, 'ios.xml'), 'utf8').trim();
const XML_IOS_TRANSFORMED = fs.readFileSync(path.resolve(__dirname, 'ios-transformed.xml'), 'utf8').trim();