appium-webdriveragent 12.1.1 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/xcodebuild.ts CHANGED
@@ -3,15 +3,15 @@ import {SubProcess, exec} from 'teen_process';
3
3
  import {logger, timing} from '@appium/support';
4
4
  import type {AppiumLogger, StringRecord} from '@appium/types';
5
5
  import {log as defaultLogger} from './logger';
6
- import B from 'bluebird';
7
6
  import {
8
7
  setRealDeviceSecurity,
9
8
  setXctestrunFile,
10
9
  killProcess,
11
10
  getWDAUpgradeTimestamp,
12
11
  isTvOS,
12
+ escapeRegExp,
13
+ truncateString,
13
14
  } from './utils';
14
- import _ from 'lodash';
15
15
  import path from 'node:path';
16
16
  import {WDA_RUNNER_BUNDLE_ID} from './constants';
17
17
  import type {AppleDevice, XcodeBuildArgs} from './types';
@@ -30,7 +30,7 @@ const IGNORED_ERRORS = [
30
30
  'Failed to remove screenshot at path',
31
31
  ];
32
32
  const IGNORED_ERRORS_PATTERN = new RegExp(
33
- '(' + IGNORED_ERRORS.map((errStr) => _.escapeRegExp(errStr)).join('|') + ')',
33
+ '(' + IGNORED_ERRORS.map((errStr) => escapeRegExp(errStr)).join('|') + ')',
34
34
  );
35
35
 
36
36
  const RUNNER_SCHEME_TV = 'WebDriverAgentRunner_tvOS';
@@ -44,27 +44,28 @@ const xcodeLog = logger.getLogger('Xcode');
44
44
  export class XcodeBuild {
45
45
  xcodebuild?: SubProcess;
46
46
  readonly device: AppleDevice;
47
- private readonly log: AppiumLogger;
48
47
  readonly realDevice: boolean;
49
48
  readonly agentPath: string;
50
49
  readonly bootstrapPath: string;
51
50
  readonly platformVersion?: string;
52
51
  readonly platformName?: string;
53
52
  readonly iosSdkVersion?: string;
53
+ readonly xcodeSigningId: string;
54
+ usePrebuiltWDA?: boolean;
55
+ derivedDataPath?: string;
56
+ agentUrl?: string;
57
+ private readonly log: AppiumLogger;
54
58
  private readonly showXcodeLog?: boolean;
55
59
  private readonly xcodeConfigFile?: string;
56
60
  private readonly xcodeOrgId?: string;
57
- readonly xcodeSigningId: string;
58
61
  private readonly keychainPath?: string;
59
62
  private readonly keychainPassword?: string;
60
- usePrebuiltWDA?: boolean;
61
63
  private readonly useSimpleBuildTest?: boolean;
62
64
  private readonly useXctestrunFile?: boolean;
63
65
  private readonly launchTimeout?: number;
64
66
  private readonly wdaRemotePort?: number;
65
67
  private readonly wdaBindingIP?: string;
66
68
  private readonly updatedWDABundleId?: string;
67
- derivedDataPath?: string;
68
69
  private readonly mjpegServerPort?: number;
69
70
  private readonly prebuildDelay: number;
70
71
  private readonly allowProvisioningDeviceRegistration?: boolean;
@@ -75,7 +76,6 @@ export class XcodeBuild {
75
76
  private _derivedDataPathPromise?: Promise<string | undefined>;
76
77
  private noSessionProxy?: NoSessionProxy;
77
78
  private xctestrunFilePath?: string;
78
- agentUrl?: string;
79
79
 
80
80
  /**
81
81
  * Creates a new XcodeBuild instance.
@@ -119,7 +119,8 @@ export class XcodeBuild {
119
119
 
120
120
  this.mjpegServerPort = args.mjpegServerPort;
121
121
 
122
- this.prebuildDelay = _.isNumber(args.prebuildDelay) ? args.prebuildDelay : PREBUILD_DELAY;
122
+ this.prebuildDelay =
123
+ typeof args.prebuildDelay === 'number' ? args.prebuildDelay : PREBUILD_DELAY;
123
124
 
124
125
  this.allowProvisioningDeviceRegistration = args.allowProvisioningDeviceRegistration;
125
126
 
@@ -183,7 +184,7 @@ export class XcodeBuild {
183
184
  const pattern = /^\s*BUILD_DIR\s+=\s+(\/.*)/m;
184
185
  const match = pattern.exec(stdout);
185
186
  if (!match) {
186
- this.log.warn(`Cannot parse WDA build dir from ${_.truncate(stdout, {length: 300})}`);
187
+ this.log.warn(`Cannot parse WDA build dir from ${truncateString(stdout, 300)}`);
187
188
  return;
188
189
  }
189
190
  this.log.debug(`Parsed BUILD_DIR configuration value: '${match[1]}'`);
@@ -207,7 +208,7 @@ export class XcodeBuild {
207
208
 
208
209
  if (this.prebuildDelay > 0) {
209
210
  // pause a moment
210
- await B.delay(this.prebuildDelay);
211
+ await new Promise((resolve) => setTimeout(resolve, this.prebuildDelay));
211
212
  }
212
213
  }
213
214
 
@@ -242,7 +243,7 @@ export class XcodeBuild {
242
243
  throw new Error('xcodebuild subprocess was not created');
243
244
  }
244
245
  const xcodebuild = this.xcodebuild;
245
- return await new B((resolve, reject) => {
246
+ return await new Promise<StringRecord | void>((resolve, reject) => {
246
247
  xcodebuild.once('exit', (code, signal) => {
247
248
  xcodeLog.error(`xcodebuild exited with code '${code}' and signal '${signal}'`);
248
249
  xcodebuild.removeAllListeners();
@@ -415,9 +416,10 @@ export class XcodeBuild {
415
416
  });
416
417
 
417
418
  let logXcodeOutput = !!this.showXcodeLog;
418
- const logMsg = _.isBoolean(this.showXcodeLog)
419
- ? `Output from xcodebuild ${this.showXcodeLog ? 'will' : 'will not'} be logged`
420
- : 'Output from xcodebuild will only be logged if any errors are present there';
419
+ const logMsg =
420
+ typeof this.showXcodeLog === 'boolean'
421
+ ? `Output from xcodebuild ${this.showXcodeLog ? 'will' : 'will not'} be logged`
422
+ : 'Output from xcodebuild will only be logged if any errors are present there';
421
423
  this.log.debug(`${logMsg}. To change this, use 'showXcodeLog' desired capability`);
422
424
 
423
425
  const onStreamLine = (line: string) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "12.1.1",
3
+ "version": "12.2.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/lib/index.js",
6
6
  "types": "./build/lib/index.d.ts",
@@ -54,16 +54,14 @@
54
54
  "@appium/types": "^1.0.0-rc.1",
55
55
  "@semantic-release/changelog": "^6.0.1",
56
56
  "@semantic-release/git": "^10.0.1",
57
- "@types/bluebird": "^3.5.38",
58
- "@types/lodash": "^4.14.196",
59
57
  "@types/mocha": "^10.0.1",
60
58
  "@types/node": "^25.0.0",
61
59
  "appium-xcode": "^6.0.0",
62
60
  "chai": "^6.0.0",
63
61
  "chai-as-promised": "^8.0.0",
64
62
  "conventional-changelog-conventionalcommits": "^9.0.0",
65
- "node-simctl": "^8.0.0",
66
63
  "mocha": "^11.0.1",
64
+ "node-simctl": "^8.0.0",
67
65
  "prettier": "^3.0.0",
68
66
  "semantic-release": "^25.0.2",
69
67
  "semver": "^7.3.7",
@@ -80,8 +78,6 @@
80
78
  "async-lock": "^1.0.0",
81
79
  "asyncbox": "^6.1.0",
82
80
  "axios": "^1.4.0",
83
- "bluebird": "^3.5.5",
84
- "lodash": "^4.17.11",
85
81
  "teen_process": "^4.0.7"
86
82
  },
87
83
  "files": [