File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 11import os from 'node:os'
2- import logger from '@wdio/logger'
32
43export const MOZ_CENTRAL_CARGO_TOML = 'https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/geckodriver/Cargo.toml'
54export 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
76export const GECKODRIVER_DOWNLOAD_PATH = `${ BASE_CDN_URL } /v%s/geckodriver-v%s-%s%s%s`
87export const DEFAULT_HOSTNAME = '0.0.0.0'
98export const BINARY_FILE = 'geckodriver' + ( os . platform ( ) === 'win32' ? '.exe' : '' )
10- export const log = logger ( 'geckodriver' )
Original file line number Diff line number Diff line change 11import cp from 'node:child_process'
2+ import logger from '@wdio/logger'
23
34import { download as downloadDriver } from './install.js'
45import { hasAccess , parseParams } from './utils.js'
5- import { DEFAULT_HOSTNAME , log } from './constants.js'
6+ import { DEFAULT_HOSTNAME } from './constants.js'
67import type { GeckodriverParameters } from './types.js'
78
9+ const log = logger ( 'geckodriver' )
10+
811export async function start ( params : GeckodriverParameters ) {
912 const { cacheDir, customGeckoDriverPath, ...startArgs } = params
1013 let geckoDriverPath = process . env . GECKODRIVER_FILEPATH || customGeckoDriverPath
Original file line number Diff line number Diff line change @@ -7,15 +7,17 @@ import fsp from 'node:fs/promises'
77import zlib from 'node:zlib'
88import { Readable } from 'node:stream'
99
10+ import logger from '@wdio/logger'
1011import tar from 'tar-fs'
1112import { type RequestInit } from 'node-fetch'
1213import { HttpsProxyAgent } from 'https-proxy-agent'
1314import { HttpProxyAgent } from 'http-proxy-agent'
1415import 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'
1718import { hasAccess , getDownloadUrl , retryFetch } from './utils.js'
1819
20+ const log = logger ( 'geckodriver' )
1921const streamPipeline = util . promisify ( stream . pipeline )
2022
2123const fetchOpts : RequestInit = { }
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 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 ,
2323 "include" : [" src/**/*" , " src/cjs/package.json" ],
2424 "ignore" : [" node_modules" , " dist" ]
2525 }
26-
You can’t perform that action at this time.
0 commit comments