percher 0.5.4 → 0.5.5

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.
@@ -113418,9 +113418,20 @@ function updateLocalTomlName(cwd, oldName, newName) {
113418
113418
  }
113419
113419
  }
113420
113420
  // ../core/dist/commands/reproduce.js
113421
+ import { spawn } from "node:child_process";
113421
113422
  import { mkdtempSync, writeFileSync as writeFileSync9 } from "node:fs";
113422
113423
  import { tmpdir } from "node:os";
113423
113424
  import { join as join23 } from "node:path";
113425
+ function runProcessExit(cmd, args, opts = {}) {
113426
+ return new Promise((resolve7, reject) => {
113427
+ const child = spawn(cmd, args, {
113428
+ cwd: opts.cwd,
113429
+ stdio: opts.inherit ? "inherit" : "ignore"
113430
+ });
113431
+ child.on("error", reject);
113432
+ child.on("close", (code) => resolve7(code ?? 1));
113433
+ });
113434
+ }
113424
113435
  var reproduceInputSchema = exports_external.object({
113425
113436
  app: exports_external.string().optional().describe("App name. Defaults to the [app].name in the current directory's percher.toml."),
113426
113437
  deployId: exports_external.string().describe("Deploy id (e.g. dep_abc123) to reproduce. Required — usually the failed deploy you want to debug.")
@@ -113509,12 +113520,7 @@ async function reproduce(ctx, input) {
113509
113520
  writeFileSync9(tarballPath, bytes);
113510
113521
  let extracted = false;
113511
113522
  try {
113512
- const proc = Bun.spawn(["tar", "-xzf", tarballPath, "-C", tmpDir], {
113513
- stdout: "pipe",
113514
- stderr: "pipe"
113515
- });
113516
- const exitCode = await proc.exited;
113517
- extracted = exitCode === 0;
113523
+ extracted = await runProcessExit("tar", ["-xzf", tarballPath, "-C", tmpDir]) === 0;
113518
113524
  } catch {}
113519
113525
  const envHint = currentAppEnvKeys.length > 0 ? `Current app env keys (NOT a deploy-time snapshot): ${currentAppEnvKeys.join(", ")}` : "No env vars currently configured on the app.";
113520
113526
  if (!extracted) {
@@ -113533,20 +113539,15 @@ async function reproduce(ctx, input) {
113533
113539
  let builtLocally = false;
113534
113540
  let nixpacksAvailable = false;
113535
113541
  try {
113536
- const which = Bun.spawn(["nixpacks", "--version"], { stdout: "pipe", stderr: "pipe" });
113537
- const code = await which.exited;
113538
- nixpacksAvailable = code === 0;
113542
+ nixpacksAvailable = await runProcessExit("nixpacks", ["--version"]) === 0;
113539
113543
  } catch {}
113540
113544
  if (nixpacksAvailable) {
113541
113545
  ctx.status("Running nixpacks build locally...");
113542
113546
  try {
113543
- const build = Bun.spawn(["nixpacks", "build", tmpDir, "--name", `repro-${input.deployId}`], {
113547
+ builtLocally = await runProcessExit("nixpacks", ["build", tmpDir, "--name", `repro-${input.deployId}`], {
113544
113548
  cwd: tmpDir,
113545
- stdout: "inherit",
113546
- stderr: "inherit"
113547
- });
113548
- const code = await build.exited;
113549
- builtLocally = code === 0;
113549
+ inherit: true
113550
+ }) === 0;
113550
113551
  } catch {}
113551
113552
  }
113552
113553
  const buildHint = builtLocally ? `Build succeeded locally — the cloud failure may have been infra-flake. Retry the same source server-side: \`bunx percher redeploy ${input.deployId} --app ${app.name}\`` : nixpacksAvailable ? "nixpacks build also failed locally — same error as cloud. Iterate on the source in the tmp dir, then `bunx percher publish` from the project root once fixed." : `nixpacks not on PATH. Install from https://nixpacks.com to reproduce the build, or run your own build command in ${tmpDir}.`;
@@ -115870,16 +115871,16 @@ function registerTransfersCommands(cli, ctx) {
115870
115871
  }
115871
115872
 
115872
115873
  // src/open.ts
115873
- import { spawn } from "node:child_process";
115874
+ import { spawn as spawn2 } from "node:child_process";
115874
115875
  async function openUrl(url2) {
115875
115876
  const platform = process.platform;
115876
115877
  try {
115877
115878
  if (platform === "darwin")
115878
- spawn("open", [url2], { detached: true, stdio: "ignore" }).unref();
115879
+ spawn2("open", [url2], { detached: true, stdio: "ignore" }).unref();
115879
115880
  else if (platform === "win32")
115880
- spawn("cmd", ["/c", "start", "", url2], { detached: true, stdio: "ignore" }).unref();
115881
+ spawn2("cmd", ["/c", "start", "", url2], { detached: true, stdio: "ignore" }).unref();
115881
115882
  else
115882
- spawn("xdg-open", [url2], { detached: true, stdio: "ignore" }).unref();
115883
+ spawn2("xdg-open", [url2], { detached: true, stdio: "ignore" }).unref();
115883
115884
  } catch {}
115884
115885
  }
115885
115886
 
@@ -115986,7 +115987,7 @@ async function renderError(stderr, error48) {
115986
115987
  // package.json
115987
115988
  var package_default = {
115988
115989
  name: "percher",
115989
- version: "0.5.4",
115990
+ version: "0.5.5",
115990
115991
  description: "CLI for the Percher hosting platform — publish apps with one command",
115991
115992
  type: "module",
115992
115993
  bin: {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "percher",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "CLI for the Percher hosting platform — publish apps with one command",
5
5
  "type": "module",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "percher",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "CLI for the Percher hosting platform — publish apps with one command",
5
5
  "type": "module",
6
6
  "bin": {