@storybook/addon-vitest 10.1.0-alpha.11 → 10.1.0-alpha.13

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/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
1
+ import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,11 +12,10 @@ var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.createRequire(import.meta.url);
12
12
  import {
13
13
  log,
14
14
  noop
15
- } from "./_node-chunks/chunk-2WX72TIY.js";
15
+ } from "./_node-chunks/chunk-XHF2DJDH.js";
16
16
  import {
17
- execaNode,
18
17
  importMetaResolve
19
- } from "./_node-chunks/chunk-BEGZGAUW.js";
18
+ } from "./_node-chunks/chunk-HKZ24UC3.js";
20
19
  import {
21
20
  ADDON_ID,
22
21
  COVERAGE_DIRECTORY,
@@ -25,16 +24,19 @@ import {
25
24
  STORYBOOK_ADDON_TEST_CHANNEL,
26
25
  TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
27
26
  storeOptions
28
- } from "./_node-chunks/chunk-TCQNKRGF.js";
27
+ } from "./_node-chunks/chunk-FJKQJ53U.js";
29
28
  import {
30
29
  require_picocolors
31
- } from "./_node-chunks/chunk-XN666246.js";
30
+ } from "./_node-chunks/chunk-NT7JGKSQ.js";
31
+ import {
32
+ require_dist
33
+ } from "./_node-chunks/chunk-IZMDFVYT.js";
32
34
  import {
33
35
  normalize
34
- } from "./_node-chunks/chunk-L7WYCUSW.js";
36
+ } from "./_node-chunks/chunk-F3U6JEPX.js";
35
37
  import {
36
38
  __toESM
37
- } from "./_node-chunks/chunk-FCFZB5YS.js";
39
+ } from "./_node-chunks/chunk-6K4PB6ZM.js";
38
40
 
39
41
  // src/preset.ts
40
42
  import { mkdir } from "node:fs/promises";
@@ -205,11 +207,11 @@ function isEqual(a, b) {
205
207
  }
206
208
 
207
209
  // src/preset.ts
208
- var import_picocolors = __toESM(require_picocolors(), 1);
209
- import { dedent } from "ts-dedent";
210
+ var import_picocolors = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
210
211
 
211
212
  // src/node/boot-test-runner.ts
212
213
  import { fileURLToPath } from "node:url";
214
+ import { executeNodeCommand } from "storybook/internal/common";
213
215
  import {
214
216
  internal_universalStatusStore,
215
217
  internal_universalTestProviderStore
@@ -234,15 +236,18 @@ var MAX_START_TIME = 3e4, vitestModulePath = fileURLToPath(importMetaResolve("@s
234
236
  };
235
237
  process.on("exit", exit), process.on("SIGINT", () => exit(0)), process.on("SIGTERM", () => exit(0));
236
238
  let startChildProcess = () => new Promise((resolve, reject) => {
237
- child = execaNode(vitestModulePath, {
238
- env: {
239
- VITEST: "true",
240
- TEST: "true",
241
- VITEST_CHILD_PROCESS: "true",
242
- NODE_ENV: process.env.NODE_ENV ?? "test",
243
- STORYBOOK_CONFIG_DIR: normalize(options.configDir)
244
- },
245
- extendEnv: !0
239
+ child = executeNodeCommand({
240
+ scriptPath: vitestModulePath,
241
+ options: {
242
+ env: {
243
+ VITEST: "true",
244
+ TEST: "true",
245
+ VITEST_CHILD_PROCESS: "true",
246
+ NODE_ENV: process.env.NODE_ENV ?? "test",
247
+ STORYBOOK_CONFIG_DIR: normalize(options.configDir)
248
+ },
249
+ extendEnv: !0
250
+ }
246
251
  }), stderr = [], child.stdout?.on("data", log), child.stderr?.on("data", (data) => {
247
252
  data.toString().match(/^\u001B\[33m/) || (log(data), stderr.push(data.toString()));
248
253
  }), unsubscribeStore = store.subscribe(forwardUniversalStoreEvent(STORE_CHANNEL_EVENT_NAME)), unsubscribeStatusStore = internal_universalStatusStore.subscribe(
@@ -303,7 +308,7 @@ var experimental_serverChannel = async (channel, options) => {
303
308
  options
304
309
  ), resolvedPreviewBuilder = typeof core?.builder == "string" ? core.builder : core?.builder?.name, framework = await getFrameworkName(options);
305
310
  if (!resolvedPreviewBuilder?.includes("vite"))
306
- return framework.includes("nextjs") && log(dedent`
311
+ return framework.includes("nextjs") && log(import_ts_dedent.dedent`
307
312
  You're using ${framework}, which is a Webpack-based builder. In order to use Storybook Test, with your project, you need to use '@storybook/nextjs-vite', a high performance Vite-based equivalent.
308
313
 
309
314
  Information on how to upgrade here: ${import_picocolors.default.yellow("https://storybook.js.org/docs/get-started/frameworks/nextjs?ref=upgrade#with-vite")}\n
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
1
+ import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,7 +13,7 @@ import {
13
13
  __commonJS,
14
14
  __require,
15
15
  __toESM
16
- } from "../_node-chunks/chunk-FCFZB5YS.js";
16
+ } from "../_node-chunks/chunk-6K4PB6ZM.js";
17
17
 
18
18
  // ../../node_modules/tree-kill/index.js
19
19
  var require_tree_kill = __commonJS({
@@ -121,8 +121,7 @@ var storybookProcess = null, getIsVitestStandaloneRun = () => {
121
121
  try {
122
122
  storybookProcess = spawn(storybookScript, [], {
123
123
  stdio: process.env.DEBUG === "storybook" ? "pipe" : "ignore",
124
- cwd: process.cwd(),
125
- shell: !0
124
+ cwd: process.cwd()
126
125
  }), storybookProcess.on("error", (error) => {
127
126
  throw logger.verbose("Failed to start Storybook:" + error.message), error;
128
127
  });
@@ -1,29 +1,32 @@
1
- import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
1
+ import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_picocolors
14
- } from "../_node-chunks/chunk-XN666246.js";
14
+ } from "../_node-chunks/chunk-NT7JGKSQ.js";
15
+ import {
16
+ require_dist
17
+ } from "../_node-chunks/chunk-IZMDFVYT.js";
15
18
  import {
16
19
  join,
17
20
  normalize,
18
21
  relative,
19
22
  resolve,
20
23
  sep
21
- } from "../_node-chunks/chunk-L7WYCUSW.js";
24
+ } from "../_node-chunks/chunk-F3U6JEPX.js";
22
25
  import {
23
26
  __commonJS,
24
27
  __require,
25
28
  __toESM
26
- } from "../_node-chunks/chunk-FCFZB5YS.js";
29
+ } from "../_node-chunks/chunk-6K4PB6ZM.js";
27
30
 
28
31
  // ../../node_modules/braces/lib/utils.js
29
32
  var require_utils = __commonJS({
@@ -2337,8 +2340,7 @@ import { readConfig, vitestTransform } from "storybook/internal/csf-tools";
2337
2340
  import { MainFileMissingError } from "storybook/internal/server-errors";
2338
2341
  import { telemetry } from "storybook/internal/telemetry";
2339
2342
  import { oneWayHash } from "storybook/internal/telemetry";
2340
- var import_picocolors = __toESM(require_picocolors(), 1), import_sirv = __toESM(require_build2(), 1);
2341
- import { dedent } from "ts-dedent";
2343
+ var import_picocolors = __toESM(require_picocolors(), 1), import_sirv = __toESM(require_build2(), 1), import_ts_dedent = __toESM(require_dist(), 1);
2342
2344
 
2343
2345
  // ../../builders/builder-vite/src/utils/without-vite-plugins.ts
2344
2346
  var withoutVitePlugins = async (plugins = [], namesToRemove) => {
@@ -2541,7 +2543,7 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
2541
2543
  viteConfigFromStorybook
2542
2544
  );
2543
2545
  return (nonMutableInputConfig.test?.include?.length ?? 0) > 0 && (nonMutableInputConfig.test.include = [], console.log(
2544
- import_picocolors.default.yellow(dedent`
2546
+ import_picocolors.default.yellow(import_ts_dedent.dedent`
2545
2547
  Warning: Starting in Storybook 8.5.0-alpha.18, the "test.include" option in Vitest is discouraged in favor of just using the "stories" field in your Storybook configuration.
2546
2548
 
2547
2549
  The values you passed to "test.include" will be ignored, please remove them from your Vitest configuration where the Storybook plugin is applied.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PANEL_ID
3
- } from "../_browser-chunks/chunk-ULSHVN74.js";
3
+ } from "../_browser-chunks/chunk-TYJENCK5.js";
4
4
 
5
5
  // src/vitest-plugin/setup-file.ts
6
6
  import { afterEach, beforeAll, vi } from "vitest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "10.1.0-alpha.11",
3
+ "version": "10.1.0-alpha.13",
4
4
  "description": "Storybook Vitest addon: Blazing fast component testing using stories",
5
5
  "keywords": [
6
6
  "storybook",
@@ -73,9 +73,7 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@storybook/global": "^5.0.0",
76
- "@storybook/icons": "^2.0.0",
77
- "prompts": "^2.4.0",
78
- "ts-dedent": "^2.2.0"
76
+ "@storybook/icons": "^2.0.0"
79
77
  },
80
78
  "devDependencies": {
81
79
  "@types/istanbul-lib-report": "^3.0.3",
@@ -84,10 +82,8 @@
84
82
  "@types/semver": "^7",
85
83
  "@vitest/browser-playwright": "^4.0.1",
86
84
  "@vitest/runner": "^4.0.1",
87
- "boxen": "^8.0.1",
88
85
  "empathic": "^2.0.0",
89
86
  "es-toolkit": "^1.36.0",
90
- "execa": "^8.0.1",
91
87
  "istanbul-lib-report": "^3.0.1",
92
88
  "micromatch": "^4.0.8",
93
89
  "pathe": "^1.1.2",
@@ -107,7 +103,7 @@
107
103
  "@vitest/browser": "^3.0.0 || ^4.0.0",
108
104
  "@vitest/browser-playwright": "^4.0.0",
109
105
  "@vitest/runner": "^3.0.0 || ^4.0.0",
110
- "storybook": "^10.1.0-alpha.11",
106
+ "storybook": "^10.1.0-alpha.13",
111
107
  "vitest": "^3.0.0 || ^4.0.0"
112
108
  },
113
109
  "peerDependenciesMeta": {
@@ -1,35 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- ADDON_ID
14
- } from "./chunk-TCQNKRGF.js";
15
- import {
16
- require_picocolors
17
- } from "./chunk-XN666246.js";
18
- import {
19
- __toESM
20
- } from "./chunk-FCFZB5YS.js";
21
-
22
- // src/logger.ts
23
- var import_picocolors = __toESM(require_picocolors(), 1);
24
- var log = (message) => {
25
- console.log(`${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().trim()}`);
26
- };
27
-
28
- // ../../node_modules/es-toolkit/dist/function/noop.mjs
29
- function noop() {
30
- }
31
-
32
- export {
33
- noop,
34
- log
35
- };