@storybook/addon-vitest 0.0.0-pr-32799-sha-2fd404cf → 0.0.0-pr-32717-sha-47ba2989

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_8xr17y6c6uv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8xr17y6c6uv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8xr17y6c6uv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_2jsf5jhwlj6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_2jsf5jhwlj6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_8xr17y6c6uv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8xr17y6c6uv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8xr17y6c6uv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_2jsf5jhwlj6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_2jsf5jhwlj6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6.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_8xr17y6c6uv.createRequire(import.meta.url);
12
12
  import {
13
13
  log,
14
14
  noop
15
- } from "./_node-chunks/chunk-VM7LYAZL.js";
15
+ } from "./_node-chunks/chunk-45MCYOUJ.js";
16
16
  import {
17
- execaNode,
18
17
  importMetaResolve
19
- } from "./_node-chunks/chunk-WQUQR2JF.js";
18
+ } from "./_node-chunks/chunk-4H2GO2UY.js";
20
19
  import {
21
20
  ADDON_ID,
22
21
  COVERAGE_DIRECTORY,
@@ -25,17 +24,20 @@ import {
25
24
  STORYBOOK_ADDON_TEST_CHANNEL,
26
25
  TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
27
26
  storeOptions
28
- } from "./_node-chunks/chunk-LIA3N4HE.js";
27
+ } from "./_node-chunks/chunk-BRIC3JT4.js";
29
28
  import {
30
29
  require_picocolors
31
- } from "./_node-chunks/chunk-AJ2WUJGZ.js";
30
+ } from "./_node-chunks/chunk-FXNIGN3F.js";
31
+ import {
32
+ require_dist
33
+ } from "./_node-chunks/chunk-MYOIMEAF.js";
32
34
  import {
33
35
  normalize
34
- } from "./_node-chunks/chunk-TZI2AHX2.js";
36
+ } from "./_node-chunks/chunk-26QD4KIO.js";
35
37
  import {
36
38
  __name,
37
39
  __toESM
38
- } from "./_node-chunks/chunk-HQVHOASY.js";
40
+ } from "./_node-chunks/chunk-C2FSHTUD.js";
39
41
 
40
42
  // src/preset.ts
41
43
  import { mkdir } from "node:fs/promises";
@@ -302,10 +304,11 @@ __name(isEqual, "isEqual");
302
304
 
303
305
  // src/preset.ts
304
306
  var import_picocolors = __toESM(require_picocolors(), 1);
305
- import { dedent } from "ts-dedent";
307
+ var import_ts_dedent = __toESM(require_dist(), 1);
306
308
 
307
309
  // src/node/boot-test-runner.ts
308
310
  import { fileURLToPath } from "node:url";
311
+ import { executeNodeCommand } from "storybook/internal/common";
309
312
  import {
310
313
  internal_universalStatusStore,
311
314
  internal_universalTestProviderStore
@@ -348,15 +351,18 @@ var bootTestRunner = /* @__PURE__ */ __name(async ({
348
351
  process.on("SIGINT", () => exit(0));
349
352
  process.on("SIGTERM", () => exit(0));
350
353
  const startChildProcess = /* @__PURE__ */ __name(() => new Promise((resolve, reject) => {
351
- child = execaNode(vitestModulePath, {
352
- env: {
353
- VITEST: "true",
354
- TEST: "true",
355
- VITEST_CHILD_PROCESS: "true",
356
- NODE_ENV: process.env.NODE_ENV ?? "test",
357
- STORYBOOK_CONFIG_DIR: normalize(options.configDir)
358
- },
359
- extendEnv: true
354
+ child = executeNodeCommand({
355
+ scriptPath: vitestModulePath,
356
+ options: {
357
+ env: {
358
+ VITEST: "true",
359
+ TEST: "true",
360
+ VITEST_CHILD_PROCESS: "true",
361
+ NODE_ENV: process.env.NODE_ENV ?? "test",
362
+ STORYBOOK_CONFIG_DIR: normalize(options.configDir)
363
+ },
364
+ extendEnv: true
365
+ }
360
366
  });
361
367
  stderr = [];
362
368
  child.stdout?.on("data", log);
@@ -448,7 +454,7 @@ var experimental_serverChannel = /* @__PURE__ */ __name(async (channel, options)
448
454
  const framework = await getFrameworkName(options);
449
455
  if (!resolvedPreviewBuilder?.includes("vite")) {
450
456
  if (framework.includes("nextjs")) {
451
- log(dedent`
457
+ log(import_ts_dedent.dedent`
452
458
  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.
453
459
 
454
460
  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_8xr17y6c6uv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8xr17y6c6uv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8xr17y6c6uv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_2jsf5jhwlj6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_2jsf5jhwlj6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_8xr17y6c6uv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8xr17y6c6uv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8xr17y6c6uv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_2jsf5jhwlj6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_2jsf5jhwlj6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,7 +14,7 @@ import {
14
14
  __name,
15
15
  __require,
16
16
  __toESM
17
- } from "../_node-chunks/chunk-HQVHOASY.js";
17
+ } from "../_node-chunks/chunk-C2FSHTUD.js";
18
18
 
19
19
  // ../../node_modules/tree-kill/index.js
20
20
  var require_tree_kill = __commonJS({
@@ -162,8 +162,7 @@ var startStorybookIfNotRunning = /* @__PURE__ */ __name(async () => {
162
162
  try {
163
163
  storybookProcess = spawn(storybookScript, [], {
164
164
  stdio: process.env.DEBUG === "storybook" ? "pipe" : "ignore",
165
- cwd: process.cwd(),
166
- shell: true
165
+ cwd: process.cwd()
167
166
  });
168
167
  storybookProcess.on("error", (error) => {
169
168
  logger.verbose("Failed to start Storybook:" + error.message);
@@ -1,30 +1,33 @@
1
- import CJS_COMPAT_NODE_URL_8xr17y6c6uv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8xr17y6c6uv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8xr17y6c6uv from "node:module";
1
+ import CJS_COMPAT_NODE_URL_2jsf5jhwlj6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_2jsf5jhwlj6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_8xr17y6c6uv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8xr17y6c6uv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8xr17y6c6uv.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_2jsf5jhwlj6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_2jsf5jhwlj6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_2jsf5jhwlj6.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-AJ2WUJGZ.js";
14
+ } from "../_node-chunks/chunk-FXNIGN3F.js";
15
+ import {
16
+ require_dist
17
+ } from "../_node-chunks/chunk-MYOIMEAF.js";
15
18
  import {
16
19
  join,
17
20
  normalize,
18
21
  relative,
19
22
  resolve,
20
23
  sep
21
- } from "../_node-chunks/chunk-TZI2AHX2.js";
24
+ } from "../_node-chunks/chunk-26QD4KIO.js";
22
25
  import {
23
26
  __commonJS,
24
27
  __name,
25
28
  __require,
26
29
  __toESM
27
- } from "../_node-chunks/chunk-HQVHOASY.js";
30
+ } from "../_node-chunks/chunk-C2FSHTUD.js";
28
31
 
29
32
  // ../../node_modules/braces/lib/utils.js
30
33
  var require_utils = __commonJS({
@@ -3493,7 +3496,7 @@ import { telemetry } from "storybook/internal/telemetry";
3493
3496
  import { oneWayHash } from "storybook/internal/telemetry";
3494
3497
  var import_picocolors = __toESM(require_picocolors(), 1);
3495
3498
  var import_sirv = __toESM(require_build2(), 1);
3496
- import { dedent } from "ts-dedent";
3499
+ var import_ts_dedent = __toESM(require_dist(), 1);
3497
3500
 
3498
3501
  // ../../builders/builder-vite/src/utils/without-vite-plugins.ts
3499
3502
  var withoutVitePlugins = /* @__PURE__ */ __name(async (plugins = [], namesToRemove) => {
@@ -3745,7 +3748,7 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
3745
3748
  if ((nonMutableInputConfig.test?.include?.length ?? 0) > 0) {
3746
3749
  nonMutableInputConfig.test.include = [];
3747
3750
  console.log(
3748
- import_picocolors.default.yellow(dedent`
3751
+ import_picocolors.default.yellow(import_ts_dedent.dedent`
3749
3752
  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.
3750
3753
 
3751
3754
  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-CAYLRBRX.js";
3
+ } from "../_browser-chunks/chunk-RPDOPHZX.js";
4
4
  import {
5
5
  __name
6
6
  } from "../_browser-chunks/chunk-JK72E6FR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "0.0.0-pr-32799-sha-2fd404cf",
3
+ "version": "0.0.0-pr-32717-sha-47ba2989",
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": "^1.6.0",
77
- "prompts": "^2.4.0",
78
- "ts-dedent": "^2.2.0"
76
+ "@storybook/icons": "^1.6.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": "^0.0.0-pr-32799-sha-2fd404cf",
106
+ "storybook": "^0.0.0-pr-32717-sha-47ba2989",
111
107
  "vitest": "^3.0.0 || ^4.0.0"
112
108
  },
113
109
  "peerDependenciesMeta": {
@@ -1,98 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_8xr17y6c6uv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8xr17y6c6uv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8xr17y6c6uv from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_8xr17y6c6uv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8xr17y6c6uv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8xr17y6c6uv.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-HQVHOASY.js";
15
-
16
- // src/utils.ts
17
- function getAddonNames(mainConfig) {
18
- const addons = mainConfig.addons || [];
19
- const addonList = addons.map((addon) => {
20
- let name = "";
21
- if (typeof addon === "string") {
22
- name = addon;
23
- } else if (typeof addon === "object") {
24
- name = addon.name;
25
- }
26
- return name;
27
- });
28
- return addonList.filter((item) => item != null);
29
- }
30
- __name(getAddonNames, "getAddonNames");
31
- function errorToErrorLike(error) {
32
- return {
33
- message: error.message,
34
- name: error.name,
35
- // avoid duplicating the error message in the stack trace
36
- stack: error.stack?.replace(error.message, ""),
37
- cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
38
- };
39
- }
40
- __name(errorToErrorLike, "errorToErrorLike");
41
-
42
- // ../../node_modules/empathic/find.mjs
43
- import { join as join2 } from "node:path";
44
- import { existsSync, statSync } from "node:fs";
45
-
46
- // ../../node_modules/empathic/walk.mjs
47
- import { dirname } from "node:path";
48
-
49
- // ../../node_modules/empathic/resolve.mjs
50
- import { isAbsolute, join, resolve } from "node:path";
51
- function absolute(input, root) {
52
- return isAbsolute(input) ? input : resolve(root || ".", input);
53
- }
54
- __name(absolute, "absolute");
55
-
56
- // ../../node_modules/empathic/walk.mjs
57
- function up(base, options) {
58
- let { last, cwd } = options || {};
59
- let tmp = absolute(base, cwd);
60
- let root = absolute(last || "/", cwd);
61
- let prev, arr = [];
62
- while (prev !== root) {
63
- arr.push(tmp);
64
- tmp = dirname(prev = tmp);
65
- if (tmp === prev) break;
66
- }
67
- return arr;
68
- }
69
- __name(up, "up");
70
-
71
- // ../../node_modules/empathic/find.mjs
72
- function up2(name, options) {
73
- let dir, tmp;
74
- let start = options && options.cwd || "";
75
- for (dir of up(start, options)) {
76
- tmp = join2(dir, name);
77
- if (existsSync(tmp)) return tmp;
78
- }
79
- }
80
- __name(up2, "up");
81
- function any(names, options) {
82
- let dir, start = options && options.cwd || "";
83
- let j = 0, len = names.length, tmp;
84
- for (dir of up(start, options)) {
85
- for (j = 0; j < len; j++) {
86
- tmp = join2(dir, names[j]);
87
- if (existsSync(tmp)) return tmp;
88
- }
89
- }
90
- }
91
- __name(any, "any");
92
-
93
- export {
94
- getAddonNames,
95
- errorToErrorLike,
96
- up2 as up,
97
- any
98
- };
@@ -1,37 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_8xr17y6c6uv from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8xr17y6c6uv from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8xr17y6c6uv from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_8xr17y6c6uv.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8xr17y6c6uv.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8xr17y6c6uv.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-LIA3N4HE.js";
15
- import {
16
- require_picocolors
17
- } from "./chunk-AJ2WUJGZ.js";
18
- import {
19
- __name,
20
- __toESM
21
- } from "./chunk-HQVHOASY.js";
22
-
23
- // src/logger.ts
24
- var import_picocolors = __toESM(require_picocolors(), 1);
25
- var log = /* @__PURE__ */ __name((message) => {
26
- console.log(`${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().trim()}`);
27
- }, "log");
28
-
29
- // ../../node_modules/es-toolkit/dist/function/noop.mjs
30
- function noop() {
31
- }
32
- __name(noop, "noop");
33
-
34
- export {
35
- noop,
36
- log
37
- };