react-doctor 0.5.8-dev.9f28454 → 0.5.8-dev.c2ce298
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/LICENSE +1 -8
- package/dist/cli.js +47 -95
- package/dist/index.js +6 -63
- package/dist/lsp.js +6 -3
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
MIT License
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 Million Software, Inc.
|
|
4
4
|
|
|
@@ -12,13 +12,6 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
The Software, its source code, and any derivative works thereof may not be
|
|
16
|
-
used, in whole or in part, as training data, fine-tuning data, evaluation
|
|
17
|
-
data, or as input to any automated pipeline for the purpose of training or
|
|
18
|
-
improving any machine learning model or AI system, without prior written
|
|
19
|
-
permission from the copyright holder. To request permission, contact
|
|
20
|
-
founders@million.dev.
|
|
21
|
-
|
|
22
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
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]="
|
|
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]="b0741e5a-8791-58ae-be3e-0ea33c204326")}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
|
|
@@ -37679,7 +37679,10 @@ for (const [legacyRuleKey, nativeRuleKey] of Object.entries(LEGACY_RULE_KEY_TO_N
|
|
|
37679
37679
|
NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.set(nativeRuleKey, aliases);
|
|
37680
37680
|
}
|
|
37681
37681
|
const getLegacyRuleKeysForNative = (ruleKey) => NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.get(ruleKey) ?? [];
|
|
37682
|
-
const canonicalizeRuleKey = (ruleKey) =>
|
|
37682
|
+
const canonicalizeRuleKey = (ruleKey) => {
|
|
37683
|
+
const nativeRuleKey = LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY[ruleKey];
|
|
37684
|
+
return typeof nativeRuleKey === "string" ? nativeRuleKey : ruleKey;
|
|
37685
|
+
};
|
|
37683
37686
|
const isReactDoctorShortIdOf = (bareRuleKey, qualifiedRuleKey) => !bareRuleKey.includes("/") && qualifiedRuleKey === `react-doctor/${bareRuleKey}`;
|
|
37684
37687
|
const isSameRuleKey = (candidateRuleKey, targetRuleKey) => {
|
|
37685
37688
|
const canonicalCandidate = canonicalizeRuleKey(candidateRuleKey);
|
|
@@ -44702,25 +44705,7 @@ const CI_PROVIDER_BY_ENVIRONMENT_VARIABLE = [
|
|
|
44702
44705
|
["TEAMCITY_VERSION", "teamcity"],
|
|
44703
44706
|
["BITBUCKET_BUILD_NUMBER", "bitbucket"],
|
|
44704
44707
|
["TRAVIS", "travis"],
|
|
44705
|
-
["DRONE", "drone"]
|
|
44706
|
-
["SEMAPHORE", "semaphore"],
|
|
44707
|
-
["APPVEYOR", "appveyor"],
|
|
44708
|
-
["HARNESS_BUILD_ID", "harness"],
|
|
44709
|
-
["BUDDY", "buddy"],
|
|
44710
|
-
["CF_BUILD_ID", "codefresh"],
|
|
44711
|
-
["NETLIFY", "netlify"],
|
|
44712
|
-
["RAILWAY_SERVICE_ID", "railway"],
|
|
44713
|
-
["VERCEL", "vercel"],
|
|
44714
|
-
["CM_BUILD_ID", "codemagic"],
|
|
44715
|
-
["PROW_JOB_ID", "prow"],
|
|
44716
|
-
["AGOLA_GIT_REF", "agola"],
|
|
44717
|
-
["CIRRUS_CI", "cirrus-ci"],
|
|
44718
|
-
["BLACKSMITH_STICKYDISK_TOKEN", "blacksmith"],
|
|
44719
|
-
["WARPBUILD_RUNNER_VERIFICATION_TOKEN", "warpbuild"],
|
|
44720
|
-
["NSC_CACHE_PATH", "namespace"],
|
|
44721
|
-
["UBICLOUD_CACHE_URL", "ubicloud"],
|
|
44722
|
-
["RENDER", "render"],
|
|
44723
|
-
["FLY_APP_NAME", "fly-io"]
|
|
44708
|
+
["DRONE", "drone"]
|
|
44724
44709
|
];
|
|
44725
44710
|
const GITHUB_ACTION_MARKER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_GITHUB_ACTION";
|
|
44726
44711
|
const ACTION_INPUT_ENVIRONMENT_VARIABLES = {
|
|
@@ -44738,10 +44723,7 @@ const CODING_AGENT_BY_ENVIRONMENT_VARIABLE = [
|
|
|
44738
44723
|
["CODEX_SANDBOX_NETWORK_DISABLED", "codex"],
|
|
44739
44724
|
["OPENCODE", "opencode"],
|
|
44740
44725
|
["GOOSE_TERMINAL", "goose"],
|
|
44741
|
-
["AMP_THREAD_ID", "amp"]
|
|
44742
|
-
["CLINE_ACTIVE", "cline"],
|
|
44743
|
-
["AUGMENT_AGENT", "augment"],
|
|
44744
|
-
["TRAE_AI_SHELL_ID", "trae-ai"]
|
|
44726
|
+
["AMP_THREAD_ID", "amp"]
|
|
44745
44727
|
];
|
|
44746
44728
|
const GENERIC_CODING_AGENT_ENVIRONMENT_VARIABLES = ["AGENT_SESSION_ID", "AGENT_THREAD_ID"];
|
|
44747
44729
|
const CODING_AGENT_ENVIRONMENT_VALUE_VARIABLES = ["AGENT"];
|
|
@@ -44932,7 +44914,7 @@ const makeNoopConsole = () => ({
|
|
|
44932
44914
|
});
|
|
44933
44915
|
//#endregion
|
|
44934
44916
|
//#region src/cli/utils/version.ts
|
|
44935
|
-
const VERSION = "0.5.8-dev.
|
|
44917
|
+
const VERSION = "0.5.8-dev.c2ce298";
|
|
44936
44918
|
//#endregion
|
|
44937
44919
|
//#region src/cli/utils/json-mode.ts
|
|
44938
44920
|
let context = null;
|
|
@@ -45296,13 +45278,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
45296
45278
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
45297
45279
|
* standard `SENTRY_RELEASE` override.
|
|
45298
45280
|
*/
|
|
45299
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.
|
|
45281
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.c2ce298`;
|
|
45300
45282
|
/**
|
|
45301
45283
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
45302
45284
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
45303
45285
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
45304
45286
|
*/
|
|
45305
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.
|
|
45287
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.c2ce298") ? "development" : "production");
|
|
45306
45288
|
/**
|
|
45307
45289
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
45308
45290
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -49711,6 +49693,7 @@ const CI_PITCH_EVENT = "ci-pitch";
|
|
|
49711
49693
|
const ACTION_UPGRADE_EVENT = "action-upgrade-v2";
|
|
49712
49694
|
const SETUP_HINT_EVENT = "setup-hint";
|
|
49713
49695
|
const HANDOFF_TARGET_PREFERENCE_ID = "handoff-target";
|
|
49696
|
+
const INSTALL_AGENTS_PREFERENCE_ID = "install-agents";
|
|
49714
49697
|
const foldLegacyDecisions = (projects, legacy, eventId) => {
|
|
49715
49698
|
for (const [hash, record] of Object.entries(legacy ?? {})) {
|
|
49716
49699
|
const existing = projects[hash] ?? { rootDirectory: record.rootDirectory ?? "" };
|
|
@@ -51317,6 +51300,20 @@ const detectAvailableAgents = async () => {
|
|
|
51317
51300
|
const detected = new Set([...detectPathAvailableAgents(), ...await detectInstalledSkillAgents()]);
|
|
51318
51301
|
return getSkillAgentTypes().filter((agent) => agent !== "universal" && detected.has(agent));
|
|
51319
51302
|
};
|
|
51303
|
+
const DEFAULT_INSTALL_AGENTS = [
|
|
51304
|
+
"claude-code",
|
|
51305
|
+
"cursor",
|
|
51306
|
+
"codex",
|
|
51307
|
+
"opencode"
|
|
51308
|
+
];
|
|
51309
|
+
const computeDefaultSelectedAgents = (detectedAgents, rememberedAgents) => {
|
|
51310
|
+
const detected = new Set(detectedAgents);
|
|
51311
|
+
const remembered = rememberedAgents.filter((agent) => detected.has(agent));
|
|
51312
|
+
if (remembered.length > 0) return remembered;
|
|
51313
|
+
const defaults = DEFAULT_INSTALL_AGENTS.filter((agent) => detected.has(agent));
|
|
51314
|
+
if (defaults.length > 0) return defaults;
|
|
51315
|
+
return detectedAgents.length === 1 ? [...detectedAgents] : [];
|
|
51316
|
+
};
|
|
51320
51317
|
//#endregion
|
|
51321
51318
|
//#region src/cli/utils/install-doctor-script.ts
|
|
51322
51319
|
const DOCTOR_SCRIPT_NAME = "doctor";
|
|
@@ -51969,6 +51966,19 @@ const setUpGitHubActions = async (options) => {
|
|
|
51969
51966
|
return didCreateWorkflow;
|
|
51970
51967
|
};
|
|
51971
51968
|
//#endregion
|
|
51969
|
+
//#region src/cli/utils/install-agents-preference.ts
|
|
51970
|
+
const INSTALL_AGENTS_PREFERENCE = {
|
|
51971
|
+
id: INSTALL_AGENTS_PREFERENCE_ID,
|
|
51972
|
+
scope: "global"
|
|
51973
|
+
};
|
|
51974
|
+
const PREFERENCE_SEPARATOR = ",";
|
|
51975
|
+
const readInstallAgents = (options = {}) => {
|
|
51976
|
+
const stored = readPreference(INSTALL_AGENTS_PREFERENCE, {}, options);
|
|
51977
|
+
if (stored === null) return [];
|
|
51978
|
+
return stored.split(PREFERENCE_SEPARATOR).map((entry) => entry.trim()).filter((entry) => isSkillAgentType(entry));
|
|
51979
|
+
};
|
|
51980
|
+
const rememberInstallAgents = (agents, options = {}) => writePreference(INSTALL_AGENTS_PREFERENCE, agents.join(PREFERENCE_SEPARATOR), {}, options);
|
|
51981
|
+
//#endregion
|
|
51972
51982
|
//#region src/cli/utils/install-agent-hooks.ts
|
|
51973
51983
|
const CLAUDE_AGENT = "claude-code";
|
|
51974
51984
|
const CURSOR_AGENT = "cursor";
|
|
@@ -52847,6 +52857,9 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52847
52857
|
const shouldUpgradeWorkflow = canUpgradeWorkflow && (Boolean(options.yes) || upgradePromptOutcome === "yes");
|
|
52848
52858
|
if (upgradePromptOutcome === "no" && !options.dryRun) recordActionUpgradeDecision(projectRoot, "declined");
|
|
52849
52859
|
if ((ciPromptOutcome === "yes" || ciPromptOutcome === "no") && !options.dryRun) recordCiPromptDecision(projectRoot, ciPromptOutcome === "yes" ? "accepted" : "declined");
|
|
52860
|
+
const rememberedAgents = options.lastSelectedAgents ?? readInstallAgents();
|
|
52861
|
+
const defaultSelectedAgents = computeDefaultSelectedAgents(detectedAgents, rememberedAgents);
|
|
52862
|
+
const usedRememberedAgents = rememberedAgents.some((agent) => detectedAgents.includes(agent));
|
|
52850
52863
|
const selectedAgents = skipPrompts ? detectedAgents : (await prompt({
|
|
52851
52864
|
type: "multiselect",
|
|
52852
52865
|
name: "agents",
|
|
@@ -52854,12 +52867,13 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52854
52867
|
choices: detectedAgents.map((agent) => ({
|
|
52855
52868
|
title: getSkillAgentConfig(agent).displayName,
|
|
52856
52869
|
value: agent,
|
|
52857
|
-
selected:
|
|
52870
|
+
selected: defaultSelectedAgents.includes(agent)
|
|
52858
52871
|
})),
|
|
52859
52872
|
instructions: false,
|
|
52860
52873
|
min: 1
|
|
52861
52874
|
}, promptOptions)).agents ?? [];
|
|
52862
52875
|
if (selectedAgents.length === 0) return;
|
|
52876
|
+
if (!skipPrompts && !options.dryRun) rememberInstallAgents(selectedAgents);
|
|
52863
52877
|
let dependencyResult;
|
|
52864
52878
|
if (!options.dryRun) {
|
|
52865
52879
|
await installReactDoctorSkillStep(sourceDir, selectedAgents, projectRoot);
|
|
@@ -52918,6 +52932,8 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52918
52932
|
}
|
|
52919
52933
|
recordCount(METRIC.installCompleted, 1, {
|
|
52920
52934
|
agentsCount: selectedAgents.length,
|
|
52935
|
+
agentsDetected: detectedAgents.length,
|
|
52936
|
+
usedRememberedAgents,
|
|
52921
52937
|
gitHook: shouldInstallGitHook,
|
|
52922
52938
|
agentHooks: shouldInstallAgentHooks,
|
|
52923
52939
|
workflow: didInstallWorkflow,
|
|
@@ -54001,69 +54017,6 @@ const warnDeprecatedFailOn = (flags, userConfig) => {
|
|
|
54001
54017
|
cliLogger.warn(`${source} is deprecated; rename it to ${replacement}.`);
|
|
54002
54018
|
};
|
|
54003
54019
|
//#endregion
|
|
54004
|
-
//#region src/cli/utils/detect-ai-training-environment.ts
|
|
54005
|
-
const AI_TRAINING_ENV_VARS = [
|
|
54006
|
-
["HF_DATASETS_CACHE", "huggingface"],
|
|
54007
|
-
["HF_HOME", "huggingface"],
|
|
54008
|
-
["HUGGINGFACE_HUB_CACHE", "huggingface"],
|
|
54009
|
-
["CUDA_VISIBLE_DEVICES", "cuda"],
|
|
54010
|
-
["NVIDIA_VISIBLE_DEVICES", "nvidia"],
|
|
54011
|
-
["WANDB_RUN_ID", "wandb"],
|
|
54012
|
-
["MLFLOW_RUN_ID", "mlflow"],
|
|
54013
|
-
["MLFLOW_TRACKING_URI", "mlflow"],
|
|
54014
|
-
["COMET_EXPERIMENT_KEY", "comet"],
|
|
54015
|
-
["NEPTUNE_RUN_ID", "neptune"],
|
|
54016
|
-
["RAY_WORKER_PROCESS", "ray"],
|
|
54017
|
-
["RAY_ADDRESS", "ray"],
|
|
54018
|
-
["MUJOCO_GL", "mujoco"],
|
|
54019
|
-
["MUJOCO_PATH", "mujoco"],
|
|
54020
|
-
["GYM_DISABLE_ENV_CHECKER", "gymnasium"],
|
|
54021
|
-
["SAGEMAKER_BASE_DIR", "sagemaker"],
|
|
54022
|
-
["AZURE_ML_MODEL_DIR", "azure-ml"],
|
|
54023
|
-
["VERTEX_AI_LOG_LEVEL", "vertex-ai"],
|
|
54024
|
-
["DAYTONA_WS_ID", "daytona"],
|
|
54025
|
-
["DAYTONA_WS_NAME", "daytona"],
|
|
54026
|
-
["E2B_SANDBOX_ID", "e2b"],
|
|
54027
|
-
["MODAL_FUNCTION_ID", "modal"],
|
|
54028
|
-
["MODAL_TASK_ID", "modal"],
|
|
54029
|
-
["RUNPOD_POD_ID", "runpod"],
|
|
54030
|
-
["HARBOR_URL", "harbor"],
|
|
54031
|
-
["HARBOR_HOSTNAME", "harbor"],
|
|
54032
|
-
["SWE_BENCH_TASK", "swe-bench"],
|
|
54033
|
-
["SWEBENCH_TASK", "swe-bench"],
|
|
54034
|
-
["SWE_AGENT_MODEL", "swe-agent"],
|
|
54035
|
-
["KAGGLE_KERNEL_RUN_TYPE", "kaggle"],
|
|
54036
|
-
["COLAB_BACKEND_VERSION", "google-colab"],
|
|
54037
|
-
["DATABRICKS_RUNTIME_VERSION", "databricks"],
|
|
54038
|
-
["SM_TRAINING_ENV", "sagemaker"],
|
|
54039
|
-
["TRAINING_JOB_ARN", "sagemaker"],
|
|
54040
|
-
["AZUREML_RUN_ID", "azure-ml"],
|
|
54041
|
-
["CLOUD_ML_PROJECT_ID", "vertex-ai"],
|
|
54042
|
-
["WANDB_SWEEP_ID", "wandb"],
|
|
54043
|
-
["DVC_STAGE", "dvc"],
|
|
54044
|
-
["CLEARML_TASK_ID", "clearml"],
|
|
54045
|
-
["FLYTE_INTERNAL_EXECUTION_ID", "flyte"],
|
|
54046
|
-
["DET_MASTER", "determined-ai"],
|
|
54047
|
-
["LIGHTNING_USER_ID", "lightning-ai"],
|
|
54048
|
-
["ARGO_WORKFLOW_NAME", "argo-workflows"],
|
|
54049
|
-
["KFP_POD_NAME", "kubeflow-pipelines"],
|
|
54050
|
-
["SPACE_ID", "huggingface-spaces"],
|
|
54051
|
-
["REPLICATE_USERNAME", "replicate"],
|
|
54052
|
-
["VAST_CONTAINERLABEL", "vast-ai"],
|
|
54053
|
-
["TPU_NAME", "google-tpu"],
|
|
54054
|
-
["ROCR_VISIBLE_DEVICES", "rocm"]
|
|
54055
|
-
];
|
|
54056
|
-
const detectAiTrainingEnvironment = () => {
|
|
54057
|
-
for (const [envVar, label] of AI_TRAINING_ENV_VARS) if (process.env[envVar] !== void 0) return label;
|
|
54058
|
-
return null;
|
|
54059
|
-
};
|
|
54060
|
-
//#endregion
|
|
54061
|
-
//#region src/cli/utils/warn-ai-training-environment.ts
|
|
54062
|
-
const warnIfAiTrainingEnvironment = () => {
|
|
54063
|
-
if (detectAiTrainingEnvironment() === null) return;
|
|
54064
|
-
cliLogger.warn("react-doctor detected use in an AI or ML pipeline. This use requires written permission under the react-doctor license — contact founders@million.dev to request access.");
|
|
54065
|
-
};
|
|
54066
|
-
//#endregion
|
|
54067
54020
|
//#region src/cli/utils/validate-mode-flags.ts
|
|
54068
54021
|
const usedDiffAlias = (flags) => flags.diff !== void 0 && flags.diff !== false && flags.diff !== "false" && flags.diff !== "";
|
|
54069
54022
|
const usedScope = (flags) => typeof flags.scope === "string" && flags.scope.length > 0;
|
|
@@ -54164,7 +54117,6 @@ const inspectAction = async (directory, flags) => {
|
|
|
54164
54117
|
setJsonReportDirectory(resolvedDirectory);
|
|
54165
54118
|
warnDeprecatedFailOn(flags, userConfig);
|
|
54166
54119
|
warnDeprecatedDiff(flags, userConfig);
|
|
54167
|
-
warnIfAiTrainingEnvironment();
|
|
54168
54120
|
if (scanTarget.didRedirectViaRootDir && !isQuiet) {
|
|
54169
54121
|
cliLogger.dim(`Redirected to ${highlighter.info(toRelativePath(resolvedDirectory, requestedDirectory))} via react-doctor config "rootDir".`);
|
|
54170
54122
|
cliLogger.break();
|
|
@@ -55459,4 +55411,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
55459
55411
|
export {};
|
|
55460
55412
|
|
|
55461
55413
|
//# sourceMappingURL=cli.js.map
|
|
55462
|
-
//# debugId=
|
|
55414
|
+
//# debugId=b0741e5a-8791-58ae-be3e-0ea33c204326
|
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]="
|
|
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]="fa4e432e-2004-53cc-816a-025aebf1c752")}catch(e){}}();
|
|
3
3
|
import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as NFS from "node:fs";
|
|
@@ -34487,7 +34487,10 @@ for (const [legacyRuleKey, nativeRuleKey] of Object.entries(LEGACY_RULE_KEY_TO_N
|
|
|
34487
34487
|
NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.set(nativeRuleKey, aliases);
|
|
34488
34488
|
}
|
|
34489
34489
|
const getLegacyRuleKeysForNative = (ruleKey) => NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.get(ruleKey) ?? [];
|
|
34490
|
-
const canonicalizeRuleKey = (ruleKey) =>
|
|
34490
|
+
const canonicalizeRuleKey = (ruleKey) => {
|
|
34491
|
+
const nativeRuleKey = LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY[ruleKey];
|
|
34492
|
+
return typeof nativeRuleKey === "string" ? nativeRuleKey : ruleKey;
|
|
34493
|
+
};
|
|
34491
34494
|
const isReactDoctorShortIdOf = (bareRuleKey, qualifiedRuleKey) => !bareRuleKey.includes("/") && qualifiedRuleKey === `react-doctor/${bareRuleKey}`;
|
|
34492
34495
|
const isSameRuleKey = (candidateRuleKey, targetRuleKey) => {
|
|
34493
34496
|
const canonicalCandidate = canonicalizeRuleKey(candidateRuleKey);
|
|
@@ -41342,64 +41345,6 @@ const mergeReactDoctorConfigs = (baseConfig, overrideConfig) => {
|
|
|
41342
41345
|
};
|
|
41343
41346
|
//#endregion
|
|
41344
41347
|
//#region ../api/dist/index.js
|
|
41345
|
-
const AI_TRAINING_ENV_VARS = [
|
|
41346
|
-
"HF_DATASETS_CACHE",
|
|
41347
|
-
"HF_HOME",
|
|
41348
|
-
"HUGGINGFACE_HUB_CACHE",
|
|
41349
|
-
"CUDA_VISIBLE_DEVICES",
|
|
41350
|
-
"NVIDIA_VISIBLE_DEVICES",
|
|
41351
|
-
"WANDB_RUN_ID",
|
|
41352
|
-
"WANDB_SWEEP_ID",
|
|
41353
|
-
"MLFLOW_RUN_ID",
|
|
41354
|
-
"MLFLOW_TRACKING_URI",
|
|
41355
|
-
"COMET_EXPERIMENT_KEY",
|
|
41356
|
-
"NEPTUNE_RUN_ID",
|
|
41357
|
-
"CLEARML_TASK_ID",
|
|
41358
|
-
"RAY_WORKER_PROCESS",
|
|
41359
|
-
"RAY_ADDRESS",
|
|
41360
|
-
"MUJOCO_GL",
|
|
41361
|
-
"MUJOCO_PATH",
|
|
41362
|
-
"GYM_DISABLE_ENV_CHECKER",
|
|
41363
|
-
"SM_TRAINING_ENV",
|
|
41364
|
-
"TRAINING_JOB_ARN",
|
|
41365
|
-
"SAGEMAKER_BASE_DIR",
|
|
41366
|
-
"AZUREML_RUN_ID",
|
|
41367
|
-
"AZURE_ML_MODEL_DIR",
|
|
41368
|
-
"CLOUD_ML_PROJECT_ID",
|
|
41369
|
-
"VERTEX_AI_LOG_LEVEL",
|
|
41370
|
-
"KAGGLE_KERNEL_RUN_TYPE",
|
|
41371
|
-
"COLAB_BACKEND_VERSION",
|
|
41372
|
-
"DATABRICKS_RUNTIME_VERSION",
|
|
41373
|
-
"FLYTE_INTERNAL_EXECUTION_ID",
|
|
41374
|
-
"DET_MASTER",
|
|
41375
|
-
"LIGHTNING_USER_ID",
|
|
41376
|
-
"ARGO_WORKFLOW_NAME",
|
|
41377
|
-
"KFP_POD_NAME",
|
|
41378
|
-
"DVC_STAGE",
|
|
41379
|
-
"DAYTONA_WS_ID",
|
|
41380
|
-
"DAYTONA_WS_NAME",
|
|
41381
|
-
"E2B_SANDBOX_ID",
|
|
41382
|
-
"MODAL_FUNCTION_ID",
|
|
41383
|
-
"MODAL_TASK_ID",
|
|
41384
|
-
"RUNPOD_POD_ID",
|
|
41385
|
-
"SPACE_ID",
|
|
41386
|
-
"REPLICATE_USERNAME",
|
|
41387
|
-
"VAST_CONTAINERLABEL",
|
|
41388
|
-
"TPU_NAME",
|
|
41389
|
-
"ROCR_VISIBLE_DEVICES",
|
|
41390
|
-
"HARBOR_URL",
|
|
41391
|
-
"HARBOR_HOSTNAME",
|
|
41392
|
-
"SWE_BENCH_TASK",
|
|
41393
|
-
"SWEBENCH_TASK",
|
|
41394
|
-
"SWE_AGENT_MODEL"
|
|
41395
|
-
];
|
|
41396
|
-
let didWarnAiTraining = false;
|
|
41397
|
-
const warnIfAiTrainingEnvironment = () => {
|
|
41398
|
-
if (didWarnAiTraining) return;
|
|
41399
|
-
if (AI_TRAINING_ENV_VARS.find((envVar) => process.env[envVar] !== void 0) === void 0) return;
|
|
41400
|
-
didWarnAiTraining = true;
|
|
41401
|
-
console.warn("[react-doctor] Use in an AI or ML pipeline requires written permission under the react-doctor license. Contact founders@million.dev to request access.");
|
|
41402
|
-
};
|
|
41403
41348
|
const buildDiagnoseLayer = (config, configOverrideTarget) => {
|
|
41404
41349
|
const configLayer = configOverrideTarget === void 0 ? Config.layerNode : Config.layerOf({
|
|
41405
41350
|
config,
|
|
@@ -41437,7 +41382,6 @@ const outputToDiagnoseResult = (output, elapsedMilliseconds) => {
|
|
|
41437
41382
|
};
|
|
41438
41383
|
};
|
|
41439
41384
|
const diagnoseDirectory = async (directory, options) => {
|
|
41440
|
-
warnIfAiTrainingEnvironment();
|
|
41441
41385
|
const startTime = globalThis.performance.now();
|
|
41442
41386
|
const scanTarget = await resolveScanTarget(directory);
|
|
41443
41387
|
return outputToDiagnoseResult(await runPromise(restoreLegacyThrow(buildInspectProgram(scanTarget, options).pipe(provide(buildDiagnoseLayer(scanTarget.userConfig)), provide(layerOtlp)))), globalThis.performance.now() - startTime);
|
|
@@ -41484,7 +41428,6 @@ const diagnoseProject = async (projectDefinition, baseOptions, batchConfig) => {
|
|
|
41484
41428
|
}
|
|
41485
41429
|
};
|
|
41486
41430
|
const diagnoseProjectBatch = async (input) => {
|
|
41487
|
-
warnIfAiTrainingEnvironment();
|
|
41488
41431
|
const startTime = globalThis.performance.now();
|
|
41489
41432
|
const { projects, concurrency, config: batchConfig, ...baseOptions } = input;
|
|
41490
41433
|
const projectResults = await mapWithConcurrency(projects, concurrency ?? 4, (projectDefinition) => diagnoseProject(projectDefinition, baseOptions, batchConfig));
|
|
@@ -41529,4 +41472,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
41529
41472
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
41530
41473
|
|
|
41531
41474
|
//# sourceMappingURL=index.js.map
|
|
41532
|
-
//# debugId=
|
|
41475
|
+
//# debugId=fa4e432e-2004-53cc-816a-025aebf1c752
|
package/dist/lsp.js
CHANGED
|
@@ -34546,7 +34546,10 @@ for (const [legacyRuleKey, nativeRuleKey] of Object.entries(LEGACY_RULE_KEY_TO_N
|
|
|
34546
34546
|
NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.set(nativeRuleKey, aliases);
|
|
34547
34547
|
}
|
|
34548
34548
|
const getLegacyRuleKeysForNative = (ruleKey) => NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.get(ruleKey) ?? [];
|
|
34549
|
-
const canonicalizeRuleKey = (ruleKey) =>
|
|
34549
|
+
const canonicalizeRuleKey = (ruleKey) => {
|
|
34550
|
+
const nativeRuleKey = LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY[ruleKey];
|
|
34551
|
+
return typeof nativeRuleKey === "string" ? nativeRuleKey : ruleKey;
|
|
34552
|
+
};
|
|
34550
34553
|
const isReactDoctorShortIdOf = (bareRuleKey, qualifiedRuleKey) => !bareRuleKey.includes("/") && qualifiedRuleKey === `react-doctor/${bareRuleKey}`;
|
|
34551
34554
|
const isSameRuleKey = (candidateRuleKey, targetRuleKey) => {
|
|
34552
34555
|
const canonicalCandidate = canonicalizeRuleKey(candidateRuleKey);
|
|
@@ -43249,5 +43252,5 @@ const startLanguageServer = () => {
|
|
|
43249
43252
|
};
|
|
43250
43253
|
//#endregion
|
|
43251
43254
|
export { startLanguageServer };
|
|
43252
|
-
!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]="
|
|
43253
|
-
//# debugId=
|
|
43255
|
+
!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]="28a9132e-0eb3-5487-9d97-46eb9456a794")}catch(e){}}();
|
|
43256
|
+
//# debugId=28a9132e-0eb3-5487-9d97-46eb9456a794
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.5.8-dev.
|
|
3
|
+
"version": "0.5.8-dev.c2ce298",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/millionco/react-doctor/issues"
|
|
22
22
|
},
|
|
23
|
-
"license": "
|
|
23
|
+
"license": "MIT",
|
|
24
24
|
"author": "Million Software, Inc",
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -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
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"deslop-js": "0.5.8",
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.8-dev.c2ce298"
|
|
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/api": "0.5.8",
|
|
76
|
-
"@react-doctor/
|
|
77
|
-
"@react-doctor/
|
|
76
|
+
"@react-doctor/language-server": "0.5.8",
|
|
77
|
+
"@react-doctor/core": "0.5.8"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": "^20.19.0 || >=22.13.0"
|