@flash-tunnel/adapter-cloudflare 0.2.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +22 -5
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -90,7 +90,9 @@ class CloudflareApi {
90
90
  throw new AdapterError("Cannot determine the Cloudflare account id", {
91
91
  code: "ACCOUNT_NOT_FOUND",
92
92
  hint: "Set CLOUDFLARE_ACCOUNT_ID or providers.cloudflare.accountId",
93
- details: { accounts: accounts.map((account) => account.name) }
93
+ details: {
94
+ accounts: accounts.map((account) => account.name)
95
+ }
94
96
  });
95
97
  }
96
98
  async listZones(name) {
@@ -227,7 +229,9 @@ function createCloudflareDns(options) {
227
229
  throw new AdapterError(`DNS record "${target.name}" already exists`, {
228
230
  code: "RECORD_CONFLICT",
229
231
  hint: "Use a different subdomain, or pass --overwrite to replace a non-flash-tunnel record",
230
- details: { records: conflicts.map((record) => record.id) }
232
+ details: {
233
+ records: conflicts.map((record) => record.id)
234
+ }
231
235
  });
232
236
  }
233
237
  },
@@ -479,7 +483,12 @@ function createCloudflareTunnel(options = {}) {
479
483
  code: "PROCESS_SPAWN_FAILED"
480
484
  });
481
485
  }
482
- const args = named ? ["--no-autoupdate", "tunnel", "run"] : ["--no-autoupdate", "tunnel", "--url", localUrl];
486
+ const args = named ? ["--no-autoupdate", "tunnel", "run"] : [
487
+ "--no-autoupdate",
488
+ "tunnel",
489
+ "--url",
490
+ localUrl
491
+ ];
483
492
  const invocation = shellInvocation(cloudflaredPath, args);
484
493
  const child = spawn(invocation.command, invocation.args, {
485
494
  shell: invocation.shell,
@@ -490,7 +499,10 @@ function createCloudflareTunnel(options = {}) {
490
499
  });
491
500
  childProcess = child;
492
501
  if (child.pid) {
493
- handle.meta = { ...handle.meta, processPid: String(child.pid) };
502
+ handle.meta = {
503
+ ...handle.meta,
504
+ processPid: String(child.pid)
505
+ };
494
506
  }
495
507
  child.stderr?.on("data", (chunk) => capture(chunk, hooks));
496
508
  child.stdout?.on("data", (chunk) => capture(chunk, hooks));
@@ -555,7 +567,12 @@ ${output.slice(-10).join("\n")}` : ""}`,
555
567
  return;
556
568
  }
557
569
  if (process.platform === "win32") {
558
- spawnSync("taskkill", ["/PID", String(child.pid), "/T", "/F"], {
570
+ spawnSync("taskkill", [
571
+ "/PID",
572
+ String(child.pid),
573
+ "/T",
574
+ "/F"
575
+ ], {
559
576
  stdio: "ignore",
560
577
  windowsHide: true
561
578
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flash-tunnel/adapter-cloudflare",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/flash-tunnel/flash-tunnel#readme",
7
7
  "repository": {
@@ -30,8 +30,8 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@flash-tunnel/types": "0.2.0",
34
- "@flash-tunnel/utils": "0.2.0"
33
+ "@flash-tunnel/types": "0.3.0",
34
+ "@flash-tunnel/utils": "0.3.0"
35
35
  },
36
36
  "scripts": {
37
37
  "stub": "unbuild --stub",