@storybook/addon-vitest 10.2.0-alpha.11 → 10.2.0-alpha.12
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/_node-chunks/{chunk-Y6VGPPSD.js → chunk-7TW4BJPL.js} +7 -7
- package/dist/_node-chunks/{chunk-TQSNPH3N.js → chunk-CUBC2MO6.js} +9 -9
- package/dist/_node-chunks/{chunk-MYPG5LVV.js → chunk-MFK74NWN.js} +7 -7
- package/dist/_node-chunks/{chunk-KTLRCBAA.js → chunk-MXNSEJ5A.js} +7 -7
- package/dist/_node-chunks/{chunk-IB5IAFQF.js → chunk-N6JECK66.js} +6 -6
- package/dist/_node-chunks/{chunk-KGWSAXJM.js → chunk-S3ZR4EWC.js} +6 -6
- package/dist/_node-chunks/{chunk-D2ZUAJQP.js → chunk-TRTUXRWO.js} +6 -6
- package/dist/_node-chunks/{chunk-BTRRB3AO.js → chunk-TSG5OPRK.js} +7 -7
- package/dist/_node-chunks/{chunk-Y3YX44MN.js → chunk-YAO6RQPR.js} +6 -6
- package/dist/manager.js +2 -2
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +14 -13
- package/dist/postinstall.js +13 -13
- package/dist/preset.js +13 -13
- package/dist/vitest-plugin/global-setup.js +7 -7
- package/dist/vitest-plugin/index.js +25 -17
- package/package.json +2 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-S3ZR4EWC.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
ADDON_ID
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TRTUXRWO.js";
|
|
15
15
|
import {
|
|
16
16
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MXNSEJ5A.js";
|
|
18
18
|
import {
|
|
19
19
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-S3ZR4EWC.js";
|
|
21
21
|
|
|
22
22
|
// src/logger.ts
|
|
23
23
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_okg5h9pn0ag.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
dirname,
|
|
14
14
|
join
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N6JECK66.js";
|
|
16
16
|
|
|
17
17
|
// ../../core/src/shared/utils/module.ts
|
|
18
18
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-S3ZR4EWC.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/picocolors/picocolors.js
|
|
17
17
|
var require_picocolors = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-S3ZR4EWC.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/ts-dedent/dist/index.js
|
|
17
17
|
var require_dist = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/manager.js
CHANGED
|
@@ -28,7 +28,7 @@ var store = experimental_UniversalStore.create({
|
|
|
28
28
|
}), componentTestStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_COMPONENT_TEST), a11yStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_A11Y), testProviderStore = experimental_getTestProviderStore(ADDON_ID2);
|
|
29
29
|
|
|
30
30
|
// src/manager.tsx
|
|
31
|
-
import { addons as addons2 } from "storybook/manager-api";
|
|
31
|
+
import { Tag, addons as addons2 } from "storybook/manager-api";
|
|
32
32
|
|
|
33
33
|
// src/components/GlobalErrorModal.tsx
|
|
34
34
|
import React, { useContext } from "react";
|
|
@@ -695,7 +695,7 @@ addons2.register(ADDON_ID2, (api) => {
|
|
|
695
695
|
}
|
|
696
696
|
));
|
|
697
697
|
},
|
|
698
|
-
sidebarContextMenu: ({ context }) => context.type === "docs" || context.type === "story" && !context.tags.includes(
|
|
698
|
+
sidebarContextMenu: ({ context }) => context.type === "docs" || context.type === "story" && !context.tags.includes(Tag.TEST) ? null : React5.createElement(SidebarContextMenu, { context, api })
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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_gte
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-7TW4BJPL.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-S3ZR4EWC.js";
|
|
20
20
|
|
|
21
21
|
// ../../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
|
|
22
22
|
var require_make_dir = __commonJS({
|
package/dist/node/vitest.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
log
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-CUBC2MO6.js";
|
|
15
15
|
import {
|
|
16
16
|
any
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-YAO6RQPR.js";
|
|
18
18
|
import {
|
|
19
19
|
ADDON_ID,
|
|
20
20
|
COVERAGE_DIRECTORY,
|
|
21
21
|
STATUS_TYPE_ID_A11Y,
|
|
22
22
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
23
23
|
storeOptions
|
|
24
|
-
} from "../_node-chunks/chunk-
|
|
25
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-TRTUXRWO.js";
|
|
25
|
+
import "../_node-chunks/chunk-MXNSEJ5A.js";
|
|
26
26
|
import {
|
|
27
27
|
dirname,
|
|
28
28
|
join,
|
|
29
29
|
normalize,
|
|
30
30
|
path
|
|
31
|
-
} from "../_node-chunks/chunk-
|
|
32
|
-
import "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-N6JECK66.js";
|
|
32
|
+
import "../_node-chunks/chunk-S3ZR4EWC.js";
|
|
33
33
|
|
|
34
34
|
// src/node/vitest.ts
|
|
35
35
|
import process2 from "node:process";
|
|
@@ -125,6 +125,7 @@ function errorToErrorLike(error) {
|
|
|
125
125
|
// src/node/vitest-manager.ts
|
|
126
126
|
import { existsSync } from "node:fs";
|
|
127
127
|
import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
|
|
128
|
+
import { Tag } from "storybook/internal/core-server";
|
|
128
129
|
|
|
129
130
|
// ../../../node_modules/slash/index.js
|
|
130
131
|
function slash(path2) {
|
|
@@ -283,7 +284,7 @@ Please install the @vitest/${isIstanbul ? "coverage-istanbul" : "coverage-v8"} p
|
|
|
283
284
|
storiesByImportPath[absoluteImportPath] || (storiesByImportPath[absoluteImportPath] = []), storiesByImportPath[absoluteImportPath].push(story);
|
|
284
285
|
}
|
|
285
286
|
for (let testSpecification of testSpecifications) {
|
|
286
|
-
let { env = {} } = testSpecification.project.config, include = env.__VITEST_INCLUDE_TAGS__?.split(",").filter(Boolean) ?? [
|
|
287
|
+
let { env = {} } = testSpecification.project.config, include = env.__VITEST_INCLUDE_TAGS__?.split(",").filter(Boolean) ?? [Tag.TEST], exclude = env.__VITEST_EXCLUDE_TAGS__?.split(",").filter(Boolean) ?? [], skip = env.__VITEST_SKIP_TAGS__?.split(",").filter(Boolean) ?? [], filteredStories = (storiesByImportPath[testSpecification.moduleId] ?? []).filter((story) => !(include.length && !include.some((tag) => story.tags?.includes(tag)) || exclude.some((tag) => story.tags?.includes(tag))));
|
|
287
288
|
filteredStories.length && (this.testManager.store.getState().watching || this.updateLastChanged(testSpecification.moduleId), filteredTestSpecifications.push(testSpecification), filteredStoryIds.push(
|
|
288
289
|
...filteredStories.filter((story) => !skip.some((tag) => story.tags?.includes(tag))).map((story) => story.id)
|
|
289
290
|
));
|
package/dist/postinstall.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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
|
resolvePackageDir
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-MFK74NWN.js";
|
|
15
15
|
import {
|
|
16
16
|
any
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-YAO6RQPR.js";
|
|
18
18
|
import {
|
|
19
19
|
DOCUMENTATION_LINK
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-TRTUXRWO.js";
|
|
21
21
|
import {
|
|
22
22
|
require_dist
|
|
23
|
-
} from "./_node-chunks/chunk-
|
|
23
|
+
} from "./_node-chunks/chunk-TSG5OPRK.js";
|
|
24
24
|
import {
|
|
25
25
|
dirname,
|
|
26
26
|
join,
|
|
27
27
|
relative,
|
|
28
28
|
resolve
|
|
29
|
-
} from "./_node-chunks/chunk-
|
|
29
|
+
} from "./_node-chunks/chunk-N6JECK66.js";
|
|
30
30
|
import {
|
|
31
31
|
require_compare,
|
|
32
32
|
require_constants,
|
|
@@ -36,11 +36,11 @@ import {
|
|
|
36
36
|
require_parse_options,
|
|
37
37
|
require_re,
|
|
38
38
|
require_semver
|
|
39
|
-
} from "./_node-chunks/chunk-
|
|
39
|
+
} from "./_node-chunks/chunk-7TW4BJPL.js";
|
|
40
40
|
import {
|
|
41
41
|
__commonJS,
|
|
42
42
|
__toESM
|
|
43
|
-
} from "./_node-chunks/chunk-
|
|
43
|
+
} from "./_node-chunks/chunk-S3ZR4EWC.js";
|
|
44
44
|
|
|
45
45
|
// ../../../node_modules/semver/functions/parse.js
|
|
46
46
|
var require_parse = __commonJS({
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,10 +12,10 @@ var require = CJS_COMPAT_NODE_MODULE_okg5h9pn0ag.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
log,
|
|
14
14
|
noop
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-CUBC2MO6.js";
|
|
16
16
|
import {
|
|
17
17
|
importMetaResolve
|
|
18
|
-
} from "./_node-chunks/chunk-
|
|
18
|
+
} from "./_node-chunks/chunk-MFK74NWN.js";
|
|
19
19
|
import {
|
|
20
20
|
ADDON_ID,
|
|
21
21
|
COVERAGE_DIRECTORY,
|
|
@@ -24,19 +24,19 @@ import {
|
|
|
24
24
|
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
25
25
|
TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
|
|
26
26
|
storeOptions
|
|
27
|
-
} from "./_node-chunks/chunk-
|
|
27
|
+
} from "./_node-chunks/chunk-TRTUXRWO.js";
|
|
28
28
|
import {
|
|
29
29
|
require_picocolors
|
|
30
|
-
} from "./_node-chunks/chunk-
|
|
30
|
+
} from "./_node-chunks/chunk-MXNSEJ5A.js";
|
|
31
31
|
import {
|
|
32
32
|
require_dist
|
|
33
|
-
} from "./_node-chunks/chunk-
|
|
33
|
+
} from "./_node-chunks/chunk-TSG5OPRK.js";
|
|
34
34
|
import {
|
|
35
35
|
normalize
|
|
36
|
-
} from "./_node-chunks/chunk-
|
|
36
|
+
} from "./_node-chunks/chunk-N6JECK66.js";
|
|
37
37
|
import {
|
|
38
38
|
__toESM
|
|
39
|
-
} from "./_node-chunks/chunk-
|
|
39
|
+
} from "./_node-chunks/chunk-S3ZR4EWC.js";
|
|
40
40
|
|
|
41
41
|
// src/preset.ts
|
|
42
42
|
import { mkdir } from "node:fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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-S3ZR4EWC.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/tree-kill/index.js
|
|
19
19
|
var require_tree_kill = __commonJS({
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_66it1hi9ryo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_66it1hi9ryo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_66it1hi9ryo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_66it1hi9ryo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_66it1hi9ryo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_66it1hi9ryo.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-MXNSEJ5A.js";
|
|
15
15
|
import {
|
|
16
16
|
require_dist
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-TSG5OPRK.js";
|
|
18
18
|
import {
|
|
19
19
|
join,
|
|
20
20
|
normalize,
|
|
21
21
|
relative,
|
|
22
22
|
resolve,
|
|
23
23
|
sep
|
|
24
|
-
} from "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-N6JECK66.js";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__require,
|
|
28
28
|
__toESM
|
|
29
|
-
} from "../_node-chunks/chunk-
|
|
29
|
+
} from "../_node-chunks/chunk-S3ZR4EWC.js";
|
|
30
30
|
|
|
31
31
|
// ../../../node_modules/braces/lib/utils.js
|
|
32
32
|
var require_utils = __commonJS({
|
|
@@ -2333,6 +2333,7 @@ import {
|
|
|
2333
2333
|
} from "storybook/internal/common";
|
|
2334
2334
|
import {
|
|
2335
2335
|
StoryIndexGenerator,
|
|
2336
|
+
Tag,
|
|
2336
2337
|
experimental_loadStorybook,
|
|
2337
2338
|
mapStaticDir
|
|
2338
2339
|
} from "storybook/internal/core-server";
|
|
@@ -2383,12 +2384,14 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2383
2384
|
return id.endsWith(".mdx") ? "export default {};" : null;
|
|
2384
2385
|
}
|
|
2385
2386
|
}, storybookTest = async (options) => {
|
|
2387
|
+
if (!optionalEnvToBoolean(process.env.VITEST))
|
|
2388
|
+
return [];
|
|
2386
2389
|
let finalOptions = {
|
|
2387
2390
|
...defaultOptions,
|
|
2388
2391
|
...options,
|
|
2389
2392
|
configDir: options?.configDir ? resolve(WORKING_DIR, options.configDir) : defaultOptions.configDir,
|
|
2390
2393
|
tags: {
|
|
2391
|
-
include: options?.tags?.include ?? [
|
|
2394
|
+
include: options?.tags?.include ?? [Tag.TEST],
|
|
2392
2395
|
exclude: options?.tags?.exclude ?? [],
|
|
2393
2396
|
skip: options?.tags?.skip ?? []
|
|
2394
2397
|
}
|
|
@@ -2403,7 +2406,6 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2403
2406
|
}), stories = await presets.apply("stories", []), commonConfig = { root: resolve(finalOptions.configDir, "..") }, [
|
|
2404
2407
|
{ storiesGlobs },
|
|
2405
2408
|
framework,
|
|
2406
|
-
storybookEnv,
|
|
2407
2409
|
viteConfigFromStorybook,
|
|
2408
2410
|
staticDirs,
|
|
2409
2411
|
previewLevelTags,
|
|
@@ -2413,7 +2415,6 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2413
2415
|
] = await Promise.all([
|
|
2414
2416
|
getStoryGlobsAndFiles(presets, directories),
|
|
2415
2417
|
presets.apply("framework", void 0),
|
|
2416
|
-
presets.apply("env", {}),
|
|
2417
2418
|
presets.apply("viteFinal", commonConfig),
|
|
2418
2419
|
presets.apply("staticDirs", []),
|
|
2419
2420
|
extractTagsFromPreview(finalOptions.configDir),
|
|
@@ -2439,7 +2440,8 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2439
2440
|
]);
|
|
2440
2441
|
return html.replace("</head>", `${headHtmlSnippet ?? ""}</head>`).replace("<body>", `<body>${bodyHtmlSnippet ?? ""}`);
|
|
2441
2442
|
},
|
|
2442
|
-
async config(nonMutableInputConfig) {
|
|
2443
|
+
async config(nonMutableInputConfig, { mode }) {
|
|
2444
|
+
mode && (process.env.BUILD_TARGET = mode);
|
|
2443
2445
|
try {
|
|
2444
2446
|
await validateConfigurationFiles(finalOptions.configDir);
|
|
2445
2447
|
} catch {
|
|
@@ -2471,7 +2473,15 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2471
2473
|
]
|
|
2472
2474
|
} : {},
|
|
2473
2475
|
env: {
|
|
2474
|
-
|
|
2476
|
+
/**
|
|
2477
|
+
* We do this late, because we need vitest's --mode to be available and set to
|
|
2478
|
+
* BUILD_MODE. Unfortunately, the dependencies we use to load .env files can only be
|
|
2479
|
+
* configured using that environment variable. We need it to be synced up with the mode
|
|
2480
|
+
* that vitest is running in, or risk leaking envs from the wrong file.
|
|
2481
|
+
*
|
|
2482
|
+
* @see https://github.com/storybookjs/storybook/issues/33101
|
|
2483
|
+
*/
|
|
2484
|
+
...await presets.apply("env", {}),
|
|
2475
2485
|
// To be accessed by the setup file
|
|
2476
2486
|
__STORYBOOK_URL__: finalOptions.storybookUrl,
|
|
2477
2487
|
VITEST_STORYBOOK: isVitestStorybook ? "true" : "false",
|
|
@@ -2581,8 +2591,6 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2581
2591
|
}
|
|
2582
2592
|
},
|
|
2583
2593
|
async transform(code, id) {
|
|
2584
|
-
if (!optionalEnvToBoolean(process.env.VITEST))
|
|
2585
|
-
return code;
|
|
2586
2594
|
let relativeId = relative(finalOptions.vitestRoot, id);
|
|
2587
2595
|
if ((0, import_micromatch.match)([relativeId], finalOptions.includeStories).length > 0)
|
|
2588
2596
|
return vitestTransform({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-vitest",
|
|
3
|
-
"version": "10.2.0-alpha.
|
|
3
|
+
"version": "10.2.0-alpha.12",
|
|
4
4
|
"description": "Storybook Vitest addon: Blazing fast component testing using stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@vitest/browser": "^3.0.0 || ^4.0.0",
|
|
100
100
|
"@vitest/browser-playwright": "^4.0.0",
|
|
101
101
|
"@vitest/runner": "^3.0.0 || ^4.0.0",
|
|
102
|
-
"storybook": "^10.2.0-alpha.
|
|
102
|
+
"storybook": "^10.2.0-alpha.12",
|
|
103
103
|
"vitest": "^3.0.0 || ^4.0.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependenciesMeta": {
|