@cappa/plugin-storybook 0.2.6 → 0.3.1
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 +22 -17
- package/CHANGELOG.md +12 -0
- package/dist/{index.mjs → index.cjs} +49 -18
- package/dist/index.js +17 -50
- package/package.json +22 -13
- package/src/{index.ts → index.cjs.ts} +2 -3
- package/src/index.esm.ts +7 -0
- package/tsup.config.ts +11 -3
- package/dist/index.d.mts +0 -81
- /package/dist/{browser.mjs → browser.js} +0 -0
- /package/dist/{preview.mjs → preview.js} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
|
|
2
|
-
> @cappa/plugin-storybook@0.
|
|
2
|
+
> @cappa/plugin-storybook@0.3.1 build /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
5
|
+
[34mCLI[39m Building entry: {"index":"src/index.esm.ts"}
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m Building entry: {"index":"src/index.cjs.ts"}
|
|
6
8
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
9
|
[34mCLI[39m tsup v8.5.0
|
|
8
10
|
[34mCLI[39m Using tsup config: /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook/tsup.config.ts
|
|
9
|
-
[34mCLI[39m Building entry: src/storybook/addon/browser.ts
|
|
10
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
11
11
|
[34mCLI[39m tsup v8.5.0
|
|
12
12
|
[34mCLI[39m Using tsup config: /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook/tsup.config.ts
|
|
13
13
|
[34mCLI[39m Building entry: src/storybook/addon/preview.ts
|
|
14
14
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
15
15
|
[34mCLI[39m tsup v8.5.0
|
|
16
16
|
[34mCLI[39m Using tsup config: /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook/tsup.config.ts
|
|
17
|
+
[34mCLI[39m Building entry: src/storybook/addon/browser.ts
|
|
18
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
19
|
+
[34mCLI[39m tsup v8.5.0
|
|
20
|
+
[34mCLI[39m Using tsup config: /home/runner/work/cappa/cappa/packages/plugins/plugin-storybook/tsup.config.ts
|
|
21
|
+
[34mCLI[39m Target: esnext
|
|
17
22
|
[34mCLI[39m Target: esnext
|
|
18
|
-
[34mCLI[39m Target: es2015
|
|
19
23
|
[34mCLI[39m Target: node16
|
|
24
|
+
[34mCLI[39m Target: es2015
|
|
20
25
|
[34mCLI[39m Cleaning output folder
|
|
21
|
-
[34mCJS[39m Build start
|
|
22
26
|
[34mESM[39m Build start
|
|
23
27
|
[34mCLI[39m Cleaning output folder
|
|
28
|
+
[34mCJS[39m Build start
|
|
29
|
+
[34mCLI[39m Cleaning output folder
|
|
24
30
|
[34mESM[39m Build start
|
|
25
31
|
[34mCLI[39m Cleaning output folder
|
|
26
32
|
[34mESM[39m Build start
|
|
27
|
-
[32mESM[39m [1mdist/
|
|
28
|
-
[32mESM[39m ⚡️ Build success in
|
|
29
|
-
[32mESM[39m [1mdist/
|
|
30
|
-
[32mESM[39m ⚡️ Build success in
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
33
|
+
[32mESM[39m [1mdist/preview.js [22m[32m1.41 KB[39m
|
|
34
|
+
[32mESM[39m ⚡️ Build success in 36ms
|
|
35
|
+
[32mESM[39m [1mdist/browser.js [22m[32m138.00 B[39m
|
|
36
|
+
[32mESM[39m ⚡️ Build success in 34ms
|
|
37
|
+
[32mESM[39m [1mdist/index.js [22m[32m12.25 KB[39m
|
|
38
|
+
[32mESM[39m ⚡️ Build success in 42ms
|
|
39
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m13.98 KB[39m
|
|
40
|
+
[32mCJS[39m ⚡️ Build success in 48ms
|
|
35
41
|
[34mDTS[39m Build start
|
|
36
|
-
[32mDTS[39m ⚡️ Build success in
|
|
37
|
-
[32mDTS[39m [1mdist/index.d.ts
|
|
38
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m2.63 KB[39m
|
|
42
|
+
[32mDTS[39m ⚡️ Build success in 3692ms
|
|
43
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.63 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.cjs.ts
|
|
31
|
+
var index_cjs_exports = {};
|
|
32
|
+
__export(index_cjs_exports, {
|
|
33
|
+
cappaPluginStorybook: () => cappaPluginStorybook,
|
|
34
|
+
previewAnnotations: () => previewAnnotations
|
|
6
35
|
});
|
|
36
|
+
module.exports = __toCommonJS(index_cjs_exports);
|
|
7
37
|
|
|
8
38
|
// src/cappa/plugin.ts
|
|
9
|
-
|
|
10
|
-
|
|
39
|
+
var import_logger = require("@cappa/logger");
|
|
40
|
+
var import_minimatch = require("minimatch");
|
|
11
41
|
|
|
12
42
|
// src/cappa/storybook-url.ts
|
|
13
43
|
function encodePairs(obj) {
|
|
@@ -121,7 +151,7 @@ var buildFilename = (story) => {
|
|
|
121
151
|
|
|
122
152
|
// src/cappa/plugin.ts
|
|
123
153
|
async function waitForPlayFunctionCompletion(page, storyName) {
|
|
124
|
-
const logger = getLogger();
|
|
154
|
+
const logger = (0, import_logger.getLogger)();
|
|
125
155
|
try {
|
|
126
156
|
const hasPlayFunction = await page.evaluate(
|
|
127
157
|
() => window.__cappa_has_play_function === true
|
|
@@ -149,17 +179,17 @@ async function waitForPlayFunctionCompletion(page, storyName) {
|
|
|
149
179
|
}
|
|
150
180
|
function matchesGlobPatterns(story, patterns) {
|
|
151
181
|
return patterns.some((pattern) => {
|
|
152
|
-
if (minimatch(story.id, pattern)) {
|
|
182
|
+
if ((0, import_minimatch.minimatch)(story.id, pattern)) {
|
|
153
183
|
return true;
|
|
154
184
|
}
|
|
155
|
-
if (minimatch(story.title, pattern)) {
|
|
185
|
+
if ((0, import_minimatch.minimatch)(story.title, pattern)) {
|
|
156
186
|
return true;
|
|
157
187
|
}
|
|
158
|
-
if (minimatch(story.name, pattern)) {
|
|
188
|
+
if ((0, import_minimatch.minimatch)(story.name, pattern)) {
|
|
159
189
|
return true;
|
|
160
190
|
}
|
|
161
191
|
const fullPath = `${story.title}/${story.name}`;
|
|
162
|
-
if (minimatch(fullPath, pattern)) {
|
|
192
|
+
if ((0, import_minimatch.minimatch)(fullPath, pattern)) {
|
|
163
193
|
return true;
|
|
164
194
|
}
|
|
165
195
|
return false;
|
|
@@ -181,7 +211,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
181
211
|
if (!options.storybookUrl) {
|
|
182
212
|
throw new Error("storybookUrl is required");
|
|
183
213
|
}
|
|
184
|
-
const logger = getLogger();
|
|
214
|
+
const logger = (0, import_logger.getLogger)();
|
|
185
215
|
const {
|
|
186
216
|
storybookUrl,
|
|
187
217
|
includeStories = [],
|
|
@@ -239,7 +269,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
239
269
|
execute: async (task, page, screenshotTool, context) => {
|
|
240
270
|
const { url, data } = task;
|
|
241
271
|
const { story } = data;
|
|
242
|
-
const logger = getLogger();
|
|
272
|
+
const logger = (0, import_logger.getLogger)();
|
|
243
273
|
const { storybook: defaultStorybookOptions } = options || {};
|
|
244
274
|
try {
|
|
245
275
|
const currentLatch = createLatch();
|
|
@@ -375,9 +405,10 @@ var cappaPluginStorybook = (options) => {
|
|
|
375
405
|
};
|
|
376
406
|
};
|
|
377
407
|
|
|
378
|
-
// src/index.ts
|
|
379
|
-
var previewAnnotations = [
|
|
380
|
-
export
|
|
408
|
+
// src/index.cjs.ts
|
|
409
|
+
var previewAnnotations = [require.resolve("./preview.js")];
|
|
410
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
411
|
+
0 && (module.exports = {
|
|
381
412
|
cappaPluginStorybook,
|
|
382
413
|
previewAnnotations
|
|
383
|
-
};
|
|
414
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
cappaPluginStorybook: () => cappaPluginStorybook,
|
|
34
|
-
previewAnnotations: () => previewAnnotations
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(index_exports);
|
|
1
|
+
// src/index.esm.ts
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
37
3
|
|
|
38
4
|
// src/cappa/plugin.ts
|
|
39
|
-
|
|
40
|
-
|
|
5
|
+
import { getLogger } from "@cappa/logger";
|
|
6
|
+
import { minimatch } from "minimatch";
|
|
41
7
|
|
|
42
8
|
// src/cappa/storybook-url.ts
|
|
43
9
|
function encodePairs(obj) {
|
|
@@ -151,7 +117,7 @@ var buildFilename = (story) => {
|
|
|
151
117
|
|
|
152
118
|
// src/cappa/plugin.ts
|
|
153
119
|
async function waitForPlayFunctionCompletion(page, storyName) {
|
|
154
|
-
const logger =
|
|
120
|
+
const logger = getLogger();
|
|
155
121
|
try {
|
|
156
122
|
const hasPlayFunction = await page.evaluate(
|
|
157
123
|
() => window.__cappa_has_play_function === true
|
|
@@ -179,17 +145,17 @@ async function waitForPlayFunctionCompletion(page, storyName) {
|
|
|
179
145
|
}
|
|
180
146
|
function matchesGlobPatterns(story, patterns) {
|
|
181
147
|
return patterns.some((pattern) => {
|
|
182
|
-
if (
|
|
148
|
+
if (minimatch(story.id, pattern)) {
|
|
183
149
|
return true;
|
|
184
150
|
}
|
|
185
|
-
if (
|
|
151
|
+
if (minimatch(story.title, pattern)) {
|
|
186
152
|
return true;
|
|
187
153
|
}
|
|
188
|
-
if (
|
|
154
|
+
if (minimatch(story.name, pattern)) {
|
|
189
155
|
return true;
|
|
190
156
|
}
|
|
191
157
|
const fullPath = `${story.title}/${story.name}`;
|
|
192
|
-
if (
|
|
158
|
+
if (minimatch(fullPath, pattern)) {
|
|
193
159
|
return true;
|
|
194
160
|
}
|
|
195
161
|
return false;
|
|
@@ -211,7 +177,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
211
177
|
if (!options.storybookUrl) {
|
|
212
178
|
throw new Error("storybookUrl is required");
|
|
213
179
|
}
|
|
214
|
-
const logger =
|
|
180
|
+
const logger = getLogger();
|
|
215
181
|
const {
|
|
216
182
|
storybookUrl,
|
|
217
183
|
includeStories = [],
|
|
@@ -269,7 +235,7 @@ var cappaPluginStorybook = (options) => {
|
|
|
269
235
|
execute: async (task, page, screenshotTool, context) => {
|
|
270
236
|
const { url, data } = task;
|
|
271
237
|
const { story } = data;
|
|
272
|
-
const logger =
|
|
238
|
+
const logger = getLogger();
|
|
273
239
|
const { storybook: defaultStorybookOptions } = options || {};
|
|
274
240
|
try {
|
|
275
241
|
const currentLatch = createLatch();
|
|
@@ -405,10 +371,11 @@ var cappaPluginStorybook = (options) => {
|
|
|
405
371
|
};
|
|
406
372
|
};
|
|
407
373
|
|
|
408
|
-
// src/index.ts
|
|
409
|
-
var previewAnnotations = [
|
|
410
|
-
|
|
411
|
-
|
|
374
|
+
// src/index.esm.ts
|
|
375
|
+
var previewAnnotations = [
|
|
376
|
+
fileURLToPath(new URL("./preview.js", import.meta.url))
|
|
377
|
+
];
|
|
378
|
+
export {
|
|
412
379
|
cappaPluginStorybook,
|
|
413
380
|
previewAnnotations
|
|
414
|
-
}
|
|
381
|
+
};
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappa/plugin-storybook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Storybook plugin for Cappa - takes screenshots of Storybook stories",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"main": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"module": "CommonJS",
|
|
11
8
|
"license": "MIT",
|
|
12
9
|
"author": "Tim Richter",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.cjs",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
13
14
|
"exports": {
|
|
14
15
|
".": {
|
|
15
|
-
"
|
|
16
|
-
"require": "./dist/index.
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"require": "./dist/index.cjs",
|
|
18
|
+
"import": "./dist/index.js"
|
|
17
19
|
},
|
|
18
20
|
"./browser": {
|
|
19
|
-
"
|
|
20
|
-
"require": "./dist/browser.mjs"
|
|
21
|
+
"default": "./dist/browser.js"
|
|
21
22
|
},
|
|
22
23
|
"./package.json": "./package.json"
|
|
23
24
|
},
|
|
@@ -27,21 +28,29 @@
|
|
|
27
28
|
"storybook",
|
|
28
29
|
"visual-testing"
|
|
29
30
|
],
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"storybook": "^9 || ^10"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"storybook": {
|
|
36
|
+
"optional": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
30
39
|
"dependencies": {
|
|
31
|
-
"@swc/core": "^1.
|
|
40
|
+
"@swc/core": "^1.14.0",
|
|
32
41
|
"chalk": "^5.6.2",
|
|
33
|
-
"minimatch": "^10.
|
|
34
|
-
"storybook": "^9.1.12",
|
|
42
|
+
"minimatch": "^10.1.1",
|
|
35
43
|
"@cappa/core": "0.3.0",
|
|
36
44
|
"@cappa/logger": "0.0.4"
|
|
37
45
|
},
|
|
38
46
|
"devDependencies": {
|
|
39
47
|
"@vitest/coverage-v8": "3.2.4",
|
|
40
48
|
"@vitest/ui": "3.2.4",
|
|
41
|
-
"playwright-core": "^1.56.
|
|
49
|
+
"playwright-core": "^1.56.1",
|
|
42
50
|
"tsup": "8.5.0",
|
|
43
51
|
"typescript": "5.9.3",
|
|
44
|
-
"vitest": "3.2.4"
|
|
52
|
+
"vitest": "3.2.4",
|
|
53
|
+
"storybook": "^10.0.2"
|
|
45
54
|
},
|
|
46
55
|
"scripts": {
|
|
47
56
|
"test": "vitest",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
export const previewAnnotations = [require.resolve("./preview.mjs")];
|
|
1
|
+
export const previewAnnotations = [require.resolve("./preview.js")];
|
|
4
2
|
|
|
3
|
+
export { cappaPluginStorybook } from "./cappa/plugin";
|
|
5
4
|
export type { ScreenshotOptionsStorybook as CappaStorybookOptions } from "./types";
|
package/src/index.esm.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
export const previewAnnotations = [
|
|
3
|
+
fileURLToPath(new URL("./preview.js", import.meta.url)),
|
|
4
|
+
];
|
|
5
|
+
|
|
6
|
+
export { cappaPluginStorybook } from "./cappa/plugin";
|
|
7
|
+
export type { ScreenshotOptionsStorybook as CappaStorybookOptions } from "./types";
|
package/tsup.config.ts
CHANGED
|
@@ -2,11 +2,19 @@ import { defineConfig } from "tsup";
|
|
|
2
2
|
|
|
3
3
|
export default defineConfig([
|
|
4
4
|
{
|
|
5
|
-
entry:
|
|
6
|
-
format: ["
|
|
5
|
+
entry: { index: "src/index.esm.ts" },
|
|
6
|
+
format: ["esm"],
|
|
7
7
|
dts: true,
|
|
8
8
|
splitting: false,
|
|
9
|
-
external: ["./preview.
|
|
9
|
+
external: ["./preview.js"],
|
|
10
|
+
sourcemap: false,
|
|
11
|
+
clean: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
entry: { index: "src/index.cjs.ts" },
|
|
15
|
+
format: ["cjs"],
|
|
16
|
+
splitting: false,
|
|
17
|
+
external: ["./preview.js"],
|
|
10
18
|
sourcemap: false,
|
|
11
19
|
clean: true,
|
|
12
20
|
},
|
package/dist/index.d.mts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@cappa/core';
|
|
2
|
-
|
|
3
|
-
interface StorybookRenderOptions {
|
|
4
|
-
viewMode?: "story" | "docs";
|
|
5
|
-
args?: Record<string, unknown>;
|
|
6
|
-
globals?: Record<string, string | number | boolean>;
|
|
7
|
-
query?: Record<string, string | number | boolean>;
|
|
8
|
-
fullscreen?: boolean;
|
|
9
|
-
singleStory?: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface ScreenshotVariantOverrideStorybook {
|
|
12
|
-
fullPage?: boolean;
|
|
13
|
-
delay?: number;
|
|
14
|
-
skip?: boolean;
|
|
15
|
-
mask?: string[];
|
|
16
|
-
omitBackground?: boolean;
|
|
17
|
-
viewport?: {
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
};
|
|
21
|
-
args?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
interface ScreenshotVariantOptionsStorybook {
|
|
24
|
-
id: string;
|
|
25
|
-
label?: string;
|
|
26
|
-
filename?: string;
|
|
27
|
-
options?: ScreenshotVariantOverrideStorybook;
|
|
28
|
-
}
|
|
29
|
-
interface ScreenshotOptionsStorybook extends ScreenshotVariantOverrideStorybook {
|
|
30
|
-
variants?: ScreenshotVariantOptionsStorybook[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface StorybookPluginOptions {
|
|
34
|
-
storybookUrl: string;
|
|
35
|
-
/**
|
|
36
|
-
* Array of glob patterns to include stories. Stories matching any of these patterns will be included.
|
|
37
|
-
* Patterns can match against:
|
|
38
|
-
* - Story ID (e.g., "button--primary")
|
|
39
|
-
* - Story title (e.g., "Button")
|
|
40
|
-
* - Story name (e.g., "Primary")
|
|
41
|
-
* - Full story path (e.g., "Button/Primary")
|
|
42
|
-
*
|
|
43
|
-
* Examples:
|
|
44
|
-
* - ["button--*"] - Include all button stories
|
|
45
|
-
* - ["*--primary"] - Include all primary stories
|
|
46
|
-
* - ["Button/*"] - Include all stories under Button title
|
|
47
|
-
* - ["*--*"] - Include all stories
|
|
48
|
-
*/
|
|
49
|
-
includeStories?: string[];
|
|
50
|
-
/**
|
|
51
|
-
* Array of glob patterns to exclude stories. Stories matching any of these patterns will be excluded.
|
|
52
|
-
* Patterns can match against:
|
|
53
|
-
* - Story ID (e.g., "button--primary")
|
|
54
|
-
* - Story title (e.g., "Button")
|
|
55
|
-
* - Story name (e.g., "Primary")
|
|
56
|
-
* - Full story path (e.g., "Button/Primary")
|
|
57
|
-
*
|
|
58
|
-
* Examples:
|
|
59
|
-
* - ["button--*"] - Exclude all button stories
|
|
60
|
-
* - ["*--secondary"] - Exclude all secondary stories
|
|
61
|
-
* - ["Input/*"] - Exclude all stories under Input title
|
|
62
|
-
*/
|
|
63
|
-
excludeStories?: string[];
|
|
64
|
-
defaultViewport?: {
|
|
65
|
-
width: number;
|
|
66
|
-
height: number;
|
|
67
|
-
};
|
|
68
|
-
waitForSelector?: string;
|
|
69
|
-
waitForTimeout?: number;
|
|
70
|
-
storybook?: StorybookRenderOptions;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Storybook Plugin for Cappa
|
|
74
|
-
* Fetches stories from a running Storybook server and takes screenshots of each story.
|
|
75
|
-
* Supports glob pattern matching for includeStories and excludeStories options.
|
|
76
|
-
*/
|
|
77
|
-
declare const cappaPluginStorybook: Plugin<StorybookPluginOptions>;
|
|
78
|
-
|
|
79
|
-
declare const previewAnnotations: string[];
|
|
80
|
-
|
|
81
|
-
export { type ScreenshotOptionsStorybook as CappaStorybookOptions, cappaPluginStorybook, previewAnnotations };
|
|
File without changes
|
|
File without changes
|