uidex 0.7.0 → 0.8.0
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/cli.cjs +1024 -1041
- package/dist/cli/cli.cjs.map +1 -1
- package/dist/headless/index.cjs +4 -448
- package/dist/headless/index.cjs.map +1 -1
- package/dist/headless/index.d.cts +41 -11
- package/dist/headless/index.d.ts +41 -11
- package/dist/headless/index.js +4 -450
- package/dist/headless/index.js.map +1 -1
- package/dist/index.cjs +147 -3252
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -316
- package/dist/index.d.ts +43 -316
- package/dist/index.js +133 -3254
- package/dist/index.js.map +1 -1
- package/dist/playwright/index.cjs +175 -0
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.cts +2 -0
- package/dist/playwright/index.d.ts +2 -0
- package/dist/playwright/index.js +167 -0
- package/dist/playwright/index.js.map +1 -1
- package/dist/playwright/states-reporter.cjs +123 -0
- package/dist/playwright/states-reporter.cjs.map +1 -0
- package/dist/playwright/states-reporter.d.cts +46 -0
- package/dist/playwright/states-reporter.d.ts +46 -0
- package/dist/playwright/states-reporter.js +88 -0
- package/dist/playwright/states-reporter.js.map +1 -0
- package/dist/playwright/states.cjs +118 -0
- package/dist/playwright/states.cjs.map +1 -0
- package/dist/playwright/states.d.cts +120 -0
- package/dist/playwright/states.d.ts +120 -0
- package/dist/playwright/states.js +88 -0
- package/dist/playwright/states.js.map +1 -0
- package/dist/react/index.cjs +163 -3255
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +62 -275
- package/dist/react/index.d.ts +62 -275
- package/dist/react/index.js +151 -3268
- package/dist/react/index.js.map +1 -1
- package/dist/scan/index.cjs +1194 -322
- package/dist/scan/index.cjs.map +1 -1
- package/dist/scan/index.d.cts +274 -8
- package/dist/scan/index.d.ts +274 -8
- package/dist/scan/index.js +1185 -322
- package/dist/scan/index.js.map +1 -1
- package/package.json +27 -31
- package/dist/cloud/index.cjs +0 -682
- package/dist/cloud/index.cjs.map +0 -1
- package/dist/cloud/index.d.cts +0 -270
- package/dist/cloud/index.d.ts +0 -270
- package/dist/cloud/index.js +0 -645
- package/dist/cloud/index.js.map +0 -1
package/dist/scan/index.d.cts
CHANGED
|
@@ -12,6 +12,32 @@ interface EntityRef {
|
|
|
12
12
|
kind: EntityKind;
|
|
13
13
|
id: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The four kinds every captured route is expected to render — the state-matrix
|
|
17
|
+
* axis. A capture that only shoots the happy path leaves most of the value on
|
|
18
|
+
* the table, so a missing core kind must be captured, waived (the page CANNOT
|
|
19
|
+
* render it), or acknowledged in the MISSING_KINDS baseline.
|
|
20
|
+
*/
|
|
21
|
+
declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
|
|
22
|
+
type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
|
|
23
|
+
/** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
|
|
24
|
+
type StateKind = CoreStateKind | "variant";
|
|
25
|
+
/**
|
|
26
|
+
* A declared render state of an entity — the "story"-like unit: a named
|
|
27
|
+
* condition the page/feature/widget can render in (loading / empty / error /
|
|
28
|
+
* multi-currency / …). Enumerated on the entity (not derived from syntax), it
|
|
29
|
+
* is the contract the visual-states capture must satisfy and the anchor for
|
|
30
|
+
* per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
|
|
31
|
+
* the registry holds only the name (+ optional kind / per-state acceptance).
|
|
32
|
+
*/
|
|
33
|
+
interface StateDecl {
|
|
34
|
+
name: string;
|
|
35
|
+
/** Canonical kind for the state-matrix axis (defaults to `variant`). */
|
|
36
|
+
kind?: StateKind;
|
|
37
|
+
/** Acceptance criteria that only this state can evidence. */
|
|
38
|
+
acceptance?: string[];
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
15
41
|
interface Metadata {
|
|
16
42
|
name?: string;
|
|
17
43
|
description?: string;
|
|
@@ -21,6 +47,21 @@ interface Metadata {
|
|
|
21
47
|
flows?: readonly string[];
|
|
22
48
|
features?: string[];
|
|
23
49
|
widgets?: string[];
|
|
50
|
+
/** Declared render states (see StateDecl); the capture-completeness gate. */
|
|
51
|
+
states?: StateDecl[];
|
|
52
|
+
/**
|
|
53
|
+
* `false` opts this page/feature/widget out of visual-states capture forever
|
|
54
|
+
* (a redirect, a static notice, an internal target). The page-coverage gate
|
|
55
|
+
* treats an opted-out route as accounted-for. Reason belongs in `description`.
|
|
56
|
+
*/
|
|
57
|
+
capture?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Per-core-kind waivers: a core kind this page's route legitimately CANNOT
|
|
60
|
+
* render (a create form has no `empty`), mapped to a substantive reason. The
|
|
61
|
+
* state-matrix gate treats a waived kind as accounted-for. A waiver is a
|
|
62
|
+
* permanent design statement — unlike MISSING_KINDS backlog, which is debt.
|
|
63
|
+
*/
|
|
64
|
+
waivers?: Partial<Record<CoreStateKind, string>>;
|
|
24
65
|
}
|
|
25
66
|
interface EntityWithMetaBase {
|
|
26
67
|
id: string;
|
|
@@ -66,6 +107,7 @@ type Entity = Route | Page | Feature | Widget | Region | Element | Primitive | F
|
|
|
66
107
|
type EntityByKind<K extends EntityKind> = Extract<Entity, {
|
|
67
108
|
kind: K;
|
|
68
109
|
}>;
|
|
110
|
+
type MetaEntityKind = Exclude<EntityKind, "route" | "flow">;
|
|
69
111
|
|
|
70
112
|
interface ReportRecord {
|
|
71
113
|
id: string;
|
|
@@ -119,6 +161,12 @@ interface AuditConfig {
|
|
|
119
161
|
scopeLeak?: boolean;
|
|
120
162
|
coverage?: boolean;
|
|
121
163
|
acceptance?: boolean;
|
|
164
|
+
/** State-capture completeness gate (default on when a manifest is present). */
|
|
165
|
+
states?: boolean;
|
|
166
|
+
/** Page-capture coverage gate (default on when a manifest is present). */
|
|
167
|
+
pageCoverage?: boolean;
|
|
168
|
+
/** State-matrix (core-kind) gate (default on when a manifest is present). */
|
|
169
|
+
stateMatrix?: boolean;
|
|
122
170
|
}
|
|
123
171
|
interface UidexConfig {
|
|
124
172
|
$schema?: string;
|
|
@@ -128,6 +176,18 @@ interface UidexConfig {
|
|
|
128
176
|
flows?: string[];
|
|
129
177
|
audit?: AuditConfig;
|
|
130
178
|
conventions?: ConventionsConfig;
|
|
179
|
+
/**
|
|
180
|
+
* Path (relative to the config dir) of the captured-states manifest the
|
|
181
|
+
* Playwright states reporter writes. The completeness gate reads it when
|
|
182
|
+
* present. Defaults to `uidex-states.json`.
|
|
183
|
+
*/
|
|
184
|
+
statesManifest?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Path (relative to the config dir) of the page-coverage baseline — the
|
|
187
|
+
* tool-managed, shrink-only backlog written by `uidex scan --update-baseline`.
|
|
188
|
+
* Defaults to `uidex-coverage-baseline.json`.
|
|
189
|
+
*/
|
|
190
|
+
coverageBaseline?: string;
|
|
131
191
|
}
|
|
132
192
|
interface DiscoveredConfig {
|
|
133
193
|
configPath: string;
|
|
@@ -186,6 +246,26 @@ interface MetadataExport {
|
|
|
186
246
|
featureSpans?: Span[];
|
|
187
247
|
/** Spans of the string-literal items in `widgets`, parallel to `widgets`. */
|
|
188
248
|
widgetSpans?: Span[];
|
|
249
|
+
/** Declared render states (page/feature/widget); see ParsedState. */
|
|
250
|
+
states?: ParsedState[];
|
|
251
|
+
/** `capture: false` opts the entity out of the page-coverage gate. */
|
|
252
|
+
capture?: boolean;
|
|
253
|
+
/** Per-core-kind waivers: kind → reason the route cannot render it. */
|
|
254
|
+
waivers?: Record<string, string>;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* A parsed `states` entry from `export const uidex`. The authored form is a
|
|
258
|
+
* string (bare name) or an object `{ name, acceptance?, description? }`; both
|
|
259
|
+
* normalize to this. `nameSpan` powers a future `uidex rename state`.
|
|
260
|
+
*/
|
|
261
|
+
interface ParsedState {
|
|
262
|
+
name: string;
|
|
263
|
+
/** Canonical kind: loading | empty | populated | error | variant. */
|
|
264
|
+
kind?: string;
|
|
265
|
+
acceptance?: string[];
|
|
266
|
+
description?: string;
|
|
267
|
+
/** Span of the state's name string literal. */
|
|
268
|
+
nameSpan?: Span;
|
|
189
269
|
}
|
|
190
270
|
/** A data-uidex* attribute whose value the scanner could not resolve. */
|
|
191
271
|
interface DynamicAttrFact {
|
|
@@ -383,6 +463,83 @@ interface ResolveOutput {
|
|
|
383
463
|
*/
|
|
384
464
|
declare function resolve(ctx: ResolveContext): ResolveOutput;
|
|
385
465
|
|
|
466
|
+
/**
|
|
467
|
+
* State-capture completeness — the deterministic replacement for a bespoke
|
|
468
|
+
* `check-states.mjs`. Cross-checks the states DECLARED on registry entities
|
|
469
|
+
* (`export const uidex = { states: [...] }`) against the states a capture run
|
|
470
|
+
* actually produced (a `uidex-states.json` manifest written by the Playwright
|
|
471
|
+
* states reporter):
|
|
472
|
+
*
|
|
473
|
+
* - `missing-state-capture` — a declared state no run captured. The gap the
|
|
474
|
+
* acceptance-grounded analysis surfaces (a promised behavior with no pixel
|
|
475
|
+
* evidence) becomes a mechanical audit failure.
|
|
476
|
+
* - `orphan-state-capture` — a run captured a state the entity never declared,
|
|
477
|
+
* so the contact sheet shows a state the registry doesn't know about.
|
|
478
|
+
*
|
|
479
|
+
* Pure: same (registry, manifest) → same diagnostics. Only runs when a manifest
|
|
480
|
+
* is present, so a plain `uidex scan` (no capture run) never fails on it.
|
|
481
|
+
*/
|
|
482
|
+
/** One `entity/state` a capture run recorded. */
|
|
483
|
+
interface CapturedState {
|
|
484
|
+
/** Registry entity id the capture rendered (e.g. "products"). */
|
|
485
|
+
entity: string;
|
|
486
|
+
/** Entity kind, when the capture recorded it (page/feature/widget). */
|
|
487
|
+
kind?: MetaEntityKind;
|
|
488
|
+
/** The declared state name captured (e.g. "new-filled"). */
|
|
489
|
+
state: string;
|
|
490
|
+
/** Canonical matrix kind (loading/empty/populated/error/variant). */
|
|
491
|
+
stateKind?: string;
|
|
492
|
+
/** URL pathname the capture ran against (page-coverage gate matches it to a route). */
|
|
493
|
+
url?: string;
|
|
494
|
+
/** Explicit route pattern the capture covers, when supplied. */
|
|
495
|
+
route?: string;
|
|
496
|
+
}
|
|
497
|
+
interface CapturedStatesManifest {
|
|
498
|
+
captured: CapturedState[];
|
|
499
|
+
}
|
|
500
|
+
declare function checkStateCoverage(registry: Registry, manifest: CapturedStatesManifest): Diagnostic[];
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Page-capture coverage — the coarse gate above the per-state gate. Every
|
|
504
|
+
* derived route must be accounted for: captured (a run drove it), opted out
|
|
505
|
+
* (`export const uidex = { page, capture: false }`), or acknowledged backlog (a
|
|
506
|
+
* tool-managed, shrink-only baseline). A route in none of those is a *new*
|
|
507
|
+
* uncaptured page and fails hard — the ratchet that keeps debt from growing.
|
|
508
|
+
*
|
|
509
|
+
* uidex derives the route set (route groups stripped, dynamic segments kept), so
|
|
510
|
+
* unlike a hand-rolled `src/app/**` walk there is no page list to enumerate or
|
|
511
|
+
* keep from rotting: a route exists in the registry or it doesn't. And captures
|
|
512
|
+
* observe the URL they ran against, so which route a capture covers is matched,
|
|
513
|
+
* never hand-declared.
|
|
514
|
+
*/
|
|
515
|
+
/** The committed, tool-managed backlog. Shrinks as pages/kinds get captured. */
|
|
516
|
+
interface PageCoverageBaseline {
|
|
517
|
+
/** Route patterns acknowledged as uncaptured (e.g. "/[scope]/collections"). */
|
|
518
|
+
uncapturedPages: string[];
|
|
519
|
+
/** route → core kinds acknowledged as not-yet-captured (the matrix backlog). */
|
|
520
|
+
missingKinds?: Record<string, string[]>;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Turn a Next-style route pattern into an anchored matcher.
|
|
524
|
+
* `/[scope]/products/[productId]/edit` → matches `/acme/products/p1/edit`
|
|
525
|
+
* `/[...slug]` (catch-all) → matches one or more segments
|
|
526
|
+
* Returns the literal-segment count as a specificity score, so the most literal
|
|
527
|
+
* matching pattern wins when several match (e.g. `/x/new` beats `/x/[id]`).
|
|
528
|
+
*/
|
|
529
|
+
declare function compileRoute(pattern: string): {
|
|
530
|
+
test: (url: string) => boolean;
|
|
531
|
+
specificity: number;
|
|
532
|
+
};
|
|
533
|
+
/** The route pattern (from the given set) that most-specifically matches a URL. */
|
|
534
|
+
declare function matchUrlToRoute(url: string, routePaths: string[]): string | null;
|
|
535
|
+
declare function checkPageCoverage(registry: Registry, manifest: CapturedStatesManifest, baseline?: PageCoverageBaseline): Diagnostic[];
|
|
536
|
+
/**
|
|
537
|
+
* Compute the shrink-only baseline for `--update-baseline`: every route with no
|
|
538
|
+
* capture and no opt-out. Seeds on first run and prunes on later runs; growth
|
|
539
|
+
* only ever happens through this explicit command, visible in the file's diff.
|
|
540
|
+
*/
|
|
541
|
+
declare function computePageBaseline(registry: Registry, manifest: CapturedStatesManifest): PageCoverageBaseline;
|
|
542
|
+
|
|
386
543
|
interface AuditOptions {
|
|
387
544
|
registry: Registry;
|
|
388
545
|
extracted: ExtractedFile[];
|
|
@@ -393,12 +550,28 @@ interface AuditOptions {
|
|
|
393
550
|
check?: boolean;
|
|
394
551
|
lint?: boolean;
|
|
395
552
|
resolveDiagnostics?: Diagnostic[];
|
|
396
|
-
/** Freshly-emitted
|
|
553
|
+
/** Freshly-emitted DATA-file bytes (the entity array), required for --check. */
|
|
397
554
|
generated?: string;
|
|
398
|
-
/** On-disk contents of the
|
|
555
|
+
/** On-disk contents of the data file at scan time; `null` if it does not exist. */
|
|
399
556
|
existingOnDisk?: string | null;
|
|
400
|
-
/** Relative path of the
|
|
557
|
+
/** Relative path of the data file; used in diagnostics. */
|
|
401
558
|
outputPath?: string;
|
|
559
|
+
/** Freshly-emitted TYPES-file bytes; enables the types-file --check compare. */
|
|
560
|
+
typesGenerated?: string;
|
|
561
|
+
/** On-disk contents of the types file at scan time; `null` if it does not exist. */
|
|
562
|
+
typesOnDisk?: string | null;
|
|
563
|
+
/** Relative path of the configured `output` (types) file; used in diagnostics. */
|
|
564
|
+
typesOutputPath?: string;
|
|
565
|
+
/** Freshly-emitted LOCS-file bytes; enables the locs-file --check compare. */
|
|
566
|
+
locsGenerated?: string;
|
|
567
|
+
/** On-disk contents of the locs file at scan time; `null` if it does not exist. */
|
|
568
|
+
locsOnDisk?: string | null;
|
|
569
|
+
/** Relative path of the `.locs` file; used in diagnostics. */
|
|
570
|
+
locsOutputPath?: string;
|
|
571
|
+
/** Captured-states manifest for the completeness gate; absent → gate skipped. */
|
|
572
|
+
capturedStates?: CapturedStatesManifest;
|
|
573
|
+
/** Page-coverage baseline (the shrink-only backlog); absent → empty baseline. */
|
|
574
|
+
pageBaseline?: PageCoverageBaseline;
|
|
402
575
|
}
|
|
403
576
|
declare function audit(opts: AuditOptions): AuditSummary;
|
|
404
577
|
|
|
@@ -408,7 +581,31 @@ interface EmitOptions {
|
|
|
408
581
|
/** The import source for `createUidex` in the generated preconfigured export. */
|
|
409
582
|
uidexImport?: string;
|
|
410
583
|
}
|
|
411
|
-
|
|
584
|
+
/**
|
|
585
|
+
* The scanner emits THREE artifacts, split by consumer:
|
|
586
|
+
*
|
|
587
|
+
* - `types` — the id unions + the `Uidex` authoring-shape namespace. Pure types,
|
|
588
|
+
* no runtime, no `@ts-nocheck`. This is the file the ~dozens of
|
|
589
|
+
* `import type { Uidex } from "@/uidex.gen"` sites resolve, so it must stay
|
|
590
|
+
* small: an `import type` still forces tsc/tsserver to fully parse the target
|
|
591
|
+
* module, so keeping the runtime entity data out of it is what keeps the editor
|
|
592
|
+
* and type-checker responsive across every consumer file.
|
|
593
|
+
* - `data` — the AUTHORED registry (route/page/feature/widget/primitive/flow) +
|
|
594
|
+
* `gitContext` + `loadRegistry` + the preconfigured `uidex` instance. Runtime,
|
|
595
|
+
* `@ts-nocheck`. Loaded eagerly by the devtools on mount.
|
|
596
|
+
* - `locs` — the thin element/region `{ id, loc }` entities, emitted as positional
|
|
597
|
+
* tuples (see `emitLocsModule`). Loaded lazily by the devtools (idle / first
|
|
598
|
+
* inspect) via `loadLocs`, so ~90% of the entity count stays out of the initial
|
|
599
|
+
* devtools chunk.
|
|
600
|
+
*/
|
|
601
|
+
interface EmitResult {
|
|
602
|
+
types: string;
|
|
603
|
+
/** Authored-metadata registry (pages/features/widgets/flows/…). */
|
|
604
|
+
data: string;
|
|
605
|
+
/** Deferred `id → loc` module for the thin element/region entities. */
|
|
606
|
+
locs: string;
|
|
607
|
+
}
|
|
608
|
+
declare function emit(opts: EmitOptions): EmitResult;
|
|
412
609
|
|
|
413
610
|
/**
|
|
414
611
|
* Detect framework-aware routes:
|
|
@@ -462,6 +659,20 @@ interface RunScanOptions {
|
|
|
462
659
|
check?: boolean;
|
|
463
660
|
lint?: boolean;
|
|
464
661
|
configs?: DiscoveredConfig[];
|
|
662
|
+
/** Captured-states manifest for the completeness gate; overrides on-disk load. */
|
|
663
|
+
capturedStates?: CapturedStatesManifest;
|
|
664
|
+
/** Page-coverage baseline; overrides on-disk load. */
|
|
665
|
+
pageBaseline?: PageCoverageBaseline;
|
|
666
|
+
}
|
|
667
|
+
/** Load the page-coverage baseline from disk, if present + well-formed. */
|
|
668
|
+
declare function loadPageBaseline(configDir: string, config: UidexConfig): PageCoverageBaseline | undefined;
|
|
669
|
+
/** One generated artifact: its bytes plus where it lands (abs + repo-relative). */
|
|
670
|
+
interface ScanArtifact {
|
|
671
|
+
generated: string;
|
|
672
|
+
/** Absolute path on disk. */
|
|
673
|
+
outputPath: string;
|
|
674
|
+
/** Path relative to the config dir, for diagnostics. */
|
|
675
|
+
outputRel: string;
|
|
465
676
|
}
|
|
466
677
|
interface ScanResult {
|
|
467
678
|
config: UidexConfig;
|
|
@@ -469,11 +680,50 @@ interface ScanResult {
|
|
|
469
680
|
registry: Registry;
|
|
470
681
|
gitContext: GitContext;
|
|
471
682
|
audit?: AuditSummary;
|
|
472
|
-
|
|
473
|
-
|
|
683
|
+
/** Pure-types artifact (`config.output`, e.g. `uidex.gen.ts`). */
|
|
684
|
+
types: ScanArtifact;
|
|
685
|
+
/** Authored-registry artifact (the sibling `.data` module). */
|
|
686
|
+
data: ScanArtifact;
|
|
687
|
+
/** Deferred element/region source-location artifact (the sibling `.locs` module). */
|
|
688
|
+
locs: ScanArtifact;
|
|
689
|
+
/** The captured-states manifest in effect this run, if any (for --update-baseline). */
|
|
690
|
+
capturedStates?: CapturedStatesManifest;
|
|
474
691
|
}
|
|
475
692
|
declare function runScan(opts?: RunScanOptions): ScanResult[];
|
|
476
|
-
|
|
693
|
+
/**
|
|
694
|
+
* Write all three generated artifacts (types + data + locs), each only if
|
|
695
|
+
* changed. Splitting them means a change confined to one (e.g. adding an element
|
|
696
|
+
* only touches `.locs`) never rewrites the others, so watchers recompile only what
|
|
697
|
+
* actually moved. Returns `true` if any file was written.
|
|
698
|
+
*/
|
|
699
|
+
declare function writeScanResult(result: ScanResult): boolean;
|
|
700
|
+
/** Absolute path of the page-coverage baseline for a scan result. */
|
|
701
|
+
declare function pageBaselinePath(result: ScanResult): string;
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* State-matrix coverage — the second completeness axis. A capture that only ever
|
|
705
|
+
* shoots the happy path leaves most of the harness's value on the table, so
|
|
706
|
+
* every *captured* route must render each of the four core kinds
|
|
707
|
+
* (loading / empty / populated / error), or account for the gap:
|
|
708
|
+
*
|
|
709
|
+
* - a **waiver** (`export const uidex = { page, waivers: { empty: "…" } }`) —
|
|
710
|
+
* the route CANNOT render that kind (a create form has no empty state);
|
|
711
|
+
* - the **MISSING_KINDS baseline** — the route CAN render it and nobody has
|
|
712
|
+
* captured it yet (a per-(route, kind) shrink-only backlog).
|
|
713
|
+
*
|
|
714
|
+
* Anything else is a `core-kind` error. Only *captured* routes are in scope: a
|
|
715
|
+
* route with no capture at all is a page-coverage concern, not a matrix hole.
|
|
716
|
+
*/
|
|
717
|
+
/** route → core kinds acknowledged as not-yet-captured (the finer ratchet). */
|
|
718
|
+
interface StateMatrixBaseline {
|
|
719
|
+
missingKinds: Record<string, string[]>;
|
|
720
|
+
}
|
|
721
|
+
declare function checkStateMatrix(registry: Registry, manifest: CapturedStatesManifest, baseline?: StateMatrixBaseline): Diagnostic[];
|
|
722
|
+
/**
|
|
723
|
+
* Compute the shrink-only MISSING_KINDS baseline for `--update-baseline`: every
|
|
724
|
+
* (captured route, core kind) that is neither captured nor waived.
|
|
725
|
+
*/
|
|
726
|
+
declare function computeMissingKinds(registry: Registry, manifest: CapturedStatesManifest): Record<string, string[]>;
|
|
477
727
|
|
|
478
728
|
/**
|
|
479
729
|
* Applies the machine-generated fixes attached to diagnostics.
|
|
@@ -563,12 +813,26 @@ declare const DEFAULT_CONVENTIONS: Required<Pick<NonNullable<UidexConfig["conven
|
|
|
563
813
|
* bootstrapping before the first scan).
|
|
564
814
|
*/
|
|
565
815
|
declare namespace Uidex {
|
|
816
|
+
type CoreStateKind = "loading" | "empty" | "populated" | "error";
|
|
817
|
+
type StateKind = CoreStateKind | "variant";
|
|
818
|
+
/** A declared render state, as authored in `states: [{ name, ... }]`. */
|
|
819
|
+
interface State {
|
|
820
|
+
name: string;
|
|
821
|
+
kind?: StateKind;
|
|
822
|
+
acceptance?: readonly string[];
|
|
823
|
+
description?: string;
|
|
824
|
+
}
|
|
825
|
+
/** Per-core-kind waivers: a kind this route cannot render → reason. */
|
|
826
|
+
type Waivers = Partial<Record<CoreStateKind, string>>;
|
|
566
827
|
interface Page<PageIds extends string = string, FeatureIds extends string = string, WidgetIds extends string = string> {
|
|
567
828
|
page: PageIds | false;
|
|
568
829
|
name?: string;
|
|
569
830
|
features?: readonly FeatureIds[];
|
|
570
831
|
widgets?: readonly WidgetIds[];
|
|
571
832
|
acceptance?: readonly string[];
|
|
833
|
+
states?: readonly (string | State)[];
|
|
834
|
+
capture?: boolean;
|
|
835
|
+
waivers?: Waivers;
|
|
572
836
|
description?: string;
|
|
573
837
|
}
|
|
574
838
|
interface Feature<FeatureIds extends string = string> {
|
|
@@ -576,6 +840,7 @@ declare namespace Uidex {
|
|
|
576
840
|
name?: string;
|
|
577
841
|
features?: readonly FeatureIds[];
|
|
578
842
|
acceptance?: readonly string[];
|
|
843
|
+
states?: readonly (string | State)[];
|
|
579
844
|
description?: string;
|
|
580
845
|
}
|
|
581
846
|
interface Primitive<PrimitiveIds extends string = string> {
|
|
@@ -587,6 +852,7 @@ declare namespace Uidex {
|
|
|
587
852
|
widget: WidgetIds;
|
|
588
853
|
name?: string;
|
|
589
854
|
acceptance?: readonly string[];
|
|
855
|
+
states?: readonly (string | State)[];
|
|
590
856
|
description?: string;
|
|
591
857
|
}
|
|
592
858
|
interface Flow<FlowIds extends string = string> {
|
|
@@ -599,4 +865,4 @@ declare namespace Uidex {
|
|
|
599
865
|
}
|
|
600
866
|
}
|
|
601
867
|
|
|
602
|
-
export { type Annotation, type AnnotationKind, type AppliedFix, type ApplyFixesResult, type AuditConfig, type AuditSummary, CONFIG_FILENAME, type CliOptions, type CliResult, ConfigError, type ConventionsConfig, DEFAULT_CONVENTIONS, type DetectedRoute, type Diagnostic, type DiagnosticFix, type DiagnosticSeverity, type DiscoveredConfig, type ExtractedFile, type FixEdit, type GitContext, type ImportFact, type LandmarkFact, type MetadataExport, type MetadataExportKind, type RenameKind, type RenameOptions, type RenameResult, type RunScanOptions, type ScaffoldKind, type ScaffoldOptions, type ScaffoldResult, type ScaffoldSpecOptions, type ScanResult, type ScannedFile, type SourceConfig, type Span, Uidex, type UidexConfig, applyFixes, audit, detectRoutes, discover, emit, extract, extractUidexExports, globToRegExp, parseConfig, pathToId, renameEntity, resolve, resolveGitContext, run as runCli, runScan, scaffoldSpec, scaffoldWidgetSpec, validateConfig, walk, writeScanResult };
|
|
868
|
+
export { type Annotation, type AnnotationKind, type AppliedFix, type ApplyFixesResult, type AuditConfig, type AuditSummary, CONFIG_FILENAME, type CapturedState, type CapturedStatesManifest, type CliOptions, type CliResult, ConfigError, type ConventionsConfig, DEFAULT_CONVENTIONS, type DetectedRoute, type Diagnostic, type DiagnosticFix, type DiagnosticSeverity, type DiscoveredConfig, type ExtractedFile, type FixEdit, type GitContext, type ImportFact, type LandmarkFact, type MetadataExport, type MetadataExportKind, type PageCoverageBaseline, type ParsedState, type RenameKind, type RenameOptions, type RenameResult, type RunScanOptions, type ScaffoldKind, type ScaffoldOptions, type ScaffoldResult, type ScaffoldSpecOptions, type ScanResult, type ScannedFile, type SourceConfig, type Span, type StateMatrixBaseline, Uidex, type UidexConfig, applyFixes, audit, checkPageCoverage, checkStateCoverage, checkStateMatrix, compileRoute, computeMissingKinds, computePageBaseline, detectRoutes, discover, emit, extract, extractUidexExports, globToRegExp, loadPageBaseline, matchUrlToRoute, pageBaselinePath, parseConfig, pathToId, renameEntity, resolve, resolveGitContext, run as runCli, runScan, scaffoldSpec, scaffoldWidgetSpec, validateConfig, walk, writeScanResult };
|