@reshotdev/screenshot 0.0.1-beta.19 → 0.0.1-beta.20

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.19",
3
+ "version": "0.0.1-beta.20",
4
4
  "description": "Screenshot and video capture CLI",
5
5
  "author": "Reshot <hello@reshot.dev>",
6
6
  "license": "MIT",
@@ -56,20 +56,44 @@ function loadDiffManifests(outputBaseDir) {
56
56
  const latestVersion = versions.sort().reverse()[0];
57
57
  if (!latestVersion) continue;
58
58
 
59
- const manifestPath = path.join(
60
- scenarioDir,
61
- latestVersion,
62
- "diff-manifest.json",
63
- );
59
+ const versionDir = path.join(scenarioDir, latestVersion);
60
+
61
+ // `run` writes diff-manifest.json into the ACTUAL output dir, which
62
+ // includes the variant subdir (e.g. <version>/default/diff-manifest.json),
63
+ // not the version dir itself. Read the version-level manifest if present
64
+ // AND every variant subdir's manifest, merging their `assets` so the diff
65
+ // the CLI computed actually reaches publish (otherwise the platform stores
66
+ // diffPercentage: null and Activity shows "0 changed" — audit run-13 H1).
67
+ const candidatePaths = [path.join(versionDir, "diff-manifest.json")];
68
+ try {
69
+ for (const entry of fs.readdirSync(versionDir)) {
70
+ const entryPath = path.join(versionDir, entry);
71
+ if (fs.statSync(entryPath).isDirectory()) {
72
+ candidatePaths.push(path.join(entryPath, "diff-manifest.json"));
73
+ }
74
+ }
75
+ } catch (e) {
76
+ // version dir unreadable — fall back to the version-level path only
77
+ }
64
78
 
65
- if (fs.existsSync(manifestPath)) {
79
+ const merged = { assets: {} };
80
+ let foundAny = false;
81
+ for (const manifestPath of candidatePaths) {
82
+ if (!fs.existsSync(manifestPath)) continue;
66
83
  try {
67
84
  const manifest = fs.readJSONSync(manifestPath);
68
- manifests.set(`${scenarioKey}/${latestVersion}`, manifest);
85
+ foundAny = true;
86
+ Object.assign(merged, manifest, {
87
+ assets: { ...merged.assets, ...(manifest.assets || {}) },
88
+ });
69
89
  } catch (e) {
70
90
  // Skip malformed manifests
71
91
  }
72
92
  }
93
+
94
+ if (foundAny) {
95
+ manifests.set(`${scenarioKey}/${latestVersion}`, merged);
96
+ }
73
97
  }
74
98
  } catch (e) {
75
99
  // Return empty if directory structure is unexpected