react-doctor 0.9.12-dev.8c2f03a → 0.9.12-dev.905607f

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.
Files changed (44) hide show
  1. package/README.md +27 -0
  2. package/dist/active-run-trace-dlIZeEvb.js +18 -0
  3. package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
  4. package/dist/{build-section-divider-DuozMmwU.js → build-section-divider-D5ATBfDJ.js} +8 -22
  5. package/dist/{ci-Bwd2LJZC.js → ci-DIlnBiUj.js} +12 -11
  6. package/dist/cli.js +77 -25
  7. package/dist/{design-Q4Umr_4T.js → design-C-uq3ow5.js} +4 -4
  8. package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
  9. package/dist/{exit-gracefully-vUI1H1zC.js → exit-gracefully-C64GRTOn.js} +15 -9
  10. package/dist/get-east-asian-width-Cglw13G7.js +444 -0
  11. package/dist/{report-error-CAp5cil9.js → handle-error-Cfcnsjyi.js} +6 -61
  12. package/dist/index.d.ts +34 -2
  13. package/dist/index.js +187 -44
  14. package/dist/{inspect-RxIsB8bi.js → inspect-BLX566wA.js} +21 -19
  15. package/dist/{install-CI0nvC_v.js → install-Dz8zcUxD.js} +9 -8
  16. package/dist/{install-doctor-script-BAmTZygh.js → install-doctor-script-CjxGMzIH.js} +6 -441
  17. package/dist/{install-github-workflow-Dg2sosDx.js → install-github-workflow-eYmQoXdI.js} +6 -6
  18. package/dist/{install-react-doctor-CIJcnTik.js → install-react-doctor-OIDTrbHz.js} +47 -45
  19. package/dist/{run-scan-app-CeNk17wq.js → jsx-runtime-BdBmuS_a.js} +280 -2769
  20. package/dist/{print-branded-header-kwnSGrfR.js → print-branded-header-BksixHcc.js} +4 -4
  21. package/dist/prompt-runtime-scan-url-CXJMNnAo.js +240 -0
  22. package/dist/{read-object-file-m5uVvcBp.js → read-object-file-BhV9TFsy.js} +4 -4
  23. package/dist/{record-metric-DospZkfP.js → record-metric-CdX-TQ5W.js} +241 -77
  24. package/dist/report-error-DsFo2sAk.js +64 -0
  25. package/dist/{report-workflow-result-D0GvvJtT.js → report-workflow-result-BSSkdwvd.js} +5 -5
  26. package/dist/{resolve-scope-eXawiGEH.js → resolve-scope-DRnGmF8O.js} +6 -6
  27. package/dist/{rules-C_xYDSz8.js → rules-C2g4a0X3.js} +6 -6
  28. package/dist/run-scan-app-Ch6yrLY9.js +2508 -0
  29. package/dist/runtime-scan/browser-probe.iife.js +855 -0
  30. package/dist/runtime-scan-Crfe35Ke.js +770 -0
  31. package/dist/sanitize-runtime-url-Dwa_-IKX.js +76 -0
  32. package/dist/{scan-DIwsgV6M.js → scan-DJnhifws.js} +10 -22
  33. package/dist/{should-fail-scan-gate-BWTNIU5h.js → should-fail-scan-gate-D4ZKKeXI.js} +23 -114
  34. package/dist/{should-skip-prompts-oK3MwWyB.js → should-skip-prompts-Cfocoh7G.js} +4 -4
  35. package/dist/should-use-tui-COX1uZWn.js +25 -0
  36. package/dist/skills/improve-threejs/SKILL.md +102 -0
  37. package/dist/skills/performance/SKILL.md +113 -0
  38. package/dist/skills/react-doctor/SKILL.md +6 -0
  39. package/dist/{unref-stdin-BGZVK4sJ.js → telemetry-runtime-C_D70xUE.js} +5 -23
  40. package/dist/unref-stdin-BKT_s38a.js +12 -0
  41. package/dist/{version-9-2T2YQf.js → version-BAhd6Zvv.js} +4 -4
  42. package/dist/{why-BOiuB_qy.js → why-MQHWHpeA.js} +4 -4
  43. package/dist/with-run-span-DmpUrF70.js +110 -0
  44. package/package.json +6 -4
@@ -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]="36724664-8dc2-54b8-b2eb-4c3256af0c6c")}catch(e){}}();
3
- import { Hn as buildWithScope, Jt as isProjectDiscoveryError, Kn as close, Ln as runPromise, On as make, Qt as layerObservability, R as CliInputError, Rn as runSync, Sr as messageFromUnknown, Yn as void_, Yt as isReactDoctorError, g as VERSION, i as isTelemetryEnabled, qn as makeUnsafe, yr as isErrnoException } from "./record-metric-DospZkfP.js";
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]="a9b5c445-c22a-500c-b5bf-9a0408b96e50")}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-CdX-TQ5W.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
- //#region src/cli/utils/active-run-trace.ts
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=unref-stdin-BGZVK4sJ.js.map
221
- //# debugId=36724664-8dc2-54b8-b2eb-4c3256af0c6c
202
+ //# sourceMappingURL=telemetry-runtime-C_D70xUE.js.map
203
+ //# debugId=a9b5c445-c22a-500c-b5bf-9a0408b96e50
@@ -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]="bcd2c07f-2279-5d72-9b3c-7a1566f6e77b")}catch(e){}}();
3
- import { g as VERSION, t as recordCount, w as METRIC } from "./record-metric-DospZkfP.js";
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]="77d0b1cf-2a1f-5102-98e1-2e9b88ce191e")}catch(e){}}();
3
+ import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-CdX-TQ5W.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-9-2T2YQf.js.map
21
- //# debugId=bcd2c07f-2279-5d72-9b3c-7a1566f6e77b
20
+ //# sourceMappingURL=version-BAhd6Zvv.js.map
21
+ //# debugId=77d0b1cf-2a1f-5102-98e1-2e9b88ce191e
@@ -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]="34895f04-2fd2-589a-8f54-5d7c9aa4e3f3")}catch(e){}}();
3
- import { t as inspectAction } from "./inspect-RxIsB8bi.js";
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]="62ecf6d9-96bd-5189-9676-06f09f4cf53e")}catch(e){}}();
3
+ import { t as inspectAction } from "./inspect-BLX566wA.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-BOiuB_qy.js.map
21
- //# debugId=34895f04-2fd2-589a-8f54-5d7c9aa4e3f3
20
+ //# sourceMappingURL=why-MQHWHpeA.js.map
21
+ //# debugId=62ecf6d9-96bd-5189-9676-06f09f4cf53e
@@ -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]="99f78b5c-a5e4-5b46-99ce-3c357c7d2199")}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-CdX-TQ5W.js";
4
+ import { t as getTelemetryContext } from "./telemetry-runtime-C_D70xUE.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-DmpUrF70.js.map
110
+ //# debugId=99f78b5c-a5e4-5b46-99ce-3c357c7d2199
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.9.12-dev.8c2f03a",
3
+ "version": "0.9.12-dev.905607f",
4
4
  "description": "Your agent writes bad React. This catches it",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -53,19 +53,21 @@
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",
59
60
  "jiti": "^2.7.0",
60
61
  "magicast": "^0.5.3",
61
- "oxc-parser": "^0.143.0",
62
+ "oxc-parser": "^0.146.0",
62
63
  "oxc-resolver": "^11.24.2",
63
- "oxlint": ">=1.77.0 <1.78.0",
64
+ "oxlint": ">=1.79.0 <1.80.0",
65
+ "playwright-core": "^1.62.1",
64
66
  "prompts": "^2.4.2",
65
67
  "typescript": ">=5.0.4 <6",
66
68
  "yaml": "^2.9.0",
67
69
  "yoga-layout": "~3.2.1",
68
- "oxlint-plugin-react-doctor": "0.9.12-dev.8c2f03a"
70
+ "oxlint-plugin-react-doctor": "0.9.12-dev.905607f"
69
71
  },
70
72
  "devDependencies": {
71
73
  "@types/babel__code-frame": "^7.27.0",