react-doctor 0.5.8-dev.7f9e7f4 → 0.5.8-dev.986557d

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 +41 -7
  2. 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]="0b6893a8-f482-50d5-ad21-45ebd17e98a0")}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]="f65daf5b-9cf1-5118-9736-6ffc410231a0")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as NodeChildProcess from "node:child_process";
5
5
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
@@ -26,7 +26,7 @@ import tty from "node:tty";
26
26
  import { codeFrameColumns } from "@babel/code-frame";
27
27
  import Conf from "conf";
28
28
  import basePrompts from "prompts";
29
- import { SKILL_MANIFEST_FILE, detectInstalledSkillAgents, getSkillAgentConfig, getSkillAgentTypes, installSkillsFromSource } from "agent-install";
29
+ import { SKILL_MANIFEST_FILE, detectInstalledSkillAgents, getSkillAgentConfig, getSkillAgentTypes, installSkillsFromSource, isSkillAgentType } from "agent-install";
30
30
  import { generateCode, loadFile, writeFile } from "magicast";
31
31
  import { getConfigFromVariableDeclaration, getDefaultExportOptions } from "magicast/helpers";
32
32
  //#region \0rolldown/runtime.js
@@ -44911,7 +44911,7 @@ const makeNoopConsole = () => ({
44911
44911
  });
44912
44912
  //#endregion
44913
44913
  //#region src/cli/utils/version.ts
44914
- const VERSION = "0.5.8-dev.7f9e7f4";
44914
+ const VERSION = "0.5.8-dev.986557d";
44915
44915
  //#endregion
44916
44916
  //#region src/cli/utils/json-mode.ts
44917
44917
  let context = null;
@@ -45275,13 +45275,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
45275
45275
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
45276
45276
  * standard `SENTRY_RELEASE` override.
45277
45277
  */
45278
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.7f9e7f4`;
45278
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.986557d`;
45279
45279
  /**
45280
45280
  * Deployment environment shown in Sentry's environment filter. Defaults to
45281
45281
  * `production` for tagged releases and `development` for dev/unbuilt versions,
45282
45282
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
45283
45283
  */
45284
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.7f9e7f4") ? "development" : "production");
45284
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.986557d") ? "development" : "production");
45285
45285
  /**
45286
45286
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
45287
45287
  * (set to `0` to disable tracing) and falls back to
@@ -49690,6 +49690,7 @@ const CI_PITCH_EVENT = "ci-pitch";
49690
49690
  const ACTION_UPGRADE_EVENT = "action-upgrade-v2";
49691
49691
  const SETUP_HINT_EVENT = "setup-hint";
49692
49692
  const HANDOFF_TARGET_PREFERENCE_ID = "handoff-target";
49693
+ const INSTALL_AGENTS_PREFERENCE_ID = "install-agents";
49693
49694
  const foldLegacyDecisions = (projects, legacy, eventId) => {
49694
49695
  for (const [hash, record] of Object.entries(legacy ?? {})) {
49695
49696
  const existing = projects[hash] ?? { rootDirectory: record.rootDirectory ?? "" };
@@ -51296,6 +51297,20 @@ const detectAvailableAgents = async () => {
51296
51297
  const detected = new Set([...detectPathAvailableAgents(), ...await detectInstalledSkillAgents()]);
51297
51298
  return getSkillAgentTypes().filter((agent) => agent !== "universal" && detected.has(agent));
51298
51299
  };
51300
+ const DEFAULT_INSTALL_AGENTS = [
51301
+ "claude-code",
51302
+ "cursor",
51303
+ "codex",
51304
+ "opencode"
51305
+ ];
51306
+ const computeDefaultSelectedAgents = (detectedAgents, rememberedAgents) => {
51307
+ const detected = new Set(detectedAgents);
51308
+ const remembered = rememberedAgents.filter((agent) => detected.has(agent));
51309
+ if (remembered.length > 0) return remembered;
51310
+ const defaults = DEFAULT_INSTALL_AGENTS.filter((agent) => detected.has(agent));
51311
+ if (defaults.length > 0) return defaults;
51312
+ return detectedAgents.length === 1 ? [...detectedAgents] : [];
51313
+ };
51299
51314
  //#endregion
51300
51315
  //#region src/cli/utils/install-doctor-script.ts
51301
51316
  const DOCTOR_SCRIPT_NAME = "doctor";
@@ -51948,6 +51963,19 @@ const setUpGitHubActions = async (options) => {
51948
51963
  return didCreateWorkflow;
51949
51964
  };
51950
51965
  //#endregion
51966
+ //#region src/cli/utils/install-agents-preference.ts
51967
+ const INSTALL_AGENTS_PREFERENCE = {
51968
+ id: INSTALL_AGENTS_PREFERENCE_ID,
51969
+ scope: "global"
51970
+ };
51971
+ const PREFERENCE_SEPARATOR = ",";
51972
+ const readInstallAgents = (options = {}) => {
51973
+ const stored = readPreference(INSTALL_AGENTS_PREFERENCE, {}, options);
51974
+ if (stored === null) return [];
51975
+ return stored.split(PREFERENCE_SEPARATOR).map((entry) => entry.trim()).filter((entry) => isSkillAgentType(entry));
51976
+ };
51977
+ const rememberInstallAgents = (agents, options = {}) => writePreference(INSTALL_AGENTS_PREFERENCE, agents.join(PREFERENCE_SEPARATOR), {}, options);
51978
+ //#endregion
51951
51979
  //#region src/cli/utils/install-agent-hooks.ts
51952
51980
  const CLAUDE_AGENT = "claude-code";
51953
51981
  const CURSOR_AGENT = "cursor";
@@ -52826,6 +52854,9 @@ const runInstallReactDoctor = async (options = {}) => {
52826
52854
  const shouldUpgradeWorkflow = canUpgradeWorkflow && (Boolean(options.yes) || upgradePromptOutcome === "yes");
52827
52855
  if (upgradePromptOutcome === "no" && !options.dryRun) recordActionUpgradeDecision(projectRoot, "declined");
52828
52856
  if ((ciPromptOutcome === "yes" || ciPromptOutcome === "no") && !options.dryRun) recordCiPromptDecision(projectRoot, ciPromptOutcome === "yes" ? "accepted" : "declined");
52857
+ const rememberedAgents = options.lastSelectedAgents ?? readInstallAgents();
52858
+ const defaultSelectedAgents = computeDefaultSelectedAgents(detectedAgents, rememberedAgents);
52859
+ const usedRememberedAgents = rememberedAgents.some((agent) => detectedAgents.includes(agent));
52829
52860
  const selectedAgents = skipPrompts ? detectedAgents : (await prompt({
52830
52861
  type: "multiselect",
52831
52862
  name: "agents",
@@ -52833,12 +52864,13 @@ const runInstallReactDoctor = async (options = {}) => {
52833
52864
  choices: detectedAgents.map((agent) => ({
52834
52865
  title: getSkillAgentConfig(agent).displayName,
52835
52866
  value: agent,
52836
- selected: true
52867
+ selected: defaultSelectedAgents.includes(agent)
52837
52868
  })),
52838
52869
  instructions: false,
52839
52870
  min: 1
52840
52871
  }, promptOptions)).agents ?? [];
52841
52872
  if (selectedAgents.length === 0) return;
52873
+ if (!skipPrompts && !options.dryRun) rememberInstallAgents(selectedAgents);
52842
52874
  let dependencyResult;
52843
52875
  if (!options.dryRun) {
52844
52876
  await installReactDoctorSkillStep(sourceDir, selectedAgents, projectRoot);
@@ -52897,6 +52929,8 @@ const runInstallReactDoctor = async (options = {}) => {
52897
52929
  }
52898
52930
  recordCount(METRIC.installCompleted, 1, {
52899
52931
  agentsCount: selectedAgents.length,
52932
+ agentsDetected: detectedAgents.length,
52933
+ usedRememberedAgents,
52900
52934
  gitHook: shouldInstallGitHook,
52901
52935
  agentHooks: shouldInstallAgentHooks,
52902
52936
  workflow: didInstallWorkflow,
@@ -55374,4 +55408,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
55374
55408
  export {};
55375
55409
 
55376
55410
  //# sourceMappingURL=cli.js.map
55377
- //# debugId=0b6893a8-f482-50d5-ad21-45ebd17e98a0
55411
+ //# debugId=f65daf5b-9cf1-5118-9736-6ffc410231a0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.5.8-dev.7f9e7f4",
3
+ "version": "0.5.8-dev.986557d",
4
4
  "description": "Your agent writes bad React. This catches it",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -63,8 +63,8 @@
63
63
  "vscode-languageserver": "^9.0.1",
64
64
  "vscode-languageserver-textdocument": "^1.0.12",
65
65
  "vscode-uri": "^3.1.0",
66
- "deslop-js": "0.5.8",
67
- "oxlint-plugin-react-doctor": "0.5.8-dev.7f9e7f4"
66
+ "oxlint-plugin-react-doctor": "0.5.8-dev.986557d",
67
+ "deslop-js": "0.5.8"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/babel__code-frame": "^7.27.0",
@@ -73,8 +73,8 @@
73
73
  "commander": "^14.0.3",
74
74
  "ora": "^9.4.0",
75
75
  "@react-doctor/core": "0.5.8",
76
- "@react-doctor/api": "0.5.8",
77
- "@react-doctor/language-server": "0.5.8"
76
+ "@react-doctor/language-server": "0.5.8",
77
+ "@react-doctor/api": "0.5.8"
78
78
  },
79
79
  "engines": {
80
80
  "node": "^20.19.0 || >=22.13.0"