@storybook/addon-vitest 0.0.0-pr-32795-sha-d0cb3b7f → 0.0.0-pr-33092-sha-c8460b7a
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-TJXI7EIW.js → chunk-ULSHVN74.js} +1 -2
- package/dist/_node-chunks/{chunk-LG32FAEW.js → chunk-A4JN7TXM.js} +6 -6
- package/dist/_node-chunks/{chunk-Q5NYU4IV.js → chunk-BYNAAADB.js} +7 -7
- package/dist/_node-chunks/{chunk-VHEOYYGG.js → chunk-H6AFC5BW.js} +20 -8
- package/dist/_node-chunks/chunk-NRFGFKG2.js +1697 -0
- package/dist/_node-chunks/{chunk-UWIZFNU3.js → chunk-PO7D7KB7.js} +31 -6
- package/dist/_node-chunks/chunk-QPB2GCIO.js +35 -0
- package/dist/_node-chunks/{chunk-72IVIFSV.js → chunk-SXPPGPJV.js} +7 -7
- package/dist/_node-chunks/{chunk-INLJZPAT.js → chunk-UVEHSNL5.js} +6 -6
- package/dist/manager.js +2 -5
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +14 -24
- package/dist/postinstall.js +290 -152
- package/dist/preset.js +26 -31
- package/dist/vitest-plugin/global-setup.js +9 -8
- package/dist/vitest-plugin/index.js +32 -17
- package/dist/vitest-plugin/setup-file.js +1 -1
- package/package.json +7 -3
- package/dist/_node-chunks/chunk-CM4R7CX6.js +0 -158
- package/dist/_node-chunks/chunk-CZJGKP4S.js +0 -61
- package/dist/_node-chunks/chunk-LTPLPMIL.js +0 -38
|
@@ -1,15 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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
|
|
|
13
|
+
// src/utils.ts
|
|
14
|
+
function getAddonNames(mainConfig) {
|
|
15
|
+
return (mainConfig.addons || []).map((addon) => {
|
|
16
|
+
let name = "";
|
|
17
|
+
return typeof addon == "string" ? name = addon : typeof addon == "object" && (name = addon.name), name;
|
|
18
|
+
}).filter((item) => item != null);
|
|
19
|
+
}
|
|
20
|
+
function errorToErrorLike(error) {
|
|
21
|
+
return {
|
|
22
|
+
message: error.message,
|
|
23
|
+
name: error.name,
|
|
24
|
+
// avoid duplicating the error message in the stack trace
|
|
25
|
+
stack: error.stack?.replace(error.message, ""),
|
|
26
|
+
cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
// ../../node_modules/empathic/find.mjs
|
|
14
31
|
import { join as join2 } from "node:path";
|
|
15
32
|
import { existsSync, statSync } from "node:fs";
|
|
@@ -32,6 +49,11 @@ function up(base, options) {
|
|
|
32
49
|
}
|
|
33
50
|
|
|
34
51
|
// ../../node_modules/empathic/find.mjs
|
|
52
|
+
function up2(name, options) {
|
|
53
|
+
let dir, tmp, start = options && options.cwd || "";
|
|
54
|
+
for (dir of up(start, options))
|
|
55
|
+
if (tmp = join2(dir, name), existsSync(tmp)) return tmp;
|
|
56
|
+
}
|
|
35
57
|
function any(names, options) {
|
|
36
58
|
let dir, start = options && options.cwd || "", j = 0, len = names.length, tmp;
|
|
37
59
|
for (dir of up(start, options))
|
|
@@ -40,5 +62,8 @@ function any(names, options) {
|
|
|
40
62
|
}
|
|
41
63
|
|
|
42
64
|
export {
|
|
65
|
+
getAddonNames,
|
|
66
|
+
errorToErrorLike,
|
|
67
|
+
up2 as up,
|
|
43
68
|
any
|
|
44
69
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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-H6AFC5BW.js";
|
|
15
|
+
import {
|
|
16
|
+
require_picocolors
|
|
17
|
+
} from "./chunk-BYNAAADB.js";
|
|
18
|
+
import {
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-A4JN7TXM.js";
|
|
21
|
+
|
|
22
|
+
// src/logger.ts
|
|
23
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
24
|
+
var log = (message) => {
|
|
25
|
+
console.log(`${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().trim()}`);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/es-toolkit/dist/function/noop.mjs
|
|
29
|
+
function noop() {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
noop,
|
|
34
|
+
log
|
|
35
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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-A4JN7TXM.js";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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
|
@@ -7,10 +7,9 @@ import {
|
|
|
7
7
|
PANEL_ID2,
|
|
8
8
|
STATUS_TYPE_ID_A11Y,
|
|
9
9
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
10
|
-
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
11
10
|
TEST_PROVIDER_ID,
|
|
12
11
|
storeOptions
|
|
13
|
-
} from "./_browser-chunks/chunk-
|
|
12
|
+
} from "./_browser-chunks/chunk-ULSHVN74.js";
|
|
14
13
|
|
|
15
14
|
// src/manager.tsx
|
|
16
15
|
import React5, { useState as useState3 } from "react";
|
|
@@ -695,9 +694,7 @@ addons2.register(ADDON_ID2, (api) => {
|
|
|
695
694
|
store.setState((state) => ({
|
|
696
695
|
...state,
|
|
697
696
|
indexUrl: new URL("index.json", window.location.href).toString()
|
|
698
|
-
}))
|
|
699
|
-
api.emit(STORYBOOK_ADDON_TEST_CHANNEL, { type: "test-run-completed", payload });
|
|
700
|
-
});
|
|
697
|
+
}));
|
|
701
698
|
}), addons2.add(TEST_PROVIDER_ID, {
|
|
702
699
|
type: Addon_TypesEnum.experimental_TEST_PROVIDER,
|
|
703
700
|
render: () => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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-SXPPGPJV.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-A4JN7TXM.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,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_vshh9fntxdn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_vshh9fntxdn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_vshh9fntxdn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_vshh9fntxdn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_vshh9fntxdn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_vshh9fntxdn.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-QPB2GCIO.js";
|
|
15
15
|
import {
|
|
16
|
-
any
|
|
17
|
-
|
|
16
|
+
any,
|
|
17
|
+
errorToErrorLike
|
|
18
|
+
} from "../_node-chunks/chunk-PO7D7KB7.js";
|
|
18
19
|
import {
|
|
19
20
|
ADDON_ID,
|
|
20
21
|
COVERAGE_DIRECTORY,
|
|
21
22
|
STATUS_TYPE_ID_A11Y,
|
|
22
23
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
23
24
|
storeOptions
|
|
24
|
-
} from "../_node-chunks/chunk-
|
|
25
|
-
import "../_node-chunks/chunk-
|
|
25
|
+
} from "../_node-chunks/chunk-H6AFC5BW.js";
|
|
26
|
+
import "../_node-chunks/chunk-BYNAAADB.js";
|
|
26
27
|
import {
|
|
27
28
|
dirname,
|
|
28
29
|
join,
|
|
29
30
|
normalize,
|
|
30
31
|
path
|
|
31
|
-
} from "../_node-chunks/chunk-
|
|
32
|
-
import "../_node-chunks/chunk-
|
|
32
|
+
} from "../_node-chunks/chunk-UVEHSNL5.js";
|
|
33
|
+
import "../_node-chunks/chunk-A4JN7TXM.js";
|
|
33
34
|
|
|
34
35
|
// src/node/vitest.ts
|
|
35
36
|
import process2 from "node:process";
|
|
@@ -105,17 +106,6 @@ function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] }
|
|
|
105
106
|
return throttled.cancel = debounced.cancel, throttled.flush = debounced.flush, throttled;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
// src/utils.ts
|
|
109
|
-
function errorToErrorLike(error) {
|
|
110
|
-
return {
|
|
111
|
-
message: error.message,
|
|
112
|
-
name: error.name,
|
|
113
|
-
// avoid duplicating the error message in the stack trace
|
|
114
|
-
stack: error.stack?.replace(error.message, ""),
|
|
115
|
-
cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
109
|
// src/node/vitest-manager.ts
|
|
120
110
|
import { existsSync } from "node:fs";
|
|
121
111
|
import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
|