storybook 9.0.0-alpha.14 → 9.0.0-alpha.16

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.
@@ -4,20 +4,20 @@ import { dirname as ESM_COMPAT_dirname } from 'node:path';
4
4
  const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
5
5
  const __dirname = ESM_COMPAT_dirname(__filename);
6
6
  const require = ESM_COMPAT_Module.createRequire(import.meta.url);
7
- var ae = Object.create;
7
+ var ie = Object.create;
8
8
  var R = Object.defineProperty;
9
- var ie = Object.getOwnPropertyDescriptor;
10
- var ce = Object.getOwnPropertyNames;
11
- var ue = Object.getPrototypeOf, le = Object.prototype.hasOwnProperty;
9
+ var ce = Object.getOwnPropertyDescriptor;
10
+ var ue = Object.getOwnPropertyNames;
11
+ var le = Object.getPrototypeOf, me = Object.prototype.hasOwnProperty;
12
12
  var r = (t, e) => R(t, "name", { value: e, configurable: !0 });
13
13
  var O = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
14
- var me = (t, e, o, n) => {
14
+ var de = (t, e, o, n) => {
15
15
  if (e && typeof e == "object" || typeof e == "function")
16
- for (let c of ce(e))
17
- !le.call(t, c) && c !== o && R(t, c, { get: () => e[c], enumerable: !(n = ie(e, c)) || n.enumerable });
16
+ for (let c of ue(e))
17
+ !me.call(t, c) && c !== o && R(t, c, { get: () => e[c], enumerable: !(n = ce(e, c)) || n.enumerable });
18
18
  return t;
19
19
  };
20
- var A = (t, e, o) => (o = t != null ? ae(ue(t)) : {}, me(
20
+ var A = (t, e, o) => (o = t != null ? ie(le(t)) : {}, de(
21
21
  // If the importer is in node compatibility mode or this is not an ESM
22
22
  // file that has been converted to a CommonJS file using a Babel-
23
23
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -27,18 +27,18 @@ var A = (t, e, o) => (o = t != null ? ae(ue(t)) : {}, me(
27
27
  ));
28
28
 
29
29
  // ../node_modules/picocolors/picocolors.js
30
- var w = O((he, k) => {
31
- var E = process || {}, _ = E.argv || [], h = E.env || {}, de = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
30
+ var w = O((Ee, k) => {
31
+ var E = process || {}, _ = E.argv || [], h = E.env || {}, be = !(h.NO_COLOR || _.includes("--no-color")) && (!!h.FORCE_COLOR || _.includes(
32
32
  "--color") || E.platform === "win32" || (E.stdout || {}).isTTY && h.TERM !== "dumb" || !!h.CI), ge = /* @__PURE__ */ r((t, e, o = t) => (n) => {
33
33
  let c = "" + n, u = c.indexOf(e, t.length);
34
- return ~u ? t + be(c, e, o, u) + e : t + c + e;
35
- }, "formatter"), be = /* @__PURE__ */ r((t, e, o, n) => {
34
+ return ~u ? t + pe(c, e, o, u) + e : t + c + e;
35
+ }, "formatter"), pe = /* @__PURE__ */ r((t, e, o, n) => {
36
36
  let c = "", u = 0;
37
37
  do
38
38
  c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
39
39
  while (~n);
40
40
  return c + t.substring(u);
41
- }, "replaceClose"), C = /* @__PURE__ */ r((t = de) => {
41
+ }, "replaceClose"), C = /* @__PURE__ */ r((t = be) => {
42
42
  let e = t ? ge : () => String;
43
43
  return {
44
44
  isColorSupported: t,
@@ -90,7 +90,7 @@ var w = O((he, k) => {
90
90
  });
91
91
 
92
92
  // ../node_modules/ts-dedent/dist/index.js
93
- var S = O((y) => {
93
+ var M = O((y) => {
94
94
  "use strict";
95
95
  Object.defineProperty(y, "__esModule", { value: !0 });
96
96
  y.dedent = void 0;
@@ -102,8 +102,8 @@ var S = O((y) => {
102
102
  var c = n.reduce(function(m, x) {
103
103
  var p = x.match(/\n([\t ]+|(?!\s).)/g);
104
104
  return p ? m.concat(p.map(function(f) {
105
- var g, b;
106
- return (b = (g = f.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;
105
+ var b, g;
106
+ return (g = (b = f.match(/[\t ]/g)) === null || b === void 0 ? void 0 : b.length) !== null && g !== void 0 ? g : 0;
107
107
  })) : m;
108
108
  }, []);
109
109
  if (c.length) {
@@ -117,13 +117,13 @@ var S = O((y) => {
117
117
  n[0] = n[0].replace(/^\r?\n/, "");
118
118
  var d = n[0];
119
119
  return e.forEach(function(m, x) {
120
- var p = d.match(/(?:^|\n)( *)$/), f = p ? p[1] : "", g = m;
120
+ var p = d.match(/(?:^|\n)( *)$/), f = p ? p[1] : "", b = m;
121
121
  typeof m == "string" && m.includes(`
122
- `) && (g = String(m).split(`
123
- `).map(function(b, ne) {
124
- return ne === 0 ? b : "" + f + b;
122
+ `) && (b = String(m).split(`
123
+ `).map(function(g, ae) {
124
+ return ae === 0 ? g : "" + f + g;
125
125
  }).join(`
126
- `)), d += g + n[x + 1];
126
+ `)), d += b + n[x + 1];
127
127
  }), d;
128
128
  }
129
129
  r(I, "dedent");
@@ -132,17 +132,17 @@ var S = O((y) => {
132
132
  });
133
133
 
134
134
  // src/server-errors.ts
135
- var l = A(w(), 1), i = A(S(), 1);
135
+ var l = A(w(), 1), i = A(M(), 1);
136
136
 
137
137
  // src/storybook-error.ts
138
- function M({
138
+ function S({
139
139
  code: t,
140
140
  category: e
141
141
  }) {
142
142
  let o = String(t).padStart(4, "0");
143
143
  return `SB_${e}_${o}`;
144
144
  }
145
- r(M, "parseErrorCode");
145
+ r(S, "parseErrorCode");
146
146
  var a = class t extends Error {
147
147
  constructor(o) {
148
148
  super(t.getFullMessage(o));
@@ -159,7 +159,7 @@ var a = class t extends Error {
159
159
  r(this, "StorybookError");
160
160
  }
161
161
  get fullErrorCode() {
162
- return M({ code: this.code, category: this.category });
162
+ return S({ code: this.code, category: this.category });
163
163
  }
164
164
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
165
165
  get name() {
@@ -174,7 +174,7 @@ var a = class t extends Error {
174
174
  message: u
175
175
  }) {
176
176
  let d;
177
- return o === !0 ? d = `https://storybook.js.org/error/${M({ code: n, category: c })}` : typeof o == "string" ? d = o : Array.isArray(o) &&
177
+ return o === !0 ? d = `https://storybook.js.org/error/${S({ code: n, category: c })}` : typeof o == "string" ? d = o : Array.isArray(o) &&
178
178
  (d = `
179
179
  ${o.map((m) => ` - ${m}`).join(`
180
180
  `)}`), `${u}${d != null ? `
@@ -185,7 +185,7 @@ More info: ${d}
185
185
  };
186
186
 
187
187
  // src/server-errors.ts
188
- var pe = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
188
+ var ye = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
189
189
  E", s.CLI_ADD = "CLI_ADD", s.CODEMOD = "CODEMOD", s.CORE_SERVER = "CORE-SERVER", s.CSF_PLUGIN = "CSF-PLUGIN", s.CSF_TOOLS = "CSF-TOOLS", s.CORE_COMMON =
190
190
  "CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
191
191
  TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
@@ -195,7 +195,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
195
195
  "FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
196
196
  FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
197
197
  s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
198
- MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(pe || {}), T = class extends a {
198
+ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ye || {}), T = class extends a {
199
199
  static {
200
200
  r(this, "NxProjectDetectedError");
201
201
  }
@@ -209,7 +209,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
209
209
  Run "nx g @nx/storybook:configuration" to add Storybook to your project.`
210
210
  });
211
211
  }
212
- }, W = class extends a {
212
+ }, v = class extends a {
213
213
  static {
214
214
  r(this, "MissingFrameworkFieldError");
215
215
  }
@@ -224,7 +224,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
224
224
  Please run 'npx storybook automigrate' to automatically fix your config.`
225
225
  });
226
226
  }
227
- }, v = class extends a {
227
+ }, W = class extends a {
228
228
  constructor(o) {
229
229
  super({
230
230
  category: "CORE-COMMON",
@@ -320,16 +320,16 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
320
320
  r(this, "WebpackInvocationError");
321
321
  }
322
322
  };
323
- function $(t = "") {
323
+ function j(t = "") {
324
324
  return t.replace(/\u001B\[[0-9;]*m/g, "");
325
325
  }
326
- r($, "removeAnsiEscapeCodes");
327
- var j = class extends a {
326
+ r(j, "removeAnsiEscapeCodes");
327
+ var V = class extends a {
328
328
  constructor(o) {
329
329
  o.errors = o.errors.map((n) => ({
330
330
  ...n,
331
- message: $(n.message),
332
- stack: $(n.stack),
331
+ message: j(n.message),
332
+ stack: j(n.stack),
333
333
  name: n.name
334
334
  }));
335
335
  super({
@@ -346,7 +346,7 @@ var j = class extends a {
346
346
  static {
347
347
  r(this, "WebpackCompilationError");
348
348
  }
349
- }, V = class extends a {
349
+ }, $ = class extends a {
350
350
  constructor(o) {
351
351
  super({
352
352
  category: "CLI_INIT",
@@ -452,6 +452,20 @@ var j = class extends a {
452
452
  r(this, "GoogleFontsLoadingError");
453
453
  }
454
454
  }, H = class extends a {
455
+ static {
456
+ r(this, "SvelteViteWithSvelteKitError");
457
+ }
458
+ constructor() {
459
+ super({
460
+ category: "FRAMEWORK_SVELTE-VITE",
461
+ code: 1,
462
+ documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework",
463
+ message: i.dedent`
464
+ We've detected a SvelteKit project using the @storybook/svelte-vite framework, which is not supported.
465
+ Please use the @storybook/sveltekit framework instead.`
466
+ });
467
+ }
468
+ }, J = class extends a {
455
469
  constructor(o) {
456
470
  super({
457
471
  category: "CORE-SERVER",
@@ -474,7 +488,7 @@ var j = class extends a {
474
488
  static {
475
489
  r(this, "NoMatchingExportError");
476
490
  }
477
- }, J = class extends a {
491
+ }, X = class extends a {
478
492
  constructor(o) {
479
493
  let n = [
480
494
  `Storybook failed to load ${o.location}`,
@@ -511,7 +525,7 @@ var j = class extends a {
511
525
  static {
512
526
  r(this, "MainFileESMOnlyImportError");
513
527
  }
514
- }, X = class extends a {
528
+ }, z = class extends a {
515
529
  constructor(o) {
516
530
  let n = {
517
531
  storybook: {
@@ -539,7 +553,7 @@ var j = class extends a {
539
553
  static {
540
554
  r(this, "MainFileMissingError");
541
555
  }
542
- }, z = class extends a {
556
+ }, q = class extends a {
543
557
  constructor(o) {
544
558
  let n = l.default.white(
545
559
  (o.error.stack || o.error.message).replaceAll(process.cwd(), "")
@@ -558,7 +572,7 @@ var j = class extends a {
558
572
  static {
559
573
  r(this, "MainFileEvaluationError");
560
574
  }
561
- }, q = class extends a {
575
+ }, Q = class extends a {
562
576
  constructor(o) {
563
577
  super({
564
578
  category: "CORE-SERVER",
@@ -574,7 +588,7 @@ var j = class extends a {
574
588
  static {
575
589
  r(this, "StatusTypeIdMismatchError");
576
590
  }
577
- }, Q = class extends a {
591
+ }, Z = class extends a {
578
592
  constructor(o) {
579
593
  super({
580
594
  category: "CLI_INIT",
@@ -590,7 +604,7 @@ var j = class extends a {
590
604
  static {
591
605
  r(this, "GenerateNewProjectOnInitError");
592
606
  }
593
- }, Z = class extends a {
607
+ }, ee = class extends a {
594
608
  constructor(o) {
595
609
  super({
596
610
  category: "CLI_UPGRADE",
@@ -612,7 +626,7 @@ var j = class extends a {
612
626
  static {
613
627
  r(this, "UpgradeStorybookToLowerVersionError");
614
628
  }
615
- }, ee = class extends a {
629
+ }, oe = class extends a {
616
630
  constructor(o) {
617
631
  super({
618
632
  category: "CLI_UPGRADE",
@@ -637,7 +651,7 @@ var j = class extends a {
637
651
  static {
638
652
  r(this, "UpgradeStorybookToSameVersionError");
639
653
  }
640
- }, oe = class extends a {
654
+ }, te = class extends a {
641
655
  static {
642
656
  r(this, "UpgradeStorybookUnknownCurrentVersionError");
643
657
  }
@@ -652,7 +666,7 @@ var j = class extends a {
652
666
  It might help if you specify your Storybook config directory with the --config-dir flag.`
653
667
  });
654
668
  }
655
- }, te = class extends a {
669
+ }, re = class extends a {
656
670
  static {
657
671
  r(this, "UpgradeStorybookInWrongWorkingDirectory");
658
672
  }
@@ -666,7 +680,7 @@ var j = class extends a {
666
680
  Did you mean to run it in a different directory? Make sure the directory you run this command in contains a package.json with your Storybook dependencies.`
667
681
  });
668
682
  }
669
- }, re = class extends a {
683
+ }, se = class extends a {
670
684
  static {
671
685
  r(this, "NoStatsForViteDevError");
672
686
  }
@@ -680,7 +694,7 @@ var j = class extends a {
680
694
  Please remove the \`--stats-json\` flag when running in dev mode.`
681
695
  });
682
696
  }
683
- }, se = class extends a {
697
+ }, ne = class extends a {
684
698
  constructor(o) {
685
699
  super({
686
700
  category: "CLI",
@@ -697,31 +711,32 @@ var j = class extends a {
697
711
  };
698
712
  export {
699
713
  F as AngularLegacyBuildOptionsError,
700
- pe as Category,
714
+ ye as Category,
701
715
  L as ConflictingStaticDirConfigError,
702
716
  K as CouldNotEvaluateFrameworkError,
703
717
  D as CriticalPresetLoadError,
704
- se as FindPackageVersionsError,
705
- Q as GenerateNewProjectOnInitError,
718
+ ne as FindPackageVersionsError,
719
+ Z as GenerateNewProjectOnInitError,
706
720
  G as GoogleFontsDownloadError,
707
721
  Y as GoogleFontsLoadingError,
708
- v as InvalidFrameworkNameError,
722
+ W as InvalidFrameworkNameError,
709
723
  B as InvalidStoriesEntryError,
710
- J as MainFileESMOnlyImportError,
711
- z as MainFileEvaluationError,
712
- X as MainFileMissingError,
713
- V as MissingAngularJsonError,
724
+ X as MainFileESMOnlyImportError,
725
+ q as MainFileEvaluationError,
726
+ z as MainFileMissingError,
727
+ $ as MissingAngularJsonError,
714
728
  U as MissingBuilderError,
715
- W as MissingFrameworkFieldError,
716
- H as NoMatchingExportError,
717
- re as NoStatsForViteDevError,
729
+ v as MissingFrameworkFieldError,
730
+ J as NoMatchingExportError,
731
+ se as NoStatsForViteDevError,
718
732
  T as NxProjectDetectedError,
719
- q as StatusTypeIdMismatchError,
720
- te as UpgradeStorybookInWrongWorkingDirectory,
721
- Z as UpgradeStorybookToLowerVersionError,
722
- ee as UpgradeStorybookToSameVersionError,
723
- oe as UpgradeStorybookUnknownCurrentVersionError,
724
- j as WebpackCompilationError,
733
+ Q as StatusTypeIdMismatchError,
734
+ H as SvelteViteWithSvelteKitError,
735
+ re as UpgradeStorybookInWrongWorkingDirectory,
736
+ ee as UpgradeStorybookToLowerVersionError,
737
+ oe as UpgradeStorybookToSameVersionError,
738
+ te as UpgradeStorybookUnknownCurrentVersionError,
739
+ V as WebpackCompilationError,
725
740
  N as WebpackInvocationError,
726
741
  P as WebpackMissingStatsError
727
742
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook",
3
- "version": "9.0.0-alpha.14",
3
+ "version": "9.0.0-alpha.16",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"