react-doctor 0.2.18-dev.0a36216 → 0.2.18-dev.3cc9971

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/cli.js +30 -5
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07713237-df07-5858-b7a4-7b12c0e7b293")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ea4607b-4f8c-5630-8d82-817cba303fa7")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import { execFileSync, spawn, spawnSync } from "node:child_process";
5
5
  import * as Path from "node:path";
@@ -11931,7 +11931,7 @@ const makeNoopConsole = () => ({
11931
11931
  });
11932
11932
  //#endregion
11933
11933
  //#region src/cli/utils/version.ts
11934
- const VERSION = "0.2.18-dev.0a36216";
11934
+ const VERSION = "0.2.18-dev.3cc9971";
11935
11935
  //#endregion
11936
11936
  //#region src/cli/utils/json-mode.ts
11937
11937
  let context = null;
@@ -12277,13 +12277,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
12277
12277
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
12278
12278
  * standard `SENTRY_RELEASE` override.
12279
12279
  */
12280
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.18-dev.0a36216`;
12280
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.18-dev.3cc9971`;
12281
12281
  /**
12282
12282
  * Deployment environment shown in Sentry's environment filter. Defaults to
12283
12283
  * `production` for tagged releases and `development` for dev/unbuilt versions,
12284
12284
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
12285
12285
  */
12286
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.18-dev.0a36216") ? "development" : "production");
12286
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.18-dev.3cc9971") ? "development" : "production");
12287
12287
  /**
12288
12288
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
12289
12289
  * (set to `0` to disable tracing) and falls back to
@@ -19936,6 +19936,30 @@ const exitGracefully = () => {
19936
19936
  process.exit(130);
19937
19937
  };
19938
19938
  //#endregion
19939
+ //#region src/cli/utils/guard-stdin.ts
19940
+ const TERMINAL_HANGUP_CODES = new Set(["EIO", "ENXIO"]);
19941
+ /**
19942
+ * Handles a `process.stdin` `'error'` event. A terminal hangup mid-read
19943
+ * (`read EIO`) is environmental, not a bug, so exit like an interrupted run
19944
+ * instead of crashing. Re-throws anything else so genuine stdin failures keep
19945
+ * funneling to the crash reporter exactly as they did before this guard.
19946
+ */
19947
+ const handleStdinError = (error) => {
19948
+ if (error.code !== void 0 && TERMINAL_HANGUP_CODES.has(error.code)) process.exit(129);
19949
+ throw error;
19950
+ };
19951
+ /**
19952
+ * Arms a `process.stdin` error guard at startup. The only thing that reads
19953
+ * stdin is the interactive `prompts` UI, which opens the TTY in raw mode and
19954
+ * never attaches an `'error'` listener of its own. Without a listener Node
19955
+ * turns a `read EIO` from a vanished terminal into a fatal uncaught exception
19956
+ * (reported to Sentry as a crash); with one, {@link handleStdinError} exits
19957
+ * cleanly on a hangup. Mirrors the stdout EPIPE guard in `cli/index.ts`.
19958
+ */
19959
+ const guardStdin = () => {
19960
+ process.stdin.on("error", handleStdinError);
19961
+ };
19962
+ //#endregion
19939
19963
  //#region src/cli/utils/normalize-help-command.ts
19940
19964
  /**
19941
19965
  * 12-factor CLI Apps (#1, "Great help is essential"): `mycli help` and
@@ -20130,6 +20154,7 @@ initializeSentry();
20130
20154
  process.on("SIGINT", exitGracefully);
20131
20155
  process.on("SIGTERM", exitGracefully);
20132
20156
  unrefStdin();
20157
+ guardStdin();
20133
20158
  const formatExampleLines = (examples) => {
20134
20159
  const width = Math.max(...examples.map(([command]) => command.length));
20135
20160
  return examples.map(([command, description]) => ` $ ${command.padEnd(width)} ${highlighter.dim(`# ${description}`)}`).join("\n");
@@ -20210,4 +20235,4 @@ program.parseAsync(argv).then(() => flushSentry()).catch(async (error) => {
20210
20235
  export {};
20211
20236
 
20212
20237
  //# sourceMappingURL=cli.js.map
20213
- //# debugId=07713237-df07-5858-b7a4-7b12c0e7b293
20238
+ //# debugId=7ea4607b-4f8c-5630-8d82-817cba303fa7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.2.18-dev.0a36216",
3
+ "version": "0.2.18-dev.3cc9971",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -63,7 +63,7 @@
63
63
  "oxlint": "^1.66.0",
64
64
  "prompts": "^2.4.2",
65
65
  "typescript": ">=5.0.4 <7",
66
- "oxlint-plugin-react-doctor": "0.2.18-dev.0a36216"
66
+ "oxlint-plugin-react-doctor": "0.2.18-dev.3cc9971"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/babel__code-frame": "^7.27.0",
@@ -71,8 +71,8 @@
71
71
  "@xterm/headless": "^6.0.0",
72
72
  "commander": "^14.0.3",
73
73
  "ora": "^9.4.0",
74
- "@react-doctor/api": "0.2.18",
75
- "@react-doctor/core": "0.2.18"
74
+ "@react-doctor/core": "0.2.18",
75
+ "@react-doctor/api": "0.2.18"
76
76
  },
77
77
  "engines": {
78
78
  "node": "^20.19.0 || >=22.12.0"