react-doctor 0.3.0-dev.9a8ad6e → 0.4.0-dev.5448962

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/dist/cli.js +45 -11
  2. package/dist/lsp.js +3 -3
  3. package/package.json +5 -5
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]="3c457dc9-865a-5459-b923-a0fb762b158f")}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]="f6c4adc9-3353-560f-a49f-c50a13c0b8a2")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
5
5
  import * as path$1 from "node:path";
@@ -12191,7 +12191,7 @@ const makeNoopConsole = () => ({
12191
12191
  });
12192
12192
  //#endregion
12193
12193
  //#region src/cli/utils/version.ts
12194
- const VERSION = "0.3.0-dev.9a8ad6e";
12194
+ const VERSION = "0.4.0-dev.5448962";
12195
12195
  //#endregion
12196
12196
  //#region src/cli/utils/json-mode.ts
12197
12197
  let context = null;
@@ -12549,13 +12549,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
12549
12549
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
12550
12550
  * standard `SENTRY_RELEASE` override.
12551
12551
  */
12552
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.3.0-dev.9a8ad6e`;
12552
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.0-dev.5448962`;
12553
12553
  /**
12554
12554
  * Deployment environment shown in Sentry's environment filter. Defaults to
12555
12555
  * `production` for tagged releases and `development` for dev/unbuilt versions,
12556
12556
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
12557
12557
  */
12558
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.3.0-dev.9a8ad6e") ? "development" : "production");
12558
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.0-dev.5448962") ? "development" : "production");
12559
12559
  /**
12560
12560
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
12561
12561
  * (set to `0` to disable tracing) and falls back to
@@ -17719,9 +17719,9 @@ const buildHandoffPayload = (input) => {
17719
17719
  };
17720
17720
  //#endregion
17721
17721
  //#region src/cli/utils/is-command-available.ts
17722
- const isWindows = process.platform === "win32";
17722
+ const isWindows$1 = process.platform === "win32";
17723
17723
  const candidateFileNames = (command) => {
17724
- if (!isWindows || path$1.extname(command)) return [command];
17724
+ if (!isWindows$1 || path$1.extname(command)) return [command];
17725
17725
  return [command, ...(process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").map((extension) => extension.trim()).filter(Boolean).map((extension) => `${command}${extension}`)];
17726
17726
  };
17727
17727
  const isCommandAvailable = (command) => {
@@ -17730,7 +17730,7 @@ const isCommandAvailable = (command) => {
17730
17730
  const binaryPath = path$1.join(directory, fileName);
17731
17731
  try {
17732
17732
  if (!fs$1.statSync(binaryPath).isFile()) continue;
17733
- if (!isWindows) fs$1.accessSync(binaryPath, fs$1.constants.X_OK);
17733
+ if (!isWindows$1) fs$1.accessSync(binaryPath, fs$1.constants.X_OK);
17734
17734
  return true;
17735
17735
  } catch {}
17736
17736
  }
@@ -19223,6 +19223,7 @@ const stageWorkflowFile = async (params) => {
19223
19223
  };
19224
19224
  //#endregion
19225
19225
  //#region src/cli/utils/launch-agent.ts
19226
+ const isWindows = process.platform === "win32";
19226
19227
  const CLI_AGENT_BINARIES = {
19227
19228
  "claude-code": "claude",
19228
19229
  codex: "codex",
@@ -19233,14 +19234,47 @@ const CLI_AGENT_AUTO_FLAGS = {
19233
19234
  codex: ["--yolo"],
19234
19235
  cursor: ["--force"]
19235
19236
  };
19236
- const launchCliAgent = (agentId, prompt, cwd) => new Promise((resolve, reject) => {
19237
- const child = spawn(CLI_AGENT_BINARIES[agentId], [...CLI_AGENT_AUTO_FLAGS[agentId], prompt], {
19237
+ const resolveWindowsCmdEntryScript = (command) => {
19238
+ if (!isWindows) return null;
19239
+ const pathDirectories = (process.env.PATH ?? "").split(path$1.delimiter).filter(Boolean);
19240
+ for (const directory of pathDirectories) {
19241
+ const cmdFilePath = path$1.join(directory, `${command}.cmd`);
19242
+ try {
19243
+ if (!fs$1.statSync(cmdFilePath).isFile()) continue;
19244
+ } catch {
19245
+ continue;
19246
+ }
19247
+ try {
19248
+ const entryScriptMatch = fs$1.readFileSync(cmdFilePath, "utf8").match(/"%(?:~dp0|dp0%)\\([^"]+\.(?:m?js|cjs))"/);
19249
+ if (!entryScriptMatch) continue;
19250
+ const resolvedScriptPath = path$1.resolve(directory, entryScriptMatch[1]);
19251
+ if (fs$1.statSync(resolvedScriptPath).isFile()) return resolvedScriptPath;
19252
+ } catch {}
19253
+ }
19254
+ return null;
19255
+ };
19256
+ const spawnAgent = (command, args, cwd, shell = false) => new Promise((resolve, reject) => {
19257
+ const child = spawn(command, [...args], {
19238
19258
  cwd,
19239
- stdio: "inherit"
19259
+ stdio: "inherit",
19260
+ shell
19240
19261
  });
19241
19262
  child.on("error", reject);
19242
19263
  child.on("close", (code) => resolve(code ?? 0));
19243
19264
  });
19265
+ const launchCliAgent = async (agentId, prompt, cwd) => {
19266
+ const binary = CLI_AGENT_BINARIES[agentId];
19267
+ const agentArgs = [...CLI_AGENT_AUTO_FLAGS[agentId], prompt];
19268
+ if (isWindows) {
19269
+ const entryScript = resolveWindowsCmdEntryScript(binary);
19270
+ if (entryScript) return spawnAgent(process.execPath, [entryScript, ...agentArgs], cwd);
19271
+ }
19272
+ try {
19273
+ return await spawnAgent(binary, agentArgs, cwd);
19274
+ } catch {
19275
+ throw new Error(`Failed to launch ${binary}`);
19276
+ }
19277
+ };
19244
19278
  const CLIPBOARD_COMMANDS = [
19245
19279
  {
19246
19280
  binary: "pbcopy",
@@ -21277,4 +21311,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
21277
21311
  export {};
21278
21312
 
21279
21313
  //# sourceMappingURL=cli.js.map
21280
- //# debugId=3c457dc9-865a-5459-b923-a0fb762b158f
21314
+ //# debugId=f6c4adc9-3353-560f-a49f-c50a13c0b8a2
package/dist/lsp.js CHANGED
@@ -8712,7 +8712,7 @@ const getRuleMetadata = (plugin, rule) => {
8712
8712
  /** Display name used in client-facing messages and progress titles. */
8713
8713
  const SERVER_DISPLAY_NAME = "React Doctor";
8714
8714
  /** Server version reported in `serverInfo`; injected at build, `dev` from source. */
8715
- const SERVER_VERSION = "0.2.11";
8715
+ const SERVER_VERSION = "0.2.12";
8716
8716
  /** `Diagnostic.source` shown next to every published diagnostic. */
8717
8717
  const DIAGNOSTIC_SOURCE = "react-doctor";
8718
8718
  /**
@@ -10800,5 +10800,5 @@ const startLanguageServer = () => {
10800
10800
  };
10801
10801
  //#endregion
10802
10802
  export { startLanguageServer };
10803
- !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]="e614bb84-5901-5a70-99a0-7f973d27a6b7")}catch(e){}}();
10804
- //# debugId=e614bb84-5901-5a70-99a0-7f973d27a6b7
10803
+ !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]="367f0c6f-8633-512f-b006-f1bb7ab5a35a")}catch(e){}}();
10804
+ //# debugId=367f0c6f-8633-512f-b006-f1bb7ab5a35a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.3.0-dev.9a8ad6e",
3
+ "version": "0.4.0-dev.5448962",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -66,7 +66,7 @@
66
66
  "vscode-languageserver": "^9.0.1",
67
67
  "vscode-languageserver-textdocument": "^1.0.12",
68
68
  "vscode-uri": "^3.1.0",
69
- "oxlint-plugin-react-doctor": "0.3.0-dev.9a8ad6e"
69
+ "oxlint-plugin-react-doctor": "0.4.0-dev.5448962"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/babel__code-frame": "^7.27.0",
@@ -74,9 +74,9 @@
74
74
  "@xterm/headless": "^6.0.0",
75
75
  "commander": "^14.0.3",
76
76
  "ora": "^9.4.0",
77
- "@react-doctor/api": "0.2.19",
78
- "@react-doctor/core": "0.2.19",
79
- "@react-doctor/language-server": "0.2.11"
77
+ "@react-doctor/core": "0.3.0",
78
+ "@react-doctor/api": "0.2.20",
79
+ "@react-doctor/language-server": "0.2.12"
80
80
  },
81
81
  "engines": {
82
82
  "node": "^20.19.0 || >=22.12.0"