storybook-addon-vis 2.0.2 → 2.0.4

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,14 +1,13 @@
1
- import * as vitest_plugin_vis_setup from 'vitest-plugin-vis/setup';
1
+ import * as vitest_plugin_vis_client_api from 'vitest-plugin-vis/client-api';
2
2
  import './matcher.js';
3
3
  export { setAutoSnapshotOptions } from 'vitest-plugin-vis';
4
4
  import { StoryContext } from 'storybook/internal/types';
5
- import 'vitest-plugin-vis/client-api';
6
5
 
7
6
  declare const visAnnotations: {
8
7
  beforeEach(ctx: StoryContext): void;
9
8
  };
10
9
 
11
- declare const vis: vitest_plugin_vis_setup.VisClientConfigurator<{
10
+ declare const vis: vitest_plugin_vis_client_api.VisClientConfigurator<{
12
11
  tags: string[];
13
12
  }>;
14
13
 
@@ -1,5 +1,6 @@
1
1
  import { commands, getCurrentTest, isSnapshotEnabled } from './chunk-UOITZV6D.js';
2
- import { createVis } from 'vitest-plugin-vis/setup';
2
+ import { createVis } from 'vitest-plugin-vis/client-api';
3
+ import 'vitest-plugin-vis/setup';
3
4
  import { setAutoSnapshotOptions } from 'vitest-plugin-vis';
4
5
  export { setAutoSnapshotOptions } from 'vitest-plugin-vis';
5
6
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/preview/vis_annotation.ts","../src/vitest-setup.ts"],"names":[],"mappings":";;;;;AAKO,IAAM,cAAiB,GAAA;AAAA,EAC7B,WAAW,GAAmB,EAAA;AAE7B,IAAA,MAAM,OAAO,cAAe,EAAA;AAC5B,IAAuB,sBAAA,CAAA;AAAA,MACtB,MAAA,EAAQ,iBAAkB,CAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MAClC,GAAG,IAAI,UAAY,EAAA,QAAA;AAAA,MACnB,MAAM,GAAI,CAAA,IAAA;AAAA,MACV,GAAG,MAAM,IAAK,CAAA;AAAA,KACd,CAAA;AAAA;AAEH;;;ACTa,IAAA,GAAA,GAAM,UAA8B,QAAQ","file":"vitest-setup.js","sourcesContent":["import type { ProjectAnnotations, Renderer, StoryContext } from 'storybook/internal/types'\nimport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nimport { isSnapshotEnabled } from '../client/storybook/tags.ts'\nimport { getCurrentTest } from '../client/vitest_proxy.ts'\n\nexport const visAnnotations = {\n\tbeforeEach(ctx: StoryContext) {\n\t\t// console.debug('storbook-addon-vis.preview.beforeEach starts...')\n\t\tconst test = getCurrentTest()\n\t\tsetAutoSnapshotOptions({\n\t\t\tenable: isSnapshotEnabled(ctx.tags),\n\t\t\t...ctx.parameters?.snapshot,\n\t\t\ttags: ctx.tags,\n\t\t\t...test?.meta.vis,\n\t\t})\n\t},\n} satisfies ProjectAnnotations<Renderer>\n","// `storybook-addon-vis/vitest-setup` provides code needed in `vitest.setup.ts`.\nimport './client/storybook/expect_extend.ts'\nimport './shared/global_matcher_augment.ts'\n\nimport { createVis } from 'vitest-plugin-vis/setup'\nimport { commands } from './client/vitest_proxy.ts'\n\nexport const vis = createVis<{ tags: string[] }>(commands)\nexport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nexport { visAnnotations } from './preview/vis_annotation.ts'\n"]}
1
+ {"version":3,"sources":["../src/preview/vis_annotation.ts","../src/vitest-setup.ts"],"names":[],"mappings":";;;;;;AAKO,IAAM,cAAiB,GAAA;AAAA,EAC7B,WAAW,GAAmB,EAAA;AAE7B,IAAA,MAAM,OAAO,cAAe,EAAA;AAC5B,IAAuB,sBAAA,CAAA;AAAA,MACtB,MAAA,EAAQ,iBAAkB,CAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MAClC,GAAG,IAAI,UAAY,EAAA,QAAA;AAAA,MACnB,MAAM,GAAI,CAAA,IAAA;AAAA,MACV,GAAG,MAAM,IAAK,CAAA;AAAA,KACd,CAAA;AAAA;AAEH;;;ACRa,IAAA,GAAA,GAAM,UAA8B,QAAQ","file":"vitest-setup.js","sourcesContent":["import type { ProjectAnnotations, Renderer, StoryContext } from 'storybook/internal/types'\nimport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nimport { isSnapshotEnabled } from '../client/storybook/tags.ts'\nimport { getCurrentTest } from '../client/vitest_proxy.ts'\n\nexport const visAnnotations = {\n\tbeforeEach(ctx: StoryContext) {\n\t\t// console.debug('storbook-addon-vis.preview.beforeEach starts...')\n\t\tconst test = getCurrentTest()\n\t\tsetAutoSnapshotOptions({\n\t\t\tenable: isSnapshotEnabled(ctx.tags),\n\t\t\t...ctx.parameters?.snapshot,\n\t\t\ttags: ctx.tags,\n\t\t\t...test?.meta.vis,\n\t\t})\n\t},\n} satisfies ProjectAnnotations<Renderer>\n","// `storybook-addon-vis/vitest-setup` provides code needed in `vitest.setup.ts`.\nimport './client/storybook/expect_extend.ts'\nimport './shared/global_matcher_augment.ts'\n\nimport { createVis } from 'vitest-plugin-vis/client-api'\nimport 'vitest-plugin-vis/setup' // for Vitest extends\nimport { commands } from './client/vitest_proxy.ts'\n\nexport const vis = createVis<{ tags: string[] }>(commands)\nexport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nexport { visAnnotations } from './preview/vis_annotation.ts'\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-vis",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Storybook Vitest visual testing addon",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -29,8 +29,7 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "types": "./dist/index.d.ts",
32
- "import": "./dist/index.js",
33
- "require": "./dist/index.cjs"
32
+ "import": "./dist/index.js"
34
33
  },
35
34
  "./manager": "./dist/manager.js",
36
35
  "./matcher": {
@@ -63,22 +62,22 @@
63
62
  "memoize": "^10.1.0",
64
63
  "pathe": "^2.0.3",
65
64
  "type-plus": "8.0.0-beta.7",
66
- "vitest-plugin-vis": "^3.2.0"
65
+ "vitest-plugin-vis": "^3.3.0"
67
66
  },
68
67
  "devDependencies": {
69
68
  "@repobuddy/storybook": "^1.0.0",
70
- "@storybook/addon-docs": "^9.0.3",
71
- "@storybook/addon-vitest": "9.0.3",
72
- "@storybook/react-vite": "^9.0.3",
69
+ "@storybook/addon-docs": "^9.0.4",
70
+ "@storybook/addon-vitest": "9.0.4",
71
+ "@storybook/react-vite": "^9.0.4",
73
72
  "@tailwindcss/cli": "^4.1.7",
74
73
  "@tailwindcss/vite": "^4.1.7",
75
74
  "@testing-library/react": "^16.0.1",
76
75
  "@types/react": "^18.2.65",
77
76
  "@types/react-dom": "^18.2.21",
78
77
  "@vitejs/plugin-react": "^4.2.1",
79
- "@vitest/browser": "^3.0.9",
80
- "@vitest/coverage-istanbul": "^3.0.9",
81
- "@vitest/expect": "^3.0.9",
78
+ "@vitest/browser": "^3.1.4",
79
+ "@vitest/coverage-istanbul": "^3.1.4",
80
+ "@vitest/expect": "^3.1.4",
82
81
  "boxen": "^8.0.1",
83
82
  "cross-env": "^7.0.3",
84
83
  "dedent": "^1.5.1",
@@ -86,20 +85,21 @@
86
85
  "playwright": "latest",
87
86
  "react": "^18.2.0",
88
87
  "react-dom": "^18.2.0",
89
- "storybook": "^9.0.3",
88
+ "storybook": "^9.0.4",
90
89
  "storybook-addon-tag-badges": "^2.0.0",
91
90
  "storybook-dark-mode2": "^5.0.2",
92
91
  "tailwindcss": "^4.1.7",
93
92
  "tsup": "^8.3.5",
94
93
  "typescript": "^5.7.2",
95
94
  "vite": "^6.2.3",
96
- "vitest": "^3.0.9",
95
+ "vitest": "^3.1.4",
97
96
  "vitest-browser-react": "^0.2.0",
98
97
  "webdriverio": "latest",
99
98
  "zx": "^8.0.0"
100
99
  },
101
100
  "peerDependencies": {
102
101
  "@vitest/browser": "^2 || ^3",
102
+ "@storybook/addon-vitest": "^9.0.0",
103
103
  "storybook": "^9.0.0",
104
104
  "vitest": "^2 || ^3"
105
105
  },
package/preset.js CHANGED
@@ -1,4 +1 @@
1
- // this file is slightly misleading. It needs to be CJS, and thus in this "type": "module" package it should be named preset.cjs
2
- // but Storybook won't pick that filename up so we have to name it preset.js instead
3
-
4
- module.exports = require('./dist/preset.cjs')
1
+ export * from './dist/preset.cjs'
@@ -2,7 +2,8 @@
2
2
  import './client/storybook/expect_extend.ts'
3
3
  import './shared/global_matcher_augment.ts'
4
4
 
5
- import { createVis } from 'vitest-plugin-vis/setup'
5
+ import { createVis } from 'vitest-plugin-vis/client-api'
6
+ import 'vitest-plugin-vis/setup' // for Vitest extends
6
7
  import { commands } from './client/vitest_proxy.ts'
7
8
 
8
9
  export const vis = createVis<{ tags: string[] }>(commands)