allure 3.0.0-beta.2 → 3.0.0-beta.20

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.
Files changed (66) hide show
  1. package/README.md +148 -16
  2. package/dist/commands/allure2.d.ts +15 -0
  3. package/dist/commands/allure2.js +77 -0
  4. package/dist/commands/awesome.d.ts +18 -12
  5. package/dist/commands/awesome.js +83 -75
  6. package/dist/commands/classic.d.ts +15 -11
  7. package/dist/commands/classic.js +71 -63
  8. package/dist/commands/csv.d.ts +13 -9
  9. package/dist/commands/csv.js +63 -45
  10. package/dist/commands/dashboard.d.ts +15 -0
  11. package/dist/commands/dashboard.js +77 -0
  12. package/dist/commands/generate.d.ts +12 -9
  13. package/dist/commands/generate.js +99 -26
  14. package/dist/commands/history.d.ts +9 -7
  15. package/dist/commands/history.js +32 -29
  16. package/dist/commands/index.d.ts +7 -0
  17. package/dist/commands/index.js +7 -0
  18. package/dist/commands/knownIssue.d.ts +8 -6
  19. package/dist/commands/knownIssue.js +31 -20
  20. package/dist/commands/log.d.ts +12 -7
  21. package/dist/commands/log.js +58 -40
  22. package/dist/commands/login.d.ts +8 -0
  23. package/dist/commands/login.js +50 -0
  24. package/dist/commands/logout.d.ts +8 -0
  25. package/dist/commands/logout.js +50 -0
  26. package/dist/commands/open.d.ts +11 -8
  27. package/dist/commands/open.js +36 -36
  28. package/dist/commands/projects/create.d.ts +9 -0
  29. package/dist/commands/projects/create.js +83 -0
  30. package/dist/commands/projects/delete.d.ts +10 -0
  31. package/dist/commands/projects/delete.js +68 -0
  32. package/dist/commands/projects/index.d.ts +3 -0
  33. package/dist/commands/projects/index.js +3 -0
  34. package/dist/commands/projects/list.d.ts +8 -0
  35. package/dist/commands/projects/list.js +75 -0
  36. package/dist/commands/qualityGate.d.ts +14 -6
  37. package/dist/commands/qualityGate.js +126 -39
  38. package/dist/commands/results/index.d.ts +2 -0
  39. package/dist/commands/results/index.js +2 -0
  40. package/dist/commands/results/pack.d.ts +10 -0
  41. package/dist/commands/results/pack.js +106 -0
  42. package/dist/commands/results/unpack.d.ts +9 -0
  43. package/dist/commands/results/unpack.js +79 -0
  44. package/dist/commands/run.d.ts +24 -10
  45. package/dist/commands/run.js +279 -109
  46. package/dist/commands/slack.d.ts +9 -5
  47. package/dist/commands/slack.js +55 -31
  48. package/dist/commands/testplan.d.ts +8 -6
  49. package/dist/commands/testplan.js +38 -30
  50. package/dist/commands/watch.d.ts +12 -10
  51. package/dist/commands/watch.js +110 -106
  52. package/dist/commands/whoami.d.ts +8 -0
  53. package/dist/commands/whoami.js +57 -0
  54. package/dist/index.d.ts +1 -2
  55. package/dist/index.js +34 -28
  56. package/dist/utils/index.d.ts +1 -0
  57. package/dist/utils/index.js +1 -0
  58. package/dist/utils/logs.d.ts +3 -0
  59. package/dist/utils/logs.js +32 -0
  60. package/dist/utils/process.d.ts +8 -2
  61. package/dist/utils/process.js +17 -6
  62. package/dist/utils/terminal.d.ts +1 -1
  63. package/dist/utils/terminal.js +1 -1
  64. package/package.json +33 -15
  65. package/dist/utils/commands.d.ts +0 -16
  66. package/dist/utils/commands.js +0 -14
@@ -1,118 +1,122 @@
1
- import { AllureReport, isFileNotFoundError, readRuntimeConfig } from "@allure/core";
2
- import { newFilesInDirectoryWatcher } from "@allure/directory-watcher";
3
- import AllureAwesome from "@allure/plugin-awesome";
4
- import ProgressPlugin from "@allure/plugin-progress";
5
- import ServerReloadPlugin from "@allure/plugin-server-reload";
6
- import { PathResultFile } from "@allure/reader-api";
7
- import { serve } from "@allure/static-server";
1
+ import { AllureReport, isFileNotFoundError, readConfig } from "@allurereport/core";
2
+ import { newFilesInDirectoryWatcher } from "@allurereport/directory-watcher";
3
+ import Awesome from "@allurereport/plugin-awesome";
4
+ import ProgressPlugin from "@allurereport/plugin-progress";
5
+ import ServerReloadPlugin from "@allurereport/plugin-server-reload";
6
+ import { PathResultFile } from "@allurereport/reader-api";
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
- import { createCommand } from "../utils/commands.js";
13
- export const WatchCommandAction = async (resultsDir, options) => {
14
- const before = new Date().getTime();
15
- process.on("exit", (code) => {
16
- const after = new Date().getTime();
17
- console.log(`exit code ${code} (${after - before}ms)`);
18
- });
19
- const { config: configPath, output, cwd, reportName } = options;
20
- const config = await readRuntimeConfig(configPath, cwd, output, reportName);
21
- try {
22
- await rm(config.output, { recursive: true });
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
- catch (e) {
25
- if (!isFileNotFoundError(e)) {
26
- console.error("could not clean output directory", e);
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
- const server = await serve({
30
- servePath: config.output,
31
- port: options.port ? parseInt(options.port) : undefined,
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 AllureAwesome({
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
- options: [
92
- [
93
- "--cwd <cwd>",
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 <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
  });
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,57 @@
1
+ import { readConfig } from "@allurereport/core";
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";
6
+ import { green, red } from "yoctocolors";
7
+ import { logError } from "../utils/logs.js";
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
+ });
17
+ }
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);
23
+ return;
24
+ }
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
+ }
43
+ }
44
+ }
45
+ WhoamiCommand.paths = [["whoami"]];
46
+ WhoamiCommand.usage = Command.Usage({
47
+ category: "Allure Service",
48
+ description: "Prints information about current user",
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"],
52
+ [
53
+ "whoami --config custom-config.js",
54
+ "Print information about the current user using a custom configuration file",
55
+ ],
56
+ ],
57
+ });
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- import { defineConfig } from "@allure/core";
2
- export { defineConfig };
1
+ export { defineConfig, defaultChartsConfig } from "@allurereport/plugin-api";
package/dist/index.js CHANGED
@@ -1,33 +1,39 @@
1
- import { defineConfig } from "@allure/core";
2
- import { cac } from "cac";
1
+ import { Builtins, Cli } from "clipanion";
3
2
  import console from "node:console";
4
3
  import { readFileSync } from "node:fs";
5
- import { cwd } from "node:process";
6
- import { ClassicCommand, AwesomeCommand, CsvCommand, GenerateCommand, HistoryCommand, KnownIssueCommand, LogCommand, OpenCommand, QualityGateCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, } from "./commands/index.js";
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, ResultsPackCommand, ResultsUnpackCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, WhoamiCommand, } from "./commands/index.js";
6
+ const [node, app, ...args] = argv;
7
7
  const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
8
- const cli = cac(pkg.name).usage(pkg.description).help().version(pkg.version);
9
- const commands = [
10
- ClassicCommand,
11
- AwesomeCommand,
12
- CsvCommand,
13
- GenerateCommand,
14
- HistoryCommand,
15
- KnownIssueCommand,
16
- LogCommand,
17
- OpenCommand,
18
- QualityGateCommand,
19
- RunCommand,
20
- SlackCommand,
21
- TestPlanCommand,
22
- WatchCommand,
23
- ];
24
- commands.forEach((command) => {
25
- command(cli);
26
- });
27
- cli.on("command:*", () => {
28
- console.error("Invalid command: %s", cli.args.join(" "));
29
- process.exit(1);
8
+ const cli = new Cli({
9
+ binaryName: pkg.name,
10
+ binaryLabel: `${node} ${app}`,
11
+ binaryVersion: pkg.version,
30
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(ResultsPackCommand);
35
+ cli.register(ResultsUnpackCommand);
36
+ cli.register(Builtins.HelpCommand);
37
+ cli.runExit(args);
31
38
  console.log(cwd());
32
- cli.parse();
33
- export { defineConfig };
39
+ export { defineConfig, defaultChartsConfig } from "@allurereport/plugin-api";
@@ -1,2 +1,3 @@
1
1
  export * from "./process.js";
2
2
  export * from "./terminal.js";
3
+ export * from "./logs.js";
@@ -1,2 +1,3 @@
1
1
  export * from "./process.js";
2
2
  export * from "./terminal.js";
3
+ export * from "./logs.js";
@@ -0,0 +1,3 @@
1
+ export declare const getLogFileName: () => string;
2
+ export declare const readLogs: () => Promise<string>;
3
+ export declare const logError: (message: string, error: Error) => Promise<void>;
@@ -0,0 +1,32 @@
1
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { red } from "yoctocolors";
5
+ const LOGS_DIRECTORY = join(homedir(), ".allure", "logs");
6
+ export const getLogFileName = () => `${new Date().toISOString().replace(/:/g, "-")}.log`;
7
+ export const readLogs = async () => {
8
+ await mkdir(LOGS_DIRECTORY, { recursive: true });
9
+ const logFilePath = join(LOGS_DIRECTORY, getLogFileName());
10
+ try {
11
+ const logs = await readFile(logFilePath, "utf-8");
12
+ return logs;
13
+ }
14
+ catch (err) {
15
+ return "";
16
+ }
17
+ };
18
+ export const logError = async (message, error) => {
19
+ let logs = await readLogs();
20
+ if (!logs) {
21
+ logs += `${new Date().toISOString()}[ERROR] ${error.message}\n`;
22
+ }
23
+ else {
24
+ logs += `\n${new Date().toISOString()}[ERROR] ${error.message}\n`;
25
+ }
26
+ if (error.stack) {
27
+ logs += `${error.stack}\n`;
28
+ }
29
+ const logFilePath = join(LOGS_DIRECTORY, getLogFileName());
30
+ await writeFile(logFilePath, logs, "utf-8");
31
+ console.error(red(`${message}. Check logs for more details: ${logFilePath}`));
32
+ };
@@ -1,3 +1,9 @@
1
- import { ChildProcess } from "node:child_process";
2
- export declare const runProcess: (command: string, commandArgs: string[], cwd: string | undefined, environment: Record<string, string>, silent?: boolean) => ChildProcess;
1
+ import type { ChildProcess } from "node:child_process";
2
+ export declare const runProcess: (params: {
3
+ command: string;
4
+ commandArgs: string[];
5
+ cwd: string | undefined;
6
+ environment?: Record<string, string>;
7
+ logs?: "pipe" | "inherit" | "ignore";
8
+ }) => ChildProcess;
3
9
  export declare const terminationOf: (testProcess: ChildProcess) => Promise<number | null>;
@@ -1,12 +1,23 @@
1
1
  import { spawn } from "node:child_process";
2
- export const runProcess = (command, commandArgs, cwd, environment, silent) => {
2
+ export const runProcess = (params) => {
3
+ const { command, commandArgs, cwd, environment = {}, logs = "inherit" } = params;
4
+ const env = {
5
+ ...process.env,
6
+ ...environment,
7
+ };
8
+ if (logs === "pipe") {
9
+ Object.assign(env, {
10
+ FORCE_COLOR: "1",
11
+ CLICOLOR_FORCE: "1",
12
+ COLOR: "1",
13
+ COLORTERM: "truecolor",
14
+ TERM: "xterm-256color",
15
+ });
16
+ }
3
17
  return spawn(command, commandArgs, {
4
- env: {
5
- ...process.env,
6
- ...environment,
7
- },
18
+ env,
8
19
  cwd,
9
- stdio: silent ? "ignore" : "inherit",
20
+ stdio: logs,
10
21
  shell: true,
11
22
  });
12
23
  };
@@ -1,3 +1,3 @@
1
- import { TestResult, TestStatus } from "@allure/core-api";
1
+ import type { TestResult, TestStatus } from "@allurereport/core-api";
2
2
  export declare const status2color: (status: TestStatus) => import("yoctocolors").Format;
3
3
  export declare const logTests: (testResults: TestResult[]) => void;
@@ -1,4 +1,4 @@
1
- import { formatDuration } from "@allure/core-api";
1
+ import { formatDuration } from "@allurereport/core-api";
2
2
  import console from "node:console";
3
3
  import { blue, gray, green, red, yellow } from "yoctocolors";
4
4
  export const status2color = (status) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.20",
4
4
  "description": "Allure Commandline Tool",
5
5
  "keywords": [
6
6
  "allure",
@@ -12,7 +12,8 @@
12
12
  "author": "Qameta Software",
13
13
  "type": "module",
14
14
  "exports": {
15
- ".": "./dist/index.js"
15
+ ".": "./dist/index.js",
16
+ "./qualityGate": "./dist/qualityGate.js"
16
17
  },
17
18
  "main": "./dist/index.js",
18
19
  "module": "./dist/index.js",
@@ -24,32 +25,49 @@
24
25
  "scripts": {
25
26
  "build": "run clean && tsc --project ./tsconfig.json",
26
27
  "clean": "rimraf ./dist",
28
+ "eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
29
+ "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
27
30
  "start": "node ./cli.js",
28
31
  "test": "vitest run"
29
32
  },
30
33
  "dependencies": {
31
- "@allure/core": "3.0.0-beta.2",
32
- "@allure/core-api": "3.0.0-beta.2",
33
- "@allure/directory-watcher": "3.0.0-beta.2",
34
- "@allure/plugin-awesome": "3.0.0-beta.2",
35
- "@allure/plugin-progress": "3.0.0-beta.2",
36
- "@allure/plugin-server-reload": "3.0.0-beta.2",
37
- "@allure/plugin-slack": "3.0.0-beta.2",
38
- "@allure/reader-api": "3.0.0-beta.2",
39
- "@allure/static-server": "3.0.0-beta.2",
40
- "cac": "^6.7.14",
34
+ "@allurereport/core": "3.0.0-beta.20",
35
+ "@allurereport/core-api": "3.0.0-beta.20",
36
+ "@allurereport/directory-watcher": "3.0.0-beta.20",
37
+ "@allurereport/plugin-allure2": "3.0.0-beta.20",
38
+ "@allurereport/plugin-api": "3.0.0-beta.20",
39
+ "@allurereport/plugin-awesome": "3.0.0-beta.20",
40
+ "@allurereport/plugin-classic": "3.0.0-beta.20",
41
+ "@allurereport/plugin-csv": "3.0.0-beta.20",
42
+ "@allurereport/plugin-dashboard": "3.0.0-beta.20",
43
+ "@allurereport/plugin-log": "3.0.0-beta.20",
44
+ "@allurereport/plugin-progress": "3.0.0-beta.20",
45
+ "@allurereport/plugin-server-reload": "3.0.0-beta.20",
46
+ "@allurereport/plugin-slack": "3.0.0-beta.20",
47
+ "@allurereport/reader-api": "3.0.0-beta.20",
48
+ "@allurereport/service": "3.0.0-beta.20",
49
+ "@allurereport/static-server": "3.0.0-beta.20",
50
+ "adm-zip": "^0.5.16",
51
+ "clipanion": "^4.0.0-rc.4",
52
+ "glob": "^11.0.3",
41
53
  "lodash.omit": "^4.5.0",
54
+ "prompts": "^2.4.2",
55
+ "terminate": "^2.8.0",
56
+ "typanion": "^3.14.0",
42
57
  "yoctocolors": "^2.1.1"
43
58
  },
44
59
  "devDependencies": {
45
60
  "@stylistic/eslint-plugin": "^2.6.1",
61
+ "@types/adm-zip": "^0",
46
62
  "@types/eslint": "^8.56.11",
47
63
  "@types/lodash.omit": "^4.5.9",
48
64
  "@types/node": "^20.17.9",
65
+ "@types/prompts": "^2",
49
66
  "@typescript-eslint/eslint-plugin": "^8.0.0",
50
67
  "@typescript-eslint/parser": "^8.0.0",
51
- "@vitest/runner": "^2.1.8",
52
- "allure-vitest": "^3.0.7",
68
+ "@vitest/runner": "^2.1.9",
69
+ "@vitest/snapshot": "^2.1.9",
70
+ "allure-vitest": "^3.3.3",
53
71
  "eslint": "^8.57.0",
54
72
  "eslint-config-prettier": "^9.1.0",
55
73
  "eslint-plugin-import": "^2.29.1",
@@ -59,6 +77,6 @@
59
77
  "eslint-plugin-prefer-arrow": "^1.2.3",
60
78
  "rimraf": "^6.0.1",
61
79
  "typescript": "^5.6.3",
62
- "vitest": "^2.1.8"
80
+ "vitest": "^2.1.9"
63
81
  }
64
82
  }
@@ -1,16 +0,0 @@
1
- import { 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;
@@ -1,14 +0,0 @@
1
- export const createCommand = (payload) => {
2
- if (!payload.name)
3
- throw new Error("Command name is not provided!");
4
- if (!payload.action)
5
- throw new Error("Command action is not provided!");
6
- return (cli) => {
7
- const command = cli.command(payload.name, payload.description);
8
- payload?.options?.forEach(([name, parameters]) => {
9
- const { description = "", ...rest } = parameters || {};
10
- command.option(name, description, rest);
11
- });
12
- command.action(payload.action);
13
- };
14
- };