@freeappstore/quality 0.1.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/LICENSE +21 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +199 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +116 -0
- package/dist/index.test.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FreeAppStore
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality reporter for FreeAppStore / FreeGameStore apps.
|
|
3
|
+
*
|
|
4
|
+
* When an app is loaded inside an iframe (i.e. by the platform Quality
|
|
5
|
+
* Dashboard at https://freeappstore.online/quality), this reporter posts
|
|
6
|
+
* viewport / overflow / clipping metrics back to the parent so the
|
|
7
|
+
* dashboard can audit layout fit at every reference viewport without
|
|
8
|
+
* needing same-origin DOM access.
|
|
9
|
+
*
|
|
10
|
+
* In production (top-level navigation) the reporter is a no-op — there's
|
|
11
|
+
* no parent to receive messages, so we don't waste CPU.
|
|
12
|
+
*
|
|
13
|
+
* Privacy note: posts contain ONLY viewport / DOM-shape numbers. No URLs
|
|
14
|
+
* (parent already knows), no localStorage, no user content, no identifiers.
|
|
15
|
+
* Apps remain fully privacy-first; this is structural metadata for QA only.
|
|
16
|
+
*
|
|
17
|
+
* Cooperation contract: the platform's audit treats apps that import this
|
|
18
|
+
* reporter (and respond to dashboard probes) as audit-cooperative. Apps
|
|
19
|
+
* that ship without it can still be listed but won't get a Quality Index
|
|
20
|
+
* badge — opt-out is allowed but visible.
|
|
21
|
+
*/
|
|
22
|
+
export interface ViewportReport {
|
|
23
|
+
type: 'fas:quality';
|
|
24
|
+
schema: 1;
|
|
25
|
+
/** ms since epoch when the snapshot was taken. */
|
|
26
|
+
capturedAt: number;
|
|
27
|
+
/** Top-level subdomain (e.g. "tetris" from tetris.freegamestore.online). */
|
|
28
|
+
appId: string;
|
|
29
|
+
/** Viewport size as the iframe sees it (parent sets this). */
|
|
30
|
+
viewport: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
/** Document scroll vs viewport — if scrollWidth > clientWidth, the page scrolls horizontally. */
|
|
35
|
+
document: {
|
|
36
|
+
scrollWidth: number;
|
|
37
|
+
scrollHeight: number;
|
|
38
|
+
clientWidth: number;
|
|
39
|
+
clientHeight: number;
|
|
40
|
+
scrollsX: boolean;
|
|
41
|
+
scrollsY: boolean;
|
|
42
|
+
};
|
|
43
|
+
/** Inner-clipping: any element with overflow:hidden|clip whose content overflows its box. */
|
|
44
|
+
clipping: ClippingHit[];
|
|
45
|
+
/** Color scheme the app currently believes it's in (light | dark | unknown). */
|
|
46
|
+
colorScheme: 'light' | 'dark' | 'unknown';
|
|
47
|
+
/** Whether prefers-reduced-motion is set. */
|
|
48
|
+
reducedMotion: boolean;
|
|
49
|
+
/** SDK / reporter version that produced this. Lets the dashboard
|
|
50
|
+
* detect / migrate when the schema changes. */
|
|
51
|
+
reporterVersion: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ClippingHit {
|
|
54
|
+
/** CSS-ish selector best-effort: tag + first class or id. */
|
|
55
|
+
selector: string;
|
|
56
|
+
scrollWidth: number;
|
|
57
|
+
scrollHeight: number;
|
|
58
|
+
clientWidth: number;
|
|
59
|
+
clientHeight: number;
|
|
60
|
+
clipsX: boolean;
|
|
61
|
+
clipsY: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Synchronously snapshot the current layout state. Cheap (single DOM walk)
|
|
65
|
+
* but called frequently during resize, so we cap clipping hits.
|
|
66
|
+
*/
|
|
67
|
+
export declare function snapshot(): ViewportReport;
|
|
68
|
+
interface ReporterHandle {
|
|
69
|
+
/** Stop reporting and detach all listeners. */
|
|
70
|
+
stop(): void;
|
|
71
|
+
/** Force a snapshot + post immediately (e.g. after a layout change). */
|
|
72
|
+
reportNow(): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Start the reporter. Idempotent — calling twice returns the existing
|
|
76
|
+
* handle. Designed for one-line use: `initQualityReporter()` from your
|
|
77
|
+
* app's main.tsx / entry. The reporter is a no-op when not iframed,
|
|
78
|
+
* so leaving it on in production has zero cost.
|
|
79
|
+
*
|
|
80
|
+
* Channels:
|
|
81
|
+
* - posts to `window.parent` with `type: 'fas:quality'`
|
|
82
|
+
* - listens on `window` for `type: 'fas:quality:request'` so the parent
|
|
83
|
+
* can poll on demand (e.g. after resizing the iframe)
|
|
84
|
+
*/
|
|
85
|
+
export declare function initQualityReporter(): ReporterHandle;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC;IACV,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,iGAAiG;IACjG,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,6FAA6F;IAC7F,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,gFAAgF;IAChF,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,6CAA6C;IAC7C,aAAa,EAAE,OAAO,CAAC;IACvB;oDACgD;IAChD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAqBD;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CA2FzC;AAED,UAAU,cAAc;IACtB,+CAA+C;IAC/C,IAAI,IAAI,IAAI,CAAC;IACb,wEAAwE;IACxE,SAAS,IAAI,IAAI,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CAwDpD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality reporter for FreeAppStore / FreeGameStore apps.
|
|
3
|
+
*
|
|
4
|
+
* When an app is loaded inside an iframe (i.e. by the platform Quality
|
|
5
|
+
* Dashboard at https://freeappstore.online/quality), this reporter posts
|
|
6
|
+
* viewport / overflow / clipping metrics back to the parent so the
|
|
7
|
+
* dashboard can audit layout fit at every reference viewport without
|
|
8
|
+
* needing same-origin DOM access.
|
|
9
|
+
*
|
|
10
|
+
* In production (top-level navigation) the reporter is a no-op — there's
|
|
11
|
+
* no parent to receive messages, so we don't waste CPU.
|
|
12
|
+
*
|
|
13
|
+
* Privacy note: posts contain ONLY viewport / DOM-shape numbers. No URLs
|
|
14
|
+
* (parent already knows), no localStorage, no user content, no identifiers.
|
|
15
|
+
* Apps remain fully privacy-first; this is structural metadata for QA only.
|
|
16
|
+
*
|
|
17
|
+
* Cooperation contract: the platform's audit treats apps that import this
|
|
18
|
+
* reporter (and respond to dashboard probes) as audit-cooperative. Apps
|
|
19
|
+
* that ship without it can still be listed but won't get a Quality Index
|
|
20
|
+
* badge — opt-out is allowed but visible.
|
|
21
|
+
*/
|
|
22
|
+
const REPORTER_VERSION = '0.1.0';
|
|
23
|
+
const TOLERANCE_PX = 1;
|
|
24
|
+
const MAX_CLIPPING_HITS = 20;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the page should report. Returns false when:
|
|
27
|
+
* - There's no `window.parent` (Node / SSR)
|
|
28
|
+
* - The page is loaded top-level (no parent to talk to)
|
|
29
|
+
* - The user has set window.__FAS_QUALITY_DISABLE = true (for embeds where
|
|
30
|
+
* the host is hostile — e.g. an iframe embed on a third-party site that
|
|
31
|
+
* we don't want to leak metrics to).
|
|
32
|
+
*/
|
|
33
|
+
function shouldReport() {
|
|
34
|
+
if (typeof window === 'undefined')
|
|
35
|
+
return false;
|
|
36
|
+
if (window.parent === window)
|
|
37
|
+
return false;
|
|
38
|
+
if (window.__FAS_QUALITY_DISABLE)
|
|
39
|
+
return false;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Synchronously snapshot the current layout state. Cheap (single DOM walk)
|
|
44
|
+
* but called frequently during resize, so we cap clipping hits.
|
|
45
|
+
*/
|
|
46
|
+
export function snapshot() {
|
|
47
|
+
const root = typeof document !== 'undefined' ? document.documentElement : null;
|
|
48
|
+
const w = typeof window !== 'undefined' ? window : undefined;
|
|
49
|
+
const fallback = () => ({
|
|
50
|
+
type: 'fas:quality',
|
|
51
|
+
schema: 1,
|
|
52
|
+
capturedAt: Date.now(),
|
|
53
|
+
appId: '',
|
|
54
|
+
viewport: { width: 0, height: 0 },
|
|
55
|
+
document: {
|
|
56
|
+
scrollWidth: 0,
|
|
57
|
+
scrollHeight: 0,
|
|
58
|
+
clientWidth: 0,
|
|
59
|
+
clientHeight: 0,
|
|
60
|
+
scrollsX: false,
|
|
61
|
+
scrollsY: false,
|
|
62
|
+
},
|
|
63
|
+
clipping: [],
|
|
64
|
+
colorScheme: 'unknown',
|
|
65
|
+
reducedMotion: false,
|
|
66
|
+
reporterVersion: REPORTER_VERSION,
|
|
67
|
+
});
|
|
68
|
+
if (!root)
|
|
69
|
+
return fallback();
|
|
70
|
+
const clipping = [];
|
|
71
|
+
// Walk all elements once; flag those with overflow:hidden|clip whose
|
|
72
|
+
// content is larger than their box. This catches the common case where
|
|
73
|
+
// a fixed-pixel container clips its child content but the document
|
|
74
|
+
// itself doesn't scroll — invisible clipping that breaks UX without
|
|
75
|
+
// tripping a naive scrollWidth check.
|
|
76
|
+
const all = document.querySelectorAll('*');
|
|
77
|
+
for (let i = 0; i < all.length && clipping.length < MAX_CLIPPING_HITS; i++) {
|
|
78
|
+
const el = all[i];
|
|
79
|
+
const cs = getComputedStyle(el);
|
|
80
|
+
const ovx = cs.overflowX;
|
|
81
|
+
const ovy = cs.overflowY;
|
|
82
|
+
const xClipped = (ovx === 'hidden' || ovx === 'clip') && el.scrollWidth > el.clientWidth + TOLERANCE_PX;
|
|
83
|
+
const yClipped = (ovy === 'hidden' || ovy === 'clip') && el.scrollHeight > el.clientHeight + TOLERANCE_PX;
|
|
84
|
+
if (!xClipped && !yClipped)
|
|
85
|
+
continue;
|
|
86
|
+
const idPart = el.id ? `#${el.id}` : '';
|
|
87
|
+
const classPart = el.className && typeof el.className === 'string'
|
|
88
|
+
? `.${el.className.split(/\s+/).filter(Boolean)[0] ?? ''}`
|
|
89
|
+
: '';
|
|
90
|
+
clipping.push({
|
|
91
|
+
selector: `${el.tagName.toLowerCase()}${idPart}${classPart}`,
|
|
92
|
+
scrollWidth: el.scrollWidth,
|
|
93
|
+
scrollHeight: el.scrollHeight,
|
|
94
|
+
clientWidth: el.clientWidth,
|
|
95
|
+
clientHeight: el.clientHeight,
|
|
96
|
+
clipsX: xClipped,
|
|
97
|
+
clipsY: yClipped,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const colorScheme = typeof matchMedia === 'function'
|
|
101
|
+
? matchMedia('(prefers-color-scheme: dark)').matches
|
|
102
|
+
? 'dark'
|
|
103
|
+
: 'light'
|
|
104
|
+
: 'unknown';
|
|
105
|
+
const reducedMotion = typeof matchMedia === 'function' ? matchMedia('(prefers-reduced-motion: reduce)').matches : false;
|
|
106
|
+
// App ID is the leftmost subdomain on a *.freeappstore.online or
|
|
107
|
+
// *.freegamestore.online host; bare domains (local dev, custom domains)
|
|
108
|
+
// get the empty string and the dashboard falls back to the iframe URL.
|
|
109
|
+
const host = w.location.hostname;
|
|
110
|
+
const m = /^([^.]+)\.(?:freeappstore|freegamestore)\.online$/.exec(host);
|
|
111
|
+
const appId = m?.[1] ?? '';
|
|
112
|
+
return {
|
|
113
|
+
type: 'fas:quality',
|
|
114
|
+
schema: 1,
|
|
115
|
+
capturedAt: Date.now(),
|
|
116
|
+
appId,
|
|
117
|
+
viewport: { width: w.innerWidth, height: w.innerHeight },
|
|
118
|
+
document: {
|
|
119
|
+
scrollWidth: root.scrollWidth,
|
|
120
|
+
scrollHeight: root.scrollHeight,
|
|
121
|
+
clientWidth: root.clientWidth,
|
|
122
|
+
clientHeight: root.clientHeight,
|
|
123
|
+
scrollsX: root.scrollWidth > root.clientWidth + TOLERANCE_PX,
|
|
124
|
+
scrollsY: root.scrollHeight > root.clientHeight + TOLERANCE_PX,
|
|
125
|
+
},
|
|
126
|
+
clipping,
|
|
127
|
+
colorScheme,
|
|
128
|
+
reducedMotion,
|
|
129
|
+
reporterVersion: REPORTER_VERSION,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Start the reporter. Idempotent — calling twice returns the existing
|
|
134
|
+
* handle. Designed for one-line use: `initQualityReporter()` from your
|
|
135
|
+
* app's main.tsx / entry. The reporter is a no-op when not iframed,
|
|
136
|
+
* so leaving it on in production has zero cost.
|
|
137
|
+
*
|
|
138
|
+
* Channels:
|
|
139
|
+
* - posts to `window.parent` with `type: 'fas:quality'`
|
|
140
|
+
* - listens on `window` for `type: 'fas:quality:request'` so the parent
|
|
141
|
+
* can poll on demand (e.g. after resizing the iframe)
|
|
142
|
+
*/
|
|
143
|
+
export function initQualityReporter() {
|
|
144
|
+
// Idempotency guard: parent dashboards can probe + the SDK can also
|
|
145
|
+
// call this; we only want one reporter per page.
|
|
146
|
+
const w = typeof window !== 'undefined' ? window : null;
|
|
147
|
+
if (!w)
|
|
148
|
+
return { stop: () => undefined, reportNow: () => undefined };
|
|
149
|
+
const existing = w.__FAS_QUALITY_REPORTER__;
|
|
150
|
+
if (existing)
|
|
151
|
+
return existing;
|
|
152
|
+
if (!shouldReport()) {
|
|
153
|
+
// No-op handle — production page with no parent. Still install one
|
|
154
|
+
// marker so a later call doesn't try to install again.
|
|
155
|
+
const noop = { stop: () => undefined, reportNow: () => undefined };
|
|
156
|
+
w.__FAS_QUALITY_REPORTER__ = noop;
|
|
157
|
+
return noop;
|
|
158
|
+
}
|
|
159
|
+
const post = () => {
|
|
160
|
+
try {
|
|
161
|
+
w.parent.postMessage(snapshot(), '*');
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Parent may have closed or set restrictive CSP; nothing to do.
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
// Fire on initial layout, after fonts settle, and after any subsequent
|
|
168
|
+
// resize. The 250ms delay matches what fas screencheck waits for fonts.
|
|
169
|
+
const initialPost = () => {
|
|
170
|
+
post();
|
|
171
|
+
setTimeout(post, 250);
|
|
172
|
+
setTimeout(post, 1500); // catch late layout (web fonts, lazy images)
|
|
173
|
+
};
|
|
174
|
+
const onResize = () => post();
|
|
175
|
+
const onMessage = (e) => {
|
|
176
|
+
const data = e.data;
|
|
177
|
+
if (data && data.type === 'fas:quality:request')
|
|
178
|
+
post();
|
|
179
|
+
};
|
|
180
|
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
181
|
+
initialPost();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
document.addEventListener('DOMContentLoaded', initialPost, { once: true });
|
|
185
|
+
}
|
|
186
|
+
w.addEventListener('resize', onResize);
|
|
187
|
+
w.addEventListener('message', onMessage);
|
|
188
|
+
const handle = {
|
|
189
|
+
stop: () => {
|
|
190
|
+
w.removeEventListener('resize', onResize);
|
|
191
|
+
w.removeEventListener('message', onMessage);
|
|
192
|
+
delete w.__FAS_QUALITY_REPORTER__;
|
|
193
|
+
},
|
|
194
|
+
reportNow: post,
|
|
195
|
+
};
|
|
196
|
+
w.__FAS_QUALITY_REPORTER__ = handle;
|
|
197
|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C;QACD,SAAS,EAAE,IAAI;KAChB,CAAC;IACD,CAA8D,CAAC,wBAAwB,GAAG,MAAM,CAAC;IAClG,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
3
|
+
import { snapshot, initQualityReporter } from './index.js';
|
|
4
|
+
describe('snapshot', () => {
|
|
5
|
+
it('returns the schema-1 shape with required keys', () => {
|
|
6
|
+
const s = snapshot();
|
|
7
|
+
expect(s.type).toBe('fas:quality');
|
|
8
|
+
expect(s.schema).toBe(1);
|
|
9
|
+
expect(typeof s.capturedAt).toBe('number');
|
|
10
|
+
expect(s.viewport).toBeDefined();
|
|
11
|
+
expect(s.document).toBeDefined();
|
|
12
|
+
expect(s.clipping).toBeInstanceOf(Array);
|
|
13
|
+
expect(['light', 'dark', 'unknown']).toContain(s.colorScheme);
|
|
14
|
+
});
|
|
15
|
+
it('extracts appId from *.freeappstore.online host', () => {
|
|
16
|
+
Object.defineProperty(window, 'location', {
|
|
17
|
+
value: { hostname: 'tetris.freegamestore.online' },
|
|
18
|
+
configurable: true,
|
|
19
|
+
});
|
|
20
|
+
expect(snapshot().appId).toBe('tetris');
|
|
21
|
+
Object.defineProperty(window, 'location', {
|
|
22
|
+
value: { hostname: 'todo.freeappstore.online' },
|
|
23
|
+
configurable: true,
|
|
24
|
+
});
|
|
25
|
+
expect(snapshot().appId).toBe('todo');
|
|
26
|
+
});
|
|
27
|
+
it('returns empty appId for local dev / custom domains', () => {
|
|
28
|
+
Object.defineProperty(window, 'location', {
|
|
29
|
+
value: { hostname: 'localhost' },
|
|
30
|
+
configurable: true,
|
|
31
|
+
});
|
|
32
|
+
expect(snapshot().appId).toBe('');
|
|
33
|
+
Object.defineProperty(window, 'location', {
|
|
34
|
+
value: { hostname: 'example.com' },
|
|
35
|
+
configurable: true,
|
|
36
|
+
});
|
|
37
|
+
expect(snapshot().appId).toBe('');
|
|
38
|
+
});
|
|
39
|
+
it('flags scrollsX/scrollsY when scrollWidth/Height exceed client', () => {
|
|
40
|
+
// jsdom's layout numbers are mostly zero; mock the getter chain.
|
|
41
|
+
const root = document.documentElement;
|
|
42
|
+
Object.defineProperty(root, 'scrollWidth', { get: () => 500, configurable: true });
|
|
43
|
+
Object.defineProperty(root, 'clientWidth', { get: () => 393, configurable: true });
|
|
44
|
+
Object.defineProperty(root, 'scrollHeight', { get: () => 800, configurable: true });
|
|
45
|
+
Object.defineProperty(root, 'clientHeight', { get: () => 800, configurable: true });
|
|
46
|
+
const s = snapshot();
|
|
47
|
+
expect(s.document.scrollsX).toBe(true);
|
|
48
|
+
expect(s.document.scrollsY).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
it('detects inner clipping on overflow:hidden elements', () => {
|
|
51
|
+
document.body.innerHTML = '<div class="clipper"><div class="big"></div></div>';
|
|
52
|
+
const clipper = document.querySelector('.clipper');
|
|
53
|
+
// Mock getComputedStyle so the clipper reports overflow:hidden.
|
|
54
|
+
const origGet = window.getComputedStyle;
|
|
55
|
+
window.getComputedStyle = ((el) => {
|
|
56
|
+
if (el === clipper)
|
|
57
|
+
return { overflowX: 'hidden', overflowY: 'visible' };
|
|
58
|
+
return origGet(el);
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(clipper, 'scrollWidth', { get: () => 500 });
|
|
61
|
+
Object.defineProperty(clipper, 'clientWidth', { get: () => 200 });
|
|
62
|
+
Object.defineProperty(clipper, 'scrollHeight', { get: () => 100 });
|
|
63
|
+
Object.defineProperty(clipper, 'clientHeight', { get: () => 100 });
|
|
64
|
+
const s = snapshot();
|
|
65
|
+
expect(s.clipping.length).toBeGreaterThan(0);
|
|
66
|
+
expect(s.clipping[0].clipsX).toBe(true);
|
|
67
|
+
expect(s.clipping[0].selector).toContain('div');
|
|
68
|
+
window.getComputedStyle = origGet;
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe('initQualityReporter', () => {
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
delete window.__FAS_QUALITY_REPORTER__;
|
|
74
|
+
delete window.__FAS_QUALITY_DISABLE;
|
|
75
|
+
});
|
|
76
|
+
afterEach(() => {
|
|
77
|
+
const h = window.__FAS_QUALITY_REPORTER__;
|
|
78
|
+
if (h?.stop)
|
|
79
|
+
h.stop();
|
|
80
|
+
});
|
|
81
|
+
it('is a no-op when there is no parent (top-level navigation)', () => {
|
|
82
|
+
// jsdom's window.parent === window by default — same as a real top-level page.
|
|
83
|
+
const handle = initQualityReporter();
|
|
84
|
+
expect(typeof handle.stop).toBe('function');
|
|
85
|
+
expect(typeof handle.reportNow).toBe('function');
|
|
86
|
+
// Calling reportNow shouldn't throw.
|
|
87
|
+
expect(() => handle.reportNow()).not.toThrow();
|
|
88
|
+
});
|
|
89
|
+
it('returns the existing handle on second call (idempotent)', () => {
|
|
90
|
+
const a = initQualityReporter();
|
|
91
|
+
const b = initQualityReporter();
|
|
92
|
+
expect(a).toBe(b);
|
|
93
|
+
});
|
|
94
|
+
it('skips reporting when window.__FAS_QUALITY_DISABLE is set', () => {
|
|
95
|
+
window.__FAS_QUALITY_DISABLE = true;
|
|
96
|
+
const handle = initQualityReporter();
|
|
97
|
+
expect(handle).toBeDefined();
|
|
98
|
+
// Internal marker should still be set so we don't re-attach.
|
|
99
|
+
expect(window.__FAS_QUALITY_REPORTER__).toBeDefined();
|
|
100
|
+
});
|
|
101
|
+
it('posts a snapshot when an iframe parent requests via fas:quality:request', () => {
|
|
102
|
+
// Simulate iframed: fake out window.parent so it's NOT === window.
|
|
103
|
+
const fakeParent = { postMessage: vi.fn() };
|
|
104
|
+
Object.defineProperty(window, 'parent', { value: fakeParent, configurable: true });
|
|
105
|
+
const handle = initQualityReporter();
|
|
106
|
+
// Trigger a manual snapshot post.
|
|
107
|
+
handle.reportNow();
|
|
108
|
+
expect(fakeParent.postMessage).toHaveBeenCalled();
|
|
109
|
+
const arg = fakeParent.postMessage.mock.calls[0]?.[0];
|
|
110
|
+
expect(arg.type).toBe('fas:quality');
|
|
111
|
+
expect(arg.schema).toBe(1);
|
|
112
|
+
// Restore parent.
|
|
113
|
+
Object.defineProperty(window, 'parent', { value: window, configurable: true });
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE3D,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACnC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,CAAC,OAAO,EA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M,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;QACrC,kCAAkC;QAClC,MAAM,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAClD,MAAM,GAAG,GAAI,UAAU,CAAC,WAAwC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAGjF,CAAC;QACF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,kBAAkB;QAClB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@freeappstore/quality",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Quality reporter — apps post viewport metrics to a parent dashboard via postMessage so /quality can audit fit / scroll / clipping at every reference viewport without driving a headless browser per app.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/freeappstore-online/sdk#readme",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/freeappstore-online/sdk.git",
|
|
19
|
+
"directory": "packages/quality"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/freeappstore-online/sdk/issues"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"freeappstore",
|
|
26
|
+
"freegamestore",
|
|
27
|
+
"quality",
|
|
28
|
+
"audit",
|
|
29
|
+
"viewport"
|
|
30
|
+
],
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"jsdom": "^25.0.0",
|
|
40
|
+
"typescript": "^5.7.0",
|
|
41
|
+
"vitest": "^2.1.0"
|
|
42
|
+
},
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run"
|
|
48
|
+
}
|
|
49
|
+
}
|