@oxog/react-check 1.1.1 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.2] - 2025-12-31
9
+
10
+ ### Fixed
11
+
12
+ - SSL/HTTPS support: Browser now ignores certificate errors for self-signed certs
13
+ - Improved scan stability: Better signal handling for Windows and non-TTY environments
14
+ - TUI now properly detects TTY availability and falls back gracefully
15
+ - Added automatic retry (3 attempts) when target app is not ready
16
+ - Better error messages for common issues (connection refused, port in use)
17
+
8
18
  ## [1.1.1] - 2025-12-31
9
19
 
10
20
  ### Added
package/dist/cli.js CHANGED
@@ -5605,6 +5605,8 @@ var BrowserLauncher = class extends EventEmitter {
5605
5605
  "--disable-setuid-sandbox",
5606
5606
  "--disable-dev-shm-usage",
5607
5607
  "--disable-gpu",
5608
+ "--ignore-certificate-errors",
5609
+ "--ignore-certificate-errors-spki-list",
5608
5610
  `--window-size=${this.options.width},${this.options.height}`,
5609
5611
  ...this.options.args
5610
5612
  ];
@@ -5661,25 +5663,37 @@ var BrowserLauncher = class extends EventEmitter {
5661
5663
  });
5662
5664
  }
5663
5665
  /**
5664
- * Navigate to a URL
5666
+ * Navigate to a URL with retry support
5665
5667
  * @param url - URL to navigate to
5668
+ * @param retries - Number of retries (default: 3)
5669
+ * @param retryDelay - Delay between retries in ms (default: 2000)
5666
5670
  */
5667
- async navigate(url) {
5671
+ async navigate(url, retries = 3, retryDelay = 2e3) {
5668
5672
  if (!this.page) {
5669
5673
  throw new Error("Browser not launched");
5670
5674
  }
5671
- try {
5672
- await this.page.goto(url, {
5673
- waitUntil: "networkidle2",
5674
- timeout: this.options.timeout
5675
- });
5676
- this.emit("navigated", { url });
5677
- logger3.info(`Navigated to ${url}`);
5678
- } catch (error) {
5679
- const err = error instanceof Error ? error : new Error(String(error));
5680
- this.emit("error", err);
5681
- throw err;
5675
+ let lastError = null;
5676
+ for (let attempt = 1; attempt <= retries; attempt++) {
5677
+ try {
5678
+ await this.page.goto(url, {
5679
+ waitUntil: "networkidle2",
5680
+ timeout: this.options.timeout
5681
+ });
5682
+ this.emit("navigated", { url });
5683
+ logger3.info(`Navigated to ${url}`);
5684
+ return;
5685
+ } catch (error) {
5686
+ lastError = error instanceof Error ? error : new Error(String(error));
5687
+ this.emit("error", lastError);
5688
+ if (lastError.message.includes("ERR_CONNECTION_REFUSED") && attempt < retries) {
5689
+ logger3.warn(`Connection refused, retrying in ${retryDelay}ms... (${attempt}/${retries})`);
5690
+ await new Promise((resolve3) => setTimeout(resolve3, retryDelay));
5691
+ continue;
5692
+ }
5693
+ throw lastError;
5694
+ }
5682
5695
  }
5696
+ throw lastError ?? new Error("Navigation failed");
5683
5697
  }
5684
5698
  /**
5685
5699
  * Execute script in page context
@@ -7123,7 +7137,7 @@ async function runScanCommand(args) {
7123
7137
  browserClients: /* @__PURE__ */ new Set()
7124
7138
  };
7125
7139
  setupScannerEvents(session);
7126
- const useTUI = !mergedOptions.silent && !mergedOptions.proxy;
7140
+ const useTUI = !mergedOptions.silent && !mergedOptions.proxy && process.stdin.isTTY;
7127
7141
  if (useTUI) {
7128
7142
  session.tui = new TUI(mergedOptions.target);
7129
7143
  setupTUIEvents(session);
@@ -7133,6 +7147,8 @@ async function runScanCommand(args) {
7133
7147
  fps: session.scanner.getFps()
7134
7148
  }));
7135
7149
  session.tui.start();
7150
+ } else if (!mergedOptions.silent && !mergedOptions.proxy && !process.stdin.isTTY) {
7151
+ logger4.warn("TTY not available, TUI disabled. Use --silent for non-interactive mode.");
7136
7152
  }
7137
7153
  if (mergedOptions.webui) {
7138
7154
  session.webui = new WebUIServer(mergedOptions.webuiPort, mergedOptions.target);
@@ -7243,7 +7259,20 @@ async function runScanCommand(args) {
7243
7259
  return summary.criticalIssues > 0 ? 1 : 0;
7244
7260
  } catch (error) {
7245
7261
  await cleanupSession(session);
7246
- logger4.error("Scan failed:", error);
7262
+ const errorMessage = error instanceof Error ? error.message : String(error);
7263
+ if (errorMessage.includes("ERR_CONNECTION_REFUSED")) {
7264
+ logger4.error(`Could not connect to ${mergedOptions.target}`);
7265
+ logger4.info("Make sure your React application is running at that address.");
7266
+ logger4.info("Example: npm start or npm run dev");
7267
+ } else if (errorMessage.includes("EADDRINUSE")) {
7268
+ logger4.error(`Port ${mergedOptions.port} is already in use`);
7269
+ logger4.info("Try using a different port with --port <number>");
7270
+ } else if (errorMessage.includes("ERR_CERT")) {
7271
+ logger4.error("SSL certificate error");
7272
+ logger4.info("ReactCheck now supports self-signed certificates by default.");
7273
+ } else {
7274
+ logger4.error("Scan failed:", errorMessage);
7275
+ }
7247
7276
  return 2;
7248
7277
  }
7249
7278
  }
@@ -7356,6 +7385,10 @@ async function waitForSignal() {
7356
7385
  return new Promise((resolve3) => {
7357
7386
  process.once("SIGINT", () => resolve3());
7358
7387
  process.once("SIGTERM", () => resolve3());
7388
+ if (process.stdin.isTTY) {
7389
+ process.stdin.resume();
7390
+ }
7391
+ process.stdin.once("end", () => resolve3());
7359
7392
  });
7360
7393
  }
7361
7394
  function generateReport(session) {