@spectratools/aborean-cli 0.10.6 → 0.10.8

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/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { readFileSync } from "fs";
4
+ import { readFileSync, realpathSync } from "fs";
5
5
  import { dirname, resolve } from "path";
6
6
  import { fileURLToPath } from "url";
7
7
  import { checksumAddress as checksumAddress6 } from "@spectratools/cli-shared";
@@ -6638,9 +6638,22 @@ cli.command("status", {
6638
6638
  }
6639
6639
  });
6640
6640
  applyFriendlyErrorHandling(cli);
6641
- initTelemetry("aborean");
6642
- process.on("beforeExit", () => shutdownTelemetry());
6643
- cli.serve();
6641
+ var isMain = (() => {
6642
+ const entrypoint = process.argv[1];
6643
+ if (!entrypoint) {
6644
+ return false;
6645
+ }
6646
+ try {
6647
+ return realpathSync(entrypoint) === realpathSync(fileURLToPath(import.meta.url));
6648
+ } catch {
6649
+ return false;
6650
+ }
6651
+ })();
6652
+ if (isMain) {
6653
+ initTelemetry("aborean");
6654
+ process.on("beforeExit", () => shutdownTelemetry());
6655
+ cli.serve();
6656
+ }
6644
6657
  export {
6645
6658
  cli
6646
6659
  };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { readFileSync } from "fs";
4
+ import { readFileSync, realpathSync } from "fs";
5
5
  import { dirname, resolve } from "path";
6
6
  import { fileURLToPath } from "url";
7
7
  import { checksumAddress as checksumAddress6 } from "@spectratools/cli-shared";
@@ -6638,9 +6638,22 @@ cli.command("status", {
6638
6638
  }
6639
6639
  });
6640
6640
  applyFriendlyErrorHandling(cli);
6641
- initTelemetry("aborean");
6642
- process.on("beforeExit", () => shutdownTelemetry());
6643
- cli.serve();
6641
+ var isMain = (() => {
6642
+ const entrypoint = process.argv[1];
6643
+ if (!entrypoint) {
6644
+ return false;
6645
+ }
6646
+ try {
6647
+ return realpathSync(entrypoint) === realpathSync(fileURLToPath(import.meta.url));
6648
+ } catch {
6649
+ return false;
6650
+ }
6651
+ })();
6652
+ if (isMain) {
6653
+ initTelemetry("aborean");
6654
+ process.on("beforeExit", () => shutdownTelemetry());
6655
+ cli.serve();
6656
+ }
6644
6657
  export {
6645
6658
  cli
6646
6659
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectratools/aborean-cli",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "description": "CLI for Aborean Finance DEX on Abstract (pools, swaps, gauges, voting escrow).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,8 +39,8 @@
39
39
  "incur": "^0.3.0",
40
40
  "ox": "^0.14.0",
41
41
  "viem": "^2.47.0",
42
- "@spectratools/cli-shared": "0.4.0",
43
- "@spectratools/tx-shared": "0.6.1"
42
+ "@spectratools/cli-shared": "0.4.1",
43
+ "@spectratools/tx-shared": "0.6.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "typescript": "5.7.3",