@better-webhook/cli 3.4.3 → 3.4.4
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.cjs +11 -9
- package/dist/index.js +11 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -25,7 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
27
|
var import_commander7 = require("commander");
|
|
28
|
-
var
|
|
28
|
+
var import_node_fs = require("fs");
|
|
29
|
+
var import_node_url = require("url");
|
|
29
30
|
|
|
30
31
|
// src/commands/templates.ts
|
|
31
32
|
var import_commander = require("commander");
|
|
@@ -2475,13 +2476,10 @@ async function startDashboardServer(options = {}) {
|
|
|
2475
2476
|
);
|
|
2476
2477
|
const host = options.host || "localhost";
|
|
2477
2478
|
const port = options.port ?? 4e3;
|
|
2478
|
-
const runtimeDir = (
|
|
2479
|
+
const runtimeDir = typeof __dirname !== "undefined" ? (
|
|
2479
2480
|
// eslint-disable-next-line no-undef
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
__dirname
|
|
2483
|
-
) : import_path4.default.dirname((0, import_url.fileURLToPath)(import_meta.url))
|
|
2484
|
-
);
|
|
2481
|
+
__dirname
|
|
2482
|
+
) : import_path4.default.dirname((0, import_url.fileURLToPath)(import_meta.url));
|
|
2485
2483
|
const { distDir: dashboardDistDir, indexHtml: dashboardIndexHtml } = resolveDashboardDistDir(runtimeDir);
|
|
2486
2484
|
app.use(import_express2.default.static(dashboardDistDir));
|
|
2487
2485
|
app.get("*", (req, res, next) => {
|
|
@@ -2616,8 +2614,12 @@ var dashboard = new import_commander6.Command().name("dashboard").description("S
|
|
|
2616
2614
|
|
|
2617
2615
|
// src/index.ts
|
|
2618
2616
|
var import_meta2 = {};
|
|
2619
|
-
var
|
|
2620
|
-
|
|
2617
|
+
var packageJsonPath = (0, import_node_url.fileURLToPath)(
|
|
2618
|
+
new URL("../package.json", import_meta2.url)
|
|
2619
|
+
);
|
|
2620
|
+
var packageJson = JSON.parse(
|
|
2621
|
+
(0, import_node_fs.readFileSync)(packageJsonPath, { encoding: "utf8" })
|
|
2622
|
+
);
|
|
2621
2623
|
var program = new import_commander7.Command().name("better-webhook").description(
|
|
2622
2624
|
"Modern CLI for developing, capturing, and replaying webhooks locally"
|
|
2623
2625
|
).version(packageJson.version);
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command as Command7 } from "commander";
|
|
5
|
-
import {
|
|
5
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
6
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
6
7
|
|
|
7
8
|
// src/commands/templates.ts
|
|
8
9
|
import { Command } from "commander";
|
|
@@ -2468,13 +2469,10 @@ async function startDashboardServer(options = {}) {
|
|
|
2468
2469
|
);
|
|
2469
2470
|
const host = options.host || "localhost";
|
|
2470
2471
|
const port = options.port ?? 4e3;
|
|
2471
|
-
const runtimeDir = (
|
|
2472
|
+
const runtimeDir = typeof __dirname !== "undefined" ? (
|
|
2472
2473
|
// eslint-disable-next-line no-undef
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
__dirname
|
|
2476
|
-
) : path.dirname(fileURLToPath(import.meta.url))
|
|
2477
|
-
);
|
|
2474
|
+
__dirname
|
|
2475
|
+
) : path.dirname(fileURLToPath(import.meta.url));
|
|
2478
2476
|
const { distDir: dashboardDistDir, indexHtml: dashboardIndexHtml } = resolveDashboardDistDir(runtimeDir);
|
|
2479
2477
|
app.use(express2.static(dashboardDistDir));
|
|
2480
2478
|
app.get("*", (req, res, next) => {
|
|
@@ -2608,8 +2606,12 @@ var dashboard = new Command6().name("dashboard").description("Start the local da
|
|
|
2608
2606
|
});
|
|
2609
2607
|
|
|
2610
2608
|
// src/index.ts
|
|
2611
|
-
var
|
|
2612
|
-
|
|
2609
|
+
var packageJsonPath = fileURLToPath2(
|
|
2610
|
+
new URL("../package.json", import.meta.url)
|
|
2611
|
+
);
|
|
2612
|
+
var packageJson = JSON.parse(
|
|
2613
|
+
readFileSync4(packageJsonPath, { encoding: "utf8" })
|
|
2614
|
+
);
|
|
2613
2615
|
var program = new Command7().name("better-webhook").description(
|
|
2614
2616
|
"Modern CLI for developing, capturing, and replaying webhooks locally"
|
|
2615
2617
|
).version(packageJson.version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-webhook/cli",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.4",
|
|
4
4
|
"description": "Modern CLI for developing, capturing, and replaying webhooks locally with dashboard UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build:cli": "tsup --format cjs,esm --dts && node ./scripts/copy-dashboard.mjs",
|
|
74
|
-
"build": "pnpm --filter @better-webhook/dashboard build && pnpm run build:cli
|
|
74
|
+
"build": "pnpm --filter @better-webhook/dashboard build && pnpm run build:cli",
|
|
75
75
|
"dev": "tsup --watch",
|
|
76
76
|
"start": "tsx src/index.ts",
|
|
77
77
|
"lint": "tsc"
|