@scrymore/scry-deployer 0.4.1 → 0.5.1

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/bin/cli.js CHANGED
@@ -147,6 +147,30 @@ async function runDeployment(argv) {
147
147
  '\n⚠️ Metadata was uploaded but not queued for processing.\n' +
148
148
  ' The Storybook is hosted, but its components are NOT being indexed.'
149
149
  );
150
+ } else if (argv.withAnalysis) {
151
+ // The gap between the two branches above, and the most damaging
152
+ // state of the three: analysis was asked for, produced nothing, and
153
+ // this command used to say "Upload successful" and stop. Nothing is
154
+ // ever indexed, no error is printed, and CI stays green — so the
155
+ // first sign of trouble is a customer reporting that search is empty
156
+ // days later (ISSUES.md #24).
157
+ //
158
+ // Exit non-zero. The Storybook is hosted, so "failure" overstates it
159
+ // slightly, but the job asked for was to make components searchable
160
+ // and that did not happen. A red build is the only signal that gets
161
+ // acted on.
162
+ process.exitCode = 1;
163
+ logger.error(
164
+ '\n❌ Analysis produced no metadata, so NOTHING WILL BE INDEXED.\n' +
165
+ ' The Storybook is hosted and browsable, but no component will be\n' +
166
+ ' searchable from this build.\n\n' +
167
+ ' You asked for --with-analysis and it did not complete. The cause is\n' +
168
+ ' in the coverage output above — commonly a missing Playwright browser\n' +
169
+ ' (run: npx playwright install chromium-headless-shell) or a TypeScript\n' +
170
+ ' resolution error in the analyzer.\n\n' +
171
+ ' Exiting non-zero deliberately: a green build here would mean search\n' +
172
+ ' silently returns nothing.'
173
+ );
150
174
  }
151
175
 
152
176
  } finally {
package/lib/apiClient.js CHANGED
@@ -427,12 +427,26 @@ async function uploadBuild(apiClient, target, options) {
427
427
  logger.info(`Waiting ${COVERAGE_UPLOAD_DELAY_MS / 1000}s before uploading coverage report...`);
428
428
  await sleep(COVERAGE_UPLOAD_DELAY_MS);
429
429
 
430
+ // The retry used to be unguarded, so a second failure threw out of
431
+ // uploadBuild and the metadata upload below never ran. Coverage is a
432
+ // report; the metadata archive is what makes components searchable — so a
433
+ // failure in the optional artifact was silently taking down the essential
434
+ // one. Observed on a 467-story library: every story captured, nothing
435
+ // indexed, twice.
430
436
  try {
431
437
  coverageUpload = await uploadCoverageReportDirectly(apiClient, target, options.coverageReport);
432
438
  } catch (error) {
433
439
  logger.info('Coverage upload failed; retrying in 60s...');
434
440
  await sleep(COVERAGE_RETRY_DELAY_MS);
435
- coverageUpload = await uploadCoverageReportDirectly(apiClient, target, options.coverageReport);
441
+ try {
442
+ coverageUpload = await uploadCoverageReportDirectly(apiClient, target, options.coverageReport);
443
+ } catch (retryError) {
444
+ logger.warn(
445
+ `⚠️ Coverage report upload failed: ${retryError.message}\n` +
446
+ ' Continuing — this affects the coverage report only. Screenshots and\n' +
447
+ ' metadata still upload, so components will still be indexed.'
448
+ );
449
+ }
436
450
  }
437
451
  }
438
452
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrymore/scry-deployer",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "A CLI to automate the deployment of Storybook static builds.",
5
5
  "main": "index.js",
6
6
  "bin": {