@cappa/plugin-storybook 0.4.1 → 0.4.2

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @cappa/plugin-storybook@0.4.1 build /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook
2
+ > @cappa/plugin-storybook@0.4.2 build /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: {"index":"src/index.esm.ts"}
@@ -31,23 +31,23 @@
31
31
  CLI Cleaning output folder
32
32
  ESM Build start
33
33
  CJS Build start
34
- ESM dist/browser.js 138.00 B
35
- ESM ⚡️ Build success in 62ms
36
34
  CJS dist/browser.cjs 1.12 KB
37
- CJS ⚡️ Build success in 65ms
35
+ CJS ⚡️ Build success in 53ms
36
+ ESM dist/browser.js 138.00 B
37
+ ESM ⚡️ Build success in 53ms
38
38
  ESM dist/preview.js 1.58 KB
39
- ESM ⚡️ Build success in 74ms
39
+ ESM ⚡️ Build success in 60ms
40
40
  CJS dist/index.cjs 14.08 KB
41
- CJS ⚡️ Build success in 86ms
41
+ CJS ⚡️ Build success in 70ms
42
42
  ESM dist/index.js 12.35 KB
43
- ESM ⚡️ Build success in 94ms
43
+ ESM ⚡️ Build success in 76ms
44
44
  DTS Build start
45
45
  DTS Build start
46
46
  DTS Build start
47
- DTS ⚡️ Build success in 5054ms
47
+ DTS ⚡️ Build success in 4139ms
48
48
  DTS dist/browser.d.ts 117.00 B
49
49
  DTS dist/browser.d.cts 117.00 B
50
- DTS ⚡️ Build success in 6179ms
51
- DTS dist/index.esm.d.ts 2.66 KB
52
- DTS ⚡️ Build success in 6343ms
50
+ DTS ⚡️ Build success in 5475ms
53
51
  DTS dist/index.cjs.d.cts 2.66 KB
52
+ DTS ⚡️ Build success in 5454ms
53
+ DTS dist/index.esm.d.ts 2.66 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @cappa/plugin-storybook
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1fad7cc: fix: deleted screenshot handling in approve command
8
+ - Updated dependencies [1fad7cc]
9
+ - @cappa/logger@0.0.7
10
+ - @cappa/core@0.4.2
11
+
3
12
  ## 0.4.1
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cappa/plugin-storybook",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Storybook plugin for Cappa - takes screenshots of Storybook stories",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -56,8 +56,8 @@
56
56
  "@swc/core": "^1.14.0",
57
57
  "chalk": "^5.6.2",
58
58
  "minimatch": "^10.1.1",
59
- "@cappa/core": "0.4.1",
60
- "@cappa/logger": "0.0.6"
59
+ "@cappa/core": "0.4.2",
60
+ "@cappa/logger": "0.0.7"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "24.9.2",
@@ -104,9 +104,9 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
104
104
  includeStories: ["button--primary"],
105
105
  });
106
106
 
107
- const result = await plugin.discover();
107
+ const result = await plugin.discover({} as any);
108
108
  expect(result).toHaveLength(1);
109
- expect(result[0].data.story.id).toBe("button--primary");
109
+ expect(result[0]?.data.story.id).toBe("button--primary");
110
110
  });
111
111
 
112
112
  it("should include stories matching wildcard patterns", async () => {
@@ -115,7 +115,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
115
115
  includeStories: ["button--*"],
116
116
  });
117
117
 
118
- const result = await plugin.discover();
118
+ const result = await plugin.discover({} as any);
119
119
  expect(result).toHaveLength(2);
120
120
  expect(result.map((r) => r.data.story.id)).toEqual([
121
121
  "button--primary",
@@ -129,7 +129,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
129
129
  includeStories: ["Button"],
130
130
  });
131
131
 
132
- const result = await plugin.discover();
132
+ const result = await plugin.discover({} as any);
133
133
  expect(result).toHaveLength(2);
134
134
  expect(result.map((r) => r.data.story.id)).toEqual([
135
135
  "button--primary",
@@ -143,9 +143,9 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
143
143
  includeStories: ["Primary"],
144
144
  });
145
145
 
146
- const result = await plugin.discover();
146
+ const result = await plugin.discover({} as any);
147
147
  expect(result).toHaveLength(1);
148
- expect(result[0].data.story.id).toBe("button--primary");
148
+ expect(result[0]?.data.story.id).toBe("button--primary");
149
149
  });
150
150
 
151
151
  it("should include stories matching full path patterns", async () => {
@@ -154,7 +154,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
154
154
  includeStories: ["Button/*"],
155
155
  });
156
156
 
157
- const result = await plugin.discover();
157
+ const result = await plugin.discover({} as any);
158
158
  expect(result).toHaveLength(2);
159
159
  expect(result.map((r) => r.data.story.id)).toEqual([
160
160
  "button--primary",
@@ -168,7 +168,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
168
168
  includeStories: ["button--*", "input--*"],
169
169
  });
170
170
 
171
- const result = await plugin.discover();
171
+ const result = await plugin.discover({} as any);
172
172
  expect(result).toHaveLength(4);
173
173
  expect(result.map((r) => r.data.story.id)).toEqual([
174
174
  "button--primary",
@@ -184,7 +184,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
184
184
  includeStories: ["*--primary", "*--default"],
185
185
  });
186
186
 
187
- const result = await plugin.discover();
187
+ const result = await plugin.discover({} as any);
188
188
  expect(result).toHaveLength(2);
189
189
  expect(result.map((r) => r.data.story.id)).toEqual([
190
190
  "button--primary",
@@ -200,7 +200,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
200
200
  excludeStories: ["button--primary"],
201
201
  });
202
202
 
203
- const result = await plugin.discover();
203
+ const result = await plugin.discover({} as any);
204
204
  expect(result).toHaveLength(5);
205
205
  expect(result.map((r) => r.data.story.id)).not.toContain(
206
206
  "button--primary",
@@ -213,7 +213,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
213
213
  excludeStories: ["button--*"],
214
214
  });
215
215
 
216
- const result = await plugin.discover();
216
+ const result = await plugin.discover({} as any);
217
217
  expect(result).toHaveLength(4);
218
218
  expect(result.map((r) => r.data.story.id)).not.toContain(
219
219
  "button--primary",
@@ -229,7 +229,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
229
229
  excludeStories: ["Button"],
230
230
  });
231
231
 
232
- const result = await plugin.discover();
232
+ const result = await plugin.discover({} as any);
233
233
  expect(result).toHaveLength(4);
234
234
  expect(result.map((r) => r.data.story.id)).not.toContain(
235
235
  "button--primary",
@@ -245,7 +245,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
245
245
  excludeStories: ["Primary"],
246
246
  });
247
247
 
248
- const result = await plugin.discover();
248
+ const result = await plugin.discover({} as any);
249
249
  expect(result).toHaveLength(5);
250
250
  expect(result.map((r) => r.data.story.id)).not.toContain(
251
251
  "button--primary",
@@ -258,7 +258,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
258
258
  excludeStories: ["Button/*"],
259
259
  });
260
260
 
261
- const result = await plugin.discover();
261
+ const result = await plugin.discover({} as any);
262
262
  expect(result).toHaveLength(4);
263
263
  expect(result.map((r) => r.data.story.id)).not.toContain(
264
264
  "button--primary",
@@ -274,7 +274,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
274
274
  excludeStories: ["button--*", "input--*"],
275
275
  });
276
276
 
277
- const result = await plugin.discover();
277
+ const result = await plugin.discover({} as any);
278
278
  expect(result).toHaveLength(2);
279
279
  expect(result.map((r) => r.data.story.id)).toEqual([
280
280
  "card--basic",
@@ -291,7 +291,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
291
291
  excludeStories: ["button--*"], // Then exclude button stories
292
292
  });
293
293
 
294
- const result = await plugin.discover();
294
+ const result = await plugin.discover({} as any);
295
295
  expect(result).toHaveLength(4);
296
296
  expect(result.map((r) => r.data.story.id)).not.toContain(
297
297
  "button--primary",
@@ -308,9 +308,9 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
308
308
  excludeStories: ["button--*"], // Exclude all button stories
309
309
  });
310
310
 
311
- const result = await plugin.discover();
311
+ const result = await plugin.discover({} as any);
312
312
  expect(result).toHaveLength(1);
313
- expect(result[0].data.story.id).toBe("input--default");
313
+ expect(result[0]?.data.story.id).toBe("input--default");
314
314
  });
315
315
  });
316
316
 
@@ -321,7 +321,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
321
321
  includeStories: [],
322
322
  });
323
323
 
324
- const result = await plugin.discover();
324
+ const result = await plugin.discover({} as any);
325
325
  expect(result).toHaveLength(6); // All stories included
326
326
  });
327
327
 
@@ -331,8 +331,8 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
331
331
  excludeStories: [],
332
332
  });
333
333
 
334
- const result = await plugin.discover();
335
- expect(result).toHaveLength(6); // All stories included
334
+ const result = await plugin.discover({} as any);
335
+ expect(result).toHaveLength(6);
336
336
  });
337
337
 
338
338
  it("should handle patterns that match no stories", async () => {
@@ -341,7 +341,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
341
341
  includeStories: ["nonexistent--*"],
342
342
  });
343
343
 
344
- const result = await plugin.discover();
344
+ const result = await plugin.discover({} as any);
345
345
  expect(result).toHaveLength(0);
346
346
  });
347
347
 
@@ -351,7 +351,7 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
351
351
  includeStories: ["button"], // lowercase
352
352
  });
353
353
 
354
- const result = await plugin.discover();
354
+ const result = await plugin.discover({} as any);
355
355
  expect(result).toHaveLength(0); // No matches because "Button" is capitalized
356
356
  });
357
357
 
@@ -383,9 +383,9 @@ describe("cappaPluginStorybook - Glob Pattern Matching", () => {
383
383
  includeStories: ["special--*"],
384
384
  });
385
385
 
386
- const result = await plugin.discover();
386
+ const result = await plugin.discover({} as any);
387
387
  expect(result).toHaveLength(1);
388
- expect(result[0].data.story.id).toBe(
388
+ expect(result[0]?.data.story.id).toBe(
389
389
  "special--with-dots.and-brackets[test]",
390
390
  );
391
391
  });
@@ -476,7 +476,10 @@ describe("console logging configuration", () => {
476
476
 
477
477
  const page = createPage();
478
478
  const screenshotTool = createScreenshotTool();
479
- const context = (await plugin.initPage?.()) ?? { latchMap: new Map() };
479
+ const context = (await plugin.initPage?.(
480
+ page as any,
481
+ screenshotTool as any,
482
+ )) ?? { latchMap: new Map() };
480
483
 
481
484
  await plugin.execute(
482
485
  createTask(),
@@ -501,7 +504,10 @@ describe("console logging configuration", () => {
501
504
  const plugin = cappaPluginStorybook({
502
505
  storybookUrl: "http://localhost:6006",
503
506
  });
504
- const context = (await plugin.initPage?.()) ?? { latchMap: new Map() };
507
+ const context = (await plugin.initPage?.(
508
+ page as any,
509
+ screenshotTool as any,
510
+ )) ?? { latchMap: new Map() };
505
511
 
506
512
  await plugin.execute(
507
513
  createTask(),
@@ -1,6 +0,0 @@
1
- /**
2
- * Checks if the current window is a cappa window
3
- */
4
- declare const isCappa: () => boolean;
5
-
6
- export { isCappa };
package/dist/browser.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Checks if the current window is a cappa window
3
- */
4
- declare const isCappa: () => boolean;
5
-
6
- export { isCappa };