@storybook/addon-vitest 10.1.0-alpha.8 → 10.1.0-beta.0
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 +61 -0
- package/dist/_node-chunks/chunk-4GXXLLOJ.js +61 -0
- package/dist/_node-chunks/chunk-AP5IIXAM.js +339 -0
- package/dist/_node-chunks/chunk-BGBUUVQU.js +45 -0
- package/dist/_node-chunks/chunk-EDXFFK3M.js +38 -0
- package/dist/_node-chunks/chunk-ERO7LVWY.js +71 -0
- package/dist/_node-chunks/{chunk-E2BHHDMM.js → chunk-J7YOLKRX.js} +15 -24
- package/dist/_node-chunks/chunk-KJQIXLJD.js +138 -0
- package/dist/_node-chunks/chunk-LZHFU3IY.js +44 -0
- package/dist/_node-chunks/chunk-NTUEKICW.js +158 -0
- package/dist/index.js +1 -5
- package/dist/manager.js +274 -491
- package/dist/node/coverage-reporter.js +319 -864
- package/dist/node/vitest.js +201 -456
- package/dist/postinstall.js +497 -1502
- package/dist/preset.js +166 -349
- package/dist/vitest-plugin/global-setup.js +50 -106
- package/dist/vitest-plugin/index.js +1163 -2378
- package/dist/vitest-plugin/setup-file.js +6 -12
- package/dist/vitest-plugin/test-utils.js +31 -71
- package/package.json +3 -7
- package/dist/_browser-chunks/chunk-CAYLRBRX.js +0 -77
- package/dist/_browser-chunks/chunk-JK72E6FR.js +0 -6
- package/dist/_node-chunks/chunk-37QBGOBL.js +0 -2574
- package/dist/_node-chunks/chunk-4EU2HFAD.js +0 -37
- package/dist/_node-chunks/chunk-6S4X4RWE.js +0 -247
- package/dist/_node-chunks/chunk-CZTTZYY4.js +0 -481
- package/dist/_node-chunks/chunk-KKAUWLBT.js +0 -98
- package/dist/_node-chunks/chunk-OYLANTK3.js +0 -105
- package/dist/_node-chunks/chunk-QAVSDLTJ.js +0 -50
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2cm23o1mqpi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2cm23o1mqpi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2cm23o1mqpi from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2cm23o1mqpi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2cm23o1mqpi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2cm23o1mqpi.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
|
-
__commonJS
|
|
14
|
-
|
|
15
|
-
} from "./chunk-QAVSDLTJ.js";
|
|
13
|
+
__commonJS
|
|
14
|
+
} from "./chunk-BGBUUVQU.js";
|
|
16
15
|
|
|
17
16
|
// ../../node_modules/picocolors/picocolors.js
|
|
18
17
|
var require_picocolors = __commonJS({
|
|
19
18
|
"../../node_modules/picocolors/picocolors.js"(exports, module) {
|
|
20
|
-
var p = process || {}
|
|
21
|
-
var argv = p.argv || [];
|
|
22
|
-
var env = p.env || {};
|
|
23
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
24
|
-
var formatter = /* @__PURE__ */ __name((open, close, replace = open) => (input) => {
|
|
19
|
+
var p = process || {}, argv = p.argv || [], env = p.env || {}, isColorSupported = !(env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI), formatter = (open, close, replace = open) => (input) => {
|
|
25
20
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
26
21
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
27
|
-
},
|
|
28
|
-
var replaceClose = /* @__PURE__ */ __name((string, close, replace, index) => {
|
|
22
|
+
}, replaceClose = (string, close, replace, index) => {
|
|
29
23
|
let result = "", cursor = 0;
|
|
30
|
-
do
|
|
31
|
-
result += string.substring(cursor, index) + replace;
|
|
32
|
-
|
|
33
|
-
index = string.indexOf(close, cursor);
|
|
34
|
-
} while (~index);
|
|
24
|
+
do
|
|
25
|
+
result += string.substring(cursor, index) + replace, cursor = index + close.length, index = string.indexOf(close, cursor);
|
|
26
|
+
while (~index);
|
|
35
27
|
return result + string.substring(cursor);
|
|
36
|
-
},
|
|
37
|
-
var createColors = /* @__PURE__ */ __name((enabled = isColorSupported) => {
|
|
28
|
+
}, createColors = (enabled = isColorSupported) => {
|
|
38
29
|
let f = enabled ? formatter : () => String;
|
|
39
30
|
return {
|
|
40
31
|
isColorSupported: enabled,
|
|
@@ -80,7 +71,7 @@ var require_picocolors = __commonJS({
|
|
|
80
71
|
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
81
72
|
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
82
73
|
};
|
|
83
|
-
}
|
|
74
|
+
};
|
|
84
75
|
module.exports = createColors();
|
|
85
76
|
module.exports.createColors = createColors;
|
|
86
77
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2cm23o1mqpi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2cm23o1mqpi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2cm23o1mqpi from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2cm23o1mqpi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2cm23o1mqpi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2cm23o1mqpi.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
14
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
15
|
+
function normalizeWindowsPath(input = "") {
|
|
16
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
17
|
+
}
|
|
18
|
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, sep = "/", delimiter = ":", normalize = function(path2) {
|
|
19
|
+
if (path2.length === 0)
|
|
20
|
+
return ".";
|
|
21
|
+
path2 = normalizeWindowsPath(path2);
|
|
22
|
+
let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
|
|
23
|
+
return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
|
|
24
|
+
}, join = function(...arguments_) {
|
|
25
|
+
if (arguments_.length === 0)
|
|
26
|
+
return ".";
|
|
27
|
+
let joined;
|
|
28
|
+
for (let argument of arguments_)
|
|
29
|
+
argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
|
|
30
|
+
return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
|
|
31
|
+
};
|
|
32
|
+
function cwd() {
|
|
33
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
34
|
+
}
|
|
35
|
+
var resolve = function(...arguments_) {
|
|
36
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
37
|
+
let resolvedPath = "", resolvedAbsolute = !1;
|
|
38
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
39
|
+
let path2 = index >= 0 ? arguments_[index] : cwd();
|
|
40
|
+
!path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path2));
|
|
41
|
+
}
|
|
42
|
+
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
43
|
+
};
|
|
44
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
45
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
46
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
47
|
+
if (index < path2.length)
|
|
48
|
+
char = path2[index];
|
|
49
|
+
else {
|
|
50
|
+
if (char === "/")
|
|
51
|
+
break;
|
|
52
|
+
char = "/";
|
|
53
|
+
}
|
|
54
|
+
if (char === "/") {
|
|
55
|
+
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
56
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
57
|
+
if (res.length > 2) {
|
|
58
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
59
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
60
|
+
continue;
|
|
61
|
+
} else if (res.length > 0) {
|
|
62
|
+
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
67
|
+
} else
|
|
68
|
+
res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
69
|
+
lastSlash = index, dots = 0;
|
|
70
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
71
|
+
}
|
|
72
|
+
return res;
|
|
73
|
+
}
|
|
74
|
+
var isAbsolute = function(p) {
|
|
75
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
76
|
+
}, toNamespacedPath = function(p) {
|
|
77
|
+
return normalizeWindowsPath(p);
|
|
78
|
+
}, _EXTNAME_RE = /.(\.[^./]+)$/, extname = function(p) {
|
|
79
|
+
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
80
|
+
return match && match[1] || "";
|
|
81
|
+
}, relative = function(from, to) {
|
|
82
|
+
let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
83
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
|
|
84
|
+
return _to.join("/");
|
|
85
|
+
let _fromCopy = [..._from];
|
|
86
|
+
for (let segment of _fromCopy) {
|
|
87
|
+
if (_to[0] !== segment)
|
|
88
|
+
break;
|
|
89
|
+
_from.shift(), _to.shift();
|
|
90
|
+
}
|
|
91
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
92
|
+
}, dirname = function(p) {
|
|
93
|
+
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
94
|
+
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
95
|
+
}, format = function(p) {
|
|
96
|
+
let segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
|
|
97
|
+
return normalizeWindowsPath(
|
|
98
|
+
p.root ? resolve(...segments) : segments.join("/")
|
|
99
|
+
);
|
|
100
|
+
}, basename = function(p, extension) {
|
|
101
|
+
let lastSegment = normalizeWindowsPath(p).split("/").pop();
|
|
102
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
103
|
+
}, parse = function(p) {
|
|
104
|
+
let root = normalizeWindowsPath(p).split("/").shift() || "/", base = basename(p), extension = extname(base);
|
|
105
|
+
return {
|
|
106
|
+
root,
|
|
107
|
+
dir: dirname(p),
|
|
108
|
+
base,
|
|
109
|
+
ext: extension,
|
|
110
|
+
name: base.slice(0, base.length - extension.length)
|
|
111
|
+
};
|
|
112
|
+
}, path = {
|
|
113
|
+
__proto__: null,
|
|
114
|
+
basename,
|
|
115
|
+
delimiter,
|
|
116
|
+
dirname,
|
|
117
|
+
extname,
|
|
118
|
+
format,
|
|
119
|
+
isAbsolute,
|
|
120
|
+
join,
|
|
121
|
+
normalize,
|
|
122
|
+
normalizeString,
|
|
123
|
+
parse,
|
|
124
|
+
relative,
|
|
125
|
+
resolve,
|
|
126
|
+
sep,
|
|
127
|
+
toNamespacedPath
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
sep,
|
|
132
|
+
normalize,
|
|
133
|
+
join,
|
|
134
|
+
resolve,
|
|
135
|
+
relative,
|
|
136
|
+
dirname,
|
|
137
|
+
path
|
|
138
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2cm23o1mqpi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2cm23o1mqpi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2cm23o1mqpi from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2cm23o1mqpi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2cm23o1mqpi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2cm23o1mqpi.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/empathic/find.mjs
|
|
14
|
+
import { join as join2 } from "node:path";
|
|
15
|
+
import { existsSync, statSync } from "node:fs";
|
|
16
|
+
|
|
17
|
+
// ../../node_modules/empathic/walk.mjs
|
|
18
|
+
import { dirname } from "node:path";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/empathic/resolve.mjs
|
|
21
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
22
|
+
function absolute(input, root) {
|
|
23
|
+
return isAbsolute(input) ? input : resolve(root || ".", input);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ../../node_modules/empathic/walk.mjs
|
|
27
|
+
function up(base, options) {
|
|
28
|
+
let { last, cwd } = options || {}, tmp = absolute(base, cwd), root = absolute(last || "/", cwd), prev, arr = [];
|
|
29
|
+
for (; prev !== root && (arr.push(tmp), tmp = dirname(prev = tmp), tmp !== prev); )
|
|
30
|
+
;
|
|
31
|
+
return arr;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/empathic/find.mjs
|
|
35
|
+
function any(names, options) {
|
|
36
|
+
let dir, start = options && options.cwd || "", j = 0, len = names.length, tmp;
|
|
37
|
+
for (dir of up(start, options))
|
|
38
|
+
for (j = 0; j < len; j++)
|
|
39
|
+
if (tmp = join2(dir, names[j]), existsSync(tmp)) return tmp;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
any
|
|
44
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2cm23o1mqpi from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2cm23o1mqpi from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2cm23o1mqpi from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2cm23o1mqpi.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2cm23o1mqpi.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2cm23o1mqpi.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-KJQIXLJD.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
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./_browser-chunks/chunk-JK72E6FR.js";
|
|
4
|
-
|
|
5
1
|
// src/index.ts
|
|
6
2
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
7
|
-
var index_default =
|
|
3
|
+
var index_default = () => definePreviewAddon({});
|
|
8
4
|
export {
|
|
9
5
|
index_default as default
|
|
10
6
|
};
|