react-doctor 0.9.11 → 0.9.12-dev.025d69d
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 +28 -1
- package/bin/react-doctor.js +1 -9
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-sLcWe1hO.js → build-section-divider-Rtaiowhy.js} +10 -25
- package/dist/{ci-DsrrD52i.js → ci-BB3u5Gt7.js} +13 -12
- package/dist/cli.js +84 -32
- package/dist/{design-CP25gyyg.js → design-DndYvifI.js} +4 -4
- package/dist/{devtools-DPRVRu3S.js → devtools-BiC-AP3B.js} +4 -4
- package/dist/{exit-gracefully-CVVkBxDS.js → exit-gracefully-DShLWQuA.js} +15 -9
- package/dist/get-east-asian-width-Cglw13G7.js +444 -0
- package/dist/{report-error-CAEixMg1.js → handle-error-D1wDDJF-.js} +18 -68
- package/dist/index.d.ts +70 -61
- package/dist/index.js +55252 -54707
- package/dist/{inspect-D6y8oLtg.js → inspect-FuGxonlI.js} +26 -24
- package/dist/{install-afMFGeTB.js → install-DMK7JRVX.js} +9 -8
- package/dist/{install-doctor-script-Be7Mv3-l.js → install-doctor-script-JE3JnnQc.js} +7 -449
- package/dist/{install-github-workflow-Dev2F6Ea.js → install-github-workflow-BdY3qY2f.js} +10 -6
- package/dist/{install-react-doctor-DIPVunY4.js → install-react-doctor-BMn0_WV6.js} +47 -45
- package/dist/{run-scan-app-BGzlyiIB.js → jsx-runtime-pWsmwZGj.js} +281 -2726
- package/dist/{print-branded-header-D5jLdo4p.js → print-branded-header-BmI9tLH6.js} +4 -4
- package/dist/project-analysis-worker.d.ts +1 -0
- package/dist/project-analysis-worker.js +51901 -0
- package/dist/prompt-runtime-scan-url-BfBBYAfw.js +240 -0
- package/dist/{read-object-file-CEh1CqnD.js → read-object-file-CRpKojJA.js} +4 -4
- package/dist/{record-metric-CJxSHfJD.js → record-metric-BM82PBSe.js} +3338 -6056
- package/dist/report-error-CZHQUNh4.js +64 -0
- package/dist/{report-workflow-result-C0jbKH8p.js → report-workflow-result-xEGmAMA7.js} +5 -5
- package/dist/{resolve-scope-DS7rcRRz.js → resolve-scope-Bnf4Y4EW.js} +6 -6
- package/dist/{rules-BJynymuU.js → rules-DzOjQMX6.js} +6 -6
- package/dist/run-scan-app-BV3v34-X.js +2510 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-B85-DJZM.js +770 -0
- package/dist/sanitize-runtime-url-CPjeveTJ.js +76 -0
- package/dist/{scan-CgPRG6_z.js → scan-DuP6gdzt.js} +10 -22
- package/dist/semver-DFtnEmN-.js +3219 -0
- package/dist/{should-fail-scan-gate-4jf7ZRdL.js → should-fail-scan-gate-DXLurKbC.js} +199 -195
- package/dist/{should-skip-prompts-C78r7Ww7.js → should-skip-prompts-CQyO96OW.js} +4 -4
- package/dist/should-use-tui-CNPwNNtA.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-Dc8ipkaw.js → telemetry-runtime-DbSLLSa0.js} +57 -33
- package/dist/unref-stdin-BKT_s38a.js +12 -0
- package/dist/{version-DDrwsTas.js → version-Zw_S1mCX.js} +4 -4
- package/dist/{why-BRNrKY1b.js → why-B-WcOS0C.js} +4 -4
- package/dist/with-run-span-CVyFHX3Z.js +110 -0
- package/package.json +9 -12
- package/dist/chunk-q7NCDQ7-.js +0 -28
- package/dist/lsp.js +0 -81114
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 /
|
|
9640
|
-
* diagnostics carry no source span.
|
|
9641
|
-
* precise range
|
|
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).
|
|
9701
|
-
*
|
|
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
|
-
*
|
|
9875
|
-
*
|
|
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
|
-
/**
|
|
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>;
|
|
@@ -10366,11 +10389,11 @@ interface DiagnoseResult {
|
|
|
10366
10389
|
scannedFileCount?: number;
|
|
10367
10390
|
project: ProjectInfo;
|
|
10368
10391
|
/**
|
|
10369
|
-
* Whether the scanned project resolved a React-compatible runtime
|
|
10370
|
-
* or
|
|
10371
|
-
*
|
|
10372
|
-
*
|
|
10373
|
-
*
|
|
10392
|
+
* Whether the scanned project resolved a React-compatible runtime directly
|
|
10393
|
+
* or through a React-backed framework. `false` means every React-runtime
|
|
10394
|
+
* rule family was gated off, not that the scan target was unsupported:
|
|
10395
|
+
* other detected framework and library rule families still run, as do
|
|
10396
|
+
* framework-neutral rules on any analyzable project.
|
|
10374
10397
|
* Mirrors `JsonReport.reactDetected`; same predicate as
|
|
10375
10398
|
* `hasReactRuntime(result.project)`. Always set by `diagnose()`;
|
|
10376
10399
|
* optional so hand-constructed results keep compiling.
|
|
@@ -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 (`
|
|
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 {
|
|
@@ -10427,7 +10450,8 @@ interface DiagnoseProjectsResult {
|
|
|
10427
10450
|
score: ScoreResult | null;
|
|
10428
10451
|
/**
|
|
10429
10452
|
* Whether any successfully scanned project resolved a React-compatible
|
|
10430
|
-
* runtime
|
|
10453
|
+
* runtime directly or through a React-backed framework. Absent when no
|
|
10454
|
+
* project scanned successfully.
|
|
10431
10455
|
* See `DiagnoseResult.reactDetected` for gating guidance; per-project
|
|
10432
10456
|
* detail is on each `ProjectResultOk.reactDetected`.
|
|
10433
10457
|
*/
|
|
@@ -10496,23 +10520,11 @@ interface InspectResult {
|
|
|
10496
10520
|
*/
|
|
10497
10521
|
lintSidecarReplayedFileCount?: number | null;
|
|
10498
10522
|
lintSidecarTotalFileCount?: number | null;
|
|
10499
|
-
/**
|
|
10500
|
-
* Dead-code result cache outcome: `true` when the pass replayed a cached
|
|
10501
|
-
* result (the analysis never ran), `false` on a fresh analysis. Absent when
|
|
10502
|
-
* the pass never consulted the cache — dead-code skipped, the cache
|
|
10503
|
-
* disabled, or a whole-repo cache replay where no analysis ran. The CLI
|
|
10504
|
-
* projects it onto the Sentry wide event as `deadCode.cacheHit`.
|
|
10505
|
-
*/
|
|
10523
|
+
/** @deprecated Retained for report compatibility. */
|
|
10506
10524
|
deadCodeCacheHit?: boolean | null;
|
|
10507
|
-
/**
|
|
10508
|
-
* deslop's incremental summary-cache outcome for the dead-code analysis:
|
|
10509
|
-
* collected files served from cached parse summaries vs freshly parsed.
|
|
10510
|
-
* Both absent whenever no analysis consulted the incremental store — a
|
|
10511
|
-
* whole-result cache hit, the cache disabled, or dead-code skipped. The CLI
|
|
10512
|
-
* projects them onto the Sentry wide event as `deadCode.summaryCacheHits` /
|
|
10513
|
-
* `deadCode.summaryCacheMisses`.
|
|
10514
|
-
*/
|
|
10525
|
+
/** @deprecated Retained for report compatibility. */
|
|
10515
10526
|
deadCodeSummaryCacheHits?: number | null;
|
|
10527
|
+
/** @deprecated Retained for report compatibility. */
|
|
10516
10528
|
deadCodeSummaryCacheMisses?: number | null;
|
|
10517
10529
|
/**
|
|
10518
10530
|
* Present only for a baseline run (`InspectOptions.baseline` set). The
|
|
@@ -10530,7 +10542,7 @@ interface InspectResult {
|
|
|
10530
10542
|
* Options accepted by `inspect()`. Mixes two concern groups; ordered
|
|
10531
10543
|
* here in the source to make the split visible to future readers:
|
|
10532
10544
|
*
|
|
10533
|
-
* - **Engine inputs** (`lint`, `
|
|
10545
|
+
* - **Engine inputs** (`lint`, `includePaths`,
|
|
10534
10546
|
* `configOverride`, `respectInlineDisables`) — flow into
|
|
10535
10547
|
* `runInspect`'s `InspectInput` and shape what the engine
|
|
10536
10548
|
* actually does.
|
|
@@ -10660,14 +10672,13 @@ interface JsonReportV1$1 {
|
|
|
10660
10672
|
mode: JsonReportMode;
|
|
10661
10673
|
baselineDegraded?: boolean;
|
|
10662
10674
|
/**
|
|
10663
|
-
* Whether any scanned project resolved a React-compatible runtime
|
|
10664
|
-
* or
|
|
10665
|
-
*
|
|
10666
|
-
*
|
|
10667
|
-
*
|
|
10668
|
-
*
|
|
10669
|
-
*
|
|
10670
|
-
* is empty), on error reports, and on reports from older CLI versions.
|
|
10675
|
+
* Whether any scanned project resolved a React-compatible runtime directly
|
|
10676
|
+
* or through a React-backed framework. `false` means every React-runtime
|
|
10677
|
+
* rule family was gated off, not that the scan target was unsupported:
|
|
10678
|
+
* other detected framework and library rule families still run, as do
|
|
10679
|
+
* framework-neutral rules on any analyzable project. Absent when
|
|
10680
|
+
* nothing was scanned (`projects` is empty), on error reports, and on
|
|
10681
|
+
* reports from older CLI versions.
|
|
10671
10682
|
*/
|
|
10672
10683
|
reactDetected?: boolean;
|
|
10673
10684
|
diff: JsonReportDiffInfo | null;
|
|
@@ -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
|
|
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
|
|
10858
|
+
declare const MaintainabilityAnalysisFailed_base: Class<MaintainabilityAnalysisFailed, TaggedStruct<"MaintainabilityAnalysisFailed", {
|
|
10848
10859
|
readonly cause: Unknown;
|
|
10849
10860
|
}>, YieldableError>;
|
|
10850
|
-
declare class
|
|
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
|
|
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;
|
|
@@ -10972,13 +10983,11 @@ declare const defineConfig: (config: ReactDoctorConfig) => ReactDoctorConfig; //
|
|
|
10972
10983
|
//#endregion
|
|
10973
10984
|
//#region src/utils/has-react-runtime.d.ts
|
|
10974
10985
|
/**
|
|
10975
|
-
* Whether project discovery resolved a React-compatible runtime
|
|
10976
|
-
*
|
|
10977
|
-
* predicate that grants the `react` capability, so `false` means every
|
|
10978
|
-
* React-runtime rule family was gated off for the project.
|
|
10986
|
+
* Whether project discovery resolved a React-compatible runtime directly or
|
|
10987
|
+
* through a framework whose runtime is necessarily React-compatible.
|
|
10979
10988
|
*/
|
|
10980
10989
|
declare const hasReactRuntime: (project: ProjectInfo) => boolean; //#endregion
|
|
10981
|
-
//#region src/utils/
|
|
10990
|
+
//#region src/utils/has-supported-framework-or-library.d.ts
|
|
10982
10991
|
//#endregion
|
|
10983
10992
|
//#region ../api/dist/index.d.ts
|
|
10984
10993
|
//#region src/diagnose.d.ts
|