react-doctor 0.2.18-dev.0a36216 → 0.2.18-dev.19b39c0

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/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]="989a10c5-8f69-5f04-a13a-8353aeb4c29a")}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";
@@ -5157,7 +5157,10 @@ const IGNORABLE_READDIR_ERROR_CODES = new Set([
5157
5157
  "EACCES",
5158
5158
  "EPERM",
5159
5159
  "ENOENT",
5160
- "ENOTDIR"
5160
+ "ENOTDIR",
5161
+ "EINVAL",
5162
+ "ELOOP",
5163
+ "ENAMETOOLONG"
5161
5164
  ]);
5162
5165
  const isIgnorableReaddirError = (error) => {
5163
5166
  if (typeof error !== "object" || error === null) return false;
@@ -11931,7 +11934,7 @@ const makeNoopConsole = () => ({
11931
11934
  });
11932
11935
  //#endregion
11933
11936
  //#region src/cli/utils/version.ts
11934
- const VERSION = "0.2.18-dev.0a36216";
11937
+ const VERSION = "0.2.18-dev.19b39c0";
11935
11938
  //#endregion
11936
11939
  //#region src/cli/utils/json-mode.ts
11937
11940
  let context = null;
@@ -12277,13 +12280,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
12277
12280
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
12278
12281
  * standard `SENTRY_RELEASE` override.
12279
12282
  */
12280
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.18-dev.0a36216`;
12283
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.18-dev.19b39c0`;
12281
12284
  /**
12282
12285
  * Deployment environment shown in Sentry's environment filter. Defaults to
12283
12286
  * `production` for tagged releases and `development` for dev/unbuilt versions,
12284
12287
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
12285
12288
  */
12286
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.18-dev.0a36216") ? "development" : "production");
12289
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.18-dev.19b39c0") ? "development" : "production");
12287
12290
  /**
12288
12291
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
12289
12292
  * (set to `0` to disable tracing) and falls back to
@@ -18611,7 +18614,13 @@ const isSafeRelativePath = (filePath) => {
18611
18614
  return normalized === filePath;
18612
18615
  };
18613
18616
  const readChangedFilesFrom = (filePath) => {
18614
- const raw = fs.readFileSync(filePath, "utf8");
18617
+ let raw;
18618
+ try {
18619
+ raw = fs.readFileSync(filePath, "utf8");
18620
+ } catch (error) {
18621
+ const errorCode = error?.code;
18622
+ throw new CliInputError(`Could not read the --changed-files-from file "${filePath}"${errorCode ? ` (${errorCode})` : ""}. Pass a path to a readable text file that lists changed files, one per line.`);
18623
+ }
18615
18624
  const uniqueFiles = /* @__PURE__ */ new Set();
18616
18625
  for (const line of raw.split(/\r?\n/)) {
18617
18626
  const candidate = toForwardSlashes(line.trim());
@@ -19936,6 +19945,30 @@ const exitGracefully = () => {
19936
19945
  process.exit(130);
19937
19946
  };
19938
19947
  //#endregion
19948
+ //#region src/cli/utils/guard-stdin.ts
19949
+ const TERMINAL_HANGUP_CODES = new Set(["EIO", "ENXIO"]);
19950
+ /**
19951
+ * Handles a `process.stdin` `'error'` event. A terminal hangup mid-read
19952
+ * (`read EIO`) is environmental, not a bug, so exit like an interrupted run
19953
+ * instead of crashing. Re-throws anything else so genuine stdin failures keep
19954
+ * funneling to the crash reporter exactly as they did before this guard.
19955
+ */
19956
+ const handleStdinError = (error) => {
19957
+ if (error.code !== void 0 && TERMINAL_HANGUP_CODES.has(error.code)) process.exit(129);
19958
+ throw error;
19959
+ };
19960
+ /**
19961
+ * Arms a `process.stdin` error guard at startup. The only thing that reads
19962
+ * stdin is the interactive `prompts` UI, which opens the TTY in raw mode and
19963
+ * never attaches an `'error'` listener of its own. Without a listener Node
19964
+ * turns a `read EIO` from a vanished terminal into a fatal uncaught exception
19965
+ * (reported to Sentry as a crash); with one, {@link handleStdinError} exits
19966
+ * cleanly on a hangup. Mirrors the stdout EPIPE guard in `cli/index.ts`.
19967
+ */
19968
+ const guardStdin = () => {
19969
+ process.stdin.on("error", handleStdinError);
19970
+ };
19971
+ //#endregion
19939
19972
  //#region src/cli/utils/normalize-help-command.ts
19940
19973
  /**
19941
19974
  * 12-factor CLI Apps (#1, "Great help is essential"): `mycli help` and
@@ -20130,6 +20163,7 @@ initializeSentry();
20130
20163
  process.on("SIGINT", exitGracefully);
20131
20164
  process.on("SIGTERM", exitGracefully);
20132
20165
  unrefStdin();
20166
+ guardStdin();
20133
20167
  const formatExampleLines = (examples) => {
20134
20168
  const width = Math.max(...examples.map(([command]) => command.length));
20135
20169
  return examples.map(([command, description]) => ` $ ${command.padEnd(width)} ${highlighter.dim(`# ${description}`)}`).join("\n");
@@ -20210,4 +20244,4 @@ program.parseAsync(argv).then(() => flushSentry()).catch(async (error) => {
20210
20244
  export {};
20211
20245
 
20212
20246
  //# sourceMappingURL=cli.js.map
20213
- //# debugId=07713237-df07-5858-b7a4-7b12c0e7b293
20247
+ //# debugId=989a10c5-8f69-5f04-a13a-8353aeb4c29a
package/dist/index.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]="9b91fa51-6642-5351-a848-af91945dec6f")}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]="40acbd32-84e3-59a8-874d-7a23e9b8383e")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as Schema from "effect/Schema";
5
5
  import * as fs$1 from "node:fs";
@@ -2130,7 +2130,10 @@ const IGNORABLE_READDIR_ERROR_CODES = new Set([
2130
2130
  "EACCES",
2131
2131
  "EPERM",
2132
2132
  "ENOENT",
2133
- "ENOTDIR"
2133
+ "ENOTDIR",
2134
+ "EINVAL",
2135
+ "ELOOP",
2136
+ "ENAMETOOLONG"
2134
2137
  ]);
2135
2138
  const isIgnorableReaddirError = (error) => {
2136
2139
  if (typeof error !== "object" || error === null) return false;
@@ -8724,4 +8727,4 @@ const toJsonReport = (result, options) => buildJsonReport({
8724
8727
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
8725
8728
 
8726
8729
  //# sourceMappingURL=index.js.map
8727
- //# debugId=9b91fa51-6642-5351-a848-af91945dec6f
8730
+ //# debugId=40acbd32-84e3-59a8-874d-7a23e9b8383e
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.19b39c0",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -55,7 +55,7 @@
55
55
  "agent-install": "0.0.5",
56
56
  "conf": "^15.1.0",
57
57
  "confbox": "^0.2.4",
58
- "deslop-js": "^0.0.14",
58
+ "deslop-js": "^0.0.15",
59
59
  "effect": "4.0.0-beta.70",
60
60
  "eslint-plugin-react-hooks": "^7.1.1",
61
61
  "jiti": "^2.7.0",
@@ -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.19b39c0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/babel__code-frame": "^7.27.0",