@cappa/plugin-storybook 0.0.14 → 0.0.15
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/.turbo/turbo-tsc.log +5 -0
- package/CHANGELOG.md +8 -0
- package/README.md +6 -4
- package/dist/index.js +7 -5
- package/dist/index.mjs +7 -5
- package/package.json +2 -2
- package/src/cappa/plugin.ts +7 -6
- package/src/storybook/addon/preview.ts +1 -6
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.14 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/preview.mjs [22m[32m1.39 KB[39m
|
|
29
|
-
[32mESM[39m ⚡️ Build success in 7ms
|
|
30
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m5.81 KB[39m
|
|
31
|
-
[32mESM[39m ⚡️ Build success in 10ms
|
|
32
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[32m5.96 KB[39m
|
|
31
|
+
[32mESM[39m ⚡️ Build success in 9ms
|
|
32
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.32 KB[39m
|
|
33
|
+
[32mCJS[39m ⚡️ Build success in 9ms
|
|
34
|
+
[32mESM[39m [1mdist/preview.mjs [22m[32m1.39 KB[39m
|
|
33
35
|
[32mESM[39m ⚡️ Build success in 7ms
|
|
34
|
-
[32mCJS[39m [1mdist/index.js [22m[32m7.17 KB[39m
|
|
35
|
-
[32mCJS[39m ⚡️ Build success in 10ms
|
|
36
36
|
DTS Build start
|
|
37
|
-
DTS ⚡️ Build success in
|
|
37
|
+
DTS ⚡️ Build success in 839ms
|
|
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/README.md
CHANGED
|
@@ -45,10 +45,11 @@ Cappa uses a storybook addon that allows you to pass options from storybook into
|
|
|
45
45
|
|
|
46
46
|
### Parameters
|
|
47
47
|
|
|
48
|
-
| Option
|
|
49
|
-
|
|
|
50
|
-
| skip
|
|
51
|
-
| delay
|
|
48
|
+
| Option | Description | Default |
|
|
49
|
+
| -------- | ----------------------------------------------- | --------------- |
|
|
50
|
+
| skip | Whether to skip the screenshot | false |
|
|
51
|
+
| delay | The delay to wait before taking the screenshot | null (no delay) |
|
|
52
|
+
| fullPage | Whether to take a full page screenshot | true |
|
|
52
53
|
|
|
53
54
|
#### Example
|
|
54
55
|
|
|
@@ -58,6 +59,7 @@ export const Primary: Story = {
|
|
|
58
59
|
cappa: {
|
|
59
60
|
skip: true,
|
|
60
61
|
delay: 1000,
|
|
62
|
+
fullPage: false,
|
|
61
63
|
},
|
|
62
64
|
},
|
|
63
65
|
};
|
package/dist/index.js
CHANGED
|
@@ -154,8 +154,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
154
154
|
});
|
|
155
155
|
results.push({
|
|
156
156
|
storyId: story.id,
|
|
157
|
-
storyName: story.name
|
|
158
|
-
storyTitle: story.title,
|
|
157
|
+
storyName: `${story.title} - ${story.name}`,
|
|
159
158
|
success: true,
|
|
160
159
|
filepath: actualFilepath
|
|
161
160
|
});
|
|
@@ -163,13 +162,16 @@ var cappaPluginStorybook = (options) => {
|
|
|
163
162
|
console.error(`Error taking screenshot of story ${story.title} - ${story.name}:`, error.message);
|
|
164
163
|
results.push({
|
|
165
164
|
storyId: story.id,
|
|
166
|
-
storyName: story.name
|
|
167
|
-
storyTitle: story.title,
|
|
165
|
+
storyName: `${story.title} - ${story.name}`,
|
|
168
166
|
success: false,
|
|
169
|
-
error: error
|
|
167
|
+
error: error?.message ?? "Unknown error"
|
|
170
168
|
});
|
|
171
169
|
}
|
|
172
170
|
}
|
|
171
|
+
if (results.some((r) => !r.success)) {
|
|
172
|
+
console.log(`Error report:
|
|
173
|
+
${results.map((r) => `${r.storyName}: ${r.error}`).join("\n")}`);
|
|
174
|
+
}
|
|
173
175
|
console.log(`Completed screenshots: ${results.filter((r) => r.success).length}/${results.length} successful`);
|
|
174
176
|
return results;
|
|
175
177
|
} catch (error) {
|
package/dist/index.mjs
CHANGED
|
@@ -124,8 +124,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
124
124
|
});
|
|
125
125
|
results.push({
|
|
126
126
|
storyId: story.id,
|
|
127
|
-
storyName: story.name
|
|
128
|
-
storyTitle: story.title,
|
|
127
|
+
storyName: `${story.title} - ${story.name}`,
|
|
129
128
|
success: true,
|
|
130
129
|
filepath: actualFilepath
|
|
131
130
|
});
|
|
@@ -133,13 +132,16 @@ var cappaPluginStorybook = (options) => {
|
|
|
133
132
|
console.error(`Error taking screenshot of story ${story.title} - ${story.name}:`, error.message);
|
|
134
133
|
results.push({
|
|
135
134
|
storyId: story.id,
|
|
136
|
-
storyName: story.name
|
|
137
|
-
storyTitle: story.title,
|
|
135
|
+
storyName: `${story.title} - ${story.name}`,
|
|
138
136
|
success: false,
|
|
139
|
-
error: error
|
|
137
|
+
error: error?.message ?? "Unknown error"
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
}
|
|
141
|
+
if (results.some((r) => !r.success)) {
|
|
142
|
+
console.log(`Error report:
|
|
143
|
+
${results.map((r) => `${r.storyName}: ${r.error}`).join("\n")}`);
|
|
144
|
+
}
|
|
143
145
|
console.log(`Completed screenshots: ${results.filter((r) => r.success).length}/${results.length} successful`);
|
|
144
146
|
return results;
|
|
145
147
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappa/plugin-storybook",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Storybook plugin for Cappa - takes screenshots of Storybook stories",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@swc/core": "^1.13.5",
|
|
32
32
|
"storybook": "^9.1.5",
|
|
33
|
-
"@cappa/core": "0.0.
|
|
33
|
+
"@cappa/core": "0.0.15"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"playwright-core": "^1.55.0",
|
package/src/cappa/plugin.ts
CHANGED
|
@@ -99,7 +99,6 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (options) =>
|
|
|
99
99
|
const results: Array<{
|
|
100
100
|
storyId: string;
|
|
101
101
|
storyName: string;
|
|
102
|
-
storyTitle: string;
|
|
103
102
|
success: boolean;
|
|
104
103
|
filepath?: string;
|
|
105
104
|
error?: string;
|
|
@@ -171,8 +170,7 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (options) =>
|
|
|
171
170
|
|
|
172
171
|
results.push({
|
|
173
172
|
storyId: story.id,
|
|
174
|
-
storyName: story.name
|
|
175
|
-
storyTitle: story.title,
|
|
173
|
+
storyName: `${story.title} - ${story.name}`,
|
|
176
174
|
success: true,
|
|
177
175
|
filepath: actualFilepath,
|
|
178
176
|
});
|
|
@@ -180,14 +178,17 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (options) =>
|
|
|
180
178
|
console.error(`Error taking screenshot of story ${story.title} - ${story.name}:`, (error as Error).message);
|
|
181
179
|
results.push({
|
|
182
180
|
storyId: story.id,
|
|
183
|
-
storyName: story.name
|
|
184
|
-
storyTitle: story.title,
|
|
181
|
+
storyName: `${story.title} - ${story.name}`,
|
|
185
182
|
success: false,
|
|
186
|
-
error: (error as Error)
|
|
183
|
+
error: (error as Error)?.message ?? "Unknown error",
|
|
187
184
|
});
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
187
|
|
|
188
|
+
if (results.some((r) => !r.success)) {
|
|
189
|
+
console.log(`Error report: \n${results.map((r) => `${r.storyName}: ${r.error}`).join("\n")}`);
|
|
190
|
+
}
|
|
191
|
+
|
|
191
192
|
console.log(`Completed screenshots: ${results.filter((r) => r.success).length}/${results.length} successful`);
|
|
192
193
|
return results;
|
|
193
194
|
} catch (error) {
|
|
@@ -2,12 +2,7 @@ import { withCappaDecorator } from "./decorator";
|
|
|
2
2
|
|
|
3
3
|
export const decorators = [withCappaDecorator];
|
|
4
4
|
|
|
5
|
-
export const parameters = {
|
|
6
|
-
layout: "full",
|
|
7
|
-
cappa: {
|
|
8
|
-
enabled: true,
|
|
9
|
-
},
|
|
10
|
-
};
|
|
5
|
+
export const parameters = {};
|
|
11
6
|
|
|
12
7
|
export const afterEach = () => {
|
|
13
8
|
(window as any).playAfterEach = true;
|