Skip to content

Commit b3a59e6

Browse files
refactor: Set Appium as peer dependency (#747)
1 parent 5f67e02 commit b3a59e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+70
-100
lines changed

.azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
NODE_VERSION: 12.x
2+
NODE_VERSION: 16.x
33
_FORCE_LOGS: 1
44
CI: true
55
MOCHA_TIMEOUT: 360000

gulpfile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
'use strict';
22

33
const { exec } = require('teen_process');
4-
const system = require('@appium/support').system;
54
const gulp = require('gulp');
65
const boilerplate = require('@appium/gulp-plugins').boilerplate.use(gulp);
76
const DEFAULTS = require('@appium/gulp-plugins').boilerplate.DEFAULTS;
87

98

10-
const ANT_CMD = system.isWindows() ? 'ant.bat' : 'ant';
9+
const ANT_CMD = process.platform === 'win32' ? 'ant.bat' : 'ant';
1110

1211
gulp.task('ant-clean', function clean () {
1312
return exec(ANT_CMD, ['clean'], {cwd: 'bootstrap'});

index.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
#!/usr/bin/env node
22
// transpile:main
3-
4-
import { asyncify } from 'asyncbox';
5-
import * as server from './lib/server';
6-
7-
8-
const { startServer } = server;
9-
10-
const DEFAULT_HOST = 'localhost';
11-
const DEFAULT_PORT = 4723;
12-
13-
async function main () {
14-
const getArgValue = (argName) => {
15-
const argIndex = process.argv.indexOf(argName);
16-
return argIndex > 0 ? process.argv[argIndex + 1] : null;
17-
};
18-
const port = parseInt(getArgValue('--port'), 10) || DEFAULT_PORT;
19-
const host = getArgValue('--host') || DEFAULT_HOST;
20-
return await startServer(port, host);
21-
}
22-
23-
if (require.main === module) {
24-
asyncify(main);
25-
}
26-
27-
283
import * as driver from './lib/driver';
294
import * as androidHelperIndex from './lib/android-helpers';
305
import * as commandIndex from './lib/commands/index';
@@ -42,7 +17,7 @@ const { helpers: androidHelpers, SETTINGS_HELPER_PKG_ID } = androidHelperIndex;
4217

4318
export default AndroidDriver;
4419
export {
45-
androidHelpers, androidCommands, AndroidDriver, startServer,
20+
androidHelpers, androidCommands, AndroidDriver,
4621
commonCapConstraints, webviewHelpers, NATIVE_WIN, WEBVIEW_WIN,
4722
WEBVIEW_BASE, CHROMIUM_WIN, SETTINGS_HELPER_PKG_ID,
4823
};

lib/android-helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import _ from 'lodash';
22
import path from 'path';
33
import { retry, waitForCondition } from 'asyncbox';
44
import logger from './logger';
5-
import { fs, util } from '@appium/support';
5+
import { fs, util } from 'appium/support';
66
import { path as settingsApkPath } from 'io.appium.settings';
77
import Bootstrap from './bootstrap';
88
import B from 'bluebird';

lib/bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import UiAutomator from './uiautomator';
22
import net from 'net';
33
import path from 'path';
44
import _ from 'lodash';
5-
import { errorFromCode } from '@appium/base-driver';
5+
import { errorFromCode } from 'appium/driver';
66
import B from 'bluebird';
7-
import { logger } from '@appium/support';
7+
import { logger } from 'appium/support';
88

99

1010
const log = logger.getLogger('AndroidBootstrap');

lib/commands/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import androidHelpers from '../android-helpers';
2-
import { fs, util, tempDir} from '@appium/support';
2+
import { fs, util, tempDir} from 'appium/support';
33
import path from 'path';
44
import B from 'bluebird';
55
import jimp from 'jimp';

lib/commands/alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable require-await */
2-
import { errors } from '@appium/base-driver';
2+
import { errors } from 'appium/driver';
33

44
let commands = {}, helpers = {}, extensions = {};
55

lib/commands/app-management.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import _ from 'lodash';
22
import { waitForCondition } from 'asyncbox';
3-
import { util } from '@appium/support';
3+
import { util } from 'appium/support';
44
import { APP_STATE } from '../android-helpers';
5-
import { errors } from '@appium/base-driver';
5+
import { errors } from 'appium/driver';
66

77
const APP_EXTENSIONS = ['.apk', '.apks'];
88

lib/commands/context.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import _ from 'lodash';
22
import Chromedriver from 'appium-chromedriver';
33
import PortFinder from 'portfinder';
44
import B from 'bluebird';
5-
import { util } from '@appium/support';
6-
import { errors } from '@appium/base-driver';
5+
import { util } from 'appium/support';
6+
import { errors } from 'appium/driver';
77
import {
88
default as webviewHelpers,
99
NATIVE_WIN, WEBVIEW_BASE, WEBVIEW_WIN, CHROMIUM_WIN, KNOWN_CHROME_PACKAGE_NAMES

lib/commands/element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import androidHelpers from '../android-helpers';
22
import { retryInterval } from 'asyncbox';
3-
import { util } from '@appium/support';
3+
import { util } from 'appium/support';
44

55

66
let commands = {}, helpers = {}, extensions = {};

0 commit comments

Comments
 (0)