cluso-inspector 1.0.0 → 1.0.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/main.js +16 -0
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -100,6 +100,22 @@ ipcMain.handle('extraction-complete', async (event, data) => {
|
|
|
100
100
|
const outputPath = process.argv[3] || '/tmp/clonereact-output-' + process.pid + '.json';
|
|
101
101
|
const language = process.argv[4] || 'typescript';
|
|
102
102
|
|
|
103
|
+
// Save screenshot as separate file
|
|
104
|
+
let screenshotPath = null;
|
|
105
|
+
if (data.extractions && data.extractions[0] && data.extractions[0].screenshot) {
|
|
106
|
+
const base64Data = data.extractions[0].screenshot.replace(/^data:image\/png;base64,/, '');
|
|
107
|
+
screenshotPath = outputPath.replace('.json', '-screenshot.png');
|
|
108
|
+
try {
|
|
109
|
+
fs.writeFileSync(screenshotPath, Buffer.from(base64Data, 'base64'));
|
|
110
|
+
console.log('[CloneReact] Screenshot saved:', screenshotPath);
|
|
111
|
+
// Replace base64 with path in output
|
|
112
|
+
data.extractions[0].screenshotPath = screenshotPath;
|
|
113
|
+
delete data.extractions[0].screenshot;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error('[CloneReact] Failed to save screenshot:', error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
103
119
|
// Add language to output
|
|
104
120
|
const outputData = {
|
|
105
121
|
...data,
|