cursedbelt 4.1.1 → 4.3.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/react/media/CanvasVideoPlayer.d.ts +3 -2
- package/dist/react/media/CanvasVideoPlayer.d.ts.map +1 -1
- package/dist/react/media/CanvasVideoPlayer.js +4 -3
- package/dist/react/media/CanvasVideoPlayer.js.map +1 -1
- package/dist/react/media/FrameGrabber.d.ts +16 -2
- package/dist/react/media/FrameGrabber.d.ts.map +1 -1
- package/dist/react/media/FrameGrabber.js +68 -43
- package/dist/react/media/FrameGrabber.js.map +1 -1
- package/dist/react/media/PictureEditor.d.ts +17 -2
- package/dist/react/media/PictureEditor.d.ts.map +1 -1
- package/dist/react/media/PictureEditor.js +33 -7
- package/dist/react/media/PictureEditor.js.map +1 -1
- package/dist/react/media/VideoChapterEditor.d.ts +17 -2
- package/dist/react/media/VideoChapterEditor.d.ts.map +1 -1
- package/dist/react/media/VideoChapterEditor.js +21 -3
- package/dist/react/media/VideoChapterEditor.js.map +1 -1
- package/dist/react/media/VideoCutEditor.d.ts +16 -2
- package/dist/react/media/VideoCutEditor.d.ts.map +1 -1
- package/dist/react/media/VideoCutEditor.js +21 -3
- package/dist/react/media/VideoCutEditor.js.map +1 -1
- package/dist/react/media/VideoPlayer.d.ts +37 -9
- package/dist/react/media/VideoPlayer.d.ts.map +1 -1
- package/dist/react/media/VideoPlayer.js +130 -39
- package/dist/react/media/VideoPlayer.js.map +1 -1
- package/dist/react/media/hlsSource.d.ts +24 -3
- package/dist/react/media/hlsSource.d.ts.map +1 -1
- package/dist/react/media/hlsSource.js +109 -8
- package/dist/react/media/hlsSource.js.map +1 -1
- package/dist/react/media/pictureEditor.css +2 -0
- package/dist/react/media/sourceFault.d.ts +146 -0
- package/dist/react/media/sourceFault.d.ts.map +1 -0
- package/dist/react/media/sourceFault.js +139 -0
- package/dist/react/media/sourceFault.js.map +1 -0
- package/dist/react/media/videoChapterEditor.css +19 -0
- package/dist/react/media/videoCutEditor.css +22 -0
- package/dist/react/media-gallery/MediaGallery.d.ts +12 -1
- package/dist/react/media-gallery/MediaGallery.d.ts.map +1 -1
- package/dist/react/media-gallery/MediaGallery.js +166 -13
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/media-gallery/galleryItemMedia.d.ts +4 -0
- package/dist/react/media-gallery/galleryItemMedia.d.ts.map +1 -1
- package/dist/react/media-gallery/galleryItemMedia.js +27 -3
- package/dist/react/media-gallery/galleryItemMedia.js.map +1 -1
- package/dist/react/media-gallery/mediaGalleryModel.d.ts.map +1 -1
- package/dist/react/media-gallery/mediaGalleryModel.js +5 -0
- package/dist/react/media-gallery/mediaGalleryModel.js.map +1 -1
- package/dist/react/media-gallery/types.d.ts +23 -0
- package/dist/react/media-gallery/types.d.ts.map +1 -1
- package/dist/scripts/guardrailsEnforce.d.ts +1 -0
- package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
- package/dist/styles-areas/media-gallery.css +1 -1
- package/dist/styles-areas/media.css +1 -1
- package/package.json +3 -2
- package/scripts/guardrailsEnforce.spec.ts +244 -1
- package/scripts/guardrailsEnforce.ts +224 -7
- package/src/react/media/CanvasVideoPlayer.tsx +11 -6
- package/src/react/media/FrameGrabber.spec.tsx +57 -1
- package/src/react/media/FrameGrabber.tsx +138 -84
- package/src/react/media/PictureEditor.spec.tsx +90 -0
- package/src/react/media/PictureEditor.tsx +78 -23
- package/src/react/media/VideoChapterEditor.spec.tsx +86 -0
- package/src/react/media/VideoChapterEditor.tsx +64 -18
- package/src/react/media/VideoCutEditor.spec.tsx +44 -0
- package/src/react/media/VideoCutEditor.tsx +63 -18
- package/src/react/media/VideoPlayer.spec.tsx +101 -0
- package/src/react/media/VideoPlayer.tsx +221 -73
- package/src/react/media/hlsSource.answer.spec.ts +255 -0
- package/src/react/media/hlsSource.ts +136 -8
- package/src/react/media/pictureEditor.css +2 -0
- package/src/react/media/sourceFault.spec.tsx +224 -0
- package/src/react/media/sourceFault.tsx +220 -0
- package/src/react/media/videoChapterEditor.css +19 -0
- package/src/react/media/videoCutEditor.css +22 -0
- package/src/react/media-gallery/MediaGallery.spec.tsx +288 -0
- package/src/react/media-gallery/MediaGallery.tsx +356 -45
- package/src/react/media-gallery/galleryItemMedia.tsx +27 -4
- package/src/react/media-gallery/mediaGalleryModel.spec.ts +36 -0
- package/src/react/media-gallery/mediaGalleryModel.ts +4 -0
- package/src/react/media-gallery/types.ts +23 -0
- package/src/styles-areas/media-gallery.css +1 -1
- package/src/styles-areas/media.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"galleryItemMedia.d.ts","sourceRoot":"","sources":["../../../src/react/media-gallery/galleryItemMedia.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"galleryItemMedia.d.ts","sourceRoot":"","sources":["../../../src/react/media-gallery/galleryItemMedia.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAA4C,MAAM,OAAO,CAAC;AAExF,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9F;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,UAAU,GAChB;IAAE,KAAK,EAAE,qBAAqB,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAA;CAAE,CAoD9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,WAAW,EACX,GAAG,EACH,SAAS,EACT,KAAK,GACN,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,+BAeA"}
|
|
@@ -9,17 +9,40 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* signed-URL app is a request per row per toggle. A module both import is the only shape
|
|
10
10
|
* that cannot drift; re-implementing either inside the table is what this file prevents.
|
|
11
11
|
*/
|
|
12
|
-
import { useEffect, useState } from 'react';
|
|
12
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
13
13
|
import { staticItemMedia } from './mediaGalleryModel';
|
|
14
14
|
/**
|
|
15
15
|
* The item's resolved media: static URL fields immediately, `resolveMedia` results merged
|
|
16
16
|
* in when the item needs them (cached per id for the gallery's lifetime).
|
|
17
|
+
*
|
|
18
|
+
* `refresh` throws the cached answer away and asks the app again — see its own note; it is
|
|
19
|
+
* what makes a `403` from a stale signed URL recoverable instead of a sentence on screen.
|
|
17
20
|
*/
|
|
18
21
|
export function useItemMedia(item, cache) {
|
|
19
22
|
const staticMedia = staticItemMedia(item);
|
|
20
23
|
const needsResolve = Boolean(item.resolveMedia) && !item.url;
|
|
21
24
|
const [resolved, setResolved] = useState(null);
|
|
22
25
|
const [resolving, setResolving] = useState(needsResolve);
|
|
26
|
+
/** Bumped by {@link refresh} so the effect below re-runs against an emptied cache. */
|
|
27
|
+
const [attempt, setAttempt] = useState(0);
|
|
28
|
+
/**
|
|
29
|
+
* 🔴 ONE re-ask per item, for the life of this mount.
|
|
30
|
+
*
|
|
31
|
+
* The whole reason to re-ask is a signed URL that went stale, and the app's answer to that
|
|
32
|
+
* is a fresh token — so if the second URL fails the same way, asking a third time is an
|
|
33
|
+
* unbounded loop against something that is not going to change, which is the same spinner
|
|
34
|
+
* this batch removed with more requests in it. `RECOVERY_BUDGET` in `hlsSource.ts` bounds
|
|
35
|
+
* its retries for exactly this reason; this is that rule one layer up.
|
|
36
|
+
*/
|
|
37
|
+
const reAsked = useRef(new Set());
|
|
38
|
+
const refresh = useCallback(() => {
|
|
39
|
+
if (!needsResolve || reAsked.current.has(item.id))
|
|
40
|
+
return false;
|
|
41
|
+
reAsked.current.add(item.id);
|
|
42
|
+
cache.current.delete(item.id);
|
|
43
|
+
setAttempt((n) => n + 1);
|
|
44
|
+
return true;
|
|
45
|
+
}, [item.id, needsResolve, cache]);
|
|
23
46
|
useEffect(() => {
|
|
24
47
|
if (!needsResolve)
|
|
25
48
|
return;
|
|
@@ -46,8 +69,9 @@ export function useItemMedia(item, cache) {
|
|
|
46
69
|
return () => {
|
|
47
70
|
live = false;
|
|
48
71
|
};
|
|
49
|
-
|
|
50
|
-
|
|
72
|
+
// `attempt` is the re-ask: it is not read in the body, it is what re-runs it.
|
|
73
|
+
}, [item.id, needsResolve, cache, item.resolveMedia, attempt]);
|
|
74
|
+
return { media: { ...(resolved ?? {}), ...staticMedia }, resolving, refresh };
|
|
51
75
|
}
|
|
52
76
|
/**
|
|
53
77
|
* "13 Aug 2026" — the created date in the shortest form that stays unambiguous.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"galleryItemMedia.js","sourceRoot":"","sources":["../../../src/react/media-gallery/galleryItemMedia.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,EAAyB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"galleryItemMedia.js","sourceRoot":"","sources":["../../../src/react/media-gallery/galleryItemMedia.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,EAAyB,WAAW,EAAE,SAAS,EAAE,M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;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAazE;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gBAAgB,EAAE,EACzB,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,aAAa,GAClC,gBAAgB,EAAE,CAYpB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,EAAE;IAClC,GAAG,EAAE,iBAAiB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,EAoBA,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,gBAAgB,EAAE,EACzB,KAAK,EAAE,iBAAiB,GACvB,gBAAgB,EAAE,CAyBpB;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,qBAAqB,CAe7E;AAED,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE7D;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAI/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIjF"}
|
|
@@ -183,6 +183,11 @@ export function staticItemMedia(item) {
|
|
|
183
183
|
// Additional to `streamUrl`, never instead of it — see `MediaGalleryItemMedia.hlsUrl`.
|
|
184
184
|
if (item.hlsUrl)
|
|
185
185
|
media.hlsUrl = item.hlsUrl;
|
|
186
|
+
// "We could not ASK about the ladder", which is not the same as not having one — see
|
|
187
|
+
// `MediaGalleryItemMedia.playbackDegraded`. Forwarded only when true, so the ordinary
|
|
188
|
+
// ladder-less video carries nothing and the stage has nothing to say about it.
|
|
189
|
+
if (item.playbackDegraded)
|
|
190
|
+
media.playbackDegraded = true;
|
|
186
191
|
if (item.vttUrl)
|
|
187
192
|
media.vttUrl = item.vttUrl;
|
|
188
193
|
if (item.processingStatus)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaGalleryModel.js","sourceRoot":"","sources":["../../../src/react/media-gallery/mediaGalleryModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGjE,iFAAiF;AACjF,yFAAyF;AAEzF,sFAAsF;AACtF,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,OAAO,IAAI,CAAC,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAiC;IAC9D,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,+FAA+F;AAC/F,MAAM,UAAU,GAAmB;IACjC,OAAO;IACP,OAAO;IACP,OAAO;IACP,KAAK;IACL,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,S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AC,gBAAgB,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAAC,IAAsB;IAClD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,cAAc,CAAC,IAAsB;IACnD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,IAAyC;IACpE,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,OAAO,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,IAAyC;IACtE,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,OAAO,CAAC;AACtD,CAAC"}
|
|
@@ -47,6 +47,29 @@ export interface MediaGalleryItemMedia {
|
|
|
47
47
|
* and `preferBundledHls`, which decides where the engine comes from.
|
|
48
48
|
*/
|
|
49
49
|
hlsUrl?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The ladder was not ASKED ABOUT successfully — so this play is the progressive fallback and
|
|
52
|
+
* the app knows it, rather than merely having no ladder.
|
|
53
|
+
*
|
|
54
|
+
* 🔴 It is NOT "there is no ladder". A video whose ladder has simply never been built is the
|
|
55
|
+
* ordinary case and stays quiet: {@link hlsUrl} is absent, `streamUrl` plays, nothing is
|
|
56
|
+
* wrong. This flag is the other thing — the app's probe of its own media store did not
|
|
57
|
+
* answer, so it cannot tell a ladder that is missing from one it could not reach, and it has
|
|
58
|
+
* served the progressive copy on that ignorance.
|
|
59
|
+
*
|
|
60
|
+
* 🔴 And it is NOT {@link processingStatus} `'failed'`. That badge says the optimization
|
|
61
|
+
* failed; here the optimization may well have succeeded and we could not ask. Different
|
|
62
|
+
* cause, different fix, different lifetime — this one usually clears on the next open — so
|
|
63
|
+
* the player draws a SECOND badge rather than borrowing that one's sentence.
|
|
64
|
+
*
|
|
65
|
+
* Worth a badge because the fallback is expensive and silent: in `apps/collections` the
|
|
66
|
+
* progressive `.web.mp4` averages 467 MB and reaches 4.4 GB, which is past what Cloudflare
|
|
67
|
+
* will cache (`x-bs-edge-cache: MISS-TOO-LARGE`), so every play and every seek is pulled off
|
|
68
|
+
* the owner's own Mac; a ladder segment is ~1 MB and comes from the edge. For eight days
|
|
69
|
+
* nothing in the fleet could say which of the two it was serving, and the owner found out by
|
|
70
|
+
* watching a video stall.
|
|
71
|
+
*/
|
|
72
|
+
playbackDegraded?: boolean;
|
|
50
73
|
/**
|
|
51
74
|
* WebVTT scrub-preview track — the sprite-sheet index that puts real frame thumbnails on
|
|
52
75
|
* the scrub bar instead of a bare timecode. Passed straight to the player's `thumbnails`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/media-gallery/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,WAAW,GACX,MAAM,GACN,UAAU,CAAC;AAEf;;;;GAIG;AACH,MAAM,WAA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C,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACzE;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrailsEnforce.d.ts","sourceRoot":"","sources":["../../scripts/guardrailsEnforce.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"guardrailsEnforce.d.ts","sourceRoot":"","sources":["../../scripts/guardrailsEnforce.ts"],"names":[],"mappings":";AA0LA,UAAU,SAAS;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,IAAI;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;CACzD;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CA6B9D;AAu2BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAEpE;AAweD,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAkBtC,CAAC;AASF,eAAO,MAAM,uBAAuB,aAAkD,CAAC;AAGvF,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED;2FAC2F;AAC3F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA0C3F;AAED,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAmGhC,wBAAgB,0BAA0B,CAAC,SAAS,GAAE,MAAwB,GAAG,MAAM,EAAE,CAyBxF"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* An app that imports every area gets exactly what `cursedbelt/styles-utilities.css`
|
|
17
17
|
* emits — proved rule by rule in src/stylesAreas.spec.ts, which is also what fails
|
|
18
|
-
* when this file is stale.
|
|
18
|
+
* when this file is stale. 2113 candidate(s) scanned.
|
|
19
19
|
*
|
|
20
20
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
21
21
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* An app that imports every area gets exactly what `cursedbelt/styles-utilities.css`
|
|
17
17
|
* emits — proved rule by rule in src/stylesAreas.spec.ts, which is also what fails
|
|
18
|
-
* when this file is stale.
|
|
18
|
+
* when this file is stale. 2825 candidate(s) scanned.
|
|
19
19
|
*
|
|
20
20
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
21
21
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The React design system of the cursedbelt split — components, styles, theme. cursedbelt-core below it; server tier in cursedbelt-server.",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"styles": "bun run styles:static && bun run styles:utilities && bun run styles:areas",
|
|
32
32
|
"styles:static": "bun run scripts/generateStaticStyles.ts",
|
|
33
33
|
"styles:utilities": "bun run scripts/generateUtilityStyles.ts",
|
|
34
|
-
"test": "NODE_ENV=development bun test src --parallel=6",
|
|
34
|
+
"test": "NODE_ENV=development bun test src --timeout 60000 --parallel=6",
|
|
35
35
|
"demo": "vite --config demo/vite.config.ts",
|
|
36
36
|
"demo:build": "vite build --config demo/vite.config.ts",
|
|
37
37
|
"demo:serve": "bun run demo:build && vite preview --config demo/vite.config.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"e2e:stage-layout": "playwright test --config e2e/playwright.config.ts stage-layout.spec.ts",
|
|
43
43
|
"e2e:dialog-reach": "playwright test --config e2e/playwright.config.ts dialog-reach.spec.ts",
|
|
44
44
|
"e2e:video-turn": "playwright test --config e2e/playwright.config.ts video-turn.spec.ts",
|
|
45
|
+
"e2e:playback-degraded": "playwright test --config e2e/playwright.config.ts playback-degraded.spec.ts",
|
|
45
46
|
"e2e:resize-grip": "playwright test --config e2e/playwright.config.ts resize-grip-rail.spec.ts",
|
|
46
47
|
"e2e:touch": "playwright test --config e2e/playwright.config.ts --project=touch",
|
|
47
48
|
"done:serial": "bun run typecheck && bun run lint && bun run test && bun run build",
|
|
@@ -2,7 +2,7 @@ import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { describe, expect, test } from 'bun:test';
|
|
5
|
-
import { parseFileAllows, RULES, setReimplementedNames, walk } from './guardrailsEnforce';
|
|
5
|
+
import { beltExportedComponentNames, parseFileAllows, RULES, setReimplementedNames, walk } from './guardrailsEnforce';
|
|
6
6
|
|
|
7
7
|
function check(rule: keyof typeof RULES, source: string) {
|
|
8
8
|
return RULES[rule].check('test.tsx', source);
|
|
@@ -864,3 +864,246 @@ describe('no-fast-tooltip', () => {
|
|
|
864
864
|
).toHaveLength(0);
|
|
865
865
|
});
|
|
866
866
|
});
|
|
867
|
+
|
|
868
|
+
// ── the CLI's two ratchets, and the flags that let an app use one ──────────────
|
|
869
|
+
// Nine apps each carried an identical ~140-line wrapper (`apps/*/scripts/guardrails.ts`)
|
|
870
|
+
// because this CLI could only read the baseline shipped INSIDE the package. These
|
|
871
|
+
// exercise the flags that replaced them, as a subprocess — the wrappers' only contract
|
|
872
|
+
// was this script's exit code and its verdict lines, and that is what an app's `verify`
|
|
873
|
+
// still depends on.
|
|
874
|
+
|
|
875
|
+
const CLI = join(import.meta.dir, 'guardrailsEnforce.ts');
|
|
876
|
+
|
|
877
|
+
function withFixture(files: Record<string, string>, body: (dir: string) => void): void {
|
|
878
|
+
const root = mkdtempSync(join(tmpdir(), 'guardrails-cli-'));
|
|
879
|
+
try {
|
|
880
|
+
for (const [rel, contents] of Object.entries(files)) {
|
|
881
|
+
const full = join(root, rel);
|
|
882
|
+
mkdirSync(join(full, '..'), { recursive: true });
|
|
883
|
+
writeFileSync(full, contents);
|
|
884
|
+
}
|
|
885
|
+
body(root);
|
|
886
|
+
} finally {
|
|
887
|
+
rmSync(root, { recursive: true, force: true });
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
function runCli(cwd: string, args: string[]): { code: number; report: string } {
|
|
892
|
+
const run = Bun.spawnSync([process.execPath, CLI, ...args], { cwd });
|
|
893
|
+
return { code: run.exitCode, report: `${run.stdout.toString()}${run.stderr.toString()}` };
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/** Two hex colours and one raw <input>: counts a baseline row can be wrong about. */
|
|
897
|
+
const FIXTURE = {
|
|
898
|
+
'src/ui/theme.css': '.a { color: #ff0000; }\n.b { background: #00ff00; }\n',
|
|
899
|
+
'src/ui/Form.tsx': 'export const Form = () => <input name="q" />;\n',
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
const rowsFor = (colors: number, inputs: number) =>
|
|
903
|
+
JSON.stringify({ 'no-hardcoded-colors': colors, 'no-raw-inputs': inputs });
|
|
904
|
+
|
|
905
|
+
describe('--baseline (a consuming repo\'s ratchet)', () => {
|
|
906
|
+
test('passes when every row equals the count that is actually there', () => {
|
|
907
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': rowsFor(2, 1) }, (dir) => {
|
|
908
|
+
const { code, report } = runCli(dir, [
|
|
909
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
910
|
+
'--baseline',
|
|
911
|
+
'scripts/baseline.json',
|
|
912
|
+
'src',
|
|
913
|
+
]);
|
|
914
|
+
expect(report).toContain('✓ no-hardcoded-colors: 2 violation(s)');
|
|
915
|
+
expect(report).toContain('✓ no-raw-inputs: 1 violation(s)');
|
|
916
|
+
expect(code).toBe(0);
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
test('🔴 a row ABOVE the real count FAILS, printing the number to paste', () => {
|
|
921
|
+
// The half a one-sided ratchet gets wrong: fix a violation, leave the row where it
|
|
922
|
+
// was, and the slack is available for the next one to grow back into silently.
|
|
923
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': rowsFor(9, 1) }, (dir) => {
|
|
924
|
+
const { code, report } = runCli(dir, [
|
|
925
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
926
|
+
'--baseline',
|
|
927
|
+
'scripts/baseline.json',
|
|
928
|
+
'src',
|
|
929
|
+
]);
|
|
930
|
+
expect(code).toBe(1);
|
|
931
|
+
expect(report).toContain('✗ no-hardcoded-colors: 2 violation(s), below the baseline of 9');
|
|
932
|
+
expect(report).toContain('lower "no-hardcoded-colors" to 2 in scripts/baseline.json');
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
test('a count above its row fails, the way it always did', () => {
|
|
937
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': rowsFor(2, 0) }, (dir) => {
|
|
938
|
+
const { code, report } = runCli(dir, [
|
|
939
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
940
|
+
'--baseline',
|
|
941
|
+
'scripts/baseline.json',
|
|
942
|
+
'src',
|
|
943
|
+
]);
|
|
944
|
+
expect(code).toBe(1);
|
|
945
|
+
expect(report).toContain('✗ no-raw-inputs: 1 violation(s) — exceeds baseline of 0');
|
|
946
|
+
});
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
test('a row for a rule nobody scans is refused — coverage that is not there', () => {
|
|
950
|
+
withFixture(
|
|
951
|
+
{ ...FIXTURE, 'scripts/baseline.json': JSON.stringify({ 'no-hardcoded-colors': 2, 'no-raw-zindex': 0 }) },
|
|
952
|
+
(dir) => {
|
|
953
|
+
const { code, report } = runCli(dir, ['no-hardcoded-colors', '--baseline', 'scripts/baseline.json', 'src']);
|
|
954
|
+
expect(code).toBe(2);
|
|
955
|
+
expect(report).toContain('row(s) for rules nobody scans: no-raw-zindex');
|
|
956
|
+
},
|
|
957
|
+
);
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
test('a scanned rule with no row is refused — a silent 0 demands the whole pile at once', () => {
|
|
961
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': JSON.stringify({ 'no-hardcoded-colors': 2 }) }, (dir) => {
|
|
962
|
+
const { code, report } = runCli(dir, [
|
|
963
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
964
|
+
'--baseline',
|
|
965
|
+
'scripts/baseline.json',
|
|
966
|
+
'src',
|
|
967
|
+
]);
|
|
968
|
+
expect(code).toBe(2);
|
|
969
|
+
expect(report).toContain('no row for rule(s) being scanned: no-raw-inputs');
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
test('"$comment" carries the why; any OTHER non-number is a typo in a row', () => {
|
|
974
|
+
withFixture(
|
|
975
|
+
{
|
|
976
|
+
...FIXTURE,
|
|
977
|
+
'scripts/baseline.json': JSON.stringify({ $comment: ['the why', 'over several lines'], 'no-hardcoded-colors': 2 }),
|
|
978
|
+
},
|
|
979
|
+
(dir) => {
|
|
980
|
+
expect(runCli(dir, ['no-hardcoded-colors', '--baseline', 'scripts/baseline.json', 'src']).code).toBe(0);
|
|
981
|
+
},
|
|
982
|
+
);
|
|
983
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': JSON.stringify({ 'no-hardcoded-colors': '2' }) }, (dir) => {
|
|
984
|
+
const { code, report } = runCli(dir, ['no-hardcoded-colors', '--baseline', 'scripts/baseline.json', 'src']);
|
|
985
|
+
expect(code).toBe(2);
|
|
986
|
+
expect(report).toContain('"no-hardcoded-colors" is "2", not a violation count');
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
test('a missing baseline file stops the run rather than defaulting every row to 0', () => {
|
|
991
|
+
withFixture(FIXTURE, (dir) => {
|
|
992
|
+
const { code, report } = runCli(dir, ['no-hardcoded-colors', '--baseline', 'scripts/nope.json', 'src']);
|
|
993
|
+
expect(code).toBe(2);
|
|
994
|
+
expect(report).toContain('no such file');
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
test('is not the packaged --scope ratchet, and says so rather than picking one', () => {
|
|
999
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': rowsFor(2, 1) }, (dir) => {
|
|
1000
|
+
const { code, report } = runCli(dir, [
|
|
1001
|
+
'no-hardcoded-colors',
|
|
1002
|
+
'--scope',
|
|
1003
|
+
'cursedbelt',
|
|
1004
|
+
'--baseline',
|
|
1005
|
+
'scripts/baseline.json',
|
|
1006
|
+
'src',
|
|
1007
|
+
]);
|
|
1008
|
+
expect(code).toBe(2);
|
|
1009
|
+
expect(report).toContain('two different ratchets');
|
|
1010
|
+
});
|
|
1011
|
+
});
|
|
1012
|
+
|
|
1013
|
+
test('--scope stays ONE-sided: below its row passes and only suggests', () => {
|
|
1014
|
+
// The packaged baseline lives inside node_modules, so a consumer cannot lower a row
|
|
1015
|
+
// in it. Failing them for a number only a cursedbelt release can change would be a
|
|
1016
|
+
// gate nobody can turn green — which is why only --baseline is two-sided.
|
|
1017
|
+
withFixture(FIXTURE, (dir) => {
|
|
1018
|
+
const { code, report } = runCli(dir, ['no-hardcoded-colors', '--scope', 'cursedbelt', 'src']);
|
|
1019
|
+
expect(code).toBe(1); // 2 found against the packaged cursedbelt row of 0
|
|
1020
|
+
expect(report).toContain('exceeds baseline of 0');
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
describe('--reimplements-from-belt', () => {
|
|
1026
|
+
test('flags a local component named after one this package exports', () => {
|
|
1027
|
+
// Read off this package's own react index files, so the list is the truth of the
|
|
1028
|
+
// version an app installed rather than a copy it maintains.
|
|
1029
|
+
withFixture(
|
|
1030
|
+
{
|
|
1031
|
+
'src/Button.tsx': 'export function Button() { return null; }\n',
|
|
1032
|
+
'scripts/baseline.json': JSON.stringify({ 'no-local-reimplementation': 0 }),
|
|
1033
|
+
},
|
|
1034
|
+
(dir) => {
|
|
1035
|
+
const { code, report } = runCli(dir, [
|
|
1036
|
+
'no-local-reimplementation',
|
|
1037
|
+
'--baseline',
|
|
1038
|
+
'scripts/baseline.json',
|
|
1039
|
+
'--reimplements-from-belt',
|
|
1040
|
+
'src',
|
|
1041
|
+
]);
|
|
1042
|
+
expect(code).toBe(1);
|
|
1043
|
+
expect(report).toContain('✗ no-local-reimplementation: 1 violation(s)');
|
|
1044
|
+
expect(report).toContain('src/Button.tsx');
|
|
1045
|
+
},
|
|
1046
|
+
);
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
test('the derived list is this package\'s real exports, not a handful', () => {
|
|
1050
|
+
const names = beltExportedComponentNames();
|
|
1051
|
+
expect(names.length).toBeGreaterThan(100);
|
|
1052
|
+
expect(names).toContain('Button');
|
|
1053
|
+
expect(names).toContain('DataTable');
|
|
1054
|
+
});
|
|
1055
|
+
|
|
1056
|
+
test('🔴 fails CLOSED on an empty list rather than scoring an inert rule 0', () => {
|
|
1057
|
+
// Without this, a moved react tree makes `no-local-reimplementation` print
|
|
1058
|
+
// "0 violation(s)" for a check that never ran, and its 0 row looks earned.
|
|
1059
|
+
const empty = mkdtempSync(join(tmpdir(), 'guardrails-belt-'));
|
|
1060
|
+
try {
|
|
1061
|
+
expect(beltExportedComponentNames(empty)).toEqual([]);
|
|
1062
|
+
} finally {
|
|
1063
|
+
rmSync(empty, { recursive: true, force: true });
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
describe('--exclude', () => {
|
|
1069
|
+
test('drops build output that lives under a source root', () => {
|
|
1070
|
+
// desk's `src/generated/assets.ts` is the compiled browser app inlined as a module:
|
|
1071
|
+
// 282 double-counted violations that move with the bundle, reddening a two-sided
|
|
1072
|
+
// ratchet over work nobody did.
|
|
1073
|
+
const files = {
|
|
1074
|
+
...FIXTURE,
|
|
1075
|
+
'src/generated/assets.css': '.x { color: #123456; }\n.y { color: #654321; }\n',
|
|
1076
|
+
'scripts/baseline.json': rowsFor(2, 1),
|
|
1077
|
+
};
|
|
1078
|
+
withFixture(files, (dir) => {
|
|
1079
|
+
const scanned = runCli(dir, ['no-hardcoded-colors,no-raw-inputs', '--baseline', 'scripts/baseline.json', 'src']);
|
|
1080
|
+
expect(scanned.code).toBe(1); // 4 colours, not 2 — the artifact counted as source
|
|
1081
|
+
|
|
1082
|
+
const { code, report } = runCli(dir, [
|
|
1083
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
1084
|
+
'--baseline',
|
|
1085
|
+
'scripts/baseline.json',
|
|
1086
|
+
'--exclude',
|
|
1087
|
+
'src/generated',
|
|
1088
|
+
'src',
|
|
1089
|
+
]);
|
|
1090
|
+
expect(report).toContain('✓ no-hardcoded-colors: 2 violation(s)');
|
|
1091
|
+
expect(code).toBe(0);
|
|
1092
|
+
});
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
test('an exclusion matching nothing is refused, never read as handled', () => {
|
|
1096
|
+
withFixture({ ...FIXTURE, 'scripts/baseline.json': rowsFor(2, 1) }, (dir) => {
|
|
1097
|
+
const { code, report } = runCli(dir, [
|
|
1098
|
+
'no-hardcoded-colors,no-raw-inputs',
|
|
1099
|
+
'--baseline',
|
|
1100
|
+
'scripts/baseline.json',
|
|
1101
|
+
'--exclude',
|
|
1102
|
+
'src/generated',
|
|
1103
|
+
'src',
|
|
1104
|
+
]);
|
|
1105
|
+
expect(code).toBe(2);
|
|
1106
|
+
expect(report).toContain('--exclude matched no scanned file');
|
|
1107
|
+
});
|
|
1108
|
+
});
|
|
1109
|
+
});
|