react-doctor 0.9.12 → 0.9.13-dev.fd23edc

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 (52) hide show
  1. package/README.md +34 -1
  2. package/bin/react-doctor.js +1 -9
  3. package/dist/active-run-trace-dlIZeEvb.js +18 -0
  4. package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
  5. package/dist/{build-section-divider-BsQvH-7I.js → build-section-divider-CUtO-gXD.js} +10 -25
  6. package/dist/{ci-B4x4RjKD.js → ci-DjilJaw4.js} +13 -12
  7. package/dist/cli.js +121 -41
  8. package/dist/{design-A48PNCf_.js → design-CXLKbARh.js} +4 -4
  9. package/dist/{devtools-DPRVRu3S.js → devtools-CC2PAZ85.js} +4 -4
  10. package/dist/{exit-gracefully-Bk531kS-.js → exit-gracefully-DTLgxZZ5.js} +15 -9
  11. package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
  12. package/dist/{report-error-Pb2uO8EG.js → handle-error-BqaqFvmc.js} +18 -68
  13. package/dist/index.d.ts +53 -42
  14. package/dist/index.js +55119 -54689
  15. package/dist/{inspect-CwH84aSA.js → inspect-BIfnzKGq.js} +44 -33
  16. package/dist/{install-doctor-script-DLayXS7q.js → install-doctor-script-B1U08lUD.js} +7 -449
  17. package/dist/{install-github-workflow-Goz-KFqb.js → install-github-workflow-CkOl0wCn.js} +10 -6
  18. package/dist/{install-sFN_w425.js → install-nhJ65X-y.js} +9 -8
  19. package/dist/{install-react-doctor-Bq7dfEBI.js → install-react-doctor-Dm35Egex.js} +47 -45
  20. package/dist/{run-scan-app-DXBMW54J.js → jsx-runtime-C1t3eR6p.js} +281 -2759
  21. package/dist/path-format-DnHpmJwG.js +9 -0
  22. package/dist/{print-branded-header-D_J8Qdsj.js → print-branded-header-qOJiGkuW.js} +4 -4
  23. package/dist/project-analysis-worker.d.ts +1 -0
  24. package/dist/project-analysis-worker.js +51901 -0
  25. package/dist/prompt-runtime-scan-url-m88LMtMP.js +240 -0
  26. package/dist/{read-object-file-Hk79zI91.js → read-object-file-Cv41FpZo.js} +4 -4
  27. package/dist/{record-metric-CsQXJewH.js → record-metric-u8youmM2.js} +3257 -6019
  28. package/dist/report-error-CkFgxJTQ.js +64 -0
  29. package/dist/{report-workflow-result-6n_wSqzA.js → report-workflow-result-Wh1SQuOu.js} +5 -5
  30. package/dist/{resolve-scope-DP6rYlNO.js → resolve-scope-CHCpJtks.js} +8 -10
  31. package/dist/{rules-BnIZ4Fq_.js → rules-C30QFptP.js} +6 -6
  32. package/dist/run-scan-app-yTBDucJ3.js +2511 -0
  33. package/dist/runtime-scan/browser-probe.iife.js +855 -0
  34. package/dist/runtime-scan-VH25Yf8H.js +770 -0
  35. package/dist/sanitize-runtime-url-crVHbQlW.js +76 -0
  36. package/dist/scan-CNSRWEtJ.js +47 -0
  37. package/dist/semver-DFtnEmN-.js +3219 -0
  38. package/dist/{should-fail-scan-gate-DzZuTxim.js → should-fail-scan-gate-Cw6KeoRT.js} +160 -184
  39. package/dist/{should-skip-prompts-D1GWG2qN.js → should-skip-prompts-B5zkkkKR.js} +4 -4
  40. package/dist/should-use-tui-S9255AG_.js +25 -0
  41. package/dist/skills/improve-threejs/SKILL.md +102 -0
  42. package/dist/skills/performance/SKILL.md +113 -0
  43. package/dist/skills/react-doctor/SKILL.md +6 -0
  44. package/dist/{unref-stdin-0a_0uwC6.js → telemetry-runtime-B2rpGWMl.js} +57 -33
  45. package/dist/unref-stdin-SK3WfwxS.js +12 -0
  46. package/dist/{version-Bo5QDp7F.js → version-KQbGQSGN.js} +4 -4
  47. package/dist/{why-BFYbtnm8.js → why-B-l2qTCV.js} +4 -4
  48. package/dist/with-run-span-Dk1M8cnH.js +110 -0
  49. package/package.json +9 -10
  50. package/dist/chunk-q7NCDQ7-.js +0 -28
  51. package/dist/lsp.js +0 -81145
  52. package/dist/scan-CnnXz78m.js +0 -53
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { FrameworkToken } from "oxlint-plugin-react-doctor/core";
2
1
  import fs from "node:fs";
2
+ import { FrameworkToken } from "oxlint-plugin-react-doctor/core";
3
3
 
4
4
  //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Types.d.ts
5
5
  /**
@@ -9636,10 +9636,9 @@ interface Diagnostic {
9636
9636
  column: number;
9637
9637
  /**
9638
9638
  * UTF-8 byte offset of the diagnostic's primary span start, straight
9639
- * from oxlint's label span. Optional because environment / dead-code
9640
- * diagnostics carry no source span. Editors (LSP) convert this into a
9641
- * precise range via the in-memory document; non-editor consumers can
9642
- * ignore it.
9639
+ * from oxlint's label span. Optional because environment / maintainability
9640
+ * diagnostics carry no source span. Consumers can use it to recover a
9641
+ * precise range or ignore it.
9643
9642
  */
9644
9643
  offset?: number;
9645
9644
  /** UTF-8 byte length of the primary span (pairs with `offset`). */
@@ -9697,8 +9696,8 @@ type BlockingLevel = "error" | "warning" | "none";
9697
9696
  * CLI `--scope` flag, the GitHub Action `scope` input, and this config field
9698
9697
  * all share. Ordered widest to narrowest:
9699
9698
  *
9700
- * - `"full"` — whole project, every issue (the default). Whole-project checks
9701
- * (dead-code, environment, supply-chain) run only at this scope.
9699
+ * - `"full"` — whole project, every issue (the default). Environment and
9700
+ * supply-chain checks run only at this scope.
9702
9701
  * - `"files"` — only the files changed vs the base, with ALL issues in them
9703
9702
  * (no compare-to-main). What `--staged` and an uncommitted `--diff` do today.
9704
9703
  * - `"changed"` — only issues the change INTRODUCED vs the base (the baseline
@@ -9836,8 +9835,7 @@ interface SupplyChainConfig {
9836
9835
  /**
9837
9836
  * Whether to run the Socket supply-chain score check. Default: `true`.
9838
9837
  * Set to `false` to opt out — the check performs one network request per
9839
- * direct dependency. It is always skipped in `--diff` / `--staged` mode
9840
- * and in editor scans regardless of this setting.
9838
+ * direct dependency. It is always skipped in `--diff` / `--staged` mode.
9841
9839
  */
9842
9840
  enabled?: boolean;
9843
9841
  /**
@@ -9871,11 +9869,8 @@ interface ReactDoctorConfig {
9871
9869
  */
9872
9870
  supplyChain?: SupplyChainConfig;
9873
9871
  /**
9874
- * Whether to run dead-code analysis (via `deslop-js`) alongside lint.
9875
- * Reports unused files, unused exports, unused dependencies, and
9876
- * circular imports under the "Maintainability" category. Default: `true`.
9877
- * Always skipped in `--diff` / `--staged` modes because reachability
9878
- * is a whole-project property.
9872
+ * Compatibility switch for React maintainability analysis. Default: `true`.
9873
+ * @deprecated React maintainability checks are part of React Doctor.
9879
9874
  */
9880
9875
  deadCode?: boolean;
9881
9876
  verbose?: boolean;
@@ -10195,6 +10190,28 @@ interface ProjectInfo {
10195
10190
  remotionVersion?: string | null;
10196
10191
  remotionMajorVersion?: number | null;
10197
10192
  hasI18nLibrary?: boolean;
10193
+ /**
10194
+ * `true` when the project (or a workspace package) declares the unified
10195
+ * `radix-ui` package or any `@radix-ui/react-*` primitive (icons excluded).
10196
+ * Drives the `radix-ui` capability, which gates the `radix-*` composition
10197
+ * rules for apps that assemble Radix parts directly.
10198
+ */
10199
+ hasRadixUi?: boolean;
10200
+ /**
10201
+ * `true` when the project (or a workspace package) declares Base UI
10202
+ * (`@base-ui-components/react` or its 1.0 rename `@base-ui/react`).
10203
+ * Drives the `base-ui` capability, which gates the `base-ui-*`
10204
+ * composition rules.
10205
+ */
10206
+ hasBaseUi?: boolean;
10207
+ /** `true` when `react-aria-components` is declared. Drives the `react-aria` capability. */
10208
+ hasReactAriaComponents?: boolean;
10209
+ /** `true` when `@tanstack/react-table` is declared. Drives the `tanstack-table` capability. */
10210
+ hasTanstackTable?: boolean;
10211
+ /** `true` when `@tanstack/react-virtual` is declared. Drives the `tanstack-virtual` capability. */
10212
+ hasTanstackVirtual?: boolean;
10213
+ /** `true` when `@tanstack/react-form` is declared. Drives the `tanstack-form` capability. */
10214
+ hasTanstackForm?: boolean;
10198
10215
  tanstackQueryVersion?: string | null;
10199
10216
  styledComponentsVersion?: string | null;
10200
10217
  /** Whether the project or one of its workspaces declares Three.js, Fiber, or Drei. */
@@ -10294,6 +10311,16 @@ interface ProjectInfo {
10294
10311
  * recommend them to projects pinned below that.
10295
10312
  */
10296
10313
  reanimatedVersion: string | null;
10314
+ /**
10315
+ * `true` when the project (or an ancestor up to the repository boundary)
10316
+ * carries a shadcn `components.json` config. Drives the `shadcn`
10317
+ * capability, which gates the `shadcn-*` component-composition rules —
10318
+ * their part names (`DialogTitle`, `InputGroupInput`, `TabsList`, …) only
10319
+ * carry shadcn's contract in a project that actually generated those
10320
+ * files. Optional so existing `ProjectInfo` consumers remain
10321
+ * source-compatible.
10322
+ */
10323
+ hasShadcnUi?: boolean;
10297
10324
  /**
10298
10325
  * `true` when the project's `tsconfig.json` `compilerOptions.target` or
10299
10326
  * `compilerOptions.lib` indicates the output environment predates ES2023
@@ -10332,7 +10359,7 @@ interface ScoreResult {
10332
10359
  //#region src/types/diagnose.d.ts
10333
10360
  interface DiagnoseOptions {
10334
10361
  lint?: boolean;
10335
- /** See `ReactDoctorConfig.deadCode`. Ignored in diff mode. */
10362
+ /** @deprecated Compatibility alias for React maintainability analysis. */
10336
10363
  deadCode?: boolean;
10337
10364
  verbose?: boolean;
10338
10365
  /** Restrict linting to supported JS/TS files and inline scripts in HTML files. */
@@ -10352,11 +10379,7 @@ interface DiagnoseOptions {
10352
10379
  interface DiagnoseResult {
10353
10380
  diagnostics: Diagnostic[];
10354
10381
  score: ScoreResult | null;
10355
- /**
10356
- * Checks that did not run to completion (e.g. `"dead-code"` when the
10357
- * `deslop-js` native binding crashed). Empty when everything ran.
10358
- * Mirrors `InspectResult.skippedChecks`.
10359
- */
10382
+ /** Checks that did not run to completion. Mirrors `InspectResult.skippedChecks`. */
10360
10383
  skippedChecks: string[];
10361
10384
  /** See `InspectResult.skippedCheckReasons`. */
10362
10385
  skippedCheckReasons?: Record<string, string>;
@@ -10380,7 +10403,7 @@ interface DiagnoseResult {
10380
10403
  }
10381
10404
  /**
10382
10405
  * A single project to scan as part of a `diagnose({ projects })` batch.
10383
- * Scan options (`deadCode`, `lint`, etc.) are flat on the entry and
10406
+ * Scan options (`lint`, etc.) are flat on the entry and
10384
10407
  * layer on top of the global defaults — omitted fields fall through.
10385
10408
  */
10386
10409
  interface ProjectDefinition extends DiagnoseOptions {
@@ -10497,23 +10520,11 @@ interface InspectResult {
10497
10520
  */
10498
10521
  lintSidecarReplayedFileCount?: number | null;
10499
10522
  lintSidecarTotalFileCount?: number | null;
10500
- /**
10501
- * Dead-code result cache outcome: `true` when the pass replayed a cached
10502
- * result (the analysis never ran), `false` on a fresh analysis. Absent when
10503
- * the pass never consulted the cache — dead-code skipped, the cache
10504
- * disabled, or a whole-repo cache replay where no analysis ran. The CLI
10505
- * projects it onto the Sentry wide event as `deadCode.cacheHit`.
10506
- */
10523
+ /** @deprecated Retained for report compatibility. */
10507
10524
  deadCodeCacheHit?: boolean | null;
10508
- /**
10509
- * deslop's incremental summary-cache outcome for the dead-code analysis:
10510
- * collected files served from cached parse summaries vs freshly parsed.
10511
- * Both absent whenever no analysis consulted the incremental store — a
10512
- * whole-result cache hit, the cache disabled, or dead-code skipped. The CLI
10513
- * projects them onto the Sentry wide event as `deadCode.summaryCacheHits` /
10514
- * `deadCode.summaryCacheMisses`.
10515
- */
10525
+ /** @deprecated Retained for report compatibility. */
10516
10526
  deadCodeSummaryCacheHits?: number | null;
10527
+ /** @deprecated Retained for report compatibility. */
10517
10528
  deadCodeSummaryCacheMisses?: number | null;
10518
10529
  /**
10519
10530
  * Present only for a baseline run (`InspectOptions.baseline` set). The
@@ -10531,7 +10542,7 @@ interface InspectResult {
10531
10542
  * Options accepted by `inspect()`. Mixes two concern groups; ordered
10532
10543
  * here in the source to make the split visible to future readers:
10533
10544
  *
10534
- * - **Engine inputs** (`lint`, `deadCode`, `includePaths`,
10545
+ * - **Engine inputs** (`lint`, `includePaths`,
10535
10546
  * `configOverride`, `respectInlineDisables`) — flow into
10536
10547
  * `runInspect`'s `InspectInput` and shape what the engine
10537
10548
  * actually does.
@@ -10738,8 +10749,8 @@ type JsonReport = JsonReportV1$1 | JsonReportV2$1 | JsonReportV3$1; //#endregion
10738
10749
  * Distinguishes the two situations that both surface as "no project here", so
10739
10750
  * the rendered message matches reality:
10740
10751
  *
10741
- * - `no-project` (default): the path exists but has no React project — no
10742
- * `package.json` at the root and no discoverable nested React subproject.
10752
+ * - `no-project` (default): the path exists but has no supported project — no
10753
+ * `package.json` at the root and no discoverable nested React or Three.js subproject.
10743
10754
  * - `missing-path`: the resolved scan target does not exist on disk at all
10744
10755
  * (a typo, a stale temp path, a monorepo subdir that isn't present). The
10745
10756
  * generic "expected a package.json" guidance is misleading here, so point
@@ -10844,10 +10855,10 @@ declare const ProjectDiscoveryFailed_base: Class<ProjectDiscoveryFailed, TaggedS
10844
10855
  declare class ProjectDiscoveryFailed extends ProjectDiscoveryFailed_base {
10845
10856
  get message(): string;
10846
10857
  }
10847
- declare const DeadCodeAnalysisFailed_base: Class<DeadCodeAnalysisFailed, TaggedStruct<"DeadCodeAnalysisFailed", {
10858
+ declare const MaintainabilityAnalysisFailed_base: Class<MaintainabilityAnalysisFailed, TaggedStruct<"MaintainabilityAnalysisFailed", {
10848
10859
  readonly cause: Unknown;
10849
10860
  }>, YieldableError>;
10850
- declare class DeadCodeAnalysisFailed extends DeadCodeAnalysisFailed_base {
10861
+ declare class MaintainabilityAnalysisFailed extends MaintainabilityAnalysisFailed_base {
10851
10862
  get message(): string;
10852
10863
  }
10853
10864
  declare const GitInvocationFailed_base: Class<GitInvocationFailed, TaggedStruct<"GitInvocationFailed", {
@@ -10871,7 +10882,7 @@ declare class GitBaseBranchInvalid extends GitBaseBranchInvalid_base {
10871
10882
  get message(): string;
10872
10883
  }
10873
10884
  declare const ReactDoctorError_base: Class<ReactDoctorError, TaggedStruct<"ReactDoctorError", {
10874
- readonly reason: Union<readonly [typeof OxlintUnavailable, typeof OxlintBatchExceeded, typeof ScanDeadlineExceeded, typeof OxlintSpawnFailed, typeof OxlintOutputUnparseable, typeof ConfigParseFailed, typeof ProjectNotFound, typeof NoReactDependency, typeof AmbiguousProject, typeof ProjectDiscoveryFailed, typeof DeadCodeAnalysisFailed, typeof GitInvocationFailed, typeof GitBaseBranchMissing, typeof GitBaseBranchInvalid]>;
10885
+ readonly reason: Union<readonly [typeof OxlintUnavailable, typeof OxlintBatchExceeded, typeof ScanDeadlineExceeded, typeof OxlintSpawnFailed, typeof OxlintOutputUnparseable, typeof ConfigParseFailed, typeof ProjectNotFound, typeof NoReactDependency, typeof AmbiguousProject, typeof ProjectDiscoveryFailed, typeof MaintainabilityAnalysisFailed, typeof GitInvocationFailed, typeof GitBaseBranchMissing, typeof GitBaseBranchInvalid]>;
10875
10886
  }>, YieldableError>;
10876
10887
  declare class ReactDoctorError extends ReactDoctorError_base {
10877
10888
  get message(): string;