browser-webdriver-downloader 1.5.1 → 1.5.2
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/bin/msedgedriver.js +2 -1
- package/package.json +7 -7
- package/src/index.js +10 -2
package/bin/msedgedriver.js
CHANGED
@@ -3,10 +3,11 @@
|
|
3
3
|
|
4
4
|
require('../src/utils/throw-up');
|
5
5
|
|
6
|
-
const execa = require('execa');
|
7
6
|
const { getDriverPath } = require('../src');
|
8
7
|
|
9
8
|
(async () => {
|
9
|
+
const { execa } = await import('execa');
|
10
|
+
|
10
11
|
await execa(getDriverPath(), process.argv.slice(2), {
|
11
12
|
stdio: 'inherit',
|
12
13
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "browser-webdriver-downloader",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.2",
|
4
4
|
"description": "Install and wrap msedgedriver in Node.js",
|
5
5
|
"bin": {
|
6
6
|
"msedgedriver": "bin/msedgedriver.js"
|
@@ -42,23 +42,23 @@
|
|
42
42
|
"node": ">=14.15"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
|
-
"execa": "^
|
45
|
+
"execa": "^6.0.0",
|
46
46
|
"extract-zip": "^2.0.1",
|
47
47
|
"find-edge-version": "0.1.1",
|
48
|
-
"fs-extra": "^
|
49
|
-
"got": "^
|
48
|
+
"fs-extra": "^11.0.0",
|
49
|
+
"got": "^12.0.0",
|
50
50
|
"tmp": "0.2.1",
|
51
51
|
"yn": "^4.0.0"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@crowdstrike/commitlint": "^
|
54
|
+
"@crowdstrike/commitlint": "^6.0.0",
|
55
55
|
"chai": "^4.2.0",
|
56
56
|
"chai-as-promised": "^7.1.1",
|
57
57
|
"chai-fs": "^2.0.0",
|
58
58
|
"eslint": "^8.0.0",
|
59
|
-
"eslint-config-crowdstrike": "^
|
59
|
+
"eslint-config-crowdstrike": "^9.0.0",
|
60
60
|
"eslint-config-crowdstrike-node": "^3.0.0",
|
61
|
-
"eslint-plugin-json-files": "^
|
61
|
+
"eslint-plugin-json-files": "^2.0.0",
|
62
62
|
"eslint-plugin-mocha": "^10.0.0",
|
63
63
|
"eslint-plugin-node": "^11.0.0",
|
64
64
|
"mocha": "^10.0.0",
|
package/src/index.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const got = require('got');
|
4
3
|
const { promisify } = require('util');
|
5
4
|
const fs = { ...require('fs'), ...require('fs').promises, ...require('../src/fs') };
|
6
5
|
const path = require('path');
|
@@ -8,7 +7,6 @@ const extractZip = require('extract-zip');
|
|
8
7
|
const pipeline = promisify(require('stream').pipeline);
|
9
8
|
const os = require('os');
|
10
9
|
const { createTmpDir } = require('../src/tmp');
|
11
|
-
const execa = require('execa');
|
12
10
|
const yn = require('yn');
|
13
11
|
|
14
12
|
const platform = os.platform();
|
@@ -93,6 +91,8 @@ async function getDetectedDriverVersion() {
|
|
93
91
|
|
94
92
|
let ps;
|
95
93
|
|
94
|
+
const { execa } = await import('execa');
|
95
|
+
|
96
96
|
try {
|
97
97
|
ps = await execa(browserCmd, ['--version']);
|
98
98
|
} catch (err) {
|
@@ -117,6 +117,9 @@ async function getDetectedDriverVersion() {
|
|
117
117
|
}
|
118
118
|
|
119
119
|
async function getLatestDriverVersion() {
|
120
|
+
// eslint-disable-next-line node/no-missing-import
|
121
|
+
const { got } = await import('got');
|
122
|
+
|
120
123
|
let { body } = await got.get(`${downloadHost}/LATEST_STABLE`);
|
121
124
|
|
122
125
|
// For example: '��102.0.1245.33\r\n'
|
@@ -147,6 +150,8 @@ async function install() {
|
|
147
150
|
let shouldDownload = true;
|
148
151
|
|
149
152
|
if (await fs.exists(driverPath)) {
|
153
|
+
const { execa } = await import('execa');
|
154
|
+
|
150
155
|
let ps = await execa(driverPath, ['--version']);
|
151
156
|
|
152
157
|
// "Microsoft Edge WebDriver 105.0.1343.53 (3a47f00402d579c8ba1fad7e143f9d73831b6765)"
|
@@ -191,6 +196,9 @@ async function download({ tmpPath, version }) {
|
|
191
196
|
|
192
197
|
console.log(`Downloading ${downloadUrl}...`);
|
193
198
|
|
199
|
+
// eslint-disable-next-line node/no-missing-import
|
200
|
+
const { got } = await import('got');
|
201
|
+
|
194
202
|
await pipeline(
|
195
203
|
got.stream(downloadUrl),
|
196
204
|
fs.createWriteStream(downloadPath),
|