relionhq 2.0.2 → 2.0.3

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.js +15 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -493,8 +493,9 @@ async function scanCommand(targetPath, flags) {
493
493
  const startedAt = Date.now();
494
494
  const config = resolveConfig({ token: flags.token, apiUrl: flags.url, repoUrl: flags.repoUrl, commit: flags.commit, branch: flags.branch }, root);
495
495
  if (!config.token && !flags.dryRun) {
496
- printError("No API token found.", "Set RELION_TOKEN env var or run: relion login --token <token>");
497
- process.exit(1);
496
+ printError("No API token found.", "Run: relion login");
497
+ process.exitCode = 1;
498
+ return;
498
499
  }
499
500
  const meta = gitMeta(root);
500
501
  const branch = flags.branch ?? config.branch ?? meta.branch ?? void 0;
@@ -524,7 +525,8 @@ Relion v2.0.0${repoUrl ? ` \xB7 ${repoUrl.replace("https://github.com/", "")}`
524
525
  } else {
525
526
  process.stdout.write(JSON.stringify({ vendors: detected, dryRun: true }, null, 2) + "\n");
526
527
  }
527
- process.exit(detected.length === 0 ? 4 : 0);
528
+ process.exitCode = detected.length === 0 ? 4 : 0;
529
+ return;
528
530
  }
529
531
  spinner.start("Uploading API metadata");
530
532
  const payload = {
@@ -579,9 +581,9 @@ Relion v2.0.0${repoUrl ? ` \xB7 ${repoUrl.replace("https://github.com/", "")}`
579
581
  const global = readGlobalConfig();
580
582
  writeGlobalConfig({ ...global, lastScanId: receipt.scanId, lastScanAt: (/* @__PURE__ */ new Date()).toISOString(), lastDashboardUrl: receipt.dashboardUrl });
581
583
  }
582
- if (receipt.deployGate?.status === "blocked") process.exit(2);
583
- if (receipt.deployGate?.status === "pending") process.exit(3);
584
- if (detected.length === 0) process.exit(4);
584
+ if (receipt.deployGate?.status === "blocked") process.exitCode = 2;
585
+ else if (receipt.deployGate?.status === "pending") process.exitCode = 3;
586
+ else if (detected.length === 0) process.exitCode = 4;
585
587
  } catch (err) {
586
588
  spinner.fail("Scan failed");
587
589
  const msg = err instanceof Error ? err.message : String(err);
@@ -591,7 +593,7 @@ Relion v2.0.0${repoUrl ? ` \xB7 ${repoUrl.replace("https://github.com/", "")}`
591
593
  printError(msg);
592
594
  }
593
595
  if (flags.verbose) console.error(err);
594
- process.exit(1);
596
+ process.exitCode = 1;
595
597
  }
596
598
  }
597
599
  async function verifyToken(token, apiUrl) {
@@ -845,8 +847,9 @@ async function predeployCommand(targetPath, flags) {
845
847
  const config = resolveConfig({ token: flags.token, apiUrl: flags.url, repoUrl: flags.repoUrl, commit: flags.commit, branch: flags.branch }, root);
846
848
  const offline = flags.offline ?? !config.token;
847
849
  if (!config.token && !offline) {
848
- printError("No API token found.", "Set RELION_TOKEN env var or run: relion login --token <token>\nUse --offline to run without cloud lookup.");
849
- process.exit(1);
850
+ printError("No API token found.", "Run: relion login\nOr set RELION_TOKEN env var. Use --offline to skip cloud lookup.");
851
+ process.exitCode = 1;
852
+ return;
850
853
  }
851
854
  let scopeMode = "default";
852
855
  let diffBase;
@@ -871,7 +874,7 @@ Relion pre-deploy check \u2014 ${scopeLabel}
871
874
  if (changedFiles.length === 0) {
872
875
  spinner.succeed("No changed files found");
873
876
  if (!flags.json) console.log("\nNothing to check \u2014 no changed files detected.\n");
874
- process.exit(0);
877
+ return;
875
878
  }
876
879
  spinner.succeed(`${changedFiles.length} changed file${changedFiles.length === 1 ? "" : "s"}`);
877
880
  spinner.start("Detecting API dependencies");
@@ -950,7 +953,7 @@ Relion pre-deploy check \u2014 ${scopeLabel}
950
953
  }
951
954
  }
952
955
  }
953
- process.exit(exitCode);
956
+ process.exitCode = exitCode;
954
957
  } catch (err) {
955
958
  spinner.fail("Pre-deploy check failed");
956
959
  const msg = err instanceof Error ? err.message : String(err);
@@ -962,7 +965,7 @@ Relion pre-deploy check \u2014 ${scopeLabel}
962
965
  printError(msg);
963
966
  }
964
967
  if (flags.verbose) console.error(err);
965
- process.exit(1);
968
+ process.exitCode = 1;
966
969
  }
967
970
  }
968
971
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relionhq",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Relion CLI — pre-deploy API risk detection and monitoring client.",
5
5
  "license": "MIT",
6
6
  "bin": {