uidex 0.10.0 → 0.11.1

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/index.d.cts CHANGED
@@ -36,19 +36,39 @@ interface StateDecl {
36
36
  name: string;
37
37
  /** Canonical kind for the state-matrix axis (defaults to `variant`). */
38
38
  kind?: StateKind;
39
- /** Acceptance criteria that only this state can evidence. */
40
- acceptance?: string[];
39
+ /**
40
+ * Acceptance criteria that only this state can evidence. Normalized into the
41
+ * same `{ id, rev, text }` regime as entity-level `acceptance` (one
42
+ * criterion-id namespace per entity), so per-state criteria are claimable by
43
+ * `uidexCovers` and visible to every acceptance gate.
44
+ */
45
+ acceptance?: AcceptanceCriterion[];
41
46
  description?: string;
42
47
  }
48
+ /**
49
+ * A normalized acceptance criterion. Authored either as a bare string (sugar:
50
+ * `id` is a deterministic kebab slug of the text, `rev` is 1) or as an object
51
+ * `{ id, rev?, text }`; parse-time normalization means everything downstream —
52
+ * audit, scaffold, the devtools — always sees this object shape. `rev` is the
53
+ * pin flows cover against (`uidexCovers("entity", "id@rev")`): bumping it when
54
+ * the criterion's meaning changes is what makes outdated-coverage detectable.
55
+ */
56
+ interface AcceptanceCriterion {
57
+ id: string;
58
+ rev: number;
59
+ text: string;
60
+ }
43
61
  interface Metadata {
44
62
  name?: string;
45
63
  description?: string;
46
- acceptance?: string[];
64
+ acceptance?: AcceptanceCriterion[];
47
65
  notes?: string;
48
66
  composes?: EntityRef[];
49
67
  flows?: readonly string[];
50
68
  features?: string[];
51
69
  widgets?: string[];
70
+ /** Page ids a feature declares it must be mounted on (feature kind only). */
71
+ surfaces?: string[];
52
72
  /** Declared render states (see StateDecl); the capture-completeness gate. */
53
73
  states?: StateDecl[];
54
74
  /**
@@ -86,12 +106,25 @@ interface FlowStep {
86
106
  entityId: string;
87
107
  action?: string;
88
108
  }
109
+ /**
110
+ * A per-criterion coverage claim a flow makes via
111
+ * `uidexCovers("<entityId>", "<criterionId>@<rev>")`. The rev is REQUIRED at
112
+ * the claim site — a rev-less claim could never go stale, which would defeat
113
+ * the outdated-detection the pin exists for.
114
+ */
115
+ interface FlowCover {
116
+ entity: string;
117
+ criterion: string;
118
+ rev: number;
119
+ }
89
120
  interface Flow {
90
121
  kind: "flow";
91
122
  id: string;
92
123
  loc: Location;
93
124
  touches: string[];
94
125
  steps: FlowStep[];
126
+ /** Acceptance-criterion coverage claims made inside this flow's describe. */
127
+ covers?: FlowCover[];
95
128
  }
96
129
  interface Page extends EntityWithMetaBase {
97
130
  kind: "page";
package/dist/index.d.ts CHANGED
@@ -36,19 +36,39 @@ interface StateDecl {
36
36
  name: string;
37
37
  /** Canonical kind for the state-matrix axis (defaults to `variant`). */
38
38
  kind?: StateKind;
39
- /** Acceptance criteria that only this state can evidence. */
40
- acceptance?: string[];
39
+ /**
40
+ * Acceptance criteria that only this state can evidence. Normalized into the
41
+ * same `{ id, rev, text }` regime as entity-level `acceptance` (one
42
+ * criterion-id namespace per entity), so per-state criteria are claimable by
43
+ * `uidexCovers` and visible to every acceptance gate.
44
+ */
45
+ acceptance?: AcceptanceCriterion[];
41
46
  description?: string;
42
47
  }
48
+ /**
49
+ * A normalized acceptance criterion. Authored either as a bare string (sugar:
50
+ * `id` is a deterministic kebab slug of the text, `rev` is 1) or as an object
51
+ * `{ id, rev?, text }`; parse-time normalization means everything downstream —
52
+ * audit, scaffold, the devtools — always sees this object shape. `rev` is the
53
+ * pin flows cover against (`uidexCovers("entity", "id@rev")`): bumping it when
54
+ * the criterion's meaning changes is what makes outdated-coverage detectable.
55
+ */
56
+ interface AcceptanceCriterion {
57
+ id: string;
58
+ rev: number;
59
+ text: string;
60
+ }
43
61
  interface Metadata {
44
62
  name?: string;
45
63
  description?: string;
46
- acceptance?: string[];
64
+ acceptance?: AcceptanceCriterion[];
47
65
  notes?: string;
48
66
  composes?: EntityRef[];
49
67
  flows?: readonly string[];
50
68
  features?: string[];
51
69
  widgets?: string[];
70
+ /** Page ids a feature declares it must be mounted on (feature kind only). */
71
+ surfaces?: string[];
52
72
  /** Declared render states (see StateDecl); the capture-completeness gate. */
53
73
  states?: StateDecl[];
54
74
  /**
@@ -86,12 +106,25 @@ interface FlowStep {
86
106
  entityId: string;
87
107
  action?: string;
88
108
  }
109
+ /**
110
+ * A per-criterion coverage claim a flow makes via
111
+ * `uidexCovers("<entityId>", "<criterionId>@<rev>")`. The rev is REQUIRED at
112
+ * the claim site — a rev-less claim could never go stale, which would defeat
113
+ * the outdated-detection the pin exists for.
114
+ */
115
+ interface FlowCover {
116
+ entity: string;
117
+ criterion: string;
118
+ rev: number;
119
+ }
89
120
  interface Flow {
90
121
  kind: "flow";
91
122
  id: string;
92
123
  loc: Location;
93
124
  touches: string[];
94
125
  steps: FlowStep[];
126
+ /** Acceptance-criterion coverage claims made inside this flow's describe. */
127
+ covers?: FlowCover[];
95
128
  }
96
129
  interface Page extends EntityWithMetaBase {
97
130
  kind: "page";
package/dist/index.js CHANGED
@@ -7329,7 +7329,10 @@ function createEntityDetailView(config) {
7329
7329
  sections.push({ id: "description", text: meta.description });
7330
7330
  }
7331
7331
  if (offerAcceptance && meta?.acceptance?.length) {
7332
- sections.push({ id: "acceptance", items: meta.acceptance });
7332
+ sections.push({
7333
+ id: "acceptance",
7334
+ items: meta.acceptance.map((c) => c.text)
7335
+ });
7333
7336
  }
7334
7337
  if (entity) {
7335
7338
  for (const s of config.extraSections?.(ctx, entity) ?? []) {