react-doctor 0.2.5 → 0.2.7
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-CISyjOAb.js → cli-logger-C35LXalM.js} +991 -621
- package/dist/cli.js +1147 -636
- package/dist/index.d.ts +32 -16
- package/dist/index.js +1042 -629
- 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
|
*/
|
|
@@ -374,6 +374,24 @@ interface InspectResult {
|
|
|
374
374
|
project: ProjectInfo;
|
|
375
375
|
elapsedMilliseconds: number;
|
|
376
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Options accepted by `inspect()`. Mixes two concern groups; ordered
|
|
379
|
+
* here in the source to make the split visible to future readers:
|
|
380
|
+
*
|
|
381
|
+
* - **Engine inputs** (`lint`, `deadCode`, `includePaths`,
|
|
382
|
+
* `configOverride`, `respectInlineDisables`) — flow into
|
|
383
|
+
* `runInspect`'s `InspectInput` and shape what the engine
|
|
384
|
+
* actually does.
|
|
385
|
+
* - **Rendering / orchestration knobs** (`scoreOnly`, `noScore`,
|
|
386
|
+
* `silent`, `verbose`, `outputSurface`, `isCi`) — consumed by
|
|
387
|
+
* the public-API shell to decide what to print, which surface
|
|
388
|
+
* to filter for, and whether to mark the run as CI-originated.
|
|
389
|
+
*
|
|
390
|
+
* A full type split was investigated as the plan's T4 follow-up but
|
|
391
|
+
* deferred — every call site builds the union anyway, so the gain
|
|
392
|
+
* was purely documentary. Grouping the fields here captures the
|
|
393
|
+
* same intent without churning a published-API type.
|
|
394
|
+
*/
|
|
377
395
|
interface DiffInfo {
|
|
378
396
|
/**
|
|
379
397
|
* `null` when `HEAD` is detached (e.g. GitHub Actions `pull_request`
|
|
@@ -567,24 +585,22 @@ declare const ReactDoctorError_base: Schema.Class<ReactDoctorError, Schema.Tagge
|
|
|
567
585
|
declare class ReactDoctorError extends ReactDoctorError_base {
|
|
568
586
|
get message(): string;
|
|
569
587
|
}
|
|
570
|
-
declare const isReactDoctorError: (error: unknown) => error is ReactDoctorError;
|
|
571
|
-
//#region src/observability.d.ts
|
|
588
|
+
declare const isReactDoctorError: (error: unknown) => error is ReactDoctorError;
|
|
572
589
|
/**
|
|
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>"
|
|
590
|
+
* Tagged-reason → legacy thrown-class boundary shared by every public
|
|
591
|
+
* shell (`inspect()` in `react-doctor`, `diagnose()` in `@react-doctor/api`).
|
|
579
592
|
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
*
|
|
593
|
+
* `Effect.catchReasons` dispatches on the tagged-error sub-channel
|
|
594
|
+
* without manual `instanceof` checks. Each handler converts a tagged
|
|
595
|
+
* reason into the historical thrown class advertised by the legacy
|
|
596
|
+
* public-API contract (via `Effect.die`, which `Effect.runPromise`
|
|
597
|
+
* re-throws unchanged). The `orElse` branch re-`die`s the original
|
|
598
|
+
* `ReactDoctorError` instance so advanced callers can still narrow on
|
|
599
|
+
* `error.reason._tag` while grep-stderr users keep the same
|
|
600
|
+
* `error.message` they always saw.
|
|
584
601
|
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* dictates whether the spans they emit get shipped to a backend.
|
|
602
|
+
* Adding a new legacy thrown class is a one-line change on the
|
|
603
|
+
* `Effect.catchReasons` map — both shells pick it up automatically.
|
|
588
604
|
*/
|
|
589
605
|
//#endregion
|
|
590
606
|
//#region src/build-json-report-error.d.ts
|