react-doctor 0.5.8-dev.441e6af → 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 +44 -89
- package/dist/index.js +34 -38
- package/dist/lsp.js +34 -39
- 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";
|
|
@@ -36862,7 +36862,6 @@ const DOCS_URL = "https://react.doctor/docs";
|
|
|
36862
36862
|
const DOCS_RULES_BASE_URL = `${DOCS_URL}/rules`;
|
|
36863
36863
|
const FETCH_TIMEOUT_MS = 1e4;
|
|
36864
36864
|
const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
|
|
36865
|
-
const SPAWN_ARGS_MAX_LENGTH_CHARS = 24e3;
|
|
36866
36865
|
const PER_WORKER_MEM_BUDGET_BYTES = 1024 * 1024 * 1024;
|
|
36867
36866
|
const DEFAULT_BRANCH_CANDIDATES = ["main", "master"];
|
|
36868
36867
|
const ADOPTABLE_LINT_CONFIG_FILENAMES = [".oxlintrc.json", ".eslintrc.json"];
|
|
@@ -41105,46 +41104,43 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
41105
41104
|
* reason: GitInvocationFailed })` so the rest of the codebase
|
|
41106
41105
|
* sees a single failure channel.
|
|
41107
41106
|
*/
|
|
41108
|
-
const runCommand = (input) => {
|
|
41109
|
-
const
|
|
41107
|
+
const runCommand = (input) => scoped(gen(function* () {
|
|
41108
|
+
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
41109
|
+
cwd: input.directory,
|
|
41110
|
+
env: input.env,
|
|
41111
|
+
extendEnv: true
|
|
41112
|
+
}));
|
|
41113
|
+
const maxStdoutBytes = input.maxStdoutBytes;
|
|
41114
|
+
const stdoutByteCount = yield* make$13(0);
|
|
41115
|
+
const [stdout, stderr, status] = yield* all([
|
|
41116
|
+
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
41117
|
+
args: [...input.args],
|
|
41118
|
+
directory: input.directory,
|
|
41119
|
+
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
41120
|
+
}) })) : void_)))))),
|
|
41121
|
+
mkString(decodeText(handle.stderr)),
|
|
41122
|
+
handle.exitCode
|
|
41123
|
+
], { concurrency: 3 });
|
|
41124
|
+
return {
|
|
41125
|
+
status,
|
|
41126
|
+
stdout,
|
|
41127
|
+
stderr
|
|
41128
|
+
};
|
|
41129
|
+
})).pipe(catchTag$1("PlatformError", (cause) => {
|
|
41130
|
+
if (input.command !== "git") return succeed$2({
|
|
41110
41131
|
status: 127,
|
|
41111
41132
|
stdout: "",
|
|
41112
41133
|
stderr: String(cause)
|
|
41113
|
-
})
|
|
41134
|
+
});
|
|
41135
|
+
return new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
41114
41136
|
args: [...input.args],
|
|
41115
41137
|
directory: input.directory,
|
|
41116
41138
|
cause
|
|
41117
|
-
}) })
|
|
41118
|
-
|
|
41119
|
-
|
|
41120
|
-
|
|
41121
|
-
|
|
41122
|
-
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
41123
|
-
cwd: input.directory,
|
|
41124
|
-
env: input.env,
|
|
41125
|
-
extendEnv: true
|
|
41126
|
-
}));
|
|
41127
|
-
const maxStdoutBytes = input.maxStdoutBytes;
|
|
41128
|
-
const stdoutByteCount = yield* make$13(0);
|
|
41129
|
-
const [stdout, stderr, status] = yield* all([
|
|
41130
|
-
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
41131
|
-
args: [...input.args],
|
|
41132
|
-
directory: input.directory,
|
|
41133
|
-
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
41134
|
-
}) })) : void_)))))),
|
|
41135
|
-
mkString(decodeText(handle.stderr)),
|
|
41136
|
-
handle.exitCode
|
|
41137
|
-
], { concurrency: 3 });
|
|
41138
|
-
return {
|
|
41139
|
-
status,
|
|
41140
|
-
stdout,
|
|
41141
|
-
stderr
|
|
41142
|
-
};
|
|
41143
|
-
})).pipe(catchTag$1("PlatformError", foldSpawnFailure), withSpan("git.exec", { attributes: {
|
|
41144
|
-
"git.command": input.command,
|
|
41145
|
-
"git.subcommand": input.args[0] ?? ""
|
|
41146
|
-
} }));
|
|
41147
|
-
};
|
|
41139
|
+
}) });
|
|
41140
|
+
}), withSpan("git.exec", { attributes: {
|
|
41141
|
+
"git.command": input.command,
|
|
41142
|
+
"git.subcommand": input.args[0] ?? ""
|
|
41143
|
+
} }));
|
|
41148
41144
|
const runGit = (directory, args) => runCommand({
|
|
41149
41145
|
command: "git",
|
|
41150
41146
|
args,
|
|
@@ -41391,7 +41387,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
41391
41387
|
]);
|
|
41392
41388
|
if (result.status !== 0) return null;
|
|
41393
41389
|
return parseChangedLineRanges(result.stdout);
|
|
41394
|
-
}).pipe(
|
|
41390
|
+
}).pipe(withSpan("Git.changedLineRanges"))
|
|
41395
41391
|
});
|
|
41396
41392
|
})).pipe(provide$2(layer$3.pipe(provide$2(mergeAll$1(layer$2, layer$1)))));
|
|
41397
41393
|
/**
|
|
@@ -44853,7 +44849,6 @@ const NANOSECONDS_PER_SECOND = 1000000000n;
|
|
|
44853
44849
|
const METRIC = {
|
|
44854
44850
|
cliInvoked: "cli.invoked",
|
|
44855
44851
|
cliError: "cli.error",
|
|
44856
|
-
cliEnvironmentError: "cli.env_error",
|
|
44857
44852
|
projectDetected: "project.detected",
|
|
44858
44853
|
projectPathSelected: "project.path_selected",
|
|
44859
44854
|
projectConfigSelected: "project.config_selected",
|
|
@@ -44926,7 +44921,7 @@ const makeNoopConsole = () => ({
|
|
|
44926
44921
|
});
|
|
44927
44922
|
//#endregion
|
|
44928
44923
|
//#region src/cli/utils/version.ts
|
|
44929
|
-
const VERSION = "0.5.8-dev.
|
|
44924
|
+
const VERSION = "0.5.8-dev.5f2bd72";
|
|
44930
44925
|
//#endregion
|
|
44931
44926
|
//#region src/cli/utils/json-mode.ts
|
|
44932
44927
|
let context = null;
|
|
@@ -45290,13 +45285,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
45290
45285
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
45291
45286
|
* standard `SENTRY_RELEASE` override.
|
|
45292
45287
|
*/
|
|
45293
|
-
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`;
|
|
45294
45289
|
/**
|
|
45295
45290
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
45296
45291
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
45297
45292
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
45298
45293
|
*/
|
|
45299
|
-
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");
|
|
45300
45295
|
/**
|
|
45301
45296
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
45302
45297
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -51108,35 +51103,6 @@ const materializeStagedFiles = async (directory, stagedFiles, tempDirectory) =>
|
|
|
51108
51103
|
};
|
|
51109
51104
|
};
|
|
51110
51105
|
//#endregion
|
|
51111
|
-
//#region src/cli/utils/is-environment-error.ts
|
|
51112
|
-
const isNodeSystemError = (error) => error instanceof Error && typeof error.code === "string";
|
|
51113
|
-
const ENVIRONMENT_ERROR_CODES = new Set([
|
|
51114
|
-
"ENOSPC",
|
|
51115
|
-
"EIO",
|
|
51116
|
-
"EROFS",
|
|
51117
|
-
"EACCES",
|
|
51118
|
-
"EPERM",
|
|
51119
|
-
"ENOTDIR"
|
|
51120
|
-
]);
|
|
51121
|
-
const isEnvironmentError = (error) => {
|
|
51122
|
-
if (!isNodeSystemError(error)) return false;
|
|
51123
|
-
if (error.code === "ENOENT") return error.syscall?.startsWith("spawn") ?? false;
|
|
51124
|
-
return error.code !== void 0 && ENVIRONMENT_ERROR_CODES.has(error.code);
|
|
51125
|
-
};
|
|
51126
|
-
const formatEnvironmentError = (error) => {
|
|
51127
|
-
if (!isNodeSystemError(error)) return error instanceof Error ? error.message : String(error);
|
|
51128
|
-
switch (error.code) {
|
|
51129
|
-
case "ENOSPC": return "No space left on device. Free up disk space and try again.";
|
|
51130
|
-
case "EIO": return "I/O error: the filesystem or disk may be failing. Check your system logs.";
|
|
51131
|
-
case "EROFS": return "Read-only filesystem: cannot write to this location.";
|
|
51132
|
-
case "EACCES":
|
|
51133
|
-
case "EPERM": return error.path ? `Permission denied accessing ${error.path}. Check file permissions and try again.` : "Permission denied. Check file permissions and try again.";
|
|
51134
|
-
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.";
|
|
51135
|
-
case "ENOENT": return "Required command not found. Ensure the tool (e.g. git) is installed and on your PATH.";
|
|
51136
|
-
default: return error.message;
|
|
51137
|
-
}
|
|
51138
|
-
};
|
|
51139
|
-
//#endregion
|
|
51140
51106
|
//#region src/cli/utils/handle-error.ts
|
|
51141
51107
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
51142
51108
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -51219,19 +51185,15 @@ const handleError = (error, options = {}) => {
|
|
|
51219
51185
|
process.exitCode = 1;
|
|
51220
51186
|
};
|
|
51221
51187
|
/**
|
|
51222
|
-
* Renderer for expected, user-actionable failures — a bad `--diff` value
|
|
51223
|
-
* a base branch that isn't fetched
|
|
51224
|
-
*
|
|
51225
|
-
*
|
|
51226
|
-
* — because there is no bug to report.
|
|
51188
|
+
* Renderer for expected, user-actionable failures — a bad `--diff` value or
|
|
51189
|
+
* a base branch that isn't fetched. Prints just the (already human-readable)
|
|
51190
|
+
* message — no "Something went wrong", prefilled issue, Discord link, or
|
|
51191
|
+
* Sentry reference — because there is no bug to report.
|
|
51227
51192
|
*/
|
|
51228
51193
|
const handleUserError = (error, options = {}) => {
|
|
51229
|
-
const isEnvError = isEnvironmentError(error);
|
|
51230
|
-
if (isEnvError) recordCount(METRIC.cliEnvironmentError, 1, { code: error.code ?? "unknown" });
|
|
51231
|
-
const message = isEnvError ? formatEnvironmentError(error) : formatErrorForReport(error);
|
|
51232
51194
|
runSync(gen(function* () {
|
|
51233
51195
|
yield* error$1("");
|
|
51234
|
-
yield* error$1(highlighter.error(
|
|
51196
|
+
yield* error$1(highlighter.error(formatErrorForReport(error)));
|
|
51235
51197
|
yield* error$1("");
|
|
51236
51198
|
}));
|
|
51237
51199
|
if (options.shouldExit !== false) process.exit(1);
|
|
@@ -51246,7 +51208,7 @@ const handleUserError = (error, options = {}) => {
|
|
|
51246
51208
|
* `handleUserError` (a plain message — no "Something went wrong", prefilled
|
|
51247
51209
|
* issue, Discord link, or Sentry reference), since there is no bug to report.
|
|
51248
51210
|
*
|
|
51249
|
-
*
|
|
51211
|
+
* Three distinct shapes reach the CLI's catch blocks:
|
|
51250
51212
|
*
|
|
51251
51213
|
* - **Project-discovery failures** (`NoReactDependencyError`,
|
|
51252
51214
|
* `ProjectNotFoundError`, `PackageJsonNotFoundError`, `NotADirectoryError`,
|
|
@@ -51259,19 +51221,12 @@ const handleUserError = (error, options = {}) => {
|
|
|
51259
51221
|
* `--project` name.
|
|
51260
51222
|
* - **Bad `--diff` input** (`GitBaseBranchInvalid` / `GitBaseBranchMissing`)
|
|
51261
51223
|
* stays the tagged `ReactDoctorError`, so dispatch on the reason `_tag`.
|
|
51262
|
-
* - **Environment failures** (`ENOSPC`, `EIO`, `EROFS`, `EACCES`, `EPERM`,
|
|
51263
|
-
* `ENOTDIR`, plus a `spawn`-scoped `ENOENT` for a missing binary) — disk
|
|
51264
|
-
* full / failing / read-only, permission denied, or a path blocked by a
|
|
51265
|
-
* file. React Doctor cannot fix the user's environment; exit cleanly with an
|
|
51266
|
-
* actionable message instead of crashing. See `is-environment-error.ts` for
|
|
51267
|
-
* why the set stays narrow (codes that usually mean our bug keep reaching
|
|
51268
|
-
* Sentry).
|
|
51269
51224
|
*
|
|
51270
51225
|
* This composes the existing core narrowers rather than introducing a new
|
|
51271
51226
|
* error-shape helper (AGENTS.md): it encodes CLI-layer reporting policy, not
|
|
51272
51227
|
* knowledge of the `ReactDoctorError` shape.
|
|
51273
51228
|
*/
|
|
51274
|
-
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) ||
|
|
51229
|
+
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) || isReactDoctorError(error) && (error.reason._tag === "GitBaseBranchInvalid" || error.reason._tag === "GitBaseBranchMissing");
|
|
51275
51230
|
//#endregion
|
|
51276
51231
|
//#region src/cli/utils/build-handoff-payload.ts
|
|
51277
51232
|
const buildHandoffPayload = (input) => {
|
|
@@ -55481,4 +55436,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
55481
55436
|
export {};
|
|
55482
55437
|
|
|
55483
55438
|
//# sourceMappingURL=cli.js.map
|
|
55484
|
-
//# 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";
|
|
@@ -33694,7 +33694,6 @@ const MILLISECONDS_PER_SECOND = 1e3;
|
|
|
33694
33694
|
const SCORE_API_URL = "https://www.react.doctor/api/score";
|
|
33695
33695
|
const FETCH_TIMEOUT_MS = 1e4;
|
|
33696
33696
|
const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
|
|
33697
|
-
const SPAWN_ARGS_MAX_LENGTH_CHARS = 24e3;
|
|
33698
33697
|
const PER_WORKER_MEM_BUDGET_BYTES = 1024 * 1024 * 1024;
|
|
33699
33698
|
const DEFAULT_BRANCH_CANDIDATES = ["main", "master"];
|
|
33700
33699
|
const ADOPTABLE_LINT_CONFIG_FILENAMES = [".oxlintrc.json", ".eslintrc.json"];
|
|
@@ -37873,46 +37872,43 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37873
37872
|
* reason: GitInvocationFailed })` so the rest of the codebase
|
|
37874
37873
|
* sees a single failure channel.
|
|
37875
37874
|
*/
|
|
37876
|
-
const runCommand = (input) => {
|
|
37877
|
-
const
|
|
37875
|
+
const runCommand = (input) => scoped(gen(function* () {
|
|
37876
|
+
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
37877
|
+
cwd: input.directory,
|
|
37878
|
+
env: input.env,
|
|
37879
|
+
extendEnv: true
|
|
37880
|
+
}));
|
|
37881
|
+
const maxStdoutBytes = input.maxStdoutBytes;
|
|
37882
|
+
const stdoutByteCount = yield* make$13(0);
|
|
37883
|
+
const [stdout, stderr, status] = yield* all([
|
|
37884
|
+
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37885
|
+
args: [...input.args],
|
|
37886
|
+
directory: input.directory,
|
|
37887
|
+
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
37888
|
+
}) })) : void_)))))),
|
|
37889
|
+
mkString(decodeText(handle.stderr)),
|
|
37890
|
+
handle.exitCode
|
|
37891
|
+
], { concurrency: 3 });
|
|
37892
|
+
return {
|
|
37893
|
+
status,
|
|
37894
|
+
stdout,
|
|
37895
|
+
stderr
|
|
37896
|
+
};
|
|
37897
|
+
})).pipe(catchTag$1("PlatformError", (cause) => {
|
|
37898
|
+
if (input.command !== "git") return succeed$2({
|
|
37878
37899
|
status: 127,
|
|
37879
37900
|
stdout: "",
|
|
37880
37901
|
stderr: String(cause)
|
|
37881
|
-
})
|
|
37902
|
+
});
|
|
37903
|
+
return new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37882
37904
|
args: [...input.args],
|
|
37883
37905
|
directory: input.directory,
|
|
37884
37906
|
cause
|
|
37885
|
-
}) })
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
37891
|
-
cwd: input.directory,
|
|
37892
|
-
env: input.env,
|
|
37893
|
-
extendEnv: true
|
|
37894
|
-
}));
|
|
37895
|
-
const maxStdoutBytes = input.maxStdoutBytes;
|
|
37896
|
-
const stdoutByteCount = yield* make$13(0);
|
|
37897
|
-
const [stdout, stderr, status] = yield* all([
|
|
37898
|
-
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37899
|
-
args: [...input.args],
|
|
37900
|
-
directory: input.directory,
|
|
37901
|
-
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
37902
|
-
}) })) : void_)))))),
|
|
37903
|
-
mkString(decodeText(handle.stderr)),
|
|
37904
|
-
handle.exitCode
|
|
37905
|
-
], { concurrency: 3 });
|
|
37906
|
-
return {
|
|
37907
|
-
status,
|
|
37908
|
-
stdout,
|
|
37909
|
-
stderr
|
|
37910
|
-
};
|
|
37911
|
-
})).pipe(catchTag$1("PlatformError", foldSpawnFailure), withSpan("git.exec", { attributes: {
|
|
37912
|
-
"git.command": input.command,
|
|
37913
|
-
"git.subcommand": input.args[0] ?? ""
|
|
37914
|
-
} }));
|
|
37915
|
-
};
|
|
37907
|
+
}) });
|
|
37908
|
+
}), withSpan("git.exec", { attributes: {
|
|
37909
|
+
"git.command": input.command,
|
|
37910
|
+
"git.subcommand": input.args[0] ?? ""
|
|
37911
|
+
} }));
|
|
37916
37912
|
const runGit = (directory, args) => runCommand({
|
|
37917
37913
|
command: "git",
|
|
37918
37914
|
args,
|
|
@@ -38159,7 +38155,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
38159
38155
|
]);
|
|
38160
38156
|
if (result.status !== 0) return null;
|
|
38161
38157
|
return parseChangedLineRanges(result.stdout);
|
|
38162
|
-
}).pipe(
|
|
38158
|
+
}).pipe(withSpan("Git.changedLineRanges"))
|
|
38163
38159
|
});
|
|
38164
38160
|
})).pipe(provide$2(layer$2.pipe(provide$2(mergeAll$1(layer$1, layer)))));
|
|
38165
38161
|
/**
|
|
@@ -41483,4 +41479,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
41483
41479
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
41484
41480
|
|
|
41485
41481
|
//# sourceMappingURL=index.js.map
|
|
41486
|
-
//# debugId=
|
|
41482
|
+
//# debugId=62d09923-e78d-5501-8799-859098af2aaa
|
package/dist/lsp.js
CHANGED
|
@@ -33730,7 +33730,6 @@ const MILLISECONDS_PER_SECOND = 1e3;
|
|
|
33730
33730
|
const SCORE_API_URL = "https://www.react.doctor/api/score";
|
|
33731
33731
|
const FETCH_TIMEOUT_MS = 1e4;
|
|
33732
33732
|
const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
|
|
33733
|
-
const SPAWN_ARGS_MAX_LENGTH_CHARS = 24e3;
|
|
33734
33733
|
const PER_WORKER_MEM_BUDGET_BYTES = 1024 * 1024 * 1024;
|
|
33735
33734
|
const DEFAULT_BRANCH_CANDIDATES = ["main", "master"];
|
|
33736
33735
|
const ADOPTABLE_LINT_CONFIG_FILENAMES = [".oxlintrc.json", ".eslintrc.json"];
|
|
@@ -37858,46 +37857,43 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
37858
37857
|
* reason: GitInvocationFailed })` so the rest of the codebase
|
|
37859
37858
|
* sees a single failure channel.
|
|
37860
37859
|
*/
|
|
37861
|
-
const runCommand = (input) => {
|
|
37862
|
-
const
|
|
37860
|
+
const runCommand = (input) => scoped(gen(function* () {
|
|
37861
|
+
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
37862
|
+
cwd: input.directory,
|
|
37863
|
+
env: input.env,
|
|
37864
|
+
extendEnv: true
|
|
37865
|
+
}));
|
|
37866
|
+
const maxStdoutBytes = input.maxStdoutBytes;
|
|
37867
|
+
const stdoutByteCount = yield* make$13(0);
|
|
37868
|
+
const [stdout, stderr, status] = yield* all([
|
|
37869
|
+
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37870
|
+
args: [...input.args],
|
|
37871
|
+
directory: input.directory,
|
|
37872
|
+
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
37873
|
+
}) })) : void_)))))),
|
|
37874
|
+
mkString(decodeText(handle.stderr)),
|
|
37875
|
+
handle.exitCode
|
|
37876
|
+
], { concurrency: 3 });
|
|
37877
|
+
return {
|
|
37878
|
+
status,
|
|
37879
|
+
stdout,
|
|
37880
|
+
stderr
|
|
37881
|
+
};
|
|
37882
|
+
})).pipe(catchTag$1("PlatformError", (cause) => {
|
|
37883
|
+
if (input.command !== "git") return succeed$2({
|
|
37863
37884
|
status: 127,
|
|
37864
37885
|
stdout: "",
|
|
37865
37886
|
stderr: String(cause)
|
|
37866
|
-
})
|
|
37887
|
+
});
|
|
37888
|
+
return new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37867
37889
|
args: [...input.args],
|
|
37868
37890
|
directory: input.directory,
|
|
37869
37891
|
cause
|
|
37870
|
-
}) })
|
|
37871
|
-
|
|
37872
|
-
|
|
37873
|
-
|
|
37874
|
-
|
|
37875
|
-
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
37876
|
-
cwd: input.directory,
|
|
37877
|
-
env: input.env,
|
|
37878
|
-
extendEnv: true
|
|
37879
|
-
}));
|
|
37880
|
-
const maxStdoutBytes = input.maxStdoutBytes;
|
|
37881
|
-
const stdoutByteCount = yield* make$13(0);
|
|
37882
|
-
const [stdout, stderr, status] = yield* all([
|
|
37883
|
-
mkString(decodeText(maxStdoutBytes === void 0 ? handle.stdout : handle.stdout.pipe(tap((chunk) => updateAndGet(stdoutByteCount, (total) => total + chunk.length).pipe(flatMap$2((total) => total > maxStdoutBytes ? fail$4(new ReactDoctorError({ reason: new GitInvocationFailed({
|
|
37884
|
-
args: [...input.args],
|
|
37885
|
-
directory: input.directory,
|
|
37886
|
-
cause: /* @__PURE__ */ new Error(`git stdout exceeded ${maxStdoutBytes} bytes`)
|
|
37887
|
-
}) })) : void_)))))),
|
|
37888
|
-
mkString(decodeText(handle.stderr)),
|
|
37889
|
-
handle.exitCode
|
|
37890
|
-
], { concurrency: 3 });
|
|
37891
|
-
return {
|
|
37892
|
-
status,
|
|
37893
|
-
stdout,
|
|
37894
|
-
stderr
|
|
37895
|
-
};
|
|
37896
|
-
})).pipe(catchTag$1("PlatformError", foldSpawnFailure), withSpan("git.exec", { attributes: {
|
|
37897
|
-
"git.command": input.command,
|
|
37898
|
-
"git.subcommand": input.args[0] ?? ""
|
|
37899
|
-
} }));
|
|
37900
|
-
};
|
|
37892
|
+
}) });
|
|
37893
|
+
}), withSpan("git.exec", { attributes: {
|
|
37894
|
+
"git.command": input.command,
|
|
37895
|
+
"git.subcommand": input.args[0] ?? ""
|
|
37896
|
+
} }));
|
|
37901
37897
|
const runGit = (directory, args) => runCommand({
|
|
37902
37898
|
command: "git",
|
|
37903
37899
|
args,
|
|
@@ -38144,7 +38140,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
38144
38140
|
]);
|
|
38145
38141
|
if (result.status !== 0) return null;
|
|
38146
38142
|
return parseChangedLineRanges(result.stdout);
|
|
38147
|
-
}).pipe(
|
|
38143
|
+
}).pipe(withSpan("Git.changedLineRanges"))
|
|
38148
38144
|
});
|
|
38149
38145
|
})).pipe(provide$2(layer$2.pipe(provide$2(mergeAll$1(layer$1, layer)))));
|
|
38150
38146
|
/**
|
|
@@ -42917,7 +42913,6 @@ const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
|
42917
42913
|
const METRIC = {
|
|
42918
42914
|
cliInvoked: "cli.invoked",
|
|
42919
42915
|
cliError: "cli.error",
|
|
42920
|
-
cliEnvironmentError: "cli.env_error",
|
|
42921
42916
|
projectDetected: "project.detected",
|
|
42922
42917
|
projectPathSelected: "project.path_selected",
|
|
42923
42918
|
projectConfigSelected: "project.config_selected",
|
|
@@ -43264,5 +43259,5 @@ const startLanguageServer = () => {
|
|
|
43264
43259
|
};
|
|
43265
43260
|
//#endregion
|
|
43266
43261
|
export { startLanguageServer };
|
|
43267
|
-
!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]="
|
|
43268
|
-
//# 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",
|
|
@@ -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.5f2bd72"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@xterm/headless": "^6.0.0",
|
|
73
73
|
"commander": "^14.0.3",
|
|
74
74
|
"ora": "^9.4.0",
|
|
75
|
-
"@react-doctor/core": "0.5.8",
|
|
76
75
|
"@react-doctor/api": "0.5.8",
|
|
76
|
+
"@react-doctor/core": "0.5.8",
|
|
77
77
|
"@react-doctor/language-server": "0.5.8"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|