@scrymore/scry-sbcov 0.5.2-next.20260925112524 → 0.5.2

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 (45) hide show
  1. package/README.md +84 -0
  2. package/dist/cli/config.d.ts +19 -2
  3. package/dist/cli/config.d.ts.map +1 -1
  4. package/dist/cli/config.js +264 -60
  5. package/dist/cli/config.js.map +1 -1
  6. package/dist/cli/index.js +71 -5
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/core/analyzer.d.ts +6 -2
  9. package/dist/core/analyzer.d.ts.map +1 -1
  10. package/dist/core/analyzer.js +14 -2
  11. package/dist/core/analyzer.js.map +1 -1
  12. package/dist/core/built-story-index.d.ts +2 -0
  13. package/dist/core/built-story-index.d.ts.map +1 -1
  14. package/dist/core/built-story-index.js +7 -1
  15. package/dist/core/built-story-index.js.map +1 -1
  16. package/dist/core/capture-summary.d.ts +21 -0
  17. package/dist/core/capture-summary.d.ts.map +1 -0
  18. package/dist/core/capture-summary.js +33 -0
  19. package/dist/core/capture-summary.js.map +1 -0
  20. package/dist/core/errors.d.ts +23 -0
  21. package/dist/core/errors.d.ts.map +1 -1
  22. package/dist/core/errors.js +27 -0
  23. package/dist/core/errors.js.map +1 -1
  24. package/dist/core/story-executor.d.ts +2 -0
  25. package/dist/core/story-executor.d.ts.map +1 -1
  26. package/dist/core/story-executor.js +68 -7
  27. package/dist/core/story-executor.js.map +1 -1
  28. package/dist/core/version.d.ts +7 -0
  29. package/dist/core/version.d.ts.map +1 -0
  30. package/dist/core/version.js +16 -0
  31. package/dist/core/version.js.map +1 -0
  32. package/dist/core/zip-generator.d.ts +13 -3
  33. package/dist/core/zip-generator.d.ts.map +1 -1
  34. package/dist/core/zip-generator.js +60 -3
  35. package/dist/core/zip-generator.js.map +1 -1
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/parsers/story-parser.d.ts.map +1 -1
  41. package/dist/parsers/story-parser.js +4 -3
  42. package/dist/parsers/story-parser.js.map +1 -1
  43. package/dist/types/index.d.ts +57 -1
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -87,11 +87,75 @@ Options:
87
87
  --ci CI mode: exit code 1 if quality gate fails
88
88
  --threshold-component <n> Component coverage threshold % (default: 80)
89
89
  --threshold-new-code <n> New code coverage threshold % (default: 90)
90
+ --max-dropped <n> Exit 3 (after writing the archive) when more stories than this
91
+ were left out of it: a count, or a percentage like 5%
92
+ (default: no limit; the count is always reported)
93
+ --allow-default-capture If the config file cannot be used, warn and run without it
94
+ (every setting on the defaults) instead of exiting 2
90
95
  -v, --verbose Verbose output
91
96
  --version Show version
92
97
  --help Show help
93
98
  ```
94
99
 
100
+ ## Exit codes
101
+
102
+ | Code | Meaning | Archive (`--output-zip`) |
103
+ |---|---|---|
104
+ | 0 | Done. The summary line says how many stories were left out; with `--max-dropped`, no more than it allows | written |
105
+ | 1 | Crash; `--ci` and the coverage quality gate failed; or `--output-zip` was asked for and no archive could be written (story execution did not run) | written if the run got that far |
106
+ | 2 | The config cannot be used: a config file that throws or does not parse, an unknown key, a value out of range, a `--config` path that does not exist, a bad `--max-dropped`. Nothing is captured | not written |
107
+ | 3 | `--max-dropped` (or `maxDropped` in the config) is set and more stories were left out than it allows. The archive holds every story that was captured. Wins over a failed `--ci` gate, so a caller still uploads the archive | written first, then exit 3 |
108
+
109
+ Without `--max-dropped` sbcov never fails for dropped stories: it counts and names them. That
110
+ keeps an installed `@scrymore/scry-deployer` older than 0.7.0, which treats any non-zero sbcov
111
+ exit as "no archive", uploading what was captured. `@scrymore/scry-deployer` 0.7.0 and later
112
+ passes `--max-dropped 0` unless you set a value, uploads the archive, and then fails the deploy
113
+ on 3; it stops before uploading on 2.
114
+
115
+ ## What every run prints
116
+
117
+ Two lines, on stderr, whatever `--verbose` says:
118
+
119
+ ```
120
+ sbcov capture: mode=root viewport=420x600 scale=2 source=scry-sbcov.config.js
121
+ sbcov: 417/461 stories captured, 44 not indexed (timeout 40, console error 4)
122
+ ```
123
+
124
+ The first is the framing the screenshots use and where it came from (`defaults`, a config file
125
+ path relative to the repository root, `flags`, or `flags + <file>`). The second is printed once
126
+ the capture is done: how many of the stories Storybook built will be searchable, and why the
127
+ rest will not. Each left-out story is also named on its own line as it happens:
128
+
129
+ ```
130
+ ✗ settings-invitemodal--open will not be indexed: timeout (page.waitForSelector: Timeout 15000ms exceeded.)
131
+ ```
132
+
133
+ Reasons: `timeout`, `render_error`, `console_error`, `play_function` (the story failed),
134
+ `screenshot_failed` (it rendered but the image could not be written), `not_discovered` (Storybook
135
+ built it but no story file matched it, or its file failed to parse), `no_image` (the image was
136
+ missing or unusable when the archive was written).
137
+
138
+ ## The metadata archive
139
+
140
+ `--output-zip` writes `metadata.json` (a plain JSON array, one entry per captured story),
141
+ `images/*.png`, and `sbcov-manifest.json`, which accounts for every declared story:
142
+
143
+ ```json
144
+ {
145
+ "sbcovVersion": "0.5.2",
146
+ "declared": 461,
147
+ "captured": 417,
148
+ "dropped": [
149
+ { "storyId": "settings-invitemodal--open", "storyTitle": "Settings/InviteModal", "reason": "timeout", "detail": "page.waitForSelector: Timeout 15000ms exceeded." }
150
+ ],
151
+ "capture": { "mode": "root", "viewport": { "width": 420, "height": 600 }, "scale": 2, "source": "scry-sbcov.config.js" }
152
+ }
153
+ ```
154
+
155
+ `captured + dropped.length = declared`. "Declared" is Storybook's own `index.json` (or
156
+ `stories.json`) when the build has one, else the stories found on disk. The same list is in the
157
+ JSON report under `execution.dropped`, with `execution.summary.declared` and `notIndexed`.
158
+
95
159
  ## Configuration
96
160
 
97
161
  Create a `scry-sbcov.config.js` file in your project root:
@@ -127,6 +191,9 @@ module.exports = {
127
191
  // Output
128
192
  outputPath: './scry-sbcov-report.json',
129
193
 
194
+ // Optional: exit 3 when more stories than this are left out of the archive (a count or '5%')
195
+ // maxDropped: 0,
196
+
130
197
  // Scenario detection customization
131
198
  scenarioPatterns: {
132
199
  loading: ['isLoading', 'loading', 'isProcessing'],
@@ -143,6 +210,23 @@ module.exports = {
143
210
  };
144
211
  ```
145
212
 
213
+ **Where the config is found.** sbcov looks in the working directory, then each parent up to the
214
+ repository root (the first directory with `.git`), nearest first. In each directory it tries
215
+ `scry-sbcov.config.js`, `.mjs`, `.cjs`, `.json`, `.scry-sbcov.js`, `.scry-sbcov.json`, then a
216
+ `"scry-sbcov"` key in `package.json`. So a config at the repository root is used when the
217
+ Storybook is built in a subfolder (the deployer runs sbcov in the folder above `--dir`), and a
218
+ package in a monorepo can keep its own. Outside a git checkout only the working directory is read.
219
+ If your `package.json` has `"type": "module"`, use `export default { ... }` or name the file
220
+ `scry-sbcov.config.cjs`.
221
+
222
+ **A config that cannot be used is an error.** A file that throws or does not parse, a key sbcov
223
+ does not know (`Unknown key "captureSacle" in scry-sbcov.config.js; did you mean captureScale?`),
224
+ or a capture value out of range exits 2 before anything is captured. Pass
225
+ `--allow-default-capture` to run without that file instead, with a warning: every setting in it
226
+ (story globs, timeouts, thresholds as well as capture) then uses the defaults. No config at all is
227
+ fine: the settings line says `source=defaults`. A config found in a parent directory is announced
228
+ once; globs and paths in it are still relative to the working directory.
229
+
146
230
  You can also add configuration to `package.json`:
147
231
 
148
232
  ```json
@@ -1,11 +1,28 @@
1
1
  /**
2
2
  * Configuration file loader for scry-sbcov
3
- * Supports scry-sbcov.config.js, scry-sbcov.config.mjs, and package.json
3
+ * Supports scry-sbcov.config.{js,mjs,cjs,json}, .scry-sbcov.{js,json} and package.json "scry-sbcov",
4
+ * searched from the project directory up to the repository root, nearest first.
4
5
  */
5
6
  import type { ScryConfig, CliOptions, CaptureViewport } from '../types/index.js';
6
7
  declare const DEFAULT_CONFIG: ScryConfig;
7
8
  /**
8
- * Merge CLI options with config file and defaults
9
+ * The directory that bounds the upward config search: the nearest ancestor (or
10
+ * the directory itself) that holds `.git` (a directory, or a file in a worktree
11
+ * or submodule). Null when the project is not inside a git checkout; the search
12
+ * then looks only in the starting directory, so a stray config in $HOME is never
13
+ * picked up.
14
+ */
15
+ export declare function findRepositoryRoot(startDir: string): string | null;
16
+ /** Parse --max-dropped: a whole number of stories, or a percentage such as "5%". */
17
+ export declare function parseMaxDropped(value: unknown, where?: string): number | string;
18
+ /**
19
+ * Merge CLI options with config file and defaults.
20
+ *
21
+ * Throws SbcovConfigError (the CLI exits 2) when a config file exists and cannot
22
+ * be used, when --config names a file that does not exist, or when a capture
23
+ * setting is invalid. With `allowDefaultCapture`, a config file that cannot be
24
+ * used is reported as a warning and ignored instead; the run uses the defaults
25
+ * and says so in `captureSource`. A missing config is not an error.
9
26
  */
10
27
  export declare function loadConfig(cliOptions: CliOptions, projectPath?: string): Promise<ScryConfig>;
11
28
  /** "390x844" → { width: 390, height: 844 }. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElG,QAAA,MAAM,cAAc,EAAE,UAmCrB,CAAC;AAgFF;;GAEG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,UAAU,EACtB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,UAAU,CAAC,CA2ErB;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAI5D;AAmDD,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElG,QAAA,MAAM,cAAc,EAAE,UAmCrB,CAAC;AA4BF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQlE;AAsLD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAkB,GAAG,MAAM,GAAG,MAAM,CAYxF;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,UAAU,EACtB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,UAAU,CAAC,CA8HrB;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAI5D;AAoDD,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Configuration file loader for scry-sbcov
3
- * Supports scry-sbcov.config.js, scry-sbcov.config.mjs, and package.json
3
+ * Supports scry-sbcov.config.{js,mjs,cjs,json}, .scry-sbcov.{js,json} and package.json "scry-sbcov",
4
+ * searched from the project directory up to the repository root, nearest first.
4
5
  */
5
6
  import * as fs from 'node:fs';
6
7
  import * as path from 'node:path';
7
8
  import { pathToFileURL } from 'node:url';
9
+ import { SbcovConfigError } from '../core/errors.js';
8
10
  const DEFAULT_CONFIG = {
9
11
  include: ['**/*.tsx', '**/*.jsx'],
10
12
  // node_modules is also excluded by discovery itself (see core/vendor-paths.ts)
@@ -41,95 +43,281 @@ const DEFAULT_CONFIG = {
41
43
  },
42
44
  componentStoryMapping: {},
43
45
  };
46
+ const CONFIG_FILE_NAMES = [
47
+ 'scry-sbcov.config.js',
48
+ 'scry-sbcov.config.mjs',
49
+ 'scry-sbcov.config.cjs',
50
+ 'scry-sbcov.config.json',
51
+ '.scry-sbcov.js',
52
+ '.scry-sbcov.json',
53
+ ];
54
+ /** Keys a config file may set: everything in DEFAULT_CONFIG. */
55
+ /** Keys a config file may set: everything in DEFAULT_CONFIG, plus the optional ones with no default. */
56
+ const KNOWN_KEYS = new Set(Object.keys(DEFAULT_CONFIG).concat('maxDropped'));
57
+ /** Nested objects whose own keys are checked too; the others are free-form maps. */
58
+ const KNOWN_NESTED_KEYS = {
59
+ thresholds: new Set(Object.keys(DEFAULT_CONFIG.thresholds)),
60
+ captureViewport: new Set(['width', 'height']),
61
+ };
62
+ const CAPTURE_KEYS = ['captureMode', 'captureViewport', 'captureScale'];
63
+ /**
64
+ * The directory that bounds the upward config search: the nearest ancestor (or
65
+ * the directory itself) that holds `.git` (a directory, or a file in a worktree
66
+ * or submodule). Null when the project is not inside a git checkout; the search
67
+ * then looks only in the starting directory, so a stray config in $HOME is never
68
+ * picked up.
69
+ */
70
+ export function findRepositoryRoot(startDir) {
71
+ let dir = path.resolve(startDir);
72
+ for (;;) {
73
+ if (fs.existsSync(path.join(dir, '.git')))
74
+ return dir;
75
+ const parent = path.dirname(dir);
76
+ if (parent === dir)
77
+ return null;
78
+ dir = parent;
79
+ }
80
+ }
81
+ /** Directories to search, nearest first: startDir, then each parent up to the repo root. */
82
+ function searchDirs(startDir) {
83
+ const start = path.resolve(startDir);
84
+ const root = findRepositoryRoot(start);
85
+ if (!root)
86
+ return [start];
87
+ const dirs = [];
88
+ let dir = start;
89
+ for (;;) {
90
+ dirs.push(dir);
91
+ if (dir === root)
92
+ break;
93
+ const parent = path.dirname(dir);
94
+ if (parent === dir)
95
+ break;
96
+ dir = parent;
97
+ }
98
+ return dirs;
99
+ }
100
+ /** How a config path is shown: relative to the repo root when inside one, else to the project. */
101
+ function displayPathFor(absolutePath, projectPath) {
102
+ const base = findRepositoryRoot(projectPath) ?? path.resolve(projectPath);
103
+ const rel = path.relative(base, absolutePath);
104
+ return rel && !rel.startsWith('..') && !path.isAbsolute(rel) ? toPosix(rel) : toPosix(absolutePath);
105
+ }
106
+ function toPosix(value) {
107
+ return value.split(path.sep).join('/');
108
+ }
109
+ function firstLine(error) {
110
+ const message = error instanceof Error ? error.message : String(error);
111
+ return message.split('\n')[0];
112
+ }
113
+ /** Levenshtein distance, for "did you mean" on a misspelt key. */
114
+ function editDistance(a, b) {
115
+ const row = Array.from({ length: b.length + 1 }, (_, i) => i);
116
+ for (let i = 1; i <= a.length; i++) {
117
+ let prev = row[0];
118
+ row[0] = i;
119
+ for (let j = 1; j <= b.length; j++) {
120
+ const cur = row[j];
121
+ row[j] = Math.min(row[j] + 1, row[j - 1] + 1, prev + (a[i - 1] === b[j - 1] ? 0 : 1));
122
+ prev = cur;
123
+ }
124
+ }
125
+ return row[b.length];
126
+ }
127
+ function suggestKey(key, known) {
128
+ let best = null;
129
+ let bestDistance = Infinity;
130
+ for (const candidate of known) {
131
+ const d = candidate.toLowerCase() === key.toLowerCase() ? 0 : editDistance(key, candidate);
132
+ if (d < bestDistance) {
133
+ best = candidate;
134
+ bestDistance = d;
135
+ }
136
+ }
137
+ return best !== null && bestDistance <= Math.max(2, Math.floor(key.length / 4)) ? best : null;
138
+ }
139
+ /** Reject keys sbcov does not know, naming the file and suggesting the near miss. */
140
+ function checkKeys(values, displayPath) {
141
+ for (const key of Object.keys(values)) {
142
+ if (!KNOWN_KEYS.has(key)) {
143
+ const suggestion = suggestKey(key, KNOWN_KEYS);
144
+ throw new SbcovConfigError(`Unknown key "${key}" in ${displayPath}${suggestion ? `; did you mean ${suggestion}?` : ''}`, { file: displayPath, key });
145
+ }
146
+ const nestedKnown = KNOWN_NESTED_KEYS[key];
147
+ const nested = values[key];
148
+ if (nestedKnown && nested !== null && typeof nested === 'object') {
149
+ for (const inner of Object.keys(nested)) {
150
+ if (!nestedKnown.has(inner)) {
151
+ const suggestion = suggestKey(inner, nestedKnown);
152
+ throw new SbcovConfigError(`Unknown key "${key}.${inner}" in ${displayPath}${suggestion ? `; did you mean ${key}.${suggestion}?` : ''}`, { file: displayPath, key: `${key}.${inner}` });
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ function asConfigObject(value, displayPath) {
159
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
160
+ throw new SbcovConfigError(`${displayPath} does not export a config object (got ${value === null ? 'null' : Array.isArray(value) ? 'an array' : typeof value})`, { file: displayPath });
161
+ }
162
+ const values = { ...value };
163
+ // An ES module namespace for a CommonJS file carries both the named keys and `default`.
164
+ delete values['default'];
165
+ delete values['module.exports'];
166
+ checkKeys(values, displayPath);
167
+ return values;
168
+ }
44
169
  /**
45
- * Load configuration from file
170
+ * Load one config file. Returns null only when the file does not exist; a file
171
+ * that exists and cannot be used throws SbcovConfigError naming it.
46
172
  */
47
- async function loadConfigFile(configPath) {
48
- const absolutePath = path.isAbsolute(configPath)
49
- ? configPath
50
- : path.resolve(process.cwd(), configPath);
173
+ async function loadConfigFile(absolutePath, projectPath) {
51
174
  if (!fs.existsSync(absolutePath)) {
52
175
  return null;
53
176
  }
177
+ const displayPath = displayPathFor(absolutePath, projectPath);
178
+ let raw;
54
179
  try {
55
- // ES module import for .js and .mjs files
56
- if (absolutePath.endsWith('.js') || absolutePath.endsWith('.mjs')) {
57
- const fileUrl = pathToFileURL(absolutePath).href;
58
- const module = await import(fileUrl);
59
- return module.default || module;
60
- }
61
- // JSON files
62
180
  if (absolutePath.endsWith('.json')) {
63
- const content = fs.readFileSync(absolutePath, 'utf-8');
64
- return JSON.parse(content);
181
+ raw = JSON.parse(fs.readFileSync(absolutePath, 'utf-8'));
182
+ }
183
+ else if (/\.(c|m)?js$/.test(absolutePath)) {
184
+ const module = await import(pathToFileURL(absolutePath).href);
185
+ raw = module.default ?? module;
186
+ }
187
+ else {
188
+ throw new Error('unsupported config file extension (use .js, .mjs, .cjs or .json)');
65
189
  }
66
- return null;
67
190
  }
68
191
  catch (error) {
69
- console.error(`Error loading config file ${configPath}:`, error);
70
- return null;
192
+ const hint = /module is not defined in ES module scope|require is not defined in ES module scope/.test(firstLine(error))
193
+ ? ' (the nearest package.json has "type": "module"; rename the file to scry-sbcov.config.cjs or use export default)'
194
+ : '';
195
+ throw new SbcovConfigError(`Could not load ${displayPath}: ${firstLine(error)}${hint}`, { file: displayPath, cause: error });
71
196
  }
197
+ const values = asConfigObject(raw, displayPath);
198
+ return { values, absolutePath, displayPath };
72
199
  }
73
200
  /**
74
- * Load configuration from package.json
201
+ * Read a "scry-sbcov" key from package.json. A package.json that does not parse
202
+ * is only an error when it mentions "scry-sbcov": otherwise it cannot hold our
203
+ * config, and whatever else is wrong with it is not ours to report.
75
204
  */
76
- function loadPackageJsonConfig(projectPath) {
77
- const packageJsonPath = path.join(projectPath, 'package.json');
205
+ function loadPackageJsonConfig(dir, projectPath) {
206
+ const packageJsonPath = path.join(dir, 'package.json');
78
207
  if (!fs.existsSync(packageJsonPath)) {
79
208
  return null;
80
209
  }
210
+ const displayPath = displayPathFor(packageJsonPath, projectPath);
211
+ const content = fs.readFileSync(packageJsonPath, 'utf-8');
212
+ let packageJson;
81
213
  try {
82
- const content = fs.readFileSync(packageJsonPath, 'utf-8');
83
- const packageJson = JSON.parse(content);
84
- return packageJson['scry-sbcov'] || null;
214
+ packageJson = JSON.parse(content);
215
+ }
216
+ catch (error) {
217
+ if (!content.includes('"scry-sbcov"'))
218
+ return null;
219
+ throw new SbcovConfigError(`Could not read the "scry-sbcov" key in ${displayPath}: ${firstLine(error)}`, { file: displayPath, key: 'scry-sbcov', cause: error });
85
220
  }
86
- catch {
221
+ if (!packageJson || typeof packageJson !== 'object' || !('scry-sbcov' in packageJson)) {
87
222
  return null;
88
223
  }
224
+ const values = asConfigObject(packageJson['scry-sbcov'], `${displayPath} "scry-sbcov"`);
225
+ return { values, absolutePath: packageJsonPath, displayPath: `${displayPath} "scry-sbcov"` };
89
226
  }
90
227
  /**
91
- * Find and load configuration automatically
228
+ * Find and load configuration automatically: from projectPath up to the
229
+ * repository root, nearest first; in each directory the config files in
230
+ * CONFIG_FILE_NAMES order, then package.json's "scry-sbcov" key.
231
+ *
232
+ * The deployer runs sbcov with cwd = dirname(--dir), so a config at the repo
233
+ * root was never found for a Storybook built in a subfolder (ISSUES.md #51).
92
234
  */
93
235
  async function autoLoadConfig(projectPath) {
94
- const configFiles = [
95
- 'scry-sbcov.config.js',
96
- 'scry-sbcov.config.mjs',
97
- 'scry-sbcov.config.json',
98
- '.scry-sbcov.js',
99
- '.scry-sbcov.json',
100
- ];
101
- for (const configFile of configFiles) {
102
- const configPath = path.join(projectPath, configFile);
103
- if (fs.existsSync(configPath)) {
104
- const config = await loadConfigFile(configPath);
105
- if (config) {
106
- return config;
107
- }
236
+ for (const dir of searchDirs(projectPath)) {
237
+ for (const name of CONFIG_FILE_NAMES) {
238
+ const loaded = await loadConfigFile(path.join(dir, name), projectPath);
239
+ if (loaded)
240
+ return loaded;
108
241
  }
242
+ const fromPackageJson = loadPackageJsonConfig(dir, projectPath);
243
+ if (fromPackageJson)
244
+ return fromPackageJson;
245
+ }
246
+ return null;
247
+ }
248
+ /** Parse --max-dropped: a whole number of stories, or a percentage such as "5%". */
249
+ export function parseMaxDropped(value, where = '--max-dropped') {
250
+ if (typeof value === 'number' && Number.isInteger(value) && value >= 0)
251
+ return value;
252
+ if (typeof value === 'string') {
253
+ const trimmed = value.trim();
254
+ if (/^\d+$/.test(trimmed))
255
+ return Number(trimmed);
256
+ const pct = /^(\d+(?:\.\d+)?)\s*%$/.exec(trimmed);
257
+ if (pct && Number(pct[1]) <= 100)
258
+ return `${Number(pct[1])}%`;
109
259
  }
110
- // Fall back to package.json
111
- return loadPackageJsonConfig(projectPath);
260
+ throw new SbcovConfigError(`Invalid ${where} ${JSON.stringify(value)}: expected a whole number of stories (e.g. 0, 5) or a percentage (e.g. 5%)`, { key: 'maxDropped' });
112
261
  }
113
262
  /**
114
- * Merge CLI options with config file and defaults
263
+ * Merge CLI options with config file and defaults.
264
+ *
265
+ * Throws SbcovConfigError (the CLI exits 2) when a config file exists and cannot
266
+ * be used, when --config names a file that does not exist, or when a capture
267
+ * setting is invalid. With `allowDefaultCapture`, a config file that cannot be
268
+ * used is reported as a warning and ignored instead; the run uses the defaults
269
+ * and says so in `captureSource`. A missing config is not an error.
115
270
  */
116
271
  export async function loadConfig(cliOptions, projectPath = process.cwd()) {
117
- // Start with defaults
118
- let config = { ...DEFAULT_CONFIG };
272
+ // Start with defaults (nested objects copied, so a run never mutates DEFAULT_CONFIG)
273
+ let config = {
274
+ ...DEFAULT_CONFIG,
275
+ thresholds: { ...DEFAULT_CONFIG.thresholds },
276
+ captureViewport: { ...DEFAULT_CONFIG.captureViewport },
277
+ };
119
278
  // Load from config file if specified, or auto-detect
120
- let fileConfig = null;
121
- if (cliOptions.config) {
122
- fileConfig = await loadConfigFile(cliOptions.config);
123
- if (!fileConfig) {
124
- console.warn(`Warning: Config file ${cliOptions.config} not found, using defaults`);
279
+ let loaded = null;
280
+ try {
281
+ if (cliOptions.config) {
282
+ const absolutePath = path.isAbsolute(cliOptions.config)
283
+ ? cliOptions.config
284
+ : path.resolve(process.cwd(), cliOptions.config);
285
+ loaded = await loadConfigFile(absolutePath, projectPath);
286
+ if (!loaded) {
287
+ throw new SbcovConfigError(`Config file ${cliOptions.config} (--config) does not exist`, { file: cliOptions.config });
288
+ }
289
+ }
290
+ else {
291
+ loaded = await autoLoadConfig(projectPath);
292
+ }
293
+ if (loaded) {
294
+ // Capture values from the file are checked here, before flags can mask them,
295
+ // so a bad value is blamed on the file that holds it.
296
+ validateCapture(mergeConfig(config, loaded.values), loaded.displayPath);
297
+ if (loaded.values.maxDropped !== undefined) {
298
+ parseMaxDropped(loaded.values.maxDropped, `maxDropped in ${loaded.displayPath}`);
299
+ }
125
300
  }
126
301
  }
127
- else {
128
- fileConfig = await autoLoadConfig(projectPath);
302
+ catch (error) {
303
+ if (!(error instanceof SbcovConfigError))
304
+ throw error;
305
+ if (!cliOptions.allowDefaultCapture) {
306
+ // Everything thrown in here is about a config file, which --allow-default-capture can set aside.
307
+ throw new SbcovConfigError(error.message, { file: error.file, key: error.key, cause: error.cause, fromFile: true });
308
+ }
309
+ console.warn(`sbcov: WARNING ${error.message}. Because of --allow-default-capture the run continues without ` +
310
+ `${error.file ?? 'the config'}: every setting in it (story globs, timeouts, thresholds as well as capture) uses the defaults.`);
311
+ loaded = null;
312
+ }
313
+ if (loaded && path.dirname(loaded.absolutePath) !== path.resolve(projectPath)) {
314
+ // Found above the working directory (the deployer runs sbcov in dirname(--dir)).
315
+ // Globs and paths in it still resolve against the working directory; say so once.
316
+ console.warn(`sbcov: using ${loaded.displayPath} from a parent directory; paths and globs in it are relative to ${path.resolve(projectPath)}`);
129
317
  }
130
318
  // Merge file config
131
- if (fileConfig) {
132
- config = mergeConfig(config, fileConfig);
319
+ if (loaded) {
320
+ config = mergeConfig(config, loaded.values);
133
321
  }
134
322
  // Override with CLI options
135
323
  if (cliOptions.include) {
@@ -154,6 +342,7 @@ export async function loadConfig(cliOptions, projectPath = process.cwd()) {
154
342
  config.execute = true;
155
343
  config.captureAllScreenshots = true;
156
344
  }
345
+ const captureFlags = cliOptions.captureMode !== undefined || cliOptions.captureViewport !== undefined || cliOptions.captureScale !== undefined;
157
346
  if (cliOptions.captureMode !== undefined) {
158
347
  config.captureMode = cliOptions.captureMode;
159
348
  }
@@ -173,7 +362,10 @@ export async function loadConfig(cliOptions, projectPath = process.cwd()) {
173
362
  config.outputPath = cliOptions.output;
174
363
  }
175
364
  if (cliOptions.outputZip) {
365
+ // An archive is only ever useful with screenshots in it; without them every
366
+ // passing story would be reported as dropped (no_image).
176
367
  config.execute = true;
368
+ config.captureAllScreenshots = true;
177
369
  config.outputZip = cliOptions.outputZip;
178
370
  }
179
371
  if (cliOptions.thresholdComponent !== undefined) {
@@ -182,27 +374,39 @@ export async function loadConfig(cliOptions, projectPath = process.cwd()) {
182
374
  if (cliOptions.thresholdNewCode !== undefined) {
183
375
  config.thresholds.newCodeCoverage = cliOptions.thresholdNewCode;
184
376
  }
185
- validateCapture(config);
377
+ // No threshold unless one is set (Gate A D1 is enforced by the deployer, which
378
+ // passes --max-dropped 0): an installed deployer < 0.7.0 swallows any non-zero
379
+ // sbcov exit and would then upload no archive at all.
380
+ const maxDropped = cliOptions.maxDropped ?? config.maxDropped;
381
+ config.maxDropped = maxDropped === undefined
382
+ ? undefined
383
+ : parseMaxDropped(maxDropped, cliOptions.maxDropped !== undefined ? '--max-dropped' : `maxDropped in ${loaded?.displayPath ?? 'config'}`);
384
+ const fileWithCapture = loaded && CAPTURE_KEYS.some((key) => loaded?.values[key] !== undefined) ? loaded.displayPath : null;
385
+ config.captureSource = captureFlags
386
+ ? (fileWithCapture ? `flags + ${fileWithCapture}` : 'flags')
387
+ : (fileWithCapture ?? 'defaults');
388
+ validateCapture(config, captureFlags ? 'the capture flags' : undefined);
186
389
  return config;
187
390
  }
188
391
  /** "390x844" → { width: 390, height: 844 }. */
189
392
  export function parseViewport(value) {
190
393
  const m = /^\s*(\d+)\s*[xX×]\s*(\d+)\s*$/.exec(value);
191
394
  if (!m)
192
- throw new Error(`Invalid --capture-viewport "${value}": expected WIDTHxHEIGHT, e.g. 390x844`);
395
+ throw new SbcovConfigError(`Invalid --capture-viewport "${value}": expected WIDTHxHEIGHT, e.g. 390x844`);
193
396
  return { width: Number(m[1]), height: Number(m[2]) };
194
397
  }
195
398
  /** Reject capture settings that would produce nothing or something unexpected, whatever their source. */
196
- function validateCapture(config) {
399
+ function validateCapture(config, source) {
400
+ const where = source ? ` in ${source}` : '';
197
401
  if (config.captureMode !== 'viewport' && config.captureMode !== 'root') {
198
- throw new Error(`Invalid captureMode "${String(config.captureMode)}": expected "viewport" or "root"`);
402
+ throw new SbcovConfigError(`Invalid captureMode "${String(config.captureMode)}"${where}: expected "viewport" or "root"`, { file: source ?? null, key: 'captureMode' });
199
403
  }
200
404
  const v = config.captureViewport;
201
405
  if (!v || !Number.isInteger(v.width) || !Number.isInteger(v.height) || v.width < 1 || v.height < 1) {
202
- throw new Error(`Invalid captureViewport ${JSON.stringify(v)}: expected { width, height } in whole CSS px`);
406
+ throw new SbcovConfigError(`Invalid captureViewport ${JSON.stringify(v)}${where}: expected { width, height } in whole CSS px`, { file: source ?? null, key: 'captureViewport' });
203
407
  }
204
408
  if (typeof config.captureScale !== 'number' || !(config.captureScale > 0) || config.captureScale > 4) {
205
- throw new Error(`Invalid captureScale ${String(config.captureScale)}: expected a number in (0, 4]`);
409
+ throw new SbcovConfigError(`Invalid captureScale ${String(config.captureScale)}${where}: expected a number in (0, 4]`, { file: source ?? null, key: 'captureScale' });
206
410
  }
207
411
  }
208
412
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,cAAc,GAAe;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,+EAA+E;IAC/E,8EAA8E;IAC9E,OAAO,EAAE,CAAC,oBAAoB,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;IACzK,aAAa,EAAE,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;IAC7F,UAAU,EAAE,MAAM;IAClB,iBAAiB,EAAE,IAAI;IACvB,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,uBAAuB;IACrC,kBAAkB,EAAE,IAAI;IACxB,gBAAgB,EAAE,KAAK;IACvB,qBAAqB,EAAE,KAAK;IAC5B,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAC7C,YAAY,EAAE,CAAC;IACf,UAAU,EAAE;QACV,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;KACpB;IACD,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE;QAChB,OAAO,EAAE,CAA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