@reshotdev/screenshot 0.0.1-beta.0 → 0.0.1-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reshotdev/screenshot",
3
- "version": "0.0.1-beta.0",
3
+ "version": "0.0.1-beta.2",
4
4
  "description": "CI/CD screenshot and video capture CLI",
5
5
  "author": "Reshot <hello@reshot.dev>",
6
6
  "license": "MIT",
@@ -465,6 +465,26 @@ async function runCommand(options = {}) {
465
465
 
466
466
  console.log(chalk.gray(`\nOutput saved to: ${outputBaseDir}`));
467
467
 
468
+ // Offer to open Studio for review (interactive TTY only, on success)
469
+ if (result.success && process.stdin.isTTY && !noExit) {
470
+ const inquirer = require("inquirer");
471
+ const { openStudio } = await inquirer.prompt([
472
+ {
473
+ type: "confirm",
474
+ name: "openStudio",
475
+ message: "Open Reshot Studio to review captures?",
476
+ default: true,
477
+ },
478
+ ]);
479
+
480
+ if (openStudio) {
481
+ console.log(chalk.cyan("\nšŸŽ¬ Launching Reshot Studio...\n"));
482
+ const uiCommand = require("./ui");
483
+ await uiCommand({ open: true });
484
+ return { success: result.success, results: result.results };
485
+ }
486
+ }
487
+
468
488
  // Ensure process exits cleanly (Playwright CDP connections can keep event loop alive)
469
489
  if (!noExit) {
470
490
  setImmediate(() => process.exit(process.exitCode || 0));
@@ -673,7 +673,21 @@ async function setupWizard(options = {}) {
673
673
  journeyMappings:
674
674
  Object.keys(journeyMappings).length > 0 ? journeyMappings : undefined,
675
675
  };
676
- newConfig.assetDir = ".reshot/output";
676
+
677
+ if (!useCloud) {
678
+ const { customAssetDir } = await inquirer.prompt([
679
+ {
680
+ type: "input",
681
+ name: "customAssetDir",
682
+ message: "Where should screenshots be saved?",
683
+ default: ".reshot/output",
684
+ },
685
+ ]);
686
+ newConfig.assetDir = customAssetDir;
687
+ } else {
688
+ newConfig.assetDir = ".reshot/output";
689
+ }
690
+
677
691
  newConfig.scenarios = existingConfig?.scenarios || [];
678
692
  }
679
693
 
@@ -2330,6 +2330,33 @@ async function runScenarioWithVideoCapture(scenario, options = {}) {
2330
2330
  )
2331
2331
  );
2332
2332
 
2333
+ // Extract poster frame from the video (first frame at 0.5s for non-blank content)
2334
+ const posterPath = finalVideoPath.replace(/\.mp4$/, "-poster.png");
2335
+ try {
2336
+ await runFFmpegConvert([
2337
+ "-i",
2338
+ finalVideoPath,
2339
+ "-ss",
2340
+ "0.5",
2341
+ "-frames:v",
2342
+ "1",
2343
+ "-q:v",
2344
+ "2",
2345
+ "-y",
2346
+ posterPath,
2347
+ ]);
2348
+ if (fs.existsSync(posterPath)) {
2349
+ const posterSize = fs.statSync(posterPath).size;
2350
+ console.log(
2351
+ chalk.green(
2352
+ ` āœ” Poster frame: ${posterPath} (${(posterSize / 1024).toFixed(1)} KB)`
2353
+ )
2354
+ );
2355
+ }
2356
+ } catch (e) {
2357
+ debug(`Poster frame extraction failed: ${e.message}`);
2358
+ }
2359
+
2333
2360
  // Save timeline for reference
2334
2361
  const timelinePath = path.join(
2335
2362
  outputDir || path.join(".reshot/output", scenario.key, "default"),