react-doctor 0.5.8-dev.c2ce298 → 0.5.8-dev.f853efd
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 +91 -25
- package/dist/index.js +10 -3
- package/dist/lsp.js +11 -3
- package/package.json +4 -4
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]="89eea142-f3f2-5f35-a6b0-e9e10055d0cb")}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";
|
|
@@ -38768,6 +38768,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
38768
38768
|
"adoptExistingLintConfig"
|
|
38769
38769
|
];
|
|
38770
38770
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
38771
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
38772
|
+
"projects",
|
|
38773
|
+
"textComponents",
|
|
38774
|
+
"rawTextWrapperComponents",
|
|
38775
|
+
"serverAuthFunctionNames"
|
|
38776
|
+
];
|
|
38771
38777
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
38772
38778
|
"includeTags",
|
|
38773
38779
|
"excludeTags",
|
|
@@ -38869,6 +38875,7 @@ const validateConfigTypes = (config) => {
|
|
|
38869
38875
|
const validated = { ...config };
|
|
38870
38876
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
38871
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));
|
|
38872
38879
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
38873
38880
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
38874
38881
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -41166,7 +41173,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
41166
41173
|
"rev-parse",
|
|
41167
41174
|
"--verify",
|
|
41168
41175
|
branch
|
|
41169
|
-
]).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)));
|
|
41170
41177
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
41171
41178
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
41172
41179
|
"merge-base",
|
|
@@ -44842,6 +44849,7 @@ const NANOSECONDS_PER_SECOND = 1000000000n;
|
|
|
44842
44849
|
const METRIC = {
|
|
44843
44850
|
cliInvoked: "cli.invoked",
|
|
44844
44851
|
cliError: "cli.error",
|
|
44852
|
+
cliEnvironmentError: "cli.env_error",
|
|
44845
44853
|
projectDetected: "project.detected",
|
|
44846
44854
|
projectPathSelected: "project.path_selected",
|
|
44847
44855
|
projectConfigSelected: "project.config_selected",
|
|
@@ -44914,7 +44922,7 @@ const makeNoopConsole = () => ({
|
|
|
44914
44922
|
});
|
|
44915
44923
|
//#endregion
|
|
44916
44924
|
//#region src/cli/utils/version.ts
|
|
44917
|
-
const VERSION = "0.5.8-dev.
|
|
44925
|
+
const VERSION = "0.5.8-dev.f853efd";
|
|
44918
44926
|
//#endregion
|
|
44919
44927
|
//#region src/cli/utils/json-mode.ts
|
|
44920
44928
|
let context = null;
|
|
@@ -45278,13 +45286,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
45278
45286
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
45279
45287
|
* standard `SENTRY_RELEASE` override.
|
|
45280
45288
|
*/
|
|
45281
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.
|
|
45289
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.8-dev.f853efd`;
|
|
45282
45290
|
/**
|
|
45283
45291
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
45284
45292
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
45285
45293
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
45286
45294
|
*/
|
|
45287
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.
|
|
45295
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.8-dev.f853efd") ? "development" : "production");
|
|
45288
45296
|
/**
|
|
45289
45297
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
45290
45298
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -50357,7 +50365,7 @@ const readPackageJson = (projectRoot) => {
|
|
|
50357
50365
|
return null;
|
|
50358
50366
|
}
|
|
50359
50367
|
};
|
|
50360
|
-
const writeJsonFile
|
|
50368
|
+
const writeJsonFile = (filePath, value) => {
|
|
50361
50369
|
NFS.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
50362
50370
|
};
|
|
50363
50371
|
const packageHasDependency = (projectRoot, dependencyName) => {
|
|
@@ -51096,6 +51104,35 @@ const materializeStagedFiles = async (directory, stagedFiles, tempDirectory) =>
|
|
|
51096
51104
|
};
|
|
51097
51105
|
};
|
|
51098
51106
|
//#endregion
|
|
51107
|
+
//#region src/cli/utils/is-environment-error.ts
|
|
51108
|
+
const isNodeSystemError = (error) => error instanceof Error && typeof error.code === "string";
|
|
51109
|
+
const ENVIRONMENT_ERROR_CODES = new Set([
|
|
51110
|
+
"ENOSPC",
|
|
51111
|
+
"EIO",
|
|
51112
|
+
"EROFS",
|
|
51113
|
+
"EACCES",
|
|
51114
|
+
"EPERM",
|
|
51115
|
+
"ENOTDIR"
|
|
51116
|
+
]);
|
|
51117
|
+
const isEnvironmentError = (error) => {
|
|
51118
|
+
if (!isNodeSystemError(error)) return false;
|
|
51119
|
+
if (error.code === "ENOENT") return error.syscall?.startsWith("spawn") ?? false;
|
|
51120
|
+
return error.code !== void 0 && ENVIRONMENT_ERROR_CODES.has(error.code);
|
|
51121
|
+
};
|
|
51122
|
+
const formatEnvironmentError = (error) => {
|
|
51123
|
+
if (!isNodeSystemError(error)) return error instanceof Error ? error.message : String(error);
|
|
51124
|
+
switch (error.code) {
|
|
51125
|
+
case "ENOSPC": return "No space left on device. Free up disk space and try again.";
|
|
51126
|
+
case "EIO": return "I/O error: the filesystem or disk may be failing. Check your system logs.";
|
|
51127
|
+
case "EROFS": return "Read-only filesystem: cannot write to this location.";
|
|
51128
|
+
case "EACCES":
|
|
51129
|
+
case "EPERM": return error.path ? `Permission denied accessing ${error.path}. Check file permissions and try again.` : "Permission denied. Check file permissions and try again.";
|
|
51130
|
+
case "ENOTDIR": return error.path ? `A file exists at ${error.path} or one of its parent paths where a directory was expected.` : "A file exists where a directory was expected.";
|
|
51131
|
+
case "ENOENT": return "Required command not found. Ensure the tool (e.g. git) is installed and on your PATH.";
|
|
51132
|
+
default: return error.message;
|
|
51133
|
+
}
|
|
51134
|
+
};
|
|
51135
|
+
//#endregion
|
|
51099
51136
|
//#region src/cli/utils/handle-error.ts
|
|
51100
51137
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
51101
51138
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -51178,15 +51215,19 @@ const handleError = (error, options = {}) => {
|
|
|
51178
51215
|
process.exitCode = 1;
|
|
51179
51216
|
};
|
|
51180
51217
|
/**
|
|
51181
|
-
* Renderer for expected, user-actionable failures — a bad `--diff` value
|
|
51182
|
-
* a base branch that isn't fetched
|
|
51183
|
-
*
|
|
51184
|
-
*
|
|
51218
|
+
* Renderer for expected, user-actionable failures — a bad `--diff` value,
|
|
51219
|
+
* a base branch that isn't fetched, or environment errors like disk-full or
|
|
51220
|
+
* permission-denied. Prints just the (already human-readable) message — no
|
|
51221
|
+
* "Something went wrong", prefilled issue, Discord link, or Sentry reference
|
|
51222
|
+
* — because there is no bug to report.
|
|
51185
51223
|
*/
|
|
51186
51224
|
const handleUserError = (error, options = {}) => {
|
|
51225
|
+
const isEnvError = isEnvironmentError(error);
|
|
51226
|
+
if (isEnvError) recordCount(METRIC.cliEnvironmentError, 1, { code: error.code ?? "unknown" });
|
|
51227
|
+
const message = isEnvError ? formatEnvironmentError(error) : formatErrorForReport(error);
|
|
51187
51228
|
runSync(gen(function* () {
|
|
51188
51229
|
yield* error$1("");
|
|
51189
|
-
yield* error$1(highlighter.error(
|
|
51230
|
+
yield* error$1(highlighter.error(message));
|
|
51190
51231
|
yield* error$1("");
|
|
51191
51232
|
}));
|
|
51192
51233
|
if (options.shouldExit !== false) process.exit(1);
|
|
@@ -51201,7 +51242,7 @@ const handleUserError = (error, options = {}) => {
|
|
|
51201
51242
|
* `handleUserError` (a plain message — no "Something went wrong", prefilled
|
|
51202
51243
|
* issue, Discord link, or Sentry reference), since there is no bug to report.
|
|
51203
51244
|
*
|
|
51204
|
-
*
|
|
51245
|
+
* Four distinct shapes reach the CLI's catch blocks:
|
|
51205
51246
|
*
|
|
51206
51247
|
* - **Project-discovery failures** (`NoReactDependencyError`,
|
|
51207
51248
|
* `ProjectNotFoundError`, `PackageJsonNotFoundError`, `NotADirectoryError`,
|
|
@@ -51214,12 +51255,19 @@ const handleUserError = (error, options = {}) => {
|
|
|
51214
51255
|
* `--project` name.
|
|
51215
51256
|
* - **Bad `--diff` input** (`GitBaseBranchInvalid` / `GitBaseBranchMissing`)
|
|
51216
51257
|
* stays the tagged `ReactDoctorError`, so dispatch on the reason `_tag`.
|
|
51258
|
+
* - **Environment failures** (`ENOSPC`, `EIO`, `EROFS`, `EACCES`, `EPERM`,
|
|
51259
|
+
* `ENOTDIR`, plus a `spawn`-scoped `ENOENT` for a missing binary) — disk
|
|
51260
|
+
* full / failing / read-only, permission denied, or a path blocked by a
|
|
51261
|
+
* file. React Doctor cannot fix the user's environment; exit cleanly with an
|
|
51262
|
+
* actionable message instead of crashing. See `is-environment-error.ts` for
|
|
51263
|
+
* why the set stays narrow (codes that usually mean our bug keep reaching
|
|
51264
|
+
* Sentry).
|
|
51217
51265
|
*
|
|
51218
51266
|
* This composes the existing core narrowers rather than introducing a new
|
|
51219
51267
|
* error-shape helper (AGENTS.md): it encodes CLI-layer reporting policy, not
|
|
51220
51268
|
* knowledge of the `ReactDoctorError` shape.
|
|
51221
51269
|
*/
|
|
51222
|
-
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) || isReactDoctorError(error) && (error.reason._tag === "GitBaseBranchInvalid" || error.reason._tag === "GitBaseBranchMissing");
|
|
51270
|
+
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) || isEnvironmentError(error) || isReactDoctorError(error) && (error.reason._tag === "GitBaseBranchInvalid" || error.reason._tag === "GitBaseBranchMissing");
|
|
51223
51271
|
//#endregion
|
|
51224
51272
|
//#region src/cli/utils/build-handoff-payload.ts
|
|
51225
51273
|
const buildHandoffPayload = (input) => {
|
|
@@ -51395,7 +51443,7 @@ const installDoctorScript = (options) => {
|
|
|
51395
51443
|
};
|
|
51396
51444
|
})();
|
|
51397
51445
|
const scriptStatus = scriptTarget.status;
|
|
51398
|
-
if (scriptStatus === "created") writeJsonFile
|
|
51446
|
+
if (scriptStatus === "created") writeJsonFile(packageJsonPath, {
|
|
51399
51447
|
...packageJson,
|
|
51400
51448
|
scripts: {
|
|
51401
51449
|
...isRecord$1(scripts) ? scripts : {},
|
|
@@ -51989,20 +52037,34 @@ const CURSOR_HOOKS_RELATIVE_PATH = ".cursor/hooks.json";
|
|
|
51989
52037
|
const CURSOR_HOOK_RELATIVE_PATH = ".cursor/hooks/react-doctor.sh";
|
|
51990
52038
|
const CURSOR_HOOK_MATCHER = "Write|Edit|MultiEdit|ApplyPatch";
|
|
51991
52039
|
const CURSOR_HOOKS_SCHEMA_VERSION = 1;
|
|
51992
|
-
const JSON_INDENT_SPACES$1 = 2;
|
|
51993
52040
|
const isSupportedAgent = (agent) => agent === CLAUDE_AGENT || agent === CURSOR_AGENT;
|
|
51994
52041
|
const readJsonFile = (filePath, fallback) => {
|
|
51995
52042
|
if (!NFS.existsSync(filePath)) return fallback;
|
|
51996
52043
|
const content = NFS.readFileSync(filePath, "utf8").trim();
|
|
51997
52044
|
if (content.length === 0) return fallback;
|
|
51998
|
-
|
|
52045
|
+
try {
|
|
52046
|
+
return JSON.parse(content);
|
|
52047
|
+
} catch (error) {
|
|
52048
|
+
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.`);
|
|
52049
|
+
throw error;
|
|
52050
|
+
}
|
|
51999
52051
|
};
|
|
52000
|
-
const
|
|
52001
|
-
|
|
52002
|
-
|
|
52052
|
+
const ensureDirectoryExists = (directoryPath) => {
|
|
52053
|
+
try {
|
|
52054
|
+
NFS.mkdirSync(directoryPath, { recursive: true });
|
|
52055
|
+
} catch (error) {
|
|
52056
|
+
const code = error.code;
|
|
52057
|
+
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.`);
|
|
52058
|
+
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.`);
|
|
52059
|
+
throw error;
|
|
52060
|
+
}
|
|
52061
|
+
};
|
|
52062
|
+
const writeJsonFileWithDirectoryCheck = (filePath, value) => {
|
|
52063
|
+
ensureDirectoryExists(Path.dirname(filePath));
|
|
52064
|
+
writeJsonFile(filePath, value);
|
|
52003
52065
|
};
|
|
52004
52066
|
const writeHookScript = (filePath) => {
|
|
52005
|
-
|
|
52067
|
+
ensureDirectoryExists(Path.dirname(filePath));
|
|
52006
52068
|
NFS.writeFileSync(filePath, buildAgentHookScript());
|
|
52007
52069
|
NFS.chmodSync(filePath, 493);
|
|
52008
52070
|
};
|
|
@@ -52018,7 +52080,7 @@ const installClaudeHook = (projectRoot) => {
|
|
|
52018
52080
|
command: CLAUDE_HOOK_COMMAND
|
|
52019
52081
|
}] });
|
|
52020
52082
|
hooks.PostToolBatch = postToolBatchHooks;
|
|
52021
|
-
|
|
52083
|
+
writeJsonFileWithDirectoryCheck(settingsPath, {
|
|
52022
52084
|
...settings,
|
|
52023
52085
|
hooks
|
|
52024
52086
|
});
|
|
@@ -52038,7 +52100,7 @@ const installCursorHook = (projectRoot) => {
|
|
|
52038
52100
|
timeout: 120
|
|
52039
52101
|
});
|
|
52040
52102
|
hooks.postToolUse = postToolUseHooks;
|
|
52041
|
-
|
|
52103
|
+
writeJsonFileWithDirectoryCheck(configPath, {
|
|
52042
52104
|
...config,
|
|
52043
52105
|
version: config.version ?? CURSOR_HOOKS_SCHEMA_VERSION,
|
|
52044
52106
|
hooks
|
|
@@ -52274,7 +52336,7 @@ const installPackageJsonHook = (options, strategy) => {
|
|
|
52274
52336
|
parent = cloned;
|
|
52275
52337
|
}
|
|
52276
52338
|
parent[leafKey] = strategy.leafShape === "array" ? appendArrayCommand(parent[leafKey]) : appendStringCommand(parent[leafKey]);
|
|
52277
|
-
writeJsonFile
|
|
52339
|
+
writeJsonFile(packageJsonPath, nextPackageJson);
|
|
52278
52340
|
removeLegacyManagedRunner(options.projectRoot);
|
|
52279
52341
|
return {
|
|
52280
52342
|
hookPath: packageJsonPath,
|
|
@@ -53713,7 +53775,7 @@ const warnDeprecatedDiff = (flags, userConfig) => {
|
|
|
53713
53775
|
};
|
|
53714
53776
|
const warnDiffUnavailable = (requested, isQuiet) => {
|
|
53715
53777
|
if (isQuiet) return;
|
|
53716
|
-
if (typeof requested.base === "string") cliLogger.warn(`Could not compute diff against "${requested.base}" (
|
|
53778
|
+
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.`);
|
|
53717
53779
|
else cliLogger.warn("No feature branch or uncommitted changes detected. Running full scan.");
|
|
53718
53780
|
cliLogger.break();
|
|
53719
53781
|
};
|
|
@@ -54404,6 +54466,10 @@ const installAction = async (options, command) => {
|
|
|
54404
54466
|
projectRoot: options.cwd ?? process.cwd()
|
|
54405
54467
|
});
|
|
54406
54468
|
} catch (error) {
|
|
54469
|
+
if (isExpectedUserError(error)) {
|
|
54470
|
+
handleUserError(error);
|
|
54471
|
+
return;
|
|
54472
|
+
}
|
|
54407
54473
|
handleError(error, { sentryEventId: await reportErrorToSentry(error) });
|
|
54408
54474
|
}
|
|
54409
54475
|
};
|
|
@@ -55411,4 +55477,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
55411
55477
|
export {};
|
|
55412
55478
|
|
|
55413
55479
|
//# sourceMappingURL=cli.js.map
|
|
55414
|
-
//# debugId=
|
|
55480
|
+
//# debugId=89eea142-f3f2-5f35-a6b0-e9e10055d0cb
|
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";
|
|
@@ -35580,6 +35580,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
35580
35580
|
"adoptExistingLintConfig"
|
|
35581
35581
|
];
|
|
35582
35582
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
35583
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
35584
|
+
"projects",
|
|
35585
|
+
"textComponents",
|
|
35586
|
+
"rawTextWrapperComponents",
|
|
35587
|
+
"serverAuthFunctionNames"
|
|
35588
|
+
];
|
|
35583
35589
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
35584
35590
|
"includeTags",
|
|
35585
35591
|
"excludeTags",
|
|
@@ -35681,6 +35687,7 @@ const validateConfigTypes = (config) => {
|
|
|
35681
35687
|
const validated = { ...config };
|
|
35682
35688
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
35683
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));
|
|
35684
35691
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
35685
35692
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
35686
35693
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -37934,7 +37941,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37934
37941
|
"rev-parse",
|
|
37935
37942
|
"--verify",
|
|
37936
37943
|
branch
|
|
37937
|
-
]).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)));
|
|
37938
37945
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
37939
37946
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
37940
37947
|
"merge-base",
|
|
@@ -41472,4 +41479,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
41472
41479
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
41473
41480
|
|
|
41474
41481
|
//# sourceMappingURL=index.js.map
|
|
41475
|
-
//# debugId=
|
|
41482
|
+
//# debugId=62d09923-e78d-5501-8799-859098af2aaa
|
package/dist/lsp.js
CHANGED
|
@@ -35613,6 +35613,12 @@ const BOOLEAN_FIELD_NAMES = [
|
|
|
35613
35613
|
"adoptExistingLintConfig"
|
|
35614
35614
|
];
|
|
35615
35615
|
const STRING_FIELD_NAMES = ["rootDir"];
|
|
35616
|
+
const STRING_ARRAY_FIELD_NAMES = [
|
|
35617
|
+
"projects",
|
|
35618
|
+
"textComponents",
|
|
35619
|
+
"rawTextWrapperComponents",
|
|
35620
|
+
"serverAuthFunctionNames"
|
|
35621
|
+
];
|
|
35616
35622
|
const SURFACE_CONTROL_FIELD_NAMES = [
|
|
35617
35623
|
"includeTags",
|
|
35618
35624
|
"excludeTags",
|
|
@@ -35714,6 +35720,7 @@ const validateConfigTypes = (config) => {
|
|
|
35714
35720
|
const validated = { ...config };
|
|
35715
35721
|
for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
|
|
35716
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));
|
|
35717
35724
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
35718
35725
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
35719
35726
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
@@ -37919,7 +37926,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37919
37926
|
"rev-parse",
|
|
37920
37927
|
"--verify",
|
|
37921
37928
|
branch
|
|
37922
|
-
]).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)));
|
|
37923
37930
|
const headSha = (directory) => runGit(directory, ["rev-parse", "HEAD"]).pipe(map$3((result) => result.status === 0 ? trimOrNull(result.stdout) : null));
|
|
37924
37931
|
const mergeBase = (input) => isSafeGitRevision(input.ref) ? runGit(input.directory, [
|
|
37925
37932
|
"merge-base",
|
|
@@ -42906,6 +42913,7 @@ const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
|
42906
42913
|
const METRIC = {
|
|
42907
42914
|
cliInvoked: "cli.invoked",
|
|
42908
42915
|
cliError: "cli.error",
|
|
42916
|
+
cliEnvironmentError: "cli.env_error",
|
|
42909
42917
|
projectDetected: "project.detected",
|
|
42910
42918
|
projectPathSelected: "project.path_selected",
|
|
42911
42919
|
projectConfigSelected: "project.config_selected",
|
|
@@ -43252,5 +43260,5 @@ const startLanguageServer = () => {
|
|
|
43252
43260
|
};
|
|
43253
43261
|
//#endregion
|
|
43254
43262
|
export { startLanguageServer };
|
|
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]="
|
|
43256
|
-
//# debugId=
|
|
43263
|
+
!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]="1b85b637-9e6d-554c-a429-3652a14706b0")}catch(e){}}();
|
|
43264
|
+
//# debugId=1b85b637-9e6d-554c-a429-3652a14706b0
|
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.f853efd",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
65
65
|
"vscode-uri": "^3.1.0",
|
|
66
66
|
"deslop-js": "0.5.8",
|
|
67
|
-
"oxlint-plugin-react-doctor": "0.5.8-dev.
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.8-dev.f853efd"
|
|
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/core": "0.5.8",
|
|
77
|
+
"@react-doctor/language-server": "0.5.8"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": "^20.19.0 || >=22.13.0"
|