react-doctor 0.5.8-dev.31c0657 → 0.5.8-dev.5f2bd72
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 +83 -21
- package/dist/index.js +14 -4
- package/dist/lsp.js +14 -4
- package/package.json +3 -3
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]="286954ee-f636-51ec-9cb7-a1bde0687a30")}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);
|
|
@@ -38765,6 +38768,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
38765
38768
|
"adoptExistingLintConfig"
|
|
38766
38769
|
];
|
|
38767
38770
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
38771
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
38772
|
+
"projects",
|
|
38773
|
+
"textComponents",
|
|
38774
|
+
"rawTextWrapperComponents",
|
|
38775
|
+
"serverAuthFunctionNames"
|
|
38776
|
+
];
|
|
38768
38777
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
38769
38778
|
"includeTags",
|
|
38770
38779
|
"excludeTags",
|
|
@@ -38866,6 +38875,7 @@ const validateConfigTypes = (config) => {
|
|
|
38866
38875
|
const validated = { ...config };
|
|
38867
38876
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
38868
38877
|
for (const fieldName of STRING_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateString(fieldName, value));
|
|
38878
|
+
for (const fieldName of STRING_ARRAY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateStringArrayField(fieldName, value));
|
|
38869
38879
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
38870
38880
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
38871
38881
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -41163,7 +41173,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
41163
41173
|
"rev-parse",
|
|
41164
41174
|
"--verify",
|
|
41165
41175
|
branch
|
|
41166
|
-
]).pipe(map$3((result) => result.status === 0));
|
|
41176
|
+
]).pipe(map$3((result) => result.status === 0), catch_$1((error) => error.reason._tag === "GitInvocationFailed" ? succeed$2(false) : fail$4(error)));
|
|
41167
41177
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
41168
41178
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
41169
41179
|
"merge-base",
|
|
@@ -44911,7 +44921,7 @@ const makeNoopConsole = () => ({
|
|
|
44911
44921
|
});
|
|
44912
44922
|
//#endregion
|
|
44913
44923
|
//#region src/cli/utils/version.ts
|
|
44914
|
-
const VERSION = "0.5.8-dev.
|
|
44924
|
+
const VERSION = "0.5.8-dev.5f2bd72";
|
|
44915
44925
|
//#endregion
|
|
44916
44926
|
//#region src/cli/utils/json-mode.ts
|
|
44917
44927
|
let context = null;
|
|
@@ -45275,13 +45285,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
45275
45285
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
45276
45286
|
* standard `SENTRY_RELEASE` override.
|
|
45277
45287
|
*/
|
|
45278
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.
|
|
45288
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.5f2bd72`;
|
|
45279
45289
|
/**
|
|
45280
45290
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
45281
45291
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
45282
45292
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
45283
45293
|
*/
|
|
45284
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.
|
|
45294
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.5f2bd72") ? "development" : "production");
|
|
45285
45295
|
/**
|
|
45286
45296
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
45287
45297
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -49690,6 +49700,7 @@ const CI_PITCH_EVENT = "ci-pitch";
|
|
|
49690
49700
|
const ACTION_UPGRADE_EVENT = "action-upgrade-v2";
|
|
49691
49701
|
const SETUP_HINT_EVENT = "setup-hint";
|
|
49692
49702
|
const HANDOFF_TARGET_PREFERENCE_ID = "handoff-target";
|
|
49703
|
+
const INSTALL_AGENTS_PREFERENCE_ID = "install-agents";
|
|
49693
49704
|
const foldLegacyDecisions = (projects, legacy, eventId) => {
|
|
49694
49705
|
for (const [hash, record] of Object.entries(legacy ?? {})) {
|
|
49695
49706
|
const existing = projects[hash] ?? { rootDirectory: record.rootDirectory ?? "" };
|
|
@@ -50353,7 +50364,7 @@ const readPackageJson = (projectRoot) => {
|
|
|
50353
50364
|
return null;
|
|
50354
50365
|
}
|
|
50355
50366
|
};
|
|
50356
|
-
const writeJsonFile
|
|
50367
|
+
const writeJsonFile = (filePath, value) => {
|
|
50357
50368
|
NFS.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
50358
50369
|
};
|
|
50359
50370
|
const packageHasDependency = (projectRoot, dependencyName) => {
|
|
@@ -51296,6 +51307,20 @@ const detectAvailableAgents = async () => {
|
|
|
51296
51307
|
const detected = new Set([...detectPathAvailableAgents(), ...await detectInstalledSkillAgents()]);
|
|
51297
51308
|
return getSkillAgentTypes().filter((agent) => agent !== "universal" && detected.has(agent));
|
|
51298
51309
|
};
|
|
51310
|
+
const DEFAULT_INSTALL_AGENTS = [
|
|
51311
|
+
"claude-code",
|
|
51312
|
+
"cursor",
|
|
51313
|
+
"codex",
|
|
51314
|
+
"opencode"
|
|
51315
|
+
];
|
|
51316
|
+
const computeDefaultSelectedAgents = (detectedAgents, rememberedAgents) => {
|
|
51317
|
+
const detected = new Set(detectedAgents);
|
|
51318
|
+
const remembered = rememberedAgents.filter((agent) => detected.has(agent));
|
|
51319
|
+
if (remembered.length > 0) return remembered;
|
|
51320
|
+
const defaults = DEFAULT_INSTALL_AGENTS.filter((agent) => detected.has(agent));
|
|
51321
|
+
if (defaults.length > 0) return defaults;
|
|
51322
|
+
return detectedAgents.length === 1 ? [...detectedAgents] : [];
|
|
51323
|
+
};
|
|
51299
51324
|
//#endregion
|
|
51300
51325
|
//#region src/cli/utils/install-doctor-script.ts
|
|
51301
51326
|
const DOCTOR_SCRIPT_NAME = "doctor";
|
|
@@ -51377,7 +51402,7 @@ const installDoctorScript = (options) => {
|
|
|
51377
51402
|
};
|
|
51378
51403
|
})();
|
|
51379
51404
|
const scriptStatus = scriptTarget.status;
|
|
51380
|
-
if (scriptStatus === "created") writeJsonFile
|
|
51405
|
+
if (scriptStatus === "created") writeJsonFile(packageJsonPath, {
|
|
51381
51406
|
...packageJson,
|
|
51382
51407
|
scripts: {
|
|
51383
51408
|
...isRecord$1(scripts) ? scripts : {},
|
|
@@ -51948,6 +51973,19 @@ const setUpGitHubActions = async (options) => {
|
|
|
51948
51973
|
return didCreateWorkflow;
|
|
51949
51974
|
};
|
|
51950
51975
|
//#endregion
|
|
51976
|
+
//#region src/cli/utils/install-agents-preference.ts
|
|
51977
|
+
const INSTALL_AGENTS_PREFERENCE = {
|
|
51978
|
+
id: INSTALL_AGENTS_PREFERENCE_ID,
|
|
51979
|
+
scope: "global"
|
|
51980
|
+
};
|
|
51981
|
+
const PREFERENCE_SEPARATOR = ",";
|
|
51982
|
+
const readInstallAgents = (options = {}) => {
|
|
51983
|
+
const stored = readPreference(INSTALL_AGENTS_PREFERENCE, {}, options);
|
|
51984
|
+
if (stored === null) return [];
|
|
51985
|
+
return stored.split(PREFERENCE_SEPARATOR).map((entry) => entry.trim()).filter((entry) => isSkillAgentType(entry));
|
|
51986
|
+
};
|
|
51987
|
+
const rememberInstallAgents = (agents, options = {}) => writePreference(INSTALL_AGENTS_PREFERENCE, agents.join(PREFERENCE_SEPARATOR), {}, options);
|
|
51988
|
+
//#endregion
|
|
51951
51989
|
//#region src/cli/utils/install-agent-hooks.ts
|
|
51952
51990
|
const CLAUDE_AGENT = "claude-code";
|
|
51953
51991
|
const CURSOR_AGENT = "cursor";
|
|
@@ -51958,20 +51996,34 @@ const CURSOR_HOOKS_RELATIVE_PATH = ".cursor/hooks.json";
|
|
|
51958
51996
|
const CURSOR_HOOK_RELATIVE_PATH = ".cursor/hooks/react-doctor.sh";
|
|
51959
51997
|
const CURSOR_HOOK_MATCHER = "Write|Edit|MultiEdit|ApplyPatch";
|
|
51960
51998
|
const CURSOR_HOOKS_SCHEMA_VERSION = 1;
|
|
51961
|
-
const JSON_INDENT_SPACES$1 = 2;
|
|
51962
51999
|
const isSupportedAgent = (agent) => agent === CLAUDE_AGENT || agent === CURSOR_AGENT;
|
|
51963
52000
|
const readJsonFile = (filePath, fallback) => {
|
|
51964
52001
|
if (!NFS.existsSync(filePath)) return fallback;
|
|
51965
52002
|
const content = NFS.readFileSync(filePath, "utf8").trim();
|
|
51966
52003
|
if (content.length === 0) return fallback;
|
|
51967
|
-
|
|
52004
|
+
try {
|
|
52005
|
+
return JSON.parse(content);
|
|
52006
|
+
} catch (error) {
|
|
52007
|
+
if (error instanceof SyntaxError) throw new CliInputError(`Could not parse ${filePath}: the file contains invalid JSON. Fix the syntax errors in this file and re-run the install command.`);
|
|
52008
|
+
throw error;
|
|
52009
|
+
}
|
|
51968
52010
|
};
|
|
51969
|
-
const
|
|
51970
|
-
|
|
51971
|
-
|
|
52011
|
+
const ensureDirectoryExists = (directoryPath) => {
|
|
52012
|
+
try {
|
|
52013
|
+
NFS.mkdirSync(directoryPath, { recursive: true });
|
|
52014
|
+
} catch (error) {
|
|
52015
|
+
const code = error.code;
|
|
52016
|
+
if (code === "EACCES" || code === "EPERM") throw new CliInputError(`Could not create directory ${directoryPath}: permission denied. Ensure you have write permissions for this location and re-run the install command.`);
|
|
52017
|
+
if (code === "ENOTDIR" || code === "EEXIST") throw new CliInputError(`Could not create directory ${directoryPath}: a file exists at this path or one of its parent paths. Remove the conflicting file and re-run the install command.`);
|
|
52018
|
+
throw error;
|
|
52019
|
+
}
|
|
52020
|
+
};
|
|
52021
|
+
const writeJsonFileWithDirectoryCheck = (filePath, value) => {
|
|
52022
|
+
ensureDirectoryExists(Path.dirname(filePath));
|
|
52023
|
+
writeJsonFile(filePath, value);
|
|
51972
52024
|
};
|
|
51973
52025
|
const writeHookScript = (filePath) => {
|
|
51974
|
-
|
|
52026
|
+
ensureDirectoryExists(Path.dirname(filePath));
|
|
51975
52027
|
NFS.writeFileSync(filePath, buildAgentHookScript());
|
|
51976
52028
|
NFS.chmodSync(filePath, 493);
|
|
51977
52029
|
};
|
|
@@ -51987,7 +52039,7 @@ const installClaudeHook = (projectRoot) => {
|
|
|
51987
52039
|
command: CLAUDE_HOOK_COMMAND
|
|
51988
52040
|
}] });
|
|
51989
52041
|
hooks.PostToolBatch = postToolBatchHooks;
|
|
51990
|
-
|
|
52042
|
+
writeJsonFileWithDirectoryCheck(settingsPath, {
|
|
51991
52043
|
...settings,
|
|
51992
52044
|
hooks
|
|
51993
52045
|
});
|
|
@@ -52007,7 +52059,7 @@ const installCursorHook = (projectRoot) => {
|
|
|
52007
52059
|
timeout: 120
|
|
52008
52060
|
});
|
|
52009
52061
|
hooks.postToolUse = postToolUseHooks;
|
|
52010
|
-
|
|
52062
|
+
writeJsonFileWithDirectoryCheck(configPath, {
|
|
52011
52063
|
...config,
|
|
52012
52064
|
version: config.version ?? CURSOR_HOOKS_SCHEMA_VERSION,
|
|
52013
52065
|
hooks
|
|
@@ -52243,7 +52295,7 @@ const installPackageJsonHook = (options, strategy) => {
|
|
|
52243
52295
|
parent = cloned;
|
|
52244
52296
|
}
|
|
52245
52297
|
parent[leafKey] = strategy.leafShape === "array" ? appendArrayCommand(parent[leafKey]) : appendStringCommand(parent[leafKey]);
|
|
52246
|
-
writeJsonFile
|
|
52298
|
+
writeJsonFile(packageJsonPath, nextPackageJson);
|
|
52247
52299
|
removeLegacyManagedRunner(options.projectRoot);
|
|
52248
52300
|
return {
|
|
52249
52301
|
hookPath: packageJsonPath,
|
|
@@ -52826,6 +52878,9 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52826
52878
|
const shouldUpgradeWorkflow = canUpgradeWorkflow && (Boolean(options.yes) || upgradePromptOutcome === "yes");
|
|
52827
52879
|
if (upgradePromptOutcome === "no" && !options.dryRun) recordActionUpgradeDecision(projectRoot, "declined");
|
|
52828
52880
|
if ((ciPromptOutcome === "yes" || ciPromptOutcome === "no") && !options.dryRun) recordCiPromptDecision(projectRoot, ciPromptOutcome === "yes" ? "accepted" : "declined");
|
|
52881
|
+
const rememberedAgents = options.lastSelectedAgents ?? readInstallAgents();
|
|
52882
|
+
const defaultSelectedAgents = computeDefaultSelectedAgents(detectedAgents, rememberedAgents);
|
|
52883
|
+
const usedRememberedAgents = rememberedAgents.some((agent) => detectedAgents.includes(agent));
|
|
52829
52884
|
const selectedAgents = skipPrompts ? detectedAgents : (await prompt({
|
|
52830
52885
|
type: "multiselect",
|
|
52831
52886
|
name: "agents",
|
|
@@ -52833,12 +52888,13 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52833
52888
|
choices: detectedAgents.map((agent) => ({
|
|
52834
52889
|
title: getSkillAgentConfig(agent).displayName,
|
|
52835
52890
|
value: agent,
|
|
52836
|
-
selected:
|
|
52891
|
+
selected: defaultSelectedAgents.includes(agent)
|
|
52837
52892
|
})),
|
|
52838
52893
|
instructions: false,
|
|
52839
52894
|
min: 1
|
|
52840
52895
|
}, promptOptions)).agents ?? [];
|
|
52841
52896
|
if (selectedAgents.length === 0) return;
|
|
52897
|
+
if (!skipPrompts && !options.dryRun) rememberInstallAgents(selectedAgents);
|
|
52842
52898
|
let dependencyResult;
|
|
52843
52899
|
if (!options.dryRun) {
|
|
52844
52900
|
await installReactDoctorSkillStep(sourceDir, selectedAgents, projectRoot);
|
|
@@ -52897,6 +52953,8 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
52897
52953
|
}
|
|
52898
52954
|
recordCount(METRIC.installCompleted, 1, {
|
|
52899
52955
|
agentsCount: selectedAgents.length,
|
|
52956
|
+
agentsDetected: detectedAgents.length,
|
|
52957
|
+
usedRememberedAgents,
|
|
52900
52958
|
gitHook: shouldInstallGitHook,
|
|
52901
52959
|
agentHooks: shouldInstallAgentHooks,
|
|
52902
52960
|
workflow: didInstallWorkflow,
|
|
@@ -53676,7 +53734,7 @@ const warnDeprecatedDiff = (flags, userConfig) => {
|
|
|
53676
53734
|
};
|
|
53677
53735
|
const warnDiffUnavailable = (requested, isQuiet) => {
|
|
53678
53736
|
if (isQuiet) return;
|
|
53679
|
-
if (typeof requested.base === "string") cliLogger.warn(`Could not compute diff against "${requested.base}" (
|
|
53737
|
+
if (typeof requested.base === "string") cliLogger.warn(`Could not compute diff against "${requested.base}" (git unavailable, ref not found, or merge-base failed). Running full scan.`);
|
|
53680
53738
|
else cliLogger.warn("No feature branch or uncommitted changes detected. Running full scan.");
|
|
53681
53739
|
cliLogger.break();
|
|
53682
53740
|
};
|
|
@@ -54367,6 +54425,10 @@ const installAction = async (options, command) => {
|
|
|
54367
54425
|
projectRoot: options.cwd ?? process.cwd()
|
|
54368
54426
|
});
|
|
54369
54427
|
} catch (error) {
|
|
54428
|
+
if (isExpectedUserError(error)) {
|
|
54429
|
+
handleUserError(error);
|
|
54430
|
+
return;
|
|
54431
|
+
}
|
|
54370
54432
|
handleError(error, { sentryEventId: await reportErrorToSentry(error) });
|
|
54371
54433
|
}
|
|
54372
54434
|
};
|
|
@@ -55374,4 +55436,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
55374
55436
|
export {};
|
|
55375
55437
|
|
|
55376
55438
|
//# sourceMappingURL=cli.js.map
|
|
55377
|
-
//# debugId=
|
|
55439
|
+
//# debugId=286954ee-f636-51ec-9cb7-a1bde0687a30
|
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]="62d09923-e78d-5501-8799-859098af2aaa")}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);
|
|
@@ -35577,6 +35580,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
35577
35580
|
"adoptExistingLintConfig"
|
|
35578
35581
|
];
|
|
35579
35582
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
35583
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
35584
|
+
"projects",
|
|
35585
|
+
"textComponents",
|
|
35586
|
+
"rawTextWrapperComponents",
|
|
35587
|
+
"serverAuthFunctionNames"
|
|
35588
|
+
];
|
|
35580
35589
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
35581
35590
|
"includeTags",
|
|
35582
35591
|
"excludeTags",
|
|
@@ -35678,6 +35687,7 @@ const validateConfigTypes = (config) => {
|
|
|
35678
35687
|
const validated = { ...config };
|
|
35679
35688
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
35680
35689
|
for (const fieldName of STRING_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateString(fieldName, value));
|
|
35690
|
+
for (const fieldName of STRING_ARRAY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateStringArrayField(fieldName, value));
|
|
35681
35691
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
35682
35692
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
35683
35693
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -37931,7 +37941,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37931
37941
|
"rev-parse",
|
|
37932
37942
|
"--verify",
|
|
37933
37943
|
branch
|
|
37934
|
-
]).pipe(map$3((result) => result.status === 0));
|
|
37944
|
+
]).pipe(map$3((result) => result.status === 0), catch_$1((error) => error.reason._tag === "GitInvocationFailed" ? succeed$2(false) : fail$4(error)));
|
|
37935
37945
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
37936
37946
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
37937
37947
|
"merge-base",
|
|
@@ -41469,4 +41479,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
41469
41479
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
41470
41480
|
|
|
41471
41481
|
//# sourceMappingURL=index.js.map
|
|
41472
|
-
//# debugId=
|
|
41482
|
+
//# debugId=62d09923-e78d-5501-8799-859098af2aaa
|
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);
|
|
@@ -35610,6 +35613,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
35610
35613
|
"adoptExistingLintConfig"
|
|
35611
35614
|
];
|
|
35612
35615
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
35616
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
35617
|
+
"projects",
|
|
35618
|
+
"textComponents",
|
|
35619
|
+
"rawTextWrapperComponents",
|
|
35620
|
+
"serverAuthFunctionNames"
|
|
35621
|
+
];
|
|
35613
35622
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
35614
35623
|
"includeTags",
|
|
35615
35624
|
"excludeTags",
|
|
@@ -35711,6 +35720,7 @@ const validateConfigTypes = (config) => {
|
|
|
35711
35720
|
const validated = { ...config };
|
|
35712
35721
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
35713
35722
|
for (const fieldName of STRING_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateString(fieldName, value));
|
|
35723
|
+
for (const fieldName of STRING_ARRAY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateStringArrayField(fieldName, value));
|
|
35714
35724
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
35715
35725
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
35716
35726
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -37916,7 +37926,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37916
37926
|
"rev-parse",
|
|
37917
37927
|
"--verify",
|
|
37918
37928
|
branch
|
|
37919
|
-
]).pipe(map$3((result) => result.status === 0));
|
|
37929
|
+
]).pipe(map$3((result) => result.status === 0), catch_$1((error) => error.reason._tag === "GitInvocationFailed" ? succeed$2(false) : fail$4(error)));
|
|
37920
37930
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
37921
37931
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
37922
37932
|
"merge-base",
|
|
@@ -43249,5 +43259,5 @@ const startLanguageServer = () => {
|
|
|
43249
43259
|
};
|
|
43250
43260
|
//#endregion
|
|
43251
43261
|
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=
|
|
43262
|
+
!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]="f9576947-f3ff-58f4-b9ff-de0e2898651c")}catch(e){}}();
|
|
43263
|
+
//# debugId=f9576947-f3ff-58f4-b9ff-de0e2898651c
|
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.5f2bd72",
|
|
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
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"deslop-js": "0.5.8",
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.8-dev.5f2bd72"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|