@storybook/addon-vitest 10.1.0-alpha.12 → 10.1.0-alpha.13
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-AB3B3FVZ.js → chunk-25N73QA4.js} +6 -31
- package/dist/_node-chunks/{chunk-PCFYAAN7.js → chunk-6K4PB6ZM.js} +6 -6
- package/dist/_node-chunks/{chunk-2CDZI4WP.js → chunk-CWEKNW53.js} +7 -7
- package/dist/_node-chunks/{chunk-IC274GVS.js → chunk-F3U6JEPX.js} +6 -6
- package/dist/_node-chunks/{chunk-5ZI5GUBS.js → chunk-FJKQJ53U.js} +7 -19
- package/dist/_node-chunks/chunk-HKZ24UC3.js +158 -0
- package/dist/_node-chunks/chunk-IZMDFVYT.js +61 -0
- package/dist/_node-chunks/{chunk-STKK7R3Q.js → chunk-NT7JGKSQ.js} +7 -7
- package/dist/_node-chunks/chunk-XHF2DJDH.js +38 -0
- package/dist/manager.js +1 -1
- 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 +30 -25
- 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/_browser-chunks/{chunk-ULSHVN74.js → chunk-TYJENCK5.js} +0 -0
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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
|
-
|
|
30
13
|
// ../../node_modules/empathic/find.mjs
|
|
31
14
|
import { join as join2 } from "node:path";
|
|
32
15
|
import { existsSync, statSync } from "node:fs";
|
|
@@ -49,11 +32,6 @@ function up(base, options) {
|
|
|
49
32
|
}
|
|
50
33
|
|
|
51
34
|
// ../../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
|
-
}
|
|
57
35
|
function any(names, options) {
|
|
58
36
|
let dir, start = options && options.cwd || "", j = 0, len = names.length, tmp;
|
|
59
37
|
for (dir of up(start, options))
|
|
@@ -62,8 +40,5 @@ function any(names, options) {
|
|
|
62
40
|
}
|
|
63
41
|
|
|
64
42
|
export {
|
|
65
|
-
getAddonNames,
|
|
66
|
-
errorToErrorLike,
|
|
67
|
-
up2 as up,
|
|
68
43
|
any
|
|
69
44
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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-6K4PB6ZM.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_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -19,18 +19,7 @@ var UI_STATE_ID = `${ADDON_ID2}/ui`, RESULT = `${ADDON_ID2}/result`, REQUEST = `
|
|
|
19
19
|
|
|
20
20
|
// src/constants.ts
|
|
21
21
|
var ADDON_ID3 = "storybook/test", TEST_PROVIDER_ID = `${ADDON_ID3}/test-provider`, STORYBOOK_ADDON_TEST_CHANNEL = "STORYBOOK_ADDON_TEST_CHANNEL";
|
|
22
|
-
var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`, COVERAGE_DIRECTORY = "coverage",
|
|
23
|
-
"@storybook/nextjs",
|
|
24
|
-
"@storybook/nextjs-vite",
|
|
25
|
-
"@storybook/react-vite",
|
|
26
|
-
"@storybook/preact-vite",
|
|
27
|
-
"@storybook/svelte-vite",
|
|
28
|
-
"@storybook/vue3-vite",
|
|
29
|
-
"@storybook/html-vite",
|
|
30
|
-
"@storybook/web-components-vite",
|
|
31
|
-
"@storybook/sveltekit",
|
|
32
|
-
"@storybook/react-native-web-vite"
|
|
33
|
-
], storeOptions = {
|
|
22
|
+
var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`, COVERAGE_DIRECTORY = "coverage", storeOptions = {
|
|
34
23
|
id: ADDON_ID3,
|
|
35
24
|
initialState: {
|
|
36
25
|
config: {
|
|
@@ -73,7 +62,6 @@ export {
|
|
|
73
62
|
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
74
63
|
DOCUMENTATION_LINK3 as DOCUMENTATION_LINK,
|
|
75
64
|
COVERAGE_DIRECTORY,
|
|
76
|
-
SUPPORTED_FRAMEWORKS,
|
|
77
65
|
storeOptions,
|
|
78
66
|
STORE_CHANNEL_EVENT_NAME,
|
|
79
67
|
STATUS_STORE_CHANNEL_EVENT_NAME,
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
dirname,
|
|
14
|
+
join
|
|
15
|
+
} from "./chunk-F3U6JEPX.js";
|
|
16
|
+
|
|
17
|
+
// ../../core/src/shared/utils/module.ts
|
|
18
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/exsolve/dist/index.mjs
|
|
21
|
+
import assert from "node:assert";
|
|
22
|
+
import v8 from "node:v8";
|
|
23
|
+
import { format, inspect } from "node:util";
|
|
24
|
+
var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
|
25
|
+
"string",
|
|
26
|
+
"function",
|
|
27
|
+
"number",
|
|
28
|
+
"object",
|
|
29
|
+
"Function",
|
|
30
|
+
"Object",
|
|
31
|
+
"boolean",
|
|
32
|
+
"bigint",
|
|
33
|
+
"symbol"
|
|
34
|
+
]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
|
|
35
|
+
function formatList(array, type = "and") {
|
|
36
|
+
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
37
|
+
}
|
|
38
|
+
function createError(sym, value, constructor) {
|
|
39
|
+
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
|
40
|
+
}
|
|
41
|
+
function makeNodeErrorWithCode(Base, key) {
|
|
42
|
+
return function(...parameters) {
|
|
43
|
+
let limit = Error.stackTraceLimit;
|
|
44
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
45
|
+
let error = new Base();
|
|
46
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
|
|
47
|
+
let message = getMessage(key, parameters, error);
|
|
48
|
+
return Object.defineProperties(error, {
|
|
49
|
+
message: {
|
|
50
|
+
value: message,
|
|
51
|
+
enumerable: !1,
|
|
52
|
+
writable: !0,
|
|
53
|
+
configurable: !0
|
|
54
|
+
},
|
|
55
|
+
toString: {
|
|
56
|
+
value() {
|
|
57
|
+
return `${this.name} [${key}]: ${this.message}`;
|
|
58
|
+
},
|
|
59
|
+
enumerable: !1,
|
|
60
|
+
writable: !0,
|
|
61
|
+
configurable: !0
|
|
62
|
+
}
|
|
63
|
+
}), captureLargerStackTrace(error), error.code = key, error;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function isErrorStackTraceLimitWritable() {
|
|
67
|
+
try {
|
|
68
|
+
if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
72
|
+
return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
73
|
+
}
|
|
74
|
+
function hideStackFrames(wrappedFunction) {
|
|
75
|
+
let hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
76
|
+
return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
|
|
77
|
+
}
|
|
78
|
+
var captureLargerStackTrace = hideStackFrames(function(error) {
|
|
79
|
+
let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
80
|
+
return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
|
|
81
|
+
});
|
|
82
|
+
function getMessage(key, parameters, self) {
|
|
83
|
+
let message = messages.get(key);
|
|
84
|
+
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
|
85
|
+
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
|
86
|
+
let regex = /%[dfijoOs]/g, expectedLength = 0;
|
|
87
|
+
for (; regex.exec(message) !== null; ) expectedLength++;
|
|
88
|
+
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
|
89
|
+
}
|
|
90
|
+
function determineSpecificType(value) {
|
|
91
|
+
if (value == null) return String(value);
|
|
92
|
+
if (typeof value == "function" && value.name) return `function ${value.name}`;
|
|
93
|
+
if (typeof value == "object")
|
|
94
|
+
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
|
95
|
+
let inspected = inspect(value, { colors: !1 });
|
|
96
|
+
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
|
|
97
|
+
}
|
|
98
|
+
var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
99
|
+
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
|
100
|
+
let message = "The ";
|
|
101
|
+
if (name.endsWith(" argument")) message += `${name} `;
|
|
102
|
+
else {
|
|
103
|
+
let type = name.includes(".") ? "property" : "argument";
|
|
104
|
+
message += `"${name}" ${type} `;
|
|
105
|
+
}
|
|
106
|
+
message += "must be ";
|
|
107
|
+
let types = [], instances = [], other = [];
|
|
108
|
+
for (let value of expected)
|
|
109
|
+
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
|
110
|
+
if (instances.length > 0) {
|
|
111
|
+
let pos = types.indexOf("object");
|
|
112
|
+
pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
|
|
113
|
+
}
|
|
114
|
+
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
|
115
|
+
}, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
116
|
+
"ERR_INVALID_MODULE_SPECIFIER",
|
|
117
|
+
/**
|
|
118
|
+
* @param {string} request
|
|
119
|
+
* @param {string} reason
|
|
120
|
+
* @param {string} [base]
|
|
121
|
+
*/
|
|
122
|
+
(request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
|
|
123
|
+
TypeError
|
|
124
|
+
), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
|
125
|
+
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
126
|
+
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
127
|
+
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
128
|
+
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
129
|
+
/**
|
|
130
|
+
* @param {string} packagePath
|
|
131
|
+
* @param {string} subpath
|
|
132
|
+
* @param {string} [base]
|
|
133
|
+
*/
|
|
134
|
+
(packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
|
|
135
|
+
Error
|
|
136
|
+
), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
137
|
+
let inspected = inspect(value);
|
|
138
|
+
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
139
|
+
}, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
|
|
140
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
141
|
+
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
142
|
+
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
143
|
+
|
|
144
|
+
// ../../core/src/shared/utils/module.ts
|
|
145
|
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
146
|
+
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
147
|
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
|
|
148
|
+
try {
|
|
149
|
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
150
|
+
} catch {
|
|
151
|
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"))));
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
importMetaResolve,
|
|
157
|
+
resolvePackageDir
|
|
158
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__commonJS
|
|
14
|
+
} from "./chunk-6K4PB6ZM.js";
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/ts-dedent/dist/index.js
|
|
17
|
+
var require_dist = __commonJS({
|
|
18
|
+
"../../node_modules/ts-dedent/dist/index.js"(exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
21
|
+
exports.dedent = void 0;
|
|
22
|
+
function dedent(templ) {
|
|
23
|
+
for (var values = [], _i = 1; _i < arguments.length; _i++)
|
|
24
|
+
values[_i - 1] = arguments[_i];
|
|
25
|
+
var strings = Array.from(typeof templ == "string" ? [templ] : templ);
|
|
26
|
+
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
27
|
+
var indentLengths = strings.reduce(function(arr, str) {
|
|
28
|
+
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
|
|
29
|
+
return matches ? arr.concat(matches.map(function(match) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
32
|
+
})) : arr;
|
|
33
|
+
}, []);
|
|
34
|
+
if (indentLengths.length) {
|
|
35
|
+
var pattern_1 = new RegExp(`
|
|
36
|
+
[ ]{` + Math.min.apply(Math, indentLengths) + "}", "g");
|
|
37
|
+
strings = strings.map(function(str) {
|
|
38
|
+
return str.replace(pattern_1, `
|
|
39
|
+
`);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
strings[0] = strings[0].replace(/^\r?\n/, "");
|
|
43
|
+
var string = strings[0];
|
|
44
|
+
return values.forEach(function(value, i) {
|
|
45
|
+
var endentations = string.match(/(?:^|\n)( *)$/), endentation = endentations ? endentations[1] : "", indentedValue = value;
|
|
46
|
+
typeof value == "string" && value.includes(`
|
|
47
|
+
`) && (indentedValue = String(value).split(`
|
|
48
|
+
`).map(function(str, i2) {
|
|
49
|
+
return i2 === 0 ? str : "" + endentation + str;
|
|
50
|
+
}).join(`
|
|
51
|
+
`)), string += indentedValue + strings[i + 1];
|
|
52
|
+
}), string;
|
|
53
|
+
}
|
|
54
|
+
exports.dedent = dedent;
|
|
55
|
+
exports.default = dedent;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
require_dist
|
|
61
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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-6K4PB6ZM.js";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/picocolors/picocolors.js
|
|
17
17
|
var require_picocolors = __commonJS({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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-FJKQJ53U.js";
|
|
15
|
+
import {
|
|
16
|
+
require_picocolors
|
|
17
|
+
} from "./chunk-NT7JGKSQ.js";
|
|
18
|
+
import {
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-6K4PB6ZM.js";
|
|
21
|
+
|
|
22
|
+
// src/logger.ts
|
|
23
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
24
|
+
import { logger } from "storybook/internal/node-logger";
|
|
25
|
+
var log = (message) => {
|
|
26
|
+
logger.log(
|
|
27
|
+
`${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().replaceAll(/(│\n|│ )/g, "").trim()}`
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// ../../node_modules/es-toolkit/dist/function/noop.mjs
|
|
32
|
+
function noop() {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
noop,
|
|
37
|
+
log
|
|
38
|
+
};
|
package/dist/manager.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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-CWEKNW53.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-6K4PB6ZM.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,36 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_4nt6o51r4ah from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_4nt6o51r4ah from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_4nt6o51r4ah from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_4nt6o51r4ah.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_4nt6o51r4ah.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_4nt6o51r4ah.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-XHF2DJDH.js";
|
|
15
15
|
import {
|
|
16
|
-
any
|
|
17
|
-
|
|
18
|
-
} from "../_node-chunks/chunk-AB3B3FVZ.js";
|
|
16
|
+
any
|
|
17
|
+
} from "../_node-chunks/chunk-25N73QA4.js";
|
|
19
18
|
import {
|
|
20
19
|
ADDON_ID,
|
|
21
20
|
COVERAGE_DIRECTORY,
|
|
22
21
|
STATUS_TYPE_ID_A11Y,
|
|
23
22
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
24
23
|
storeOptions
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-FJKQJ53U.js";
|
|
25
|
+
import "../_node-chunks/chunk-NT7JGKSQ.js";
|
|
27
26
|
import {
|
|
28
27
|
dirname,
|
|
29
28
|
join,
|
|
30
29
|
normalize,
|
|
31
30
|
path
|
|
32
|
-
} from "../_node-chunks/chunk-
|
|
33
|
-
import "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-F3U6JEPX.js";
|
|
32
|
+
import "../_node-chunks/chunk-6K4PB6ZM.js";
|
|
34
33
|
|
|
35
34
|
// src/node/vitest.ts
|
|
36
35
|
import process2 from "node:process";
|
|
@@ -106,6 +105,17 @@ function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] }
|
|
|
106
105
|
return throttled.cancel = debounced.cancel, throttled.flush = debounced.flush, throttled;
|
|
107
106
|
}
|
|
108
107
|
|
|
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
|
+
|
|
109
119
|
// src/node/vitest-manager.ts
|
|
110
120
|
import { existsSync } from "node:fs";
|
|
111
121
|
import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
|