Skip to content

Commit d335c34

Browse files
fix build
1 parent 60a31a2 commit d335c34

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import os from 'node:os'
2-
import logger from '@wdio/logger'
32

43
export const MOZ_CENTRAL_CARGO_TOML = 'https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/geckodriver/Cargo.toml'
54
export const BASE_CDN_URL = process.env.GECKODRIVER_CDNURL || process.env.npm_config_geckodriver_cdnurl || 'https://github.com/mozilla/geckodriver/releases/download'
65
// e.g. https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-macos-aarch64.tar.gz
76
export const GECKODRIVER_DOWNLOAD_PATH = `${BASE_CDN_URL}/v%s/geckodriver-v%s-%s%s%s`
87
export const DEFAULT_HOSTNAME = '0.0.0.0'
98
export const BINARY_FILE = 'geckodriver' + (os.platform() === 'win32' ? '.exe' : '')
10-
export const log = logger('geckodriver')

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import cp from 'node:child_process'
2+
import logger from '@wdio/logger'
23

34
import { download as downloadDriver } from './install.js'
45
import { hasAccess, parseParams } from './utils.js'
5-
import { DEFAULT_HOSTNAME, log } from './constants.js'
6+
import { DEFAULT_HOSTNAME } from './constants.js'
67
import type { GeckodriverParameters } from './types.js'
78

9+
const log = logger('geckodriver')
10+
811
export async function start (params: GeckodriverParameters) {
912
const { cacheDir, customGeckoDriverPath, ...startArgs } = params
1013
let geckoDriverPath = process.env.GECKODRIVER_FILEPATH || customGeckoDriverPath

src/install.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ import fsp from 'node:fs/promises'
77
import zlib from 'node:zlib'
88
import { Readable } from 'node:stream'
99

10+
import logger from '@wdio/logger'
1011
import tar from 'tar-fs'
1112
import { type RequestInit } from 'node-fetch'
1213
import { HttpsProxyAgent } from 'https-proxy-agent'
1314
import { HttpProxyAgent } from 'http-proxy-agent'
1415
import unzipper, { type Entry } from 'unzipper'
1516

16-
import { BINARY_FILE, MOZ_CENTRAL_CARGO_TOML, log } from './constants.js'
17+
import { BINARY_FILE, MOZ_CENTRAL_CARGO_TOML } from './constants.js'
1718
import { hasAccess, getDownloadUrl, retryFetch } from './utils.js'
1819

20+
const log = logger('geckodriver')
1921
const streamPipeline = util.promisify(stream.pipeline)
2022

2123
const fetchOpts: RequestInit = {}

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export function parseParams(params: GeckodriverParameters) {
3939
if (typeof val === 'boolean' && !val) {
4040
return ''
4141
}
42-
const vals = Array.isArray(val) ? val : [val]
43-
return vals.map((v) => `--${decamelize(key, { separator: '-' })}${typeof v === 'boolean' ? '' : `=${v}`}`)
42+
const values = Array.isArray(val) ? val : [val]
43+
return values.map((v) => `--${decamelize(key, { separator: '-' })}${typeof v === 'boolean' ? '' : `=${v}`}`)
4444
})
4545
.flat()
4646
.filter(Boolean)

tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"compilerOptions": {
3-
"module": "ESNext",
3+
"module": "NodeNext",
44
"target": "ES2020",
55
"baseUrl": "src",
66
"outDir": "./dist",
7-
"moduleResolution": "node",
7+
"moduleResolution": "Node16",
88
"declaration": true,
99
"declarationMap": true,
1010
"noUnusedLocals": true,
@@ -23,4 +23,3 @@
2323
"include": ["src/**/*", "src/cjs/package.json"],
2424
"ignore": ["node_modules", "dist"]
2525
}
26-

0 commit comments

Comments
 (0)