@papercraneai/sandbox-agent 0.1.15 → 0.1.16
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/dist/index.js +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -524,7 +524,20 @@ app.post("/cli/refresh", async (_req, res) => {
|
|
|
524
524
|
if (!gitRoot)
|
|
525
525
|
return;
|
|
526
526
|
const { workspaceRefresh } = await import("@papercraneai/cli/lib/workspace-ops.js");
|
|
527
|
-
|
|
527
|
+
const result = await workspaceRefresh(gitRoot);
|
|
528
|
+
// If we start seeing publishes that change npm deps frequently, enable this
|
|
529
|
+
// block so refresh re-installs node_modules and bounces the dev-server PM2
|
|
530
|
+
// process (sandbox-agent stays up). Today most refreshes are dashboard source
|
|
531
|
+
// only, so paying the install + restart cost (and brief 502s on any open
|
|
532
|
+
// preview URL) on every push isn't worth it.
|
|
533
|
+
//
|
|
534
|
+
// const packageJsonChanged = result.filesChanged?.some((f: string) => f === "package.json" || f === "package-lock.json")
|
|
535
|
+
// if (packageJsonChanged) {
|
|
536
|
+
// await runNpmInstall(gitRoot)
|
|
537
|
+
// execSync("pm2 restart dev-server")
|
|
538
|
+
// }
|
|
539
|
+
// await ensureAppScaffold(gitRoot)
|
|
540
|
+
res.json(result);
|
|
528
541
|
});
|
|
529
542
|
app.post("/cli/publish", async (req, res) => {
|
|
530
543
|
const gitRoot = await resolveGitRoot(res);
|