browser-webdriver-downloader 1.5.1 → 1.5.3
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 +8 -8
- package/src/index.js +12 -3
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.3",
|
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
|
-
"yn": "^
|
51
|
+
"yn": "^5.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,8 +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
|
-
const yn = require('yn');
|
13
10
|
|
14
11
|
const platform = os.platform();
|
15
12
|
const arch = os.arch();
|
@@ -50,6 +47,8 @@ function getDownloadName() {
|
|
50
47
|
async function getDriverVersion() {
|
51
48
|
let version;
|
52
49
|
|
50
|
+
const { default: yn } = await import('yn');
|
51
|
+
|
53
52
|
if (process.env.EDGEDRIVER_VERSION) {
|
54
53
|
version = process.env.EDGEDRIVER_VERSION;
|
55
54
|
} else if (yn(process.env.DETECT_EDGEDRIVER_VERSION)) {
|
@@ -93,6 +92,8 @@ async function getDetectedDriverVersion() {
|
|
93
92
|
|
94
93
|
let ps;
|
95
94
|
|
95
|
+
const { execa } = await import('execa');
|
96
|
+
|
96
97
|
try {
|
97
98
|
ps = await execa(browserCmd, ['--version']);
|
98
99
|
} catch (err) {
|
@@ -117,6 +118,9 @@ async function getDetectedDriverVersion() {
|
|
117
118
|
}
|
118
119
|
|
119
120
|
async function getLatestDriverVersion() {
|
121
|
+
// eslint-disable-next-line node/no-missing-import
|
122
|
+
const { got } = await import('got');
|
123
|
+
|
120
124
|
let { body } = await got.get(`${downloadHost}/LATEST_STABLE`);
|
121
125
|
|
122
126
|
// For example: '��102.0.1245.33\r\n'
|
@@ -147,6 +151,8 @@ async function install() {
|
|
147
151
|
let shouldDownload = true;
|
148
152
|
|
149
153
|
if (await fs.exists(driverPath)) {
|
154
|
+
const { execa } = await import('execa');
|
155
|
+
|
150
156
|
let ps = await execa(driverPath, ['--version']);
|
151
157
|
|
152
158
|
// "Microsoft Edge WebDriver 105.0.1343.53 (3a47f00402d579c8ba1fad7e143f9d73831b6765)"
|
@@ -191,6 +197,9 @@ async function download({ tmpPath, version }) {
|
|
191
197
|
|
192
198
|
console.log(`Downloading ${downloadUrl}...`);
|
193
199
|
|
200
|
+
// eslint-disable-next-line node/no-missing-import
|
201
|
+
const { got } = await import('got');
|
202
|
+
|
194
203
|
await pipeline(
|
195
204
|
got.stream(downloadUrl),
|
196
205
|
fs.createWriteStream(downloadPath),
|