@juangadm/pre-post 1.3.0 → 1.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/README.md +43 -288
- package/assets/labels/post.png +0 -0
- package/assets/labels/pre.png +0 -0
- package/dist/attach.d.ts +59 -0
- package/dist/attach.d.ts.map +1 -0
- package/dist/attach.js +137 -0
- package/dist/attach.js.map +1 -0
- package/dist/baseline.d.ts +26 -1
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +92 -19
- package/dist/baseline.js.map +1 -1
- package/dist/bin/cli.js +40 -16
- package/dist/bin/cli.js.map +1 -1
- package/dist/browser.d.ts +79 -3
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +179 -38
- package/dist/browser.js.map +1 -1
- package/dist/commands/compare.d.ts.map +1 -1
- package/dist/commands/compare.js +5 -5
- package/dist/commands/compare.js.map +1 -1
- package/dist/commands/detect.d.ts +5 -0
- package/dist/commands/detect.d.ts.map +1 -1
- package/dist/commands/detect.js +3 -0
- package/dist/commands/detect.js.map +1 -1
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +21 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/pr.d.ts +5 -0
- package/dist/commands/pr.d.ts.map +1 -1
- package/dist/commands/pr.js +167 -113
- package/dist/commands/pr.js.map +1 -1
- package/dist/comparison.d.ts +5 -0
- package/dist/comparison.d.ts.map +1 -1
- package/dist/comparison.js +5 -5
- package/dist/comparison.js.map +1 -1
- package/dist/compose.d.ts +72 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +237 -0
- package/dist/compose.js.map +1 -0
- package/dist/diff-worker.d.ts +1 -0
- package/dist/diff-worker.d.ts.map +1 -1
- package/dist/diff-worker.js +1 -0
- package/dist/diff-worker.js.map +1 -1
- package/dist/diff.d.ts +42 -0
- package/dist/diff.d.ts.map +1 -1
- package/dist/diff.js +142 -24
- package/dist/diff.js.map +1 -1
- package/dist/doctor.d.ts +4 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +5 -1
- package/dist/doctor.js.map +1 -1
- package/dist/drift.d.ts +29 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +106 -0
- package/dist/drift.js.map +1 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/ffmpeg.d.ts +35 -0
- package/dist/ffmpeg.d.ts.map +1 -0
- package/dist/ffmpeg.js +143 -0
- package/dist/ffmpeg.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/moments.d.ts +83 -0
- package/dist/moments.d.ts.map +1 -0
- package/dist/moments.js +170 -0
- package/dist/moments.js.map +1 -0
- package/dist/record.d.ts +69 -0
- package/dist/record.d.ts.map +1 -0
- package/dist/record.js +223 -0
- package/dist/record.js.map +1 -0
- package/dist/report.d.ts +29 -1
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +174 -42
- package/dist/report.js.map +1 -1
- package/dist/routes/imports.d.ts +21 -1
- package/dist/routes/imports.d.ts.map +1 -1
- package/dist/routes/imports.js +32 -2
- package/dist/routes/imports.js.map +1 -1
- package/dist/routes.d.ts +18 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +110 -29
- package/dist/routes.js.map +1 -1
- package/dist/run.d.ts +48 -12
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +140 -18
- package/dist/run.js.map +1 -1
- package/dist/timeline.d.ts +46 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +80 -0
- package/dist/timeline.js.map +1 -0
- package/dist/types.d.ts +95 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -1
- package/dist/video.d.ts +19 -0
- package/dist/video.d.ts.map +1 -0
- package/dist/video.js +109 -0
- package/dist/video.js.map +1 -0
- package/package.json +4 -2
- package/skill/SKILL.md +38 -10
package/dist/types.d.ts
CHANGED
|
@@ -56,9 +56,25 @@ export interface CaptureResult {
|
|
|
56
56
|
text?: string;
|
|
57
57
|
/** Response looked like it came from Vercel (deployment protection) */
|
|
58
58
|
vercel?: boolean;
|
|
59
|
+
/** The framework's own error overlay, when the page is showing one */
|
|
60
|
+
pageError?: PageError;
|
|
59
61
|
/** Wall-clock milliseconds for navigation + settle + screenshot */
|
|
60
62
|
durationMs: number;
|
|
61
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* An error the page itself reports, read from the framework's error overlay.
|
|
66
|
+
*
|
|
67
|
+
* Its own type rather than a string because three renderers phrase it: the PR
|
|
68
|
+
* says it to a reviewer, the terminal to the developer, JSON to a script.
|
|
69
|
+
*/
|
|
70
|
+
export interface PageError {
|
|
71
|
+
/** The overlay's own label, e.g. "Build Error", "Runtime Error", or "HTTP 500" */
|
|
72
|
+
kind: string;
|
|
73
|
+
/** The first line of the message, e.g. "Parsing ecmascript source code failed" */
|
|
74
|
+
message?: string;
|
|
75
|
+
/** Where the framework says it happened, e.g. "app/work/page.tsx (8:5)" */
|
|
76
|
+
location?: string;
|
|
77
|
+
}
|
|
62
78
|
export interface BeforeAfterCaptureOptions {
|
|
63
79
|
before: CaptureOptions | string;
|
|
64
80
|
after: CaptureOptions | string;
|
|
@@ -97,6 +113,8 @@ export interface DiffResult {
|
|
|
97
113
|
};
|
|
98
114
|
/** Vertical displacement explaining most of the difference, when one does */
|
|
99
115
|
shift?: ShiftSummary;
|
|
116
|
+
/** The changed pixels of both sides, hashed: equal on two routes means the same change */
|
|
117
|
+
fingerprint?: string;
|
|
100
118
|
}
|
|
101
119
|
/**
|
|
102
120
|
* A layout shift: Post content moved down (or up) by a constant amount from a
|
|
@@ -164,6 +182,11 @@ export interface PrePostConfig {
|
|
|
164
182
|
assetsBranch?: string;
|
|
165
183
|
/** Skip paths (glob-ish prefixes) from route detection */
|
|
166
184
|
ignore?: string[];
|
|
185
|
+
/**
|
|
186
|
+
* Short interactions to record on Pre and Post, in priority order; the
|
|
187
|
+
* first three run. See docs/video.md. Validated by `parseMoments`.
|
|
188
|
+
*/
|
|
189
|
+
moments?: unknown[];
|
|
167
190
|
/**
|
|
168
191
|
* Command run in the app directory between the install and the dev server
|
|
169
192
|
* when the baseline is built from source — a workspace build, a codegen
|
|
@@ -199,7 +222,7 @@ export interface RouteCaptureOutcome {
|
|
|
199
222
|
/** Route actually requested (after sample substitution) */
|
|
200
223
|
resolvedRoute: string;
|
|
201
224
|
viewport: string;
|
|
202
|
-
status: 'changed' | 'unchanged' | 'added' | 'removed' | 'error';
|
|
225
|
+
status: 'changed' | 'unchanged' | 'added' | 'removed' | 'broken' | 'error';
|
|
203
226
|
changedRatio?: number;
|
|
204
227
|
sizeChanged?: boolean;
|
|
205
228
|
error?: string;
|
|
@@ -212,8 +235,12 @@ export interface RouteCaptureOutcome {
|
|
|
212
235
|
note?: string;
|
|
213
236
|
/** Vertical displacement of Post against Pre, when one explains the change */
|
|
214
237
|
shift?: RouteShift;
|
|
238
|
+
/** Identifies the change itself; routes that share one show the same change */
|
|
239
|
+
fingerprint?: string;
|
|
215
240
|
/** A side answered with a sign-in wall, so nothing was really compared */
|
|
216
241
|
blocked?: BlockedSide;
|
|
242
|
+
/** A side rendered an error instead of the page, so nothing was compared */
|
|
243
|
+
broken?: BrokenSide;
|
|
217
244
|
/**
|
|
218
245
|
* How much of the two sides' wording is shared, or null when neither page
|
|
219
246
|
* had enough text to judge. Near zero on every route means the two sides are
|
|
@@ -233,6 +260,34 @@ export interface BlockedSide {
|
|
|
233
260
|
/** Deployment protection, so the bypass secret is the fix */
|
|
234
261
|
vercel: boolean;
|
|
235
262
|
}
|
|
263
|
+
export interface BrokenSide {
|
|
264
|
+
/** Which side failed. Post when both did: it is what the PR is about. */
|
|
265
|
+
side: 'before' | 'after';
|
|
266
|
+
/** What that side reported. */
|
|
267
|
+
error: PageError;
|
|
268
|
+
}
|
|
269
|
+
/** What the report calls a side. */
|
|
270
|
+
export declare function sideName(side: 'before' | 'after'): 'Pre' | 'Post';
|
|
271
|
+
/**
|
|
272
|
+
* Why a run cannot be reported as a comparison of the two sites.
|
|
273
|
+
*
|
|
274
|
+
* - `walled`, `different-sites`: the run compared something other than the
|
|
275
|
+
* site. A human must fix the setup; the CLI exits 3 and publishes nothing.
|
|
276
|
+
* - `post-broken`: this branch renders an error page. That is the result, not
|
|
277
|
+
* a setup problem, so the PR says it in one sentence, with no screenshots,
|
|
278
|
+
* and the CLI exits 4.
|
|
279
|
+
* - `baseline-broken`: the base renders an error page on every route, so there
|
|
280
|
+
* is no "before". Also exit 4, worded so it does not blame the branch.
|
|
281
|
+
*/
|
|
282
|
+
export interface RunVerdict {
|
|
283
|
+
kind: 'walled' | 'different-sites' | 'post-broken' | 'baseline-broken';
|
|
284
|
+
/** The single actionable sentence a human needs. */
|
|
285
|
+
hint: string;
|
|
286
|
+
}
|
|
287
|
+
/** Verdicts that are a finding about the code, reported rather than thrown. */
|
|
288
|
+
export declare function isBrokenVerdict(v: RunVerdict | null | undefined): v is RunVerdict & {
|
|
289
|
+
kind: 'post-broken' | 'baseline-broken';
|
|
290
|
+
};
|
|
236
291
|
export interface RouteShift {
|
|
237
292
|
/** CSS pixels the content moved down by; negative means up. */
|
|
238
293
|
px: number;
|
|
@@ -249,8 +304,16 @@ export interface PrRunResult {
|
|
|
249
304
|
commentKind?: 'description' | 'comment';
|
|
250
305
|
beforeBase: string;
|
|
251
306
|
afterBase: string;
|
|
307
|
+
/** What a reviewer should call each side, e.g. "base `38d9f0b`" and "this branch" */
|
|
308
|
+
beforeLabel?: string;
|
|
309
|
+
afterLabel?: string;
|
|
252
310
|
outcomes: RouteCaptureOutcome[];
|
|
253
311
|
skippedDynamic: string[];
|
|
312
|
+
/** Routes the branch affects that the `maxRoutes` cap left out, and that cap */
|
|
313
|
+
omitted?: {
|
|
314
|
+
routes: string[];
|
|
315
|
+
cap: number;
|
|
316
|
+
};
|
|
254
317
|
durationMs: number;
|
|
255
318
|
markdown: string;
|
|
256
319
|
/** Local directory holding every captured file */
|
|
@@ -261,6 +324,37 @@ export interface PrRunResult {
|
|
|
261
324
|
timings?: Record<string, number>;
|
|
262
325
|
/** Whether GitHub took the result, and if not, the one sentence that would let it. */
|
|
263
326
|
delivery?: Delivery;
|
|
327
|
+
/** Set when the run found a side rendering errors instead of the page. */
|
|
328
|
+
verdict?: RunVerdict;
|
|
329
|
+
/** One per Moment recorded, in priority order. */
|
|
330
|
+
moments?: MomentOutcome[];
|
|
331
|
+
/** Names of Moments over the per-run limit, listed but not recorded. */
|
|
332
|
+
momentsSkipped?: string[];
|
|
333
|
+
/** Why the clips link out instead of playing inline, when they do: the one thing to fix. */
|
|
334
|
+
momentsHint?: string;
|
|
335
|
+
}
|
|
336
|
+
/** What became of one Moment. */
|
|
337
|
+
export interface MomentOutcome {
|
|
338
|
+
name: string;
|
|
339
|
+
route: string;
|
|
340
|
+
viewport: string;
|
|
341
|
+
status: 'recorded' | 'error';
|
|
342
|
+
/** Why there is no clip, in one plain sentence. */
|
|
343
|
+
error?: string;
|
|
344
|
+
/** Why the Pre pane shows a card instead of the interaction, when it does. */
|
|
345
|
+
preNote?: string;
|
|
346
|
+
durationMs?: number;
|
|
347
|
+
bytes?: number;
|
|
348
|
+
/** Local clip (`.webm`) and its last frame (`.jpg`). */
|
|
349
|
+
file?: string;
|
|
350
|
+
poster?: string;
|
|
351
|
+
/** Published clip and poster. */
|
|
352
|
+
videoUrl?: string;
|
|
353
|
+
posterUrl?: string;
|
|
354
|
+
/** True when `videoUrl` is a GitHub attachment, which plays inline in the PR. */
|
|
355
|
+
inline?: boolean;
|
|
356
|
+
/** The one-line nudge for a clip that ran long. */
|
|
357
|
+
note?: string;
|
|
264
358
|
}
|
|
265
359
|
/**
|
|
266
360
|
* What happened to a run's result on GitHub.
|
package/dist/types.d.ts.map
CHAN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AS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
package/dist/types.js
CHANGED
|
@@ -24,4 +24,12 @@ export function artifactSuffix(kind) {
|
|
|
24
24
|
default: return kind;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
/** What the report calls a side. */
|
|
28
|
+
export function sideName(side) {
|
|
29
|
+
return side === 'before' ? 'Pre' : 'Post';
|
|
30
|
+
}
|
|
31
|
+
/** Verdicts that are a finding about the code, reported rather than thrown. */
|
|
32
|
+
export function isBrokenVerdict(v) {
|
|
33
|
+
return v?.kind === 'post-broken' || v?.kind === 'baseline-broken';
|
|
34
|
+
}
|
|
27
35
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,WAAW;AACX,+DAA+D;AAW/D,MAAM,CAAC,MAAM,gBAAgB,GAAyC;IACpE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IACrC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IACpC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;CACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,WAAW;AACX,+DAA+D;AAW/D,MAAM,CAAC,MAAM,gBAAgB,GAAyC;IACpE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IACrC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IACpC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;CACpC,CAAC;AAiOF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,CAAU,CAAC;AAI9F;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,IAAkB;IAC/C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,YAAY,CAAC,CAAC,OAAO,aAAa,CAAC;QACxC,KAAK,WAAW,CAAC,CAAC,OAAO,YAAY,CAAC;QACtC,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;IACvB,CAAC;AACH,CAAC;AAsDD,oCAAoC;AACpC,MAAM,UAAU,QAAQ,CAAC,IAAwB;IAC/C,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AAC5C,CAAC;AAmBD,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,CAAgC;IAC9D,OAAO,CAAC,EAAE,IAAI,KAAK,aAAa,IAAI,CAAC,EAAE,IAAI,KAAK,iBAAiB,CAAC;AACpE,CAAC"}
|
package/dist/video.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record a run's Moments: both sides of each, in parallel, then one clip each.
|
|
3
|
+
*
|
|
4
|
+
* Optional by the same rule as the summary sheet: a Moment that cannot be
|
|
5
|
+
* recorded becomes one plain sentence in the PR, never a failed run. The
|
|
6
|
+
* screenshots are the record; the clips show what screenshots cannot.
|
|
7
|
+
*/
|
|
8
|
+
import { AuthOptions, MomentOutcome } from './types.js';
|
|
9
|
+
import { Moment } from './moments.js';
|
|
10
|
+
export interface RecordMomentsOptions {
|
|
11
|
+
before: string;
|
|
12
|
+
after: string;
|
|
13
|
+
auth?: AuthOptions;
|
|
14
|
+
outputDir: string;
|
|
15
|
+
log?: (msg: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/** Record every Moment; never throws for a Moment's own failure. */
|
|
18
|
+
export declare function recordMoments(moments: Moment[], opts: RecordMomentsOptions): Promise<MomentOutcome[]>;
|
|
19
|
+
//# sourceMappingURL=video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,MAAM,EAAuB,MAAM,cAAc,CAAC;AAO3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AA0ED,oEAAoE;AACpE,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAmB3G"}
|
package/dist/video.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record a run's Moments: both sides of each, in parallel, then one clip each.
|
|
3
|
+
*
|
|
4
|
+
* Optional by the same rule as the summary sheet: a Moment that cannot be
|
|
5
|
+
* recorded becomes one plain sentence in the PR, never a failed run. The
|
|
6
|
+
* screenshots are the record; the clips show what screenshots cannot.
|
|
7
|
+
*/
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { longClipNote, quote } from './moments.js';
|
|
10
|
+
import { recordSide } from './record.js';
|
|
11
|
+
import { composeMoment, layoutFor } from './compose.js';
|
|
12
|
+
import { parseViewport } from './viewport.js';
|
|
13
|
+
import { describeError, routeSlug } from './run.js';
|
|
14
|
+
import { joinUrl } from './url.js';
|
|
15
|
+
function size(bytes) {
|
|
16
|
+
return bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : `${Math.round(bytes / 1024)} KB`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What the Pre pane shows: the recording (null when there is none to show),
|
|
20
|
+
* and the card and note when Pre could not play the Moment. A missing page or
|
|
21
|
+
* a missing button on Pre is the normal case for a new feature, so it reads
|
|
22
|
+
* as news, not as a failure.
|
|
23
|
+
*/
|
|
24
|
+
function preSide(pre, url) {
|
|
25
|
+
if (pre.status === 'rejected') {
|
|
26
|
+
const why = describeError(pre.reason, 'before', url);
|
|
27
|
+
return { pre: null, card: { title: 'Pre could not be loaded', detail: why.slice(0, 90) }, note: `Pre could not be loaded (${why}).` };
|
|
28
|
+
}
|
|
29
|
+
const rec = pre.value;
|
|
30
|
+
if (rec.status !== undefined && rec.status >= 400) {
|
|
31
|
+
return rec.status === 404
|
|
32
|
+
? { pre: null, card: { title: 'New page in this PR', detail: 'No page here on Pre' }, note: 'This page is new, so Pre has nothing to show.' }
|
|
33
|
+
: { pre: null, card: { title: `Pre answered HTTP ${rec.status}` }, note: `Pre answered HTTP ${rec.status}.` };
|
|
34
|
+
}
|
|
35
|
+
if (rec.failure) {
|
|
36
|
+
return { pre: rec, card: { title: 'Not in the old version', detail: `${rec.failure.message} on Pre` }, note: `${rec.failure.message} on Pre, so it is shown as new.` };
|
|
37
|
+
}
|
|
38
|
+
return { pre: rec };
|
|
39
|
+
}
|
|
40
|
+
async function recordOne(moment, index, opts) {
|
|
41
|
+
const vp = parseViewport(moment.viewport);
|
|
42
|
+
const base = { name: moment.name, route: moment.route, viewport: vp.label, status: 'error' };
|
|
43
|
+
const beforeUrl = joinUrl(opts.before, moment.route);
|
|
44
|
+
const afterUrl = joinUrl(opts.after, moment.route);
|
|
45
|
+
const side = { auth: opts.auth, maxWidth: layoutFor(vp.size).paneWidth };
|
|
46
|
+
const [pre, post] = await Promise.allSettled([
|
|
47
|
+
recordSide(beforeUrl, moment, vp.size, side),
|
|
48
|
+
recordSide(afterUrl, moment, vp.size, side),
|
|
49
|
+
]);
|
|
50
|
+
// Post is the change under review: if it cannot play the Moment there is no
|
|
51
|
+
// clip worth showing, only the sentence that says why.
|
|
52
|
+
if (post.status === 'rejected')
|
|
53
|
+
return { ...base, error: `Post: ${describeError(post.reason, 'after', afterUrl)}` };
|
|
54
|
+
if (post.value.status !== undefined && post.value.status >= 400)
|
|
55
|
+
return { ...base, error: `Post answered HTTP ${post.value.status} for ${moment.route}.` };
|
|
56
|
+
if (post.value.failure)
|
|
57
|
+
return { ...base, error: `${post.value.failure.message} on Post (step ${post.value.failure.step + 1}).` };
|
|
58
|
+
const shown = preSide(pre, beforeUrl);
|
|
59
|
+
// Numbered, so two Moments whose names slug alike never write one file.
|
|
60
|
+
const stem = path.join(opts.outputDir, `moment-${index + 1}-${routeSlug(moment.name.toLowerCase())}-${vp.label}`);
|
|
61
|
+
try {
|
|
62
|
+
const clip = await composeMoment({
|
|
63
|
+
name: moment.name,
|
|
64
|
+
steps: moment.steps,
|
|
65
|
+
pre: shown.pre,
|
|
66
|
+
post: post.value,
|
|
67
|
+
preCard: shown.card,
|
|
68
|
+
out: `${stem}.webm`,
|
|
69
|
+
poster: `${stem}.jpg`,
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
...base,
|
|
73
|
+
status: 'recorded',
|
|
74
|
+
preNote: shown.note,
|
|
75
|
+
durationMs: clip.durationMs,
|
|
76
|
+
bytes: clip.bytes,
|
|
77
|
+
file: `${stem}.webm`,
|
|
78
|
+
poster: `${stem}.jpg`,
|
|
79
|
+
note: longClipNote(moment.name, clip.durationMs) ?? undefined,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return { ...base, error: `Couldn't make the video: ${err?.message?.split('\n')[0] ?? err}` };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Record every Moment; never throws for a Moment's own failure. */
|
|
87
|
+
export async function recordMoments(moments, opts) {
|
|
88
|
+
const log = opts.log ?? (() => undefined);
|
|
89
|
+
if (!moments.length)
|
|
90
|
+
return [];
|
|
91
|
+
log(`Recording ${moments.length} Moment(s) ...`);
|
|
92
|
+
// All at once: the page pool bounds how many pages are open, so wall time
|
|
93
|
+
// is about the longest clip, not the sum of them.
|
|
94
|
+
// Each Moment settles on its own: one that throws is one sentence in the PR,
|
|
95
|
+
// never the loss of the others.
|
|
96
|
+
const outcomes = await Promise.all(moments.map((m, i) => recordOne(m, i, opts).catch((err) => ({
|
|
97
|
+
name: m.name, route: m.route, viewport: m.viewport, status: 'error',
|
|
98
|
+
error: `Couldn't record it: ${err?.message?.split('\n')[0] ?? err}`,
|
|
99
|
+
}))));
|
|
100
|
+
for (const o of outcomes) {
|
|
101
|
+
log(o.status === 'recorded'
|
|
102
|
+
? ` ${quote(o.name)} ${(o.durationMs / 1000).toFixed(1)}s, ${size(o.bytes)}${o.preNote ? ` — ${o.preNote}` : ''}`
|
|
103
|
+
: ` ${quote(o.name)} not recorded: ${o.error}`);
|
|
104
|
+
if (o.note)
|
|
105
|
+
log(` Note: ${o.note}`);
|
|
106
|
+
}
|
|
107
|
+
return outcomes;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAU,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AACx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EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,CAAC;QAC5G,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;QACnE,KAAK,EAAE,uBAAwB,GAAa,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;KAC/E,CAAC,CAAC,CAAC,CAAC,CAAC;IACN,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU;YACzB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAW,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,KAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;YACpH,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,IAAI;YAAE,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juangadm/pre-post",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Before/after screenshots for pull requests: detect changed routes, capture, pixel-diff, and
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Before/after screenshots and interaction videos for pull requests: detect changed routes, capture, pixel-diff, and show the result in the PR description",
|
|
5
5
|
"author": "Juan Gabriel Delgado (forked from James Clements)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"pull-request",
|
|
21
21
|
"playwright",
|
|
22
22
|
"pixelmatch",
|
|
23
|
+
"video",
|
|
23
24
|
"cli",
|
|
24
25
|
"claude-code-skill"
|
|
25
26
|
],
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"dist",
|
|
41
|
+
"assets",
|
|
40
42
|
"skill",
|
|
41
43
|
"README.md",
|
|
42
44
|
"LICENSE"
|
package/skill/SKILL.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pre-post
|
|
3
3
|
description: Before/after screenshots for the current PR. Use when the user says "take before and after", "pre-post", "screenshot comparison", "visual diff", "PR screenshots", or after making visual UI changes.
|
|
4
|
+
version: 1.5.0
|
|
4
5
|
allowed-tools:
|
|
5
|
-
- Bash(npx -y @juangadm/pre-post@
|
|
6
|
+
- Bash(npx -y @juangadm/pre-post@1.5.0 *)
|
|
6
7
|
- Bash(npx pre-post *)
|
|
7
8
|
- Bash(pre-post *)
|
|
8
9
|
---
|
|
@@ -11,7 +12,7 @@ allowed-tools:
|
|
|
11
12
|
|
|
12
13
|
One command does everything: detects the routes this branch changed, screenshots them on
|
|
13
14
|
desktop, pixel-diffs them, uploads the images to a `pre-post-assets` branch, and
|
|
14
|
-
|
|
15
|
+
puts them at the top of the open PR description. The human reviews on GitHub.
|
|
15
16
|
|
|
16
17
|
It picks both sides itself:
|
|
17
18
|
|
|
@@ -39,21 +40,43 @@ the Post side. Pass `--no-local-baseline` to turn it off.
|
|
|
39
40
|
## Run
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
|
-
npx -y @juangadm/pre-post@
|
|
43
|
+
npx -y @juangadm/pre-post@1.5.0 pr
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
The version is pinned on purpose: this file describes that release. If the run starts with
|
|
47
|
+
`Note:` lines about another version, relay them; they mean a copy of these instructions is
|
|
48
|
+
out of date.
|
|
49
|
+
|
|
45
50
|
If you have a folder the user can open from wherever they are following you (a scratchpad
|
|
46
51
|
or workspace directory in a hosted session), add `-o <that folder>/pre-post` so the images
|
|
47
52
|
land somewhere they can see. Add `--routes /a,/b` when the user names pages explicitly. Add
|
|
48
53
|
`--before https://production-url` only if the run reports it cannot work out the baseline
|
|
49
54
|
(it is then saved to `.pre-post.json` for next time).
|
|
50
55
|
|
|
56
|
+
## Video: Moments
|
|
57
|
+
|
|
58
|
+
When the change **moves or reacts** (a menu or dialog opening, a hover or focus state, a
|
|
59
|
+
transition, form feedback), also record it: write Moments to a file outside the repo and
|
|
60
|
+
add `--moments <file>`. Static changes need none; screenshots cover them.
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{ "moments": [{ "name": "Open the account menu", "route": "/settings",
|
|
64
|
+
"steps": [{ "hover": "Account" }, { "click": "Account" }] }] }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Steps are `click`, `hover`, `press`, `type` (`["Email", "a@b.co"]`), `scroll` and `wait` (ms),
|
|
68
|
+
naming targets by the text on screen. One interaction per Moment, under 15s, most important
|
|
69
|
+
first; three at most are recorded. "Couldn't find … on Post" means the target text is wrong:
|
|
70
|
+
fix it from the code and re-run once. Guide: https://github.com/juangadm/pre-post/blob/main/docs/video.md
|
|
71
|
+
|
|
51
72
|
## What it posts
|
|
52
73
|
|
|
53
74
|
The visual changes go at the **top of the PR description**, in a delimited block that
|
|
54
75
|
re-runs replace in place — the author's own text is never touched. If the PR cannot be
|
|
55
76
|
edited (a fork, a read-only token) it falls back to a single sticky comment.
|
|
56
77
|
|
|
78
|
+
Moments come first, one clip each. If they could not play inline, the PR says why; relay that line.
|
|
79
|
+
|
|
57
80
|
Each changed route shows **Pre beside Post**, per viewport, full pages in a `<details>`. No
|
|
58
81
|
overlay, no percentage. A page that moved says `Content shifted down 48px`; relay as written. A pure move
|
|
59
82
|
("Nothing else changed.") shows the full pages with no crop and no `<details>`, by design.
|
|
@@ -62,15 +85,20 @@ overlay, no percentage. A page that moved says `Content shifted down 48px`; rela
|
|
|
62
85
|
|
|
63
86
|
When anything changed, the command prints `Sheet: <path>`: one image with Pre beside Post for
|
|
64
87
|
every change. If you can send files to the user, send that one file, even when the PR was
|
|
65
|
-
updated. Someone following you from a phone sees it there before they open GitHub.
|
|
88
|
+
updated. Someone following you from a phone sees it there before they open GitHub. Each clip
|
|
89
|
+
is printed as `Video: <path>`; send those too.
|
|
66
90
|
|
|
67
91
|
## Rules
|
|
68
92
|
|
|
69
|
-
- Run the command once. Do not open, read, or describe the screenshot files. The
|
|
70
|
-
|
|
71
|
-
|
|
93
|
+
- Run the command once. Do not open, read, or describe the screenshot files. The block in
|
|
94
|
+
the PR description is the deliverable, and the sheet is the one image you pass along. Tell
|
|
95
|
+
the user what the summary says, plus the PR link. Never paste the terminal output into the
|
|
96
|
+
PR: ports, timings and percentages there are for you, not for a reviewer.
|
|
72
97
|
- Do not switch branches, start dev servers, or use a browser tool yourself. The command
|
|
73
98
|
handles all three.
|
|
99
|
+
- Exit code 4 means a page rendered an error (a build error, a 500) instead of itself. No
|
|
100
|
+
screenshots were published and the PR says so in one sentence. Relay that sentence; the
|
|
101
|
+
branch needs fixing before a visual comparison means anything.
|
|
74
102
|
- Exit code 3 means a human must do one thing (set a token, start the dev server, pass
|
|
75
103
|
`--before`). Relay that one sentence verbatim and stop. If GitHub refused the token, the
|
|
76
104
|
screenshots were still taken: send the sheet first, then relay the sentence. Never ask the
|
|
@@ -90,8 +118,8 @@ updated. Someone following you from a phone sees it there before they open GitHu
|
|
|
90
118
|
| `--dry-run` | Preview locally, post nothing |
|
|
91
119
|
| `--header k=v` / `--cookie k=v` | The site needs auth headers or cookies |
|
|
92
120
|
|
|
93
|
-
To run on every PR without anyone invoking it, point the user to the
|
|
94
|
-
|
|
121
|
+
To run on every PR without anyone invoking it, point the user to the GitHub Action guide
|
|
122
|
+
(https://github.com/juangadm/pre-post/blob/main/docs/github-action.md). It posts with GitHub's own token, which also covers work done in cloud sessions.
|
|
95
123
|
|
|
96
|
-
Login-protected sites: `npx -y @juangadm/pre-post@
|
|
124
|
+
Login-protected sites: `npx -y @juangadm/pre-post@1.5.0 login https://site` opens a browser
|
|
97
125
|
once; the saved session is reused automatically.
|