@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.
- package/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +9 -0
- package/package.json +3 -3
- package/src/cappa/plugin.test.ts +33 -27
- package/dist/browser.d.cts +0 -6
- package/dist/browser.d.ts +0 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @cappa/plugin-storybook@0.4.
|
|
2
|
+
> @cappa/plugin-storybook@0.4.2 build /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.esm.ts"}
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
[34mCLI[39m Cleaning output folder
|
|
32
32
|
[34mESM[39m Build start
|
|
33
33
|
[34mCJS[39m Build start
|
|
34
|
-
[32mESM[39m [1mdist/browser.js [22m[32m138.00 B[39m
|
|
35
|
-
[32mESM[39m ⚡️ Build success in 62ms
|
|
36
34
|
[32mCJS[39m [1mdist/browser.cjs [22m[32m1.12 KB[39m
|
|
37
|
-
[32mCJS[39m ⚡️ Build success in
|
|
35
|
+
[32mCJS[39m ⚡️ Build success in 53ms
|
|
36
|
+
[32mESM[39m [1mdist/browser.js [22m[32m138.00 B[39m
|
|
37
|
+
[32mESM[39m ⚡️ Build success in 53ms
|
|
38
38
|
[32mESM[39m [1mdist/preview.js [22m[32m1.58 KB[39m
|
|
39
|
-
[32mESM[39m ⚡️ Build success in
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 60ms
|
|
40
40
|
[32mCJS[39m [1mdist/index.cjs [22m[32m14.08 KB[39m
|
|
41
|
-
[32mCJS[39m ⚡️ Build success in
|
|
41
|
+
[32mCJS[39m ⚡️ Build success in 70ms
|
|
42
42
|
[32mESM[39m [1mdist/index.js [22m[32m12.35 KB[39m
|
|
43
|
-
[32mESM[39m ⚡️ Build success in
|
|
43
|
+
[32mESM[39m ⚡️ Build success in 76ms
|
|
44
44
|
[34mDTS[39m Build start
|
|
45
45
|
[34mDTS[39m Build start
|
|
46
46
|
[34mDTS[39m Build start
|
|
47
|
-
[32mDTS[39m ⚡️ Build success in
|
|
47
|
+
[32mDTS[39m ⚡️ Build success in 4139ms
|
|
48
48
|
[32mDTS[39m [1mdist/browser.d.ts [22m[32m117.00 B[39m
|
|
49
49
|
[32mDTS[39m [1mdist/browser.d.cts [22m[32m117.00 B[39m
|
|
50
|
-
[32mDTS[39m ⚡️ Build success in
|
|
51
|
-
[32mDTS[39m [1mdist/index.esm.d.ts [22m[32m2.66 KB[39m
|
|
52
|
-
[32mDTS[39m ⚡️ Build success in 6343ms
|
|
50
|
+
[32mDTS[39m ⚡️ Build success in 5475ms
|
|
53
51
|
[32mDTS[39m [1mdist/index.cjs.d.cts [22m[32m2.66 KB[39m
|
|
52
|
+
[32mDTS[39m ⚡️ Build success in 5454ms
|
|
53
|
+
[32mDTS[39m [1mdist/index.esm.d.ts [22m[32m2.66 KB[39m
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappa/plugin-storybook",
|
|
3
|
-
"version": "0.4.
|
|
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.
|
|
60
|
-
"@cappa/logger": "0.0.
|
|
59
|
+
"@cappa/core": "0.4.2",
|
|
60
|
+
"@cappa/logger": "0.0.7"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "24.9.2",
|
package/src/cappa/plugin.test.ts
CHANGED
|
@@ -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]
|
|
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]
|
|
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]
|
|
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);
|
|
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]
|
|
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?.(
|
|
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?.(
|
|
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(),
|
package/dist/browser.d.cts
DELETED