@cdwr/fly-node 0.3.5 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.6 (2026-11-23)
2
+
3
+ ### 🐞 Bug Fixes
4
+
5
+ - **fly-node:** an absolute config path is found by config show ([edbfd5c86](https://github.com/codeware-sthlm/cdwr/commit/edbfd5c86))
6
+
1
7
  ## 0.3.5 (2026-11-15)
2
8
 
3
9
  ### 🐞 Bug Fixes
package/index.cjs CHANGED
@@ -613,7 +613,7 @@ var SpawnError = class extends Error {
613
613
  }
614
614
  };
615
615
  function spawn(command, args, options) {
616
- return new Promise((resolve, reject) => {
616
+ return new Promise((resolve2, reject) => {
617
617
  const { streamToConsole, ...spawnOptions } = options || {};
618
618
  const process2 = (0, import_child_process2.spawn)(command, args, {
619
619
  ...spawnOptions,
@@ -637,7 +637,7 @@ function spawn(command, args, options) {
637
637
  const stdout = Buffer.concat(stdoutChunks).toString();
638
638
  const stderr = Buffer.concat(stderrChunks).toString();
639
639
  if (code === 0) {
640
- resolve({ stdout, stderr });
640
+ resolve2({ stdout, stderr });
641
641
  } else {
642
642
  const lines = stderr.replace(/\r?\n$/, "").split(/\r?\n/);
643
643
  const message = streamToConsole && lines.length > STREAMED_STDERR_TAIL_LINES ? `Process exited with code ${code}
@@ -654,7 +654,7 @@ Error: ${stderr}`;
654
654
  // libs/shared/util/misc/src/lib/spawn-pty.ts
655
655
  var import_node_pty_prebuilt_multiarch = require("@homebridge/node-pty-prebuilt-multiarch");
656
656
  function spawnPty(command, args, options) {
657
- return new Promise((resolve, reject) => {
657
+ return new Promise((resolve2, reject) => {
658
658
  const ptyData = [];
659
659
  const ptyProcess = (0, import_node_pty_prebuilt_multiarch.spawn)(command, args, {
660
660
  cwd: process.cwd(),
@@ -674,7 +674,7 @@ function spawnPty(command, args, options) {
674
674
  ptyProcess.onExit(({ exitCode }) => {
675
675
  const output = ptyData.join("");
676
676
  if (exitCode === 0) {
677
- resolve(output);
677
+ resolve2(output);
678
678
  } else {
679
679
  reject(
680
680
  new Error(`Process exited with code ${exitCode}
@@ -2141,7 +2141,7 @@ ${error}`);
2141
2141
  return;
2142
2142
  }
2143
2143
  await new Promise(
2144
- (resolve) => setTimeout(resolve, MACHINE_STATE_INTERVAL_MS)
2144
+ (resolve2) => setTimeout(resolve2, MACHINE_STATE_INTERVAL_MS)
2145
2145
  );
2146
2146
  }
2147
2147
  throw new Error(
@@ -2317,7 +2317,7 @@ ${JSON.stringify(response, null, 2)}`);
2317
2317
  async showConfig(onError, options) {
2318
2318
  const normalized = this.normalizeOptions(options);
2319
2319
  const config = normalized.config || this.instanceConfig;
2320
- if (config && !(0, import_fs.existsSync)((0, import_path.join)((0, import_process.cwd)(), config))) {
2320
+ if (config && !(0, import_fs.existsSync)((0, import_path.resolve)((0, import_process.cwd)(), config))) {
2321
2321
  throw new Error(`Config file '${config}' does not exist`);
2322
2322
  }
2323
2323
  const args = ["config", "show"];
@@ -2414,7 +2414,7 @@ ${JSON.stringify(response, null, 2)}`);
2414
2414
  this.logger.info(
2415
2415
  `Transient Fly error (${cause}), retrying in ${delay / 1e3}s (attempt ${attempt + 1} of ${TRANSIENT_RETRY_DELAYS_MS.length + 1}): ${toLogCmd}`
2416
2416
  );
2417
- await new Promise((resolve) => setTimeout(resolve, delay));
2417
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
2418
2418
  continue;
2419
2419
  }
2420
2420
  if (onError === "throwOnError") {
package/index.js CHANGED
@@ -527,7 +527,7 @@ var HOSTNAME_CHECK_FIELDS = `
527
527
 
528
528
  // packages/fly-node/src/lib/fly.class.ts
529
529
  import { existsSync, mkdirSync, writeFileSync } from "fs";
530
- import { dirname, join } from "path";
530
+ import { dirname, join, resolve } from "path";
531
531
  import { cwd } from "process";
532
532
 
533
533
  // libs/shared/util/misc/src/lib/docker-build.ts
@@ -569,7 +569,7 @@ var SpawnError = class extends Error {
569
569
  }
570
570
  };
571
571
  function spawn(command, args, options) {
572
- return new Promise((resolve, reject) => {
572
+ return new Promise((resolve2, reject) => {
573
573
  const { streamToConsole, ...spawnOptions } = options || {};
574
574
  const process2 = cpSpawn(command, args, {
575
575
  ...spawnOptions,
@@ -593,7 +593,7 @@ function spawn(command, args, options) {
593
593
  const stdout = Buffer.concat(stdoutChunks).toString();
594
594
  const stderr = Buffer.concat(stderrChunks).toString();
595
595
  if (code === 0) {
596
- resolve({ stdout, stderr });
596
+ resolve2({ stdout, stderr });
597
597
  } else {
598
598
  const lines = stderr.replace(/\r?\n$/, "").split(/\r?\n/);
599
599
  const message = streamToConsole && lines.length > STREAMED_STDERR_TAIL_LINES ? `Process exited with code ${code}
@@ -610,7 +610,7 @@ Error: ${stderr}`;
610
610
  // libs/shared/util/misc/src/lib/spawn-pty.ts
611
611
  import { spawn as spawn2 } from "@homebridge/node-pty-prebuilt-multiarch";
612
612
  function spawnPty(command, args, options) {
613
- return new Promise((resolve, reject) => {
613
+ return new Promise((resolve2, reject) => {
614
614
  const ptyData = [];
615
615
  const ptyProcess = spawn2(command, args, {
616
616
  cwd: process.cwd(),
@@ -630,7 +630,7 @@ function spawnPty(command, args, options) {
630
630
  ptyProcess.onExit(({ exitCode }) => {
631
631
  const output = ptyData.join("");
632
632
  if (exitCode === 0) {
633
- resolve(output);
633
+ resolve2(output);
634
634
  } else {
635
635
  reject(
636
636
  new Error(`Process exited with code ${exitCode}
@@ -2097,7 +2097,7 @@ ${error}`);
2097
2097
  return;
2098
2098
  }
2099
2099
  await new Promise(
2100
- (resolve) => setTimeout(resolve, MACHINE_STATE_INTERVAL_MS)
2100
+ (resolve2) => setTimeout(resolve2, MACHINE_STATE_INTERVAL_MS)
2101
2101
  );
2102
2102
  }
2103
2103
  throw new Error(
@@ -2273,7 +2273,7 @@ ${JSON.stringify(response, null, 2)}`);
2273
2273
  async showConfig(onError, options) {
2274
2274
  const normalized = this.normalizeOptions(options);
2275
2275
  const config = normalized.config || this.instanceConfig;
2276
- if (config && !existsSync(join(cwd(), config))) {
2276
+ if (config && !existsSync(resolve(cwd(), config))) {
2277
2277
  throw new Error(`Config file '${config}' does not exist`);
2278
2278
  }
2279
2279
  const args = ["config", "show"];
@@ -2370,7 +2370,7 @@ ${JSON.stringify(response, null, 2)}`);
2370
2370
  this.logger.info(
2371
2371
  `Transient Fly error (${cause}), retrying in ${delay / 1e3}s (attempt ${attempt + 1} of ${TRANSIENT_RETRY_DELAYS_MS.length + 1}): ${toLogCmd}`
2372
2372
  );
2373
- await new Promise((resolve) => setTimeout(resolve, delay));
2373
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
2374
2374
  continue;
2375
2375
  }
2376
2376
  if (onError === "throwOnError") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdwr/fly-node",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "The flyctl node wrapper for programmatic deployments to fly.io.",
5
5
  "repository": {
6
6
  "type": "git",