@storybook/addon-vitest 0.0.0-pr-31819-sha-a15101b6 → 0.0.0-pr-32207-sha-0c91842b
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/chunk-55WZLVGN.mjs +11 -0
- package/dist/chunk-JKRQGT2U.mjs +10 -0
- package/dist/index.js +6 -9
- package/dist/index.mjs +5 -0
- package/dist/manager.js +8 -7516
- package/dist/node/coverage-reporter.d.ts +184 -0
- package/dist/node/coverage-reporter.js +4 -1898
- package/dist/node/coverage-reporter.mjs +12 -0
- package/dist/node/vitest.d.ts +2 -0
- package/dist/node/vitest.js +17 -740
- package/dist/node/vitest.mjs +19 -0
- package/dist/postinstall.js +88 -2076
- package/dist/preset.js +31 -360
- package/dist/vitest-plugin/global-setup.d.ts +6 -0
- package/dist/vitest-plugin/global-setup.js +6 -200
- package/dist/vitest-plugin/global-setup.mjs +13 -0
- package/dist/vitest-plugin/index.js +43 -3823
- package/dist/vitest-plugin/index.mjs +28 -0
- package/dist/vitest-plugin/setup-file.d.ts +14 -0
- package/dist/vitest-plugin/setup-file.js +8 -30
- package/dist/vitest-plugin/setup-file.mjs +9 -0
- package/dist/vitest-plugin/test-utils.d.ts +20 -0
- package/dist/vitest-plugin/test-utils.js +8 -102
- package/dist/vitest-plugin/test-utils.mjs +8 -0
- package/manager.js +1 -1
- package/manager.mjs +1 -0
- package/package.json +89 -16
- package/postinstall.js +1 -0
- package/postinstall.mjs +1 -0
- package/preset.js +1 -1
- package/preset.mjs +1 -0
- package/dist/_browser-chunks/chunk-JFJ5UJ7Q.js +0 -11
- package/dist/_browser-chunks/chunk-PMYV6BH2.js +0 -76
- package/dist/_node-chunks/chunk-2NHXRRNR.js +0 -6873
- package/dist/_node-chunks/chunk-6HN4LPYT.js +0 -481
- package/dist/_node-chunks/chunk-E6R4IKFS.js +0 -295
- package/dist/_node-chunks/chunk-FPMFMFWK.js +0 -55
- package/dist/_node-chunks/chunk-GJQYRLPS.js +0 -2264
- package/dist/_node-chunks/chunk-LWLQWSTY.js +0 -103
- package/dist/_node-chunks/chunk-QB3TZK72.js +0 -91
- package/dist/_node-chunks/chunk-SRR4DVLV.js +0 -247
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_ksgvf6okl3d from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_ksgvf6okl3d from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_ksgvf6okl3d from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_ksgvf6okl3d.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_ksgvf6okl3d.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_ksgvf6okl3d.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-FPMFMFWK.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/find-up/index.js
|
|
43
|
-
import path2 from "node:path";
|
|
44
|
-
|
|
45
|
-
// ../../node_modules/locate-path/index.js
|
|
46
|
-
import process from "node:process";
|
|
47
|
-
import path from "node:path";
|
|
48
|
-
import fs, { promises as fsPromises } from "node:fs";
|
|
49
|
-
import { fileURLToPath } from "node:url";
|
|
50
|
-
|
|
51
|
-
// ../../node_modules/yocto-queue/index.js
|
|
52
|
-
var Node = class {
|
|
53
|
-
static {
|
|
54
|
-
__name(this, "Node");
|
|
55
|
-
}
|
|
56
|
-
value;
|
|
57
|
-
next;
|
|
58
|
-
constructor(value) {
|
|
59
|
-
this.value = value;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var Queue = class {
|
|
63
|
-
static {
|
|
64
|
-
__name(this, "Queue");
|
|
65
|
-
}
|
|
66
|
-
#head;
|
|
67
|
-
#tail;
|
|
68
|
-
#size;
|
|
69
|
-
constructor() {
|
|
70
|
-
this.clear();
|
|
71
|
-
}
|
|
72
|
-
enqueue(value) {
|
|
73
|
-
const node = new Node(value);
|
|
74
|
-
if (this.#head) {
|
|
75
|
-
this.#tail.next = node;
|
|
76
|
-
this.#tail = node;
|
|
77
|
-
} else {
|
|
78
|
-
this.#head = node;
|
|
79
|
-
this.#tail = node;
|
|
80
|
-
}
|
|
81
|
-
this.#size++;
|
|
82
|
-
}
|
|
83
|
-
dequeue() {
|
|
84
|
-
const current = this.#head;
|
|
85
|
-
if (!current) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
this.#head = this.#head.next;
|
|
89
|
-
this.#size--;
|
|
90
|
-
return current.value;
|
|
91
|
-
}
|
|
92
|
-
peek() {
|
|
93
|
-
if (!this.#head) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
return this.#head.value;
|
|
97
|
-
}
|
|
98
|
-
clear() {
|
|
99
|
-
this.#head = void 0;
|
|
100
|
-
this.#tail = void 0;
|
|
101
|
-
this.#size = 0;
|
|
102
|
-
}
|
|
103
|
-
get size() {
|
|
104
|
-
return this.#size;
|
|
105
|
-
}
|
|
106
|
-
*[Symbol.iterator]() {
|
|
107
|
-
let current = this.#head;
|
|
108
|
-
while (current) {
|
|
109
|
-
yield current.value;
|
|
110
|
-
current = current.next;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
*drain() {
|
|
114
|
-
while (this.#head) {
|
|
115
|
-
yield this.dequeue();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// ../../node_modules/locate-path/node_modules/p-limit/index.js
|
|
121
|
-
function pLimit(concurrency) {
|
|
122
|
-
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
123
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
124
|
-
}
|
|
125
|
-
const queue = new Queue();
|
|
126
|
-
let activeCount = 0;
|
|
127
|
-
const next = /* @__PURE__ */ __name(() => {
|
|
128
|
-
activeCount--;
|
|
129
|
-
if (queue.size > 0) {
|
|
130
|
-
queue.dequeue()();
|
|
131
|
-
}
|
|
132
|
-
}, "next");
|
|
133
|
-
const run = /* @__PURE__ */ __name(async (fn, resolve, args) => {
|
|
134
|
-
activeCount++;
|
|
135
|
-
const result = (async () => fn(...args))();
|
|
136
|
-
resolve(result);
|
|
137
|
-
try {
|
|
138
|
-
await result;
|
|
139
|
-
} catch {
|
|
140
|
-
}
|
|
141
|
-
next();
|
|
142
|
-
}, "run");
|
|
143
|
-
const enqueue = /* @__PURE__ */ __name((fn, resolve, args) => {
|
|
144
|
-
queue.enqueue(run.bind(void 0, fn, resolve, args));
|
|
145
|
-
(async () => {
|
|
146
|
-
await Promise.resolve();
|
|
147
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
148
|
-
queue.dequeue()();
|
|
149
|
-
}
|
|
150
|
-
})();
|
|
151
|
-
}, "enqueue");
|
|
152
|
-
const generator = /* @__PURE__ */ __name((fn, ...args) => new Promise((resolve) => {
|
|
153
|
-
enqueue(fn, resolve, args);
|
|
154
|
-
}), "generator");
|
|
155
|
-
Object.defineProperties(generator, {
|
|
156
|
-
activeCount: {
|
|
157
|
-
get: /* @__PURE__ */ __name(() => activeCount, "get")
|
|
158
|
-
},
|
|
159
|
-
pendingCount: {
|
|
160
|
-
get: /* @__PURE__ */ __name(() => queue.size, "get")
|
|
161
|
-
},
|
|
162
|
-
clearQueue: {
|
|
163
|
-
value: /* @__PURE__ */ __name(() => {
|
|
164
|
-
queue.clear();
|
|
165
|
-
}, "value")
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
return generator;
|
|
169
|
-
}
|
|
170
|
-
__name(pLimit, "pLimit");
|
|
171
|
-
|
|
172
|
-
// ../../node_modules/locate-path/node_modules/p-locate/index.js
|
|
173
|
-
var EndError = class extends Error {
|
|
174
|
-
static {
|
|
175
|
-
__name(this, "EndError");
|
|
176
|
-
}
|
|
177
|
-
constructor(value) {
|
|
178
|
-
super();
|
|
179
|
-
this.value = value;
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var testElement = /* @__PURE__ */ __name(async (element, tester) => tester(await element), "testElement");
|
|
183
|
-
var finder = /* @__PURE__ */ __name(async (element) => {
|
|
184
|
-
const values = await Promise.all(element);
|
|
185
|
-
if (values[1] === true) {
|
|
186
|
-
throw new EndError(values[0]);
|
|
187
|
-
}
|
|
188
|
-
return false;
|
|
189
|
-
}, "finder");
|
|
190
|
-
async function pLocate(iterable, tester, {
|
|
191
|
-
concurrency = Number.POSITIVE_INFINITY,
|
|
192
|
-
preserveOrder = true
|
|
193
|
-
} = {}) {
|
|
194
|
-
const limit = pLimit(concurrency);
|
|
195
|
-
const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
|
|
196
|
-
const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
|
|
197
|
-
try {
|
|
198
|
-
await Promise.all(items.map((element) => checkLimit(finder, element)));
|
|
199
|
-
} catch (error) {
|
|
200
|
-
if (error instanceof EndError) {
|
|
201
|
-
return error.value;
|
|
202
|
-
}
|
|
203
|
-
throw error;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
__name(pLocate, "pLocate");
|
|
207
|
-
|
|
208
|
-
// ../../node_modules/locate-path/index.js
|
|
209
|
-
var typeMappings = {
|
|
210
|
-
directory: "isDirectory",
|
|
211
|
-
file: "isFile"
|
|
212
|
-
};
|
|
213
|
-
function checkType(type) {
|
|
214
|
-
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
throw new Error(`Invalid type specified: ${type}`);
|
|
218
|
-
}
|
|
219
|
-
__name(checkType, "checkType");
|
|
220
|
-
var matchType = /* @__PURE__ */ __name((type, stat) => stat[typeMappings[type]](), "matchType");
|
|
221
|
-
var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
|
|
222
|
-
async function locatePath(paths, {
|
|
223
|
-
cwd = process.cwd(),
|
|
224
|
-
type = "file",
|
|
225
|
-
allowSymlinks = true,
|
|
226
|
-
concurrency,
|
|
227
|
-
preserveOrder
|
|
228
|
-
} = {}) {
|
|
229
|
-
checkType(type);
|
|
230
|
-
cwd = toPath(cwd);
|
|
231
|
-
const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;
|
|
232
|
-
return pLocate(paths, async (path_) => {
|
|
233
|
-
try {
|
|
234
|
-
const stat = await statFunction(path.resolve(cwd, path_));
|
|
235
|
-
return matchType(type, stat);
|
|
236
|
-
} catch {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
}, { concurrency, preserveOrder });
|
|
240
|
-
}
|
|
241
|
-
__name(locatePath, "locatePath");
|
|
242
|
-
|
|
243
|
-
// ../../node_modules/find-up/node_modules/unicorn-magic/node.js
|
|
244
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
245
|
-
function toPath2(urlOrPath) {
|
|
246
|
-
return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
|
247
|
-
}
|
|
248
|
-
__name(toPath2, "toPath");
|
|
249
|
-
|
|
250
|
-
// ../../node_modules/find-up/index.js
|
|
251
|
-
var findUpStop = Symbol("findUpStop");
|
|
252
|
-
async function findUpMultiple(name, options = {}) {
|
|
253
|
-
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
254
|
-
const { root } = path2.parse(directory);
|
|
255
|
-
const stopAt = path2.resolve(directory, toPath2(options.stopAt ?? root));
|
|
256
|
-
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
257
|
-
const paths = [name].flat();
|
|
258
|
-
const runMatcher = /* @__PURE__ */ __name(async (locateOptions) => {
|
|
259
|
-
if (typeof name !== "function") {
|
|
260
|
-
return locatePath(paths, locateOptions);
|
|
261
|
-
}
|
|
262
|
-
const foundPath = await name(locateOptions.cwd);
|
|
263
|
-
if (typeof foundPath === "string") {
|
|
264
|
-
return locatePath([foundPath], locateOptions);
|
|
265
|
-
}
|
|
266
|
-
return foundPath;
|
|
267
|
-
}, "runMatcher");
|
|
268
|
-
const matches = [];
|
|
269
|
-
while (true) {
|
|
270
|
-
const foundPath = await runMatcher({ ...options, cwd: directory });
|
|
271
|
-
if (foundPath === findUpStop) {
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
if (foundPath) {
|
|
275
|
-
matches.push(path2.resolve(directory, foundPath));
|
|
276
|
-
}
|
|
277
|
-
if (directory === stopAt || matches.length >= limit) {
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
directory = path2.dirname(directory);
|
|
281
|
-
}
|
|
282
|
-
return matches;
|
|
283
|
-
}
|
|
284
|
-
__name(findUpMultiple, "findUpMultiple");
|
|
285
|
-
async function findUp(name, options = {}) {
|
|
286
|
-
const matches = await findUpMultiple(name, { ...options, limit: 1 });
|
|
287
|
-
return matches[0];
|
|
288
|
-
}
|
|
289
|
-
__name(findUp, "findUp");
|
|
290
|
-
|
|
291
|
-
export {
|
|
292
|
-
getAddonNames,
|
|
293
|
-
errorToErrorLike,
|
|
294
|
-
findUp
|
|
295
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_ksgvf6okl3d from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_ksgvf6okl3d from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_ksgvf6okl3d from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_ksgvf6okl3d.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_ksgvf6okl3d.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_ksgvf6okl3d.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
var __create = Object.create;
|
|
13
|
-
var __defProp = Object.defineProperty;
|
|
14
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
19
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
20
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
21
|
-
}) : x)(function(x) {
|
|
22
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
23
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
24
|
-
});
|
|
25
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
26
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
27
|
-
};
|
|
28
|
-
var __export = (target, all) => {
|
|
29
|
-
for (var name in all)
|
|
30
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
31
|
-
};
|
|
32
|
-
var __copyProps = (to, from, except, desc) => {
|
|
33
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
34
|
-
for (let key of __getOwnPropNames(from))
|
|
35
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
36
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
37
|
-
}
|
|
38
|
-
return to;
|
|
39
|
-
};
|
|
40
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
41
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
42
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
43
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
44
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
45
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
-
mod
|
|
47
|
-
));
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
__name,
|
|
51
|
-
__require,
|
|
52
|
-
__commonJS,
|
|
53
|
-
__export,
|
|
54
|
-
__toESM
|
|
55
|
-
};
|