@objectstack/lint 11.9.0 → 12.0.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/index.cjs +197 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -19
- package/dist/index.d.ts +90 -19
- package/dist/index.js +189 -23
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -69,7 +69,7 @@ interface WidgetBindingFinding {
|
|
|
69
69
|
/** How to fix (or deliberately suppress) it. */
|
|
70
70
|
hint: string;
|
|
71
71
|
}
|
|
72
|
-
type AnyRec$
|
|
72
|
+
type AnyRec$a = Record<string, unknown>;
|
|
73
73
|
/**
|
|
74
74
|
* Validate every dashboard widget's dataset binding. Returns the list of
|
|
75
75
|
* findings (empty = clean). Caller decides how to surface them: `error`
|
|
@@ -77,7 +77,7 @@ type AnyRec$8 = Record<string, unknown>;
|
|
|
77
77
|
* should fail validate/build; `warning` findings are advisory and must
|
|
78
78
|
* never fail the build on their own.
|
|
79
79
|
*/
|
|
80
|
-
declare function validateWidgetBindings(stack: AnyRec$
|
|
80
|
+
declare function validateWidgetBindings(stack: AnyRec$a): WidgetBindingFinding[];
|
|
81
81
|
|
|
82
82
|
interface ExprIssue {
|
|
83
83
|
where: string;
|
|
@@ -90,12 +90,35 @@ interface ExprIssue {
|
|
|
90
90
|
*/
|
|
91
91
|
severity?: 'error' | 'warning';
|
|
92
92
|
}
|
|
93
|
-
type AnyRec$
|
|
93
|
+
type AnyRec$9 = Record<string, unknown>;
|
|
94
94
|
/**
|
|
95
95
|
* Validate every predicate in the stack. Returns the list of issues (empty =
|
|
96
96
|
* clean). Caller decides how to surface / whether to fail the build.
|
|
97
97
|
*/
|
|
98
|
-
declare function validateStackExpressions(stack: AnyRec$
|
|
98
|
+
declare function validateStackExpressions(stack: AnyRec$9): ExprIssue[];
|
|
99
|
+
|
|
100
|
+
type ListViewModeSeverity = 'error' | 'warning';
|
|
101
|
+
interface ListViewModeFinding {
|
|
102
|
+
severity: ListViewModeSeverity;
|
|
103
|
+
rule: string;
|
|
104
|
+
/** Human-readable location, e.g. `object "task" › listViews.my_pending`. */
|
|
105
|
+
where: string;
|
|
106
|
+
/** Config path, e.g. `objects[0].listViews.my_pending.userFilters`. */
|
|
107
|
+
path: string;
|
|
108
|
+
message: string;
|
|
109
|
+
hint: string;
|
|
110
|
+
}
|
|
111
|
+
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
112
|
+
type AnyRec$8 = Record<string, unknown>;
|
|
113
|
+
/**
|
|
114
|
+
* Flag ADR-0053 "views" mode violations: `userFilters` / `quickFilters` on an
|
|
115
|
+
* object's built-in named views or a `defineView` default `list` / named
|
|
116
|
+
* `listViews`. Returns the list of findings (empty = clean). Caller decides how
|
|
117
|
+
* to surface / whether to fail the build.
|
|
118
|
+
*
|
|
119
|
+
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
120
|
+
*/
|
|
121
|
+
declare function validateListViewMode(stack: AnyRec$8): ListViewModeFinding[];
|
|
99
122
|
|
|
100
123
|
type StyleSeverity = 'error' | 'warning';
|
|
101
124
|
interface StyleFinding {
|
|
@@ -113,14 +136,14 @@ declare const STYLE_CLASSNAME_TAILWIND = "style-classname-tailwind";
|
|
|
113
136
|
declare const STYLE_RESPONSIVE_NO_BASE = "style-responsive-no-base";
|
|
114
137
|
declare const STYLE_UNKNOWN_CSS_PROPERTY = "style-unknown-css-property";
|
|
115
138
|
declare const STYLE_UNKNOWN_TOKEN = "style-unknown-token";
|
|
116
|
-
type AnyRec$
|
|
139
|
+
type AnyRec$7 = Record<string, unknown>;
|
|
117
140
|
/**
|
|
118
141
|
* Validate every page's component tree for SDUI styling correctness (ADR-0065).
|
|
119
142
|
* Returns findings (empty = clean). `error` findings describe styles that are
|
|
120
143
|
* silently dropped and should fail validate/build; `warning` findings are
|
|
121
144
|
* advisory (typos, drift, footguns).
|
|
122
145
|
*/
|
|
123
|
-
declare function validateResponsiveStyles(stack: AnyRec$
|
|
146
|
+
declare function validateResponsiveStyles(stack: AnyRec$7): StyleFinding[];
|
|
124
147
|
|
|
125
148
|
type JsxPageSeverity = 'error' | 'warning';
|
|
126
149
|
interface JsxPageFinding {
|
|
@@ -133,8 +156,8 @@ interface JsxPageFinding {
|
|
|
133
156
|
message: string;
|
|
134
157
|
hint: string;
|
|
135
158
|
}
|
|
136
|
-
type AnyRec$
|
|
137
|
-
declare function validateJsxPages(stack: AnyRec$
|
|
159
|
+
type AnyRec$6 = Record<string, unknown>;
|
|
160
|
+
declare function validateJsxPages(stack: AnyRec$6, opts?: {
|
|
138
161
|
manifest?: Manifest;
|
|
139
162
|
}): JsxPageFinding[];
|
|
140
163
|
|
|
@@ -147,8 +170,8 @@ interface ReactPageFinding {
|
|
|
147
170
|
message: string;
|
|
148
171
|
hint: string;
|
|
149
172
|
}
|
|
150
|
-
type AnyRec$
|
|
151
|
-
declare function validateReactPages(stack: AnyRec$
|
|
173
|
+
type AnyRec$5 = Record<string, unknown>;
|
|
174
|
+
declare function validateReactPages(stack: AnyRec$5): ReactPageFinding[];
|
|
152
175
|
|
|
153
176
|
type ReactPropSeverity = 'error' | 'warning';
|
|
154
177
|
interface ReactPropFinding {
|
|
@@ -159,8 +182,8 @@ interface ReactPropFinding {
|
|
|
159
182
|
message: string;
|
|
160
183
|
hint: string;
|
|
161
184
|
}
|
|
162
|
-
type AnyRec$
|
|
163
|
-
declare function validateReactPageProps(stack: AnyRec$
|
|
185
|
+
type AnyRec$4 = Record<string, unknown>;
|
|
186
|
+
declare function validateReactPageProps(stack: AnyRec$4): ReactPropFinding[];
|
|
164
187
|
|
|
165
188
|
type SourceStyleSeverity = 'error' | 'warning';
|
|
166
189
|
interface SourceStyleFinding {
|
|
@@ -172,8 +195,8 @@ interface SourceStyleFinding {
|
|
|
172
195
|
hint: string;
|
|
173
196
|
}
|
|
174
197
|
declare const PAGE_SOURCE_CLASSNAME = "page-source-className-tailwind";
|
|
175
|
-
type AnyRec$
|
|
176
|
-
declare function validatePageSourceStyling(stack: AnyRec$
|
|
198
|
+
type AnyRec$3 = Record<string, unknown>;
|
|
199
|
+
declare function validatePageSourceStyling(stack: AnyRec$3): SourceStyleFinding[];
|
|
177
200
|
|
|
178
201
|
/**
|
|
179
202
|
* Build-time record-title diagnostics (ADR-0079).
|
|
@@ -217,14 +240,14 @@ interface RecordTitleFinding {
|
|
|
217
240
|
/** How to fix it. */
|
|
218
241
|
hint: string;
|
|
219
242
|
}
|
|
220
|
-
type AnyRec$
|
|
243
|
+
type AnyRec$2 = Record<string, unknown>;
|
|
221
244
|
/**
|
|
222
245
|
* Validate every object's record-title declaration. Returns the list of
|
|
223
246
|
* findings (empty = clean). Both rules are advisory (`warning`): the caller
|
|
224
247
|
* must never fail the build on them alone — auto-provision + the `Record #<id>`
|
|
225
248
|
* floor guarantee a resolvable title at runtime.
|
|
226
249
|
*/
|
|
227
|
-
declare function validateRecordTitle(stack: AnyRec$
|
|
250
|
+
declare function validateRecordTitle(stack: AnyRec$2): RecordTitleFinding[];
|
|
228
251
|
|
|
229
252
|
/**
|
|
230
253
|
* Build-time semantic-role diagnostics (ADR-0085).
|
|
@@ -261,12 +284,60 @@ interface SemanticRoleFinding {
|
|
|
261
284
|
/** How to fix it. */
|
|
262
285
|
hint: string;
|
|
263
286
|
}
|
|
264
|
-
type AnyRec = Record<string, unknown>;
|
|
287
|
+
type AnyRec$1 = Record<string, unknown>;
|
|
265
288
|
/**
|
|
266
289
|
* Validate every object's semantic-role pointers. Returns the list of
|
|
267
290
|
* findings (empty = clean). Advisory only — the caller must never fail the
|
|
268
291
|
* build on these alone.
|
|
269
292
|
*/
|
|
270
|
-
declare function validateSemanticRoles(stack: AnyRec): SemanticRoleFinding[];
|
|
293
|
+
declare function validateSemanticRoles(stack: AnyRec$1): SemanticRoleFinding[];
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Build-time form-layout diagnostics (#2578).
|
|
297
|
+
*
|
|
298
|
+
* Authored form views carry field references and column-layout hints that are
|
|
299
|
+
* Zod-valid but can be silently wrong at render time — the "parsed, unmarked,
|
|
300
|
+
* silently inert" shape ADR-0078 prohibits. This lint catches the two that
|
|
301
|
+
* matter for multi-column, AI-authored forms, uniformly for `os build` /
|
|
302
|
+
* `os validate`, MCP authoring and hand authors (ADR-0019).
|
|
303
|
+
*
|
|
304
|
+
* Both rules are warnings, not errors — nothing is fully broken (an unknown
|
|
305
|
+
* field name is skipped; an over-wide colSpan is clamped) — but each is almost
|
|
306
|
+
* certainly an authoring mistake worth surfacing at author time:
|
|
307
|
+
*
|
|
308
|
+
* - `form-field-unknown` — a section references a field that is not on the
|
|
309
|
+
* form's bound object, so the field silently does not render.
|
|
310
|
+
* - `absolute-colspan-discouraged` — a field uses the absolute `colSpan`. Under
|
|
311
|
+
* a per-surface DERIVED column count (mobile 1 / modal 2 / page 3-4) a fixed
|
|
312
|
+
* span only lines up at the one width the author imagined; the renderer
|
|
313
|
+
* clamps it. The robust primitive is the relative `span: 'full'`.
|
|
314
|
+
*
|
|
315
|
+
* Scope: top-level form `views` (a `sections` array). Forms embedded inside
|
|
316
|
+
* page component trees are a follow-up — the walker deliberately stays shallow
|
|
317
|
+
* so it never guesses at an arbitrary component's object binding.
|
|
318
|
+
*/
|
|
319
|
+
declare const FORM_FIELD_UNKNOWN = "form-field-unknown";
|
|
320
|
+
declare const FORM_COLSPAN_ABSOLUTE = "absolute-colspan-discouraged";
|
|
321
|
+
type FormLayoutSeverity = 'error' | 'warning';
|
|
322
|
+
interface FormLayoutFinding {
|
|
323
|
+
/** Always `warning` today — both rules are advisory (see module note). */
|
|
324
|
+
severity: FormLayoutSeverity;
|
|
325
|
+
/** Diagnostic rule id, e.g. `form-field-unknown`. */
|
|
326
|
+
rule: string;
|
|
327
|
+
/** Human-readable location, e.g. `view "contract_form"`. */
|
|
328
|
+
where: string;
|
|
329
|
+
/** Config path, e.g. `views[2].sections[0].fields[3]`. */
|
|
330
|
+
path: string;
|
|
331
|
+
/** What is wrong. */
|
|
332
|
+
message: string;
|
|
333
|
+
/** How to fix it. */
|
|
334
|
+
hint: string;
|
|
335
|
+
}
|
|
336
|
+
type AnyRec = Record<string, unknown>;
|
|
337
|
+
/**
|
|
338
|
+
* Validate authored form-view layout. Returns findings (empty = clean).
|
|
339
|
+
* Advisory only — the caller must never fail the build on these alone.
|
|
340
|
+
*/
|
|
341
|
+
declare function validateFormLayout(stack: AnyRec): FormLayoutFinding[];
|
|
271
342
|
|
|
272
|
-
export { CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, type JsxPageFinding, type JsxPageSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, validateJsxPages, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|
|
343
|
+
export { CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface WidgetBindingFinding {
|
|
|
69
69
|
/** How to fix (or deliberately suppress) it. */
|
|
70
70
|
hint: string;
|
|
71
71
|
}
|
|
72
|
-
type AnyRec$
|
|
72
|
+
type AnyRec$a = Record<string, unknown>;
|
|
73
73
|
/**
|
|
74
74
|
* Validate every dashboard widget's dataset binding. Returns the list of
|
|
75
75
|
* findings (empty = clean). Caller decides how to surface them: `error`
|
|
@@ -77,7 +77,7 @@ type AnyRec$8 = Record<string, unknown>;
|
|
|
77
77
|
* should fail validate/build; `warning` findings are advisory and must
|
|
78
78
|
* never fail the build on their own.
|
|
79
79
|
*/
|
|
80
|
-
declare function validateWidgetBindings(stack: AnyRec$
|
|
80
|
+
declare function validateWidgetBindings(stack: AnyRec$a): WidgetBindingFinding[];
|
|
81
81
|
|
|
82
82
|
interface ExprIssue {
|
|
83
83
|
where: string;
|
|
@@ -90,12 +90,35 @@ interface ExprIssue {
|
|
|
90
90
|
*/
|
|
91
91
|
severity?: 'error' | 'warning';
|
|
92
92
|
}
|
|
93
|
-
type AnyRec$
|
|
93
|
+
type AnyRec$9 = Record<string, unknown>;
|
|
94
94
|
/**
|
|
95
95
|
* Validate every predicate in the stack. Returns the list of issues (empty =
|
|
96
96
|
* clean). Caller decides how to surface / whether to fail the build.
|
|
97
97
|
*/
|
|
98
|
-
declare function validateStackExpressions(stack: AnyRec$
|
|
98
|
+
declare function validateStackExpressions(stack: AnyRec$9): ExprIssue[];
|
|
99
|
+
|
|
100
|
+
type ListViewModeSeverity = 'error' | 'warning';
|
|
101
|
+
interface ListViewModeFinding {
|
|
102
|
+
severity: ListViewModeSeverity;
|
|
103
|
+
rule: string;
|
|
104
|
+
/** Human-readable location, e.g. `object "task" › listViews.my_pending`. */
|
|
105
|
+
where: string;
|
|
106
|
+
/** Config path, e.g. `objects[0].listViews.my_pending.userFilters`. */
|
|
107
|
+
path: string;
|
|
108
|
+
message: string;
|
|
109
|
+
hint: string;
|
|
110
|
+
}
|
|
111
|
+
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
112
|
+
type AnyRec$8 = Record<string, unknown>;
|
|
113
|
+
/**
|
|
114
|
+
* Flag ADR-0053 "views" mode violations: `userFilters` / `quickFilters` on an
|
|
115
|
+
* object's built-in named views or a `defineView` default `list` / named
|
|
116
|
+
* `listViews`. Returns the list of findings (empty = clean). Caller decides how
|
|
117
|
+
* to surface / whether to fail the build.
|
|
118
|
+
*
|
|
119
|
+
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
120
|
+
*/
|
|
121
|
+
declare function validateListViewMode(stack: AnyRec$8): ListViewModeFinding[];
|
|
99
122
|
|
|
100
123
|
type StyleSeverity = 'error' | 'warning';
|
|
101
124
|
interface StyleFinding {
|
|
@@ -113,14 +136,14 @@ declare const STYLE_CLASSNAME_TAILWIND = "style-classname-tailwind";
|
|
|
113
136
|
declare const STYLE_RESPONSIVE_NO_BASE = "style-responsive-no-base";
|
|
114
137
|
declare const STYLE_UNKNOWN_CSS_PROPERTY = "style-unknown-css-property";
|
|
115
138
|
declare const STYLE_UNKNOWN_TOKEN = "style-unknown-token";
|
|
116
|
-
type AnyRec$
|
|
139
|
+
type AnyRec$7 = Record<string, unknown>;
|
|
117
140
|
/**
|
|
118
141
|
* Validate every page's component tree for SDUI styling correctness (ADR-0065).
|
|
119
142
|
* Returns findings (empty = clean). `error` findings describe styles that are
|
|
120
143
|
* silently dropped and should fail validate/build; `warning` findings are
|
|
121
144
|
* advisory (typos, drift, footguns).
|
|
122
145
|
*/
|
|
123
|
-
declare function validateResponsiveStyles(stack: AnyRec$
|
|
146
|
+
declare function validateResponsiveStyles(stack: AnyRec$7): StyleFinding[];
|
|
124
147
|
|
|
125
148
|
type JsxPageSeverity = 'error' | 'warning';
|
|
126
149
|
interface JsxPageFinding {
|
|
@@ -133,8 +156,8 @@ interface JsxPageFinding {
|
|
|
133
156
|
message: string;
|
|
134
157
|
hint: string;
|
|
135
158
|
}
|
|
136
|
-
type AnyRec$
|
|
137
|
-
declare function validateJsxPages(stack: AnyRec$
|
|
159
|
+
type AnyRec$6 = Record<string, unknown>;
|
|
160
|
+
declare function validateJsxPages(stack: AnyRec$6, opts?: {
|
|
138
161
|
manifest?: Manifest;
|
|
139
162
|
}): JsxPageFinding[];
|
|
140
163
|
|
|
@@ -147,8 +170,8 @@ interface ReactPageFinding {
|
|
|
147
170
|
message: string;
|
|
148
171
|
hint: string;
|
|
149
172
|
}
|
|
150
|
-
type AnyRec$
|
|
151
|
-
declare function validateReactPages(stack: AnyRec$
|
|
173
|
+
type AnyRec$5 = Record<string, unknown>;
|
|
174
|
+
declare function validateReactPages(stack: AnyRec$5): ReactPageFinding[];
|
|
152
175
|
|
|
153
176
|
type ReactPropSeverity = 'error' | 'warning';
|
|
154
177
|
interface ReactPropFinding {
|
|
@@ -159,8 +182,8 @@ interface ReactPropFinding {
|
|
|
159
182
|
message: string;
|
|
160
183
|
hint: string;
|
|
161
184
|
}
|
|
162
|
-
type AnyRec$
|
|
163
|
-
declare function validateReactPageProps(stack: AnyRec$
|
|
185
|
+
type AnyRec$4 = Record<string, unknown>;
|
|
186
|
+
declare function validateReactPageProps(stack: AnyRec$4): ReactPropFinding[];
|
|
164
187
|
|
|
165
188
|
type SourceStyleSeverity = 'error' | 'warning';
|
|
166
189
|
interface SourceStyleFinding {
|
|
@@ -172,8 +195,8 @@ interface SourceStyleFinding {
|
|
|
172
195
|
hint: string;
|
|
173
196
|
}
|
|
174
197
|
declare const PAGE_SOURCE_CLASSNAME = "page-source-className-tailwind";
|
|
175
|
-
type AnyRec$
|
|
176
|
-
declare function validatePageSourceStyling(stack: AnyRec$
|
|
198
|
+
type AnyRec$3 = Record<string, unknown>;
|
|
199
|
+
declare function validatePageSourceStyling(stack: AnyRec$3): SourceStyleFinding[];
|
|
177
200
|
|
|
178
201
|
/**
|
|
179
202
|
* Build-time record-title diagnostics (ADR-0079).
|
|
@@ -217,14 +240,14 @@ interface RecordTitleFinding {
|
|
|
217
240
|
/** How to fix it. */
|
|
218
241
|
hint: string;
|
|
219
242
|
}
|
|
220
|
-
type AnyRec$
|
|
243
|
+
type AnyRec$2 = Record<string, unknown>;
|
|
221
244
|
/**
|
|
222
245
|
* Validate every object's record-title declaration. Returns the list of
|
|
223
246
|
* findings (empty = clean). Both rules are advisory (`warning`): the caller
|
|
224
247
|
* must never fail the build on them alone — auto-provision + the `Record #<id>`
|
|
225
248
|
* floor guarantee a resolvable title at runtime.
|
|
226
249
|
*/
|
|
227
|
-
declare function validateRecordTitle(stack: AnyRec$
|
|
250
|
+
declare function validateRecordTitle(stack: AnyRec$2): RecordTitleFinding[];
|
|
228
251
|
|
|
229
252
|
/**
|
|
230
253
|
* Build-time semantic-role diagnostics (ADR-0085).
|
|
@@ -261,12 +284,60 @@ interface SemanticRoleFinding {
|
|
|
261
284
|
/** How to fix it. */
|
|
262
285
|
hint: string;
|
|
263
286
|
}
|
|
264
|
-
type AnyRec = Record<string, unknown>;
|
|
287
|
+
type AnyRec$1 = Record<string, unknown>;
|
|
265
288
|
/**
|
|
266
289
|
* Validate every object's semantic-role pointers. Returns the list of
|
|
267
290
|
* findings (empty = clean). Advisory only — the caller must never fail the
|
|
268
291
|
* build on these alone.
|
|
269
292
|
*/
|
|
270
|
-
declare function validateSemanticRoles(stack: AnyRec): SemanticRoleFinding[];
|
|
293
|
+
declare function validateSemanticRoles(stack: AnyRec$1): SemanticRoleFinding[];
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Build-time form-layout diagnostics (#2578).
|
|
297
|
+
*
|
|
298
|
+
* Authored form views carry field references and column-layout hints that are
|
|
299
|
+
* Zod-valid but can be silently wrong at render time — the "parsed, unmarked,
|
|
300
|
+
* silently inert" shape ADR-0078 prohibits. This lint catches the two that
|
|
301
|
+
* matter for multi-column, AI-authored forms, uniformly for `os build` /
|
|
302
|
+
* `os validate`, MCP authoring and hand authors (ADR-0019).
|
|
303
|
+
*
|
|
304
|
+
* Both rules are warnings, not errors — nothing is fully broken (an unknown
|
|
305
|
+
* field name is skipped; an over-wide colSpan is clamped) — but each is almost
|
|
306
|
+
* certainly an authoring mistake worth surfacing at author time:
|
|
307
|
+
*
|
|
308
|
+
* - `form-field-unknown` — a section references a field that is not on the
|
|
309
|
+
* form's bound object, so the field silently does not render.
|
|
310
|
+
* - `absolute-colspan-discouraged` — a field uses the absolute `colSpan`. Under
|
|
311
|
+
* a per-surface DERIVED column count (mobile 1 / modal 2 / page 3-4) a fixed
|
|
312
|
+
* span only lines up at the one width the author imagined; the renderer
|
|
313
|
+
* clamps it. The robust primitive is the relative `span: 'full'`.
|
|
314
|
+
*
|
|
315
|
+
* Scope: top-level form `views` (a `sections` array). Forms embedded inside
|
|
316
|
+
* page component trees are a follow-up — the walker deliberately stays shallow
|
|
317
|
+
* so it never guesses at an arbitrary component's object binding.
|
|
318
|
+
*/
|
|
319
|
+
declare const FORM_FIELD_UNKNOWN = "form-field-unknown";
|
|
320
|
+
declare const FORM_COLSPAN_ABSOLUTE = "absolute-colspan-discouraged";
|
|
321
|
+
type FormLayoutSeverity = 'error' | 'warning';
|
|
322
|
+
interface FormLayoutFinding {
|
|
323
|
+
/** Always `warning` today — both rules are advisory (see module note). */
|
|
324
|
+
severity: FormLayoutSeverity;
|
|
325
|
+
/** Diagnostic rule id, e.g. `form-field-unknown`. */
|
|
326
|
+
rule: string;
|
|
327
|
+
/** Human-readable location, e.g. `view "contract_form"`. */
|
|
328
|
+
where: string;
|
|
329
|
+
/** Config path, e.g. `views[2].sections[0].fields[3]`. */
|
|
330
|
+
path: string;
|
|
331
|
+
/** What is wrong. */
|
|
332
|
+
message: string;
|
|
333
|
+
/** How to fix it. */
|
|
334
|
+
hint: string;
|
|
335
|
+
}
|
|
336
|
+
type AnyRec = Record<string, unknown>;
|
|
337
|
+
/**
|
|
338
|
+
* Validate authored form-view layout. Returns findings (empty = clean).
|
|
339
|
+
* Advisory only — the caller must never fail the build on these alone.
|
|
340
|
+
*/
|
|
341
|
+
declare function validateFormLayout(stack: AnyRec): FormLayoutFinding[];
|
|
271
342
|
|
|
272
|
-
export { CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, type JsxPageFinding, type JsxPageSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, validateJsxPages, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|
|
343
|
+
export { CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|