@juangadm/pre-post 0.3.0 → 1.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.
Files changed (153) hide show
  1. package/README.md +174 -233
  2. package/dist/baseline.d.ts +119 -0
  3. package/dist/baseline.d.ts.map +1 -0
  4. package/dist/baseline.js +316 -0
  5. package/dist/baseline.js.map +1 -0
  6. package/dist/bin/cli.js +243 -458
  7. package/dist/bin/cli.js.map +1 -1
  8. package/dist/browser.d.ts +68 -25
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +500 -105
  11. package/dist/browser.js.map +1 -1
  12. package/dist/capture.d.ts +1 -6
  13. package/dist/capture.d.ts.map +1 -1
  14. package/dist/capture.js +12 -36
  15. package/dist/capture.js.map +1 -1
  16. package/dist/commands/compare.d.ts +18 -0
  17. package/dist/commands/compare.d.ts.map +1 -0
  18. package/dist/commands/compare.js +82 -0
  19. package/dist/commands/compare.js.map +1 -0
  20. package/dist/commands/detect.d.ts +25 -0
  21. package/dist/commands/detect.d.ts.map +1 -0
  22. package/dist/commands/detect.js +22 -0
  23. package/dist/commands/detect.js.map +1 -0
  24. package/dist/commands/doctor.d.ts +42 -0
  25. package/dist/commands/doctor.d.ts.map +1 -0
  26. package/dist/commands/doctor.js +119 -0
  27. package/dist/commands/doctor.js.map +1 -0
  28. package/dist/commands/login.d.ts +6 -0
  29. package/dist/commands/login.d.ts.map +1 -0
  30. package/dist/commands/login.js +34 -0
  31. package/dist/commands/login.js.map +1 -0
  32. package/dist/commands/pr.d.ts +32 -0
  33. package/dist/commands/pr.d.ts.map +1 -0
  34. package/dist/commands/pr.js +259 -0
  35. package/dist/commands/pr.js.map +1 -0
  36. package/dist/commands/prune.d.ts +10 -0
  37. package/dist/commands/prune.d.ts.map +1 -0
  38. package/dist/commands/prune.js +13 -0
  39. package/dist/commands/prune.js.map +1 -0
  40. package/dist/comparison.d.ts +104 -0
  41. package/dist/comparison.d.ts.map +1 -0
  42. package/dist/comparison.js +236 -0
  43. package/dist/comparison.js.map +1 -0
  44. package/dist/config.d.ts +46 -0
  45. package/dist/config.d.ts.map +1 -0
  46. package/dist/config.js +82 -0
  47. package/dist/config.js.map +1 -0
  48. package/dist/deployments.d.ts +71 -0
  49. package/dist/deployments.d.ts.map +1 -0
  50. package/dist/deployments.js +204 -0
  51. package/dist/deployments.js.map +1 -0
  52. package/dist/diff-pool.d.ts +17 -0
  53. package/dist/diff-pool.d.ts.map +1 -0
  54. package/dist/diff-pool.js +92 -0
  55. package/dist/diff-pool.js.map +1 -0
  56. package/dist/diff-worker.d.ts +32 -0
  57. package/dist/diff-worker.d.ts.map +1 -0
  58. package/dist/diff-worker.js +39 -0
  59. package/dist/diff-worker.js.map +1 -0
  60. package/dist/diff.d.ts +47 -0
  61. package/dist/diff.d.ts.map +1 -0
  62. package/dist/diff.js +281 -0
  63. package/dist/diff.js.map +1 -0
  64. package/dist/doctor.d.ts +79 -0
  65. package/dist/doctor.d.ts.map +1 -0
  66. package/dist/doctor.js +138 -0
  67. package/dist/doctor.js.map +1 -0
  68. package/dist/errors.d.ts +38 -0
  69. package/dist/errors.d.ts.map +1 -0
  70. package/dist/errors.js +59 -0
  71. package/dist/errors.js.map +1 -0
  72. package/dist/git.d.ts +61 -0
  73. package/dist/git.d.ts.map +1 -0
  74. package/dist/git.js +182 -0
  75. package/dist/git.js.map +1 -0
  76. package/dist/github.d.ts +163 -0
  77. package/dist/github.d.ts.map +1 -0
  78. package/dist/github.js +411 -0
  79. package/dist/github.js.map +1 -0
  80. package/dist/index.d.ts +22 -23
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +17 -67
  83. package/dist/index.js.map +1 -1
  84. package/dist/landing.d.ts +48 -0
  85. package/dist/landing.d.ts.map +1 -0
  86. package/dist/landing.js +93 -0
  87. package/dist/landing.js.map +1 -0
  88. package/dist/pkg.d.ts +17 -0
  89. package/dist/pkg.d.ts.map +1 -0
  90. package/dist/pkg.js +49 -0
  91. package/dist/pkg.js.map +1 -0
  92. package/dist/report.d.ts +20 -0
  93. package/dist/report.d.ts.map +1 -0
  94. package/dist/report.js +130 -0
  95. package/dist/report.js.map +1 -0
  96. package/dist/routes/imports.d.ts +46 -0
  97. package/dist/routes/imports.d.ts.map +1 -0
  98. package/dist/routes/imports.js +208 -0
  99. package/dist/routes/imports.js.map +1 -0
  100. package/dist/routes/vite.d.ts +15 -0
  101. package/dist/routes/vite.d.ts.map +1 -0
  102. package/dist/routes/vite.js +130 -0
  103. package/dist/routes/vite.js.map +1 -0
  104. package/dist/routes.d.ts +65 -11
  105. package/dist/routes.d.ts.map +1 -1
  106. package/dist/routes.js +346 -141
  107. package/dist/routes.js.map +1 -1
  108. package/dist/run.d.ts +116 -0
  109. package/dist/run.d.ts.map +1 -0
  110. package/dist/run.js +316 -0
  111. package/dist/run.js.map +1 -0
  112. package/dist/sameness.d.ts +91 -0
  113. package/dist/sameness.d.ts.map +1 -0
  114. package/dist/sameness.js +157 -0
  115. package/dist/sameness.js.map +1 -0
  116. package/dist/sessions.d.ts +50 -0
  117. package/dist/sessions.d.ts.map +1 -0
  118. package/dist/sessions.js +80 -0
  119. package/dist/sessions.js.map +1 -0
  120. package/dist/shift.d.ts +67 -0
  121. package/dist/shift.d.ts.map +1 -0
  122. package/dist/shift.js +184 -0
  123. package/dist/shift.js.map +1 -0
  124. package/dist/types.d.ts +179 -68
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/types.js +1 -0
  127. package/dist/types.js.map +1 -1
  128. package/dist/url.d.ts +12 -0
  129. package/dist/url.d.ts.map +1 -0
  130. package/dist/url.js +30 -0
  131. package/dist/url.js.map +1 -0
  132. package/dist/viewport.d.ts +6 -1
  133. package/dist/viewport.d.ts.map +1 -1
  134. package/dist/viewport.js +13 -7
  135. package/dist/viewport.js.map +1 -1
  136. package/package.json +21 -14
  137. package/skill/SKILL.md +56 -221
  138. package/dist/clipboard.d.ts +0 -9
  139. package/dist/clipboard.d.ts.map +0 -1
  140. package/dist/clipboard.js +0 -26
  141. package/dist/clipboard.js.map +0 -1
  142. package/dist/upload.d.ts +0 -39
  143. package/dist/upload.d.ts.map +0 -1
  144. package/dist/upload.js +0 -159
  145. package/dist/upload.js.map +0 -1
  146. package/dist/video.d.ts +0 -19
  147. package/dist/video.d.ts.map +0 -1
  148. package/dist/video.js +0 -263
  149. package/dist/video.js.map +0 -1
  150. package/skill/scripts/adapters/0x0st.sh +0 -36
  151. package/skill/scripts/adapters/blob.sh +0 -55
  152. package/skill/scripts/adapters/git-native.sh +0 -51
  153. package/skill/scripts/upload-and-copy.sh +0 -230
package/dist/types.d.ts CHANGED
@@ -5,6 +5,18 @@ export interface ViewportSize {
5
5
  export type ViewportPreset = 'desktop' | 'tablet' | 'mobile';
6
6
  export type ViewportConfig = ViewportPreset | ViewportSize;
7
7
  export declare const VIEWPORT_PRESETS: Record<ViewportPreset, ViewportSize>;
8
+ export interface AuthOptions {
9
+ /** Extra request headers sent with every request (e.g. Vercel bypass). */
10
+ headers?: Record<string, string>;
11
+ /** Cookies to set before navigation. */
12
+ cookies?: Array<{
13
+ name: string;
14
+ value: string;
15
+ domain?: string;
16
+ path?: string;
17
+ url?: string;
18
+ }>;
19
+ }
8
20
  export interface CaptureOptions {
9
21
  /** URL to capture (file://, http://, https://) */
10
22
  url: string;
@@ -14,6 +26,16 @@ export interface CaptureOptions {
14
26
  viewport?: ViewportConfig;
15
27
  /** Capture full scrollable page instead of viewport. Default: false */
16
28
  fullPage?: boolean;
29
+ /** Maximum page height (CSS px) for full-page captures. Default: 3× viewport height */
30
+ maxHeight?: number;
31
+ /** Device scale factor. Default: 2 */
32
+ scale?: number;
33
+ /** Hard cap on settle wait (ms). Default: 8000 */
34
+ settleTimeout?: number;
35
+ /** Extra fixed wait after settle (ms). Default: 0 */
36
+ wait?: number;
37
+ /** Auth headers / cookies */
38
+ auth?: AuthOptions;
17
39
  }
18
40
  export interface CaptureResult {
19
41
  /** Raw PNG image data */
@@ -24,6 +46,18 @@ export interface CaptureResult {
24
46
  url: string;
25
47
  /** CSS selector used, if any */
26
48
  selector?: string;
49
+ /** HTTP status of the main document */
50
+ status?: number;
51
+ /** URL the browser ended on, which is not the requested one after a redirect */
52
+ finalUrl?: string;
53
+ /** Document title, used to recognise a sign-in wall that answered with 200 */
54
+ title?: string;
55
+ /** Visible text, used to tell "the same site, changed" from "a different site" */
56
+ text?: string;
57
+ /** Response looked like it came from Vercel (deployment protection) */
58
+ vercel?: boolean;
59
+ /** Wall-clock milliseconds for navigation + settle + screenshot */
60
+ durationMs: number;
27
61
  }
28
62
  export interface BeforeAfterCaptureOptions {
29
63
  before: CaptureOptions | string;
@@ -35,32 +69,51 @@ export interface BeforeAfterCaptureResult {
35
69
  before: CaptureResult;
36
70
  after: CaptureResult;
37
71
  }
38
- export type ImageInput = string | Buffer;
39
- export interface FromImagesOptions {
40
- /** Before image (file path or Buffer) */
41
- before: ImageInput;
42
- /** After image (file path or Buffer) */
43
- after: ImageInput;
44
- /** Labels for markdown output */
45
- labels?: {
46
- before?: string;
47
- after?: string;
48
- };
72
+ export interface DiffRegion {
73
+ x: number;
74
+ y: number;
75
+ width: number;
76
+ height: number;
49
77
  }
50
- export interface FromImagesResult {
51
- /** Markdown table for PR comments */
52
- markdown: string;
53
- /** Before image buffer */
54
- beforeImage: Buffer;
55
- /** After image buffer */
56
- afterImage: Buffer;
78
+ export interface DiffResult {
79
+ /** Fraction of pixels that differ, 0..1 (over the union canvas) */
80
+ changedRatio: number;
81
+ /** Number of differing pixels */
82
+ changedPixels: number;
83
+ /** Canvas size used for comparison (device pixels) */
84
+ width: number;
85
+ height: number;
86
+ /** Bounding box of all changes in device pixels, or null when identical */
87
+ region: DiffRegion | null;
88
+ /** Whether the two images had different dimensions */
89
+ sizeChanged: boolean;
90
+ /** Highlight image: grayscale page with changed pixels in red (PNG). Absent when identical. */
91
+ highlight?: Buffer;
92
+ /** Crops of before/after around the changed region, when the change is localized */
93
+ crop?: {
94
+ before: Buffer;
95
+ after: Buffer;
96
+ region: DiffRegion;
97
+ };
98
+ /** Vertical displacement explaining most of the difference, when one does */
99
+ shift?: ShiftSummary;
57
100
  }
58
- export interface BeforeAndAfterOptions {
59
- /** Default viewport for all operations */
60
- viewport?: ViewportConfig;
61
- /** Output directory for saved screenshots */
62
- outputDir?: string;
101
+ /**
102
+ * A layout shift: Post content moved down (or up) by a constant amount from a
103
+ * given row, and what remains different once the two sides are put back in
104
+ * register. Plain numbers, so it survives the worker-thread boundary.
105
+ */
106
+ export interface ShiftSummary {
107
+ /** Device pixels Post content moved down by; negative means up. */
108
+ dy: number;
109
+ /** First row, in Pre coordinates, that moved. Rows above it stayed put. */
110
+ from: number;
111
+ /** Changed pixels once Post is aligned with Pre. */
112
+ alignedChangedPixels: number;
113
+ /** Aligned changed pixels as a fraction of the canvas. */
114
+ alignedChangedRatio: number;
63
115
  }
116
+ export type Framework = 'nextjs-app' | 'nextjs-pages' | 'vite' | 'generic';
64
117
  export interface DetectedRoute {
65
118
  /** Route path, e.g., "/dashboard" */
66
119
  path: string;
@@ -73,54 +126,112 @@ export interface DetectedRoute {
73
126
  }
74
127
  export interface RouteDetectionOptions {
75
128
  /** Force a specific framework instead of auto-detecting */
76
- framework?: 'nextjs-app' | 'nextjs-pages' | 'generic';
77
- /** Maximum number of routes to return (default: 5) */
129
+ framework?: Framework;
130
+ /** Maximum number of routes to return (default: 6) */
78
131
  maxRoutes?: number;
79
- /** Git diff target, e.g., "main...HEAD" or "HEAD~1" */
80
- diffTarget?: string;
132
+ /** Where warnings go. Left unset, they are silent. */
133
+ log?: (msg: string) => void;
81
134
  }
82
- export interface CompareOptions {
83
- /** Base URL for "before" state (e.g., production URL) */
84
- beforeBase: string;
85
- /** Base URL for "after" state (e.g., localhost) */
86
- afterBase: string;
87
- /** Routes to capture */
88
- routes: string[];
89
- /** Capture at desktop + mobile viewports */
90
- responsive?: boolean;
91
- /** Viewport override (used when not in responsive mode) */
92
- viewport?: ViewportConfig;
93
- /** Output directory for screenshots */
94
- output?: string;
95
- /** Generate markdown output */
96
- markdown?: boolean;
135
+ export interface PrePostConfig {
136
+ /** Production base URL the "before" state */
137
+ before?: string;
138
+ /** Local base URL the "after" state (auto-detected when omitted) */
139
+ after?: string;
140
+ /** Routes to always include */
141
+ routes?: string[];
142
+ /** Sample URLs for dynamic routes, e.g. { "/blog/[slug]": "/blog/hello" } */
143
+ samples?: Record<string, string>;
144
+ /** Viewports to capture. Default: ["desktop"] */
145
+ viewports?: Array<ViewportPreset | string>;
146
+ /** Extra headers for every request */
147
+ headers?: Record<string, string>;
148
+ /** Change ratio (fraction 0..1) at or above which a route counts as changed. Default 0.001 */
149
+ threshold?: number;
150
+ /** Absolute changed-pixel floor at or above which a route counts as changed, so small edits on tall pages register. Default 40 */
151
+ /** Smallest painted change that counts, in CSS pixels². */
152
+ minChangedArea?: number;
153
+ /** @deprecated device pixels; use minChangedArea. Converted at the capture scale. */
154
+ minChangedPixels?: number;
155
+ /** Max detected routes. Default 6 */
156
+ maxRoutes?: number;
157
+ /** Capture full page. Default true */
158
+ fullPage?: boolean;
159
+ /** Max full-page height in CSS px. Default 2400 */
160
+ maxHeight?: number;
161
+ /** Device scale factor. Default 2 */
162
+ scale?: number;
163
+ /** Assets branch name. Default "pre-post-assets" */
164
+ assetsBranch?: string;
165
+ /** Skip paths (glob-ish prefixes) from route detection */
166
+ ignore?: string[];
97
167
  }
98
- export interface VideoOptions {
99
- /** Viewport size for the capture */
100
- viewport: ViewportSize;
101
- /** Recording duration in seconds (default: 3, max: 10) */
102
- duration?: number;
103
- /** Target frames per second (default: 5, max: 10) */
104
- fps?: number;
105
- /** Milliseconds to wait after page load before recording (default: 0) */
106
- delay?: number;
107
- /** CSS selector — scroll element into view before recording */
108
- selector?: string;
168
+ /** Pre, post, and (when there was a change) diff and crop images, as local paths or URLs. */
169
+ export interface ArtifactSet {
170
+ /** Absent when the route has no baseline (a page this branch adds). */
171
+ before?: string;
172
+ /** Absent when the branch removed the route. */
173
+ after?: string;
174
+ diff?: string;
175
+ cropBefore?: string;
176
+ cropAfter?: string;
109
177
  }
110
- export interface VideoResult {
111
- /** Raw GIF data */
112
- gif: Buffer;
113
- /** Output format identifier */
114
- format: 'gif';
115
- /** Viewport used for capture */
116
- viewport: ViewportSize;
117
- /** URL that was captured */
118
- url: string;
119
- /** Actual recording duration in seconds */
120
- duration: number;
121
- /** Number of frames in the GIF */
122
- frameCount: number;
123
- /** CSS selector used, if any */
124
- selector?: string;
178
+ export declare const ARTIFACT_KINDS: readonly ["before", "after", "diff", "cropBefore", "cropAfter"];
179
+ export interface RouteCaptureOutcome {
180
+ route: string;
181
+ /** Route actually requested (after sample substitution) */
182
+ resolvedRoute: string;
183
+ viewport: string;
184
+ status: 'changed' | 'unchanged' | 'added' | 'removed' | 'error';
185
+ changedRatio?: number;
186
+ sizeChanged?: boolean;
187
+ error?: string;
188
+ files?: ArtifactSet;
189
+ urls?: ArtifactSet;
190
+ durationMs?: number;
191
+ /** sha1 of the baseline capture, for spotting a host that serves one page for every route */
192
+ baselineHash?: string;
193
+ /** Extra context, e.g. "new page — no baseline (example.com returned 404)" */
194
+ note?: string;
195
+ /** Vertical displacement of Post against Pre, when one explains the change */
196
+ shift?: RouteShift;
197
+ /** A side answered with a sign-in wall, so nothing was really compared */
198
+ blocked?: BlockedSide;
199
+ /**
200
+ * How much of the two sides' wording is shared, or null when neither page
201
+ * had enough text to judge. Near zero on every route means the two sides are
202
+ * different sites, which a pixel ratio cannot tell you — see `sameness.ts`.
203
+ */
204
+ textOverlap?: number | null;
205
+ /**
206
+ * The same measure over the two titles. A title is where a site names
207
+ * itself, so it corroborates a run that only has one route to judge.
208
+ */
209
+ titleOverlap?: number | null;
210
+ }
211
+ export interface BlockedSide {
212
+ side: 'before' | 'after';
213
+ /** The sign-in page the capture landed on */
214
+ finalUrl: string;
215
+ /** Deployment protection, so the bypass secret is the fix */
216
+ vercel: boolean;
217
+ }
218
+ export interface RouteShift {
219
+ /** CSS pixels the content moved down by; negative means up. */
220
+ px: number;
221
+ /** Whether anything changed beyond the move, judged by the same rule as any other capture. */
222
+ otherChange: boolean;
223
+ }
224
+ export interface PrRunResult {
225
+ repo: string;
226
+ prNumber?: number;
227
+ commentUrl?: string;
228
+ beforeBase: string;
229
+ afterBase: string;
230
+ outcomes: RouteCaptureOutcome[];
231
+ skippedDynamic: string[];
232
+ durationMs: number;
233
+ markdown: string;
234
+ /** Local directory holding every captured file */
235
+ outputDir: string;
125
236
  }
126
237
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;AAE3D,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,cAAc,EAAE,YAAY,CAIjE,CAAC;AAMF,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,EAAE,YAAY,CAAC;IACvB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC;IAChC,KAAK,EAAE,cAAc,GAA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8E;IAC9E,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,8FAA8F;IAC9F,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/types.js CHANGED
@@ -6,4 +6,5 @@ export const VIEWPORT_PRESETS = {
6
6
  tablet: { width: 768, height: 1024 },
7
7
  mobile: { width: 375, height: 812 },
8
8
  };
9
+ export const ARTIFACT_KINDS = ['before', 'after', 'diff', 'cropBefore', 'cropAfter'];
9
10
  //# 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;AAmMF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,CAAU,CAAC"}
package/dist/url.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * URL helpers shared by the capture layer and the command pipeline.
3
+ *
4
+ * Kept out of run.ts so browser.ts can ask "is this loopback?" without
5
+ * importing the module that imports it.
6
+ */
7
+ /** Is this URL served from the machine running the command? */
8
+ export declare function isLocalUrl(url: string): boolean;
9
+ export declare function normalizeUrl(url: string): string;
10
+ export declare function hostOf(url: string): string;
11
+ export declare function joinUrl(base: string, route: string): string;
12
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D"}
package/dist/url.js ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * URL helpers shared by the capture layer and the command pipeline.
3
+ *
4
+ * Kept out of run.ts so browser.ts can ask "is this loopback?" without
5
+ * importing the module that imports it.
6
+ */
7
+ /** Add a scheme to a bare URL (http for loopback hosts, https otherwise) and drop trailing slashes. */
8
+ const LOOPBACK = /^(?:(?:https?|file):\/\/)?(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(:|\/|$)/i;
9
+ /** Is this URL served from the machine running the command? */
10
+ export function isLocalUrl(url) {
11
+ return LOOPBACK.test(url);
12
+ }
13
+ export function normalizeUrl(url) {
14
+ const withScheme = /^(https?|file):\/\//i.test(url)
15
+ ? url
16
+ : isLocalUrl(url) ? `http://${url}` : `https://${url}`;
17
+ return withScheme.replace(/\/+$/, '');
18
+ }
19
+ export function hostOf(url) {
20
+ try {
21
+ return new URL(url).host;
22
+ }
23
+ catch {
24
+ return url;
25
+ }
26
+ }
27
+ export function joinUrl(base, route) {
28
+ return base.replace(/\/+$/, '') + (route.startsWith('/') ? route : `/${route}`);
29
+ }
30
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uGAAuG;AACvG,MAAM,QAAQ,GAAG,gFAAgF,CAAC;AAElG,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,UAAU,GAAG,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC;QACjD,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC,WAAW,GAAG,EAAE,CAAC;IACzD,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;AAClF,CAAC"}
@@ -1,3 +1,8 @@
1
1
  import { ViewportConfig, ViewportSize } from './types.js';
2
- export declare function resolveViewport(config?: ViewportConfig): ViewportSize;
2
+ /** Accepts a preset name, a "WxH" string, or a size object. */
3
+ export declare function parseViewport(spec: ViewportConfig | string): {
4
+ label: string;
5
+ size: ViewportSize;
6
+ };
7
+ export declare function resolveViewport(config?: ViewportConfig | string): ViewportSize;
3
8
  //# sourceMappingURL=viewport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAoC,MAAM,YAAY,CAAC;AAE5F,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,YAAY,CAQrE"}
1
+ {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAoC,MAAM,YAAY,CAAC;AAE5F,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAOlG;AAED,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,YAAY,CAE9E"}
package/dist/viewport.js CHANGED
@@ -1,11 +1,17 @@
1
1
  import { VIEWPORT_PRESETS } from './types.js';
2
+ /** Accepts a preset name, a "WxH" string, or a size object. */
3
+ export function parseViewport(spec) {
4
+ if (typeof spec !== 'string')
5
+ return { label: `${spec.width}x${spec.height}`, size: spec };
6
+ const preset = VIEWPORT_PRESETS[spec];
7
+ if (preset)
8
+ return { label: spec, size: preset };
9
+ const m = spec.match(/^(\d+)x(\d+)$/);
10
+ if (!m)
11
+ throw new Error(`Invalid viewport "${spec}". Use desktop, tablet, mobile, or WxH (e.g. 1440x900).`);
12
+ return { label: spec, size: { width: Number(m[1]), height: Number(m[2]) } };
13
+ }
2
14
  export function resolveViewport(config) {
3
- if (!config) {
4
- return VIEWPORT_PRESETS.desktop;
5
- }
6
- if (typeof config === 'string') {
7
- return VIEWPORT_PRESETS[config];
8
- }
9
- return config;
15
+ return config ? parseViewport(config).size : VIEWPORT_PRESETS.desktop;
10
16
  }
11
17
  //# sourceMappingURL=viewport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE5F,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAClC,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,gBAAgB,CAAC,MAAwB,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE5F,+DAA+D;AAC/D,MAAM,UAAU,aAAa,CAAC,IAA6B;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3F,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAsB,CAAC,CAAC;IACxD,IAAI,MAAM;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACjD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACtC,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,yDAAyD,CAAC,CAAC;IAC5G,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAgC;IAC9D,OAAO,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC;AACxE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juangadm/pre-post",
3
- "version": "0.3.0",
4
- "description": "Visual diff tool for PRs captures before/after screenshots of web pages",
3
+ "version": "1.1.0",
4
+ "description": "Before/after screenshots for pull requests: detect changed routes, capture, pixel-diff, and post a sticky PR comment",
5
5
  "author": "Juan Gabriel Delgado (forked from James Clements)",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -16,13 +16,12 @@
16
16
  "screenshot",
17
17
  "before-after",
18
18
  "visual-diff",
19
- "comparison",
20
- "capture",
21
- "web",
22
- "testing",
23
- "cli",
19
+ "visual-regression",
20
+ "pull-request",
24
21
  "playwright",
25
- "pr-screenshots"
22
+ "pixelmatch",
23
+ "cli",
24
+ "claude-code-skill"
26
25
  ],
27
26
  "type": "module",
28
27
  "main": "dist/index.js",
@@ -38,23 +37,23 @@
38
37
  },
39
38
  "files": [
40
39
  "dist",
41
- "skill"
40
+ "skill",
41
+ "README.md",
42
+ "LICENSE"
42
43
  ],
43
44
  "scripts": {
44
45
  "build": "tsc -p tsconfig.pkg.json",
46
+ "prepare": "npm run build",
45
47
  "prepublishOnly": "rm -rf dist && npm run build && npm run test:unit",
46
48
  "test": "vitest run",
47
49
  "test:watch": "vitest",
48
50
  "test:unit": "vitest run tests/unit",
49
- "test:browser": "vitest run tests/browser",
51
+ "test:browser": "TEST_BROWSER=true vitest run tests/browser tests/integration",
50
52
  "test:integration": "vitest run tests/integration"
51
53
  },
52
- "dependencies": {
53
- "gifenc": "^1.0.3",
54
- "playwright": "^1.50.0"
55
- },
56
54
  "devDependencies": {
57
55
  "@types/node": "^22",
56
+ "@types/pngjs": "^6.0.5",
58
57
  "typescript": "5.7.3",
59
58
  "vitest": "^3.2.1"
60
59
  },
@@ -63,5 +62,13 @@
63
62
  "@types/react": "19.2.7",
64
63
  "@types/react-dom": "19.2.3"
65
64
  }
65
+ },
66
+ "dependencies": {
67
+ "pixelmatch": "^7.2.0",
68
+ "playwright-core": "1.58.0",
69
+ "pngjs": "^7.0.0"
70
+ },
71
+ "engines": {
72
+ "node": ">=20"
66
73
  }
67
74
  }