react-doctor 0.9.12-dev.ffc2d14 → 0.9.13-dev.d030b11
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/README.md +33 -0
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-BuOtLrzK.js → build-section-divider-Dhl7C8kp.js} +8 -22
- package/dist/{ci-DVVsf25h.js → ci-CPJtbXo4.js} +12 -11
- package/dist/cli.js +116 -35
- package/dist/{design-Y1pcA2uj.js → design-CI6oM-NB.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DnXGONjj.js → exit-gracefully-Zhbpfy2i.js} +15 -9
- package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
- package/dist/{report-error-MGKyeIns.js → handle-error-LYTGcmFr.js} +18 -68
- package/dist/index.d.ts +32 -0
- package/dist/index.js +593 -286
- package/dist/{inspect-g3_lzs3l.js → inspect-BZ-i49rK.js} +38 -28
- package/dist/{install-02Lq6wKC.js → install-Cf-tjrbB.js} +9 -8
- package/dist/{install-doctor-script-DmEWQpVJ.js → install-doctor-script-BGdm_niA.js} +7 -449
- package/dist/{install-github-workflow-Dx6Pl9Wl.js → install-github-workflow-CwcDLQCy.js} +10 -6
- package/dist/{install-react-doctor-CMCXgenA.js → install-react-doctor-DcJ90NzQ.js} +8 -8
- package/dist/{run-scan-app-CDDu7P32.js → jsx-runtime-Cq-_Fvkx.js} +280 -2774
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-kbvWYuGv.js → print-branded-header-DM0JRJnn.js} +4 -4
- package/dist/project-analysis-worker.js +59 -54
- package/dist/prompt-runtime-scan-url-BpHApg0d.js +240 -0
- package/dist/{read-object-file-Cwhr9OIi.js → read-object-file-DMUSluLA.js} +4 -4
- package/dist/{record-metric-CFfsgcVs.js → record-metric-BRc98SXW.js} +556 -235
- package/dist/report-error-BpWTkd5U.js +64 -0
- package/dist/{report-workflow-result-DGg9xopH.js → report-workflow-result-DXSpYstq.js} +5 -5
- package/dist/{resolve-scope-CXS-5jLR.js → resolve-scope-CJXv5ePP.js} +8 -10
- package/dist/{rules-CThlosPx.js → rules-CZk5ywQe.js} +6 -6
- package/dist/run-scan-app-BtY0jXpd.js +2511 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-iztAEKV3.js +770 -0
- package/dist/sanitize-runtime-url-DbrHDuC1.js +76 -0
- package/dist/scan-GPvogJT-.js +47 -0
- package/dist/{should-fail-scan-gate-C0Bo5Gqy.js → should-fail-scan-gate-Uk7rJiMQ.js} +20 -112
- package/dist/{should-skip-prompts-BqrtVX4G.js → should-skip-prompts-DzpvkZcL.js} +4 -4
- package/dist/should-use-tui-CH5oI2Vu.js +25 -0
- package/dist/skills/improve-threejs/SKILL.md +102 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-BxyvqsOy.js → telemetry-runtime-hAsPFFEx.js} +55 -25
- package/dist/unref-stdin-SK3WfwxS.js +12 -0
- package/dist/{version-S-8vvWFi.js → version-BiWDQQgs.js} +4 -4
- package/dist/{why-DXfx0oL9.js → why-B8sLOroq.js} +4 -4
- package/dist/with-run-span-BWmpgEhA.js +110 -0
- package/package.json +9 -6
- package/dist/scan-4I1mvxBO.js +0 -53
|
@@ -1,6 +1,6 @@
|
|
|
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]="
|
|
3
|
-
import {
|
|
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]="b824371a-8ecd-5990-9b33-5fdf5feb5168")}catch(e){}}();
|
|
3
|
+
import { $t as layerObservability, Cr as messageFromUnknown, Jn as makeUnsafe, Rn as runPromise, Un as buildWithScope, Xn as void_, Xt as isReactDoctorError, Yt as isProjectDiscoveryError, _ as VERSION, br as isErrnoException, i as isTelemetryEnabled, kn as make, qn as close, z as CliInputError, zn as runSync } from "./record-metric-BRc98SXW.js";
|
|
4
4
|
//#region src/cli/utils/is-environment-error.ts
|
|
5
5
|
const ENVIRONMENT_ERROR_CODES = new Set([
|
|
6
6
|
"EACCES",
|
|
@@ -61,6 +61,51 @@ const formatEnvironmentError = (error) => {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
//#endregion
|
|
64
|
+
//#region src/cli/utils/is-npm-cache-corruption-error.ts
|
|
65
|
+
const MISSING_AJV_META_SCHEMA_MESSAGES = new Set(["Cannot find module './meta/unevaluated.json'", "Cannot find module './meta/validation.json'"]);
|
|
66
|
+
const NPX_AJV_META_SCHEMA_REQUIRE_PATH_PATTERN = /(?:^|\/)_npx\/(?<cacheKey>[a-f0-9]{16})\/node_modules\/ajv\/dist\/refs\/json-schema-2020-12\/index\.js$/;
|
|
67
|
+
const isModuleNotFoundError = (error) => error instanceof Error && "code" in error && error.code === "MODULE_NOT_FOUND";
|
|
68
|
+
const findNpmCacheCorruptionError = (error) => {
|
|
69
|
+
const pendingErrors = [error];
|
|
70
|
+
const visitedErrors = /* @__PURE__ */ new Set();
|
|
71
|
+
while (pendingErrors.length > 0) {
|
|
72
|
+
const currentError = pendingErrors.pop();
|
|
73
|
+
if (typeof currentError !== "object" || currentError === null) continue;
|
|
74
|
+
if (visitedErrors.has(currentError)) continue;
|
|
75
|
+
visitedErrors.add(currentError);
|
|
76
|
+
if (isModuleNotFoundError(currentError)) {
|
|
77
|
+
const [message] = currentError.message.split("\n");
|
|
78
|
+
if (message && MISSING_AJV_META_SCHEMA_MESSAGES.has(message)) {
|
|
79
|
+
const requireStack = Array.isArray(currentError.requireStack) ? currentError.requireStack : [];
|
|
80
|
+
for (const requirePath of requireStack) {
|
|
81
|
+
if (typeof requirePath !== "string") continue;
|
|
82
|
+
const cacheKey = requirePath.replaceAll("\\", "/").match(NPX_AJV_META_SCHEMA_REQUIRE_PATH_PATTERN)?.groups?.cacheKey;
|
|
83
|
+
if (cacheKey !== void 0) return {
|
|
84
|
+
cacheKey,
|
|
85
|
+
moduleNotFoundError: currentError
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (currentError instanceof Error && currentError.cause !== void 0) pendingErrors.push(currentError.cause);
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
};
|
|
94
|
+
const isNpmCacheCorruptionError = (error) => findNpmCacheCorruptionError(error) !== null;
|
|
95
|
+
const formatNpmCacheCorruptionError = (error) => {
|
|
96
|
+
const corruptionMatch = findNpmCacheCorruptionError(error);
|
|
97
|
+
if (!corruptionMatch) return messageFromUnknown(error);
|
|
98
|
+
return [
|
|
99
|
+
"The npx cache has an incomplete Ajv installation.",
|
|
100
|
+
"",
|
|
101
|
+
"Remove this cache entry, then run React Doctor again:",
|
|
102
|
+
` npm cache npx rm ${corruptionMatch.cacheKey}`,
|
|
103
|
+
" npx react-doctor@latest",
|
|
104
|
+
"",
|
|
105
|
+
`Original error: ${corruptionMatch.moduleNotFoundError.message}`
|
|
106
|
+
].join("\n");
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
64
109
|
//#region src/cli/utils/is-expected-user-error.ts
|
|
65
110
|
/**
|
|
66
111
|
* Whether `error` is an expected, user-actionable failure — the user's project
|
|
@@ -69,7 +114,7 @@ const formatEnvironmentError = (error) => {
|
|
|
69
114
|
* `handleUserError` (a plain message — no "Something went wrong", prefilled
|
|
70
115
|
* issue, Discord link, or Sentry reference), since there is no bug to report.
|
|
71
116
|
*
|
|
72
|
-
*
|
|
117
|
+
* Five distinct shapes reach the CLI's catch blocks:
|
|
73
118
|
*
|
|
74
119
|
* - **Project-discovery failures** (`NoReactDependencyError`,
|
|
75
120
|
* `ProjectNotFoundError`, `PackageJsonNotFoundError`, `NotADirectoryError`,
|
|
@@ -89,12 +134,15 @@ const formatEnvironmentError = (error) => {
|
|
|
89
134
|
* actionable message instead of crashing. See `is-environment-error.ts` for
|
|
90
135
|
* why the set stays narrow (codes that usually mean our bug keep reaching
|
|
91
136
|
* Sentry).
|
|
137
|
+
* - **npm cache corruption** (missing Ajv meta-schema files inside `_npx`) —
|
|
138
|
+
* an incomplete npx package installation that the user can remove and
|
|
139
|
+
* reinstall.
|
|
92
140
|
*
|
|
93
141
|
* This composes the existing core narrowers rather than introducing a new
|
|
94
142
|
* error-shape helper (AGENTS.md): it encodes CLI-layer reporting policy, not
|
|
95
143
|
* knowledge of the `ReactDoctorError` shape.
|
|
96
144
|
*/
|
|
97
|
-
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) || isEnvironmentError(error) || isReactDoctorError(error) && (error.reason._tag === "GitBaseBranchInvalid" || error.reason._tag === "GitBaseBranchMissing");
|
|
145
|
+
const isExpectedUserError = (error) => error instanceof CliInputError || isProjectDiscoveryError(error) || isEnvironmentError(error) || isNpmCacheCorruptionError(error) || isReactDoctorError(error) && (error.reason._tag === "GitBaseBranchInvalid" || error.reason._tag === "GitBaseBranchMissing");
|
|
98
146
|
//#endregion
|
|
99
147
|
//#region src/cli/utils/resolve-axiom-telemetry-options.ts
|
|
100
148
|
/**
|
|
@@ -197,25 +245,7 @@ const shutdownTelemetry = async () => {
|
|
|
197
245
|
return pendingShutdown;
|
|
198
246
|
};
|
|
199
247
|
//#endregion
|
|
200
|
-
|
|
201
|
-
let activeRunTrace = null;
|
|
202
|
-
const setActiveRunTrace = (trace) => {
|
|
203
|
-
activeRunTrace = trace;
|
|
204
|
-
};
|
|
205
|
-
const getActiveRunTrace = () => activeRunTrace;
|
|
206
|
-
let lastRunTraceId = null;
|
|
207
|
-
const recordRunTraceId = (traceId) => {
|
|
208
|
-
lastRunTraceId = traceId;
|
|
209
|
-
};
|
|
210
|
-
const getLastRunTraceId = () => lastRunTraceId;
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/cli/utils/unref-stdin.ts
|
|
213
|
-
const unrefStdin = () => {
|
|
214
|
-
if (process.stdin.isTTY) return;
|
|
215
|
-
process.stdin.unref?.();
|
|
216
|
-
};
|
|
217
|
-
//#endregion
|
|
218
|
-
export { setActiveRunTrace as a, isExpectedUserError as c, recordRunTraceId as i, formatEnvironmentError as l, getActiveRunTrace as n, getTelemetryContext as o, getLastRunTraceId as r, shutdownTelemetry as s, unrefStdin as t, isEnvironmentError as u };
|
|
248
|
+
export { isNpmCacheCorruptionError as a, formatNpmCacheCorruptionError as i, shutdownTelemetry as n, formatEnvironmentError as o, isExpectedUserError as r, isEnvironmentError as s, getTelemetryContext as t };
|
|
219
249
|
|
|
220
|
-
//# sourceMappingURL=
|
|
221
|
-
//# debugId=
|
|
250
|
+
//# sourceMappingURL=telemetry-runtime-hAsPFFEx.js.map
|
|
251
|
+
//# debugId=b824371a-8ecd-5990-9b33-5fdf5feb5168
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/cli/utils/unref-stdin.ts
|
|
2
|
+
|
|
3
|
+
!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]="8f48a2ed-e79f-5438-90a2-8ef096b5fd64")}catch(e){}}();
|
|
4
|
+
const unrefStdin = () => {
|
|
5
|
+
if (process.stdin.isTTY) return;
|
|
6
|
+
process.stdin.unref?.();
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { unrefStdin as t };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=unref-stdin-SK3WfwxS.js.map
|
|
12
|
+
//# debugId=8f48a2ed-e79f-5438-90a2-8ef096b5fd64
|
|
@@ -1,6 +1,6 @@
|
|
|
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]="
|
|
3
|
-
import {
|
|
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]="6bf87c94-f918-500b-8ac0-da6f0c4c61a9")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-BRc98SXW.js";
|
|
4
4
|
//#region src/cli/commands/version.ts
|
|
5
5
|
/**
|
|
6
6
|
* oclif-style version line. 12-factor CLI Apps (#3, "What version am I
|
|
@@ -17,5 +17,5 @@ const versionAction = () => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { versionAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=version-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=version-BiWDQQgs.js.map
|
|
21
|
+
//# debugId=6bf87c94-f918-500b-8ac0-da6f0c4c61a9
|
|
@@ -1,6 +1,6 @@
|
|
|
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]="
|
|
3
|
-
import { t as inspectAction } from "./inspect-
|
|
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]="c6c61d23-0133-5dfa-8c42-9fe2484e5cd3")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-BZ-i49rK.js";
|
|
4
4
|
//#region src/cli/commands/why.ts
|
|
5
5
|
/**
|
|
6
6
|
* `why <file:line>` — explains why a rule fired (or why a suppression didn't
|
|
@@ -17,5 +17,5 @@ const whyAction = async (location, options) => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { whyAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=why-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=why-B8sLOroq.js.map
|
|
21
|
+
//# debugId=c6c61d23-0133-5dfa-8c42-9fe2484e5cd3
|
|
@@ -0,0 +1,110 @@
|
|
|
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]="0e4a0091-a5d8-5683-85fa-9b96cb60efdc")}catch(e){}}();
|
|
3
|
+
import { D as NANOSECONDS_PER_MILLISECOND, In as provideContext, Xn as void_, Yn as fail, c as setSentryProjectInfo, jn as makeSpan, o as buildSentryScope, r as toSpanAttributes, s as buildSentryProjectContext, zn as runSync } from "./record-metric-BRc98SXW.js";
|
|
4
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-hAsPFFEx.js";
|
|
5
|
+
import { i as setActiveRunTrace, r as recordRunTraceId } from "./active-run-trace-dlIZeEvb.js";
|
|
6
|
+
//#region src/cli/utils/with-run-span.ts
|
|
7
|
+
/**
|
|
8
|
+
* Ends the run span without letting a telemetry failure change the run's
|
|
9
|
+
* outcome — the invariant every other emit site here already holds.
|
|
10
|
+
*
|
|
11
|
+
* The failure path is the reason this matters most: a throw from `end` there
|
|
12
|
+
* would replace the user's original scan error, so a project-config mistake
|
|
13
|
+
* could surface as an exporter stack trace, be reclassified as a crash, and get
|
|
14
|
+
* reported as one.
|
|
15
|
+
*/
|
|
16
|
+
const endSpanSafely = (span, exit) => {
|
|
17
|
+
try {
|
|
18
|
+
span.end(BigInt(Date.now()) * NANOSECONDS_PER_MILLISECOND, exit);
|
|
19
|
+
} catch {}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Clears the module-level run-scoped telemetry state — the current scanned
|
|
23
|
+
* project and the active run trace. `inspect()` calls this at the start of every
|
|
24
|
+
* run and again after a clean one, so a prior or just-finished scan can't attach
|
|
25
|
+
* its project tags / trace to a later run or to a non-scan error (e.g.
|
|
26
|
+
* inspectAction's post-loop finalize/handoff steps). A thrown scan error skips
|
|
27
|
+
* the post-run reset, leaving the state for the command catch to attribute and
|
|
28
|
+
* link the crash. Concurrent batch members (`concurrentScan`) never touch this
|
|
29
|
+
* state — they neither write nor reset it. Safe to call when telemetry is off
|
|
30
|
+
* (the refs are read only when an event is built).
|
|
31
|
+
*/
|
|
32
|
+
const resetSentryRunState = () => {
|
|
33
|
+
setSentryProjectInfo(null);
|
|
34
|
+
setActiveRunTrace(null);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Runs an inspect invocation inside a root span so each `react-doctor` run is a
|
|
38
|
+
* first-class trace with timing and the run snapshot as attributes. The span is
|
|
39
|
+
* handed to `run` so the scan's Effect spans parent under it and so the wide
|
|
40
|
+
* event can be stamped onto it once the outcome is known.
|
|
41
|
+
*
|
|
42
|
+
* A no-op pass-through when telemetry is off (`--no-telemetry`, tests, or an
|
|
43
|
+
* unconfigured build) — `run` receives `undefined` and no span is created, so
|
|
44
|
+
* there's no added exit latency.
|
|
45
|
+
*
|
|
46
|
+
* The span is created against the shared telemetry context rather than a
|
|
47
|
+
* freshly-provided layer, so it lives in the same tracer as the scan program's
|
|
48
|
+
* spans; see `telemetry-runtime.ts` for why that matters. It is started and
|
|
49
|
+
* ended manually because the body it wraps is a promise-returning imperative
|
|
50
|
+
* function, not an Effect — the same shape the Sentry inactive span had.
|
|
51
|
+
*
|
|
52
|
+
* While the span runs, its trace context is recorded as the active run trace so
|
|
53
|
+
* `reportErrorToSentry` can attach a crash thrown during the scan back to this
|
|
54
|
+
* trace (errors surface in the command catch, after the span has ended).
|
|
55
|
+
*
|
|
56
|
+
* A `concurrentScan` (one member of the CLI's multi-project pool) still gets its
|
|
57
|
+
* own root span, but skips recording the active run trace — the module-level
|
|
58
|
+
* handle has single-scan semantics, and overlapping writers would link a crash
|
|
59
|
+
* to an arbitrary sibling's trace.
|
|
60
|
+
*/
|
|
61
|
+
const withRunSpan = async (run, options = {}) => {
|
|
62
|
+
const telemetryContext = getTelemetryContext();
|
|
63
|
+
if (telemetryContext === null) return run(void 0);
|
|
64
|
+
const { tags } = buildSentryScope();
|
|
65
|
+
const command = typeof tags.command === "string" ? tags.command : "inspect";
|
|
66
|
+
let rootSpan;
|
|
67
|
+
try {
|
|
68
|
+
rootSpan = runSync(makeSpan(`react-doctor ${command}`, { attributes: toSpanAttributes(tags) }).pipe(provideContext(telemetryContext)));
|
|
69
|
+
} catch {
|
|
70
|
+
return run(void 0);
|
|
71
|
+
}
|
|
72
|
+
recordRunTraceId(rootSpan.traceId);
|
|
73
|
+
if (options.concurrentScan !== true) setActiveRunTrace({
|
|
74
|
+
traceId: rootSpan.traceId,
|
|
75
|
+
spanId: rootSpan.spanId,
|
|
76
|
+
sampled: rootSpan.sampled
|
|
77
|
+
});
|
|
78
|
+
try {
|
|
79
|
+
const result = await run(rootSpan);
|
|
80
|
+
endSpanSafely(rootSpan, void_);
|
|
81
|
+
return result;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
endSpanSafely(rootSpan, fail(options.mapErrorForSpan?.(error) ?? error));
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Records the scanned project (discovered in the `beforeLint` hook): remembers
|
|
89
|
+
* it for the lazy Sentry error-capture path (`buildSentryScope` folds it into
|
|
90
|
+
* exception events) and for per-emit metric attributes, and sets it on the run's
|
|
91
|
+
* root span so the trace carries the project shape too. Always cheap — the span
|
|
92
|
+
* attributes are skipped when `rootSpan` is absent (telemetry off), and storing
|
|
93
|
+
* the info is a plain assignment.
|
|
94
|
+
*
|
|
95
|
+
* A `concurrentScan` only sets the span attributes: the module-level project ref
|
|
96
|
+
* has single-scan semantics, and overlapping writers would stamp events and
|
|
97
|
+
* metrics with an arbitrary sibling's project. Wide events keep full attribution
|
|
98
|
+
* (they ride the span); per-emit metrics simply omit the project shape during a
|
|
99
|
+
* concurrent batch (absent, never wrong).
|
|
100
|
+
*/
|
|
101
|
+
const recordSentryProjectContext = (projectInfo, rootSpan, options = {}) => {
|
|
102
|
+
if (options.concurrentScan !== true) setSentryProjectInfo(projectInfo);
|
|
103
|
+
if (rootSpan === void 0) return;
|
|
104
|
+
for (const [key, value] of Object.entries(toSpanAttributes(buildSentryProjectContext(projectInfo).tags))) rootSpan.attribute(key, value);
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { resetSentryRunState as n, withRunSpan as r, recordSentryProjectContext as t };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=with-run-span-BWmpgEhA.js.map
|
|
110
|
+
//# debugId=0e4a0091-a5d8-5683-85fa-9b96cb60efdc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.13-dev.d030b11",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -53,19 +53,22 @@
|
|
|
53
53
|
"@astrojs/compiler": "^4.0.0",
|
|
54
54
|
"@sentry/node": "^10.54.0",
|
|
55
55
|
"agent-install": "0.0.5",
|
|
56
|
+
"bippy": "^0.6.1",
|
|
56
57
|
"conf": "^15.1.0",
|
|
57
58
|
"confbox": "^0.2.4",
|
|
58
59
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
60
|
+
"is-unicode-supported": "^2.1.0",
|
|
59
61
|
"jiti": "^2.7.0",
|
|
60
62
|
"magicast": "^0.5.3",
|
|
61
|
-
"oxc-parser": "^0.
|
|
63
|
+
"oxc-parser": "^0.146.0",
|
|
62
64
|
"oxc-resolver": "^11.24.2",
|
|
63
|
-
"oxlint": ">=1.
|
|
65
|
+
"oxlint": ">=1.79.0 <1.80.0",
|
|
66
|
+
"playwright-core": "^1.62.1",
|
|
64
67
|
"prompts": "^2.4.2",
|
|
65
68
|
"typescript": ">=5.0.4 <6",
|
|
66
69
|
"yaml": "^2.9.0",
|
|
67
70
|
"yoga-layout": "~3.2.1",
|
|
68
|
-
"oxlint-plugin-react-doctor": "0.9.
|
|
71
|
+
"oxlint-plugin-react-doctor": "0.9.13-dev.d030b11"
|
|
69
72
|
},
|
|
70
73
|
"devDependencies": {
|
|
71
74
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -78,8 +81,8 @@
|
|
|
78
81
|
"ora": "^9.4.0",
|
|
79
82
|
"react": "19.2.5",
|
|
80
83
|
"react-devtools-core": "^7.0.1",
|
|
81
|
-
"@react-doctor/
|
|
82
|
-
"@react-doctor/
|
|
84
|
+
"@react-doctor/api": "0.9.13",
|
|
85
|
+
"@react-doctor/core": "0.9.13"
|
|
83
86
|
},
|
|
84
87
|
"engines": {
|
|
85
88
|
"node": "^20.19.0 || >=22.13.0"
|
package/dist/scan-4I1mvxBO.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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]="51399d27-1dd4-55db-9fa5-7f925bd3ec8f")}catch(e){}}();
|
|
3
|
-
import { dn as resolveScanTarget, t as recordCount, w as METRIC, z as isNonInteractiveEnvironment } from "./record-metric-CFfsgcVs.js";
|
|
4
|
-
import { i as warnDeprecatedDiff } from "./resolve-scope-CXS-5jLR.js";
|
|
5
|
-
import { _ as resolveCliInspectOptions, i as validateModeFlags } from "./should-fail-scan-gate-C0Bo5Gqy.js";
|
|
6
|
-
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-g3_lzs3l.js";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
//#region src/cli/utils/should-use-tui.ts
|
|
9
|
-
const shouldUseTui = (input) => {
|
|
10
|
-
if (input.isNonInteractiveEnvironment || !input.stdinIsTty || !input.stdoutIsTty || !input.supportsRawMode || input.nodeMajorVersion < 22 || input.terminalName === "dumb") return false;
|
|
11
|
-
const flags = input.flags;
|
|
12
|
-
return !(flags.score === true || flags.json === true || flags.jsonCompact === true || flags.jsonOut !== void 0 || flags.staged === true || flags.changedFilesFrom !== void 0);
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/cli/commands/scan.ts
|
|
16
|
-
const runScanCommand = async (input) => {
|
|
17
|
-
if (input.flags.cache === false) process.env.REACT_DOCTOR_NO_CACHE = "1";
|
|
18
|
-
const nodeMajorVersion = Number(process.versions.node.split(".")[0]);
|
|
19
|
-
if (!shouldUseTui({
|
|
20
|
-
flags: input.flags,
|
|
21
|
-
isNonInteractiveEnvironment: isNonInteractiveEnvironment(),
|
|
22
|
-
nodeMajorVersion,
|
|
23
|
-
stdinIsTty: process.stdin.isTTY === true,
|
|
24
|
-
stdoutIsTty: process.stdout.isTTY === true,
|
|
25
|
-
supportsRawMode: typeof process.stdin.setRawMode === "function",
|
|
26
|
-
terminalName: process.env.TERM
|
|
27
|
-
})) {
|
|
28
|
-
await inspectAction(input.directory, input.flags, input.invocationCommand);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
await runProjectMigrations(path.resolve(input.directory));
|
|
32
|
-
const scanTarget = await resolveScanTarget(input.directory, { allowAmbiguous: true });
|
|
33
|
-
validateModeFlags(input.flags);
|
|
34
|
-
warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
|
|
35
|
-
warnDeprecatedDiff(input.flags, scanTarget.userConfig);
|
|
36
|
-
recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
|
|
37
|
-
const { runScanApp } = await import("./run-scan-app-CDDu7P32.js");
|
|
38
|
-
const { shouldFail } = await runScanApp({
|
|
39
|
-
directory: input.directory,
|
|
40
|
-
scanTarget,
|
|
41
|
-
options: resolveCliInspectOptions(input.flags, null),
|
|
42
|
-
projectFlag: input.flags.project,
|
|
43
|
-
skipPrompts: input.flags.yes ?? false,
|
|
44
|
-
blocking: input.flags.blocking ?? input.flags.failOn,
|
|
45
|
-
flags: input.flags
|
|
46
|
-
});
|
|
47
|
-
if (shouldFail) process.exitCode = 1;
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
50
|
-
export { runScanCommand };
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=scan-4I1mvxBO.js.map
|
|
53
|
-
//# debugId=51399d27-1dd4-55db-9fa5-7f925bd3ec8f
|