@cappa/plugin-storybook 0.0.21 → 0.0.22
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 +8 -8
- package/CHANGELOG.md +8 -0
- package/dist/index.js +3 -6
- package/dist/index.mjs +3 -6
- package/package.json +2 -2
- package/src/cappa/plugin.ts +1 -4
- package/src/cappa/util.test.ts +3 -3
- package/src/cappa/util.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @cappa/plugin-storybook@0.0.
|
|
3
|
+
> @cappa/plugin-storybook@0.0.21 build /home/tim/code/work/cappa/packages/plugins/plugin-storybook
|
|
4
4
|
> tsup
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
[34mESM[39m Build start
|
|
26
26
|
[34mCLI[39m Cleaning output folder
|
|
27
27
|
[34mESM[39m Build start
|
|
28
|
-
[32mESM[39m [1mdist/browser.mjs [22m[32m138.00 B[39m
|
|
29
|
-
[32mESM[39m ⚡️ Build success in 6ms
|
|
30
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m6.75 KB[39m
|
|
31
|
-
[32mESM[39m ⚡️ Build success in 9ms
|
|
32
28
|
[32mESM[39m [1mdist/preview.mjs [22m[32m1.34 KB[39m
|
|
33
|
-
[32mESM[39m ⚡️ Build success in
|
|
34
|
-
[
|
|
29
|
+
[32mESM[39m ⚡️ Build success in 7ms
|
|
30
|
+
[32mESM[39m [1mdist/browser.mjs [22m[32m138.00 B[39m
|
|
31
|
+
[32mESM[39m ⚡️ Build success in 7ms
|
|
32
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m6.64 KB[39m
|
|
33
|
+
[32mESM[39m ⚡️ Build success in 10ms
|
|
34
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.99 KB[39m
|
|
35
35
|
[32mCJS[39m ⚡️ Build success in 10ms
|
|
36
36
|
DTS Build start
|
|
37
|
-
DTS ⚡️ Build success in
|
|
37
|
+
DTS ⚡️ Build success in 826ms
|
|
38
38
|
DTS dist/index.d.ts 593.00 B
|
|
39
39
|
DTS dist/index.d.mts 593.00 B
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var waitForVisualIdle = async (page) => {
|
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
var buildFilename = (story) => {
|
|
58
|
-
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.
|
|
58
|
+
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.png`;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
// src/cappa/plugin.ts
|
|
@@ -131,9 +131,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
131
131
|
viewport: defaultViewport,
|
|
132
132
|
waitForSelector,
|
|
133
133
|
waitForTimeout,
|
|
134
|
-
fullPage: true
|
|
135
|
-
quality: 90,
|
|
136
|
-
type: "jpeg"
|
|
134
|
+
fullPage: true
|
|
137
135
|
};
|
|
138
136
|
const page = screenshotTool.page;
|
|
139
137
|
if (!page) {
|
|
@@ -169,7 +167,6 @@ var cappaPluginStorybook = (options) => {
|
|
|
169
167
|
filename,
|
|
170
168
|
{
|
|
171
169
|
fullPage: options2.fullPage ?? screenshotOptions.fullPage,
|
|
172
|
-
type: options2.type ?? screenshotOptions.type,
|
|
173
170
|
waitForSelector: options2.waitForSelector ?? screenshotOptions.waitForSelector,
|
|
174
171
|
waitForTimeout: options2.waitForTimeout ?? screenshotOptions.waitForTimeout
|
|
175
172
|
}
|
|
@@ -205,7 +202,7 @@ ${results.filter((r) => r.skipped).map((r) => `${r.storyName}`).join("\n")}`
|
|
|
205
202
|
);
|
|
206
203
|
}
|
|
207
204
|
logger.box({
|
|
208
|
-
title: "
|
|
205
|
+
title: "Storybook Report",
|
|
209
206
|
message: `${import_chalk.default.yellow("Skipped stories:")} ${results.filter((r) => r.skipped).length}
|
|
210
207
|
${import_chalk.default.red("Failed stories:")} ${results.filter((r) => r.error).length}
|
|
211
208
|
${import_chalk.default.green("Successful screenshots:")} ${results.length}`
|
package/dist/index.mjs
CHANGED
|
@@ -25,7 +25,7 @@ var waitForVisualIdle = async (page) => {
|
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
var buildFilename = (story) => {
|
|
28
|
-
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.
|
|
28
|
+
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.png`;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
// src/cappa/plugin.ts
|
|
@@ -101,9 +101,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
101
101
|
viewport: defaultViewport,
|
|
102
102
|
waitForSelector,
|
|
103
103
|
waitForTimeout,
|
|
104
|
-
fullPage: true
|
|
105
|
-
quality: 90,
|
|
106
|
-
type: "jpeg"
|
|
104
|
+
fullPage: true
|
|
107
105
|
};
|
|
108
106
|
const page = screenshotTool.page;
|
|
109
107
|
if (!page) {
|
|
@@ -139,7 +137,6 @@ var cappaPluginStorybook = (options) => {
|
|
|
139
137
|
filename,
|
|
140
138
|
{
|
|
141
139
|
fullPage: options2.fullPage ?? screenshotOptions.fullPage,
|
|
142
|
-
type: options2.type ?? screenshotOptions.type,
|
|
143
140
|
waitForSelector: options2.waitForSelector ?? screenshotOptions.waitForSelector,
|
|
144
141
|
waitForTimeout: options2.waitForTimeout ?? screenshotOptions.waitForTimeout
|
|
145
142
|
}
|
|
@@ -175,7 +172,7 @@ ${results.filter((r) => r.skipped).map((r) => `${r.storyName}`).join("\n")}`
|
|
|
175
172
|
);
|
|
176
173
|
}
|
|
177
174
|
logger.box({
|
|
178
|
-
title: "
|
|
175
|
+
title: "Storybook Report",
|
|
179
176
|
message: `${chalk.yellow("Skipped stories:")} ${results.filter((r) => r.skipped).length}
|
|
180
177
|
${chalk.red("Failed stories:")} ${results.filter((r) => r.error).length}
|
|
181
178
|
${chalk.green("Successful screenshots:")} ${results.length}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappa/plugin-storybook",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Storybook plugin for Cappa - takes screenshots of Storybook stories",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@swc/core": "^1.13.5",
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
33
|
"storybook": "^9.1.5",
|
|
34
|
-
"@cappa/core": "0.0.
|
|
34
|
+
"@cappa/core": "0.0.22"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@vitest/coverage-v8": "3.2.4",
|
package/src/cappa/plugin.ts
CHANGED
|
@@ -140,8 +140,6 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (
|
|
|
140
140
|
waitForSelector: waitForSelector,
|
|
141
141
|
waitForTimeout: waitForTimeout,
|
|
142
142
|
fullPage: true,
|
|
143
|
-
quality: 90,
|
|
144
|
-
type: "jpeg" as const,
|
|
145
143
|
};
|
|
146
144
|
|
|
147
145
|
const page = screenshotTool.page;
|
|
@@ -189,7 +187,6 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (
|
|
|
189
187
|
filename,
|
|
190
188
|
{
|
|
191
189
|
fullPage: options.fullPage ?? screenshotOptions.fullPage,
|
|
192
|
-
type: options.type ?? screenshotOptions.type,
|
|
193
190
|
waitForSelector:
|
|
194
191
|
options.waitForSelector ?? screenshotOptions.waitForSelector,
|
|
195
192
|
waitForTimeout:
|
|
@@ -237,7 +234,7 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (
|
|
|
237
234
|
}
|
|
238
235
|
|
|
239
236
|
logger.box({
|
|
240
|
-
title: "
|
|
237
|
+
title: "Storybook Report",
|
|
241
238
|
message: `${chalk.yellow("Skipped stories:")} ${results.filter((r) => r.skipped).length}\n${chalk.red("Failed stories:")} ${results.filter((r) => r.error).length}\n${chalk.green("Successful screenshots:")} ${results.length}`,
|
|
242
239
|
});
|
|
243
240
|
|
package/src/cappa/util.test.ts
CHANGED
|
@@ -14,7 +14,7 @@ describe("buildFilename", () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const filename = buildFilename(story);
|
|
17
|
-
expect(filename).toBe("Story/Primary.
|
|
17
|
+
expect(filename).toBe("Story/Primary.png");
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it("should build a filename for a story with a folder", () => {
|
|
@@ -28,7 +28,7 @@ describe("buildFilename", () => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const filename = buildFilename(story);
|
|
31
|
-
expect(filename).toBe("Folder/Story/Primary.
|
|
31
|
+
expect(filename).toBe("Folder/Story/Primary.png");
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it("should build a filename for a story with special characters", () => {
|
|
@@ -42,6 +42,6 @@ describe("buildFilename", () => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const filename = buildFilename(story);
|
|
45
|
-
expect(filename).toBe("Story123/Primary123.
|
|
45
|
+
expect(filename).toBe("Story123/Primary123.png");
|
|
46
46
|
});
|
|
47
47
|
});
|
package/src/cappa/util.ts
CHANGED
|
@@ -40,5 +40,5 @@ export const waitForVisualIdle = async (page: Page) => {
|
|
|
40
40
|
* @returns The filename for the story. Slashes represent folders that should be handled by seperate file system calls.
|
|
41
41
|
*/
|
|
42
42
|
export const buildFilename = (story: StorybookStory) => {
|
|
43
|
-
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.
|
|
43
|
+
return `${story.title.replace(/[^a-zA-Z0-9/]/g, "")}/${story.name.replace(/[^a-zA-Z0-9]/g, "")}.png`;
|
|
44
44
|
};
|