@cappa/plugin-storybook 0.0.15 → 0.0.16
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 +6 -6
- package/CHANGELOG.md +8 -0
- package/dist/index.js +0 -3
- package/dist/index.mjs +0 -3
- package/dist/preview.mjs +1 -6
- package/package.json +2 -2
- package/src/cappa/plugin.ts +0 -4
- package/src/cappa/util.test.ts +5 -5
- package/src/cappa/util.ts +1 -1
- package/src/tsconfig.json +2 -2
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.15 build /home/tim/code/work/cappa/packages/plugins/plugin-storybook
|
|
4
4
|
> tsup
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
[34mESM[39m Build start
|
|
28
28
|
[32mESM[39m [1mdist/browser.mjs [22m[32m138.00 B[39m
|
|
29
29
|
[32mESM[39m ⚡️ Build success in 6ms
|
|
30
|
-
[
|
|
31
|
-
[32mESM[39m ⚡️ Build success in 9ms
|
|
32
|
-
[32mCJS[39m [1mdist/index.js [22m[32m7.32 KB[39m
|
|
30
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.14 KB[39m
|
|
33
31
|
[32mCJS[39m ⚡️ Build success in 9ms
|
|
34
|
-
[32mESM[39m [1mdist/preview.mjs [22m[32m1.
|
|
32
|
+
[32mESM[39m [1mdist/preview.mjs [22m[32m1.34 KB[39m
|
|
35
33
|
[32mESM[39m ⚡️ Build success in 7ms
|
|
34
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m5.84 KB[39m
|
|
35
|
+
[32mESM[39m ⚡️ Build success in 10ms
|
|
36
36
|
DTS Build start
|
|
37
|
-
DTS ⚡️ Build success in
|
|
37
|
+
DTS ⚡️ Build success in 777ms
|
|
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
|
@@ -57,8 +57,6 @@ var buildFilename = (story) => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// src/cappa/plugin.ts
|
|
60
|
-
var import_path = __toESM(require("path"));
|
|
61
|
-
var import_fs = __toESM(require("fs"));
|
|
62
60
|
function createLatch() {
|
|
63
61
|
let resolve;
|
|
64
62
|
const p = new Promise((r) => resolve = r);
|
|
@@ -145,7 +143,6 @@ var cappaPluginStorybook = (options) => {
|
|
|
145
143
|
await page.waitForTimeout(options2.delay);
|
|
146
144
|
}
|
|
147
145
|
const filename = buildFilename(story);
|
|
148
|
-
import_fs.default.mkdirSync(import_path.default.dirname(filename), { recursive: true });
|
|
149
146
|
const actualFilepath = await screenshotTool.takeScreenshot(page, filename, {
|
|
150
147
|
fullPage: options2.fullPage ?? screenshotOptions.fullPage,
|
|
151
148
|
type: options2.type ?? screenshotOptions.type,
|
package/dist/index.mjs
CHANGED
|
@@ -27,8 +27,6 @@ var buildFilename = (story) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// src/cappa/plugin.ts
|
|
30
|
-
import path from "path";
|
|
31
|
-
import fs from "fs";
|
|
32
30
|
function createLatch() {
|
|
33
31
|
let resolve;
|
|
34
32
|
const p = new Promise((r) => resolve = r);
|
|
@@ -115,7 +113,6 @@ var cappaPluginStorybook = (options) => {
|
|
|
115
113
|
await page.waitForTimeout(options2.delay);
|
|
116
114
|
}
|
|
117
115
|
const filename = buildFilename(story);
|
|
118
|
-
fs.mkdirSync(path.dirname(filename), { recursive: true });
|
|
119
116
|
const actualFilepath = await screenshotTool.takeScreenshot(page, filename, {
|
|
120
117
|
fullPage: options2.fullPage ?? screenshotOptions.fullPage,
|
|
121
118
|
type: options2.type ?? screenshotOptions.type,
|
package/dist/preview.mjs
CHANGED
|
@@ -40,12 +40,7 @@ var withCappaDecorator = makeDecorator({
|
|
|
40
40
|
|
|
41
41
|
// src/storybook/addon/preview.ts
|
|
42
42
|
var decorators = [withCappaDecorator];
|
|
43
|
-
var parameters = {
|
|
44
|
-
layout: "full",
|
|
45
|
-
cappa: {
|
|
46
|
-
enabled: true
|
|
47
|
-
}
|
|
48
|
-
};
|
|
43
|
+
var parameters = {};
|
|
49
44
|
var afterEach = () => {
|
|
50
45
|
window.playAfterEach = true;
|
|
51
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappa/plugin-storybook",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
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.16"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"playwright-core": "^1.55.0",
|
package/src/cappa/plugin.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Plugin, ScreenshotOptions, ScreenshotTool } from "@cappa/core";
|
|
2
2
|
import { buildFilename, freezeUI, waitForVisualIdle } from "./util";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import fs from "fs";
|
|
5
3
|
|
|
6
4
|
export interface StorybookStory {
|
|
7
5
|
id: string;
|
|
@@ -158,8 +156,6 @@ export const cappaPluginStorybook: Plugin<StorybookPluginOptions> = (options) =>
|
|
|
158
156
|
// Take screenshot with story-specific filename
|
|
159
157
|
const filename = buildFilename(story);
|
|
160
158
|
|
|
161
|
-
fs.mkdirSync(path.dirname(filename), { recursive: true });
|
|
162
|
-
|
|
163
159
|
// Actually take the screenshot
|
|
164
160
|
const actualFilepath = await screenshotTool.takeScreenshot(page, filename, {
|
|
165
161
|
fullPage: options.fullPage ?? screenshotOptions.fullPage,
|
package/src/cappa/util.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import { buildFilename } from "./util";
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
3
2
|
import type { StorybookStory } from "./plugin";
|
|
4
|
-
|
|
3
|
+
import { buildFilename } from "./util";
|
|
4
|
+
|
|
5
5
|
describe("buildFilename", () => {
|
|
6
6
|
it("should build a filename for a story", () => {
|
|
7
7
|
const story: StorybookStory = {
|
|
@@ -26,7 +26,7 @@ describe("buildFilename", () => {
|
|
|
26
26
|
story: "Story",
|
|
27
27
|
type: "story",
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
const filename = buildFilename(story);
|
|
31
31
|
expect(filename).toBe("Folder/Story/Primary.jpeg");
|
|
32
32
|
});
|
|
@@ -44,4 +44,4 @@ describe("buildFilename", () => {
|
|
|
44
44
|
const filename = buildFilename(story);
|
|
45
45
|
expect(filename).toBe("Story123/Primary123.jpeg");
|
|
46
46
|
});
|
|
47
|
-
});
|
|
47
|
+
});
|
package/src/cappa/util.ts
CHANGED