@storybook/addon-vitest 10.1.0-alpha.12 → 10.1.0-alpha.14
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/_browser-chunks/{chunk-ULSHVN74.js → chunk-TJXI7EIW.js} +2 -1
- package/dist/_node-chunks/chunk-6AR4T7ZA.js +158 -0
- package/dist/_node-chunks/{chunk-STKK7R3Q.js → chunk-AK5YETDU.js} +7 -7
- package/dist/_node-chunks/{chunk-2CDZI4WP.js → chunk-BPGYDXOJ.js} +7 -7
- package/dist/_node-chunks/chunk-HE4K5BJE.js +38 -0
- package/dist/_node-chunks/{chunk-AB3B3FVZ.js → chunk-LPV43OFW.js} +6 -31
- package/dist/_node-chunks/chunk-R3WDCMQA.js +61 -0
- package/dist/_node-chunks/{chunk-5ZI5GUBS.js → chunk-W47M2CRN.js} +8 -20
- package/dist/_node-chunks/{chunk-IC274GVS.js → chunk-WRYSSL2Z.js} +6 -6
- package/dist/_node-chunks/{chunk-PCFYAAN7.js → chunk-YL3EBNPR.js} +6 -6
- package/dist/manager.js +5 -2
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +24 -14
- package/dist/postinstall.js +152 -290
- package/dist/preset.js +31 -26
- package/dist/vitest-plugin/global-setup.js +8 -9
- package/dist/vitest-plugin/index.js +14 -12
- package/dist/vitest-plugin/setup-file.js +1 -1
- package/package.json +3 -7
- package/dist/_node-chunks/chunk-3HJX4AQ5.js +0 -1697
- package/dist/_node-chunks/chunk-4R6Y7BGX.js +0 -35
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_u9dwwmk6qf9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_u9dwwmk6qf9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_u9dwwmk6qf9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_u9dwwmk6qf9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9.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_xvxi8m6bww.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
log,
|
|
14
14
|
noop
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-HE4K5BJE.js";
|
|
16
16
|
import {
|
|
17
|
-
execaNode,
|
|
18
17
|
importMetaResolve
|
|
19
|
-
} from "./_node-chunks/chunk-
|
|
18
|
+
} from "./_node-chunks/chunk-6AR4T7ZA.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-
|
|
27
|
+
} from "./_node-chunks/chunk-W47M2CRN.js";
|
|
29
28
|
import {
|
|
30
29
|
require_picocolors
|
|
31
|
-
} from "./_node-chunks/chunk-
|
|
30
|
+
} from "./_node-chunks/chunk-AK5YETDU.js";
|
|
31
|
+
import {
|
|
32
|
+
require_dist
|
|
33
|
+
} from "./_node-chunks/chunk-R3WDCMQA.js";
|
|
32
34
|
import {
|
|
33
35
|
normalize
|
|
34
|
-
} from "./_node-chunks/chunk-
|
|
36
|
+
} from "./_node-chunks/chunk-WRYSSL2Z.js";
|
|
35
37
|
import {
|
|
36
38
|
__toESM
|
|
37
|
-
} from "./_node-chunks/chunk-
|
|
39
|
+
} from "./_node-chunks/chunk-YL3EBNPR.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 =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
|
@@ -380,7 +385,7 @@ var experimental_serverChannel = async (channel, options) => {
|
|
|
380
385
|
}), !core.disableTelemetry) {
|
|
381
386
|
let enableCrashReports = core.enableCrashReports || options.enableCrashReports;
|
|
382
387
|
channel.on(STORYBOOK_ADDON_TEST_CHANNEL, (event) => {
|
|
383
|
-
telemetry("addon-test", {
|
|
388
|
+
event.type !== "test-run-completed" && telemetry("addon-test", {
|
|
384
389
|
...event,
|
|
385
390
|
payload: {
|
|
386
391
|
...event.payload,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_u9dwwmk6qf9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_u9dwwmk6qf9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_u9dwwmk6qf9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_u9dwwmk6qf9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9.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-
|
|
16
|
+
} from "../_node-chunks/chunk-YL3EBNPR.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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_u9dwwmk6qf9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_u9dwwmk6qf9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_u9dwwmk6qf9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_u9dwwmk6qf9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_u9dwwmk6qf9.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-
|
|
14
|
+
} from "../_node-chunks/chunk-AK5YETDU.js";
|
|
15
|
+
import {
|
|
16
|
+
require_dist
|
|
17
|
+
} from "../_node-chunks/chunk-R3WDCMQA.js";
|
|
15
18
|
import {
|
|
16
19
|
join,
|
|
17
20
|
normalize,
|
|
18
21
|
relative,
|
|
19
22
|
resolve,
|
|
20
23
|
sep
|
|
21
|
-
} from "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-WRYSSL2Z.js";
|
|
22
25
|
import {
|
|
23
26
|
__commonJS,
|
|
24
27
|
__require,
|
|
25
28
|
__toESM
|
|
26
|
-
} from "../_node-chunks/chunk-
|
|
29
|
+
} from "../_node-chunks/chunk-YL3EBNPR.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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-vitest",
|
|
3
|
-
"version": "10.1.0-alpha.
|
|
3
|
+
"version": "10.1.0-alpha.14",
|
|
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.
|
|
106
|
+
"storybook": "^10.1.0-alpha.14",
|
|
111
107
|
"vitest": "^3.0.0 || ^4.0.0"
|
|
112
108
|
},
|
|
113
109
|
"peerDependenciesMeta": {
|