@wdio/config 7.0.4 → 7.2.1
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/build/constants.d.ts +0 -1
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +9 -9
- package/build/lib/ConfigParser.d.ts +0 -1
- package/build/lib/ConfigParser.d.ts.map +1 -1
- package/build/lib/ConfigParser.js +2 -16
- package/build/utils.d.ts +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +10 -4
- package/package.json +5 -4
package/build/constants.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ import { Options, Services } from '@wdio/types';
|
|
|
2
2
|
export declare const DEFAULT_CONFIGS: () => Omit<Options.Testrunner, 'capabilities'>;
|
|
3
3
|
export declare const SUPPORTED_HOOKS: (keyof Services.Hooks)[];
|
|
4
4
|
export declare const SUPPORTED_FILE_EXTENSIONS: string[];
|
|
5
|
-
export declare const DEFAULT_AUTOCOMPILE_CONFIGS: () => Options.AutoCompileConfig;
|
|
6
5
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM/C,eAAO,MAAM,eAAe,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM/C,eAAO,MAAM,eAAe,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CA8EzE,CAAA;AAEF,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAMnD,CAAA;AAED,eAAO,MAAM,yBAAyB,UAErC,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SUPPORTED_FILE_EXTENSIONS = exports.SUPPORTED_HOOKS = exports.DEFAULT_CONFIGS = void 0;
|
|
4
4
|
const DEFAULT_TIMEOUT = 10000;
|
|
5
5
|
/* istanbul ignore next */
|
|
6
6
|
exports.DEFAULT_CONFIGS = () => ({
|
|
@@ -31,13 +31,20 @@ exports.DEFAULT_CONFIGS = () => ({
|
|
|
31
31
|
reporterSyncInterval: 100,
|
|
32
32
|
reporterSyncTimeout: 5000,
|
|
33
33
|
cucumberFeaturesWithLineNumbers: [],
|
|
34
|
+
autoCompileOpts: {
|
|
35
|
+
autoCompile: true,
|
|
36
|
+
tsNodeOpts: {
|
|
37
|
+
transpileOnly: true
|
|
38
|
+
},
|
|
39
|
+
babelOpts: {}
|
|
40
|
+
},
|
|
34
41
|
/**
|
|
35
42
|
* framework defaults
|
|
36
43
|
*/
|
|
37
44
|
mochaOpts: {
|
|
38
45
|
timeout: DEFAULT_TIMEOUT
|
|
39
46
|
},
|
|
40
|
-
|
|
47
|
+
jasmineOpts: {
|
|
41
48
|
defaultTimeoutInterval: DEFAULT_TIMEOUT
|
|
42
49
|
},
|
|
43
50
|
cucumberOpts: {
|
|
@@ -82,10 +89,3 @@ exports.SUPPORTED_HOOKS = [
|
|
|
82
89
|
exports.SUPPORTED_FILE_EXTENSIONS = [
|
|
83
90
|
'.js', '.mjs', '.es6', '.ts', '.feature', '.coffee', '.cjs'
|
|
84
91
|
];
|
|
85
|
-
exports.DEFAULT_AUTOCOMPILE_CONFIGS = () => ({
|
|
86
|
-
autoCompile: true,
|
|
87
|
-
tsNodeOpts: {
|
|
88
|
-
transpileOnly: true
|
|
89
|
-
},
|
|
90
|
-
babelOpts: {}
|
|
91
|
-
});
|
|
@@ -28,7 +28,6 @@ interface Globber {
|
|
|
28
28
|
export interface PathService extends CurrentPathFinder, LoadConfigFile, IsFileDetector, Globber, DeterminesAbsolutePath {
|
|
29
29
|
}
|
|
30
30
|
export default class ConfigParser {
|
|
31
|
-
private _autocompileConfig;
|
|
32
31
|
private _config;
|
|
33
32
|
private _capabilities;
|
|
34
33
|
private _pathService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/lib/ConfigParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAEgB,oBAAoB,EAC1C,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/lib/ConfigParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAEgB,oBAAoB,EAC1C,MAAM,UAAU,CAAA;AAajB,UAAU,+BAAgC,SAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC;IACtF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAA;CACjD;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7F,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC9B;AAGD,UAAU,iBAAiB;IACvB,MAAM,IAAI,MAAM,CAAA;CACnB;A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,iBAAiB,GAAG,OAAO,GAAG,sBAAoD;CA8BnK"}
|
|
@@ -14,7 +14,6 @@ const log = logger_1.default('@wdio/config:ConfigParser');
|
|
|
14
14
|
const MERGE_OPTIONS = { clone: false };
|
|
15
15
|
class ConfigParser {
|
|
16
16
|
constructor(pathService = new FileSystemPathService_1.default(), moduleRequireService = new RequireLibrary_1.default()) {
|
|
17
|
-
this._autocompileConfig = constants_1.DEFAULT_AUTOCOMPILE_CONFIGS();
|
|
18
17
|
this._config = __1.DEFAULT_CONFIGS();
|
|
19
18
|
this._capabilities = [];
|
|
20
19
|
this._pathService = pathService;
|
|
@@ -24,10 +23,8 @@ class ConfigParser {
|
|
|
24
23
|
/**
|
|
25
24
|
* on launcher compile files if Babel or TypeScript are installed using our defaults
|
|
26
25
|
*/
|
|
27
|
-
if (!utils_1.loadAutoCompilers(this.
|
|
28
|
-
|
|
29
|
-
log.debug('No compiler found, continue without compiling files');
|
|
30
|
-
}
|
|
26
|
+
if (this._config.autoCompileOpts && !utils_1.loadAutoCompilers(this._config.autoCompileOpts, this._moduleRequireService)) {
|
|
27
|
+
log.debug('No compiler found, continue without compiling files');
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
@@ -44,13 +41,6 @@ class ConfigParser {
|
|
|
44
41
|
if (typeof config !== 'object') {
|
|
45
42
|
throw new Error('addConfigEntry requires config key');
|
|
46
43
|
}
|
|
47
|
-
/**
|
|
48
|
-
* on launcher compile files if Babel or TypeScript are installed using our defaults
|
|
49
|
-
*/
|
|
50
|
-
// Merge in config over defaults
|
|
51
|
-
if (config.autoCompileOpts) {
|
|
52
|
-
this._autocompileConfig = deepmerge_1.default(this._autocompileConfig, config.autoCompileOpts, MERGE_OPTIONS);
|
|
53
|
-
}
|
|
54
44
|
/**
|
|
55
45
|
* clone the original config
|
|
56
46
|
*/
|
|
@@ -88,10 +78,6 @@ class ConfigParser {
|
|
|
88
78
|
const spec = Array.isArray(object.spec) ? object.spec : [];
|
|
89
79
|
const exclude = Array.isArray(object.exclude) ? object.exclude : [];
|
|
90
80
|
this._config = deepmerge_1.default(this._config, object, MERGE_OPTIONS);
|
|
91
|
-
// Merge in config over defaults
|
|
92
|
-
if (object.autoCompileOpts) {
|
|
93
|
-
this._autocompileConfig = deepmerge_1.default(this._autocompileConfig, object.autoCompileOpts, MERGE_OPTIONS);
|
|
94
|
-
}
|
|
95
81
|
/**
|
|
96
82
|
* overwrite config specs that got piped into the wdio command
|
|
97
83
|
*/
|
package/build/utils.d.ts
CHANGED
|
@@ -29,6 +29,6 @@ export interface ModuleRequireService {
|
|
|
29
29
|
require<T>(module: string): T;
|
|
30
30
|
}
|
|
31
31
|
export declare function loadAutoCompilers(autoCompileConfig: Options.AutoCompileConfig, requireService: ModuleRequireService): boolean | undefined;
|
|
32
|
-
export declare function loadTypeScriptCompiler(tsNodeOpts: RegisterOptions | undefined, requireService: ModuleRequireService): boolean;
|
|
32
|
+
export declare function loadTypeScriptCompiler(tsNodeOpts: RegisterOptions | undefined, tsConfigPathsOpts: Options.TSConfigPathsOptions | undefined, requireService: ModuleRequireService): boolean;
|
|
33
33
|
export declare function loadBabelCompiler(babelOpts: Record<string, any> | undefined, requireService: ModuleRequireService): boolean;
|
|
34
34
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,eAAO,MAAM,kBAAkB,WAAY,GAAG,6BACoB,CAAA;AAElE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,UAMjD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,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AE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAAE,GAAG,MAAM,CAAA;IACjE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC;CACjC;AAED,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,uBAgBnH;AAED,wBAAgB,sBAAsB,CAClC,UAAU,6BAAsB,EAChC,iBAAiB,EAAE,OAAO,CAAC,oBAAoB,GAAG,SAAS,EAC3D,cAAc,EAAE,oBAAoB,WAiBvC;AAED,wBAAgB,iBAAiB,CAAE,SAAS,iCAA0B,EAAE,cAAc,EAAE,oBAAoB,WAiB3G"}
|
package/build/utils.js
CHANGED
|
@@ -85,16 +85,22 @@ function validateConfig(defaults, options, keysToKeep = []) {
|
|
|
85
85
|
}
|
|
86
86
|
exports.validateConfig = validateConfig;
|
|
87
87
|
function loadAutoCompilers(autoCompileConfig, requireService) {
|
|
88
|
-
return autoCompileConfig.autoCompile &&
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return (autoCompileConfig.autoCompile &&
|
|
89
|
+
(loadTypeScriptCompiler(autoCompileConfig.tsNodeOpts, autoCompileConfig.tsConfigPathsOpts, requireService)
|
|
90
|
+
||
|
|
91
|
+
loadBabelCompiler(autoCompileConfig.babelOpts, requireService)));
|
|
91
92
|
}
|
|
92
93
|
exports.loadAutoCompilers = loadAutoCompilers;
|
|
93
|
-
function loadTypeScriptCompiler(tsNodeOpts = {}, requireService) {
|
|
94
|
+
function loadTypeScriptCompiler(tsNodeOpts = {}, tsConfigPathsOpts, requireService) {
|
|
94
95
|
try {
|
|
95
96
|
requireService.resolve('ts-node');
|
|
96
97
|
requireService.require('ts-node').register(tsNodeOpts);
|
|
97
98
|
log.debug('Found \'ts-node\' package, auto-compiling TypeScript files');
|
|
99
|
+
if (tsConfigPathsOpts) {
|
|
100
|
+
log.debug('Found \'tsconfig-paths\' options, register paths');
|
|
101
|
+
const tsConfigPaths = require('tsconfig-paths');
|
|
102
|
+
tsConfigPaths.register(tsConfigPathsOpts);
|
|
103
|
+
}
|
|
98
104
|
return true;
|
|
99
105
|
}
|
|
100
106
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "A helper utility to parse and validate WebdriverIO options",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-config",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"types": "./build/index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@wdio/logger": "7.0.0",
|
|
27
|
-
"@wdio/types": "7.
|
|
27
|
+
"@wdio/types": "7.2.1",
|
|
28
28
|
"deepmerge": "^4.0.0",
|
|
29
29
|
"glob": "^7.1.2"
|
|
30
30
|
},
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"minimatch": "^3.0.4"
|
|
35
|
+
"minimatch": "^3.0.4",
|
|
36
|
+
"tsconfig-paths": "^3.9.0"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "aa35412bc2f9a1591ace955f91ee7e7eef278ee5"
|
|
38
39
|
}
|