react-doctor 0.2.6 → 0.2.8
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/dist/{cli-logger-Iz5pfDnL.js → cli-logger-C35LXalM.js} +887 -616
- package/dist/cli.js +1145 -636
- package/dist/index.d.ts +33 -16
- package/dist/index.js +938 -625
- package/dist/skills/react-doctor/SKILL.md +16 -2
- package/package.json +6 -14
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ type DiagnosticSurface = "cli" | "prComment" | "score" | "ciFailure";
|
|
|
49
49
|
type RuleSeverityOverride = "error" | "warn" | "off";
|
|
50
50
|
/**
|
|
51
51
|
* Internal shape consumed by `resolveRuleSeverityOverride` and
|
|
52
|
-
* `
|
|
52
|
+
* `buildDiagnosticPipeline`. Assembled at runtime from the top-level
|
|
53
53
|
* `rules` and `categories` fields on `ReactDoctorConfig`. Per-rule
|
|
54
54
|
* wins over per-category when both match the same diagnostic.
|
|
55
55
|
*/
|
|
@@ -79,6 +79,7 @@ interface SurfaceControls {
|
|
|
79
79
|
excludeRules?: string[];
|
|
80
80
|
}
|
|
81
81
|
interface ReactDoctorConfig {
|
|
82
|
+
$schema?: string;
|
|
82
83
|
ignore?: ReactDoctorIgnoreConfig;
|
|
83
84
|
lint?: boolean;
|
|
84
85
|
/**
|
|
@@ -374,6 +375,24 @@ interface InspectResult {
|
|
|
374
375
|
project: ProjectInfo;
|
|
375
376
|
elapsedMilliseconds: number;
|
|
376
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Options accepted by `inspect()`. Mixes two concern groups; ordered
|
|
380
|
+
* here in the source to make the split visible to future readers:
|
|
381
|
+
*
|
|
382
|
+
* - **Engine inputs** (`lint`, `deadCode`, `includePaths`,
|
|
383
|
+
* `configOverride`, `respectInlineDisables`) — flow into
|
|
384
|
+
* `runInspect`'s `InspectInput` and shape what the engine
|
|
385
|
+
* actually does.
|
|
386
|
+
* - **Rendering / orchestration knobs** (`scoreOnly`, `noScore`,
|
|
387
|
+
* `silent`, `verbose`, `outputSurface`, `isCi`) — consumed by
|
|
388
|
+
* the public-API shell to decide what to print, which surface
|
|
389
|
+
* to filter for, and whether to mark the run as CI-originated.
|
|
390
|
+
*
|
|
391
|
+
* A full type split was investigated as the plan's T4 follow-up but
|
|
392
|
+
* deferred — every call site builds the union anyway, so the gain
|
|
393
|
+
* was purely documentary. Grouping the fields here captures the
|
|
394
|
+
* same intent without churning a published-API type.
|
|
395
|
+
*/
|
|
377
396
|
interface DiffInfo {
|
|
378
397
|
/**
|
|
379
398
|
* `null` when `HEAD` is detached (e.g. GitHub Actions `pull_request`
|
|
@@ -567,24 +586,22 @@ declare const ReactDoctorError_base: Schema.Class<ReactDoctorError, Schema.Tagge
|
|
|
567
586
|
declare class ReactDoctorError extends ReactDoctorError_base {
|
|
568
587
|
get message(): string;
|
|
569
588
|
}
|
|
570
|
-
declare const isReactDoctorError: (error: unknown) => error is ReactDoctorError;
|
|
571
|
-
//#region src/observability.d.ts
|
|
589
|
+
declare const isReactDoctorError: (error: unknown) => error is ReactDoctorError;
|
|
572
590
|
/**
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* HTTP exporter into the runtime when the user opts in via:
|
|
576
|
-
*
|
|
577
|
-
* REACT_DOCTOR_OTLP_ENDPOINT e.g. https://api.axiom.co
|
|
578
|
-
* REACT_DOCTOR_OTLP_AUTH_HEADER e.g. "Bearer <token>"
|
|
591
|
+
* Tagged-reason → legacy thrown-class boundary shared by every public
|
|
592
|
+
* shell (`inspect()` in `react-doctor`, `diagnose()` in `@react-doctor/api`).
|
|
579
593
|
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
*
|
|
594
|
+
* `Effect.catchReasons` dispatches on the tagged-error sub-channel
|
|
595
|
+
* without manual `instanceof` checks. Each handler converts a tagged
|
|
596
|
+
* reason into the historical thrown class advertised by the legacy
|
|
597
|
+
* public-API contract (via `Effect.die`, which `Effect.runPromise`
|
|
598
|
+
* re-throws unchanged). The `orElse` branch re-`die`s the original
|
|
599
|
+
* `ReactDoctorError` instance so advanced callers can still narrow on
|
|
600
|
+
* `error.reason._tag` while grep-stderr users keep the same
|
|
601
|
+
* `error.message` they always saw.
|
|
584
602
|
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* dictates whether the spans they emit get shipped to a backend.
|
|
603
|
+
* Adding a new legacy thrown class is a one-line change on the
|
|
604
|
+
* `Effect.catchReasons` map — both shells pick it up automatically.
|
|
588
605
|
*/
|
|
589
606
|
//#endregion
|
|
590
607
|
//#region src/build-json-report-error.d.ts
|