@snapvisor/storybook 6.1.8 → 7.0.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/LICENSE CHANGED
@@ -1,8 +1,8 @@
1
- Copyright 2026 Devino Solutions Inc. (Snapvisor modifications)
2
- Copyright 2022 Smooth Code
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
-
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2026 Devino Solutions Inc. (Snapvisor modifications)
2
+ Copyright 2022 Smooth Code
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,66 +1,66 @@
1
- <p align="center">
2
- <a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
3
- <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-dark.png">
5
- <img alt="Argos" src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-light.png" width="360" height="70">
6
- </picture>
7
- </a>
8
- </p>
9
-
10
- <p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
11
-
12
- # Official Argos Storybook integration
13
-
14
- [![npm version](https://img.shields.io/npm/v/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
15
- [![npm dm](https://img.shields.io/npm/dm/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
16
- [![npm dt](https://img.shields.io/npm/dt/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
17
-
18
- Capture and review visual changes of your [Storybook](https://storybook.js.org/) stories with Argos. It runs your stories in a real browser and uploads a screenshot of each one to Argos in your CI.
19
-
20
- Visit the [Storybook SDK documentation](https://argos-ci.com/docs/reference/storybook) for guides, the API reference, and more.
21
-
22
- ## Installation
23
-
24
- ```sh
25
- npm install --save-dev @snapvisor/storybook
26
- ```
27
-
28
- ## Usage
29
-
30
- The recommended way to run visual tests is with the [Storybook Vitest addon](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon). Register the Argos plugin in your Vitest config:
31
-
32
- ```ts
33
- // vitest.config.ts
34
- import { defineConfig } from "vitest/config";
35
- import { argosVitestPlugin } from "@snapvisor/storybook/vitest-plugin";
36
-
37
- export default defineConfig({
38
- plugins: [
39
- argosVitestPlugin({
40
- // Upload the screenshots to Argos only on CI.
41
- uploadToArgos: process.env.CI === "true",
42
- }),
43
- ],
44
- });
45
- ```
46
-
47
- A screenshot is captured for every story automatically. To capture additional screenshots (for example, at different steps of an interaction), call `argosScreenshot` inside a story's `play` function:
48
-
49
- ```ts
50
- // Button.stories.tsx
51
- import { argosScreenshot } from "@snapvisor/storybook/vitest";
52
-
53
- export const Example: Story = {
54
- play: async (ctx) => {
55
- await argosScreenshot(ctx, "example");
56
- },
57
- };
58
- ```
59
-
60
- > Using the [Storybook Test Runner](https://storybook.js.org/docs/writing-tests/integrations/test-runner) instead? Import `argosScreenshot` from `@snapvisor/storybook/test-runner` and call it from the `postVisit` hook. See the [Test Runner quickstart](https://argos-ci.com/docs/quickstart/storybook-quickstart/storybook-test-runner-quickstart).
61
-
62
- ## Links
63
-
64
- - [Official SDK Docs](https://argos-ci.com/docs/reference/storybook)
65
- - [Quickstart](https://argos-ci.com/docs/quickstart/storybook-quickstart)
66
- - [Discord](https://argos-ci.com/discord)
1
+ <p align="center">
2
+ <a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-dark.png">
5
+ <img alt="Argos" src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-light.png" width="360" height="70">
6
+ </picture>
7
+ </a>
8
+ </p>
9
+
10
+ <p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
11
+
12
+ # Official Argos Storybook integration
13
+
14
+ [![npm version](https://img.shields.io/npm/v/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
15
+ [![npm dm](https://img.shields.io/npm/dm/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
16
+ [![npm dt](https://img.shields.io/npm/dt/@snapvisor/storybook.svg)](https://www.npmjs.com/package/@snapvisor/storybook)
17
+
18
+ Capture and review visual changes of your [Storybook](https://storybook.js.org/) stories with Argos. It runs your stories in a real browser and uploads a screenshot of each one to Argos in your CI.
19
+
20
+ Visit the [Storybook SDK documentation](https://argos-ci.com/docs/reference/storybook) for guides, the API reference, and more.
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ npm install --save-dev @snapvisor/storybook
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ The recommended way to run visual tests is with the [Storybook Vitest addon](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon). Register the Argos plugin in your Vitest config:
31
+
32
+ ```ts
33
+ // vitest.config.ts
34
+ import { defineConfig } from "vitest/config";
35
+ import { argosVitestPlugin } from "@snapvisor/storybook/vitest-plugin";
36
+
37
+ export default defineConfig({
38
+ plugins: [
39
+ argosVitestPlugin({
40
+ // Upload the screenshots to Argos only on CI.
41
+ uploadToArgos: process.env.CI === "true",
42
+ }),
43
+ ],
44
+ });
45
+ ```
46
+
47
+ A screenshot is captured for every story automatically. To capture additional screenshots (for example, at different steps of an interaction), call `argosScreenshot` inside a story's `play` function:
48
+
49
+ ```ts
50
+ // Button.stories.tsx
51
+ import { argosScreenshot } from "@snapvisor/storybook/vitest";
52
+
53
+ export const Example: Story = {
54
+ play: async (ctx) => {
55
+ await argosScreenshot(ctx, "example");
56
+ },
57
+ };
58
+ ```
59
+
60
+ > Using the [Storybook Test Runner](https://storybook.js.org/docs/writing-tests/integrations/test-runner) instead? Import `argosScreenshot` from `@snapvisor/storybook/test-runner` and call it from the `postVisit` hook. See the [Test Runner quickstart](https://argos-ci.com/docs/quickstart/storybook-quickstart/storybook-test-runner-quickstart).
61
+
62
+ ## Links
63
+
64
+ - [Official SDK Docs](https://argos-ci.com/docs/reference/storybook)
65
+ - [Quickstart](https://argos-ci.com/docs/quickstart/storybook-quickstart)
66
+ - [Discord](https://argos-ci.com/discord)
@@ -1,5 +1,5 @@
1
- const argosScreenshot = async (...args) => {
2
- const { argosScreenshot } = await import("./test-runner.mjs");
3
- return argosScreenshot(...args);
4
- };
5
- exports.argosScreenshot = argosScreenshot;
1
+ const argosScreenshot = async (...args) => {
2
+ const { argosScreenshot } = await import("./test-runner.mjs");
3
+ return argosScreenshot(...args);
4
+ };
5
+ exports.argosScreenshot = argosScreenshot;
@@ -17,7 +17,7 @@ type FitToContent = {
17
17
  zoom: number;
18
18
  };
19
19
  /**
20
- * Argos parameters in Storybook.
20
+ * Snapvisor parameters in Storybook.
21
21
  */
22
22
  interface ArgosStorybookParameters {
23
23
  /**
@@ -5,7 +5,7 @@ import { readVersionFromPackage } from "@snapvisor/util";
5
5
  //#region src/utils/metadata.ts
6
6
  const require = createRequire(import.meta.url);
7
7
  /**
8
- * Get the version of the Argos Playwright SDK.
8
+ * Get the version of the Snapvisor Playwright SDK.
9
9
  */
10
10
  async function getArgosStorybookVersion() {
11
11
  return readVersionFromPackage(require.resolve("@snapvisor/storybook/package.json"));
@@ -74,7 +74,7 @@ function getViewport(parameters, viewportName) {
74
74
  return null;
75
75
  }
76
76
  /**
77
- * Get the Argos parameters from the Storybook context.
77
+ * Get the Snapvisor parameters from the Storybook context.
78
78
  */
79
79
  function getArgosParameters(parameters) {
80
80
  if ("argos" in parameters && parameters.argos && typeof parameters.argos === "object") return parameters.argos;
@@ -104,10 +104,10 @@ function getFitToContentFromParameters(parameters) {
104
104
  async function storybookArgosScreenshot(handler, context, options) {
105
105
  const argosOptions = {
106
106
  ...options,
107
- stabilize: options?.stabilize ?? {
107
+ stabilize: typeof options?.stabilize === "object" ? {
108
108
  waitForAriaBusy: false,
109
- ...typeof options?.stabilize === "object" ? options.stabilize : {}
110
- }
109
+ ...options.stabilize
110
+ } : options?.stabilize ?? { waitForAriaBusy: false }
111
111
  };
112
112
  const version = await getArgosStorybookVersion();
113
113
  const storyUrl = `http://localhost:6006/?path=/story/${context.story.id}`;
@@ -40,13 +40,13 @@ type ArgosScreenshotOptions = Omit<ArgosScreenshotOptions$1, "viewports">;
40
40
  type ArgosScreenshotCommandArgs = [Pick<StorybookScreenshotContext<Frame>, "name" | "story" | "test" | "mode">];
41
41
  interface ArgosVitestPluginOptions extends ArgosReporterConfig, ArgosScreenshotOptions {
42
42
  /**
43
- * Upload the report to Argos.
44
- * @default true
43
+ * Upload the report to Snapvisor.
44
+ * @default false
45
45
  */
46
46
  uploadToArgos?: boolean;
47
47
  }
48
48
  /**
49
- * Create a command for taking Argos screenshots in Vitest.
49
+ * Create a command for taking Snapvisor screenshots in Vitest.
50
50
  */
51
51
  declare const createArgosScreenshotCommand: (pluginOptions?: ArgosVitestPluginOptions) => BrowserCommand<ArgosScreenshotCommandArgs>;
52
52
  declare function argosVitestPlugin(options?: ArgosVitestPluginOptions): Plugin;
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
  //#region src/utils/metadata.ts
9
9
  const require = createRequire(import.meta.url);
10
10
  /**
11
- * Get the version of the Argos Playwright SDK.
11
+ * Get the version of the Snapvisor Playwright SDK.
12
12
  */
13
13
  async function getArgosStorybookVersion() {
14
14
  return readVersionFromPackage(require.resolve("@snapvisor/storybook/package.json"));
@@ -61,7 +61,7 @@ function getViewport(parameters, viewportName) {
61
61
  return null;
62
62
  }
63
63
  /**
64
- * Get the Argos parameters from the Storybook context.
64
+ * Get the Snapvisor parameters from the Storybook context.
65
65
  */
66
66
  function getArgosParameters(parameters) {
67
67
  if ("argos" in parameters && parameters.argos && typeof parameters.argos === "object") return parameters.argos;
@@ -91,10 +91,10 @@ function getFitToContentFromParameters(parameters) {
91
91
  async function storybookArgosScreenshot(handler, context, options) {
92
92
  const argosOptions = {
93
93
  ...options,
94
- stabilize: options?.stabilize ?? {
94
+ stabilize: typeof options?.stabilize === "object" ? {
95
95
  waitForAriaBusy: false,
96
- ...typeof options?.stabilize === "object" ? options.stabilize : {}
97
- }
96
+ ...options.stabilize
97
+ } : options?.stabilize ?? { waitForAriaBusy: false }
98
98
  };
99
99
  const version = await getArgosStorybookVersion();
100
100
  const storyUrl = `http://localhost:6006/?path=/story/${context.story.id}`;
@@ -243,7 +243,7 @@ function composeName(name, suffix) {
243
243
  //#endregion
244
244
  //#region src/vitest-plugin.ts
245
245
  /**
246
- * Create a command for taking Argos screenshots in Vitest.
246
+ * Create a command for taking Snapvisor screenshots in Vitest.
247
247
  */
248
248
  const createArgosScreenshotCommand = (pluginOptions) => {
249
249
  const screenshotOptions = pluginOptions ?? {};
@@ -19,7 +19,7 @@ function hasPlay(storyContext) {
19
19
  //#endregion
20
20
  //#region src/vitest.ts
21
21
  /**
22
- * Setup Argos hooks for Vitest.
22
+ * Setup Snapvisor hooks for Vitest.
23
23
  */
24
24
  function setupArgos(api) {
25
25
  api.afterEach(async (ctx) => {
package/dist/vitest.d.mts CHANGED
@@ -43,13 +43,13 @@ declare module "vitest/browser" {
43
43
  }
44
44
  }
45
45
  /**
46
- * Setup Argos hooks for Vitest.
46
+ * Setup Snapvisor hooks for Vitest.
47
47
  */
48
48
  declare function setupArgos(api: {
49
49
  afterEach: typeof vitest.afterEach;
50
50
  }): void;
51
51
  /**
52
- * Take an Argos screenshot of a story in Vitest.
52
+ * Take an Snapvisor screenshot of a story in Vitest.
53
53
  */
54
54
  declare function argosScreenshot(story: {
55
55
  parameters: Record<string, any>;
package/dist/vitest.mjs CHANGED
@@ -18,7 +18,7 @@ function hasPlay(storyContext) {
18
18
  //#endregion
19
19
  //#region src/vitest.ts
20
20
  /**
21
- * Setup Argos hooks for Vitest.
21
+ * Setup Snapvisor hooks for Vitest.
22
22
  */
23
23
  function setupArgos(api) {
24
24
  api.afterEach(async (ctx) => {
@@ -50,7 +50,7 @@ function setupArgos(api) {
50
50
  });
51
51
  }
52
52
  /**
53
- * Take an Argos screenshot of a story in Vitest.
53
+ * Take an Snapvisor screenshot of a story in Vitest.
54
54
  */
55
55
  async function argosScreenshot(story, name) {
56
56
  if (!await checkIsVitestEnv()) return;
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@snapvisor/storybook",
3
3
  "description": "Visual testing for Storybook test runner.",
4
- "version": "6.1.8",
4
+ "version": "7.0.1",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/argos-ci/argos-javascript.git",
9
+ "url": "git+https://github.com/DevinoSolutions/snapvisor-js.git",
10
10
  "directory": "packages/storybook"
11
11
  },
12
- "homepage": "https://argos-ci.com/docs/reference/storybook",
12
+ "homepage": "https://snapvisor.io/docs",
13
13
  "keywords": [
14
14
  "storybook",
15
15
  "storybook-addon",
@@ -49,13 +49,13 @@
49
49
  "node": ">=22.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@snapvisor/core": "6.6.2",
53
- "@snapvisor/playwright": "7.3.7",
54
- "@snapvisor/util": "4.0.4",
55
- "@snapvisor/vitest": "0.3.2"
52
+ "@snapvisor/core": "7.0.0",
53
+ "@snapvisor/playwright": "8.0.0",
54
+ "@snapvisor/util": "5.0.0",
55
+ "@snapvisor/vitest": "0.4.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@snapvisor/cli": "6.4.1",
58
+ "@snapvisor/cli": "7.0.0",
59
59
  "@snapvisor/util": "workspace:*",
60
60
  "@storybook/addon-docs": "^10.4.6",
61
61
  "@storybook/addon-links": "^10.4.6",
@@ -100,5 +100,5 @@
100
100
  "check-format": "prettier --check --ignore-unknown --ignore-path=./.gitignore --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
101
101
  "lint": "eslint ."
102
102
  },
103
- "gitHead": "7c74326b53f6f513ac4087385b88e8fbd7e92eac"
103
+ "gitHead": "c755c5695739eb6f453969ea02babb317425ba45"
104
104
  }