@storybook/addon-vitest 10.0.0-beta.1 → 10.0.0-beta.10

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,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __name
15
- } from "./chunk-JXUNGTEW.js";
15
+ } from "./chunk-UXOM2XHX.js";
16
16
 
17
17
  // ../../node_modules/semver/internal/constants.js
18
18
  var require_constants = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __name
15
- } from "./chunk-JXUNGTEW.js";
15
+ } from "./chunk-UXOM2XHX.js";
16
16
 
17
17
  // ../../node_modules/picocolors/picocolors.js
18
18
  var require_picocolors = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,13 +12,13 @@ var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
12
12
  import {
13
13
  dirname,
14
14
  join
15
- } from "./chunk-HPGEHKZB.js";
15
+ } from "./chunk-LNPEEBIV.js";
16
16
  import {
17
17
  __commonJS,
18
18
  __name,
19
19
  __require,
20
20
  __toESM
21
- } from "./chunk-JXUNGTEW.js";
21
+ } from "./chunk-UXOM2XHX.js";
22
22
 
23
23
  // ../../node_modules/isexe/windows.js
24
24
  var require_windows = __commonJS({
@@ -161,22 +161,22 @@ var require_isexe = __commonJS({
161
161
  // ../../node_modules/which/which.js
162
162
  var require_which = __commonJS({
163
163
  "../../node_modules/which/which.js"(exports, module) {
164
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
164
+ var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
165
165
  var path3 = __require("path");
166
- var COLON = isWindows ? ";" : ":";
166
+ var COLON = isWindows2 ? ";" : ":";
167
167
  var isexe = require_isexe();
168
168
  var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
169
169
  var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
170
170
  const colon = opt.colon || COLON;
171
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
171
+ const pathEnv = cmd.match(/\//) || isWindows2 && cmd.match(/\\/) ? [""] : [
172
172
  // windows always checks the cwd first
173
- ...isWindows ? [process.cwd()] : [],
173
+ ...isWindows2 ? [process.cwd()] : [],
174
174
  ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
175
175
  "").split(colon)
176
176
  ];
177
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
178
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
179
- if (isWindows) {
177
+ const pathExtExe = isWindows2 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
178
+ const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
179
+ if (isWindows2) {
180
180
  if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
181
181
  pathExt.unshift("");
182
182
  }
@@ -2243,6 +2243,316 @@ __name(execaNode, "execaNode");
2243
2243
 
2244
2244
  // ../../core/src/shared/utils/module.ts
2245
2245
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
2246
+
2247
+ // ../../node_modules/exsolve/dist/index.mjs
2248
+ import assert from "node:assert";
2249
+ import v8 from "node:v8";
2250
+ import { format, inspect } from "node:util";
2251
+ var own$1 = {}.hasOwnProperty;
2252
+ var classRegExp = /^([A-Z][a-z\d]*)+$/;
2253
+ var kTypes = /* @__PURE__ */ new Set([
2254
+ "string",
2255
+ "function",
2256
+ "number",
2257
+ "object",
2258
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
2259
+ "Function",
2260
+ "Object",
2261
+ "boolean",
2262
+ "bigint",
2263
+ "symbol"
2264
+ ]);
2265
+ var messages = /* @__PURE__ */ new Map();
2266
+ var nodeInternalPrefix = "__node_internal_";
2267
+ var userStackTraceLimit;
2268
+ function formatList(array, type = "and") {
2269
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
2270
+ }
2271
+ __name(formatList, "formatList");
2272
+ function createError(sym, value, constructor) {
2273
+ messages.set(sym, value);
2274
+ return makeNodeErrorWithCode(constructor, sym);
2275
+ }
2276
+ __name(createError, "createError");
2277
+ function makeNodeErrorWithCode(Base, key) {
2278
+ return /* @__PURE__ */ __name(function NodeError(...parameters) {
2279
+ const limit = Error.stackTraceLimit;
2280
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
2281
+ const error = new Base();
2282
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
2283
+ const message = getMessage(key, parameters, error);
2284
+ Object.defineProperties(error, {
2285
+ // Note: no need to implement `kIsNodeError` symbol, would be hard,
2286
+ // probably.
2287
+ message: {
2288
+ value: message,
2289
+ enumerable: false,
2290
+ writable: true,
2291
+ configurable: true
2292
+ },
2293
+ toString: {
2294
+ /** @this {Error} */
2295
+ value() {
2296
+ return `${this.name} [${key}]: ${this.message}`;
2297
+ },
2298
+ enumerable: false,
2299
+ writable: true,
2300
+ configurable: true
2301
+ }
2302
+ });
2303
+ captureLargerStackTrace(error);
2304
+ error.code = key;
2305
+ return error;
2306
+ }, "NodeError");
2307
+ }
2308
+ __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
2309
+ function isErrorStackTraceLimitWritable() {
2310
+ try {
2311
+ if (v8.startupSnapshot.isBuildingSnapshot()) {
2312
+ return false;
2313
+ }
2314
+ } catch {
2315
+ }
2316
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
2317
+ if (desc === void 0) {
2318
+ return Object.isExtensible(Error);
2319
+ }
2320
+ return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
2321
+ }
2322
+ __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
2323
+ function hideStackFrames(wrappedFunction) {
2324
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
2325
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
2326
+ return wrappedFunction;
2327
+ }
2328
+ __name(hideStackFrames, "hideStackFrames");
2329
+ var captureLargerStackTrace = hideStackFrames(function(error) {
2330
+ const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
2331
+ if (stackTraceLimitIsWritable) {
2332
+ userStackTraceLimit = Error.stackTraceLimit;
2333
+ Error.stackTraceLimit = Number.POSITIVE_INFINITY;
2334
+ }
2335
+ Error.captureStackTrace(error);
2336
+ if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
2337
+ return error;
2338
+ });
2339
+ function getMessage(key, parameters, self) {
2340
+ const message = messages.get(key);
2341
+ assert(message !== void 0, "expected `message` to be found");
2342
+ if (typeof message === "function") {
2343
+ assert(
2344
+ message.length <= parameters.length,
2345
+ // Default options do not count.
2346
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
2347
+ );
2348
+ return Reflect.apply(message, self, parameters);
2349
+ }
2350
+ const regex = /%[dfijoOs]/g;
2351
+ let expectedLength = 0;
2352
+ while (regex.exec(message) !== null) expectedLength++;
2353
+ assert(
2354
+ expectedLength === parameters.length,
2355
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
2356
+ );
2357
+ if (parameters.length === 0) return message;
2358
+ parameters.unshift(message);
2359
+ return Reflect.apply(format, null, parameters);
2360
+ }
2361
+ __name(getMessage, "getMessage");
2362
+ function determineSpecificType(value) {
2363
+ if (value === null || value === void 0) {
2364
+ return String(value);
2365
+ }
2366
+ if (typeof value === "function" && value.name) {
2367
+ return `function ${value.name}`;
2368
+ }
2369
+ if (typeof value === "object") {
2370
+ if (value.constructor && value.constructor.name) {
2371
+ return `an instance of ${value.constructor.name}`;
2372
+ }
2373
+ return `${inspect(value, { depth: -1 })}`;
2374
+ }
2375
+ let inspected = inspect(value, { colors: false });
2376
+ if (inspected.length > 28) {
2377
+ inspected = `${inspected.slice(0, 25)}...`;
2378
+ }
2379
+ return `type ${typeof value} (${inspected})`;
2380
+ }
2381
+ __name(determineSpecificType, "determineSpecificType");
2382
+ createError(
2383
+ "ERR_INVALID_ARG_TYPE",
2384
+ (name, expected, actual) => {
2385
+ assert(typeof name === "string", "'name' must be a string");
2386
+ if (!Array.isArray(expected)) {
2387
+ expected = [expected];
2388
+ }
2389
+ let message = "The ";
2390
+ if (name.endsWith(" argument")) {
2391
+ message += `${name} `;
2392
+ } else {
2393
+ const type = name.includes(".") ? "property" : "argument";
2394
+ message += `"${name}" ${type} `;
2395
+ }
2396
+ message += "must be ";
2397
+ const types = [];
2398
+ const instances = [];
2399
+ const other = [];
2400
+ for (const value of expected) {
2401
+ assert(
2402
+ typeof value === "string",
2403
+ "All expected entries have to be of type string"
2404
+ );
2405
+ if (kTypes.has(value)) {
2406
+ types.push(value.toLowerCase());
2407
+ } else if (classRegExp.exec(value) === null) {
2408
+ assert(
2409
+ value !== "object",
2410
+ 'The value "object" should be written as "Object"'
2411
+ );
2412
+ other.push(value);
2413
+ } else {
2414
+ instances.push(value);
2415
+ }
2416
+ }
2417
+ if (instances.length > 0) {
2418
+ const pos = types.indexOf("object");
2419
+ if (pos !== -1) {
2420
+ types.slice(pos, 1);
2421
+ instances.push("Object");
2422
+ }
2423
+ }
2424
+ if (types.length > 0) {
2425
+ message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
2426
+ types,
2427
+ "or"
2428
+ )}`;
2429
+ if (instances.length > 0 || other.length > 0) message += " or ";
2430
+ }
2431
+ if (instances.length > 0) {
2432
+ message += `an instance of ${formatList(instances, "or")}`;
2433
+ if (other.length > 0) message += " or ";
2434
+ }
2435
+ if (other.length > 0) {
2436
+ if (other.length > 1) {
2437
+ message += `one of ${formatList(other, "or")}`;
2438
+ } else {
2439
+ if (other[0]?.toLowerCase() !== other[0]) message += "an ";
2440
+ message += `${other[0]}`;
2441
+ }
2442
+ }
2443
+ message += `. Received ${determineSpecificType(actual)}`;
2444
+ return message;
2445
+ },
2446
+ TypeError
2447
+ );
2448
+ var ERR_INVALID_MODULE_SPECIFIER = createError(
2449
+ "ERR_INVALID_MODULE_SPECIFIER",
2450
+ /**
2451
+ * @param {string} request
2452
+ * @param {string} reason
2453
+ * @param {string} [base]
2454
+ */
2455
+ (request, reason, base) => {
2456
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
2457
+ },
2458
+ TypeError
2459
+ );
2460
+ var ERR_INVALID_PACKAGE_CONFIG = createError(
2461
+ "ERR_INVALID_PACKAGE_CONFIG",
2462
+ (path3, base, message) => {
2463
+ return `Invalid package config ${path3}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
2464
+ },
2465
+ Error
2466
+ );
2467
+ var ERR_INVALID_PACKAGE_TARGET = createError(
2468
+ "ERR_INVALID_PACKAGE_TARGET",
2469
+ (packagePath, key, target, isImport = false, base) => {
2470
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
2471
+ if (key === ".") {
2472
+ assert(isImport === false);
2473
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2474
+ }
2475
+ return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
2476
+ target
2477
+ )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2478
+ },
2479
+ Error
2480
+ );
2481
+ var ERR_MODULE_NOT_FOUND = createError(
2482
+ "ERR_MODULE_NOT_FOUND",
2483
+ (path3, base, exactUrl = false) => {
2484
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path3}' imported from ${base}`;
2485
+ },
2486
+ Error
2487
+ );
2488
+ createError(
2489
+ "ERR_NETWORK_IMPORT_DISALLOWED",
2490
+ "import of '%s' by %s is not supported: %s",
2491
+ Error
2492
+ );
2493
+ var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
2494
+ "ERR_PACKAGE_IMPORT_NOT_DEFINED",
2495
+ (specifier, packagePath, base) => {
2496
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
2497
+ },
2498
+ TypeError
2499
+ );
2500
+ var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
2501
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
2502
+ /**
2503
+ * @param {string} packagePath
2504
+ * @param {string} subpath
2505
+ * @param {string} [base]
2506
+ */
2507
+ (packagePath, subpath, base) => {
2508
+ if (subpath === ".")
2509
+ return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2510
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2511
+ },
2512
+ Error
2513
+ );
2514
+ var ERR_UNSUPPORTED_DIR_IMPORT = createError(
2515
+ "ERR_UNSUPPORTED_DIR_IMPORT",
2516
+ "Directory import '%s' is not supported resolving ES modules imported from %s",
2517
+ Error
2518
+ );
2519
+ var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
2520
+ "ERR_UNSUPPORTED_RESOLVE_REQUEST",
2521
+ 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
2522
+ TypeError
2523
+ );
2524
+ var ERR_UNKNOWN_FILE_EXTENSION = createError(
2525
+ "ERR_UNKNOWN_FILE_EXTENSION",
2526
+ (extension, path3) => {
2527
+ return `Unknown file extension "${extension}" for ${path3}`;
2528
+ },
2529
+ TypeError
2530
+ );
2531
+ createError(
2532
+ "ERR_INVALID_ARG_VALUE",
2533
+ (name, value, reason = "is invalid") => {
2534
+ let inspected = inspect(value);
2535
+ if (inspected.length > 128) {
2536
+ inspected = `${inspected.slice(0, 128)}...`;
2537
+ }
2538
+ const type = name.includes(".") ? "property" : "argument";
2539
+ return `The ${type} '${name}' ${reason}. Received ${inspected}`;
2540
+ },
2541
+ TypeError
2542
+ // Note: extra classes have been shaken out.
2543
+ // , RangeError
2544
+ );
2545
+ var hasOwnProperty$1 = {}.hasOwnProperty;
2546
+ var hasOwnProperty = {}.hasOwnProperty;
2547
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
2548
+ var own = {}.hasOwnProperty;
2549
+ var isWindows = (() => process.platform === "win32")();
2550
+ var globalCache = (() => (
2551
+ // eslint-disable-next-line unicorn/no-unreadable-iife
2552
+ globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
2553
+ ))();
2554
+
2555
+ // ../../core/src/shared/utils/module.ts
2246
2556
  var importMetaResolve = /* @__PURE__ */ __name((...args) => {
2247
2557
  if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
2248
2558
  console.warn(
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.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 CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.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
  __name
14
- } from "./chunk-JXUNGTEW.js";
14
+ } from "./chunk-UXOM2XHX.js";
15
15
 
16
16
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
17
17
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
@@ -0,0 +1,98 @@
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.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-UXOM2XHX.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
+ };
@@ -1,24 +1,24 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.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
  ADDON_ID
14
- } from "./chunk-2REKPEQ2.js";
14
+ } from "./chunk-IGSSJNJT.js";
15
15
  import {
16
16
  require_picocolors
17
- } from "./chunk-MJQUUNLY.js";
17
+ } from "./chunk-BVQFVFQY.js";
18
18
  import {
19
19
  __name,
20
20
  __toESM
21
- } from "./chunk-JXUNGTEW.js";
21
+ } from "./chunk-UXOM2XHX.js";
22
22
 
23
23
  // src/logger.ts
24
24
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3fqiy48f2ku from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3fqiy48f2ku from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3fqiy48f2ku from "node:module";
1
+ import CJS_COMPAT_NODE_URL_dxdurso8yeb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_dxdurso8yeb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_dxdurso8yeb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3fqiy48f2ku.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3fqiy48f2ku.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3fqiy48f2ku.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_dxdurso8yeb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_dxdurso8yeb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_dxdurso8yeb.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
@@ -702,13 +702,16 @@ var TestProviderRender = /* @__PURE__ */ __name(({
702
702
  {
703
703
  "aria-label": "Start test run",
704
704
  size: "medium",
705
- onClick: () => store.send({
706
- type: "TRIGGER_RUN",
707
- payload: {
708
- storyIds: entry ? api.findAllLeafStoryIds(entry.id) : void 0,
709
- triggeredBy: entry ? entry.type : "global"
705
+ onClick: () => {
706
+ let storyIds;
707
+ if (entry) {
708
+ storyIds = entry.type === "story" ? [entry.id] : api.findAllLeafStoryIds(entry.id);
710
709
  }
711
- })
710
+ store.send({
711
+ type: "TRIGGER_RUN",
712
+ payload: { storyIds, triggeredBy: entry?.type ?? "global" }
713
+ });
714
+ }
712
715
  },
713
716
  React3.createElement(PlayHollowIcon, null)
714
717
  )