my-frontend-observer 0.3.0 → 0.5.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/CHANGELOG.md +112 -0
- package/README.md +59 -7
- package/dist/application/comparisonService.d.ts +56 -0
- package/dist/application/comparisonService.js +77 -0
- package/dist/application/comparisonService.js.map +1 -0
- package/dist/application/frontendContractEvaluationService.d.ts +49 -0
- package/dist/application/frontendContractEvaluationService.js +112 -0
- package/dist/application/frontendContractEvaluationService.js.map +1 -0
- package/dist/application/frontendContractPersistenceService.d.ts +56 -0
- package/dist/application/frontendContractPersistenceService.js +91 -0
- package/dist/application/frontendContractPersistenceService.js.map +1 -0
- package/dist/artifacts/artifactReader.d.ts +19 -0
- package/dist/artifacts/artifactReader.js +36 -0
- package/dist/artifacts/artifactReader.js.map +1 -0
- package/dist/artifacts/comparisonArtifactReader.d.ts +18 -0
- package/dist/artifacts/comparisonArtifactReader.js +35 -0
- package/dist/artifacts/comparisonArtifactReader.js.map +1 -0
- package/dist/artifacts/comparisonArtifactWriter.d.ts +41 -0
- package/dist/artifacts/comparisonArtifactWriter.js +67 -0
- package/dist/artifacts/comparisonArtifactWriter.js.map +1 -0
- package/dist/artifacts/frontendContractArtifactReader.d.ts +24 -0
- package/dist/artifacts/frontendContractArtifactReader.js +47 -0
- package/dist/artifacts/frontendContractArtifactReader.js.map +1 -0
- package/dist/artifacts/frontendContractArtifactWriter.d.ts +34 -0
- package/dist/artifacts/frontendContractArtifactWriter.js +70 -0
- package/dist/artifacts/frontendContractArtifactWriter.js.map +1 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.d.ts +17 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.js +34 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.js.map +1 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.d.ts +32 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.js +58 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.js.map +1 -0
- package/dist/cli.js +712 -3
- package/dist/cli.js.map +1 -1
- package/dist/domain/comparison.d.ts +198 -0
- package/dist/domain/comparison.js +324 -0
- package/dist/domain/comparison.js.map +1 -0
- package/dist/domain/comparisonEngine.d.ts +48 -0
- package/dist/domain/comparisonEngine.js +694 -0
- package/dist/domain/comparisonEngine.js.map +1 -0
- package/dist/domain/comparisonIdentity.d.ts +13 -0
- package/dist/domain/comparisonIdentity.js +46 -0
- package/dist/domain/comparisonIdentity.js.map +1 -0
- package/dist/domain/evidence.d.ts +2 -0
- package/dist/domain/evidence.js +4 -0
- package/dist/domain/evidence.js.map +1 -1
- package/dist/domain/frontendContractEvaluation.d.ts +57 -0
- package/dist/domain/frontendContractEvaluation.js +454 -0
- package/dist/domain/frontendContractEvaluation.js.map +1 -0
- package/dist/domain/frontendContractEvaluationArtifact.d.ts +65 -0
- package/dist/domain/frontendContractEvaluationArtifact.js +108 -0
- package/dist/domain/frontendContractEvaluationArtifact.js.map +1 -0
- package/dist/domain/frontendContractIdentity.d.ts +39 -0
- package/dist/domain/frontendContractIdentity.js +70 -0
- package/dist/domain/frontendContractIdentity.js.map +1 -0
- package/dist/domain/frontendContracts.d.ts +188 -0
- package/dist/domain/frontendContracts.js +260 -0
- package/dist/domain/frontendContracts.js.map +1 -0
- package/dist/domain/relationships.d.ts +168 -0
- package/dist/domain/relationships.js +343 -0
- package/dist/domain/relationships.js.map +1 -0
- package/dist/index.d.ts +36 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/docs/ARCHITECTURE.md +173 -3
- package/docs/CI_CD.md +76 -0
- package/docs/COMMANDS.md +299 -0
- package/docs/CONTRACTS.md +270 -6
- package/docs/CURRENT_STATE.md +183 -8
- package/docs/DEVELOPMENT.md +83 -12
- package/docs/PROJECT_OVERVIEW.md +18 -8
- package/docs/QUICKSTART.md +10 -0
- package/docs/RELEASE.md +17 -8
- package/docs/ROADMAP.md +10 -0
- package/docs/SECURITY.md +26 -1
- package/docs/WORKFLOWS.md +113 -6
- package/package.json +1 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { isValidObservationArtifact } from './schema.js';
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
// --- Geometry tolerance -------------------------------------------------------
|
|
6
|
+
/** Suppresses insignificant geometry noise only - never a design contract, never permission for changes. */
|
|
7
|
+
export const GEOMETRY_TOLERANCE_DEFAULT_PX = 0.5;
|
|
8
|
+
export const GEOMETRY_TOLERANCE_MIN_PX = 0;
|
|
9
|
+
export const GEOMETRY_TOLERANCE_MAX_PX = 10;
|
|
10
|
+
export function isValidGeometryTolerancePx(value) {
|
|
11
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= GEOMETRY_TOLERANCE_MIN_PX && value <= GEOMETRY_TOLERANCE_MAX_PX;
|
|
12
|
+
}
|
|
13
|
+
export const HORIZONTAL_ORDER_RELATIONSHIPS = ['left-of', 'right-of', 'horizontally-overlapping'];
|
|
14
|
+
export const VERTICAL_ORDER_RELATIONSHIPS = ['above', 'below', 'vertically-overlapping'];
|
|
15
|
+
export const AREA_OVERLAP_RELATIONSHIPS = ['overlaps', 'does-not-overlap'];
|
|
16
|
+
export const RELATIVE_WIDTH_RELATIONSHIPS = ['wider-than', 'narrower-than', 'equal-width-within-tolerance'];
|
|
17
|
+
export const GEOMETRIC_FIT_RELATIONSHIPS = ['fits-inside', 'does-not-fit-inside'];
|
|
18
|
+
/** Rendered-geometry sequencing only - never source DOM order (see docs/CONTRACTS.md target containment discussion). */
|
|
19
|
+
export const VERTICAL_SEQUENCE_RELATIONSHIPS = ['follows-vertically'];
|
|
20
|
+
export const PAGE_WIDTH_RELATIONSHIPS = ['document-width-fits-viewport', 'document-width-exceeds-viewport'];
|
|
21
|
+
/** Every pairwise (two-target) relationship kind this batch freezes. Deliberately bounded - not a general-purpose spatial language. */
|
|
22
|
+
export const PAIRWISE_RELATIONSHIP_KINDS = [
|
|
23
|
+
...HORIZONTAL_ORDER_RELATIONSHIPS,
|
|
24
|
+
...VERTICAL_ORDER_RELATIONSHIPS,
|
|
25
|
+
...AREA_OVERLAP_RELATIONSHIPS,
|
|
26
|
+
...RELATIVE_WIDTH_RELATIONSHIPS,
|
|
27
|
+
...GEOMETRIC_FIT_RELATIONSHIPS,
|
|
28
|
+
...VERTICAL_SEQUENCE_RELATIONSHIPS,
|
|
29
|
+
];
|
|
30
|
+
/** Every page-level (no target pair) relationship kind this batch freezes. */
|
|
31
|
+
export const PAGE_LEVEL_RELATIONSHIP_KINDS = [...PAGE_WIDTH_RELATIONSHIPS];
|
|
32
|
+
export function isValidEvidenceReference(value) {
|
|
33
|
+
return isPlainObject(value) && typeof value.path === 'string' && value.path.length > 0;
|
|
34
|
+
}
|
|
35
|
+
function isEvidenceReferenceArray(value) {
|
|
36
|
+
return Array.isArray(value) && value.every((entry) => isValidEvidenceReference(entry));
|
|
37
|
+
}
|
|
38
|
+
export function isValidPairwiseLayoutRelationship(value) {
|
|
39
|
+
if (!isPlainObject(value))
|
|
40
|
+
return false;
|
|
41
|
+
if (typeof value.kind !== 'string' || !PAIRWISE_RELATIONSHIP_KINDS.includes(value.kind))
|
|
42
|
+
return false;
|
|
43
|
+
if (typeof value.subjectTarget !== 'string' || value.subjectTarget.length === 0)
|
|
44
|
+
return false;
|
|
45
|
+
if (typeof value.relatedTarget !== 'string' || value.relatedTarget.length === 0)
|
|
46
|
+
return false;
|
|
47
|
+
if (value.subjectTarget === value.relatedTarget)
|
|
48
|
+
return false;
|
|
49
|
+
return isEvidenceReferenceArray(value.evidence);
|
|
50
|
+
}
|
|
51
|
+
export function isValidPageLevelLayoutRelationship(value) {
|
|
52
|
+
if (!isPlainObject(value))
|
|
53
|
+
return false;
|
|
54
|
+
if (typeof value.kind !== 'string' || !PAGE_LEVEL_RELATIONSHIP_KINDS.includes(value.kind))
|
|
55
|
+
return false;
|
|
56
|
+
return isEvidenceReferenceArray(value.evidence);
|
|
57
|
+
}
|
|
58
|
+
/** A configured target excluded from relationship derivation because it lacks usable geometry - never a fabricated zero-sized rectangle. */
|
|
59
|
+
export const UNRESOLVED_TARGET_REASONS = ['not-found', 'ambiguous', 'unavailable', 'hidden'];
|
|
60
|
+
export function isValidUnresolvedRelationshipTarget(value) {
|
|
61
|
+
if (!isPlainObject(value))
|
|
62
|
+
return false;
|
|
63
|
+
if (typeof value.target !== 'string' || value.target.length === 0)
|
|
64
|
+
return false;
|
|
65
|
+
return typeof value.reason === 'string' && UNRESOLVED_TARGET_REASONS.includes(value.reason);
|
|
66
|
+
}
|
|
67
|
+
export const MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS = 20;
|
|
68
|
+
export const MAX_PAIRWISE_RELATIONSHIP_PAIRS = (MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS * (MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS - 1)) / 2;
|
|
69
|
+
/**
|
|
70
|
+
* A single unordered pair can carry up to one record per independent
|
|
71
|
+
* pairwise relationship family (horizontal-order, vertical-order,
|
|
72
|
+
* area-overlap, relative-width, geometric-fit, vertical-sequence - see
|
|
73
|
+
* `deriveLayoutRelationships` below), never more than one per family per
|
|
74
|
+
* pair. This is the resulting bound on `pairwiseRelationships.length`, not a
|
|
75
|
+
* second target-count configuration.
|
|
76
|
+
*/
|
|
77
|
+
export const PAIRWISE_RELATIONSHIP_FAMILY_COUNT = 6;
|
|
78
|
+
export const MAX_PAIRWISE_RELATIONSHIP_RECORDS = MAX_PAIRWISE_RELATIONSHIP_PAIRS * PAIRWISE_RELATIONSHIP_FAMILY_COUNT;
|
|
79
|
+
export function isValidLayoutRelationshipGraph(value) {
|
|
80
|
+
if (!isPlainObject(value))
|
|
81
|
+
return false;
|
|
82
|
+
if (typeof value.observationId !== 'string' || value.observationId.length === 0)
|
|
83
|
+
return false;
|
|
84
|
+
if (typeof value.requestId !== 'string' || value.requestId.length === 0)
|
|
85
|
+
return false;
|
|
86
|
+
if (typeof value.geometryTolerancePx !== 'number' || !Number.isFinite(value.geometryTolerancePx))
|
|
87
|
+
return false;
|
|
88
|
+
if (!Array.isArray(value.targets) || !value.targets.every((t) => typeof t === 'string' && t.length > 0))
|
|
89
|
+
return false;
|
|
90
|
+
if (new Set(value.targets).size !== value.targets.length)
|
|
91
|
+
return false;
|
|
92
|
+
if (!Array.isArray(value.unresolvedTargets) || !value.unresolvedTargets.every((t) => isValidUnresolvedRelationshipTarget(t)))
|
|
93
|
+
return false;
|
|
94
|
+
const targetSet = new Set(value.targets);
|
|
95
|
+
if (value.unresolvedTargets.some((t) => targetSet.has(t.target)))
|
|
96
|
+
return false;
|
|
97
|
+
if (!Array.isArray(value.pairwiseRelationships) || !value.pairwiseRelationships.every((r) => isValidPairwiseLayoutRelationship(r)))
|
|
98
|
+
return false;
|
|
99
|
+
if (value.pairwiseRelationships.length > MAX_PAIRWISE_RELATIONSHIP_RECORDS)
|
|
100
|
+
return false;
|
|
101
|
+
for (const relationship of value.pairwiseRelationships) {
|
|
102
|
+
if (!targetSet.has(relationship.subjectTarget) || !targetSet.has(relationship.relatedTarget))
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (!Array.isArray(value.pageRelationships) || !value.pageRelationships.every((r) => isValidPageLevelLayoutRelationship(r)))
|
|
106
|
+
return false;
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Bounded derived clipping concept (docs/PROJECT_MILESTONES.md Milestone 4).
|
|
111
|
+
* `clipped` requires both actual dimensional overflow on that axis AND a
|
|
112
|
+
* computed `overflow` value of `hidden`/`clip` on that axis - `auto`,
|
|
113
|
+
* `scroll`, and `visible` never classify as clipped solely from dimensional
|
|
114
|
+
* overflow. `unavailable` when the underlying overflow/geometry evidence
|
|
115
|
+
* cannot support a conclusion - never guessed.
|
|
116
|
+
*/
|
|
117
|
+
export const CLIPPING_STATES = ['clipped', 'not-clipped', 'unavailable'];
|
|
118
|
+
export const CLIPPING_OVERFLOW_STYLES = ['hidden', 'clip'];
|
|
119
|
+
export function isValidTargetClippingEvidence(value) {
|
|
120
|
+
if (!isPlainObject(value))
|
|
121
|
+
return false;
|
|
122
|
+
return (typeof value.horizontal === 'string' &&
|
|
123
|
+
CLIPPING_STATES.includes(value.horizontal) &&
|
|
124
|
+
typeof value.vertical === 'string' &&
|
|
125
|
+
CLIPPING_STATES.includes(value.vertical));
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Pure per-target clipping derivation from one target's own existing
|
|
129
|
+
* `layout`/`style` evidence (never a scroll scenario - normal target
|
|
130
|
+
* evidence already carries `scrollWidth`/`scrollHeight`/`clientWidth`/
|
|
131
|
+
* `clientHeight`/`overflowX`/`overflowY`). `TargetClippingEvidence` has no
|
|
132
|
+
* slot in `LayoutRelationshipGraph` (that graph is spatial/page-level only,
|
|
133
|
+
* per the frozen Batch 1 vocabulary) - this is a standalone per-target
|
|
134
|
+
* derivation for callers (e.g. a later comparison engine) that need it
|
|
135
|
+
* directly from an `ObservationArtifact`'s `targetEvidence`, one target at a
|
|
136
|
+
* time. `unavailable` (never guessed) when the underlying layout/style
|
|
137
|
+
* evidence is not itself available - this naturally covers an unresolved
|
|
138
|
+
* target without any special-casing. A resolved-but-`display:none` target
|
|
139
|
+
* naturally computes `not-clipped` too: its `scrollWidth`/`clientWidth` are
|
|
140
|
+
* both `0`, so `scrollWidth > clientWidth` is false - clipping is never
|
|
141
|
+
* inferred from hidden-ness itself.
|
|
142
|
+
*/
|
|
143
|
+
export function deriveTargetClipping(record) {
|
|
144
|
+
const layoutField = record.layout;
|
|
145
|
+
const styleField = record.style;
|
|
146
|
+
if (layoutField.state !== 'available' || styleField.state !== 'available') {
|
|
147
|
+
return { horizontal: 'unavailable', vertical: 'unavailable' };
|
|
148
|
+
}
|
|
149
|
+
const layout = layoutField.value;
|
|
150
|
+
const style = styleField.value;
|
|
151
|
+
const isClippingOverflowStyle = (value) => CLIPPING_OVERFLOW_STYLES.includes(value);
|
|
152
|
+
const horizontalOverflow = layout.scrollWidth > layout.clientWidth;
|
|
153
|
+
const verticalOverflow = layout.scrollHeight > layout.clientHeight;
|
|
154
|
+
return {
|
|
155
|
+
horizontal: horizontalOverflow && isClippingOverflowStyle(style.overflowX) ? 'clipped' : 'not-clipped',
|
|
156
|
+
vertical: verticalOverflow && isClippingOverflowStyle(style.overflowY) ? 'clipped' : 'not-clipped',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// --- deriveLayoutRelationships (v0.4 Batch 2 canonical derivation engine) ----
|
|
160
|
+
/**
|
|
161
|
+
* Pure tolerance-aware geometry predicates (Batch 1's frozen rules,
|
|
162
|
+
* verbatim). Every predicate is a total function over exactly one relation
|
|
163
|
+
* family, so it can never itself produce a contradictory pair of values
|
|
164
|
+
* (e.g. `left-of` and `right-of` for the same call) - the caller decides
|
|
165
|
+
* `subject`/`related` once per pair and each family is evaluated exactly
|
|
166
|
+
* once for that fixed direction.
|
|
167
|
+
*/
|
|
168
|
+
function horizontalOrderOf(a, b, tolerance) {
|
|
169
|
+
if (a.right <= b.x + tolerance)
|
|
170
|
+
return 'left-of';
|
|
171
|
+
if (b.right <= a.x + tolerance)
|
|
172
|
+
return 'right-of';
|
|
173
|
+
return 'horizontally-overlapping';
|
|
174
|
+
}
|
|
175
|
+
function verticalOrderOf(a, b, tolerance) {
|
|
176
|
+
if (a.bottom <= b.y + tolerance)
|
|
177
|
+
return 'above';
|
|
178
|
+
if (b.bottom <= a.y + tolerance)
|
|
179
|
+
return 'below';
|
|
180
|
+
return 'vertically-overlapping';
|
|
181
|
+
}
|
|
182
|
+
function areaOverlapOf(a, b, tolerance) {
|
|
183
|
+
const overlapWidth = Math.min(a.right, b.right) - Math.max(a.x, b.x);
|
|
184
|
+
const overlapHeight = Math.min(a.bottom, b.bottom) - Math.max(a.y, b.y);
|
|
185
|
+
return overlapWidth > tolerance && overlapHeight > tolerance ? 'overlaps' : 'does-not-overlap';
|
|
186
|
+
}
|
|
187
|
+
function relativeWidthOf(a, b, tolerance) {
|
|
188
|
+
if (a.width > b.width + tolerance)
|
|
189
|
+
return 'wider-than';
|
|
190
|
+
if (a.width < b.width - tolerance)
|
|
191
|
+
return 'narrower-than';
|
|
192
|
+
return 'equal-width-within-tolerance';
|
|
193
|
+
}
|
|
194
|
+
function geometricFitOf(a, b, tolerance) {
|
|
195
|
+
const fits = a.x >= b.x - tolerance && a.y >= b.y - tolerance && a.right <= b.right + tolerance && a.bottom <= b.bottom + tolerance;
|
|
196
|
+
return fits ? 'fits-inside' : 'does-not-fit-inside';
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* `follows-vertically` is the one family whose vocabulary has a single
|
|
200
|
+
* value (not a total 3-way partition like the others), so it is emitted
|
|
201
|
+
* only when one target's geometry actually precedes the other's - never for
|
|
202
|
+
* both directions, never when they vertically overlap. The direction is
|
|
203
|
+
* decided by actual rendered geometry, not configured target order:
|
|
204
|
+
* `above(x, y)` and "y follows x" share the same tolerance-relative
|
|
205
|
+
* condition, so whichever of the pair is algebraically "above" the other
|
|
206
|
+
* becomes `relatedTarget` and the one that follows becomes `subjectTarget`.
|
|
207
|
+
*/
|
|
208
|
+
function verticalSequenceOf(x, y, tolerance) {
|
|
209
|
+
if (x.geometry.bottom <= y.geometry.y + tolerance)
|
|
210
|
+
return { subjectTarget: y.name, relatedTarget: x.name };
|
|
211
|
+
if (y.geometry.bottom <= x.geometry.y + tolerance)
|
|
212
|
+
return { subjectTarget: x.name, relatedTarget: y.name };
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
function geometryEvidence(a, b) {
|
|
216
|
+
return [{ path: `targetEvidence.${a}.geometry` }, { path: `targetEvidence.${b}.geometry` }];
|
|
217
|
+
}
|
|
218
|
+
/** Maps a configured target's resolution/visibility evidence to the frozen unresolved-target reason vocabulary - never a fabricated relationship for a target that cannot honestly carry one. */
|
|
219
|
+
function classifyUnresolvedTarget(record) {
|
|
220
|
+
if (!record)
|
|
221
|
+
return 'unavailable';
|
|
222
|
+
const resolutionField = record.resolution;
|
|
223
|
+
if (resolutionField.state === 'available' || resolutionField.state === 'partial') {
|
|
224
|
+
const status = resolutionField.value.selectionStatus;
|
|
225
|
+
if (status === 'not-found')
|
|
226
|
+
return 'not-found';
|
|
227
|
+
if (status === 'ambiguous')
|
|
228
|
+
return 'ambiguous';
|
|
229
|
+
if (status === 'unavailable')
|
|
230
|
+
return 'unavailable';
|
|
231
|
+
}
|
|
232
|
+
return 'unavailable';
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The one canonical pure derivation from an already-captured
|
|
236
|
+
* `ObservationArtifact` to a `LayoutRelationshipGraph` (real Chromium ->
|
|
237
|
+
* ObservationArtifact -> **relationship derivation** -> comparability ->
|
|
238
|
+
* comparison -> ComparisonArtifact, see docs/ARCHITECTURE.md). Deterministic
|
|
239
|
+
* and synchronous: same `observation`/`geometryTolerancePx` in, same graph
|
|
240
|
+
* out, every time - no Chromium, target re-resolution, DOM access, randomness,
|
|
241
|
+
* clock, filesystem, or network involved, and `observation` is never
|
|
242
|
+
* mutated.
|
|
243
|
+
*
|
|
244
|
+
* Scope, by construction:
|
|
245
|
+
* - only targets present in `observation.requestConfig.targets` are ever
|
|
246
|
+
* considered (bounded at the existing 20-target/190-pair request limit -
|
|
247
|
+
* never arbitrary DOM/accessibility-tree traversal);
|
|
248
|
+
* - a configured target missing usable geometry (never resolved, or
|
|
249
|
+
* resolved but reported not-visible) becomes an `unresolvedTargets` entry
|
|
250
|
+
* with an honest reason, never a fabricated zero-sized relation;
|
|
251
|
+
* - for each unordered pair of geometry-eligible targets, exactly one
|
|
252
|
+
* record per relationship family is derived, with `subjectTarget`/
|
|
253
|
+
* `relatedTarget` fixed to that pair's configured order (earlier
|
|
254
|
+
* configured target is always `subjectTarget`) for every family except
|
|
255
|
+
* `follows-vertically` (see `verticalSequenceOf`) - so
|
|
256
|
+
* `pairwiseRelationships.length` never exceeds
|
|
257
|
+
* `MAX_PAIRWISE_RELATIONSHIP_RECORDS`;
|
|
258
|
+
* - DOM containment is deliberately not re-derived here: it already exists
|
|
259
|
+
* as `targetEvidence.<name>.containment` on the observation itself (see
|
|
260
|
+
* `TargetContainment` in domain/schema.ts, explicitly documented there as
|
|
261
|
+
* "never a layout/relationship graph") and stays separate from
|
|
262
|
+
* `fits-inside`/`does-not-fit-inside`, which is geometry-only;
|
|
263
|
+
* - the page-width relationship is derived only when both
|
|
264
|
+
* `pageEvidence.documentWidth` and `pageEvidence.viewportWidth` are
|
|
265
|
+
* themselves available - never defaulted to "fits" when evidence is
|
|
266
|
+
* missing.
|
|
267
|
+
*/
|
|
268
|
+
export function deriveLayoutRelationships(observation, options = {}) {
|
|
269
|
+
const validation = isValidObservationArtifact(observation);
|
|
270
|
+
if (!validation.valid) {
|
|
271
|
+
return { ok: false, reason: `cannot derive relationships from an invalid ObservationArtifact: ${validation.reason}` };
|
|
272
|
+
}
|
|
273
|
+
const geometryTolerancePx = options.geometryTolerancePx ?? GEOMETRY_TOLERANCE_DEFAULT_PX;
|
|
274
|
+
if (!isValidGeometryTolerancePx(geometryTolerancePx)) {
|
|
275
|
+
return {
|
|
276
|
+
ok: false,
|
|
277
|
+
reason: `geometryTolerancePx must be a finite number in [${GEOMETRY_TOLERANCE_MIN_PX}, ${GEOMETRY_TOLERANCE_MAX_PX}]`,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const configuredNames = observation.requestConfig.targets.map((target) => target.name);
|
|
281
|
+
if (configuredNames.length > MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS) {
|
|
282
|
+
return {
|
|
283
|
+
ok: false,
|
|
284
|
+
reason: `observation.requestConfig.targets has ${configuredNames.length} entries, exceeding the ${MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS}-target relationship-derivation bound`,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const eligible = [];
|
|
288
|
+
const unresolvedTargets = [];
|
|
289
|
+
for (const name of configuredNames) {
|
|
290
|
+
const record = observation.targetEvidence[name];
|
|
291
|
+
const geometryField = record?.geometry;
|
|
292
|
+
if (!record || geometryField?.state !== 'available') {
|
|
293
|
+
unresolvedTargets.push({ target: name, reason: classifyUnresolvedTarget(record) });
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const visibilityField = record.visibility;
|
|
297
|
+
if ((visibilityField.state === 'available' || visibilityField.state === 'partial') && visibilityField.value.visible === false) {
|
|
298
|
+
unresolvedTargets.push({ target: name, reason: 'hidden' });
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
eligible.push({ name, geometry: geometryField.value });
|
|
302
|
+
}
|
|
303
|
+
const pairwiseRelationships = [];
|
|
304
|
+
for (let i = 0; i < eligible.length; i += 1) {
|
|
305
|
+
const subject = eligible[i];
|
|
306
|
+
for (let j = i + 1; j < eligible.length; j += 1) {
|
|
307
|
+
const related = eligible[j];
|
|
308
|
+
const evidence = geometryEvidence(subject.name, related.name);
|
|
309
|
+
pairwiseRelationships.push({ kind: horizontalOrderOf(subject.geometry, related.geometry, geometryTolerancePx), subjectTarget: subject.name, relatedTarget: related.name, evidence }, { kind: verticalOrderOf(subject.geometry, related.geometry, geometryTolerancePx), subjectTarget: subject.name, relatedTarget: related.name, evidence }, { kind: areaOverlapOf(subject.geometry, related.geometry, geometryTolerancePx), subjectTarget: subject.name, relatedTarget: related.name, evidence }, { kind: relativeWidthOf(subject.geometry, related.geometry, geometryTolerancePx), subjectTarget: subject.name, relatedTarget: related.name, evidence }, { kind: geometricFitOf(subject.geometry, related.geometry, geometryTolerancePx), subjectTarget: subject.name, relatedTarget: related.name, evidence });
|
|
310
|
+
const sequence = verticalSequenceOf(subject, related, geometryTolerancePx);
|
|
311
|
+
if (sequence) {
|
|
312
|
+
pairwiseRelationships.push({
|
|
313
|
+
kind: 'follows-vertically',
|
|
314
|
+
subjectTarget: sequence.subjectTarget,
|
|
315
|
+
relatedTarget: sequence.relatedTarget,
|
|
316
|
+
evidence: geometryEvidence(sequence.subjectTarget, sequence.relatedTarget),
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const pageRelationships = [];
|
|
322
|
+
const documentWidthField = observation.pageEvidence.documentWidth;
|
|
323
|
+
const viewportWidthField = observation.pageEvidence.viewportWidth;
|
|
324
|
+
const documentWidth = documentWidthField?.state === 'available' && typeof documentWidthField.value === 'number' ? documentWidthField.value : undefined;
|
|
325
|
+
const viewportWidth = viewportWidthField?.state === 'available' && typeof viewportWidthField.value === 'number' ? viewportWidthField.value : undefined;
|
|
326
|
+
if (documentWidth !== undefined && viewportWidth !== undefined) {
|
|
327
|
+
pageRelationships.push({
|
|
328
|
+
kind: documentWidth <= viewportWidth + geometryTolerancePx ? 'document-width-fits-viewport' : 'document-width-exceeds-viewport',
|
|
329
|
+
evidence: [{ path: 'pageEvidence.documentWidth' }, { path: 'pageEvidence.viewportWidth' }],
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
const graph = {
|
|
333
|
+
observationId: observation.observationId,
|
|
334
|
+
requestId: observation.requestId,
|
|
335
|
+
geometryTolerancePx,
|
|
336
|
+
targets: eligible.map((entry) => entry.name),
|
|
337
|
+
unresolvedTargets,
|
|
338
|
+
pairwiseRelationships,
|
|
339
|
+
pageRelationships,
|
|
340
|
+
};
|
|
341
|
+
return { ok: true, graph };
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=relationships.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../src/domain/relationships.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,C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+1,5 @@
|
|
|
1
1
|
export type { EvidenceState, EvidenceSource, EvidenceField } from './domain/evidence.js';
|
|
2
|
-
export { isValidEvidenceField } from './domain/evidence.js';
|
|
2
|
+
export { isValidEvidenceField, evidenceValue } from './domain/evidence.js';
|
|
3
3
|
export type { DiagnosticCode, DiagnosticSeverity, Diagnostic } from './domain/diagnostics.js';
|
|
4
4
|
export { DIAGNOSTIC_CODES, DIAGNOSTIC_SEVERITY, orderDiagnostics } from './domain/diagnostics.js';
|
|
5
5
|
export type { CompletionState, RequestPhase } from './domain/completion.js';
|
|
@@ -19,3 +19,38 @@ export type { PersistedObservationResult } from './artifacts/types.js';
|
|
|
19
19
|
export { MANIFEST_FILENAME, SCREENSHOT_FILENAME } from './artifacts/artifactWriter.js';
|
|
20
20
|
export type { ApplicationObservationResult } from './application/observationPersistence.js';
|
|
21
21
|
export { buildObservationArtifact, persistBrowserCapture, observe } from './application/observationPersistence.js';
|
|
22
|
+
export type { HorizontalOrderRelationship, VerticalOrderRelationship, AreaOverlapRelationship, RelativeWidthRelationship, GeometricFitRelationship, VerticalSequenceRelationship, PageWidthRelationship, PairwiseRelationshipKind, PageLevelRelationshipKind, EvidenceReference, PairwiseLayoutRelationship, PageLevelLayoutRelationship, UnresolvedTargetReason, UnresolvedRelationshipTarget, LayoutRelationshipGraph, ClippingState, ClippingOverflowStyle, TargetClippingEvidence, DeriveLayoutRelationshipsOptions, DeriveLayoutRelationshipsResult, } from './domain/relationships.js';
|
|
23
|
+
export { HORIZONTAL_ORDER_RELATIONSHIPS, VERTICAL_ORDER_RELATIONSHIPS, AREA_OVERLAP_RELATIONSHIPS, RELATIVE_WIDTH_RELATIONSHIPS, GEOMETRIC_FIT_RELATIONSHIPS, VERTICAL_SEQUENCE_RELATIONSHIPS, PAGE_WIDTH_RELATIONSHIPS, PAIRWISE_RELATIONSHIP_KINDS, PAGE_LEVEL_RELATIONSHIP_KINDS, MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS, MAX_PAIRWISE_RELATIONSHIP_PAIRS, PAIRWISE_RELATIONSHIP_FAMILY_COUNT, MAX_PAIRWISE_RELATIONSHIP_RECORDS, CLIPPING_STATES, CLIPPING_OVERFLOW_STYLES, isValidEvidenceReference, isValidPairwiseLayoutRelationship, isValidPageLevelLayoutRelationship, isValidUnresolvedRelationshipTarget, isValidLayoutRelationshipGraph, isValidTargetClippingEvidence, deriveTargetClipping, deriveLayoutRelationships, } from './domain/relationships.js';
|
|
24
|
+
export type { DependencyProperty, DependencyDirection, ExpectedDependencySource, DependencyTermDeclaration, ExpectedDependencyDeclaration, DependencyEvidenceOutcome, ExpectedDependencyEvidence, ComparisonConfig, ComparabilityState, ComparabilityReasonCode, ComparabilityReasonSeverity, ComparabilityReason, ComparabilityResult, TargetConfigurationChangeKind, TargetConfigurationChange, DifferenceKind, ComparisonDifferenceSubject, ComparisonDifference, RelationshipChangeRecord, ComparisonSourceObservationReference, ComparisonArtifact, ComparisonSchemaValidationResult, } from './domain/comparison.js';
|
|
25
|
+
export { COMPARISON_ARTIFACT_KIND, COMPARISON_SCHEMA_VERSION, GEOMETRY_TOLERANCE_DEFAULT_PX, GEOMETRY_TOLERANCE_MIN_PX, GEOMETRY_TOLERANCE_MAX_PX, isValidGeometryTolerancePx, DEPENDENCY_PROPERTIES, DEPENDENCY_DIRECTIONS, EXPECTED_DEPENDENCY_SOURCES, isValidExpectedDependencyDeclaration, DEPENDENCY_EVIDENCE_OUTCOMES, isValidExpectedDependencyEvidence, isValidComparisonConfig, COMPARABILITY_STATES, COMPARABILITY_REASON_CODES, COMPARABILITY_REASON_SEVERITY, isValidComparabilityResult, TARGET_CONFIGURATION_CHANGE_KINDS, isValidTargetConfigurationChange, DIFFERENCE_KINDS, isValidComparisonDifference, isValidComparisonSourceObservationReference, isValidComparisonArtifact, } from './domain/comparison.js';
|
|
26
|
+
export { buildComparisonRequestIdentity, buildComparisonIdentity } from './domain/comparisonIdentity.js';
|
|
27
|
+
export type { AuthoredChangeScopeCategory, ChangeScopeClassification, ExpectedDependentMode, ContractTolerance, ContractPrimitiveKind, ContractPrimitive, FrontendContractClauseBase, BaselineClause, PerChangeClause, FrontendContractObservationReference, PersistentBaselineContract, FrontendContractValidationResult, PerChangeContract, ClauseResultStatus, ClauseEvaluationResult, OverallVerdict, } from './domain/frontendContracts.js';
|
|
28
|
+
export { CONTRACT_ARTIFACT_KIND, CONTRACT_SCHEMA_VERSION, AUTHORED_CHANGE_SCOPE_CATEGORIES, isAuthoredChangeScopeCategory, CHANGE_SCOPE_CLASSIFICATIONS, EXPECTED_DEPENDENT_MODES, isValidExpectedDependentMode, CONTRACT_TOLERANCE_ABSOLUTE_PX_MIN, CONTRACT_TOLERANCE_ABSOLUTE_PX_MAX, CONTRACT_TOLERANCE_PERCENT_MIN, CONTRACT_TOLERANCE_PERCENT_MAX, isValidContractTolerance, CONTRACT_PRIMITIVE_KINDS, isValidContractPrimitive, isValidBaselineClause, isValidPerChangeClause, isValidFrontendContractObservationReference, isValidPersistentBaselineContract, isValidPerChangeContract, CLAUSE_RESULT_STATUSES, isValidClauseEvaluationResult, OVERALL_VERDICTS, } from './domain/frontendContracts.js';
|
|
29
|
+
export { buildFrontendContractRequestIdentity, buildFrontendContractInstanceIdentity, buildClauseIdentity } from './domain/frontendContractIdentity.js';
|
|
30
|
+
export type { FrontendContractEvaluationInput, UnexpectedChangeResult, FrontendContractEvaluationResult, EvaluateFrontendContractResult } from './domain/frontendContractEvaluation.js';
|
|
31
|
+
export { evaluateFrontendContract } from './domain/frontendContractEvaluation.js';
|
|
32
|
+
export { buildFrontendContractEvaluationRequestIdentity } from './domain/frontendContractIdentity.js';
|
|
33
|
+
export type { FrontendContractEvaluationSourceReference, FrontendContractEvaluationArtifact, FrontendContractEvaluationArtifactValidationResult, BuildFrontendContractEvaluationArtifactInput, } from './domain/frontendContractEvaluationArtifact.js';
|
|
34
|
+
export { EVALUATION_ARTIFACT_KIND, EVALUATION_SCHEMA_VERSION, isValidFrontendContractEvaluationArtifact, buildFrontendContractEvaluationArtifact, } from './domain/frontendContractEvaluationArtifact.js';
|
|
35
|
+
export type { PersistedFrontendContractResult, WriteFrontendContractArtifactOptions } from './artifacts/frontendContractArtifactWriter.js';
|
|
36
|
+
export { FRONTEND_CONTRACT_MANIFEST_FILENAME, writePersistentBaselineContract, writePerChangeContract } from './artifacts/frontendContractArtifactWriter.js';
|
|
37
|
+
export type { ReadPersistentBaselineContractResult, ReadPerChangeContractResult } from './artifacts/frontendContractArtifactReader.js';
|
|
38
|
+
export { readPersistentBaselineContract, readPerChangeContract } from './artifacts/frontendContractArtifactReader.js';
|
|
39
|
+
export type { ReadComparisonArtifactResult } from './artifacts/comparisonArtifactReader.js';
|
|
40
|
+
export { readComparisonArtifact } from './artifacts/comparisonArtifactReader.js';
|
|
41
|
+
export type { PersistedFrontendContractEvaluationResult, WriteFrontendContractEvaluationArtifactOptions } from './artifacts/frontendContractEvaluationArtifactWriter.js';
|
|
42
|
+
export { EVALUATION_MANIFEST_FILENAME, writeFrontendContractEvaluationArtifact } from './artifacts/frontendContractEvaluationArtifactWriter.js';
|
|
43
|
+
export type { ReadFrontendContractEvaluationArtifactResult } from './artifacts/frontendContractEvaluationArtifactReader.js';
|
|
44
|
+
export { readFrontendContractEvaluationArtifact } from './artifacts/frontendContractEvaluationArtifactReader.js';
|
|
45
|
+
export type { EvaluateAndPersistOptions, ApplicationFrontendContractEvaluationResult } from './application/frontendContractEvaluationService.js';
|
|
46
|
+
export { DEFAULT_EVALUATION_OUTPUT_LOCATION, evaluateAndPersist, evaluateAndPersistFromArtifactRoots } from './application/frontendContractEvaluationService.js';
|
|
47
|
+
export type { PersistFrontendContractOptions, ApplicationApproveBaselineResult, ApplicationPersistChangeContractResult } from './application/frontendContractPersistenceService.js';
|
|
48
|
+
export { approveAndPersistBaseline, persistPerChangeContract } from './application/frontendContractPersistenceService.js';
|
|
49
|
+
export type { CompareObservationsResult } from './domain/comparisonEngine.js';
|
|
50
|
+
export { compareObservations, evaluateComparability, evaluateExpectedDependencies, compareTargetConfiguration } from './domain/comparisonEngine.js';
|
|
51
|
+
export type { PersistedComparisonResult, WriteComparisonArtifactOptions } from './artifacts/comparisonArtifactWriter.js';
|
|
52
|
+
export { COMPARISON_MANIFEST_FILENAME, writeComparisonArtifact } from './artifacts/comparisonArtifactWriter.js';
|
|
53
|
+
export type { ReadObservationArtifactResult } from './artifacts/artifactReader.js';
|
|
54
|
+
export { readObservationArtifact } from './artifacts/artifactReader.js';
|
|
55
|
+
export type { CompareAndPersistOptions, ApplicationComparisonResult } from './application/comparisonService.js';
|
|
56
|
+
export { DEFAULT_COMPARISON_OUTPUT_LOCATION, compareAndPersist, compareAndPersistFromArtifactRoots } from './application/comparisonService.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isValidEvidenceField } from './domain/evidence.js';
|
|
1
|
+
export { isValidEvidenceField, evidenceValue } from './domain/evidence.js';
|
|
2
2
|
export { DIAGNOSTIC_CODES, DIAGNOSTIC_SEVERITY, orderDiagnostics } from './domain/diagnostics.js';
|
|
3
3
|
export { deriveCompletion } from './domain/completion.js';
|
|
4
4
|
export { ARTIFACT_KIND, SCHEMA_VERSION, PRODUCER_NAME, TARGET_LANDMARK_ROLES, getProducerInfo, isValidObservationArtifact, } from './domain/schema.js';
|
|
@@ -9,4 +9,23 @@ export { classifyUrl, classifyRedirect, classifySubresource, classifyPopup, clas
|
|
|
9
9
|
export { runBrowserCapture } from './application/browserCaptureService.js';
|
|
10
10
|
export { MANIFEST_FILENAME, SCREENSHOT_FILENAME } from './artifacts/artifactWriter.js';
|
|
11
11
|
export { buildObservationArtifact, persistBrowserCapture, observe } from './application/observationPersistence.js';
|
|
12
|
+
export { HORIZONTAL_ORDER_RELATIONSHIPS, VERTICAL_ORDER_RELATIONSHIPS, AREA_OVERLAP_RELATIONSHIPS, RELATIVE_WIDTH_RELATIONSHIPS, GEOMETRIC_FIT_RELATIONSHIPS, VERTICAL_SEQUENCE_RELATIONSHIPS, PAGE_WIDTH_RELATIONSHIPS, PAIRWISE_RELATIONSHIP_KINDS, PAGE_LEVEL_RELATIONSHIP_KINDS, MAX_CONFIGURED_TARGETS_FOR_RELATIONSHIPS, MAX_PAIRWISE_RELATIONSHIP_PAIRS, PAIRWISE_RELATIONSHIP_FAMILY_COUNT, MAX_PAIRWISE_RELATIONSHIP_RECORDS, CLIPPING_STATES, CLIPPING_OVERFLOW_STYLES, isValidEvidenceReference, isValidPairwiseLayoutRelationship, isValidPageLevelLayoutRelationship, isValidUnresolvedRelationshipTarget, isValidLayoutRelationshipGraph, isValidTargetClippingEvidence, deriveTargetClipping, deriveLayoutRelationships, } from './domain/relationships.js';
|
|
13
|
+
export { COMPARISON_ARTIFACT_KIND, COMPARISON_SCHEMA_VERSION, GEOMETRY_TOLERANCE_DEFAULT_PX, GEOMETRY_TOLERANCE_MIN_PX, GEOMETRY_TOLERANCE_MAX_PX, isValidGeometryTolerancePx, DEPENDENCY_PROPERTIES, DEPENDENCY_DIRECTIONS, EXPECTED_DEPENDENCY_SOURCES, isValidExpectedDependencyDeclaration, DEPENDENCY_EVIDENCE_OUTCOMES, isValidExpectedDependencyEvidence, isValidComparisonConfig, COMPARABILITY_STATES, COMPARABILITY_REASON_CODES, COMPARABILITY_REASON_SEVERITY, isValidComparabilityResult, TARGET_CONFIGURATION_CHANGE_KINDS, isValidTargetConfigurationChange, DIFFERENCE_KINDS, isValidComparisonDifference, isValidComparisonSourceObservationReference, isValidComparisonArtifact, } from './domain/comparison.js';
|
|
14
|
+
export { buildComparisonRequestIdentity, buildComparisonIdentity } from './domain/comparisonIdentity.js';
|
|
15
|
+
export { CONTRACT_ARTIFACT_KIND, CONTRACT_SCHEMA_VERSION, AUTHORED_CHANGE_SCOPE_CATEGORIES, isAuthoredChangeScopeCategory, CHANGE_SCOPE_CLASSIFICATIONS, EXPECTED_DEPENDENT_MODES, isValidExpectedDependentMode, CONTRACT_TOLERANCE_ABSOLUTE_PX_MIN, CONTRACT_TOLERANCE_ABSOLUTE_PX_MAX, CONTRACT_TOLERANCE_PERCENT_MIN, CONTRACT_TOLERANCE_PERCENT_MAX, isValidContractTolerance, CONTRACT_PRIMITIVE_KINDS, isValidContractPrimitive, isValidBaselineClause, isValidPerChangeClause, isValidFrontendContractObservationReference, isValidPersistentBaselineContract, isValidPerChangeContract, CLAUSE_RESULT_STATUSES, isValidClauseEvaluationResult, OVERALL_VERDICTS, } from './domain/frontendContracts.js';
|
|
16
|
+
export { buildFrontendContractRequestIdentity, buildFrontendContractInstanceIdentity, buildClauseIdentity } from './domain/frontendContractIdentity.js';
|
|
17
|
+
export { evaluateFrontendContract } from './domain/frontendContractEvaluation.js';
|
|
18
|
+
export { buildFrontendContractEvaluationRequestIdentity } from './domain/frontendContractIdentity.js';
|
|
19
|
+
export { EVALUATION_ARTIFACT_KIND, EVALUATION_SCHEMA_VERSION, isValidFrontendContractEvaluationArtifact, buildFrontendContractEvaluationArtifact, } from './domain/frontendContractEvaluationArtifact.js';
|
|
20
|
+
export { FRONTEND_CONTRACT_MANIFEST_FILENAME, writePersistentBaselineContract, writePerChangeContract } from './artifacts/frontendContractArtifactWriter.js';
|
|
21
|
+
export { readPersistentBaselineContract, readPerChangeContract } from './artifacts/frontendContractArtifactReader.js';
|
|
22
|
+
export { readComparisonArtifact } from './artifacts/comparisonArtifactReader.js';
|
|
23
|
+
export { EVALUATION_MANIFEST_FILENAME, writeFrontendContractEvaluationArtifact } from './artifacts/frontendContractEvaluationArtifactWriter.js';
|
|
24
|
+
export { readFrontendContractEvaluationArtifact } from './artifacts/frontendContractEvaluationArtifactReader.js';
|
|
25
|
+
export { DEFAULT_EVALUATION_OUTPUT_LOCATION, evaluateAndPersist, evaluateAndPersistFromArtifactRoots } from './application/frontendContractEvaluationService.js';
|
|
26
|
+
export { approveAndPersistBaseline, persistPerChangeContract } from './application/frontendContractPersistenceService.js';
|
|
27
|
+
export { compareObservations, evaluateComparability, evaluateExpectedDependencies, compareTargetConfiguration } from './domain/comparisonEngine.js';
|
|
28
|
+
export { COMPARISON_MANIFEST_FILENAME, writeComparisonArtifact } from './artifacts/comparisonArtifactWriter.js';
|
|
29
|
+
export { readObservationArtifact } from './artifacts/artifactReader.js';
|
|
30
|
+
export { DEFAULT_COMPARISON_OUTPUT_LOCATION, compareAndPersist, compareAndPersistFromArtifactRoots } from './application/comparisonService.js';
|
|
12
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAmC1D,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAetF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGzH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE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