@crvy/strybk 0.0.4 → 0.0.5

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.0.5] - 2026-07-06
9
+
10
+ ### Added
11
+
12
+ - **cli:** Add --help/-h flag to print usage and exit 0
8
13
  ## [0.0.4] - 2026-07-03
9
14
 
10
15
  ### Other
package/dist/src/cli.d.ts CHANGED
@@ -4,6 +4,9 @@ export interface GenerateCliArgs {
4
4
  configPath: string;
5
5
  dryRun: boolean;
6
6
  }
7
+ export declare const HELP_TEXT = "Usage: crvy-strybk generate --config <path> [options]\n\nGenerate Playwright screenshot spec files from a running Storybook index.\n\nThe Storybook server must be running at the configured `storybookUrl` so that\nindex.json can be fetched at generate time.\n\nOptions:\n --config <path> Path to strybk.config.ts (required)\n --dry-run Compute outputs without writing files\n -h, --help Show this help message\n";
8
+ export declare function printHelp(): void;
9
+ export declare function wantsHelp(argv: string[]): boolean;
7
10
  export declare function parseCliArgs(argv: string[]): GenerateCliArgs;
8
11
  export declare function runCli(argv: string[]): Promise<Array<{
9
12
  outputPath: string;
package/dist/src/cli.js CHANGED
@@ -99,6 +99,24 @@ const writeGeneratedFiles = (outputs) => {
99
99
  writeFileSync(output.outputPath, output.content);
100
100
  }
101
101
  };
102
+ export const HELP_TEXT = `Usage: crvy-strybk generate --config <path> [options]
103
+
104
+ Generate Playwright screenshot spec files from a running Storybook index.
105
+
106
+ The Storybook server must be running at the configured \`storybookUrl\` so that
107
+ index.json can be fetched at generate time.
108
+
109
+ Options:
110
+ --config <path> Path to strybk.config.ts (required)
111
+ --dry-run Compute outputs without writing files
112
+ -h, --help Show this help message
113
+ `;
114
+ export function printHelp() {
115
+ console.log(HELP_TEXT);
116
+ }
117
+ export function wantsHelp(argv) {
118
+ return argv.includes("--help") || argv.includes("-h");
119
+ }
102
120
  export function parseCliArgs(argv) {
103
121
  const [command, ...options] = argv;
104
122
  if (command !== "generate") {
@@ -155,6 +173,10 @@ export async function runCli(argv) {
155
173
  return outputs;
156
174
  }
157
175
  export async function main(argv = process.argv.slice(2)) {
176
+ if (wantsHelp(argv)) {
177
+ printHelp();
178
+ return;
179
+ }
158
180
  try {
159
181
  const outputs = await runCli(argv);
160
182
  const dryRun = argv.includes("--dry-run");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvy/strybk",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Generator-first Playwright screenshot testing for Storybook.",
5
5
  "keywords": [
6
6
  "crvy",