From 9708249e92d6099a57ed7ad7ea88629dbea7e4d5 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:06:30 +0100 Subject: [PATCH] chore: set `APPIUM_HOME` and remove patch --- .../patches/appium-npm-3.0.2-7d0e99d983.patch | 25 ------ .yarnrc.yml | 3 + example/package.json | 4 +- scripts/testing/test-matrix.mts | 5 ++ yarn.lock | 89 ++++++------------- 5 files changed, 35 insertions(+), 91 deletions(-) delete mode 100644 .yarn/patches/appium-npm-3.0.2-7d0e99d983.patch diff --git a/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch b/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch deleted file mode 100644 index ab8fc2b68..000000000 --- a/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/build/lib/extension/manifest.js b/build/lib/extension/manifest.js -index af59df0ff07d6294bbc373cbcc273cc06300482f..6ad054e11bc7ece77e80e08c0d265e538ebe7c53 100644 ---- a/build/lib/extension/manifest.js -+++ b/build/lib/extension/manifest.js -@@ -180,12 +180,14 @@ class Manifest { - onMatch(path_1.default.join(this.#appiumHome, 'package.json'), true), - ]; - // add dependencies to the queue -- const filepaths = await support_1.fs.glob('node_modules/{*,@*/*}/package.json', { -- cwd: this.#appiumHome, -- absolute: true, -- }); -- for (const filepath of filepaths) { -- queue.push(onMatch(filepath)); -+ const appPkgPath = path_1.default.join(process.cwd(), 'package.json'); -+ const appPkg = JSON.parse(await support_1.fs.readFile(appPkgPath, 'utf8')); -+ for (const name of Object.keys(appPkg.devDependencies)) { -+ try { -+ queue.push(onMatch(require.resolve(name + "/package.json"))); -+ } catch (_) { -+ // Ignore packages that don't export `./package.json` -+ } - } - // wait for everything to finish - await bluebird_1.default.all(queue); diff --git a/.yarnrc.yml b/.yarnrc.yml index 203a59c43..c8e002501 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -14,6 +14,9 @@ logFilters: nodeLinker: node-modules npmRegistryServer: "https://registry.npmjs.org" packageExtensions: + appium@3: + dependencies: + "@colors/colors": ^1.6.0 react-native-windows@*: peerDependenciesMeta: "@types/react": diff --git a/example/package.json b/example/package.json index f93bbee0c..74c87403c 100644 --- a/example/package.json +++ b/example/package.json @@ -38,8 +38,8 @@ "@rnx-kit/polyfills": "^0.2.0", "@rnx-kit/tsconfig": "^2.0.0", "@types/react": "~19.0.0", - "appium": "patch:appium@npm%3A3.1.1#~/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch", - "appium-uiautomator2-driver": "^5.0.0", + "appium": "^3.1.1", + "appium-uiautomator2-driver": "^6.0.0", "appium-xcuitest-driver": "^10.0.0", "react-native-test-app": "workspace:*", "webdriverio": "^9.0.0" diff --git a/scripts/testing/test-matrix.mts b/scripts/testing/test-matrix.mts index 30983a4a3..b1511b7fe 100644 --- a/scripts/testing/test-matrix.mts +++ b/scripts/testing/test-matrix.mts @@ -4,6 +4,7 @@ */ import { spawn, spawnSync } from "node:child_process"; import * as fs from "node:fs"; +import * as path from "node:path"; import { URL, fileURLToPath } from "node:url"; import * as util from "node:util"; import { readTextFile, toVersionNumber, v } from "../helpers.js"; @@ -135,6 +136,10 @@ function showBanner(message: string) { * Starts Appium server. */ function startAppiumServer(logPath = "appium.log") { + if (!process.env["APPIUM_HOME"]) { + const appium = fileURLToPath(import.meta.resolve("../../package.json")); + process.env["APPIUM_HOME"] = path.dirname(appium); + } log(`Appium log path: ${logPath}`); return run("appium", logPath); } diff --git a/yarn.lock b/yarn.lock index 2602d15a4..24b028d9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5026,18 +5026,18 @@ __metadata: languageName: node linkType: hard -"appium-android-driver@npm:^11.0.9": - version: 11.0.12 - resolution: "appium-android-driver@npm:11.0.12" +"appium-android-driver@npm:^12.3.0": + version: 12.3.0 + resolution: "appium-android-driver@npm:12.3.0" dependencies: "@appium/support": "npm:^7.0.0-rc.1" "@colors/colors": "npm:^1.6.0" appium-adb: "npm:^14.0.0" - appium-chromedriver: "npm:^8.0.16" + appium-chromedriver: "npm:^8.0.18" asyncbox: "npm:^3.0.0" axios: "npm:^1.x" bluebird: "npm:^3.4.7" - io.appium.settings: "npm:^6.0.0" + io.appium.settings: "npm:^7.0.4" lodash: "npm:^4.17.4" lru-cache: "npm:^11.1.0" moment: "npm:^2.24.0" @@ -5049,11 +5049,11 @@ __metadata: ws: "npm:^8.0.0" peerDependencies: appium: ^3.0.0-rc.2 - checksum: 10c0/c890e857b8b0804cd3805c73b835e9c6f8f015c092e84870d706c40195137b1ffd53093a5bb3ea06c178b1e02372f668ad4b2f9db55f9f86dd19280a5d2c1461 + checksum: 10c0/a20d13030688265326a6d34e36be2ea8ca06b5a0435b7d25fb87991cd006e3817c2db512462216ab1ffc77f7e655404b2d1590d7dad03eb6fb8e7d2d7407db11 languageName: node linkType: hard -"appium-chromedriver@npm:^8.0.16": +"appium-chromedriver@npm:^8.0.18": version: 8.0.22 resolution: "appium-chromedriver@npm:8.0.22" dependencies: @@ -5169,32 +5169,32 @@ __metadata: languageName: node linkType: hard -"appium-uiautomator2-driver@npm:^5.0.0": - version: 5.0.7 - resolution: "appium-uiautomator2-driver@npm:5.0.7" +"appium-uiautomator2-driver@npm:^6.0.0": + version: 6.3.0 + resolution: "appium-uiautomator2-driver@npm:6.3.0" dependencies: appium-adb: "npm:^14.0.0" - appium-android-driver: "npm:^11.0.9" - appium-uiautomator2-server: "npm:^8.1.1" + appium-android-driver: "npm:^12.3.0" + appium-uiautomator2-server: "npm:^9.0.0" asyncbox: "npm:^3.0.0" axios: "npm:^1.12.2" bluebird: "npm:^3.5.1" css-selector-parser: "npm:^3.0.0" - io.appium.settings: "npm:^6.0.8" + io.appium.settings: "npm:^7.0.1" lodash: "npm:^4.17.4" portscanner: "npm:^2.2.0" source-map-support: "npm:^0.x" teen_process: "npm:^3.0.0" peerDependencies: appium: ^3.0.0-rc.2 - checksum: 10c0/ca0a7175af95311fce03e9716af0983eee9bd9f0842e1bd2d849c85db9f6d185173d12728c77d89f747b2e3bac12359d800c625ef995e0bc9a22a41c6b153ac8 + checksum: 10c0/ef15df62ce3159056175d71848b5b100628ecfa929364368b59aef407878809685e7d224395230f76e0bb5d3563d6fb0c9135134e7fb6109095bc64c396b8318 languageName: node linkType: hard -"appium-uiautomator2-server@npm:^8.1.1": - version: 8.1.2 - resolution: "appium-uiautomator2-server@npm:8.1.2" - checksum: 10c0/a636d424283851a0fb1384280f89a607abfe0f33cab6051f903f6cdea1da68e8a74a1436bf261e61bb172c9465303d95a3f25be1b3cf01accd5b75cf225dc220 +"appium-uiautomator2-server@npm:^9.0.0": + version: 9.1.4 + resolution: "appium-uiautomator2-server@npm:9.1.4" + checksum: 10c0/7574c4e5da890c502c318e566377db658ff4e1449b8b7a381bc68a43eebb13325e8b866014bcbd39fddbb9eb2651f0ab0051a55c7ef7e22020feda335de5242f languageName: node linkType: hard @@ -5274,7 +5274,7 @@ __metadata: languageName: node linkType: hard -"appium@npm:3.1.1": +"appium@npm:^3.1.1": version: 3.1.1 resolution: "appium@npm:3.1.1" dependencies: @@ -5313,45 +5313,6 @@ __metadata: languageName: node linkType: hard -"appium@patch:appium@npm%3A3.1.1#~/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch": - version: 3.1.1 - resolution: "appium@patch:appium@npm%3A3.1.1#~/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch::version=3.1.1&hash=8747c0" - dependencies: - "@appium/base-driver": "npm:^10.1.1" - "@appium/base-plugin": "npm:^3.0.4" - "@appium/docutils": "npm:^2.1.2" - "@appium/logger": "npm:^2.0.2" - "@appium/schema": "npm:^1.0.0" - "@appium/support": "npm:^7.0.3" - "@appium/types": "npm:^1.1.1" - "@sidvind/better-ajv-errors": "npm:4.0.0" - ajv: "npm:8.17.1" - ajv-formats: "npm:3.0.1" - argparse: "npm:2.0.1" - async-lock: "npm:1.4.1" - asyncbox: "npm:3.0.0" - axios: "npm:1.13.2" - bluebird: "npm:3.7.2" - lilconfig: "npm:3.1.3" - lodash: "npm:4.17.21" - lru-cache: "npm:11.2.2" - ora: "npm:5.4.1" - package-changed: "npm:3.0.0" - resolve-from: "npm:5.0.0" - semver: "npm:7.7.3" - source-map-support: "npm:0.5.21" - teen_process: "npm:3.0.2" - type-fest: "npm:5.2.0" - winston: "npm:3.18.3" - wrap-ansi: "npm:7.0.0" - ws: "npm:8.18.3" - yaml: "npm:2.8.1" - bin: - appium: index.js - checksum: 10c0/5d6facbd4a953b38bc18658152868a8b972c4bc352545dcebde49c75c52a766fbb748ea5f1de8300cc1c5a5282123361810b178df214c98e376118d3c1b310c3 - languageName: node - linkType: hard - "archiver-utils@npm:^5.0.0, archiver-utils@npm:^5.0.2": version: 5.0.2 resolution: "archiver-utils@npm:5.0.2" @@ -7854,8 +7815,8 @@ __metadata: "@rnx-kit/polyfills": "npm:^0.2.0" "@rnx-kit/tsconfig": "npm:^2.0.0" "@types/react": "npm:~19.0.0" - appium: "patch:appium@npm%3A3.1.1#~/.yarn/patches/appium-npm-3.0.2-7d0e99d983.patch" - appium-uiautomator2-driver: "npm:^5.0.0" + appium: "npm:^3.1.1" + appium-uiautomator2-driver: "npm:^6.0.0" appium-xcuitest-driver: "npm:^10.0.0" react: "npm:19.0.0" react-native: "npm:^0.79.0" @@ -9122,9 +9083,9 @@ __metadata: languageName: node linkType: hard -"io.appium.settings@npm:^6.0.0, io.appium.settings@npm:^6.0.8": - version: 6.0.8 - resolution: "io.appium.settings@npm:6.0.8" +"io.appium.settings@npm:^7.0.1, io.appium.settings@npm:^7.0.4": + version: 7.0.4 + resolution: "io.appium.settings@npm:7.0.4" dependencies: "@appium/logger": "npm:^2.0.0-rc.1" asyncbox: "npm:^3.0.0" @@ -9133,7 +9094,7 @@ __metadata: semver: "npm:^7.5.4" source-map-support: "npm:^0.x" teen_process: "npm:^3.0.0" - checksum: 10c0/54d33cc1ee64f39e830c0a99e3bc93d7d486de1a8e05409ac0feb885e010943fdb02566435de05d0ef223486b5b25f015233167401a2f2ae6f1fe2b21e6a0e4e + checksum: 10c0/3fef36d660f3eda378991721bed2d0979b9646cd68883406476717e6759a4d85f34d1c0732c0abe615215d3cd4b03151f43247c856fe7cebef6210edc6130e45 languageName: node linkType: hard