@storybook/addon-vitest 0.0.0-pr-32799-sha-64c5d96a → 0.0.0-pr-32795-sha-81cf1f23

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.
@@ -1,247 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_39dez2kdspn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_39dez2kdspn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_39dez2kdspn from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_39dez2kdspn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_39dez2kdspn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_39dez2kdspn.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-PW5WU54A.js";
15
-
16
- // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
17
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
18
- function normalizeWindowsPath(input = "") {
19
- if (!input) {
20
- return input;
21
- }
22
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
23
- }
24
- __name(normalizeWindowsPath, "normalizeWindowsPath");
25
- var _UNC_REGEX = /^[/\\]{2}/;
26
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
27
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
28
- var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
29
- var sep = "/";
30
- var delimiter = ":";
31
- var normalize = /* @__PURE__ */ __name(function(path2) {
32
- if (path2.length === 0) {
33
- return ".";
34
- }
35
- path2 = normalizeWindowsPath(path2);
36
- const isUNCPath = path2.match(_UNC_REGEX);
37
- const isPathAbsolute = isAbsolute(path2);
38
- const trailingSeparator = path2[path2.length - 1] === "/";
39
- path2 = normalizeString(path2, !isPathAbsolute);
40
- if (path2.length === 0) {
41
- if (isPathAbsolute) {
42
- return "/";
43
- }
44
- return trailingSeparator ? "./" : ".";
45
- }
46
- if (trailingSeparator) {
47
- path2 += "/";
48
- }
49
- if (_DRIVE_LETTER_RE.test(path2)) {
50
- path2 += "/";
51
- }
52
- if (isUNCPath) {
53
- if (!isPathAbsolute) {
54
- return `//./${path2}`;
55
- }
56
- return `//${path2}`;
57
- }
58
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
59
- }, "normalize");
60
- var join = /* @__PURE__ */ __name(function(...arguments_) {
61
- if (arguments_.length === 0) {
62
- return ".";
63
- }
64
- let joined;
65
- for (const argument of arguments_) {
66
- if (argument && argument.length > 0) {
67
- if (joined === void 0) {
68
- joined = argument;
69
- } else {
70
- joined += `/${argument}`;
71
- }
72
- }
73
- }
74
- if (joined === void 0) {
75
- return ".";
76
- }
77
- return normalize(joined.replace(/\/\/+/g, "/"));
78
- }, "join");
79
- function cwd() {
80
- if (typeof process !== "undefined" && typeof process.cwd === "function") {
81
- return process.cwd().replace(/\\/g, "/");
82
- }
83
- return "/";
84
- }
85
- __name(cwd, "cwd");
86
- var resolve = /* @__PURE__ */ __name(function(...arguments_) {
87
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
88
- let resolvedPath = "";
89
- let resolvedAbsolute = false;
90
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
91
- const path2 = index >= 0 ? arguments_[index] : cwd();
92
- if (!path2 || path2.length === 0) {
93
- continue;
94
- }
95
- resolvedPath = `${path2}/${resolvedPath}`;
96
- resolvedAbsolute = isAbsolute(path2);
97
- }
98
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
99
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
100
- return `/${resolvedPath}`;
101
- }
102
- return resolvedPath.length > 0 ? resolvedPath : ".";
103
- }, "resolve");
104
- function normalizeString(path2, allowAboveRoot) {
105
- let res = "";
106
- let lastSegmentLength = 0;
107
- let lastSlash = -1;
108
- let dots = 0;
109
- let char = null;
110
- for (let index = 0; index <= path2.length; ++index) {
111
- if (index < path2.length) {
112
- char = path2[index];
113
- } else if (char === "/") {
114
- break;
115
- } else {
116
- char = "/";
117
- }
118
- if (char === "/") {
119
- if (lastSlash === index - 1 || dots === 1) ;
120
- else if (dots === 2) {
121
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
122
- if (res.length > 2) {
123
- const lastSlashIndex = res.lastIndexOf("/");
124
- if (lastSlashIndex === -1) {
125
- res = "";
126
- lastSegmentLength = 0;
127
- } else {
128
- res = res.slice(0, lastSlashIndex);
129
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
130
- }
131
- lastSlash = index;
132
- dots = 0;
133
- continue;
134
- } else if (res.length > 0) {
135
- res = "";
136
- lastSegmentLength = 0;
137
- lastSlash = index;
138
- dots = 0;
139
- continue;
140
- }
141
- }
142
- if (allowAboveRoot) {
143
- res += res.length > 0 ? "/.." : "..";
144
- lastSegmentLength = 2;
145
- }
146
- } else {
147
- if (res.length > 0) {
148
- res += `/${path2.slice(lastSlash + 1, index)}`;
149
- } else {
150
- res = path2.slice(lastSlash + 1, index);
151
- }
152
- lastSegmentLength = index - lastSlash - 1;
153
- }
154
- lastSlash = index;
155
- dots = 0;
156
- } else if (char === "." && dots !== -1) {
157
- ++dots;
158
- } else {
159
- dots = -1;
160
- }
161
- }
162
- return res;
163
- }
164
- __name(normalizeString, "normalizeString");
165
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
166
- return _IS_ABSOLUTE_RE.test(p);
167
- }, "isAbsolute");
168
- var toNamespacedPath = /* @__PURE__ */ __name(function(p) {
169
- return normalizeWindowsPath(p);
170
- }, "toNamespacedPath");
171
- var _EXTNAME_RE = /.(\.[^./]+)$/;
172
- var extname = /* @__PURE__ */ __name(function(p) {
173
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
174
- return match && match[1] || "";
175
- }, "extname");
176
- var relative = /* @__PURE__ */ __name(function(from, to) {
177
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
178
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
179
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
180
- return _to.join("/");
181
- }
182
- const _fromCopy = [..._from];
183
- for (const segment of _fromCopy) {
184
- if (_to[0] !== segment) {
185
- break;
186
- }
187
- _from.shift();
188
- _to.shift();
189
- }
190
- return [..._from.map(() => ".."), ..._to].join("/");
191
- }, "relative");
192
- var dirname = /* @__PURE__ */ __name(function(p) {
193
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
194
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
195
- segments[0] += "/";
196
- }
197
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
198
- }, "dirname");
199
- var format = /* @__PURE__ */ __name(function(p) {
200
- const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
201
- return normalizeWindowsPath(
202
- p.root ? resolve(...segments) : segments.join("/")
203
- );
204
- }, "format");
205
- var basename = /* @__PURE__ */ __name(function(p, extension) {
206
- const lastSegment = normalizeWindowsPath(p).split("/").pop();
207
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
208
- }, "basename");
209
- var parse = /* @__PURE__ */ __name(function(p) {
210
- const root = normalizeWindowsPath(p).split("/").shift() || "/";
211
- const base = basename(p);
212
- const extension = extname(base);
213
- return {
214
- root,
215
- dir: dirname(p),
216
- base,
217
- ext: extension,
218
- name: base.slice(0, base.length - extension.length)
219
- };
220
- }, "parse");
221
- var path = {
222
- __proto__: null,
223
- basename,
224
- delimiter,
225
- dirname,
226
- extname,
227
- format,
228
- isAbsolute,
229
- join,
230
- normalize,
231
- normalizeString,
232
- parse,
233
- relative,
234
- resolve,
235
- sep,
236
- toNamespacedPath
237
- };
238
-
239
- export {
240
- sep,
241
- normalize,
242
- join,
243
- resolve,
244
- relative,
245
- dirname,
246
- path
247
- };
@@ -1,98 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_39dez2kdspn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_39dez2kdspn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_39dez2kdspn from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_39dez2kdspn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_39dez2kdspn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_39dez2kdspn.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-PW5WU54A.js";
15
-
16
- // src/utils.ts
17
- function getAddonNames(mainConfig) {
18
- const addons = mainConfig.addons || [];
19
- const addonList = addons.map((addon) => {
20
- let name = "";
21
- if (typeof addon === "string") {
22
- name = addon;
23
- } else if (typeof addon === "object") {
24
- name = addon.name;
25
- }
26
- return name;
27
- });
28
- return addonList.filter((item) => item != null);
29
- }
30
- __name(getAddonNames, "getAddonNames");
31
- function errorToErrorLike(error) {
32
- return {
33
- message: error.message,
34
- name: error.name,
35
- // avoid duplicating the error message in the stack trace
36
- stack: error.stack?.replace(error.message, ""),
37
- cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
38
- };
39
- }
40
- __name(errorToErrorLike, "errorToErrorLike");
41
-
42
- // ../../node_modules/empathic/find.mjs
43
- import { join as join2 } from "node:path";
44
- import { existsSync, statSync } from "node:fs";
45
-
46
- // ../../node_modules/empathic/walk.mjs
47
- import { dirname } from "node:path";
48
-
49
- // ../../node_modules/empathic/resolve.mjs
50
- import { isAbsolute, join, resolve } from "node:path";
51
- function absolute(input, root) {
52
- return isAbsolute(input) ? input : resolve(root || ".", input);
53
- }
54
- __name(absolute, "absolute");
55
-
56
- // ../../node_modules/empathic/walk.mjs
57
- function up(base, options) {
58
- let { last, cwd } = options || {};
59
- let tmp = absolute(base, cwd);
60
- let root = absolute(last || "/", cwd);
61
- let prev, arr = [];
62
- while (prev !== root) {
63
- arr.push(tmp);
64
- tmp = dirname(prev = tmp);
65
- if (tmp === prev) break;
66
- }
67
- return arr;
68
- }
69
- __name(up, "up");
70
-
71
- // ../../node_modules/empathic/find.mjs
72
- function up2(name, options) {
73
- let dir, tmp;
74
- let start = options && options.cwd || "";
75
- for (dir of up(start, options)) {
76
- tmp = join2(dir, name);
77
- if (existsSync(tmp)) return tmp;
78
- }
79
- }
80
- __name(up2, "up");
81
- function any(names, options) {
82
- let dir, start = options && options.cwd || "";
83
- let j = 0, len = names.length, tmp;
84
- for (dir of up(start, options)) {
85
- for (j = 0; j < len; j++) {
86
- tmp = join2(dir, names[j]);
87
- if (existsSync(tmp)) return tmp;
88
- }
89
- }
90
- }
91
- __name(any, "any");
92
-
93
- export {
94
- getAddonNames,
95
- errorToErrorLike,
96
- up2 as up,
97
- any
98
- };