diff --git a/detox/package.json b/detox/package.json index edeb96db24..6d85fc4193 100644 --- a/detox/package.json +++ b/detox/package.json @@ -99,7 +99,6 @@ "find-up": "^5.0.0", "fs-extra": "^11.0.0", "funpermaproxy": "^1.1.0", - "glob": "^8.0.3", "ini": "^1.3.4", "jest-environment-emit": "^1.2.0", "json-cycle": "^1.3.0", @@ -118,6 +117,7 @@ "stream-json": "^1.7.4", "strip-ansi": "^6.0.1", "telnet-client": "1.2.8", + "tinyglobby": "^0.2.16", "tmp": "^0.2.1", "trace-event-lib": "^1.3.1", "which": "^1.3.1", diff --git a/detox/src/artifacts/utils/temporaryPath.js b/detox/src/artifacts/utils/temporaryPath.js index faca7ff66b..21be98ce2b 100644 --- a/detox/src/artifacts/utils/temporaryPath.js +++ b/detox/src/artifacts/utils/temporaryPath.js @@ -1,15 +1,12 @@ const path = require('path'); -const { promisify } = require('util'); -const glob = require('glob'); const _ = require('lodash'); +const { globSync, glob: globAsync } = require('tinyglobby'); const { useForwardSlashes } = require('../../utils/shellUtils'); const tempfile = require('../../utils/tempfile'); -const globSync = glob.sync; -const globAsync = promisify(glob); const getRoot = _.once(() => path.dirname(tempfile())); function createGlobber(ext) { diff --git a/detox/src/logger/utils/DetoxLogFinalizer.test.js b/detox/src/logger/utils/DetoxLogFinalizer.test.js index 8f8ada0ada..3f52aaed74 100644 --- a/detox/src/logger/utils/DetoxLogFinalizer.test.js +++ b/detox/src/logger/utils/DetoxLogFinalizer.test.js @@ -4,7 +4,7 @@ const path = require('path'); const { PassThrough } = require('stream'); const fs = require('fs-extra'); -const glob = require('glob'); +const { globSync } = require('tinyglobby'); const temporary = require('../../artifacts/utils/temporaryPath'); const tempfile = require('../../utils/tempfile'); @@ -116,7 +116,7 @@ describe('DetoxLogFinalizer', () => { await createLogFiles(); await finalizer.finalize(); - const outFiles = glob.sync('*', { cwd: artifactsDir() }); + const outFiles = globSync('*', { cwd: artifactsDir() }); expect(outFiles).toEqual([ 'detox.log', 'detox.trace.json', @@ -148,7 +148,7 @@ describe('DetoxLogFinalizer', () => { await createLogFiles(); finalizer.finalizeSync(); - const outFiles = glob.sync('*', { cwd: artifactsDir() }); + const outFiles = globSync('*', { cwd: artifactsDir() }); expect(outFiles.map(f => path.extname(f))).toEqual([ '.jsonl', '.jsonl', @@ -171,7 +171,7 @@ describe('DetoxLogFinalizer', () => { await createLogFiles(); finalizer.finalizeSync(); - const outFiles = glob.sync('*', { cwd: artifactsDir() }); + const outFiles = globSync('*', { cwd: artifactsDir() }); expect(outFiles.map(f => path.extname(f))).toEqual([ '.jsonl', '.jsonl', diff --git a/detox/test/e2e/utils/artifactUtils.js b/detox/test/e2e/utils/artifactUtils.js index ce3d261482..36232ac84c 100644 --- a/detox/test/e2e/utils/artifactUtils.js +++ b/detox/test/e2e/utils/artifactUtils.js @@ -1,7 +1,7 @@ const _ = require('lodash'); const fs = require('fs'); const path = require('path'); -const glob = require('glob'); +const { globSync } = require('tinyglobby'); function getLatestArtifactsDir() { if (!fs.existsSync('artifacts')) { @@ -25,7 +25,7 @@ function assertDirExists(dirPath) { function assertArtifactExists(pattern) { const artifactsRootDir = getLatestArtifactsDir(); - const matchingArtifacts = glob.sync(pattern, { cwd: artifactsRootDir }); + const matchingArtifacts = globSync(pattern, { cwd: artifactsRootDir }); if (matchingArtifacts.length === 0) { throw new Error('Assertion failed.\nFailed to find artifacts matching: ' + path.join(artifactsRootDir, pattern)); } diff --git a/yarn.lock b/yarn.lock index 0274c1e436..b9f1f14d55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10204,7 +10204,6 @@ __metadata: find-up: "npm:^5.0.0" fs-extra: "npm:^11.0.0" funpermaproxy: "npm:^1.1.0" - glob: "npm:^8.0.3" ini: "npm:^1.3.4" jest: "npm:^30.0.3" jest-allure2-reporter: "npm:^2.2.6" @@ -10229,6 +10228,7 @@ __metadata: stream-json: "npm:^1.7.4" strip-ansi: "npm:^6.0.1" telnet-client: "npm:1.2.8" + tinyglobby: "npm:^0.2.16" tmp: "npm:^0.2.1" trace-event-lib: "npm:^1.3.1" typescript: "npm:^5.8.3" @@ -13163,7 +13163,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.0, glob@npm:^8.0.3": +"glob@npm:^8.0.0": version: 8.1.0 resolution: "glob@npm:8.1.0" dependencies: @@ -20430,6 +20430,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.4": + version: 4.0.4 + resolution: "picomatch@npm:4.0.4" + checksum: 10/f6ef80a3590827ce20378ae110ac78209cc4f74d39236370f1780f957b7ee41c12acde0e4651b90f39983506fd2f5e449994716f516db2e9752924aff8de93ce + languageName: node + linkType: hard + "pify@npm:^2.0.0, pify@npm:^2.2.0, pify@npm:^2.3.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -25746,6 +25753,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.16": + version: 0.2.16 + resolution: "tinyglobby@npm:0.2.16" + dependencies: + fdir: "npm:^6.5.0" + picomatch: "npm:^4.0.4" + checksum: 10/5c2c41b572ada38449e7c86a5fe034f204a1dbba577225a761a14f29f48dc3f2fc0d81a6c56fcc67c5a742cc3aa9fb5e2ca18dbf22b610b0bc0e549b34d5a0f8 + languageName: node + linkType: hard + "tmp@npm:^0.2.1": version: 0.2.5 resolution: "tmp@npm:0.2.5"