allure 3.20.0 → 3.21.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/README.md +25 -1
- package/dist/commands/{agent.js → agents/index.js} +13 -109
- package/dist/commands/agents/lifecycle.d.ts +20 -0
- package/dist/commands/agents/lifecycle.js +91 -0
- package/dist/commands/{agent-run.d.ts → agents/run.d.ts} +1 -13
- package/dist/commands/{agent-run.js → agents/run.js} +12 -67
- package/dist/commands/commons/generate.d.ts +1 -0
- package/dist/commands/commons/generate.js +28 -2
- package/dist/commands/generate.d.ts +2 -0
- package/dist/commands/generate.js +19 -1
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.js +2 -1
- package/dist/commands/migrate.d.ts +6 -0
- package/dist/commands/migrate.js +15 -0
- package/dist/commands/open.d.ts +1 -0
- package/dist/commands/open.js +12 -2
- package/dist/commands/qualityGate.js +11 -1
- package/dist/commands/run.d.ts +4 -0
- package/dist/commands/run.js +27 -5
- package/dist/commands/slack.d.ts +3 -2
- package/dist/commands/slack.js +17 -5
- package/dist/commands/testopsPlan.js +4 -4
- package/dist/commands/watch.d.ts +1 -0
- package/dist/commands/watch.js +10 -1
- package/dist/index.js +30 -9
- package/dist/utils/allure2Hints.d.ts +8 -0
- package/dist/utils/allure2Hints.js +90 -0
- package/dist/utils/cleanOutput.d.ts +9 -0
- package/dist/utils/cleanOutput.js +62 -0
- package/dist/utils/fileSystem.d.ts +4 -1
- package/dist/utils/fileSystem.js +3 -3
- package/dist/utils/serverOptions.d.ts +5 -0
- package/dist/utils/serverOptions.js +4 -0
- package/dist/utils/updateNotifier.d.ts +6 -0
- package/dist/utils/updateNotifier.js +58 -0
- package/dist/utils/verbosity.d.ts +7 -0
- package/dist/utils/verbosity.js +32 -0
- package/package.json +28 -23
- /package/dist/commands/{agent-human-report.d.ts → agents/human-report.d.ts} +0 -0
- /package/dist/commands/{agent-human-report.js → agents/human-report.js} +0 -0
- /package/dist/commands/{agent.d.ts → agents/index.d.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const isNewerVersion: (candidate: unknown, current: unknown) => boolean;
|
|
2
|
+
export declare const parseUpdateNotifierArgs: (args: string[]) => {
|
|
3
|
+
args: string[];
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const notifyAboutUpdate: (args: string[], disabled?: boolean) => Promise<void>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
const parseVersion = (version) => {
|
|
4
|
+
const match = typeof version === "string" && /^(\d+)\.(\d+)\.(\d+)(?:-([a-z][a-z-]*)\.(\d+))?(?:\+[\w.-]+)?$/.exec(version);
|
|
5
|
+
if (!match)
|
|
6
|
+
return undefined;
|
|
7
|
+
const numbers = [Number(match[1]), Number(match[2]), Number(match[3]), ...(match[5] ? [Number(match[5])] : [])];
|
|
8
|
+
if (!numbers.every(Number.isSafeInteger))
|
|
9
|
+
return undefined;
|
|
10
|
+
return { numbers: [...numbers.slice(0, 3), match[5] ? numbers[3] : Infinity], distTag: match[4] ?? "latest" };
|
|
11
|
+
};
|
|
12
|
+
export const isNewerVersion = (candidate, current) => {
|
|
13
|
+
const remote = parseVersion(candidate);
|
|
14
|
+
const local = parseVersion(current);
|
|
15
|
+
if (!remote || !local || (remote.distTag !== "latest" && remote.distTag !== local.distTag))
|
|
16
|
+
return false;
|
|
17
|
+
const index = remote.numbers.findIndex((value, position) => value !== local.numbers[position]);
|
|
18
|
+
return index !== -1 && remote.numbers[index] > local.numbers[index];
|
|
19
|
+
};
|
|
20
|
+
export const parseUpdateNotifierArgs = (args) => {
|
|
21
|
+
const separatorIndex = args.indexOf("--");
|
|
22
|
+
const cliArgs = separatorIndex === -1 ? args : args.slice(0, separatorIndex);
|
|
23
|
+
return {
|
|
24
|
+
args: [...cliArgs.filter((arg) => arg !== "--no-update-notifier"), ...args.slice(cliArgs.length)],
|
|
25
|
+
disabled: cliArgs.includes("--no-update-notifier"),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export const notifyAboutUpdate = async (args, disabled = false) => {
|
|
29
|
+
const env = process.env;
|
|
30
|
+
const separatorIndex = args.indexOf("--");
|
|
31
|
+
const cliArgs = separatorIndex === -1 ? args : args.slice(0, separatorIndex);
|
|
32
|
+
if (disabled ||
|
|
33
|
+
!process.stderr.isTTY ||
|
|
34
|
+
!cliArgs.length ||
|
|
35
|
+
cliArgs[0] === "agent" ||
|
|
36
|
+
cliArgs.some((arg) => ["--help", "-h", "--version", "-v"].includes(arg)) ||
|
|
37
|
+
env.NO_UPDATE_NOTIFIER !== undefined ||
|
|
38
|
+
env.NODE_ENV === "test" ||
|
|
39
|
+
(env.CI !== undefined && env.CI !== "false" && env.CI !== "0") ||
|
|
40
|
+
env.npm_config_user_agent !== undefined ||
|
|
41
|
+
env.npm_execpath !== undefined)
|
|
42
|
+
return;
|
|
43
|
+
try {
|
|
44
|
+
const pkg = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8"));
|
|
45
|
+
const current = parseVersion(pkg.version);
|
|
46
|
+
if (!current || typeof pkg.name !== "string")
|
|
47
|
+
return;
|
|
48
|
+
const response = await fetch(`https://registry.npmjs.org/${encodeURIComponent(pkg.name)}/${encodeURIComponent(current.distTag)}`, { signal: AbortSignal.timeout(1000) });
|
|
49
|
+
if (!response.ok)
|
|
50
|
+
return;
|
|
51
|
+
const data = (await response.json());
|
|
52
|
+
if (isNewerVersion(data?.version, pkg.version)) {
|
|
53
|
+
process.stderr.write(`\nUpdate available ${pkg.version} → ${data.version}\nUpdate Allure using your package manager (${pkg.name}@${current.distTag}).\n\n`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type Verbosity = "verbose" | "quiet" | "normal";
|
|
2
|
+
export declare const isQuiet: () => boolean;
|
|
3
|
+
export declare const extractVerbosityFlags: (args: string[]) => {
|
|
4
|
+
args: string[];
|
|
5
|
+
verbosity: Verbosity;
|
|
6
|
+
};
|
|
7
|
+
export declare const applyVerbosity: (verbosity: Verbosity) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { setGlobalLogLevel } from "@allurereport/cli-commons";
|
|
2
|
+
import { UsageError } from "clipanion";
|
|
3
|
+
const LOG_LEVELS = {
|
|
4
|
+
verbose: "verbose",
|
|
5
|
+
quiet: "error",
|
|
6
|
+
normal: undefined,
|
|
7
|
+
};
|
|
8
|
+
const isVerboseFlag = (arg) => arg === "--verbose" || arg === "-v";
|
|
9
|
+
const isQuietFlag = (arg) => arg === "--quiet" || arg === "-q";
|
|
10
|
+
let currentVerbosity = "normal";
|
|
11
|
+
export const isQuiet = () => currentVerbosity === "quiet";
|
|
12
|
+
export const extractVerbosityFlags = (args) => {
|
|
13
|
+
if (args.length === 1 && args[0] === "-v") {
|
|
14
|
+
return { args, verbosity: "normal" };
|
|
15
|
+
}
|
|
16
|
+
const separator = args.indexOf("--");
|
|
17
|
+
const own = separator === -1 ? args : args.slice(0, separator);
|
|
18
|
+
const nested = separator === -1 ? [] : args.slice(separator);
|
|
19
|
+
const verbose = own.some(isVerboseFlag);
|
|
20
|
+
const quiet = own.some(isQuietFlag);
|
|
21
|
+
if (verbose && quiet) {
|
|
22
|
+
throw new UsageError("--verbose and --quiet cannot be used together");
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
args: [...own.filter((arg) => !isVerboseFlag(arg) && !isQuietFlag(arg)), ...nested],
|
|
26
|
+
verbosity: verbose ? "verbose" : quiet ? "quiet" : "normal",
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export const applyVerbosity = (verbosity) => {
|
|
30
|
+
currentVerbosity = verbosity;
|
|
31
|
+
setGlobalLogLevel(LOG_LEVELS[verbosity]);
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "Allure Commandline Tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -28,32 +28,35 @@
|
|
|
28
28
|
"clean": "rimraf ./dist",
|
|
29
29
|
"start": "node ./cli.js",
|
|
30
30
|
"test": "vitest run",
|
|
31
|
+
"test:unit": "yarn test",
|
|
31
32
|
"lint": "oxlint --import-plugin src test features stories",
|
|
32
33
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@allurereport/charts-api": "3.
|
|
36
|
-
"@allurereport/ci": "3.
|
|
37
|
-
"@allurereport/cli-commons": "3.
|
|
38
|
-
"@allurereport/core": "3.
|
|
39
|
-
"@allurereport/core-api": "3.
|
|
40
|
-
"@allurereport/directory-watcher": "3.
|
|
41
|
-
"@allurereport/plugin-agent": "3.
|
|
42
|
-
"@allurereport/plugin-allure2": "3.
|
|
43
|
-
"@allurereport/plugin-api": "3.
|
|
44
|
-
"@allurereport/plugin-awesome": "3.
|
|
45
|
-
"@allurereport/plugin-classic": "3.
|
|
46
|
-
"@allurereport/plugin-csv": "3.
|
|
47
|
-
"@allurereport/plugin-dashboard": "3.
|
|
48
|
-
"@allurereport/plugin-jira": "3.
|
|
49
|
-
"@allurereport/plugin-log": "3.
|
|
50
|
-
"@allurereport/plugin-
|
|
51
|
-
"@allurereport/plugin-
|
|
52
|
-
"@allurereport/plugin-
|
|
53
|
-
"@allurereport/
|
|
54
|
-
"@allurereport/
|
|
55
|
-
"@allurereport/
|
|
56
|
-
"
|
|
36
|
+
"@allurereport/charts-api": "3.21.0",
|
|
37
|
+
"@allurereport/ci": "3.21.0",
|
|
38
|
+
"@allurereport/cli-commons": "3.21.0",
|
|
39
|
+
"@allurereport/core": "3.21.0",
|
|
40
|
+
"@allurereport/core-api": "3.21.0",
|
|
41
|
+
"@allurereport/directory-watcher": "3.21.0",
|
|
42
|
+
"@allurereport/plugin-agent": "3.21.0",
|
|
43
|
+
"@allurereport/plugin-allure2": "3.21.0",
|
|
44
|
+
"@allurereport/plugin-api": "3.21.0",
|
|
45
|
+
"@allurereport/plugin-awesome": "3.21.0",
|
|
46
|
+
"@allurereport/plugin-classic": "3.21.0",
|
|
47
|
+
"@allurereport/plugin-csv": "3.21.0",
|
|
48
|
+
"@allurereport/plugin-dashboard": "3.21.0",
|
|
49
|
+
"@allurereport/plugin-jira": "3.21.0",
|
|
50
|
+
"@allurereport/plugin-log": "3.21.0",
|
|
51
|
+
"@allurereport/plugin-metrics": "3.21.0",
|
|
52
|
+
"@allurereport/plugin-progress": "3.21.0",
|
|
53
|
+
"@allurereport/plugin-server-reload": "3.21.0",
|
|
54
|
+
"@allurereport/plugin-slack": "3.21.0",
|
|
55
|
+
"@allurereport/plugin-xray": "3.21.0",
|
|
56
|
+
"@allurereport/reader-api": "3.21.0",
|
|
57
|
+
"@allurereport/service": "3.21.0",
|
|
58
|
+
"@allurereport/static-server": "3.21.0",
|
|
59
|
+
"adm-zip": "0.6.1",
|
|
57
60
|
"clipanion": "^4.0.0-rc.4",
|
|
58
61
|
"glob": "^13.0.6",
|
|
59
62
|
"lodash.omit": "^4.18.0",
|
|
@@ -62,10 +65,12 @@
|
|
|
62
65
|
"yoctocolors": "^2.2.0"
|
|
63
66
|
},
|
|
64
67
|
"devDependencies": {
|
|
68
|
+
"@allurereport/test-config": "3.21.0",
|
|
65
69
|
"@types/adm-zip": "^0",
|
|
66
70
|
"@types/lodash.omit": "^4.5.9",
|
|
67
71
|
"@types/node": "^20",
|
|
68
72
|
"@types/prompts": "^2",
|
|
73
|
+
"@vitest/coverage-istanbul": "^4.1.0",
|
|
69
74
|
"@vitest/runner": "^2",
|
|
70
75
|
"@vitest/snapshot": "^5.0.1",
|
|
71
76
|
"allure-js-commons": "^3",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|