storybook 9.1.0-alpha.4 → 9.1.0-alpha.6

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.
Files changed (39) hide show
  1. package/dist/bin/index.cjs +62 -69
  2. package/dist/bin/index.js +43 -50
  3. package/dist/cli/bin/index.cjs +604 -604
  4. package/dist/cli/bin/index.js +151 -150
  5. package/dist/cli/index.cjs +13787 -13796
  6. package/dist/cli/index.d.ts +706 -15
  7. package/dist/cli/index.js +12363 -12371
  8. package/dist/common/index.cjs +10988 -10891
  9. package/dist/common/index.d.ts +342 -69
  10. package/dist/common/index.js +24631 -24531
  11. package/dist/components/index.cjs +5 -3
  12. package/dist/components/index.d.ts +2 -1
  13. package/dist/components/index.js +5 -3
  14. package/dist/controls/preview.cjs +14 -14
  15. package/dist/controls/preview.d.ts +1 -1
  16. package/dist/controls/preview.js +2 -2
  17. package/dist/core-server/index.cjs +4838 -4791
  18. package/dist/core-server/index.d.ts +10 -1
  19. package/dist/core-server/index.js +5746 -5699
  20. package/dist/core-server/presets/common-manager.js +46 -32
  21. package/dist/core-server/presets/common-preset.cjs +1047 -1045
  22. package/dist/core-server/presets/common-preset.js +2053 -2048
  23. package/dist/csf/index.d.ts +2 -1
  24. package/dist/csf-tools/index.cjs +226 -224
  25. package/dist/csf-tools/index.js +116 -112
  26. package/dist/manager/globals-runtime.js +6 -4
  27. package/dist/manager-api/index.cjs +73 -73
  28. package/dist/manager-api/index.js +140 -140
  29. package/dist/node-logger/index.cjs +8520 -994
  30. package/dist/node-logger/index.d.ts +395 -2
  31. package/dist/node-logger/index.js +8535 -995
  32. package/dist/server-errors.cjs +201 -242
  33. package/dist/server-errors.d.ts +1 -12
  34. package/dist/server-errors.js +182 -223
  35. package/dist/telemetry/index.cjs +1326 -1325
  36. package/dist/telemetry/index.d.ts +3 -2
  37. package/dist/telemetry/index.js +1217 -1214
  38. package/dist/types/index.d.ts +3 -3
  39. package/package.json +18 -9
@@ -9,7 +9,7 @@ var Qe = Object.defineProperty;
9
9
  var Rr = Object.getOwnPropertyDescriptor;
10
10
  var Zr = Object.getOwnPropertyNames;
11
11
  var Pr = Object.getPrototypeOf, Nr = Object.prototype.hasOwnProperty;
12
- var d = (s, e) => Qe(s, "name", { value: e, configurable: !0 }), me = /* @__PURE__ */ ((s) => typeof require < "u" ? require : typeof Proxy <
12
+ var d = (s, e) => Qe(s, "name", { value: e, configurable: !0 }), ge = /* @__PURE__ */ ((s) => typeof require < "u" ? require : typeof Proxy <
13
13
  "u" ? new Proxy(s, {
14
14
  get: (e, t) => (typeof require < "u" ? require : e)[t]
15
15
  }) : s)(function(s) {
@@ -23,7 +23,7 @@ var Vr = (s, e, t, r) => {
23
23
  !Nr.call(s, i) && i !== t && Qe(s, i, { get: () => e[i], enumerable: !(r = Rr(e, i)) || r.enumerable });
24
24
  return s;
25
25
  };
26
- var fe = (s, e, t) => (t = s != null ? Sr(Pr(s)) : {}, Vr(
26
+ var ye = (s, e, t) => (t = s != null ? Sr(Pr(s)) : {}, Vr(
27
27
  // If the importer is in node compatibility mode or this is not an ESM
28
28
  // file that has been converted to a CommonJS file using a Babel-
29
29
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -33,7 +33,7 @@ var fe = (s, e, t) => (t = s != null ? Sr(Pr(s)) : {}, Vr(
33
33
  ));
34
34
 
35
35
  // ../node_modules/commander/lib/error.js
36
- var Oe = O((tt) => {
36
+ var Te = O((tt) => {
37
37
  var Ve = class extends Error {
38
38
  static {
39
39
  d(this, "CommanderError");
@@ -66,7 +66,7 @@ var Oe = O((tt) => {
66
66
 
67
67
  // ../node_modules/commander/lib/argument.js
68
68
  var De = O((st) => {
69
- var { InvalidArgumentError: Dr } = Oe(), rt = class {
69
+ var { InvalidArgumentError: Dr } = Te(), rt = class {
70
70
  static {
71
71
  d(this, "Argument");
72
72
  }
@@ -389,9 +389,9 @@ var nt = O((Pt) => {
389
389
  */
390
390
  formatHelp(e, t) {
391
391
  let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2, o = 2;
392
- function a(I, B) {
393
- if (B) {
394
- let Xe = `${I.padEnd(r + o)}${B}`;
392
+ function a(I, W) {
393
+ if (W) {
394
+ let Xe = `${I.padEnd(r + o)}${W}`;
395
395
  return t.wrap(
396
396
  Xe,
397
397
  i - n,
@@ -421,9 +421,9 @@ var nt = O((Pt) => {
421
421
  t.optionDescription(I)
422
422
  ));
423
423
  if (k.length > 0 && (p = p.concat(["Options:", l(k), ""])), this.showGlobalOptions) {
424
- let I = t.visibleGlobalOptions(e).map((B) => a(
425
- t.optionTerm(B),
426
- t.optionDescription(B)
424
+ let I = t.visibleGlobalOptions(e).map((W) => a(
425
+ t.optionTerm(W),
426
+ t.optionDescription(W)
427
427
  ));
428
428
  I.length > 0 && (p = p.concat([
429
429
  "Global Options:",
@@ -476,8 +476,8 @@ var nt = O((Pt) => {
476
476
  |.{1,${a - 1}}([${k}]|$)|[^${k}]+?([${k}]|$)`,
477
477
  "g"
478
478
  ), I = p.match(j) || [];
479
- return l + I.map((B, Xe) => B === `
480
- ` ? "" : (Xe > 0 ? h : "") + B.trimEnd()).join(`
479
+ return l + I.map((W, Xe) => W === `
480
+ ` ? "" : (Xe > 0 ? h : "") + W.trimEnd()).join(`
481
481
  `);
482
482
  }
483
483
  };
@@ -486,7 +486,7 @@ var nt = O((Pt) => {
486
486
 
487
487
  // ../node_modules/commander/lib/option.js
488
488
  var ct = O((dt) => {
489
- var { InvalidArgumentError: Lr } = Oe(), ot = class {
489
+ var { InvalidArgumentError: Lr } = Te(), ot = class {
490
490
  static {
491
491
  d(this, "Option");
492
492
  }
@@ -725,7 +725,7 @@ var Vt = O((Nt) => {
725
725
  return t[s.length][e.length];
726
726
  }
727
727
  d(Fr, "editDistance");
728
- function Br(s, e) {
728
+ function Wr(s, e) {
729
729
  if (!e || e.length === 0) return "";
730
730
  e = Array.from(new Set(e));
731
731
  let t = s.startsWith("--");
@@ -739,15 +739,15 @@ var Vt = O((Nt) => {
739
739
  (Did you mean one of ${r.join(", ")}?)` : r.length === 1 ? `
740
740
  (Did you mean ${r[0]}?)` : "";
741
741
  }
742
- d(Br, "suggestSimilar");
743
- Nt.suggestSimilar = Br;
742
+ d(Wr, "suggestSimilar");
743
+ Nt.suggestSimilar = Wr;
744
744
  });
745
745
 
746
746
  // ../node_modules/commander/lib/command.js
747
747
  var Ut = O((Lt) => {
748
- var Wr = me("node:events").EventEmitter, ut = me("node:child_process"), L = me("node:path"), lt = me("node:fs"), C = me("node:process"), {
749
- Argument: Hr, humanReadableArgName: Kr } = De(), { CommanderError: pt } = Oe(), { Help: zr } = nt(), { Option: Dt, DualOptions: Gr } = ct(),
750
- { suggestSimilar: $t } = Vt(), ht = class s extends Wr {
748
+ var Br = ge("node:events").EventEmitter, ut = ge("node:child_process"), L = ge("node:path"), lt = ge("node:fs"), C = ge("node:process"), {
749
+ Argument: Hr, humanReadableArgName: Kr } = De(), { CommanderError: pt } = Te(), { Help: zr } = nt(), { Option: Dt, DualOptions: Gr } = ct(),
750
+ { suggestSimilar: $t } = Vt(), ht = class s extends Br {
751
751
  static {
752
752
  d(this, "Command");
753
753
  }
@@ -2307,14 +2307,14 @@ Expecting one of '${r.join("', '")}'`);
2307
2307
  });
2308
2308
 
2309
2309
  // ../node_modules/commander/index.js
2310
- var Wt = O((R) => {
2311
- var { Argument: qt } = De(), { Command: mt } = Ut(), { CommanderError: Jr, InvalidArgumentError: Ft } = Oe(), { Help: Yr } = nt(), { Option: Bt } = ct();
2310
+ var Bt = O((R) => {
2311
+ var { Argument: qt } = De(), { Command: mt } = Ut(), { CommanderError: Jr, InvalidArgumentError: Ft } = Te(), { Help: Yr } = nt(), { Option: Wt } = ct();
2312
2312
  R.program = new mt();
2313
2313
  R.createCommand = (s) => new mt(s);
2314
- R.createOption = (s, e) => new Bt(s, e);
2314
+ R.createOption = (s, e) => new Wt(s, e);
2315
2315
  R.createArgument = (s, e) => new qt(s, e);
2316
2316
  R.Command = mt;
2317
- R.Option = Bt;
2317
+ R.Option = Wt;
2318
2318
  R.Argument = qt;
2319
2319
  R.Help = Yr;
2320
2320
  R.CommanderError = Jr;
@@ -2327,7 +2327,7 @@ var Kt = O(($e) => {
2327
2327
  "use strict";
2328
2328
  Object.defineProperty($e, "__esModule", { value: !0 });
2329
2329
  $e.walkUp = void 0;
2330
- var Ht = me("path"), Xr = /* @__PURE__ */ d(function* (s) {
2330
+ var Ht = ge("path"), Xr = /* @__PURE__ */ d(function* (s) {
2331
2331
  for (s = (0, Ht.resolve)(s); s; ) {
2332
2332
  yield s;
2333
2333
  let e = (0, Ht.dirname)(s);
@@ -2403,10 +2403,10 @@ var Xt = O((xn, yt) => {
2403
2403
  });
2404
2404
 
2405
2405
  // ../node_modules/ts-dedent/dist/index.js
2406
- var bt = O((Te) => {
2406
+ var bt = O((Ee) => {
2407
2407
  "use strict";
2408
- Object.defineProperty(Te, "__esModule", { value: !0 });
2409
- Te.dedent = void 0;
2408
+ Object.defineProperty(Ee, "__esModule", { value: !0 });
2409
+ Ee.dedent = void 0;
2410
2410
  function tr(s) {
2411
2411
  for (var e = [], t = 1; t < arguments.length; t++)
2412
2412
  e[t - 1] = arguments[t];
@@ -2440,12 +2440,12 @@ var bt = O((Te) => {
2440
2440
  }), o;
2441
2441
  }
2442
2442
  d(tr, "dedent");
2443
- Te.dedent = tr;
2444
- Te.default = tr;
2443
+ Ee.dedent = tr;
2444
+ Ee.default = tr;
2445
2445
  });
2446
2446
 
2447
2447
  // ../node_modules/zod/lib/helpers/util.js
2448
- var Ee = O((w) => {
2448
+ var Ae = O((w) => {
2449
2449
  "use strict";
2450
2450
  Object.defineProperty(w, "__esModule", { value: !0 });
2451
2451
  w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
@@ -2548,7 +2548,7 @@ var Ue = O((K) => {
2548
2548
  "use strict";
2549
2549
  Object.defineProperty(K, "__esModule", { value: !0 });
2550
2550
  K.ZodError = K.quotelessJson = K.ZodIssueCode = void 0;
2551
- var ir = Ee();
2551
+ var ir = Ae();
2552
2552
  K.ZodIssueCode = ir.util.arrayToEnum([
2553
2553
  "invalid_type",
2554
2554
  "invalid_literal",
@@ -2569,7 +2569,7 @@ var Ue = O((K) => {
2569
2569
  ]);
2570
2570
  var xs = /* @__PURE__ */ d((s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson");
2571
2571
  K.quotelessJson = xs;
2572
- var Ae = class s extends Error {
2572
+ var je = class s extends Error {
2573
2573
  static {
2574
2574
  d(this, "ZodError");
2575
2575
  }
@@ -2632,15 +2632,15 @@ var Ue = O((K) => {
2632
2632
  return this.flatten();
2633
2633
  }
2634
2634
  };
2635
- K.ZodError = Ae;
2636
- Ae.create = (s) => new Ae(s);
2635
+ K.ZodError = je;
2636
+ je.create = (s) => new je(s);
2637
2637
  });
2638
2638
 
2639
2639
  // ../node_modules/zod/lib/locales/en.js
2640
2640
  var Ct = O((kt) => {
2641
2641
  "use strict";
2642
2642
  Object.defineProperty(kt, "__esModule", { value: !0 });
2643
- var X = Ee(), T = Ue(), ws = /* @__PURE__ */ d((s, e) => {
2643
+ var X = Ae(), T = Ue(), ws = /* @__PURE__ */ d((s, e) => {
2644
2644
  let t;
2645
2645
  switch (s.code) {
2646
2646
  case T.ZodIssueCode.invalid_type:
@@ -2869,7 +2869,7 @@ var lr = O((Fe) => {
2869
2869
  // ../node_modules/zod/lib/types.js
2870
2870
  var Cr = O((c) => {
2871
2871
  "use strict";
2872
- var We = c && c.__classPrivateFieldGet || function(s, e, t, r) {
2872
+ var Be = c && c.__classPrivateFieldGet || function(s, e, t, r) {
2873
2873
  if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
2874
2874
  if (typeof e == "function" ? s !== e || !r : !e.has(s)) throw new TypeError("Cannot read private member from an object whose class did n\
2875
2875
  ot declare it");
@@ -2880,7 +2880,7 @@ ot declare it");
2880
2880
  if (typeof e == "function" ? s !== e || !i : !e.has(s)) throw new TypeError("Cannot write private member to an object whose class did no\
2881
2881
  t declare it");
2882
2882
  return r === "a" ? i.call(s, t) : i ? i.value = t : e.set(s, t), t;
2883
- }, je, Se;
2883
+ }, Se, Re;
2884
2884
  Object.defineProperty(c, "__esModule", { value: !0 });
2885
2885
  c.boolean = c.bigint = c.array = c.any = c.coerce = c.ZodFirstPartyTypeKind = c.late = c.ZodSchema = c.Schema = c.custom = c.ZodReadonly =
2886
2886
  c.ZodPipeline = c.ZodBranded = c.BRAND = c.ZodNaN = c.ZodCatch = c.ZodDefault = c.ZodNullable = c.ZodOptional = c.ZodTransformer = c.ZodEffects =
@@ -2891,7 +2891,7 @@ t declare it");
2891
2891
  c.promise = c.preprocess = c.pipeline = c.ostring = c.optional = c.onumber = c.oboolean = c.object = c.number = c.nullable = c.null = c.never =
2892
2892
  c.nativeEnum = c.nan = c.map = c.literal = c.lazy = c.intersection = c.instanceof = c.function = c.enum = c.effect = c.discriminatedUnion =
2893
2893
  c.date = void 0;
2894
- var Be = qe(), g = lr(), u = Ot(), f = Ee(), m = Ue(), P = class {
2894
+ var We = qe(), g = lr(), u = Ot(), f = Ae(), m = Ue(), P = class {
2895
2895
  static {
2896
2896
  d(this, "ParseInputLazyPath");
2897
2897
  }
@@ -3129,7 +3129,7 @@ eProperties");
3129
3129
  });
3130
3130
  }
3131
3131
  brand() {
3132
- return new Re({
3132
+ return new Ze({
3133
3133
  typeName: _.ZodBranded,
3134
3134
  type: this,
3135
3135
  ...v(this._def)
@@ -3152,7 +3152,7 @@ eProperties");
3152
3152
  });
3153
3153
  }
3154
3154
  pipe(e) {
3155
- return Ze.create(this, e);
3155
+ return Pe.create(this, e);
3156
3156
  }
3157
3157
  readonly() {
3158
3158
  return he.create(this);
@@ -3169,8 +3169,8 @@ eProperties");
3169
3169
  c.ZodSchema = b;
3170
3170
  var Vs = /^c[^\s-]{8,}$/i, Ds = /^[0-9a-z]+$/, $s = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ms = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,
3171
3171
  Ls = /^[a-z0-9_-]{21}$/i, Us = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, qs = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,
3172
- Fs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Bs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
3173
- onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Hs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
3172
+ Fs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ws = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
3173
+ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Hs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
3174
3174
  Ks = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
3175
3175
  zs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
3176
3176
  Gs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Js = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
@@ -3192,7 +3192,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
3192
3192
  d(yr, "datetimeRegex");
3193
3193
  c.datetimeRegex = yr;
3194
3194
  function Qs(s, e) {
3195
- return !!((e === "v4" || !e) && Ws.test(s) || (e === "v6" || !e) && Ks.test(s));
3195
+ return !!((e === "v4" || !e) && Bs.test(s) || (e === "v6" || !e) && Ks.test(s));
3196
3196
  }
3197
3197
  d(Qs, "isValidIP");
3198
3198
  function ei(s, e) {
@@ -3268,7 +3268,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
3268
3268
  message: n.message
3269
3269
  }), r.dirty());
3270
3270
  else if (n.kind === "emoji")
3271
- Tt || (Tt = new RegExp(Bs, "u")), Tt.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
3271
+ Tt || (Tt = new RegExp(Ws, "u")), Tt.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
3272
3272
  validation: "emoji",
3273
3273
  code: m.ZodIssueCode.invalid_string,
3274
3274
  message: n.message
@@ -4033,7 +4033,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4033
4033
  typeName: _.ZodDate,
4034
4034
  ...v(s)
4035
4035
  });
4036
- var ye = class extends b {
4036
+ var ve = class extends b {
4037
4037
  static {
4038
4038
  d(this, "ZodSymbol");
4039
4039
  }
@@ -4049,8 +4049,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4049
4049
  return (0, u.OK)(e.data);
4050
4050
  }
4051
4051
  };
4052
- c.ZodSymbol = ye;
4053
- ye.create = (s) => new ye({
4052
+ c.ZodSymbol = ve;
4053
+ ve.create = (s) => new ve({
4054
4054
  typeName: _.ZodSymbol,
4055
4055
  ...v(s)
4056
4056
  });
@@ -4146,7 +4146,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4146
4146
  typeName: _.ZodNever,
4147
4147
  ...v(s)
4148
4148
  });
4149
- var _e = class extends b {
4149
+ var be = class extends b {
4150
4150
  static {
4151
4151
  d(this, "ZodVoid");
4152
4152
  }
@@ -4162,8 +4162,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4162
4162
  return (0, u.OK)(e.data);
4163
4163
  }
4164
4164
  };
4165
- c.ZodVoid = _e;
4166
- _e.create = (s) => new _e({
4165
+ c.ZodVoid = be;
4166
+ be.create = (s) => new be({
4167
4167
  typeName: _.ZodVoid,
4168
4168
  ...v(s)
4169
4169
  });
@@ -4244,12 +4244,12 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4244
4244
  typeName: _.ZodArray,
4245
4245
  ...v(e)
4246
4246
  });
4247
- function ge(s) {
4247
+ function _e(s) {
4248
4248
  if (s instanceof E) {
4249
4249
  let e = {};
4250
4250
  for (let t in s.shape) {
4251
4251
  let r = s.shape[t];
4252
- e[t] = Z.create(ge(r));
4252
+ e[t] = Z.create(_e(r));
4253
4253
  }
4254
4254
  return new E({
4255
4255
  ...s._def,
@@ -4257,11 +4257,11 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4257
4257
  });
4258
4258
  } else return s instanceof F ? new F({
4259
4259
  ...s._def,
4260
- type: ge(s.element)
4261
- }) : s instanceof Z ? Z.create(ge(s.unwrap())) : s instanceof M ? M.create(ge(s.unwrap())) : s instanceof $ ? $.create(s.items.map((e) => ge(
4260
+ type: _e(s.element)
4261
+ }) : s instanceof Z ? Z.create(_e(s.unwrap())) : s instanceof M ? M.create(_e(s.unwrap())) : s instanceof $ ? $.create(s.items.map((e) => _e(
4262
4262
  e))) : s;
4263
4263
  }
4264
- d(ge, "deepPartialify");
4264
+ d(_e, "deepPartialify");
4265
4265
  var E = class s extends b {
4266
4266
  static {
4267
4267
  d(this, "ZodObject");
@@ -4501,7 +4501,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4501
4501
  * @deprecated
4502
4502
  */
4503
4503
  deepPartial() {
4504
- return ge(this);
4504
+ return _e(this);
4505
4505
  }
4506
4506
  partial(e) {
4507
4507
  let t = {};
@@ -4633,7 +4633,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4633
4633
  });
4634
4634
  var U = /* @__PURE__ */ d((s) => s instanceof ae ? U(s.schema) : s instanceof S ? U(s.innerType()) : s instanceof de ? [s.value] : s instanceof
4635
4635
  ce ? s.options : s instanceof ue ? f.util.objectValues(s.enum) : s instanceof le ? U(s._def.innerType) : s instanceof se ? [void 0] : s instanceof
4636
- ie ? [null] : s instanceof Z ? [void 0, ...U(s.unwrap())] : s instanceof M ? [null, ...U(s.unwrap())] : s instanceof Re || s instanceof he ?
4636
+ ie ? [null] : s instanceof Z ? [void 0, ...U(s.unwrap())] : s instanceof M ? [null, ...U(s.unwrap())] : s instanceof Ze || s instanceof he ?
4637
4637
  U(s.unwrap()) : s instanceof pe ? U(s._def.innerType) : [], "getDiscriminator"), He = class s extends b {
4638
4638
  static {
4639
4639
  d(this, "ZodDiscriminatedUnion");
@@ -4869,7 +4869,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4869
4869
  }
4870
4870
  };
4871
4871
  c.ZodRecord = Ke;
4872
- var ve = class extends b {
4872
+ var xe = class extends b {
4873
4873
  static {
4874
4874
  d(this, "ZodMap");
4875
4875
  }
@@ -4914,14 +4914,14 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4914
4914
  }
4915
4915
  }
4916
4916
  };
4917
- c.ZodMap = ve;
4918
- ve.create = (s, e, t) => new ve({
4917
+ c.ZodMap = xe;
4918
+ xe.create = (s, e, t) => new xe({
4919
4919
  valueType: e,
4920
4920
  keyType: s,
4921
4921
  typeName: _.ZodMap,
4922
4922
  ...v(t)
4923
4923
  });
4924
- var be = class s extends b {
4924
+ var we = class s extends b {
4925
4925
  static {
4926
4926
  d(this, "ZodSet");
4927
4927
  }
@@ -4982,8 +4982,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4982
4982
  return this.min(1, e);
4983
4983
  }
4984
4984
  };
4985
- c.ZodSet = be;
4986
- be.create = (s, e) => new be({
4985
+ c.ZodSet = we;
4986
+ we.create = (s, e) => new we({
4987
4987
  valueType: s,
4988
4988
  minSize: null,
4989
4989
  maxSize: null,
@@ -5012,8 +5012,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5012
5012
  errorMaps: [
5013
5013
  t.common.contextualErrorMap,
5014
5014
  t.schemaErrorMap,
5015
- (0, Be.getErrorMap)(),
5016
- Be.defaultErrorMap
5015
+ (0, We.getErrorMap)(),
5016
+ We.defaultErrorMap
5017
5017
  ].filter((p) => !!p),
5018
5018
  issueData: {
5019
5019
  code: m.ZodIssueCode.invalid_arguments,
@@ -5029,8 +5029,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5029
5029
  errorMaps: [
5030
5030
  t.common.contextualErrorMap,
5031
5031
  t.schemaErrorMap,
5032
- (0, Be.getErrorMap)(),
5033
- Be.defaultErrorMap
5032
+ (0, We.getErrorMap)(),
5033
+ We.defaultErrorMap
5034
5034
  ].filter((p) => !!p),
5035
5035
  issueData: {
5036
5036
  code: m.ZodIssueCode.invalid_return_type,
@@ -5153,7 +5153,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5153
5153
  d(this, "ZodEnum");
5154
5154
  }
5155
5155
  constructor() {
5156
- super(...arguments), je.set(this, void 0);
5156
+ super(...arguments), Se.set(this, void 0);
5157
5157
  }
5158
5158
  _parse(e) {
5159
5159
  if (typeof e.data != "string") {
@@ -5164,7 +5164,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5164
5164
  code: m.ZodIssueCode.invalid_type
5165
5165
  }), u.INVALID;
5166
5166
  }
5167
- if (We(this, je, "f") || mr(this, je, new Set(this._def.values), "f"), !We(this, je, "f").has(e.data)) {
5167
+ if (Be(this, Se, "f") || mr(this, Se, new Set(this._def.values), "f"), !Be(this, Se, "f").has(e.data)) {
5168
5168
  let t = this._getOrReturnCtx(e), r = this._def.values;
5169
5169
  return (0, u.addIssueToContext)(t, {
5170
5170
  received: t.data,
@@ -5209,14 +5209,14 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5209
5209
  }
5210
5210
  };
5211
5211
  c.ZodEnum = ce;
5212
- je = /* @__PURE__ */ new WeakMap();
5212
+ Se = /* @__PURE__ */ new WeakMap();
5213
5213
  ce.create = _r;
5214
5214
  var ue = class extends b {
5215
5215
  static {
5216
5216
  d(this, "ZodNativeEnum");
5217
5217
  }
5218
5218
  constructor() {
5219
- super(...arguments), Se.set(this, void 0);
5219
+ super(...arguments), Re.set(this, void 0);
5220
5220
  }
5221
5221
  _parse(e) {
5222
5222
  let t = f.util.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
@@ -5228,7 +5228,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5228
5228
  code: m.ZodIssueCode.invalid_type
5229
5229
  }), u.INVALID;
5230
5230
  }
5231
- if (We(this, Se, "f") || mr(this, Se, new Set(f.util.getValidEnumValues(this._def.values)), "f"), !We(this, Se, "f").has(e.data)) {
5231
+ if (Be(this, Re, "f") || mr(this, Re, new Set(f.util.getValidEnumValues(this._def.values)), "f"), !Be(this, Re, "f").has(e.data)) {
5232
5232
  let i = f.util.objectValues(t);
5233
5233
  return (0, u.addIssueToContext)(r, {
5234
5234
  received: r.data,
@@ -5243,7 +5243,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5243
5243
  }
5244
5244
  };
5245
5245
  c.ZodNativeEnum = ue;
5246
- Se = /* @__PURE__ */ new WeakMap();
5246
+ Re = /* @__PURE__ */ new WeakMap();
5247
5247
  ue.create = (s, e) => new ue({
5248
5248
  values: s,
5249
5249
  typeName: _.ZodNativeEnum,
@@ -5477,7 +5477,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5477
5477
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
5478
5478
  ...v(e)
5479
5479
  });
5480
- var xe = class extends b {
5480
+ var ke = class extends b {
5481
5481
  static {
5482
5482
  d(this, "ZodNaN");
5483
5483
  }
@@ -5493,13 +5493,13 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5493
5493
  return { status: "valid", value: e.data };
5494
5494
  }
5495
5495
  };
5496
- c.ZodNaN = xe;
5497
- xe.create = (s) => new xe({
5496
+ c.ZodNaN = ke;
5497
+ ke.create = (s) => new ke({
5498
5498
  typeName: _.ZodNaN,
5499
5499
  ...v(s)
5500
5500
  });
5501
5501
  c.BRAND = Symbol("zod_brand");
5502
- var Re = class extends b {
5502
+ var Ze = class extends b {
5503
5503
  static {
5504
5504
  d(this, "ZodBranded");
5505
5505
  }
@@ -5515,8 +5515,8 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5515
5515
  return this._def.type;
5516
5516
  }
5517
5517
  };
5518
- c.ZodBranded = Re;
5519
- var Ze = class s extends b {
5518
+ c.ZodBranded = Ze;
5519
+ var Pe = class s extends b {
5520
5520
  static {
5521
5521
  d(this, "ZodPipeline");
5522
5522
  }
@@ -5560,7 +5560,7 @@ onent})+$", Tt, Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5560
5560
  });
5561
5561
  }
5562
5562
  };
5563
- c.ZodPipeline = Ze;
5563
+ c.ZodPipeline = Pe;
5564
5564
  var he = class extends b {
5565
5565
  static {
5566
5566
  d(this, "ZodReadonly");
@@ -5627,7 +5627,7 @@ adonly";
5627
5627
  c.string = br;
5628
5628
  var xr = Q.create;
5629
5629
  c.number = xr;
5630
- var ii = xe.create;
5630
+ var ii = ke.create;
5631
5631
  c.nan = ii;
5632
5632
  var ni = ee.create;
5633
5633
  c.bigint = ni;
@@ -5635,7 +5635,7 @@ adonly";
5635
5635
  c.boolean = wr;
5636
5636
  var oi = re.create;
5637
5637
  c.date = oi;
5638
- var ai = ye.create;
5638
+ var ai = ve.create;
5639
5639
  c.symbol = ai;
5640
5640
  var di = se.create;
5641
5641
  c.undefined = di;
@@ -5647,7 +5647,7 @@ adonly";
5647
5647
  c.unknown = li;
5648
5648
  var pi = V.create;
5649
5649
  c.never = pi;
5650
- var hi = _e.create;
5650
+ var hi = be.create;
5651
5651
  c.void = hi;
5652
5652
  var mi = F.create;
5653
5653
  c.array = mi;
@@ -5665,9 +5665,9 @@ adonly";
5665
5665
  c.tuple = bi;
5666
5666
  var xi = Ke.create;
5667
5667
  c.record = xi;
5668
- var wi = ve.create;
5668
+ var wi = xe.create;
5669
5669
  c.map = wi;
5670
- var ki = be.create;
5670
+ var ki = we.create;
5671
5671
  c.set = ki;
5672
5672
  var Ci = ze.create;
5673
5673
  c.function = Ci;
@@ -5690,7 +5690,7 @@ adonly";
5690
5690
  c.nullable = Si;
5691
5691
  var Ri = S.createWithPreprocess;
5692
5692
  c.preprocess = Ri;
5693
- var Zi = Ze.create;
5693
+ var Zi = Pe.create;
5694
5694
  c.pipeline = Zi;
5695
5695
  var Pi = /* @__PURE__ */ d(() => br().optional(), "ostring");
5696
5696
  c.ostring = Pi;
@@ -5722,16 +5722,16 @@ var At = O((N) => {
5722
5722
  }, "get") }), Object.defineProperty(s, r, i);
5723
5723
  } : function(s, e, t, r) {
5724
5724
  r === void 0 && (r = t), s[r] = e[t];
5725
- }), we = N && N.__exportStar || function(s, e) {
5725
+ }), Ce = N && N.__exportStar || function(s, e) {
5726
5726
  for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Di(e, s, t);
5727
5727
  };
5728
5728
  Object.defineProperty(N, "__esModule", { value: !0 });
5729
- we(qe(), N);
5730
- we(Ot(), N);
5731
- we(cr(), N);
5732
- we(Ee(), N);
5733
- we(Cr(), N);
5734
- we(Ue(), N);
5729
+ Ce(qe(), N);
5730
+ Ce(Ot(), N);
5731
+ Ce(cr(), N);
5732
+ Ce(Ae(), N);
5733
+ Ce(Cr(), N);
5734
+ Ce(Ue(), N);
5735
5735
  });
5736
5736
 
5737
5737
  // ../node_modules/zod/lib/index.js
@@ -5766,13 +5766,13 @@ var Tr = O((A) => {
5766
5766
  });
5767
5767
 
5768
5768
  // src/cli/bin/index.ts
5769
- var Pe = fe(Wt(), 1);
5770
- import { getEnvConfig as St, parseList as Ki } from "storybook/internal/common";
5771
- import { logger as Rt } from "storybook/internal/node-logger";
5769
+ var Ne = ye(Bt(), 1);
5770
+ import { getEnvConfig as Rt, parseList as Ki } from "storybook/internal/common";
5771
+ import { logTracker as St, logger as me } from "storybook/internal/node-logger";
5772
5772
  import { addToGlobalContext as zi } from "storybook/internal/telemetry";
5773
5773
 
5774
5774
  // ../node_modules/fd-package-json/dist/esm/main.js
5775
- var zt = fe(Kt(), 1);
5775
+ var zt = ye(Kt(), 1);
5776
5776
  import { resolve as Qr } from "node:path";
5777
5777
  import { stat as es, readFile as ts } from "node:fs/promises";
5778
5778
  import { statSync as fn, readFileSync as gn } from "node:fs";
@@ -5793,7 +5793,7 @@ async function ss(s) {
5793
5793
  return null;
5794
5794
  }
5795
5795
  d(ss, "findPackagePath");
5796
- async function W(s) {
5796
+ async function B(s) {
5797
5797
  let e = await ss(s);
5798
5798
  if (!e)
5799
5799
  return null;
@@ -5804,7 +5804,7 @@ async function W(s) {
5804
5804
  return null;
5805
5805
  }
5806
5806
  }
5807
- d(W, "findPackage");
5807
+ d(B, "findPackage");
5808
5808
 
5809
5809
  // node_modules/leven/index.js
5810
5810
  var ft = [], Gt = [];
@@ -5832,7 +5832,7 @@ function gt(s, e) {
5832
5832
  d(gt, "leven");
5833
5833
 
5834
5834
  // src/cli/bin/index.ts
5835
- var Ne = fe(Xt(), 1);
5835
+ var fe = ye(Xt(), 1);
5836
5836
 
5837
5837
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
5838
5838
  var as = process.env.NODE_ENV === "production", _t = "Invariant failed";
@@ -5847,13 +5847,13 @@ function H(s, e) {
5847
5847
  d(H, "invariant");
5848
5848
 
5849
5849
  // package.json
5850
- var vt = "9.1.0-alpha.4";
5850
+ var vt = "9.1.0-alpha.6";
5851
5851
 
5852
5852
  // src/cli/build.ts
5853
5853
  import { cache as cs } from "storybook/internal/common";
5854
5854
  import { buildStaticStandalone as us, withTelemetry as ls } from "storybook/internal/core-server";
5855
5855
  var Qt = /* @__PURE__ */ d(async (s) => {
5856
- let e = await W(__dirname);
5856
+ let e = await B(__dirname);
5857
5857
  H(e, "Failed to find the closest package.json file.");
5858
5858
  let t = {
5859
5859
  ...s,
@@ -5895,7 +5895,7 @@ var er = /* @__PURE__ */ d(async (s) => {
5895
5895
  import { cache as fs } from "storybook/internal/common";
5896
5896
  import { buildDevStandalone as gs, withTelemetry as ys } from "storybook/internal/core-server";
5897
5897
  import { logger as Y, instance as _s } from "storybook/internal/node-logger";
5898
- var xt = fe(bt(), 1);
5898
+ var xt = ye(bt(), 1);
5899
5899
  function vs(s) {
5900
5900
  _s.heading = "", s instanceof Error ? s.error ? Y.error(s.error) : s.stats && s.stats.compilation.errors ? s.stats.compilation.errors.forEach(
5901
5901
  (e) => Y.plain(e)) : Y.error(s) : s.compilation?.errors && s.compilation.errors.forEach((e) => Y.plain(e)), Y.line(), Y.warn(
@@ -5912,7 +5912,7 @@ d(vs, "printError");
5912
5912
  var rr = /* @__PURE__ */ d(async (s) => {
5913
5913
  let { env: e } = process;
5914
5914
  e.NODE_ENV = e.NODE_ENV || "development";
5915
- let t = await W(__dirname);
5915
+ let t = await B(__dirname);
5916
5916
  H(t, "Failed to find the closest package.json file.");
5917
5917
  let r = {
5918
5918
  ...s,
@@ -5934,13 +5934,13 @@ var rr = /* @__PURE__ */ d(async (s) => {
5934
5934
  }, "dev");
5935
5935
 
5936
5936
  // src/cli/globalSettings.ts
5937
- var Ce = fe(Tr(), 1);
5937
+ var Oe = ye(Tr(), 1);
5938
5938
  import jt from "node:fs/promises";
5939
5939
  import { homedir as Ui } from "node:os";
5940
5940
  import { dirname as qi, join as Fi } from "node:path";
5941
5941
 
5942
5942
  // src/server-errors.ts
5943
- var Ar = fe(bt(), 1);
5943
+ var Ar = ye(bt(), 1);
5944
5944
 
5945
5945
  // src/storybook-error.ts
5946
5946
  function Er({
@@ -6010,23 +6010,23 @@ var Je = class extends Ge {
6010
6010
  };
6011
6011
 
6012
6012
  // src/cli/globalSettings.ts
6013
- var Bi = Fi(Ui(), ".storybook", "settings.json"), Wi = 1, Hi = Ce.z.object({
6014
- version: Ce.z.number(),
6013
+ var Wi = Fi(Ui(), ".storybook", "settings.json"), Bi = 1, Hi = Oe.z.object({
6014
+ version: Oe.z.number(),
6015
6015
  // NOTE: every key (and subkey) below must be optional, for forwards compatibility reasons
6016
6016
  // (we can remove keys once they are deprecated)
6017
- userSince: Ce.z.number().optional(),
6018
- init: Ce.z.object({ skipOnboarding: Ce.z.boolean().optional() }).optional()
6019
- }), ke;
6020
- async function jr(s = Bi) {
6021
- if (ke)
6022
- return ke;
6017
+ userSince: Oe.z.number().optional(),
6018
+ init: Oe.z.object({ skipOnboarding: Oe.z.boolean().optional() }).optional()
6019
+ }), Ie;
6020
+ async function jr(s = Wi) {
6021
+ if (Ie)
6022
+ return Ie;
6023
6023
  try {
6024
6024
  let e = await jt.readFile(s, "utf8"), t = Hi.parse(JSON.parse(e));
6025
- ke = new Ye(s, t);
6025
+ Ie = new Ye(s, t);
6026
6026
  } catch {
6027
- ke = new Ye(s, { version: Wi, userSince: Date.now() }), await ke.save();
6027
+ Ie = new Ye(s, { version: Bi, userSince: Date.now() }), await Ie.save();
6028
6028
  }
6029
- return ke;
6029
+ return Ie;
6030
6030
  }
6031
6031
  d(jr, "globalSettings");
6032
6032
  var Ye = class {
@@ -6057,17 +6057,25 @@ var Ye = class {
6057
6057
 
6058
6058
  // src/cli/bin/index.ts
6059
6059
  zi("cliVersion", vt);
6060
- var Ie = console, Zt = /* @__PURE__ */ d((s) => Pe.program.command(s).option(
6060
+ var Zt = /* @__PURE__ */ d((s) => Ne.program.command(s).option(
6061
6061
  "--disable-telemetry",
6062
6062
  "Disable sending telemetry data",
6063
6063
  // default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true
6064
6064
  process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== "false"
6065
- ).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").hook(
6066
- "preAction", async () => {
6065
+ ).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").option(
6066
+ "--loglevel <trace | debug | info | warn | error | silent>", "Define log level", "info").option("--write-logs", "Write all debug logs to a f\
6067
+ ile at the end of the run").hook("preAction", async (e) => {
6067
6068
  try {
6068
- await jr();
6069
- } catch (e) {
6070
- Ie.error("Error loading global settings", e);
6069
+ let t = e.opts();
6070
+ t.loglevel && me.setLogLevel(t.loglevel), t.writeLogs && St.enableLogWriting(), await jr();
6071
+ } catch (t) {
6072
+ me.error(`Error loading global settings:
6073
+ ` + String(t));
6074
+ }
6075
+ }).hook("postAction", async () => {
6076
+ if (St.shouldWriteLogsToFile) {
6077
+ let e = await St.writeToFile();
6078
+ me.outro(`Storybook debug logs can be found at: ${e}`);
6071
6079
  }
6072
6080
  }), "command");
6073
6081
  Zt("dev").option("-p, --port <number>", "Port to run Storybook", (s) => parseInt(s, 10)).option("-h, --host <string>", "Host to run Storyboo\
@@ -6080,9 +6088,8 @@ k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook con
6080
6088
  Ki
6081
6089
  ).option("--ssl-cert <cert>", "Provide an SSL certificate. (Required with --https)").option("--ssl-key <key>", "Provide an SSL key. (Require\
6082
6090
  d with --https)").option("--smoke-test", "Exit after successful start").option("--ci", "CI mode (skip interactive prompts, don't open browse\
6083
- r)").option("--no-open", "Do not open Storybook automatically in the browser").option("--loglevel <level>", "Control level of logging during\
6084
- build").option("--quiet", "Suppress verbose build output").option("--no-version-updates", "Suppress update check", !0).option("--debug-webp\
6085
- ack", "Display final webpack configurations for debugging purposes").option(
6091
+ r)").option("--no-open", "Do not open Storybook automatically in the browser").option("--quiet", "Suppress verbose build output").option("--\
6092
+ no-version-updates", "Suppress update check", !0).option("--debug-webpack", "Display final webpack configurations for debugging purposes").option(
6086
6093
  "--webpack-stats-json [directory]",
6087
6094
  "Write Webpack stats JSON to disk (synonym for `--stats-json`)"
6088
6095
  ).option("--stats-json [directory]", "Write stats JSON to disk").option(
@@ -6093,10 +6100,9 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
6093
6100
  "--initial-path [path]",
6094
6101
  "URL path to be appended when visiting Storybook for the first time"
6095
6102
  ).option("--preview-only", "Use the preview without the manager UI").action(async (s) => {
6096
- Rt.setLevel(s.loglevel);
6097
- let e = await W(__dirname);
6098
- H(e, "Failed to find the closest package.json file."), Ie.log(Ne.default.bold(`${e.name} v${e.version}`) + Ne.default.reset(`
6099
- `)), St(s, {
6103
+ let e = await B(__dirname);
6104
+ H(e, "Failed to find the closest package.json file."), me.log(fe.default.bold(`${e.name} v${e.version}`) + fe.default.reset(`
6105
+ `)), Rt(s, {
6100
6106
  port: "SBCONFIG_PORT",
6101
6107
  host: "SBCONFIG_HOSTNAME",
6102
6108
  staticDir: "SBCONFIG_STATIC_DIR",
@@ -6105,8 +6111,8 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
6105
6111
  }), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await rr({ ...s, packageJson: e }).catch(() => process.exit(1));
6106
6112
  });
6107
6113
  Zt("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
6108
- here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level \
6109
- of logging during build").option("--debug-webpack", "Display final webpack configurations for debugging purposes").option(
6114
+ here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final web\
6115
+ pack configurations for debugging purposes").option(
6110
6116
  "--webpack-stats-json [directory]",
6111
6117
  "Write Webpack stats JSON to disk (synonym for `--stats-json`)"
6112
6118
  ).option("--stats-json [directory]", "Write stats JSON to disk").option(
@@ -6117,9 +6123,9 @@ ly site using addon-docs").option("--test", "Build stories optimized for testing
6117
6123
  ut the manager UI").action(async (s) => {
6118
6124
  let { env: e } = process;
6119
6125
  e.NODE_ENV = e.NODE_ENV || "production";
6120
- let t = await W(__dirname);
6121
- H(t, "Failed to find the closest package.json file."), Rt.setLevel(s.loglevel), Ie.log(Ne.default.bold(`${t.name} v${t.version}
6122
- `)), St(s, {
6126
+ let t = await B(__dirname);
6127
+ H(t, "Failed to find the closest package.json file."), me.log(fe.default.bold(`${t.name} v${t.version}
6128
+ `)), Rt(s, {
6123
6129
  staticDir: "SBCONFIG_STATIC_DIR",
6124
6130
  outputDir: "SBCONFIG_OUTPUT_DIR",
6125
6131
  configDir: "SBCONFIG_CONFIG_DIR"
@@ -6130,13 +6136,12 @@ ut the manager UI").action(async (s) => {
6130
6136
  }).catch(() => process.exit(1));
6131
6137
  });
6132
6138
  Zt("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
6133
- oad Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level of loggin\
6134
- g during build").action(async (s) => {
6139
+ oad Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (s) => {
6135
6140
  let { env: e } = process;
6136
6141
  e.NODE_ENV = e.NODE_ENV || "production";
6137
- let t = await W(__dirname);
6138
- H(t, "Failed to find the closest package.json file."), Rt.setLevel(s.loglevel), Ie.log(Ne.default.bold(`${t.name} v${t.version}
6139
- `)), St(s, {
6142
+ let t = await B(__dirname);
6143
+ H(t, "Failed to find the closest package.json file."), me.log(fe.default.bold(`${t.name} v${t.version}
6144
+ `)), Rt(s, {
6140
6145
  configDir: "SBCONFIG_CONFIG_DIR",
6141
6146
  outputFile: "SBCONFIG_OUTPUT_FILE"
6142
6147
  }), await er({
@@ -6144,14 +6149,10 @@ g during build").action(async (s) => {
6144
6149
  packageJson: t
6145
6150
  }).catch(() => process.exit(1));
6146
6151
  });
6147
- Pe.program.on("command:*", ([s]) => {
6148
- Ie.error(
6149
- ` Invalid command: %s.
6150
- See --help for a list of available commands.`,
6151
- s
6152
- );
6153
- let t = Pe.program.commands.map((r) => r.name()).find((r) => gt(r, s) < 3);
6154
- t && Ie.info(`
6155
- Did you mean ${t}?`), process.exit(1);
6152
+ Ne.program.on("command:*", ([s]) => {
6153
+ let e = ` Invalid command: ${fe.default.bold(s)}.
6154
+ See --help for a list of available commands.`, r = Ne.program.commands.map((i) => i.name()).find((i) => gt(i, s) < 3);
6155
+ r && (e += `
6156
+ Did you mean ${fe.default.yellow(r)}?`), me.error(e), process.exit(1);
6156
6157
  });
6157
- Pe.program.usage("<command> [options]").version(String(vt)).parse(process.argv);
6158
+ Ne.program.usage("<command> [options]").version(String(vt)).parse(process.argv);