@allurereport/core 3.11.0 → 3.13.0
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/dist/config.d.ts +5 -2
- package/dist/config.js +23 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +20 -20
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Config, PluginDescriptor } from "@allurereport/plugin-api";
|
|
1
|
+
import type { Config, Plugin, PluginConstructorContext, PluginDescriptor } from "@allurereport/plugin-api";
|
|
2
2
|
import type { FullConfig, PluginInstance } from "./api.js";
|
|
3
|
+
type PluginConstructor = new (options?: Record<string, any>, context?: PluginConstructorContext) => Plugin;
|
|
3
4
|
export interface ConfigOverride {
|
|
4
5
|
name?: Config["name"];
|
|
5
6
|
output?: Config["output"];
|
|
@@ -26,5 +27,7 @@ export declare const loadJsonConfig: (configPath: string) => Promise<Config>;
|
|
|
26
27
|
export declare const loadJsConfig: (configPath: string) => Promise<Config>;
|
|
27
28
|
export declare const resolveConfig: (config: Config, override?: ConfigOverride) => Promise<FullConfig>;
|
|
28
29
|
export declare const readConfig: (cwd?: string, configPath?: string, override?: ConfigOverride) => Promise<FullConfig>;
|
|
30
|
+
export declare const readRawConfig: (cwd?: string, configPath?: string) => Promise<Config>;
|
|
29
31
|
export declare const getPluginInstance: (config: FullConfig, predicate: (plugin: PluginInstance) => boolean) => PluginInstance | undefined;
|
|
30
|
-
export declare const resolvePlugin: (path: string) => Promise<
|
|
32
|
+
export declare const resolvePlugin: (path: string) => Promise<PluginConstructor>;
|
|
33
|
+
export {};
|
package/dist/config.js
CHANGED
|
@@ -271,6 +271,22 @@ export const readConfig = async (cwd = process.cwd(), configPath, override) => {
|
|
|
271
271
|
const fullConfig = await resolveConfig(config, override);
|
|
272
272
|
return fullConfig;
|
|
273
273
|
};
|
|
274
|
+
export const readRawConfig = async (cwd = process.cwd(), configPath) => {
|
|
275
|
+
const cfg = (await findConfig(cwd, configPath)) ?? "";
|
|
276
|
+
switch (extname(cfg)) {
|
|
277
|
+
case ".json":
|
|
278
|
+
return loadJsonConfig(cfg);
|
|
279
|
+
case ".yaml":
|
|
280
|
+
case ".yml":
|
|
281
|
+
return loadYamlConfig(cfg);
|
|
282
|
+
case ".js":
|
|
283
|
+
case ".cjs":
|
|
284
|
+
case ".mjs":
|
|
285
|
+
return loadJsConfig(cfg);
|
|
286
|
+
default:
|
|
287
|
+
return DEFAULT_CONFIG;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
274
290
|
export const getPluginInstance = (config, predicate) => {
|
|
275
291
|
return config?.plugins?.find(predicate);
|
|
276
292
|
};
|
|
@@ -303,11 +319,16 @@ const resolvePlugins = async (plugins) => {
|
|
|
303
319
|
const pluginConfig = plugins[id];
|
|
304
320
|
const pluginId = getPluginId(id);
|
|
305
321
|
const Plugin = await resolvePlugin(pluginConfig.import ?? id);
|
|
322
|
+
const enabled = pluginConfig.enabled ?? true;
|
|
323
|
+
const constructorContext = {};
|
|
324
|
+
if ("enabled" in pluginConfig) {
|
|
325
|
+
constructorContext.enabled = pluginConfig.enabled;
|
|
326
|
+
}
|
|
306
327
|
pluginInstances.push({
|
|
307
328
|
id: pluginId,
|
|
308
|
-
enabled
|
|
329
|
+
enabled,
|
|
309
330
|
options: pluginConfig.options ?? {},
|
|
310
|
-
plugin: new Plugin(pluginConfig.options),
|
|
331
|
+
plugin: new Plugin(pluginConfig.options, constructorContext),
|
|
311
332
|
});
|
|
312
333
|
}
|
|
313
334
|
return pluginInstances;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export * from "./utils/flaky.js";
|
|
|
7
7
|
export * from "./utils/environment.js";
|
|
8
8
|
export * from "./history.js";
|
|
9
9
|
export * from "./known.js";
|
|
10
|
-
export { resolveConfig, readConfig, getPluginInstance } from "./config.js";
|
|
10
|
+
export { resolveConfig, readConfig, readRawConfig, getPluginInstance } from "./config.js";
|
|
11
11
|
export * from "./report.js";
|
|
12
12
|
export * from "./plugin.js";
|
|
13
13
|
export { QualityGateState, qualityGateDefaultRules, maxFailuresRule, minTestsCountRule, successRateRule, maxDurationRule, allTestsContainEnvRule, environmentsTestedRule, convertQualityGateResultsToTestErrors, stringifyQualityGateResults, } from "./qualityGate/index.js";
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export * from "./utils/flaky.js";
|
|
|
6
6
|
export * from "./utils/environment.js";
|
|
7
7
|
export * from "./history.js";
|
|
8
8
|
export * from "./known.js";
|
|
9
|
-
export { resolveConfig, readConfig, getPluginInstance } from "./config.js";
|
|
9
|
+
export { resolveConfig, readConfig, readRawConfig, getPluginInstance } from "./config.js";
|
|
10
10
|
export * from "./report.js";
|
|
11
11
|
export * from "./plugin.js";
|
|
12
12
|
export { QualityGateState, qualityGateDefaultRules, maxFailuresRule, minTestsCountRule, successRateRule, maxDurationRule, allTestsContainEnvRule, environmentsTestedRule, convertQualityGateResultsToTestErrors, stringifyQualityGateResults, } from "./qualityGate/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Collection of generic Allure utilities used across the entire project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure"
|
|
@@ -25,25 +25,25 @@
|
|
|
25
25
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@allurereport/ci": "3.
|
|
29
|
-
"@allurereport/core-api": "3.
|
|
30
|
-
"@allurereport/plugin-agent": "3.
|
|
31
|
-
"@allurereport/plugin-allure2": "3.
|
|
32
|
-
"@allurereport/plugin-api": "3.
|
|
33
|
-
"@allurereport/plugin-awesome": "3.
|
|
34
|
-
"@allurereport/plugin-classic": "3.
|
|
35
|
-
"@allurereport/plugin-csv": "3.
|
|
36
|
-
"@allurereport/plugin-dashboard": "3.
|
|
37
|
-
"@allurereport/plugin-jira": "3.
|
|
38
|
-
"@allurereport/plugin-log": "3.
|
|
39
|
-
"@allurereport/plugin-progress": "3.
|
|
40
|
-
"@allurereport/plugin-slack": "3.
|
|
41
|
-
"@allurereport/plugin-testops": "3.
|
|
42
|
-
"@allurereport/plugin-testplan": "3.
|
|
43
|
-
"@allurereport/reader": "3.
|
|
44
|
-
"@allurereport/reader-api": "3.
|
|
45
|
-
"@allurereport/service": "3.
|
|
46
|
-
"@allurereport/summary": "3.
|
|
28
|
+
"@allurereport/ci": "3.13.0",
|
|
29
|
+
"@allurereport/core-api": "3.13.0",
|
|
30
|
+
"@allurereport/plugin-agent": "3.13.0",
|
|
31
|
+
"@allurereport/plugin-allure2": "3.13.0",
|
|
32
|
+
"@allurereport/plugin-api": "3.13.0",
|
|
33
|
+
"@allurereport/plugin-awesome": "3.13.0",
|
|
34
|
+
"@allurereport/plugin-classic": "3.13.0",
|
|
35
|
+
"@allurereport/plugin-csv": "3.13.0",
|
|
36
|
+
"@allurereport/plugin-dashboard": "3.13.0",
|
|
37
|
+
"@allurereport/plugin-jira": "3.13.0",
|
|
38
|
+
"@allurereport/plugin-log": "3.13.0",
|
|
39
|
+
"@allurereport/plugin-progress": "3.13.0",
|
|
40
|
+
"@allurereport/plugin-slack": "3.13.0",
|
|
41
|
+
"@allurereport/plugin-testops": "3.13.0",
|
|
42
|
+
"@allurereport/plugin-testplan": "3.13.0",
|
|
43
|
+
"@allurereport/reader": "3.13.0",
|
|
44
|
+
"@allurereport/reader-api": "3.13.0",
|
|
45
|
+
"@allurereport/service": "3.13.0",
|
|
46
|
+
"@allurereport/summary": "3.13.0",
|
|
47
47
|
"glob": "^13.0.6",
|
|
48
48
|
"handlebars": "^4.7.9",
|
|
49
49
|
"node-stream-zip": "^1.15.0",
|