react-doctor 0.2.12 → 0.2.13-dev.ac14db3

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +20 -9
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <picture>
2
2
  <source media="(prefers-color-scheme: dark)" srcset="./assets/react-doctor-readme-logo-dark.svg">
3
3
  <source media="(prefers-color-scheme: light)" srcset="./assets/react-doctor-readme-logo-light.svg">
4
- <img alt="React Doctor" src="./assets/react-doctor-readme-logo-light.svg" width="180" height="40">
4
+ <img alt="React Doctor" src="./assets/react-doctor-readme-logo-light.svg" width="239" height="40">
5
5
  </picture>
6
6
 
7
7
  [![version](https://img.shields.io/npm/v/react-doctor?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/react-doctor)
package/dist/cli.js CHANGED
@@ -6578,6 +6578,12 @@ const shouldSelectAllChoices = (choiceStates) => {
6578
6578
  return choiceStates.filter((choiceState) => !choiceState.disabled).some((choiceState) => choiceState.selected !== true);
6579
6579
  };
6580
6580
  //#endregion
6581
+ //#region src/cli/utils/unref-stdin.ts
6582
+ const unrefStdin = () => {
6583
+ if (process.stdin.isTTY) return;
6584
+ process.stdin.unref?.();
6585
+ };
6586
+ //#endregion
6581
6587
  //#region src/cli/utils/prompts.ts
6582
6588
  const require$1 = createRequire(import.meta.url);
6583
6589
  const PROMPTS_MULTISELECT_MODULE_PATH = "prompts/lib/elements/multiselect";
@@ -6620,7 +6626,7 @@ const patchMultiselectSubmit = () => {
6620
6626
  const prompts = (questions, options = {}) => {
6621
6627
  patchMultiselectToggleAll();
6622
6628
  patchMultiselectSubmit();
6623
- return basePrompts(questions, { onCancel: options.onCancel ?? onCancel });
6629
+ return basePrompts(questions, { onCancel: options.onCancel ?? onCancel }).finally(unrefStdin);
6624
6630
  };
6625
6631
  //#endregion
6626
6632
  //#region src/cli/utils/resolve-oxlint-node.ts
@@ -6674,7 +6680,7 @@ const resolveOxlintNodeEffect = (isLintEnabled, isQuiet) => Effect.gen(function*
6674
6680
  const resolveOxlintNode = (isLintEnabled, isQuiet) => Effect.runPromise(resolveOxlintNodeEffect(isLintEnabled, isQuiet).pipe(Effect.provide(NodeResolver.layerNode)));
6675
6681
  //#endregion
6676
6682
  //#region src/cli/utils/version.ts
6677
- const VERSION = "0.2.12";
6683
+ const VERSION = "0.2.13-dev.ac14db3";
6678
6684
  //#endregion
6679
6685
  //#region src/inspect.ts
6680
6686
  const silentConsole = makeNoopConsole();
@@ -7467,7 +7473,7 @@ const defaultWait = (milliseconds) => new Promise((resolve) => {
7467
7473
  setTimeout(resolve, milliseconds);
7468
7474
  });
7469
7475
  const defaultSelect = async (message) => {
7470
- const { setupReactDoctorChoice } = await basePrompts({
7476
+ const { setupReactDoctorChoice } = await prompts({
7471
7477
  type: "select",
7472
7478
  name: "setupReactDoctorChoice",
7473
7479
  message,
@@ -8802,6 +8808,7 @@ const defaultInstallDependencyRunner = (input) => {
8802
8808
  shell: process.platform === "win32"
8803
8809
  });
8804
8810
  };
8811
+ const formatInstallCommand = (input) => [input.command, ...input.args].join(" ");
8805
8812
  const installReactDoctorDependency = async (options) => {
8806
8813
  const packageJson = readPackageJson(options.projectRoot);
8807
8814
  if (!isRecord(packageJson)) return {
@@ -8814,7 +8821,15 @@ const installReactDoctorDependency = async (options) => {
8814
8821
  dependencyReason: "invalid-dev-dependencies"
8815
8822
  };
8816
8823
  const runnerInput = buildInstallCommand(options.projectRoot);
8817
- await (options.runner ?? defaultInstallDependencyRunner)(runnerInput);
8824
+ try {
8825
+ await (options.runner ?? defaultInstallDependencyRunner)(runnerInput);
8826
+ } catch {
8827
+ return {
8828
+ dependencyStatus: "skipped",
8829
+ dependencyReason: "install-command-failed",
8830
+ installCommand: formatInstallCommand(runnerInput)
8831
+ };
8832
+ }
8818
8833
  return { dependencyStatus: "created" };
8819
8834
  };
8820
8835
  const buildManualGitHookTarget = (hookPath, projectRoot) => ({
@@ -8841,6 +8856,7 @@ const formatDependencyInstallMessage = (result) => {
8841
8856
  if (result.dependencyStatus === "created") return "Installed dev dependency: react-doctor.";
8842
8857
  if (result.dependencyStatus === "existing") return "React Doctor dependency already exists.";
8843
8858
  if (result.dependencyReason === "invalid-dev-dependencies") return "Skipped dev dependency install: devDependencies field is not an object.";
8859
+ if (result.dependencyReason === "install-command-failed") return `Skipped dev dependency install: package manager command failed. Run manually: ${result.installCommand ?? `npm install --save-dev react-doctor@latest`}`;
8844
8860
  return "Skipped dev dependency install: package.json missing or invalid.";
8845
8861
  };
8846
8862
  const installReactDoctorPackageSetup = async (projectRoot, dependencyRunner) => {
@@ -9186,11 +9202,6 @@ const stripUnknownCliFlags = (argv) => {
9186
9202
  ];
9187
9203
  };
9188
9204
  //#endregion
9189
- //#region src/cli/utils/unref-stdin.ts
9190
- const unrefStdin = () => {
9191
- process.stdin.unref?.();
9192
- };
9193
- //#endregion
9194
9205
  //#region src/cli/index.ts
9195
9206
  process.on("SIGINT", exitGracefully);
9196
9207
  process.on("SIGTERM", exitGracefully);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.2.12",
3
+ "version": "0.2.13-dev.ac14db3",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -58,14 +58,14 @@
58
58
  "oxlint": "^1.66.0",
59
59
  "prompts": "^2.4.2",
60
60
  "typescript": ">=5.0.4 <7",
61
- "oxlint-plugin-react-doctor": "0.2.12"
61
+ "oxlint-plugin-react-doctor": "0.2.13-dev.ac14db3"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/prompts": "^2.4.9",
65
65
  "commander": "^14.0.3",
66
66
  "ora": "^9.4.0",
67
- "@react-doctor/api": "0.2.12",
68
- "@react-doctor/core": "0.2.12"
67
+ "@react-doctor/api": "0.2.13",
68
+ "@react-doctor/core": "0.2.13"
69
69
  },
70
70
  "engines": {
71
71
  "node": "^20.19.0 || >=22.12.0"