@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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @cappa/plugin-storybook@0.0.13 build /home/tim/code/work/cappa/packages/plugins/plugin-storybook
3
+ > @cappa/plugin-storybook@0.0.14 build /home/tim/code/work/cappa/packages/plugins/plugin-storybook
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -25,15 +25,15 @@
25
25
  ESM Build start
26
26
  CLI Cleaning output folder
27
27
  ESM Build start
28
- ESM dist/preview.mjs 1.39 KB
29
- ESM ⚡️ Build success in 7ms
30
- ESM dist/index.mjs 5.81 KB
31
- ESM ⚡️ Build success in 10ms
32
28
  ESM dist/browser.mjs 138.00 B
29
+ ESM ⚡️ Build success in 6ms
30
+ ESM dist/index.mjs 5.96 KB
31
+ ESM ⚡️ Build success in 9ms
32
+ CJS dist/index.js 7.32 KB
33
+ CJS ⚡️ Build success in 9ms
34
+ ESM dist/preview.mjs 1.39 KB
33
35
  ESM ⚡️ Build success in 7ms
34
- CJS dist/index.js 7.17 KB
35
- CJS ⚡️ Build success in 10ms
36
36
  DTS Build start
37
- DTS ⚡️ Build success in 795ms
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
@@ -0,0 +1,5 @@
1
+
2
+
3
+ > @cappa/plugin-storybook@0.0.14 tsc /home/tim/code/work/cappa/packages/plugins/plugin-storybook
4
+ > tsc
5
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @cappa/plugin-storybook
2
2
 
3
+ ## 0.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - a41a91e: Add fullPage option
8
+ - Updated dependencies [a41a91e]
9
+ - @cappa/core@0.0.15
10
+
3
11
  ## 0.0.14
4
12
 
5
13
  ### Patch Changes
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 | Description | Default |
49
- | ------ | ---------------------------------------------- | --------------- |
50
- | skip | Whether to skip the screenshot | false |
51
- | delay | The delay to wait before taking the screenshot | null (no 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.message
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.message
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.14",
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.14"
33
+ "@cappa/core": "0.0.15"
34
34
  },
35
35
  "devDependencies": {
36
36
  "playwright-core": "^1.55.0",
@@ -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).message,
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;