forge-remote 0.1.30 → 2.1.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 +2 -2
- package/src/build-manager.js +38 -66
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-remote",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Desktop relay for Forge Remote —
|
|
3
|
+
"version": "2.1.2",
|
|
4
|
+
"description": "Desktop relay for Forge Remote — mobile command center for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"author": "Daniel Wendel <daniel@ironforgeapps.com> (https://ironforgeapps.com)",
|
package/src/build-manager.js
CHANGED
|
@@ -231,88 +231,60 @@ export async function runBuild(projectPath, platform, onOutput) {
|
|
|
231
231
|
process.env.DEVELOPER_DIR ||
|
|
232
232
|
"/Applications/Xcode.app/Contents/Developer",
|
|
233
233
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
});
|
|
234
|
+
try {
|
|
235
|
+
const output = execSync(buildCmd, {
|
|
236
|
+
cwd: projectPath,
|
|
237
|
+
env: buildEnv,
|
|
238
|
+
timeout: 600000, // 10 minutes
|
|
239
|
+
encoding: "utf-8",
|
|
240
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
241
|
+
shell: shell,
|
|
242
|
+
});
|
|
244
243
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
setTimeout(() => {
|
|
252
|
-
try {
|
|
253
|
-
proc.kill("SIGKILL");
|
|
254
|
-
} catch {}
|
|
255
|
-
}, 5000);
|
|
256
|
-
reject(new Error(`Build timed out after 10 minutes`));
|
|
257
|
-
}, 600000);
|
|
244
|
+
const duration = Math.round((Date.now() - startTime) / 1000);
|
|
245
|
+
const outputPath =
|
|
246
|
+
projectInfo.outputPaths[platform] ||
|
|
247
|
+
projectInfo.outputPaths.web ||
|
|
248
|
+
projectInfo.outputPaths.default ||
|
|
249
|
+
null;
|
|
258
250
|
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
for (const line of text.split("\n")) {
|
|
251
|
+
// Stream output lines to callback
|
|
252
|
+
for (const line of output.split("\n")) {
|
|
262
253
|
const trimmed = line.trim();
|
|
263
254
|
if (trimmed) {
|
|
264
255
|
outputLines.push(trimmed);
|
|
265
256
|
if (onOutput) onOutput(trimmed, "stdout");
|
|
266
257
|
}
|
|
267
258
|
}
|
|
268
|
-
});
|
|
269
259
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
log.info(`Build succeeded in ${duration}s`);
|
|
261
|
+
resolve({
|
|
262
|
+
success: true,
|
|
263
|
+
output: outputLines.join("\n"),
|
|
264
|
+
duration,
|
|
265
|
+
outputPath: outputPath ? path.resolve(projectPath, outputPath) : null,
|
|
266
|
+
framework: projectInfo.framework,
|
|
267
|
+
platform,
|
|
268
|
+
});
|
|
269
|
+
} catch (err) {
|
|
270
|
+
const duration = Math.round((Date.now() - startTime) / 1000);
|
|
271
|
+
const stderr = err.stderr?.toString() || "";
|
|
272
|
+
const stdout = err.stdout?.toString() || "";
|
|
273
|
+
const allOutput = (stdout + "\n" + stderr).trim();
|
|
274
|
+
|
|
275
|
+
// Stream output lines to callback
|
|
276
|
+
for (const line of allOutput.split("\n")) {
|
|
273
277
|
const trimmed = line.trim();
|
|
274
278
|
if (trimmed) {
|
|
275
279
|
outputLines.push(trimmed);
|
|
276
280
|
if (onOutput) onOutput(trimmed, "stderr");
|
|
277
281
|
}
|
|
278
282
|
}
|
|
279
|
-
});
|
|
280
283
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
reject(new Error(`Build
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
proc.on("close", (code) => {
|
|
287
|
-
clearTimeout(buildTimeout);
|
|
288
|
-
const duration = Math.round((Date.now() - startTime) / 1000);
|
|
289
|
-
const outputPath =
|
|
290
|
-
projectInfo.outputPaths[platform] ||
|
|
291
|
-
projectInfo.outputPaths.web ||
|
|
292
|
-
projectInfo.outputPaths.default ||
|
|
293
|
-
null;
|
|
294
|
-
|
|
295
|
-
if (code === 0) {
|
|
296
|
-
log.info(`Build succeeded in ${duration}s`);
|
|
297
|
-
resolve({
|
|
298
|
-
success: true,
|
|
299
|
-
output: outputLines.join("\n"),
|
|
300
|
-
duration,
|
|
301
|
-
outputPath: outputPath ? path.resolve(projectPath, outputPath) : null,
|
|
302
|
-
framework: projectInfo.framework,
|
|
303
|
-
platform,
|
|
304
|
-
});
|
|
305
|
-
} else {
|
|
306
|
-
const tail = outputLines.slice(-15).join("\n");
|
|
307
|
-
log.error(`Build failed (exit code ${code})`);
|
|
308
|
-
reject(new Error(`Build failed (exit code ${code})\n${tail}`));
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
proc.on("error", (err) => {
|
|
313
|
-
log.error(`Build process error: ${err.message}`);
|
|
314
|
-
reject(new Error(`Build process error: ${err.message}`));
|
|
315
|
-
});
|
|
284
|
+
const tail = outputLines.slice(-15).join("\n");
|
|
285
|
+
log.error(`Build failed (exit code ${err.status}) after ${duration}s`);
|
|
286
|
+
reject(new Error(`Build failed (exit code ${err.status})\n${tail}`));
|
|
287
|
+
}
|
|
316
288
|
});
|
|
317
289
|
}
|
|
318
290
|
|