@griffin-app/griffin-cli 1.0.38 → 1.0.40

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.
@@ -42,15 +42,16 @@ export const executeRuns = createCommandHandler("runs", async (options, output)
42
42
  });
43
43
  output.blank();
44
44
  const table = output.table({
45
- head: ["Status", "Monitor", "Duration", "Started"],
45
+ head: ["Status", "Monitor", "Duration", "Location", "Started"],
46
46
  });
47
47
  for (const run of runsData.data) {
48
48
  const statusIcon = getStatusIcon(run.status, run.success);
49
49
  const duration = run.duration_ms
50
50
  ? `${(run.duration_ms / 1000).toFixed(2)}s`
51
51
  : "-";
52
+ const location = run.location ?? "-";
52
53
  const started = new Date(run.startedAt).toLocaleString();
53
- table.push([statusIcon, run.monitor?.name ?? "-", duration, started]);
54
+ table.push([statusIcon, run.monitor?.name ?? "-", duration, location, started]);
54
55
  }
55
56
  output.log(table.toString());
56
57
  const runsWithErrors = runsData.data.filter((run) => Array.isArray(run.errors) && run.errors.length > 0);
@@ -1,4 +1,4 @@
1
- import { loadState } from "../core/state.js";
1
+ import { loadState, stateExists } from "../core/state.js";
2
2
  import { createCommandHandler } from "../utils/command-wrapper.js";
3
3
  import { OutputError } from "../utils/output.js";
4
4
  import { discoverLocalMonitors, filterDiscoveredByName, monitorNotFoundData, } from "../core/monitor-helpers.js";
@@ -6,7 +6,7 @@ import { discoverLocalMonitors, filterDiscoveredByName, monitorNotFoundData, } f
6
6
  * Validate test monitor files without syncing
7
7
  */
8
8
  export const executeValidate = createCommandHandler("validate", async (options, output) => {
9
- const state = await loadState();
9
+ const state = (await stateExists()) ? await loadState() : undefined;
10
10
  const { monitors } = await discoverLocalMonitors(state);
11
11
  let toValidate = monitors;
12
12
  if (options.monitor) {
@@ -52,7 +52,15 @@ export async function runTestFile(filePath, envName) {
52
52
  }
53
53
  let rawMonitor;
54
54
  try {
55
- rawMonitor = validateDsl(defaultExport.default);
55
+ // Handle potential double-wrapping from ESM/CJS interop
56
+ let monitor = defaultExport.default;
57
+ if (typeof monitor === "object" &&
58
+ monitor !== null &&
59
+ "default" in monitor &&
60
+ typeof monitor.default === "object") {
61
+ monitor = monitor.default;
62
+ }
63
+ rawMonitor = validateDsl(monitor);
56
64
  }
57
65
  catch (cause) {
58
66
  throw new MonitorRunnerError("validate", messageFromCause(cause), cause);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@griffin-app/griffin-cli",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "CLI tool for running and managing griffin API tests",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",