@storysnap/cli 1.3.0 → 2.0.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 CHANGED
@@ -183,7 +183,7 @@ jobs:
183
183
  - uses: actions/checkout@v4
184
184
  - uses: actions/setup-node@v4
185
185
  with:
186
- node-version: '20'
186
+ node-version: '22'
187
187
 
188
188
  - name: Install dependencies
189
189
  run: npm ci
@@ -204,7 +204,7 @@ jobs:
204
204
 
205
205
  ```yaml
206
206
  visual-tests:
207
- image: mcr.microsoft.com/playwright:v1.40.0-jammy
207
+ image: mcr.microsoft.com/playwright:v1.63.0-noble
208
208
  script:
209
209
  - npm ci
210
210
  - npm run build-storybook
@@ -285,7 +285,7 @@ npx playwright install-deps
285
285
 
286
286
  ## Requirements
287
287
 
288
- - Node.js 18 or higher
288
+ - Node.js 22.12 or higher
289
289
  - A running Storybook instance (v6.0+)
290
290
 
291
291
  ## License
@@ -82,8 +82,8 @@ export interface Baseline {
82
82
  }
83
83
  export declare class ApiError extends Error {
84
84
  statusCode: number;
85
- response?: unknown | undefined;
86
- constructor(message: string, statusCode: number, response?: unknown | undefined);
85
+ response?: unknown;
86
+ constructor(message: string, statusCode: number, response?: unknown);
87
87
  }
88
88
  export declare class ApiClient {
89
89
  private apiUrl;
@@ -1,10 +1,14 @@
1
1
  import { z } from 'zod';
2
- declare const browserSchema: z.ZodEnum<["chromium", "firefox", "webkit"]>;
2
+ declare const browserSchema: z.ZodEnum<{
3
+ chromium: "chromium";
4
+ firefox: "firefox";
5
+ webkit: "webkit";
6
+ }>;
3
7
  export type Browser = z.infer<typeof browserSchema>;
4
- export declare const configSchema: z.ZodEffects<z.ZodObject<{
8
+ export declare const configSchema: z.ZodObject<{
5
9
  storybookUrl: z.ZodOptional<z.ZodString>;
6
10
  storybookStaticDir: z.ZodOptional<z.ZodString>;
7
- storage: z.ZodDefault<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
11
+ storage: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
8
12
  type: z.ZodLiteral<"s3">;
9
13
  bucket: z.ZodString;
10
14
  region: z.ZodString;
@@ -12,184 +16,32 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
12
16
  endpoint: z.ZodOptional<z.ZodString>;
13
17
  accessKeyId: z.ZodOptional<z.ZodString>;
14
18
  secretAccessKey: z.ZodOptional<z.ZodString>;
15
- }, "strip", z.ZodTypeAny, {
16
- type: "s3";
17
- bucket: string;
18
- region: string;
19
- prefix?: string | undefined;
20
- endpoint?: string | undefined;
21
- accessKeyId?: string | undefined;
22
- secretAccessKey?: string | undefined;
23
- }, {
24
- type: "s3";
25
- bucket: string;
26
- region: string;
27
- prefix?: string | undefined;
28
- endpoint?: string | undefined;
29
- accessKeyId?: string | undefined;
30
- secretAccessKey?: string | undefined;
31
- }>, z.ZodObject<{
19
+ }, z.core.$strip>, z.ZodObject<{
32
20
  type: z.ZodLiteral<"local">;
33
21
  directory: z.ZodString;
34
- }, "strip", z.ZodTypeAny, {
35
- type: "local";
36
- directory: string;
37
- }, {
38
- type: "local";
39
- directory: string;
40
- }>]>>;
22
+ }, z.core.$strip>], "type">>;
41
23
  viewport: z.ZodDefault<z.ZodObject<{
42
24
  width: z.ZodDefault<z.ZodNumber>;
43
25
  height: z.ZodDefault<z.ZodNumber>;
44
- }, "strip", z.ZodTypeAny, {
45
- width: number;
46
- height: number;
47
- }, {
48
- width?: number | undefined;
49
- height?: number | undefined;
50
- }>>;
51
- browsers: z.ZodDefault<z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">>;
26
+ }, z.core.$strip>>;
27
+ browsers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
28
+ chromium: "chromium";
29
+ firefox: "firefox";
30
+ webkit: "webkit";
31
+ }>>>;
52
32
  threshold: z.ZodOptional<z.ZodNumber>;
53
33
  maxDiffPercent: z.ZodOptional<z.ZodNumber>;
54
34
  localSnapshotsDir: z.ZodOptional<z.ZodString>;
55
- include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
- exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
37
  waitForSelector: z.ZodDefault<z.ZodString>;
58
38
  waitTimeout: z.ZodDefault<z.ZodNumber>;
59
39
  concurrency: z.ZodDefault<z.ZodNumber>;
60
- ignoreSelectors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ ignoreSelectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
41
  ignoreColor: z.ZodOptional<z.ZodString>;
62
42
  apiUrl: z.ZodOptional<z.ZodString>;
63
43
  apiToken: z.ZodOptional<z.ZodString>;
64
- }, "strip", z.ZodTypeAny, {
65
- storage: {
66
- type: "s3";
67
- bucket: string;
68
- region: string;
69
- prefix?: string | undefined;
70
- endpoint?: string | undefined;
71
- accessKeyId?: string | undefined;
72
- secretAccessKey?: string | undefined;
73
- } | {
74
- type: "local";
75
- directory: string;
76
- };
77
- viewport: {
78
- width: number;
79
- height: number;
80
- };
81
- browsers: ("chromium" | "firefox" | "webkit")[];
82
- waitForSelector: string;
83
- waitTimeout: number;
84
- concurrency: number;
85
- storybookUrl?: string | undefined;
86
- storybookStaticDir?: string | undefined;
87
- threshold?: number | undefined;
88
- maxDiffPercent?: number | undefined;
89
- localSnapshotsDir?: string | undefined;
90
- include?: string[] | undefined;
91
- exclude?: string[] | undefined;
92
- ignoreSelectors?: string[] | undefined;
93
- ignoreColor?: string | undefined;
94
- apiUrl?: string | undefined;
95
- apiToken?: string | undefined;
96
- }, {
97
- storybookUrl?: string | undefined;
98
- storybookStaticDir?: string | undefined;
99
- storage?: {
100
- type: "s3";
101
- bucket: string;
102
- region: string;
103
- prefix?: string | undefined;
104
- endpoint?: string | undefined;
105
- accessKeyId?: string | undefined;
106
- secretAccessKey?: string | undefined;
107
- } | {
108
- type: "local";
109
- directory: string;
110
- } | undefined;
111
- viewport?: {
112
- width?: number | undefined;
113
- height?: number | undefined;
114
- } | undefined;
115
- browsers?: ("chromium" | "firefox" | "webkit")[] | undefined;
116
- threshold?: number | undefined;
117
- maxDiffPercent?: number | undefined;
118
- localSnapshotsDir?: string | undefined;
119
- include?: string[] | undefined;
120
- exclude?: string[] | undefined;
121
- waitForSelector?: string | undefined;
122
- waitTimeout?: number | undefined;
123
- concurrency?: number | undefined;
124
- ignoreSelectors?: string[] | undefined;
125
- ignoreColor?: string | undefined;
126
- apiUrl?: string | undefined;
127
- apiToken?: string | undefined;
128
- }>, {
129
- storage: {
130
- type: "s3";
131
- bucket: string;
132
- region: string;
133
- prefix?: string | undefined;
134
- endpoint?: string | undefined;
135
- accessKeyId?: string | undefined;
136
- secretAccessKey?: string | undefined;
137
- } | {
138
- type: "local";
139
- directory: string;
140
- };
141
- viewport: {
142
- width: number;
143
- height: number;
144
- };
145
- browsers: ("chromium" | "firefox" | "webkit")[];
146
- waitForSelector: string;
147
- waitTimeout: number;
148
- concurrency: number;
149
- storybookUrl?: string | undefined;
150
- storybookStaticDir?: string | undefined;
151
- threshold?: number | undefined;
152
- maxDiffPercent?: number | undefined;
153
- localSnapshotsDir?: string | undefined;
154
- include?: string[] | undefined;
155
- exclude?: string[] | undefined;
156
- ignoreSelectors?: string[] | undefined;
157
- ignoreColor?: string | undefined;
158
- apiUrl?: string | undefined;
159
- apiToken?: string | undefined;
160
- }, {
161
- storybookUrl?: string | undefined;
162
- storybookStaticDir?: string | undefined;
163
- storage?: {
164
- type: "s3";
165
- bucket: string;
166
- region: string;
167
- prefix?: string | undefined;
168
- endpoint?: string | undefined;
169
- accessKeyId?: string | undefined;
170
- secretAccessKey?: string | undefined;
171
- } | {
172
- type: "local";
173
- directory: string;
174
- } | undefined;
175
- viewport?: {
176
- width?: number | undefined;
177
- height?: number | undefined;
178
- } | undefined;
179
- browsers?: ("chromium" | "firefox" | "webkit")[] | undefined;
180
- threshold?: number | undefined;
181
- maxDiffPercent?: number | undefined;
182
- localSnapshotsDir?: string | undefined;
183
- include?: string[] | undefined;
184
- exclude?: string[] | undefined;
185
- waitForSelector?: string | undefined;
186
- waitTimeout?: number | undefined;
187
- concurrency?: number | undefined;
188
- ignoreSelectors?: string[] | undefined;
189
- ignoreColor?: string | undefined;
190
- apiUrl?: string | undefined;
191
- apiToken?: string | undefined;
192
- }>;
44
+ }, z.core.$strip>;
193
45
  export type ConfigInput = z.input<typeof configSchema>;
194
46
  export type Config = z.output<typeof configSchema>;
195
47
  export declare function validateConfig(input: unknown): Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storysnap/cli",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Visual regression testing for Storybook - capture screenshots, detect changes, and maintain baselines",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -53,27 +53,26 @@
53
53
  },
54
54
  "homepage": "https://github.com/Kosai106/storysnap#readme",
55
55
  "dependencies": {
56
- "@aws-sdk/client-s3": "^3.400.0",
57
- "chalk": "^5.3.0",
58
- "commander": "^11.0.0",
59
- "glob": "^10.3.0",
60
- "ora": "^7.0.0",
61
- "pixelmatch": "^5.3.0",
62
- "playwright": "^1.40.0",
56
+ "@aws-sdk/client-s3": "^3.1147.0",
57
+ "chalk": "^6.0.1",
58
+ "commander": "^15.0.0",
59
+ "glob": "^13.0.6",
60
+ "ora": "^9.4.1",
61
+ "pixelmatch": "^8.0.0",
62
+ "playwright": "^1.63.0",
63
63
  "pngjs": "^7.0.0",
64
- "zod": "^3.22.0"
64
+ "zod": "^4.6.5"
65
65
  },
66
66
  "devDependencies": {
67
- "@types/node": "^20.10.0",
68
- "@types/pixelmatch": "^5.2.6",
69
- "@types/pngjs": "^6.0.4",
70
- "@vitest/coverage-v8": "^2.0.0",
71
- "typescript": "^5.3.0",
72
- "vitest": "^2.0.0",
73
- "@storysnap/shared": "1.0.0"
67
+ "@storysnap/shared": "1.0.0",
68
+ "@types/node": "^22.12.0",
69
+ "@types/pngjs": "^6.0.5",
70
+ "@vitest/coverage-v8": "^5.0.3",
71
+ "typescript": "^7.0.2",
72
+ "vitest": "^5.0.3"
74
73
  },
75
74
  "engines": {
76
- "node": ">=18.0.0"
75
+ "node": ">=22.12.0"
77
76
  },
78
77
  "scripts": {
79
78
  "build": "tsc",