@wdio/config
Advanced tools
Comparing version 8.19.0 to 8.20.0
import { DEFAULT_CONFIGS } from './constants.js'; | ||
import { validateConfig, isCloudCapability } from './utils.js'; | ||
import ConfigParser from './lib/ConfigParser.js'; | ||
export { validateConfig, isCloudCapability, ConfigParser, | ||
export { | ||
/** | ||
* configuration helpers | ||
*/ | ||
validateConfig, isCloudCapability, | ||
/** | ||
* constants | ||
@@ -7,0 +10,0 @@ */ |
/* istanbul ignore file */ | ||
import { DEFAULT_CONFIGS } from './constants.js'; | ||
import { validateConfig, isCloudCapability } from './utils.js'; | ||
import ConfigParser from './lib/ConfigParser.js'; | ||
export { validateConfig, isCloudCapability, ConfigParser, | ||
export { | ||
/** | ||
* configuration helpers | ||
*/ | ||
validateConfig, isCloudCapability, | ||
/** | ||
* constants | ||
@@ -8,0 +11,0 @@ */ |
import type { Options } from '@wdio/types'; | ||
import type { ModuleImportService } from './types.js'; | ||
export declare const validObjectOrArray: (object: any) => object is object | any[]; | ||
@@ -25,7 +24,3 @@ /** | ||
export declare function validateConfig<T>(defaults: Options.Definition<T>, options: T, keysToKeep?: (keyof T)[]): T; | ||
export declare function loadAutoCompilers(autoCompileConfig: Options.AutoCompileConfig, requireService: ModuleImportService): Promise<boolean | undefined>; | ||
export declare function loadTypeScriptCompiler(autoCompileConfig: Options.AutoCompileConfig): Promise<boolean>; | ||
export declare function objectToEnv(params?: Record<string, any>): void; | ||
export declare function loadBabelCompiler(babelOpts: Record<string, any> | undefined, requireService: ModuleImportService): Promise<boolean>; | ||
export declare function makeRelativeToCWD(files?: (string | string[])[]): (string | string[])[]; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -1,7 +0,2 @@ | ||
import url from 'node:url'; | ||
import path from 'node:path'; | ||
import logger from '@wdio/logger'; | ||
import decamelize from 'decamelize'; | ||
import { resolve } from 'import-meta-resolve'; | ||
const log = logger('@wdio/config:utils'); | ||
export const validObjectOrArray = (object) => (Array.isArray(object) && object.length > 0) || | ||
@@ -81,33 +76,2 @@ (typeof object === 'object' && Object.keys(object).length > 0); | ||
} | ||
export async function loadAutoCompilers(autoCompileConfig, requireService) { | ||
if (!autoCompileConfig.autoCompile) { | ||
return; | ||
} | ||
return (await loadTypeScriptCompiler(autoCompileConfig) || | ||
await loadBabelCompiler(autoCompileConfig.babelOpts, requireService)); | ||
} | ||
export async function loadTypeScriptCompiler(autoCompileConfig) { | ||
/** | ||
* don't auto compile within worker as it already was spawn with a loader | ||
*/ | ||
if (process.env.WDIO_WORKER_ID) { | ||
return false; | ||
} | ||
try { | ||
/** | ||
* only for testing purposes | ||
*/ | ||
if (process.env.VITEST_WORKER_ID && process.env.THROW_TSNODE_RESOLVE) { | ||
throw new Error('test fail'); | ||
} | ||
await resolve('ts-node', import.meta.url); | ||
process.env.WDIO_LOAD_TS_NODE = '1'; | ||
objectToEnv(autoCompileConfig.tsNodeOpts); | ||
return true; | ||
} | ||
catch (err) { | ||
log.debug(`Failed loading TS Node: ${err.message}`); | ||
return false; | ||
} | ||
} | ||
export function objectToEnv(params) { | ||
@@ -136,32 +100,1 @@ /** | ||
} | ||
export async function loadBabelCompiler(babelOpts = {}, requireService) { | ||
try { | ||
/** | ||
* only for testing purposes | ||
*/ | ||
if (process.env.VITEST_WORKER_ID && process.env.THROW_BABEL_REGISTER) { | ||
throw new Error('test fail'); | ||
} | ||
(await requireService.import('@babel/register'))(babelOpts); | ||
log.debug('Found \'@babel/register\' package, auto-compiling files with Babel'); | ||
return true; | ||
} | ||
catch (err) { | ||
return false; | ||
} | ||
} | ||
export function makeRelativeToCWD(files = []) { | ||
const returnFiles = []; | ||
for (const file of files) { | ||
if (Array.isArray(file)) { | ||
returnFiles.push(makeRelativeToCWD(file)); | ||
continue; | ||
} | ||
returnFiles.push(file.startsWith('file:///') | ||
? url.fileURLToPath(file) | ||
: file.includes('/') | ||
? path.resolve(process.cwd(), file) | ||
: file); | ||
} | ||
return returnFiles; | ||
} |
{ | ||
"name": "@wdio/config", | ||
"version": "8.19.0", | ||
"version": "8.20.0", | ||
"description": "A helper utility to parse and validate WebdriverIO options", | ||
@@ -11,3 +11,10 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
"exports": { | ||
".": "./build/index.js", | ||
".": { | ||
"import": "./build/index.js", | ||
"types": "./build/index.d.ts" | ||
}, | ||
"./node": { | ||
"import": "./build/node/index.js", | ||
"types": "./build/node/index.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -34,4 +41,4 @@ }, | ||
"@wdio/logger": "8.16.17", | ||
"@wdio/types": "8.19.0", | ||
"@wdio/utils": "8.19.0", | ||
"@wdio/types": "8.20.0", | ||
"@wdio/utils": "8.20.0", | ||
"decamelize": "^6.0.0", | ||
@@ -50,3 +57,3 @@ "deepmerge-ts": "^5.0.0", | ||
}, | ||
"gitHead": "5179b3b3d0bced033e719890baf4517137ac1576" | ||
"gitHead": "6aa9e33233a6abc832bb16d2e24aaaa382e206b6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44693
30
923
1
+ Added@wdio/types@8.20.0(transitive)
+ Added@wdio/utils@8.20.0(transitive)
- Removed@wdio/types@8.19.0(transitive)
- Removed@wdio/utils@8.19.0(transitive)
Updated@wdio/types@8.20.0
Updated@wdio/utils@8.20.0