react-doctor 0.9.12-dev.0b670aa → 0.9.12-dev.1d3e4a6
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 +27 -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-CJ7k-BvF.js → build-section-divider-8MOZLIsm.js} +8 -22
- package/dist/{ci-Dannv-cF.js → ci-BkncxruQ.js} +12 -11
- package/dist/cli.js +76 -24
- package/dist/{design-9x5DReyL.js → design-cWsjx19m.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
- package/dist/{exit-gracefully-ti2wONpM.js → exit-gracefully-B9tEGAKH.js} +15 -9
- package/dist/get-east-asian-width-Cglw13G7.js +444 -0
- package/dist/{report-error-BlOAg03W.js → handle-error-wbMFUdUK.js} +6 -61
- package/dist/index.d.ts +34 -2
- package/dist/index.js +334 -205
- package/dist/{inspect-C3itFiEW.js → inspect-Bz2rayph.js} +17 -16
- package/dist/{install-CjIJL6S5.js → install-DdckCi3Z.js} +9 -8
- package/dist/{install-doctor-script-0sdZ4SY8.js → install-doctor-script-jOg4qbkK.js} +7 -449
- package/dist/{install-github-workflow-DQ8_lhAW.js → install-github-workflow-C5OkC7nA.js} +6 -6
- package/dist/{install-react-doctor-DRG8hdL4.js → install-react-doctor-W8P-PVpX.js} +8 -8
- package/dist/{run-scan-app-Cgn4ELJF.js → jsx-runtime-0eiF0jis.js} +280 -2769
- package/dist/{print-branded-header-Dc1KdrcV.js → print-branded-header-_cUJmAUD.js} +4 -4
- package/dist/project-analysis-worker.js +3 -3
- package/dist/prompt-runtime-scan-url-CV2AUqdk.js +240 -0
- package/dist/{read-object-file-rblJxHxN.js → read-object-file-DOfcpaZX.js} +4 -4
- package/dist/{record-metric-Dgg2b2LG.js → record-metric-BA5ry-7d.js} +338 -188
- package/dist/report-error-CFe3r9gh.js +64 -0
- package/dist/{report-workflow-result-Dp4dCUxw.js → report-workflow-result-BoDN1Z77.js} +5 -5
- package/dist/{resolve-scope-CbeXgE9z.js → resolve-scope-BVNh_icv.js} +6 -6
- package/dist/{rules-ClDrNCc3.js → rules-CyIHtrnI.js} +6 -6
- package/dist/run-scan-app-BhUlnxaV.js +2509 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-CUt6T5J3.js +770 -0
- package/dist/sanitize-runtime-url-CWANxE3L.js +76 -0
- package/dist/{scan-Caa_ogFB.js → scan-DU_zcchs.js} +10 -22
- package/dist/{should-fail-scan-gate-BGzNJApW.js → should-fail-scan-gate-CDwqCAPq.js} +23 -114
- package/dist/{should-skip-prompts-Bbl0ToUI.js → should-skip-prompts-B9za5uX9.js} +4 -4
- package/dist/should-use-tui-BR82qmYC.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-C7d7_3va.js → telemetry-runtime-C9dZxrK_.js} +5 -23
- package/dist/unref-stdin-BKT_s38a.js +12 -0
- package/dist/{version-Bjql-CLM.js → version-yw_bHX_4.js} +4 -4
- package/dist/{why-BqG2EML8.js → why-CdGev87Z.js} +4 -4
- package/dist/with-run-span-CCVNobt7.js +110 -0
- package/package.json +9 -6
|
@@ -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]="c19cefdf-bbc2-58dd-affd-050e66ca9200")}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-BA5ry-7d.js";
|
|
4
4
|
//#region src/cli/utils/is-environment-error.ts
|
|
5
5
|
const ENVIRONMENT_ERROR_CODES = new Set([
|
|
6
6
|
"EACCES",
|
|
@@ -197,25 +197,7 @@ const shutdownTelemetry = async () => {
|
|
|
197
197
|
return pendingShutdown;
|
|
198
198
|
};
|
|
199
199
|
//#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 };
|
|
200
|
+
export { isEnvironmentError as a, formatEnvironmentError as i, shutdownTelemetry as n, isExpectedUserError as r, getTelemetryContext as t };
|
|
219
201
|
|
|
220
|
-
//# sourceMappingURL=
|
|
221
|
-
//# debugId=
|
|
202
|
+
//# sourceMappingURL=telemetry-runtime-C9dZxrK_.js.map
|
|
203
|
+
//# debugId=c19cefdf-bbc2-58dd-affd-050e66ca9200
|
|
@@ -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]="bb265729-ea99-5b37-b53e-561ac78da6ac")}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-BKT_s38a.js.map
|
|
12
|
+
//# debugId=bb265729-ea99-5b37-b53e-561ac78da6ac
|
|
@@ -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]="7a148021-5cee-543a-b507-026fcbc863c7")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-BA5ry-7d.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-yw_bHX_4.js.map
|
|
21
|
+
//# debugId=7a148021-5cee-543a-b507-026fcbc863c7
|
|
@@ -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]="3d4347f7-a963-542b-9084-eef6d11bde9e")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-Bz2rayph.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-CdGev87Z.js.map
|
|
21
|
+
//# debugId=3d4347f7-a963-542b-9084-eef6d11bde9e
|
|
@@ -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]="26a0c8a5-47f3-5072-a5a2-98fb13897b6c")}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-BA5ry-7d.js";
|
|
4
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-C9dZxrK_.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-CCVNobt7.js.map
|
|
110
|
+
//# debugId=26a0c8a5-47f3-5072-a5a2-98fb13897b6c
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.9.12-dev.
|
|
3
|
+
"version": "0.9.12-dev.1d3e4a6",
|
|
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.12-dev.
|
|
71
|
+
"oxlint-plugin-react-doctor": "0.9.12-dev.1d3e4a6"
|
|
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.12",
|
|
85
|
+
"@react-doctor/core": "0.9.12"
|
|
83
86
|
},
|
|
84
87
|
"engines": {
|
|
85
88
|
"node": "^20.19.0 || >=22.13.0"
|