allure 3.0.0-beta.16 → 3.0.0-beta.17
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/commands/allure2.d.ts +15 -13
- package/dist/commands/allure2.js +67 -79
- package/dist/commands/awesome.d.ts +18 -15
- package/dist/commands/awesome.js +79 -99
- package/dist/commands/classic.d.ts +15 -13
- package/dist/commands/classic.js +67 -79
- package/dist/commands/csv.d.ts +13 -11
- package/dist/commands/csv.js +59 -65
- package/dist/commands/dashboard.d.ts +15 -13
- package/dist/commands/dashboard.js +67 -78
- package/dist/commands/generate.d.ts +11 -9
- package/dist/commands/generate.js +44 -36
- package/dist/commands/history.d.ts +9 -7
- package/dist/commands/history.js +31 -28
- package/dist/commands/knownIssue.d.ts +8 -6
- package/dist/commands/knownIssue.js +30 -23
- package/dist/commands/log.d.ts +12 -9
- package/dist/commands/log.js +54 -58
- package/dist/commands/login.d.ts +8 -7
- package/dist/commands/login.js +39 -36
- package/dist/commands/logout.d.ts +8 -7
- package/dist/commands/logout.js +39 -36
- package/dist/commands/open.d.ts +11 -9
- package/dist/commands/open.js +34 -40
- package/dist/commands/projects/create.d.ts +9 -7
- package/dist/commands/projects/create.js +70 -66
- package/dist/commands/projects/delete.d.ts +10 -7
- package/dist/commands/projects/delete.js +55 -61
- package/dist/commands/projects/list.d.ts +8 -7
- package/dist/commands/projects/list.js +62 -62
- package/dist/commands/qualityGate.d.ts +9 -7
- package/dist/commands/qualityGate.js +46 -42
- package/dist/commands/run.d.ts +13 -10
- package/dist/commands/run.js +102 -111
- package/dist/commands/slack.d.ts +9 -7
- package/dist/commands/slack.js +51 -48
- package/dist/commands/testplan.d.ts +8 -6
- package/dist/commands/testplan.js +36 -29
- package/dist/commands/watch.d.ts +12 -10
- package/dist/commands/watch.js +103 -99
- package/dist/commands/whoami.d.ts +8 -7
- package/dist/commands/whoami.js +44 -38
- package/dist/index.js +31 -35
- package/package.json +19 -19
- package/dist/utils/commands.d.ts +0 -16
- package/dist/utils/commands.js +0 -16
package/dist/commands/watch.js
CHANGED
|
@@ -5,114 +5,118 @@ import ProgressPlugin from "@allurereport/plugin-progress";
|
|
|
5
5
|
import ServerReloadPlugin from "@allurereport/plugin-server-reload";
|
|
6
6
|
import { PathResultFile } from "@allurereport/reader-api";
|
|
7
7
|
import { serve } from "@allurereport/static-server";
|
|
8
|
+
import { Command, Option } from "clipanion";
|
|
8
9
|
import * as console from "node:console";
|
|
9
10
|
import { rm } from "node:fs/promises";
|
|
10
11
|
import { join, resolve } from "node:path";
|
|
11
12
|
import process from "node:process";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
export class WatchCommand extends Command {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.resultsDir = Option.String({ required: true, name: "The directory with Allure results" });
|
|
17
|
+
this.config = Option.String("--config,-c", {
|
|
18
|
+
description: "The path Allure config file",
|
|
19
|
+
});
|
|
20
|
+
this.cwd = Option.String("--cwd", {
|
|
21
|
+
description: "The working directory for the command to run (default: current working directory)",
|
|
22
|
+
});
|
|
23
|
+
this.output = Option.String("--output,-o", {
|
|
24
|
+
description: "The output file name, allure.csv by default. Accepts absolute paths (default: ./allure-report)",
|
|
25
|
+
});
|
|
26
|
+
this.reportName = Option.String("--report-name,--name", {
|
|
27
|
+
description: "The report name (default: Allure Report)",
|
|
28
|
+
});
|
|
29
|
+
this.port = Option.String("--port", {
|
|
30
|
+
description: "The port to serve the reports on (default: random port)",
|
|
31
|
+
});
|
|
23
32
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
async execute() {
|
|
34
|
+
const before = new Date().getTime();
|
|
35
|
+
process.on("exit", (code) => {
|
|
36
|
+
const after = new Date().getTime();
|
|
37
|
+
console.log(`exit code ${code} (${after - before}ms)`);
|
|
38
|
+
});
|
|
39
|
+
const config = await readConfig(this.cwd, this.config, {
|
|
40
|
+
output: this.output,
|
|
41
|
+
name: this.reportName,
|
|
42
|
+
});
|
|
43
|
+
try {
|
|
44
|
+
await rm(config.output, { recursive: true });
|
|
27
45
|
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
if (!isFileNotFoundError(e)) {
|
|
48
|
+
console.error("could not clean output directory", e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const server = await serve({
|
|
52
|
+
servePath: config.output,
|
|
53
|
+
port: this.port ? parseInt(this.port, 10) : undefined,
|
|
54
|
+
live: false,
|
|
55
|
+
open: false,
|
|
56
|
+
});
|
|
57
|
+
const allureReport = new AllureReport({
|
|
58
|
+
...config,
|
|
59
|
+
realTime: true,
|
|
60
|
+
plugins: [
|
|
61
|
+
...(config.plugins?.length
|
|
62
|
+
? config.plugins
|
|
63
|
+
: [
|
|
64
|
+
{
|
|
65
|
+
id: "awesome",
|
|
66
|
+
enabled: true,
|
|
67
|
+
options: {},
|
|
68
|
+
plugin: new Awesome({
|
|
69
|
+
reportName: config.name,
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
]),
|
|
73
|
+
{
|
|
74
|
+
id: "watch log",
|
|
75
|
+
enabled: true,
|
|
76
|
+
options: {},
|
|
77
|
+
plugin: new ProgressPlugin(),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "server reload",
|
|
81
|
+
enabled: true,
|
|
82
|
+
options: {},
|
|
83
|
+
plugin: new ServerReloadPlugin({
|
|
84
|
+
server,
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
await allureReport.start();
|
|
90
|
+
const input = resolve(this.resultsDir[0]);
|
|
91
|
+
const { abort } = newFilesInDirectoryWatcher(input, async (path) => {
|
|
92
|
+
await allureReport.readResult(new PathResultFile(path));
|
|
93
|
+
});
|
|
94
|
+
const pluginIdToOpen = config.plugins?.find((plugin) => !!plugin.options.open)?.id;
|
|
95
|
+
if (pluginIdToOpen) {
|
|
96
|
+
await server.open(join(server.url, pluginIdToOpen));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
await server.open(server.url);
|
|
100
|
+
}
|
|
101
|
+
console.info("Press Ctrl+C to exit");
|
|
102
|
+
process.on("SIGINT", async () => {
|
|
103
|
+
console.log("");
|
|
104
|
+
await abort();
|
|
105
|
+
await server.stop();
|
|
106
|
+
await allureReport.done();
|
|
107
|
+
process.exit(0);
|
|
108
|
+
});
|
|
28
109
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
live: false,
|
|
33
|
-
open: false,
|
|
34
|
-
});
|
|
35
|
-
const allureReport = new AllureReport({
|
|
36
|
-
...config,
|
|
37
|
-
realTime: true,
|
|
38
|
-
plugins: [
|
|
39
|
-
...(config.plugins?.length
|
|
40
|
-
? config.plugins
|
|
41
|
-
: [
|
|
42
|
-
{
|
|
43
|
-
id: "awesome",
|
|
44
|
-
enabled: true,
|
|
45
|
-
options: {},
|
|
46
|
-
plugin: new Awesome({
|
|
47
|
-
reportName: config.name,
|
|
48
|
-
}),
|
|
49
|
-
},
|
|
50
|
-
]),
|
|
51
|
-
{
|
|
52
|
-
id: "watch log",
|
|
53
|
-
enabled: true,
|
|
54
|
-
options: {},
|
|
55
|
-
plugin: new ProgressPlugin(),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: "server reload",
|
|
59
|
-
enabled: true,
|
|
60
|
-
options: {},
|
|
61
|
-
plugin: new ServerReloadPlugin({
|
|
62
|
-
server,
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
});
|
|
67
|
-
await allureReport.start();
|
|
68
|
-
const input = resolve(resultsDir);
|
|
69
|
-
const { abort } = newFilesInDirectoryWatcher(input, async (path) => {
|
|
70
|
-
await allureReport.readResult(new PathResultFile(path));
|
|
71
|
-
});
|
|
72
|
-
const pluginIdToOpen = config.plugins?.find((plugin) => !!plugin.options.open)?.id;
|
|
73
|
-
if (pluginIdToOpen) {
|
|
74
|
-
await server.open(join(server.url, pluginIdToOpen));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
await server.open(server.url);
|
|
78
|
-
}
|
|
79
|
-
console.info("Press Ctrl+C to exit");
|
|
80
|
-
process.on("SIGINT", async () => {
|
|
81
|
-
console.log("");
|
|
82
|
-
await abort();
|
|
83
|
-
await server.stop();
|
|
84
|
-
await allureReport.done();
|
|
85
|
-
process.exit(0);
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
export const WatchCommand = createCommand({
|
|
89
|
-
name: "watch <resultsDir>",
|
|
110
|
+
}
|
|
111
|
+
WatchCommand.paths = [["watch"]];
|
|
112
|
+
WatchCommand.usage = Command.Usage({
|
|
90
113
|
description: "Watches Allure Results changes in Real-time",
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
description: "The working directory for the command to run (default: current working directory)",
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"--output, -o <file>",
|
|
100
|
-
{
|
|
101
|
-
description: "The output file name, allure.csv by default. Accepts absolute paths (default: ./allure-report)",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
"--report-name, --name <string>",
|
|
106
|
-
{
|
|
107
|
-
description: "The report name (default: Allure Report)",
|
|
108
|
-
},
|
|
109
|
-
],
|
|
114
|
+
details: "This command watches for changes in the Allure Results directory and updates the report in real-time.",
|
|
115
|
+
examples: [
|
|
116
|
+
["watch ./allure-results", "Watch for changes in the ./allure-results directory"],
|
|
110
117
|
[
|
|
111
|
-
"--port
|
|
112
|
-
|
|
113
|
-
description: "The port to serve the reports on (default: random port)",
|
|
114
|
-
},
|
|
118
|
+
"watch ./allure-results --port 8080",
|
|
119
|
+
"Watch for changes in the ./allure-results directory and serve the report on port 8080",
|
|
115
120
|
],
|
|
116
121
|
],
|
|
117
|
-
action: WatchCommandAction,
|
|
118
122
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Command } from "clipanion";
|
|
2
|
+
export declare class WhoamiCommand extends Command {
|
|
3
|
+
static paths: string[][];
|
|
4
|
+
static usage: import("clipanion").Usage;
|
|
5
|
+
config: string | undefined;
|
|
6
|
+
cwd: string | undefined;
|
|
7
|
+
execute(): Promise<void>;
|
|
8
|
+
}
|
package/dist/commands/whoami.js
CHANGED
|
@@ -1,51 +1,57 @@
|
|
|
1
1
|
import { readConfig } from "@allurereport/core";
|
|
2
2
|
import { AllureServiceClient, KnownError } from "@allurereport/service";
|
|
3
|
+
import { Command, Option } from "clipanion";
|
|
4
|
+
import * as console from "node:console";
|
|
5
|
+
import { exit } from "node:process";
|
|
3
6
|
import { green, red } from "yoctocolors";
|
|
4
|
-
import { createCommand } from "../utils/commands.js";
|
|
5
7
|
import { logError } from "../utils/logs.js";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export class WhoamiCommand extends Command {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.config = Option.String("--config,-c", {
|
|
12
|
+
description: "The path Allure config file",
|
|
13
|
+
});
|
|
14
|
+
this.cwd = Option.String("--cwd", {
|
|
15
|
+
description: "The working directory for the command to run (default: current working directory)",
|
|
16
|
+
});
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
lines.push(`Current project is "${config.allureService.project}"`);
|
|
20
|
-
}
|
|
21
|
-
console.info(green(lines.join("\n")));
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
if (error instanceof KnownError) {
|
|
25
|
-
console.error(red(error.message));
|
|
26
|
-
process.exit(1);
|
|
18
|
+
async execute() {
|
|
19
|
+
const config = await readConfig(this.cwd, this.config);
|
|
20
|
+
if (!config?.allureService?.url) {
|
|
21
|
+
console.error(red("No Allure Service URL is provided. Please provide it in the `allureService.url` field in the `allure.config.js` file"));
|
|
22
|
+
exit(1);
|
|
27
23
|
return;
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const serviceClient = new AllureServiceClient(config.allureService);
|
|
26
|
+
try {
|
|
27
|
+
const profile = await serviceClient.profile();
|
|
28
|
+
const lines = [`You are logged in as "${profile.email}"`];
|
|
29
|
+
if (config.allureService?.project) {
|
|
30
|
+
lines.push(`Current project is "${config.allureService.project}"`);
|
|
31
|
+
}
|
|
32
|
+
console.info(green(lines.join("\n")));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof KnownError) {
|
|
36
|
+
console.error(red(error.message));
|
|
37
|
+
exit(1);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
await logError("Failed to get profile due to unexpected error", error);
|
|
41
|
+
exit(1);
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
}
|
|
45
|
+
WhoamiCommand.paths = [["whoami"]];
|
|
46
|
+
WhoamiCommand.usage = Command.Usage({
|
|
47
|
+
category: "Allure Service",
|
|
35
48
|
description: "Prints information about current user",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
description: "The path Allure config file",
|
|
41
|
-
},
|
|
42
|
-
],
|
|
49
|
+
details: "This command prints information about the current user logged in to the Allure Service.",
|
|
50
|
+
examples: [
|
|
51
|
+
["whoami", "Print information about the current user using the default configuration"],
|
|
43
52
|
[
|
|
44
|
-
"--
|
|
45
|
-
|
|
46
|
-
description: "The working directory for the command to run (default: current working directory)",
|
|
47
|
-
},
|
|
53
|
+
"whoami --config custom-config.js",
|
|
54
|
+
"Print information about the current user using a custom configuration file",
|
|
48
55
|
],
|
|
49
56
|
],
|
|
50
|
-
action: WhoamiCommandAction,
|
|
51
57
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Builtins, Cli } from "clipanion";
|
|
2
2
|
import console from "node:console";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
|
-
import { cwd } from "node:process";
|
|
5
|
-
import { AwesomeCommand, ClassicCommand,
|
|
4
|
+
import { argv, cwd } from "node:process";
|
|
5
|
+
import { Allure2Command, AwesomeCommand, ClassicCommand, CsvCommand, DashboardCommand, GenerateCommand, HistoryCommand, KnownIssueCommand, LogCommand, LoginCommand, LogoutCommand, OpenCommand, ProjectsCreateCommand, ProjectsDeleteCommand, ProjectsListCommand, QualityGateCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, WhoamiCommand, } from "./commands/index.js";
|
|
6
|
+
const [node, app, ...args] = argv;
|
|
6
7
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
7
|
-
const cli =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
AwesomeCommand,
|
|
12
|
-
CsvCommand,
|
|
13
|
-
DashboardCommand,
|
|
14
|
-
GenerateCommand,
|
|
15
|
-
HistoryCommand,
|
|
16
|
-
KnownIssueCommand,
|
|
17
|
-
LogCommand,
|
|
18
|
-
OpenCommand,
|
|
19
|
-
QualityGateCommand,
|
|
20
|
-
RunCommand,
|
|
21
|
-
SlackCommand,
|
|
22
|
-
TestPlanCommand,
|
|
23
|
-
WatchCommand,
|
|
24
|
-
LoginCommand,
|
|
25
|
-
LogoutCommand,
|
|
26
|
-
WhoamiCommand,
|
|
27
|
-
ProjectsCreateCommand,
|
|
28
|
-
ProjectsDeleteCommand,
|
|
29
|
-
ProjectsListCommand,
|
|
30
|
-
];
|
|
31
|
-
commands.forEach((command) => {
|
|
32
|
-
command(cli);
|
|
33
|
-
});
|
|
34
|
-
cli.on("command:*", () => {
|
|
35
|
-
console.error(`Invalid command: "${cli.args.join(" ")}"`);
|
|
36
|
-
console.error("See --help for a list of available commands");
|
|
37
|
-
process.exit(1);
|
|
8
|
+
const cli = new Cli({
|
|
9
|
+
binaryName: pkg.name,
|
|
10
|
+
binaryLabel: `${node} ${app}`,
|
|
11
|
+
binaryVersion: pkg.version,
|
|
38
12
|
});
|
|
13
|
+
cli.register(AwesomeCommand);
|
|
14
|
+
cli.register(Allure2Command);
|
|
15
|
+
cli.register(ClassicCommand);
|
|
16
|
+
cli.register(CsvCommand);
|
|
17
|
+
cli.register(DashboardCommand);
|
|
18
|
+
cli.register(GenerateCommand);
|
|
19
|
+
cli.register(HistoryCommand);
|
|
20
|
+
cli.register(KnownIssueCommand);
|
|
21
|
+
cli.register(LogCommand);
|
|
22
|
+
cli.register(LoginCommand);
|
|
23
|
+
cli.register(LogoutCommand);
|
|
24
|
+
cli.register(OpenCommand);
|
|
25
|
+
cli.register(QualityGateCommand);
|
|
26
|
+
cli.register(RunCommand);
|
|
27
|
+
cli.register(SlackCommand);
|
|
28
|
+
cli.register(TestPlanCommand);
|
|
29
|
+
cli.register(WatchCommand);
|
|
30
|
+
cli.register(WhoamiCommand);
|
|
31
|
+
cli.register(ProjectsCreateCommand);
|
|
32
|
+
cli.register(ProjectsDeleteCommand);
|
|
33
|
+
cli.register(ProjectsListCommand);
|
|
34
|
+
cli.register(Builtins.HelpCommand);
|
|
35
|
+
cli.runExit(args);
|
|
39
36
|
console.log(cwd());
|
|
40
|
-
cli.parse();
|
|
41
37
|
export { defineConfig } from "@allurereport/plugin-api";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.17",
|
|
4
4
|
"description": "Allure Commandline Tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
"test": "vitest run"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@allurereport/core": "3.0.0-beta.
|
|
34
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/directory-watcher": "3.0.0-beta.
|
|
36
|
-
"@allurereport/plugin-allure2": "3.0.0-beta.
|
|
37
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
38
|
-
"@allurereport/plugin-awesome": "3.0.0-beta.
|
|
39
|
-
"@allurereport/plugin-classic": "3.0.0-beta.
|
|
40
|
-
"@allurereport/plugin-csv": "3.0.0-beta.
|
|
41
|
-
"@allurereport/plugin-dashboard": "3.0.0-beta.
|
|
42
|
-
"@allurereport/plugin-log": "3.0.0-beta.
|
|
43
|
-
"@allurereport/plugin-progress": "3.0.0-beta.
|
|
44
|
-
"@allurereport/plugin-server-reload": "3.0.0-beta.
|
|
45
|
-
"@allurereport/plugin-slack": "3.0.0-beta.
|
|
46
|
-
"@allurereport/reader-api": "3.0.0-beta.
|
|
47
|
-
"@allurereport/service": "3.0.0-beta.
|
|
48
|
-
"@allurereport/static-server": "3.0.0-beta.
|
|
49
|
-
"
|
|
33
|
+
"@allurereport/core": "3.0.0-beta.17",
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.17",
|
|
35
|
+
"@allurereport/directory-watcher": "3.0.0-beta.17",
|
|
36
|
+
"@allurereport/plugin-allure2": "3.0.0-beta.17",
|
|
37
|
+
"@allurereport/plugin-api": "3.0.0-beta.17",
|
|
38
|
+
"@allurereport/plugin-awesome": "3.0.0-beta.17",
|
|
39
|
+
"@allurereport/plugin-classic": "3.0.0-beta.17",
|
|
40
|
+
"@allurereport/plugin-csv": "3.0.0-beta.17",
|
|
41
|
+
"@allurereport/plugin-dashboard": "3.0.0-beta.17",
|
|
42
|
+
"@allurereport/plugin-log": "3.0.0-beta.17",
|
|
43
|
+
"@allurereport/plugin-progress": "3.0.0-beta.17",
|
|
44
|
+
"@allurereport/plugin-server-reload": "3.0.0-beta.17",
|
|
45
|
+
"@allurereport/plugin-slack": "3.0.0-beta.17",
|
|
46
|
+
"@allurereport/reader-api": "3.0.0-beta.17",
|
|
47
|
+
"@allurereport/service": "3.0.0-beta.17",
|
|
48
|
+
"@allurereport/static-server": "3.0.0-beta.17",
|
|
49
|
+
"clipanion": "^4.0.0-rc.4",
|
|
50
50
|
"lodash.omit": "^4.5.0",
|
|
51
51
|
"prompts": "^2.4.2",
|
|
52
52
|
"yoctocolors": "^2.1.1"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@typescript-eslint/parser": "^8.0.0",
|
|
62
62
|
"@vitest/runner": "^2.1.9",
|
|
63
63
|
"@vitest/snapshot": "^2.1.9",
|
|
64
|
-
"allure-vitest": "^3.0
|
|
64
|
+
"allure-vitest": "^3.3.0",
|
|
65
65
|
"eslint": "^8.57.0",
|
|
66
66
|
"eslint-config-prettier": "^9.1.0",
|
|
67
67
|
"eslint-plugin-import": "^2.29.1",
|
package/dist/utils/commands.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CAC } from "cac";
|
|
2
|
-
export type OptionDescription = [string] | [
|
|
3
|
-
string,
|
|
4
|
-
{
|
|
5
|
-
description?: string;
|
|
6
|
-
type?: any[];
|
|
7
|
-
default?: any;
|
|
8
|
-
}
|
|
9
|
-
];
|
|
10
|
-
export type CreateCommandOptions = {
|
|
11
|
-
name: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
options?: OptionDescription[];
|
|
14
|
-
action: (...args: any[]) => Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
export declare const createCommand: (payload: CreateCommandOptions) => (cli: CAC) => void;
|
package/dist/utils/commands.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const createCommand = (payload) => {
|
|
2
|
-
if (!payload.name) {
|
|
3
|
-
throw new Error("Command name is not provided!");
|
|
4
|
-
}
|
|
5
|
-
if (!payload.action) {
|
|
6
|
-
throw new Error("Command action is not provided!");
|
|
7
|
-
}
|
|
8
|
-
return (cli) => {
|
|
9
|
-
const command = cli.command(payload.name, payload.description);
|
|
10
|
-
payload?.options?.forEach(([name, parameters]) => {
|
|
11
|
-
const { description = "", ...rest } = parameters || {};
|
|
12
|
-
command.option(name, description, rest);
|
|
13
|
-
});
|
|
14
|
-
command.action(payload.action);
|
|
15
|
-
};
|
|
16
|
-
};
|