@storybook/addon-vitest 0.0.0-pr-32939-sha-3f0b505a → 0.0.0-pr-32799-sha-e72c6b25
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-CAYLRBRX.js → chunk-PMYV6BH2.js} +0 -1
- package/dist/_node-chunks/{chunk-L3UU4GCD.js → chunk-54L6M5PF.js} +7 -7
- package/dist/_node-chunks/{chunk-2VXQI47B.js → chunk-EBTWRVJW.js} +6 -6
- package/dist/_node-chunks/{chunk-OTIJ62GC.js → chunk-MNO64KI6.js} +6 -7
- package/dist/_node-chunks/{chunk-LH6GKEW6.js → chunk-N3IVPIIG.js} +7 -7
- package/dist/_node-chunks/{chunk-6FB3AIJX.js → chunk-S4OYSNCY.js} +9 -9
- package/dist/_node-chunks/{chunk-ZYYVDUI2.js → chunk-S6NBXJD5.js} +7 -7
- package/dist/_node-chunks/{chunk-EBUX7LWY.js → chunk-VUPLOX7Y.js} +8 -8
- package/dist/_node-chunks/{chunk-QODVORKU.js → chunk-YRSMPC6L.js} +7 -7
- package/dist/manager.js +1 -1
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +15 -18
- package/dist/postinstall.js +74 -92
- package/dist/preset.js +12 -12
- package/dist/vitest-plugin/global-setup.js +7 -7
- package/dist/vitest-plugin/index.js +9 -10
- package/dist/vitest-plugin/setup-file.js +1 -1
- package/package.json +8 -12
- package/templates/vitest.config.3.2.template.ts +1 -6
- package/templates/vitest.config.template.ts +1 -6
- package/templates/vitest.workspace.template.ts +1 -6
- package/templates/vitest.config.4.template.ts +0 -37
|
@@ -7,7 +7,6 @@ var DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-th
|
|
|
7
7
|
// ../a11y/src/constants.ts
|
|
8
8
|
var ADDON_ID2 = "storybook/a11y";
|
|
9
9
|
var PANEL_ID2 = `${ADDON_ID2}/panel`;
|
|
10
|
-
var UI_STATE_ID = `${ADDON_ID2}/ui`;
|
|
11
10
|
var RESULT = `${ADDON_ID2}/result`;
|
|
12
11
|
var REQUEST = `${ADDON_ID2}/request`;
|
|
13
12
|
var RUNNING = `${ADDON_ID2}/running`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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_gak8rrbjnbb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EBTWRVJW.js";
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/picocolors/picocolors.js
|
|
18
18
|
var require_picocolors = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -19,7 +19,6 @@ var DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-th
|
|
|
19
19
|
// ../a11y/src/constants.ts
|
|
20
20
|
var ADDON_ID2 = "storybook/a11y";
|
|
21
21
|
var PANEL_ID2 = `${ADDON_ID2}/panel`;
|
|
22
|
-
var UI_STATE_ID = `${ADDON_ID2}/ui`;
|
|
23
22
|
var RESULT = `${ADDON_ID2}/result`;
|
|
24
23
|
var REQUEST = `${ADDON_ID2}/request`;
|
|
25
24
|
var RUNNING = `${ADDON_ID2}/running`;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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
|
__name
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EBTWRVJW.js";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
17
17
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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-MNO64KI6.js";
|
|
15
15
|
import {
|
|
16
16
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-54L6M5PF.js";
|
|
18
18
|
import {
|
|
19
19
|
__name,
|
|
20
20
|
__toESM
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-EBTWRVJW.js";
|
|
22
22
|
|
|
23
23
|
// src/logger.ts
|
|
24
24
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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_gak8rrbjnbb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__name
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EBTWRVJW.js";
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/semver/internal/constants.js
|
|
18
18
|
var require_constants = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,13 +12,13 @@ var require = CJS_COMPAT_NODE_MODULE_gak8rrbjnbb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
dirname,
|
|
14
14
|
join
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N3IVPIIG.js";
|
|
16
16
|
import {
|
|
17
17
|
__commonJS,
|
|
18
18
|
__name,
|
|
19
19
|
__require,
|
|
20
20
|
__toESM
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-EBTWRVJW.js";
|
|
22
22
|
|
|
23
23
|
// ../../node_modules/isexe/windows.js
|
|
24
24
|
var require_windows = __commonJS({
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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
|
__name
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EBTWRVJW.js";
|
|
15
15
|
|
|
16
16
|
// src/utils.ts
|
|
17
17
|
function getAddonNames(mainConfig) {
|
package/dist/manager.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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-S6NBXJD5.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__name,
|
|
18
18
|
__require,
|
|
19
19
|
__toESM
|
|
20
|
-
} from "../_node-chunks/chunk-
|
|
20
|
+
} from "../_node-chunks/chunk-EBTWRVJW.js";
|
|
21
21
|
|
|
22
22
|
// ../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
|
|
23
23
|
var require_make_dir = __commonJS({
|
package/dist/node/vitest.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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-S4OYSNCY.js";
|
|
15
15
|
import {
|
|
16
16
|
any,
|
|
17
17
|
errorToErrorLike
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-YRSMPC6L.js";
|
|
19
19
|
import {
|
|
20
20
|
ADDON_ID,
|
|
21
21
|
COVERAGE_DIRECTORY,
|
|
22
22
|
STATUS_TYPE_ID_A11Y,
|
|
23
23
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
24
24
|
storeOptions
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
25
|
+
} from "../_node-chunks/chunk-MNO64KI6.js";
|
|
26
|
+
import "../_node-chunks/chunk-54L6M5PF.js";
|
|
27
27
|
import {
|
|
28
28
|
dirname,
|
|
29
29
|
join,
|
|
30
30
|
normalize,
|
|
31
31
|
path
|
|
32
|
-
} from "../_node-chunks/chunk-
|
|
32
|
+
} from "../_node-chunks/chunk-N3IVPIIG.js";
|
|
33
33
|
import {
|
|
34
34
|
__name
|
|
35
|
-
} from "../_node-chunks/chunk-
|
|
35
|
+
} from "../_node-chunks/chunk-EBTWRVJW.js";
|
|
36
36
|
|
|
37
37
|
// src/node/vitest.ts
|
|
38
38
|
import process2 from "node:process";
|
|
@@ -234,7 +234,7 @@ var StorybookReporter = class {
|
|
|
234
234
|
this.ctx.state.pathsSet.clear();
|
|
235
235
|
this.ctx.state.idMap.clear();
|
|
236
236
|
this.ctx.state.errorsSet.clear();
|
|
237
|
-
this.ctx.state.processTimeoutCauses
|
|
237
|
+
this.ctx.state.processTimeoutCauses.clear();
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
|
|
@@ -350,15 +350,12 @@ Please install the @vitest/${coveragePackage} package to collect coverage
|
|
|
350
350
|
this.vitest?.setGlobalTestNamePattern("");
|
|
351
351
|
}
|
|
352
352
|
updateLastChanged(filepath) {
|
|
353
|
-
this.vitest.
|
|
353
|
+
const projects = this.vitest.getModuleProjects(filepath);
|
|
354
|
+
projects.forEach(({ server, browser }) => {
|
|
354
355
|
if (server) {
|
|
355
356
|
const serverMods = server.moduleGraph.getModulesByFile(filepath);
|
|
356
357
|
serverMods?.forEach((mod) => server.moduleGraph.invalidateModule(mod));
|
|
357
358
|
}
|
|
358
|
-
if (vite) {
|
|
359
|
-
const serverMods = vite.moduleGraph.getModulesByFile(filepath);
|
|
360
|
-
serverMods?.forEach((mod) => vite.moduleGraph.invalidateModule(mod));
|
|
361
|
-
}
|
|
362
359
|
if (browser) {
|
|
363
360
|
const browserMods = browser.vite.moduleGraph.getModulesByFile(filepath);
|
|
364
361
|
browserMods?.forEach((mod) => browser.vite.moduleGraph.invalidateModule(mod));
|
package/dist/postinstall.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,22 +12,22 @@ var require = CJS_COMPAT_NODE_MODULE_gak8rrbjnbb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
execa,
|
|
14
14
|
resolvePackageDir
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-VUPLOX7Y.js";
|
|
16
16
|
import {
|
|
17
17
|
any,
|
|
18
18
|
getAddonNames,
|
|
19
19
|
up
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-YRSMPC6L.js";
|
|
21
21
|
import {
|
|
22
22
|
DOCUMENTATION_LINK,
|
|
23
23
|
SUPPORTED_FRAMEWORKS
|
|
24
|
-
} from "./_node-chunks/chunk-
|
|
24
|
+
} from "./_node-chunks/chunk-MNO64KI6.js";
|
|
25
25
|
import {
|
|
26
26
|
dirname,
|
|
27
27
|
join,
|
|
28
28
|
relative,
|
|
29
29
|
resolve
|
|
30
|
-
} from "./_node-chunks/chunk-
|
|
30
|
+
} from "./_node-chunks/chunk-N3IVPIIG.js";
|
|
31
31
|
import {
|
|
32
32
|
require_compare,
|
|
33
33
|
require_constants,
|
|
@@ -37,12 +37,12 @@ import {
|
|
|
37
37
|
require_parse_options,
|
|
38
38
|
require_re,
|
|
39
39
|
require_semver
|
|
40
|
-
} from "./_node-chunks/chunk-
|
|
40
|
+
} from "./_node-chunks/chunk-S6NBXJD5.js";
|
|
41
41
|
import {
|
|
42
42
|
__commonJS,
|
|
43
43
|
__name,
|
|
44
44
|
__toESM
|
|
45
|
-
} from "./_node-chunks/chunk-
|
|
45
|
+
} from "./_node-chunks/chunk-EBTWRVJW.js";
|
|
46
46
|
|
|
47
47
|
// ../../node_modules/semver/functions/parse.js
|
|
48
48
|
var require_parse = __commonJS({
|
|
@@ -1616,7 +1616,10 @@ var updateConfigFile = /* @__PURE__ */ __name((source, target) => {
|
|
|
1616
1616
|
} else if (targetExportDefault.declaration.type === "CallExpression" && targetExportDefault.declaration.callee.type === "Identifier" && targetExportDefault.declaration.callee.name === "defineConfig" && targetExportDefault.declaration.arguments[0]?.type === "ObjectExpression") {
|
|
1617
1617
|
canHandleConfig = true;
|
|
1618
1618
|
} else if (targetExportDefault.declaration.type === "CallExpression" && targetExportDefault.declaration.callee.type === "Identifier" && targetExportDefault.declaration.callee.name === "mergeConfig" && targetExportDefault.declaration.arguments.length >= 2) {
|
|
1619
|
-
|
|
1619
|
+
const defineConfigNodes = targetExportDefault.declaration.arguments.filter(
|
|
1620
|
+
(arg) => arg?.type === "CallExpression" && arg.callee.type === "Identifier" && arg.callee.name === "defineConfig" && arg.arguments[0]?.type === "ObjectExpression"
|
|
1621
|
+
);
|
|
1622
|
+
canHandleConfig = defineConfigNodes.length > 0;
|
|
1620
1623
|
}
|
|
1621
1624
|
if (!canHandleConfig) {
|
|
1622
1625
|
return false;
|
|
@@ -1649,24 +1652,20 @@ var updateConfigFile = /* @__PURE__ */ __name((source, target) => {
|
|
|
1649
1652
|
mergeProperties(properties, exportDefault.declaration.arguments[0].properties);
|
|
1650
1653
|
updated = true;
|
|
1651
1654
|
} else if (exportDefault.declaration.type === "CallExpression" && exportDefault.declaration.callee.type === "Identifier" && exportDefault.declaration.callee.name === "mergeConfig" && exportDefault.declaration.arguments.length >= 2) {
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
configObjectNodes.push(arg);
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
const configObjectWithTest = configObjectNodes.find(
|
|
1661
|
-
(obj) => obj.properties.some(
|
|
1655
|
+
const defineConfigNodes = exportDefault.declaration.arguments.filter(
|
|
1656
|
+
(arg) => arg?.type === "CallExpression" && arg.callee.type === "Identifier" && arg.callee.name === "defineConfig" && arg.arguments[0]?.type === "ObjectExpression"
|
|
1657
|
+
);
|
|
1658
|
+
const defineConfigNodeWithTest = defineConfigNodes.find(
|
|
1659
|
+
(node) => node.arguments[0].type === "ObjectExpression" && node.arguments[0].properties.some(
|
|
1662
1660
|
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "test"
|
|
1663
1661
|
)
|
|
1664
1662
|
);
|
|
1665
|
-
const
|
|
1666
|
-
if (!
|
|
1663
|
+
const defineConfigNode = defineConfigNodeWithTest || defineConfigNodes[0];
|
|
1664
|
+
if (!defineConfigNode) {
|
|
1667
1665
|
return false;
|
|
1668
1666
|
}
|
|
1669
|
-
const
|
|
1667
|
+
const defineConfigProps = defineConfigNode.arguments[0];
|
|
1668
|
+
const existingTestProp = defineConfigProps.properties.find(
|
|
1670
1669
|
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "test"
|
|
1671
1670
|
);
|
|
1672
1671
|
if (existingTestProp && existingTestProp.value.type === "ObjectExpression") {
|
|
@@ -1678,16 +1677,6 @@ var updateConfigFile = /* @__PURE__ */ __name((source, target) => {
|
|
|
1678
1677
|
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && (p.key.name === "workspace" || p.key.name === "projects")
|
|
1679
1678
|
);
|
|
1680
1679
|
if (workspaceOrProjectsProp && workspaceOrProjectsProp.value.type === "ArrayExpression") {
|
|
1681
|
-
const coverageProp = existingTestProp.value.properties.find(
|
|
1682
|
-
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "coverage"
|
|
1683
|
-
);
|
|
1684
|
-
const testPropsWithoutCoverage = existingTestProp.value.properties.filter(
|
|
1685
|
-
(p) => p !== coverageProp
|
|
1686
|
-
);
|
|
1687
|
-
const testConfigForProject = {
|
|
1688
|
-
type: "ObjectExpression",
|
|
1689
|
-
properties: testPropsWithoutCoverage
|
|
1690
|
-
};
|
|
1691
1680
|
const existingTestProject = {
|
|
1692
1681
|
type: "ObjectExpression",
|
|
1693
1682
|
properties: [
|
|
@@ -1701,28 +1690,25 @@ var updateConfigFile = /* @__PURE__ */ __name((source, target) => {
|
|
|
1701
1690
|
{
|
|
1702
1691
|
type: "ObjectProperty",
|
|
1703
1692
|
key: { type: "Identifier", name: "test" },
|
|
1704
|
-
value:
|
|
1693
|
+
value: existingTestProp.value,
|
|
1705
1694
|
computed: false,
|
|
1706
1695
|
shorthand: false
|
|
1707
1696
|
}
|
|
1708
1697
|
]
|
|
1709
1698
|
};
|
|
1710
1699
|
workspaceOrProjectsProp.value.elements.unshift(existingTestProject);
|
|
1711
|
-
|
|
1700
|
+
defineConfigProps.properties = defineConfigProps.properties.filter(
|
|
1712
1701
|
(p) => p !== existingTestProp
|
|
1713
1702
|
);
|
|
1714
|
-
|
|
1715
|
-
templateTestProp.value.properties.unshift(coverageProp);
|
|
1716
|
-
}
|
|
1717
|
-
mergeProperties(properties, targetConfigObject.properties);
|
|
1703
|
+
mergeProperties(properties, defineConfigProps.properties);
|
|
1718
1704
|
} else {
|
|
1719
|
-
mergeProperties(properties,
|
|
1705
|
+
mergeProperties(properties, defineConfigProps.properties);
|
|
1720
1706
|
}
|
|
1721
1707
|
} else {
|
|
1722
|
-
mergeProperties(properties,
|
|
1708
|
+
mergeProperties(properties, defineConfigProps.properties);
|
|
1723
1709
|
}
|
|
1724
1710
|
} else {
|
|
1725
|
-
mergeProperties(properties,
|
|
1711
|
+
mergeProperties(properties, defineConfigProps.properties);
|
|
1726
1712
|
}
|
|
1727
1713
|
updated = true;
|
|
1728
1714
|
}
|
|
@@ -1805,18 +1791,12 @@ async function postInstall(options) {
|
|
|
1805
1791
|
const packageManager = JsPackageManagerFactory.getPackageManager({
|
|
1806
1792
|
force: options.packageManager
|
|
1807
1793
|
});
|
|
1808
|
-
const vitestVersionSpecifier = await packageManager.getInstalledVersion("vitest");
|
|
1809
|
-
const coercedVitestVersion = vitestVersionSpecifier ? (0, import_semver.coerce)(vitestVersionSpecifier) : null;
|
|
1810
|
-
const isVitest3_2To4 = vitestVersionSpecifier ? (0, import_semver.satisfies)(vitestVersionSpecifier, ">=3.2.0 <4.0.0") : false;
|
|
1811
|
-
const isVitest4OrNewer = vitestVersionSpecifier ? (0, import_semver.satisfies)(vitestVersionSpecifier, ">=4.0.0") : true;
|
|
1812
1794
|
const info2 = await getStorybookInfo(options);
|
|
1813
1795
|
const allDeps = packageManager.getAllDependencies();
|
|
1814
|
-
const dependencies = [
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
];
|
|
1819
|
-
const uniqueDependencies = dependencies.filter((p) => !allDeps[p]);
|
|
1796
|
+
const dependencies = ["vitest", "@vitest/browser", "playwright"].filter((p) => !allDeps[p]);
|
|
1797
|
+
const vitestVersionSpecifier = await packageManager.getInstalledVersion("vitest");
|
|
1798
|
+
const coercedVitestVersion = vitestVersionSpecifier ? (0, import_semver.coerce)(vitestVersionSpecifier) : null;
|
|
1799
|
+
const isVitest3_2OrNewer = vitestVersionSpecifier ? (0, import_semver.satisfies)(vitestVersionSpecifier, ">=3.2.0") : true;
|
|
1820
1800
|
const mainJsPath = getInterpretedFile(resolve(options.configDir, "main"));
|
|
1821
1801
|
const config = await readConfig(mainJsPath);
|
|
1822
1802
|
const hasCustomWebpackConfig = !!config.getFieldNode(["webpackFinal"]);
|
|
@@ -1950,7 +1930,7 @@ async function postInstall(options) {
|
|
|
1950
1930
|
);
|
|
1951
1931
|
try {
|
|
1952
1932
|
const storybookVersion = await packageManager.getInstalledVersion("storybook");
|
|
1953
|
-
|
|
1933
|
+
dependencies.push(`@storybook/nextjs-vite@^${storybookVersion}`);
|
|
1954
1934
|
} catch (e) {
|
|
1955
1935
|
console.error("Failed to install @storybook/nextjs-vite. Please install it manually");
|
|
1956
1936
|
}
|
|
@@ -1967,9 +1947,9 @@ async function postInstall(options) {
|
|
|
1967
1947
|
Read more about Vitest coverage providers at https://vitest.dev/guide/coverage.html#coverage-providers
|
|
1968
1948
|
`
|
|
1969
1949
|
);
|
|
1970
|
-
|
|
1950
|
+
dependencies.push(`@vitest/coverage-v8`);
|
|
1971
1951
|
}
|
|
1972
|
-
const versionedDependencies =
|
|
1952
|
+
const versionedDependencies = dependencies.map((p) => {
|
|
1973
1953
|
if (p.includes("vitest")) {
|
|
1974
1954
|
return vitestVersionSpecifier ? `${p}@${vitestVersionSpecifier}` : p;
|
|
1975
1955
|
}
|
|
@@ -2039,29 +2019,28 @@ async function postInstall(options) {
|
|
|
2039
2019
|
setProjectAnnotations([${projectAnnotations.join(", ")}]);
|
|
2040
2020
|
`
|
|
2041
2021
|
);
|
|
2042
|
-
const vitestWorkspaceFile = findFile("vitest.workspace", [".ts", ".js", ".json"]);
|
|
2022
|
+
const vitestWorkspaceFile = findFile("vitest.workspace", [".ts", ".js", ".json"]) || findFile("vitest.projects", [".ts", ".js", ".json"]);
|
|
2043
2023
|
const viteConfigFile = findFile("vite.config");
|
|
2044
2024
|
const vitestConfigFile = findFile("vitest.config");
|
|
2045
2025
|
const vitestShimFile = findFile("vitest.shims.d");
|
|
2046
2026
|
const rootConfig = vitestConfigFile || viteConfigFile;
|
|
2027
|
+
const browserConfig = `{
|
|
2028
|
+
enabled: true,
|
|
2029
|
+
headless: true,
|
|
2030
|
+
provider: 'playwright',
|
|
2031
|
+
instances: [{ browser: 'chromium' }]
|
|
2032
|
+
}`;
|
|
2047
2033
|
if (fileExtension === "ts" && !vitestShimFile) {
|
|
2048
2034
|
await writeFile(
|
|
2049
2035
|
"vitest.shims.d.ts",
|
|
2050
|
-
|
|
2036
|
+
'/// <reference types="@vitest/browser/providers/playwright" />'
|
|
2051
2037
|
);
|
|
2052
2038
|
}
|
|
2053
|
-
const getTemplateName = /* @__PURE__ */ __name(() => {
|
|
2054
|
-
if (isVitest4OrNewer) {
|
|
2055
|
-
return "vitest.config.4.template.ts";
|
|
2056
|
-
} else if (isVitest3_2To4) {
|
|
2057
|
-
return "vitest.config.3.2.template.ts";
|
|
2058
|
-
}
|
|
2059
|
-
return "vitest.config.template.ts";
|
|
2060
|
-
}, "getTemplateName");
|
|
2061
2039
|
if (vitestWorkspaceFile) {
|
|
2062
2040
|
const workspaceTemplate = await loadTemplate("vitest.workspace.template.ts", {
|
|
2063
2041
|
EXTENDS_WORKSPACE: viteConfigFile ? relative(dirname(vitestWorkspaceFile), viteConfigFile) : "",
|
|
2064
2042
|
CONFIG_DIR: options.configDir,
|
|
2043
|
+
BROWSER_CONFIG: browserConfig,
|
|
2065
2044
|
SETUP_FILE: relative(dirname(vitestWorkspaceFile), vitestSetupFile)
|
|
2066
2045
|
}).then((t) => t.replace(`
|
|
2067
2046
|
'ROOT_CONFIG',`, "").replace(/\s+extends: '',/, ""));
|
|
@@ -2095,13 +2074,15 @@ async function postInstall(options) {
|
|
|
2095
2074
|
} else if (rootConfig) {
|
|
2096
2075
|
let target, updated;
|
|
2097
2076
|
const configFile = await fs2.readFile(rootConfig, "utf8");
|
|
2077
|
+
const hasProjectsConfig = configFile.includes("projects:");
|
|
2098
2078
|
const configFileHasTypeReference = configFile.match(
|
|
2099
2079
|
/\/\/\/\s*<reference\s+types=["']vitest\/config["']\s*\/>/
|
|
2100
2080
|
);
|
|
2101
|
-
const templateName =
|
|
2081
|
+
const templateName = hasProjectsConfig || isVitest3_2OrNewer ? "vitest.config.3.2.template.ts" : "vitest.config.template.ts";
|
|
2102
2082
|
if (templateName) {
|
|
2103
2083
|
const configTemplate = await loadTemplate(templateName, {
|
|
2104
2084
|
CONFIG_DIR: options.configDir,
|
|
2085
|
+
BROWSER_CONFIG: browserConfig,
|
|
2105
2086
|
SETUP_FILE: relative(dirname(rootConfig), vitestSetupFile)
|
|
2106
2087
|
});
|
|
2107
2088
|
const source = babelParse(configTemplate);
|
|
@@ -2113,10 +2094,9 @@ async function postInstall(options) {
|
|
|
2113
2094
|
logger2.plain(`${step} Updating your ${vitestConfigFile ? "Vitest" : "Vite"} config file:`);
|
|
2114
2095
|
logger2.plain(` ${rootConfig}`);
|
|
2115
2096
|
const formattedContent = await formatFileContent(rootConfig, generate(target).code);
|
|
2116
|
-
const shouldAddReference = !configFileHasTypeReference && !vitestConfigFile;
|
|
2117
2097
|
await writeFile(
|
|
2118
2098
|
rootConfig,
|
|
2119
|
-
|
|
2099
|
+
configFileHasTypeReference ? formattedContent : '/// <reference types="vitest/config" />\n' + formattedContent
|
|
2120
2100
|
);
|
|
2121
2101
|
} else {
|
|
2122
2102
|
logErrors(
|
|
@@ -2131,10 +2111,14 @@ async function postInstall(options) {
|
|
|
2131
2111
|
}
|
|
2132
2112
|
} else {
|
|
2133
2113
|
const newConfigFile = resolve(`vitest.config.${fileExtension}`);
|
|
2134
|
-
const configTemplate = await loadTemplate(
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2114
|
+
const configTemplate = await loadTemplate(
|
|
2115
|
+
isVitest3_2OrNewer ? "vitest.config.3.2.template.ts" : "vitest.config.template.ts",
|
|
2116
|
+
{
|
|
2117
|
+
CONFIG_DIR: options.configDir,
|
|
2118
|
+
BROWSER_CONFIG: browserConfig,
|
|
2119
|
+
SETUP_FILE: relative(dirname(newConfigFile), vitestSetupFile)
|
|
2120
|
+
}
|
|
2121
|
+
);
|
|
2138
2122
|
logger2.line(1);
|
|
2139
2123
|
logger2.plain(`${step} Creating a Vitest config file:`);
|
|
2140
2124
|
logger2.plain(` ${newConfigFile}`);
|
|
@@ -2145,23 +2129,21 @@ async function postInstall(options) {
|
|
|
2145
2129
|
if (a11yAddon) {
|
|
2146
2130
|
try {
|
|
2147
2131
|
logger2.plain(`${step} Setting up ${addonA11yName} for @storybook/addon-vitest:`);
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
}
|
|
2164
|
-
);
|
|
2132
|
+
const command = ["automigrate", "addon-a11y-addon-test"];
|
|
2133
|
+
command.push("--loglevel", "silent");
|
|
2134
|
+
command.push("--yes", "--skip-doctor");
|
|
2135
|
+
if (options.packageManager) {
|
|
2136
|
+
command.push("--package-manager", options.packageManager);
|
|
2137
|
+
}
|
|
2138
|
+
if (options.skipInstall) {
|
|
2139
|
+
command.push("--skip-install");
|
|
2140
|
+
}
|
|
2141
|
+
if (options.configDir !== ".storybook") {
|
|
2142
|
+
command.push("--config-dir", `"${options.configDir}"`);
|
|
2143
|
+
}
|
|
2144
|
+
await execa("storybook", command, {
|
|
2145
|
+
stdio: "inherit"
|
|
2146
|
+
});
|
|
2165
2147
|
} catch (e) {
|
|
2166
2148
|
logErrors(
|
|
2167
2149
|
"\u{1F6A8} Oh no!",
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,11 +12,11 @@ var require = CJS_COMPAT_NODE_MODULE_gak8rrbjnbb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
log,
|
|
14
14
|
noop
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-S4OYSNCY.js";
|
|
16
16
|
import {
|
|
17
17
|
execaNode,
|
|
18
18
|
importMetaResolve
|
|
19
|
-
} from "./_node-chunks/chunk-
|
|
19
|
+
} from "./_node-chunks/chunk-VUPLOX7Y.js";
|
|
20
20
|
import {
|
|
21
21
|
ADDON_ID,
|
|
22
22
|
COVERAGE_DIRECTORY,
|
|
@@ -25,17 +25,17 @@ import {
|
|
|
25
25
|
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
26
26
|
TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
|
|
27
27
|
storeOptions
|
|
28
|
-
} from "./_node-chunks/chunk-
|
|
28
|
+
} from "./_node-chunks/chunk-MNO64KI6.js";
|
|
29
29
|
import {
|
|
30
30
|
require_picocolors
|
|
31
|
-
} from "./_node-chunks/chunk-
|
|
31
|
+
} from "./_node-chunks/chunk-54L6M5PF.js";
|
|
32
32
|
import {
|
|
33
33
|
normalize
|
|
34
|
-
} from "./_node-chunks/chunk-
|
|
34
|
+
} from "./_node-chunks/chunk-N3IVPIIG.js";
|
|
35
35
|
import {
|
|
36
36
|
__name,
|
|
37
37
|
__toESM
|
|
38
|
-
} from "./_node-chunks/chunk-
|
|
38
|
+
} from "./_node-chunks/chunk-EBTWRVJW.js";
|
|
39
39
|
|
|
40
40
|
// src/preset.ts
|
|
41
41
|
import { mkdir } from "node:fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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-
|
|
17
|
+
} from "../_node-chunks/chunk-EBTWRVJW.js";
|
|
18
18
|
|
|
19
19
|
// ../../node_modules/tree-kill/index.js
|
|
20
20
|
var require_tree_kill = __commonJS({
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_g10epgk91bd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_g10epgk91bd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_g10epgk91bd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_g10epgk91bd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_g10epgk91bd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_g10epgk91bd.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-54L6M5PF.js";
|
|
15
15
|
import {
|
|
16
16
|
join,
|
|
17
17
|
normalize,
|
|
18
18
|
relative,
|
|
19
19
|
resolve,
|
|
20
20
|
sep
|
|
21
|
-
} from "../_node-chunks/chunk-
|
|
21
|
+
} from "../_node-chunks/chunk-N3IVPIIG.js";
|
|
22
22
|
import {
|
|
23
23
|
__commonJS,
|
|
24
24
|
__name,
|
|
25
25
|
__require,
|
|
26
26
|
__toESM
|
|
27
|
-
} from "../_node-chunks/chunk-
|
|
27
|
+
} from "../_node-chunks/chunk-EBTWRVJW.js";
|
|
28
28
|
|
|
29
29
|
// ../../node_modules/braces/lib/utils.js
|
|
30
30
|
var require_utils = __commonJS({
|
|
@@ -3683,7 +3683,6 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
|
|
|
3683
3683
|
join(relative(finalOptions.vitestRoot, process.cwd()), "**/*.mdx").replaceAll(sep, "/")
|
|
3684
3684
|
],
|
|
3685
3685
|
// if the existing deps.inline is true, we keep it as-is, because it will inline everything
|
|
3686
|
-
// TODO: Remove the check once we don't support Vitest 3 anymore
|
|
3687
3686
|
...nonMutableInputConfig.test?.server?.deps?.inline !== true ? {
|
|
3688
3687
|
server: {
|
|
3689
3688
|
deps: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-vitest",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-32799-sha-e72c6b25",
|
|
4
4
|
"description": "Storybook Vitest addon: Blazing fast component testing using stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@types/micromatch": "^4.0.0",
|
|
83
83
|
"@types/node": "^22.0.0",
|
|
84
84
|
"@types/semver": "^7",
|
|
85
|
-
"@vitest/browser
|
|
86
|
-
"@vitest/runner": "^
|
|
85
|
+
"@vitest/browser": "^3.2.4",
|
|
86
|
+
"@vitest/runner": "^3.2.4",
|
|
87
87
|
"boxen": "^8.0.1",
|
|
88
88
|
"empathic": "^2.0.0",
|
|
89
89
|
"es-toolkit": "^1.36.0",
|
|
@@ -101,22 +101,18 @@
|
|
|
101
101
|
"tree-kill": "^1.2.2",
|
|
102
102
|
"ts-dedent": "^2.2.0",
|
|
103
103
|
"typescript": "^5.8.3",
|
|
104
|
-
"vitest": "^
|
|
104
|
+
"vitest": "^3.2.4"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@vitest/browser": "^3.0.0
|
|
108
|
-
"@vitest/
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"vitest": "^3.0.0 || ^4.0.0"
|
|
107
|
+
"@vitest/browser": "^3.0.0",
|
|
108
|
+
"@vitest/runner": "^3.0.0",
|
|
109
|
+
"storybook": "^0.0.0-pr-32799-sha-e72c6b25",
|
|
110
|
+
"vitest": "^3.0.0"
|
|
112
111
|
},
|
|
113
112
|
"peerDependenciesMeta": {
|
|
114
113
|
"@vitest/browser": {
|
|
115
114
|
"optional": true
|
|
116
115
|
},
|
|
117
|
-
"@vitest/browser-playwright": {
|
|
118
|
-
"optional": true
|
|
119
|
-
},
|
|
120
116
|
"@vitest/runner": {
|
|
121
117
|
"optional": true
|
|
122
118
|
},
|
|
@@ -21,12 +21,7 @@ export default defineConfig({
|
|
|
21
21
|
],
|
|
22
22
|
test: {
|
|
23
23
|
name: 'storybook',
|
|
24
|
-
browser:
|
|
25
|
-
enabled: true,
|
|
26
|
-
headless: true,
|
|
27
|
-
provider: 'playwright',
|
|
28
|
-
instances: [{ browser: 'chromium' }],
|
|
29
|
-
},
|
|
24
|
+
browser: BROWSER_CONFIG,
|
|
30
25
|
setupFiles: ['SETUP_FILE'],
|
|
31
26
|
},
|
|
32
27
|
},
|
|
@@ -21,12 +21,7 @@ export default defineConfig({
|
|
|
21
21
|
],
|
|
22
22
|
test: {
|
|
23
23
|
name: 'storybook',
|
|
24
|
-
browser:
|
|
25
|
-
enabled: true,
|
|
26
|
-
headless: true,
|
|
27
|
-
provider: 'playwright',
|
|
28
|
-
instances: [{ browser: 'chromium' }],
|
|
29
|
-
},
|
|
24
|
+
browser: BROWSER_CONFIG,
|
|
30
25
|
setupFiles: ['SETUP_FILE'],
|
|
31
26
|
},
|
|
32
27
|
},
|
|
@@ -20,12 +20,7 @@ export default defineWorkspace([
|
|
|
20
20
|
],
|
|
21
21
|
test: {
|
|
22
22
|
name: 'storybook',
|
|
23
|
-
browser:
|
|
24
|
-
enabled: true,
|
|
25
|
-
headless: true,
|
|
26
|
-
provider: 'playwright',
|
|
27
|
-
instances: [{ browser: 'chromium' }],
|
|
28
|
-
},
|
|
23
|
+
browser: BROWSER_CONFIG,
|
|
29
24
|
setupFiles: ['SETUP_FILE'],
|
|
30
25
|
},
|
|
31
26
|
},
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
import { defineConfig } from 'vitest/config';
|
|
5
|
-
|
|
6
|
-
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
-
|
|
8
|
-
import { playwright } from '@vitest/browser-playwright';
|
|
9
|
-
|
|
10
|
-
const dirname =
|
|
11
|
-
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
|
|
13
|
-
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
|
14
|
-
export default defineConfig({
|
|
15
|
-
test: {
|
|
16
|
-
projects: [
|
|
17
|
-
{
|
|
18
|
-
extends: true,
|
|
19
|
-
plugins: [
|
|
20
|
-
// The plugin will run tests for the stories defined in your Storybook config
|
|
21
|
-
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
22
|
-
storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
|
|
23
|
-
],
|
|
24
|
-
test: {
|
|
25
|
-
name: 'storybook',
|
|
26
|
-
browser: {
|
|
27
|
-
enabled: true,
|
|
28
|
-
headless: true,
|
|
29
|
-
provider: playwright({}),
|
|
30
|
-
instances: [{ browser: 'chromium' }],
|
|
31
|
-
},
|
|
32
|
-
setupFiles: ['SETUP_FILE'],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
});
|