snapdrift 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,9 @@ export {
10
10
  selectRoutesForChangedFiles,
11
11
  resolveFromWorkingDirectory,
12
12
  splitCommaList,
13
- VALID_DIFF_MODES
13
+ VALID_DIFF_MODES,
14
+ VALID_PROVIDER_VALUES,
15
+ VALID_ON_UNAVAILABLE_MODES
14
16
  } from '@snapdrift/manifest';
15
17
 
16
18
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapdrift",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "SnapDrift captures, compares, and reports UI drift for Playwright-based app checks.",
@@ -46,7 +46,6 @@
46
46
  "eslint": "^10.2.0",
47
47
  "globals": "^17.4.0",
48
48
  "jest": "^30.3.0",
49
- "js-yaml": "^4.1.0",
50
49
  "typescript": "^6.0.2"
51
50
  },
52
51
  "jest": {
@@ -76,7 +75,11 @@
76
75
  "./lib/drift-summary.mjs": "./lib/drift-summary.mjs",
77
76
  "./lib/pr-comment.mjs": "./lib/pr-comment.mjs",
78
77
  "./lib/report.mjs": "./lib/report.mjs",
79
- "./lib/cli.mjs": "./lib/cli.mjs"
78
+ "./lib/cli.mjs": "./lib/cli.mjs",
79
+ "./lib/provider.mjs": "./lib/provider.mjs",
80
+ "./lib/snap-provider.mjs": "./lib/snap-provider.mjs",
81
+ "./lib/migrate-baselines.mjs": "./lib/migrate-baselines.mjs",
82
+ "./lib/init-from-action.mjs": "./lib/init-from-action.mjs"
80
83
  },
81
84
  "files": [
82
85
  "actions/",
@@ -93,9 +96,10 @@
93
96
  },
94
97
  "dependencies": {
95
98
  "@snapdrift/adapter-fs": "^1.0.0",
96
- "@snapdrift/adapter-report-md": "^1.0.0",
99
+ "@snapdrift/adapter-report-md": "^1.1.0",
97
100
  "@snapdrift/compare-core": "^1.0.0",
98
- "@snapdrift/manifest": "^1.0.0",
101
+ "@snapdrift/manifest": "^1.2.0",
102
+ "js-yaml": "^4.1.0",
99
103
  "playwright": "^1.59.1",
100
104
  "pngjs": "^7.0.0"
101
105
  }
@@ -28,6 +28,8 @@ export interface VisualRegressionConfig {
28
28
  mode: 'report-only' | 'fail-on-changes' | 'fail-on-incomplete' | 'strict';
29
29
  };
30
30
  selection?: VisualRegressionSelectionConfig;
31
+ provider?: 'local' | 'snap';
32
+ snap?: SnapConfig;
31
33
  }
32
34
 
33
35
  export interface VisualBaselineRouteResult {
@@ -135,4 +137,67 @@ export interface VisualDiffSummary {
135
137
  errors: VisualDiffErrorItem[];
136
138
  dimensionChanges: VisualDiffDimensionItem[];
137
139
  message?: string;
140
+ /** Link to the provider's run detail page. Set by SnapProvider during diff(); undefined for LocalProvider. */
141
+ dashboardUrl?: string;
142
+ }
143
+
144
+ // --- Provider abstraction (canonical definitions in @snapdrift/manifest) ---
145
+
146
+ export type {
147
+ ProviderCaptureOptions,
148
+ ProviderCaptureResult,
149
+ ProviderDiffOptions,
150
+ ProviderDiffResult,
151
+ ProviderPublishBaselineOptions,
152
+ ProviderPublishBaselineResult,
153
+ ProviderFetchBaselineOptions,
154
+ ProviderBaselineData,
155
+ ProviderCommentMeta,
156
+ VisualProvider,
157
+ SnapConfig
158
+ } from '@snapdrift/manifest';
159
+
160
+ // --- Migration types ---
161
+
162
+ export interface MigrateToSnapResult {
163
+ uploaded: number;
164
+ skipped: number;
165
+ baselineId: string;
166
+ }
167
+
168
+ export interface ExportedBaseline {
169
+ results: object;
170
+ manifest: object;
171
+ screenshots: Array<{ filename: string; data: Buffer }>;
172
+ engine: { name: string; version: string };
173
+ }
174
+
175
+ // --- Init codemod types ---
176
+
177
+ export interface InitWarning {
178
+ field: string;
179
+ originalValue: string;
180
+ message: string;
181
+ severity: 'warning' | 'note';
182
+ }
183
+
184
+ export interface InitFromActionResult {
185
+ configPath: string;
186
+ warningsCount: number;
187
+ }
188
+
189
+ // --- CLI options (extended) ---
190
+
191
+ export interface CliOptions {
192
+ command: string;
193
+ open: boolean;
194
+ configPath?: string;
195
+ routes: string[];
196
+ baselineDir: string;
197
+ currentDir: string;
198
+ diffDir: string;
199
+ to?: 'snap' | 'local';
200
+ from?: 'snap';
201
+ acceptCrossEngine?: boolean;
202
+ fromSnapAction?: string;
138
203
  }