@crvy/rprtr 0.2.3 → 0.2.4

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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.4] - 2026-07-06
9
+
10
+ ### Added
11
+
12
+ - **cli:** Add --help/-h flag to print usage and exit 0
8
13
  ## [0.2.3] - 2026-07-03
9
14
 
10
15
  ### Fixed
package/dist/cli.d.ts CHANGED
@@ -6,6 +6,9 @@ interface ResolvedCliOptions extends ServerOptions {
6
6
  reportPath: string;
7
7
  outputDir: string;
8
8
  }
9
+ export declare const HELP_TEXT = "Usage: crvy-rprtr [artifact-dir] [options]\n\nStart the @crvy/rprtr visual regression report UI server.\n\nArguments:\n artifact-dir Directory of downloaded CI test artifacts. When set,\n --report-path defaults to <dir>/report.json and\n --screenshot-dir defaults to <dir>/screenshots.\n\nOptions:\n -p, --port <number> Server port (default: 3000)\n -s, --screenshot-dir <dir> Screenshot artifact directory (default: ./screenshots)\n -r, --report-path <path> Path to report.json (default: ./report.json)\n -o, --output-dir <dir> Playwright test output directory (default: ./test-results)\n -c, --config <path> Path to playwright.config.ts, used for approval routing\n -h, --help Show this help message\n";
10
+ export declare function printHelp(): void;
11
+ export declare function wantsHelp(args: string[]): boolean;
9
12
  export declare function resolveCliOptions(args: string[]): ResolvedCliOptions;
10
13
  export {};
11
14
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAKA,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAO7D,UAAU,kBAAmB,SAAQ,aAAa;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,kBAAkB,CA8BpE"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAKA,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAO7D,UAAU,kBAAmB,SAAQ,aAAa;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,00BAgBrB,CAAA;AAED,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,kBAAkB,CA8BpE"}
package/dist/cli.js CHANGED
@@ -32,6 +32,29 @@ var DEFAULT_PORT = 3e3;
32
32
  var DEFAULT_SCREENSHOT_DIR = "./screenshots";
33
33
  var DEFAULT_REPORT_PATH = "./report.json";
34
34
  var DEFAULT_OUTPUT_DIR = "./test-results";
35
+ var HELP_TEXT = `Usage: crvy-rprtr [artifact-dir] [options]
36
+
37
+ Start the @crvy/rprtr visual regression report UI server.
38
+
39
+ Arguments:
40
+ artifact-dir Directory of downloaded CI test artifacts. When set,
41
+ --report-path defaults to <dir>/report.json and
42
+ --screenshot-dir defaults to <dir>/screenshots.
43
+
44
+ Options:
45
+ -p, --port <number> Server port (default: 3000)
46
+ -s, --screenshot-dir <dir> Screenshot artifact directory (default: ./screenshots)
47
+ -r, --report-path <path> Path to report.json (default: ./report.json)
48
+ -o, --output-dir <dir> Playwright test output directory (default: ./test-results)
49
+ -c, --config <path> Path to playwright.config.ts, used for approval routing
50
+ -h, --help Show this help message
51
+ `;
52
+ function printHelp() {
53
+ console.log(HELP_TEXT);
54
+ }
55
+ function wantsHelp(args) {
56
+ return args.includes("--help") || args.includes("-h");
57
+ }
35
58
  function resolveCliOptions(args) {
36
59
  const { values, positionals } = parseArgs({
37
60
  args,
@@ -59,8 +82,16 @@ function resolveCliOptions(args) {
59
82
  };
60
83
  }
61
84
  if (isDirectExecution(import.meta.url)) {
62
- await startServer(resolveCliOptions(process.argv.slice(2)));
85
+ const args = process.argv.slice(2);
86
+ if (wantsHelp(args)) {
87
+ printHelp();
88
+ } else {
89
+ await startServer(resolveCliOptions(args));
90
+ }
63
91
  }
64
92
  export {
65
- resolveCliOptions
93
+ HELP_TEXT,
94
+ printHelp,
95
+ resolveCliOptions,
96
+ wantsHelp
66
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvy/rprtr",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Playwright reporter with visual regression UI for comparing and approving screenshot tests",
5
5
  "keywords": [
6
6
  "crvy",