create-storybook 11.0.0-beta.3 → 11.0.0-beta.4
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/_node-chunks/{chunk-LEWXYR2F.js → chunk-CFINOCOZ.js} +1 -11
- package/dist/_node-chunks/{chunk-4BUOBRVK.js → chunk-FDXHL2R5.js} +23 -220
- package/dist/_node-chunks/{chunk-YAZBZE2W.js → chunk-KA3D3PZF.js} +0 -12
- package/dist/_node-chunks/postinstallAddon-QZIAMDB2.js +115 -0
- package/dist/_node-chunks/{run-FK7SLYSO.js → run-MZ72W7YV.js} +12 -26
- package/dist/_node-chunks/{vitest.config.4.template-Z5QKCTNZ.js → vitest.config.4.template-CSBLKKCJ.js} +1 -12
- package/dist/bin/index.js +1 -12
- package/dist/index.js +3 -14
- package/package.json +2 -2
- package/dist/_node-chunks/postinstallAddon-AFCBL45W.js +0 -252
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
1
|
+
import { createRequire as CJS_COMPAT_CREATE_REQUIRE_4p8n808syhn } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_4p8n808syhn(import.meta.url);
|
|
12
2
|
var __create = Object.create;
|
|
13
3
|
var __defProp = Object.defineProperty;
|
|
14
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
relative,
|
|
14
3
|
resolve
|
|
15
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KA3D3PZF.js";
|
|
16
5
|
import {
|
|
17
6
|
__commonJS,
|
|
18
7
|
__toESM
|
|
19
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CFINOCOZ.js";
|
|
20
9
|
|
|
21
10
|
// ../../../node_modules/ts-dedent/dist/index.js
|
|
22
11
|
var require_dist = __commonJS({
|
|
@@ -2601,164 +2590,12 @@ import { readdir, readFile, writeFile as writeFile2 } from "node:fs/promises";
|
|
|
2601
2590
|
import { SupportedFramework as SupportedFramework2 } from "storybook/internal/types";
|
|
2602
2591
|
|
|
2603
2592
|
// ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2604
|
-
var
|
|
2605
|
-
var __lib__ = (() => {
|
|
2606
|
-
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
|
|
2607
|
-
for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
|
|
2608
|
-
}, H = (r, e, n, a) => {
|
|
2609
|
-
if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
|
|
2610
|
-
return r;
|
|
2611
|
-
}, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
|
|
2612
|
-
q(w, { default: () => re });
|
|
2613
|
-
var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
|
|
2614
|
-
let e = /* @__PURE__ */ new Map();
|
|
2615
|
-
return (n) => {
|
|
2616
|
-
let a = e.get(n);
|
|
2617
|
-
if (a) return a;
|
|
2618
|
-
let t = r(n);
|
|
2619
|
-
return e.set(n, t), t;
|
|
2620
|
-
};
|
|
2621
|
-
}, rr = (r, e, n = {}) => {
|
|
2622
|
-
let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
|
|
2623
|
-
if (v(e)(a) && a.index === r.length) return a.output;
|
|
2624
|
-
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
2625
|
-
}, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
|
|
2626
|
-
let n = {};
|
|
2627
|
-
for (let a of r) {
|
|
2628
|
-
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
2629
|
-
let t = a.charCodeAt(0);
|
|
2630
|
-
n[t] = !0;
|
|
2631
|
-
}
|
|
2632
|
-
return (a) => {
|
|
2633
|
-
let t = a.index, o = a.input;
|
|
2634
|
-
for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
|
|
2635
|
-
let u = a.index;
|
|
2636
|
-
if (u > t) {
|
|
2637
|
-
if (!h(e) && !a.options.silent) {
|
|
2638
|
-
let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
|
|
2639
|
-
h(c) || a.output.push(c);
|
|
2640
|
-
}
|
|
2641
|
-
a.indexMax = Math.max(a.indexMax, a.index);
|
|
2642
|
-
}
|
|
2643
|
-
return !0;
|
|
2644
|
-
};
|
|
2645
|
-
}, nr = (r, e) => {
|
|
2646
|
-
let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
|
|
2647
|
-
return g((o) => {
|
|
2648
|
-
t.lastIndex = o.index;
|
|
2649
|
-
let u = t.exec(o.input);
|
|
2650
|
-
if (u) {
|
|
2651
|
-
if (!h(e) && !o.options.silent) {
|
|
2652
|
-
let s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
2653
|
-
h(s) || o.output.push(s);
|
|
2654
|
-
}
|
|
2655
|
-
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
|
|
2656
|
-
} else return !1;
|
|
2657
|
-
});
|
|
2658
|
-
}, ar = (r, e) => (n) => {
|
|
2659
|
-
if (n.input.startsWith(r, n.index)) {
|
|
2660
|
-
if (!h(e) && !n.options.silent) {
|
|
2661
|
-
let t = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
2662
|
-
h(t) || n.output.push(t);
|
|
2663
|
-
}
|
|
2664
|
-
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
|
|
2665
|
-
} else return !1;
|
|
2666
|
-
}, C = (r, e, n, a) => {
|
|
2667
|
-
let t = v(r);
|
|
2668
|
-
return g(_(M((o) => {
|
|
2669
|
-
let u = 0;
|
|
2670
|
-
for (; u < n; ) {
|
|
2671
|
-
let s = o.index;
|
|
2672
|
-
if (!t(o) || (u += 1, o.index === s)) break;
|
|
2673
|
-
}
|
|
2674
|
-
return u >= e;
|
|
2675
|
-
})));
|
|
2676
|
-
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
|
|
2677
|
-
let n = r.map(v);
|
|
2678
|
-
return g(_(M((a) => {
|
|
2679
|
-
for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
|
|
2680
|
-
return !0;
|
|
2681
|
-
})));
|
|
2682
|
-
}, l = (r, e) => {
|
|
2683
|
-
let n = r.map(v);
|
|
2684
|
-
return g(_((a) => {
|
|
2685
|
-
for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
|
|
2686
|
-
return !1;
|
|
2687
|
-
}));
|
|
2688
|
-
}, M = (r, e = !1) => {
|
|
2689
|
-
let n = v(r);
|
|
2690
|
-
return (a) => {
|
|
2691
|
-
let t = a.index, o = a.output.length, u = n(a);
|
|
2692
|
-
return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
|
|
2693
|
-
};
|
|
2694
|
-
}, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
|
|
2695
|
-
let r = 0;
|
|
2696
|
-
return (e) => {
|
|
2697
|
-
let n = v(e), a = r += 1;
|
|
2698
|
-
return (t) => {
|
|
2699
|
-
var o;
|
|
2700
|
-
if (t.options.memoization === !1) return n(t);
|
|
2701
|
-
let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
2702
|
-
if (c === !1) return !1;
|
|
2703
|
-
if (W(c)) return t.index = c, !0;
|
|
2704
|
-
if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
|
|
2705
|
-
{
|
|
2706
|
-
let Z = t.output.length;
|
|
2707
|
-
if (n(t)) {
|
|
2708
|
-
let D = t.index, U = t.output.length;
|
|
2709
|
-
if (U > Z) {
|
|
2710
|
-
let ee = t.output.slice(Z, U);
|
|
2711
|
-
s.set(u, { index: D, output: ee });
|
|
2712
|
-
} else s.set(u, D);
|
|
2713
|
-
return !0;
|
|
2714
|
-
} else return s.set(u, !1), !1;
|
|
2715
|
-
}
|
|
2716
|
-
};
|
|
2717
|
-
};
|
|
2718
|
-
})(), E = (r) => {
|
|
2719
|
-
let e;
|
|
2720
|
-
return (n) => (e || (e = v(r())), e(n));
|
|
2721
|
-
}, v = Y((r) => {
|
|
2722
|
-
if (d(r)) return Q(r) ? E(r) : r;
|
|
2723
|
-
if (b(r) || X(r)) return i(r);
|
|
2724
|
-
if (A(r)) return x(r);
|
|
2725
|
-
if (K(r)) return l(Object.values(r));
|
|
2726
|
-
throw new Error("Invalid rule");
|
|
2727
|
-
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
2728
|
-
let e = "";
|
|
2729
|
-
for (; r > 0; ) {
|
|
2730
|
-
let n = (r - 1) % 26;
|
|
2731
|
-
e = P[n] + e, r = Math.floor((r - 1) / 26);
|
|
2732
|
-
}
|
|
2733
|
-
return e;
|
|
2734
|
-
}, O = (r) => {
|
|
2735
|
-
let e = 0;
|
|
2736
|
-
for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
|
|
2737
|
-
return e;
|
|
2738
|
-
}, S = (r, e) => {
|
|
2739
|
-
if (e < r) return S(e, r);
|
|
2740
|
-
let n = [];
|
|
2741
|
-
for (; r <= e; ) n.push(r++);
|
|
2742
|
-
return n;
|
|
2743
|
-
}, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
|
|
2744
|
-
let e = {};
|
|
2745
|
-
return (n) => e[n] ?? (e[n] = r(n));
|
|
2746
|
-
}, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
|
|
2747
|
-
let n = Array.isArray(r) ? r : [r];
|
|
2748
|
-
if (!n.length) return !1;
|
|
2749
|
-
let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
|
|
2750
|
-
return a.some((s) => s.test(o));
|
|
2751
|
-
};
|
|
2752
|
-
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
2753
|
-
var re = $;
|
|
2754
|
-
return J(w);
|
|
2755
|
-
})();
|
|
2756
|
-
return __lib__.default || __lib__;
|
|
2757
|
-
}, _match, zeptomatch = (path4, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path4, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2593
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2758
2594
|
function normalizeWindowsPath(input = "") {
|
|
2759
2595
|
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
2760
2596
|
}
|
|
2761
|
-
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]
|
|
2597
|
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
2598
|
+
var normalize = function(path4) {
|
|
2762
2599
|
if (path4.length === 0)
|
|
2763
2600
|
return ".";
|
|
2764
2601
|
path4 = normalizeWindowsPath(path4);
|
|
@@ -2819,9 +2656,8 @@ function normalizeString(path4, allowAboveRoot) {
|
|
|
2819
2656
|
}
|
|
2820
2657
|
var isAbsolute2 = function(p) {
|
|
2821
2658
|
return _IS_ABSOLUTE_RE.test(p);
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
}, extname = function(p) {
|
|
2659
|
+
};
|
|
2660
|
+
var extname = function(p) {
|
|
2825
2661
|
if (p === "..") return "";
|
|
2826
2662
|
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
2827
2663
|
return match && match[1] || "";
|
|
@@ -2839,14 +2675,8 @@ var isAbsolute2 = function(p) {
|
|
|
2839
2675
|
}, dirname2 = function(p) {
|
|
2840
2676
|
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
2841
2677
|
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
|
|
2842
|
-
}
|
|
2843
|
-
|
|
2844
|
-
Boolean
|
|
2845
|
-
);
|
|
2846
|
-
return normalizeWindowsPath(
|
|
2847
|
-
p.root ? resolve5(...segments) : segments.join("/")
|
|
2848
|
-
);
|
|
2849
|
-
}, basename = function(p, extension) {
|
|
2678
|
+
};
|
|
2679
|
+
var basename = function(p, extension) {
|
|
2850
2680
|
let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
|
|
2851
2681
|
for (let i = segments.length - 1; i >= 0; i--) {
|
|
2852
2682
|
let val = segments[i];
|
|
@@ -2865,31 +2695,8 @@ var isAbsolute2 = function(p) {
|
|
|
2865
2695
|
ext: extension,
|
|
2866
2696
|
name: base.slice(0, base.length - extension.length)
|
|
2867
2697
|
};
|
|
2868
|
-
}, matchesGlob = (path4, pattern) => zeptomatch(pattern, normalize(path4)), _path = {
|
|
2869
|
-
__proto__: null,
|
|
2870
|
-
basename,
|
|
2871
|
-
dirname: dirname2,
|
|
2872
|
-
extname,
|
|
2873
|
-
format,
|
|
2874
|
-
isAbsolute: isAbsolute2,
|
|
2875
|
-
join: join3,
|
|
2876
|
-
matchesGlob,
|
|
2877
|
-
normalize,
|
|
2878
|
-
normalizeString,
|
|
2879
|
-
parse,
|
|
2880
|
-
relative: relative2,
|
|
2881
|
-
resolve: resolve5,
|
|
2882
|
-
sep,
|
|
2883
|
-
toNamespacedPath
|
|
2884
2698
|
};
|
|
2885
2699
|
|
|
2886
|
-
// ../../../node_modules/pathe/dist/index.mjs
|
|
2887
|
-
var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
|
|
2888
|
-
get(_, prop) {
|
|
2889
|
-
return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
|
|
2890
|
-
}
|
|
2891
|
-
}), posix = mix(":"), win32 = mix(";");
|
|
2892
|
-
|
|
2893
2700
|
// src/generators/csf-factories.ts
|
|
2894
2701
|
var CLI_STORY_FILE = /\.(stories|story)\.(js|jsx|ts|tsx|mjs|mts|mjsx|mtsx|svelte)$/, PREVIEW_IMPORT = /from (['"])[^'"]*\.storybook\/preview\1/g;
|
|
2895
2702
|
function supportsCsfFactories(framework) {
|
|
@@ -3422,19 +3229,15 @@ function injectAngularVitestIntoConfig(content, fileName) {
|
|
|
3422
3229
|
return injectAngularVitestIntoEditor(editor) ? editor.toString() : null;
|
|
3423
3230
|
}
|
|
3424
3231
|
|
|
3425
|
-
// ../../core/src/component-testing/constants.ts
|
|
3426
|
-
var ADDON_ID = "storybook/interactions", PANEL_ID = `${ADDON_ID}/panel`;
|
|
3427
|
-
var DOCUMENTATION_LINK = "writing-tests/integrations/vitest-addon", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-there-are-different-test-results-in-multiple-environments`;
|
|
3428
|
-
|
|
3429
3232
|
// ../../addons/a11y/src/constants.ts
|
|
3430
|
-
var
|
|
3431
|
-
var UI_STATE_ID = `${
|
|
3233
|
+
var ADDON_ID = "storybook/a11y", PANEL_ID = `${ADDON_ID}/panel`;
|
|
3234
|
+
var UI_STATE_ID = `${ADDON_ID}/ui`, RESULT = `${ADDON_ID}/result`, REQUEST = `${ADDON_ID}/request`, RUNNING = `${ADDON_ID}/running`, ERROR = `${ADDON_ID}/error`, MANUAL = `${ADDON_ID}/manual`, DOCUMENTATION_LINK = "writing-tests/accessibility-testing", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#why-are-my-tests-failing-in-different-environments`;
|
|
3432
3235
|
|
|
3433
3236
|
// ../../addons/vitest/src/constants.ts
|
|
3434
|
-
var
|
|
3435
|
-
var
|
|
3237
|
+
var ADDON_ID2 = "storybook/test", TEST_PROVIDER_ID = `${ADDON_ID2}/test-provider`, STORYBOOK_ADDON_TEST_CHANNEL = `${ADDON_ID2}/channel`;
|
|
3238
|
+
var DOCUMENTATION_LINK2 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK2}#what-happens-if-vitest-itself-has-an-error`;
|
|
3436
3239
|
var storeOptions = {
|
|
3437
|
-
id:
|
|
3240
|
+
id: ADDON_ID2,
|
|
3438
3241
|
initialState: {
|
|
3439
3242
|
config: {
|
|
3440
3243
|
coverage: !1,
|
|
@@ -3472,8 +3275,8 @@ var storeOptions = {
|
|
|
3472
3275
|
}
|
|
3473
3276
|
};
|
|
3474
3277
|
var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`;
|
|
3475
|
-
var STORY_INDEX_CHANNEL_EVENT_NAME = `${
|
|
3476
|
-
var TRIGGER_TEST_RUN_REQUEST = `${
|
|
3278
|
+
var STORY_INDEX_CHANNEL_EVENT_NAME = `${ADDON_ID2}/story-index`;
|
|
3279
|
+
var TRIGGER_TEST_RUN_REQUEST = `${ADDON_ID2}/trigger-test-run-request`, TRIGGER_TEST_RUN_RESPONSE = `${ADDON_ID2}/trigger-test-run-response`;
|
|
3477
3280
|
|
|
3478
3281
|
// ../../addons/vitest/src/updateVitestFile.ts
|
|
3479
3282
|
import { isBuiltin } from "node:module";
|
|
@@ -3499,7 +3302,7 @@ import {
|
|
|
3499
3302
|
staticKey
|
|
3500
3303
|
} from "storybook/internal/csf-tools";
|
|
3501
3304
|
async function getTemplatePath() {
|
|
3502
|
-
return import("./vitest.config.4.template-
|
|
3305
|
+
return import("./vitest.config.4.template-CSBLKKCJ.js");
|
|
3503
3306
|
}
|
|
3504
3307
|
var loadTemplate = async (name, replacements) => {
|
|
3505
3308
|
let template = (await getTemplatePath()).default;
|
|
@@ -3724,7 +3527,7 @@ async function postInstall(options) {
|
|
|
3724
3527
|
in your main Storybook config file and remove the dependency from your package.json file.
|
|
3725
3528
|
|
|
3726
3529
|
Please check the documentation for more information about its requirements and installation:
|
|
3727
|
-
https://storybook.js.org/docs/next/${
|
|
3530
|
+
https://storybook.js.org/docs/next/${DOCUMENTATION_LINK2}
|
|
3728
3531
|
`
|
|
3729
3532
|
), result = reasons.map((r) => r.trim()).join(`
|
|
3730
3533
|
|
|
@@ -3778,7 +3581,7 @@ async function postInstall(options) {
|
|
|
3778
3581
|
|
|
3779
3582
|
Please add storybookAngularVitest({}) to the plugins array next to storybookTest()
|
|
3780
3583
|
and import it from "@storybook/angular-vite/vitest". See:
|
|
3781
|
-
https://storybook.js.org/docs/next/${
|
|
3584
|
+
https://storybook.js.org/docs/next/${DOCUMENTATION_LINK2}#manual-setup-advanced
|
|
3782
3585
|
`), errors.push(new AddonVitestPostinstallConfigUpdateError({ filePath }));
|
|
3783
3586
|
return;
|
|
3784
3587
|
}
|
|
@@ -3807,7 +3610,7 @@ async function postInstall(options) {
|
|
|
3807
3610
|
|
|
3808
3611
|
Please add storybookAngularVitest({}) to the plugins array next to storybookTest()
|
|
3809
3612
|
and import it from "@storybook/angular-vite/vitest". See:
|
|
3810
|
-
https://storybook.js.org/docs/next/${
|
|
3613
|
+
https://storybook.js.org/docs/next/${DOCUMENTATION_LINK2}#manual-setup-advanced
|
|
3811
3614
|
`), errors.push(new AddonVitestPostinstallConfigUpdateError({ filePath: rootConfig }))));
|
|
3812
3615
|
let formattedContent = await formatFileContent(rootConfig, target.toString());
|
|
3813
3616
|
await writeFile3(
|
|
@@ -3848,14 +3651,14 @@ async function postInstall(options) {
|
|
|
3848
3651
|
• Vitest IDE extension shows all stories as tests in your editor!
|
|
3849
3652
|
|
|
3850
3653
|
Check the documentation for more information about its features and options at:
|
|
3851
|
-
https://storybook.js.org/docs/next/${
|
|
3654
|
+
https://storybook.js.org/docs/next/${DOCUMENTATION_LINK2}
|
|
3852
3655
|
`);
|
|
3853
3656
|
else
|
|
3854
3657
|
throw logger20.warn(
|
|
3855
3658
|
import_ts_dedent8.dedent`
|
|
3856
3659
|
Done, but with errors!
|
|
3857
3660
|
@storybook/addon-vitest was installed successfully, but there were some errors during the setup process. Please refer to the documentation to complete the setup manually and check the errors above:
|
|
3858
|
-
https://storybook.js.org/docs/next/${
|
|
3661
|
+
https://storybook.js.org/docs/next/${DOCUMENTATION_LINK2}#manual-setup-advanced
|
|
3859
3662
|
`
|
|
3860
3663
|
), new AddonVitestPostinstallError({ errors });
|
|
3861
3664
|
}
|
|
@@ -3932,7 +3735,7 @@ var ADDON_INSTALLATION_INSTRUCTIONS = {
|
|
|
3932
3735
|
}
|
|
3933
3736
|
/** Configure test addons */
|
|
3934
3737
|
async configureAddons(configDir, addons) {
|
|
3935
|
-
let { postinstallAddon } = await import("./postinstallAddon-
|
|
3738
|
+
let { postinstallAddon } = await import("./postinstallAddon-QZIAMDB2.js"), task = prompt7.taskLog({
|
|
3936
3739
|
id: "configure-addons",
|
|
3937
3740
|
title: "Configuring addons..."
|
|
3938
3741
|
}), addonResults = /* @__PURE__ */ new Map();
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
|
|
13
1
|
// ../../core/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
14
2
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
15
3
|
function normalizeWindowsPath(input = "") {
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import "./chunk-KA3D3PZF.js";
|
|
2
|
+
import "./chunk-CFINOCOZ.js";
|
|
3
|
+
|
|
4
|
+
// ../cli-storybook/src/postinstallAddon.ts
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
9
|
+
|
|
10
|
+
// ../../core/src/shared/utils/module.ts
|
|
11
|
+
import nodeModule, { createRequire } from "node:module";
|
|
12
|
+
import { win32 } from "node:path/win32";
|
|
13
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
14
|
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
15
|
+
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
16
|
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args);
|
|
17
|
+
var usesRegisterHooks = (nodeVersion) => Number(nodeVersion.split(".")[0]) >= 26, typescriptLoaderRegistration = null, typescriptLoaderRegistrationError = null;
|
|
18
|
+
function registerTypescriptLoader() {
|
|
19
|
+
return typescriptLoaderRegistration ??= (async () => {
|
|
20
|
+
if (usesRegisterHooks(process.versions.node))
|
|
21
|
+
try {
|
|
22
|
+
let { load } = await import("storybook/internal/bin/loader");
|
|
23
|
+
nodeModule.registerHooks({ load });
|
|
24
|
+
return;
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
let typescriptLoaderUrl = importMetaResolve("storybook/internal/bin/loader");
|
|
28
|
+
nodeModule.register(typescriptLoaderUrl, import.meta.url);
|
|
29
|
+
})().catch(async (error) => {
|
|
30
|
+
typescriptLoaderRegistrationError = error;
|
|
31
|
+
let { logger } = await import("storybook/internal/node-logger");
|
|
32
|
+
logger.debug(`Storybook's TypeScript loader hooks could not be registered: ${error}`);
|
|
33
|
+
}), typescriptLoaderRegistration;
|
|
34
|
+
}
|
|
35
|
+
async function importModule(path, { skipCache = !1 } = {}) {
|
|
36
|
+
await registerTypescriptLoader();
|
|
37
|
+
let mod;
|
|
38
|
+
try {
|
|
39
|
+
let resolvedPath = win32.isAbsolute(path) ? pathToFileURL(path).href : path;
|
|
40
|
+
mod = await import(skipCache ? `${resolvedPath}?${Date.now()}` : resolvedPath);
|
|
41
|
+
} catch (importError) {
|
|
42
|
+
try {
|
|
43
|
+
let require3 = createRequire(import.meta.url);
|
|
44
|
+
skipCache && delete require3.cache[require3.resolve(path)], mod = require3(path);
|
|
45
|
+
} catch {
|
|
46
|
+
throw typescriptLoaderRegistrationError && importError instanceof Error && (importError.cause = typescriptLoaderRegistrationError), importError;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return mod.default ?? mod;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ../cli-storybook/src/postinstallAddon.ts
|
|
53
|
+
var DIR_CWD = process.cwd(), require2 = createRequire2(join(DIR_CWD, "package.json")), NO_HOOK_EXIT_CODE = 3, RESOLVE_IN_CHILD = `
|
|
54
|
+
try {
|
|
55
|
+
process.stdout.write(require.resolve(process.argv[1], { paths: [process.cwd()] }));
|
|
56
|
+
} catch (error) {
|
|
57
|
+
process.exit(error.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED' ? ${NO_HOOK_EXIT_CODE} : 1);
|
|
58
|
+
}`, postinstallAddon = async (addonName, options) => {
|
|
59
|
+
let hookPath = `${addonName}/postinstall`, logger = options.logger, modulePath;
|
|
60
|
+
try {
|
|
61
|
+
modulePath = require2.resolve(hookPath, { paths: [DIR_CWD] });
|
|
62
|
+
} catch {
|
|
63
|
+
let result = spawnSync(process.execPath, ["-e", RESOLVE_IN_CHILD, hookPath], {
|
|
64
|
+
cwd: DIR_CWD,
|
|
65
|
+
encoding: "utf8",
|
|
66
|
+
timeout: 3e4
|
|
67
|
+
});
|
|
68
|
+
if (result.status === NO_HOOK_EXIT_CODE)
|
|
69
|
+
return;
|
|
70
|
+
result.status === 0 && result.stdout.trim() && (modulePath = result.stdout.trim());
|
|
71
|
+
}
|
|
72
|
+
if (!modulePath)
|
|
73
|
+
try {
|
|
74
|
+
modulePath = import.meta.resolve(hookPath);
|
|
75
|
+
} catch {
|
|
76
|
+
logger.warn(
|
|
77
|
+
`Could not resolve the postinstall hook of ${addonName}, skipping its configuration. Run \`npx storybook add ${addonName}\` to set it up manually.`
|
|
78
|
+
);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let moduleFilePath = modulePath.startsWith("file:") ? fileURLToPath2(modulePath) : modulePath, moduledLoaded;
|
|
82
|
+
try {
|
|
83
|
+
moduledLoaded = await import(pathToFileURL2(moduleFilePath).href).catch(() => importModule(moduleFilePath)).catch(() => require2(moduleFilePath)).catch(() => import(hookPath)).catch(() => importModule(hookPath)).catch(() => require2(hookPath));
|
|
84
|
+
} catch (e) {
|
|
85
|
+
logger.warn(
|
|
86
|
+
`Could not load the postinstall hook of ${addonName} (${String(
|
|
87
|
+
e
|
|
88
|
+
)}), skipping its configuration. Run \`npx storybook add ${addonName}\` to set it up manually.`
|
|
89
|
+
);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let postinstall = moduledLoaded?.default || moduledLoaded?.postinstall || moduledLoaded;
|
|
93
|
+
if (!postinstall || typeof postinstall != "function") {
|
|
94
|
+
logger.error(`Error finding postinstall function for ${addonName}`);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
await postinstall(options);
|
|
99
|
+
} catch (e) {
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
102
|
+
}, configureDeferredAddons = async (addons, options) => {
|
|
103
|
+
for (let addon of addons)
|
|
104
|
+
try {
|
|
105
|
+
await postinstallAddon(addon, options);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
options.logger.warn(
|
|
108
|
+
`Could not configure ${addon}: ${e}. Run \`npx storybook add ${addon}\` to set it up manually.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
configureDeferredAddons,
|
|
114
|
+
postinstallAddon
|
|
115
|
+
};
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
initiate
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FDXHL2R5.js";
|
|
4
|
+
import "./chunk-KA3D3PZF.js";
|
|
16
5
|
import {
|
|
17
6
|
__commonJS,
|
|
18
7
|
__require,
|
|
19
8
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CFINOCOZ.js";
|
|
21
10
|
|
|
22
11
|
// ../../../node_modules/commander/lib/error.js
|
|
23
12
|
var require_error = __commonJS({
|
|
@@ -2620,10 +2609,10 @@ var import_index = __toESM(require_commander(), 1), {
|
|
|
2620
2609
|
} = import_index.default;
|
|
2621
2610
|
|
|
2622
2611
|
// package.json
|
|
2623
|
-
var version = "11.0.0-beta.
|
|
2612
|
+
var version = "11.0.0-beta.4";
|
|
2624
2613
|
|
|
2625
2614
|
// ../../../node_modules/std-env/dist/index.mjs
|
|
2626
|
-
var E = globalThis.process?.env || /* @__PURE__ */ Object.create(null), I = globalThis.process || { env: E }, O = I !== void 0 && I.env && I.env.NODE_ENV || void 0, n = [["claude", ["CLAUDECODE", "CLAUDE_CODE"]], ["replit", ["REPL_ID"]], ["gemini", ["GEMINI_CLI"]], ["codex", ["CODEX_SANDBOX", "CODEX_THREAD_ID"]], ["opencode", ["OPENCODE"]], ["pi", [_("PATH", /\.pi[\\/]agent/)]], ["auggie", ["AUGMENT_AGENT"]], ["goose", ["GOOSE_PROVIDER"]], ["junie", ["JUNIE_DATA", "JUNIE_SHIM_PATH"]], ["copilot", ["COPILOT_AGENT", "COPILOT_CLI"]], ["devin", [_("EDITOR", /devin/)]], ["cursor", ["CURSOR_AGENT"]], ["kiro", [_("TERM_PROGRAM", /kiro/, { noTTY: !0 })]]];
|
|
2615
|
+
var E = globalThis.process?.env || /* @__PURE__ */ Object.create(null), I = globalThis.process || { env: E }, O = I !== void 0 && I.env && I.env.NODE_ENV || void 0, n = [["claude", ["CLAUDECODE", "CLAUDE_CODE"]], ["replit", ["REPL_ID"]], ["gemini", ["GEMINI_CLI"]], ["codex", ["CODEX_SANDBOX", "CODEX_THREAD_ID"]], ["opencode", ["OPENCODE"]], ["pi", [/* @__PURE__ */ _("PATH", /\.pi[\\/]agent/)]], ["auggie", ["AUGMENT_AGENT"]], ["goose", ["GOOSE_PROVIDER"]], ["junie", ["JUNIE_DATA", "JUNIE_SHIM_PATH"]], ["copilot", ["COPILOT_AGENT", "COPILOT_CLI"]], ["devin", [/* @__PURE__ */ _("EDITOR", /devin/)]], ["cursor", ["CURSOR_AGENT"]], ["kiro", [/* @__PURE__ */ _("TERM_PROGRAM", /kiro/, { noTTY: !0 })]]];
|
|
2627
2616
|
function _(O2, n2, _2) {
|
|
2628
2617
|
return () => {
|
|
2629
2618
|
if (_2?.noTTY && I.stdout?.isTTY) return !1;
|
|
@@ -2640,16 +2629,13 @@ function e() {
|
|
|
2640
2629
|
for (let [I3, O2] of n) for (let n2 of O2) if (typeof n2 == "string" ? E[n2] : n2()) return { name: I3 };
|
|
2641
2630
|
return {};
|
|
2642
2631
|
}
|
|
2643
|
-
var o = e()
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
var D = C(), T = D.name, t = I.platform || "", L = !!E.CI || D.ci !== !1, N = !!I.stdout?.isTTY;
|
|
2652
|
-
var s = !!E.DEBUG, r = O === "test" || !!E.TEST, P = O === "production" || E.MODE === "production", c = O === "dev" || O === "development" || E.MODE === "development", l = !!E.MINIMAL || L || r || !N, U = /^win/i.test(t), a = /^linux/i.test(t), B = /^darwin/i.test(t), u = !E.NO_COLOR && (!!E.FORCE_COLOR || (N || U) && E.TERM !== "dumb" || L), d = (I.versions?.node || "").replace(/^v/, "") || null, G = Number(d?.split(".")[0]) || null, f = !!I?.versions?.node, M = !!I?.versions?.nub, g = "Bun" in globalThis, Y = "Deno" in globalThis, p = "fastly" in globalThis, b = "Netlify" in globalThis, m = "EdgeRuntime" in globalThis, v = globalThis.navigator?.userAgent === "Cloudflare-Workers", V = [[b, "netlify"], [m, "edge-light"], [v, "workerd"], [p, "fastly"], [Y, "deno"], [g, "bun"], [f, "node"]], H = (function() {
|
|
2632
|
+
var o = /* @__PURE__ */ e();
|
|
2633
|
+
var i = !!o.name;
|
|
2634
|
+
var t = I.platform || "";
|
|
2635
|
+
var N = !!I.stdout?.isTTY;
|
|
2636
|
+
var s = !!E.DEBUG, r = O === "test" || !!E.TEST, P = O === "production" || E.MODE === "production", c = O === "dev" || O === "development" || E.MODE === "development";
|
|
2637
|
+
var U = /^win/i.test(t), a = /^linux/i.test(t), B = /^darwin/i.test(t);
|
|
2638
|
+
var d = (I.versions?.node || "").replace(/^v/, "") || null, G = Number(d?.split(".")[0]) || null, f = !!I?.versions?.node, M = !!I?.versions?.nub, g = "Bun" in globalThis, Y = "Deno" in globalThis, p = "fastly" in globalThis, b = "Netlify" in globalThis, m = "EdgeRuntime" in globalThis, v = globalThis.navigator?.userAgent === "Cloudflare-Workers", V = [[b, "netlify"], [m, "edge-light"], [v, "workerd"], [p, "fastly"], [Y, "deno"], [g, "bun"], [f, "node"]], H = (function() {
|
|
2653
2639
|
let E2 = V.find((E3) => E3[0]);
|
|
2654
2640
|
if (E2) return { name: E2[1] };
|
|
2655
2641
|
})(), F = H?.name || "";
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-LEWXYR2F.js";
|
|
1
|
+
import "./chunk-CFINOCOZ.js";
|
|
13
2
|
|
|
14
3
|
// raw:../templates/vitest.config.4.template.ts
|
|
15
4
|
var vitest_config_4_template_default = `import path from 'node:path';
|
package/dist/bin/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
3
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
4
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
5
|
-
|
|
6
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
7
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
8
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
9
|
-
|
|
10
|
-
// ------------------------------------------------------------
|
|
11
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
12
|
-
// ------------------------------------------------------------
|
|
13
2
|
|
|
14
3
|
// src/bin/index.ts
|
|
15
4
|
var { isNodeVersionSupported } = await import("storybook/internal/common");
|
|
@@ -20,4 +9,4 @@ if (!isNodeVersionSupported(process.versions.node)) {
|
|
|
20
9
|
You are currently running Node.js ${process.version}.`
|
|
21
10
|
), logger.outro(""), process.exit(1);
|
|
22
11
|
}
|
|
23
|
-
await import("../_node-chunks/run-
|
|
12
|
+
await import("../_node-chunks/run-MZ72W7YV.js");
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
1
|
import {
|
|
13
2
|
doInitiate
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import "./_node-chunks/chunk-
|
|
16
|
-
import "./_node-chunks/chunk-
|
|
3
|
+
} from "./_node-chunks/chunk-FDXHL2R5.js";
|
|
4
|
+
import "./_node-chunks/chunk-KA3D3PZF.js";
|
|
5
|
+
import "./_node-chunks/chunk-CFINOCOZ.js";
|
|
17
6
|
export {
|
|
18
7
|
doInitiate as initiate
|
|
19
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-storybook",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.4",
|
|
4
4
|
"description": "Storybook installer: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"!src/**/*"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"storybook": "11.0.0-beta.
|
|
41
|
+
"storybook": "11.0.0-beta.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/prompts": "^2.0.9",
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_4ivpr2og2ph from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_4ivpr2og2ph from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_4ivpr2og2ph from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_4ivpr2og2ph.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_4ivpr2og2ph.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_4ivpr2og2ph.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-YAZBZE2W.js";
|
|
13
|
-
import "./chunk-LEWXYR2F.js";
|
|
14
|
-
|
|
15
|
-
// ../cli-storybook/src/postinstallAddon.ts
|
|
16
|
-
import { spawnSync } from "node:child_process";
|
|
17
|
-
import { createRequire as createRequire2 } from "node:module";
|
|
18
|
-
import { join as join2 } from "node:path";
|
|
19
|
-
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
20
|
-
|
|
21
|
-
// ../../core/src/shared/utils/module.ts
|
|
22
|
-
import nodeModule, { createRequire } from "node:module";
|
|
23
|
-
import { win32 } from "node:path/win32";
|
|
24
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
25
|
-
|
|
26
|
-
// ../../../node_modules/exsolve/dist/index.mjs
|
|
27
|
-
import assert from "node:assert";
|
|
28
|
-
import v8 from "node:v8";
|
|
29
|
-
import { format, inspect } from "node:util";
|
|
30
|
-
var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
|
31
|
-
"string",
|
|
32
|
-
"function",
|
|
33
|
-
"number",
|
|
34
|
-
"object",
|
|
35
|
-
"Function",
|
|
36
|
-
"Object",
|
|
37
|
-
"boolean",
|
|
38
|
-
"bigint",
|
|
39
|
-
"symbol"
|
|
40
|
-
]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
|
|
41
|
-
function formatList(array, type = "and") {
|
|
42
|
-
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
43
|
-
}
|
|
44
|
-
function createError(sym, value, constructor) {
|
|
45
|
-
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
|
46
|
-
}
|
|
47
|
-
function makeNodeErrorWithCode(Base, key) {
|
|
48
|
-
return function(...parameters) {
|
|
49
|
-
let limit = Error.stackTraceLimit;
|
|
50
|
-
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
51
|
-
let error = new Base();
|
|
52
|
-
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
|
|
53
|
-
let message = getMessage(key, parameters, error);
|
|
54
|
-
return Object.defineProperties(error, {
|
|
55
|
-
message: {
|
|
56
|
-
value: message,
|
|
57
|
-
enumerable: !1,
|
|
58
|
-
writable: !0,
|
|
59
|
-
configurable: !0
|
|
60
|
-
},
|
|
61
|
-
toString: {
|
|
62
|
-
value() {
|
|
63
|
-
return `${this.name} [${key}]: ${this.message}`;
|
|
64
|
-
},
|
|
65
|
-
enumerable: !1,
|
|
66
|
-
writable: !0,
|
|
67
|
-
configurable: !0
|
|
68
|
-
}
|
|
69
|
-
}), captureLargerStackTrace(error), error.code = key, error;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function isErrorStackTraceLimitWritable() {
|
|
73
|
-
try {
|
|
74
|
-
if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
|
|
75
|
-
} catch {
|
|
76
|
-
}
|
|
77
|
-
let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
78
|
-
return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
79
|
-
}
|
|
80
|
-
function hideStackFrames(wrappedFunction) {
|
|
81
|
-
let hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
82
|
-
return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
|
|
83
|
-
}
|
|
84
|
-
var captureLargerStackTrace = hideStackFrames(function(error) {
|
|
85
|
-
let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
86
|
-
return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
|
|
87
|
-
});
|
|
88
|
-
function getMessage(key, parameters, self) {
|
|
89
|
-
let message = messages.get(key);
|
|
90
|
-
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
|
91
|
-
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
|
92
|
-
let regex = /%[dfijoOs]/g, expectedLength = 0;
|
|
93
|
-
for (; regex.exec(message) !== null; ) expectedLength++;
|
|
94
|
-
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
|
95
|
-
}
|
|
96
|
-
function determineSpecificType(value) {
|
|
97
|
-
if (value == null) return String(value);
|
|
98
|
-
if (typeof value == "function" && value.name) return `function ${value.name}`;
|
|
99
|
-
if (typeof value == "object")
|
|
100
|
-
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
|
101
|
-
let inspected = inspect(value, { colors: !1 });
|
|
102
|
-
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
|
|
103
|
-
}
|
|
104
|
-
var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
105
|
-
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
|
106
|
-
let message = "The ";
|
|
107
|
-
if (name.endsWith(" argument")) message += `${name} `;
|
|
108
|
-
else {
|
|
109
|
-
let type = name.includes(".") ? "property" : "argument";
|
|
110
|
-
message += `"${name}" ${type} `;
|
|
111
|
-
}
|
|
112
|
-
message += "must be ";
|
|
113
|
-
let types = [], instances = [], other = [];
|
|
114
|
-
for (let value of expected)
|
|
115
|
-
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
|
116
|
-
if (instances.length > 0) {
|
|
117
|
-
let pos = types.indexOf("object");
|
|
118
|
-
pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
|
|
119
|
-
}
|
|
120
|
-
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
|
121
|
-
}, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
122
|
-
"ERR_INVALID_MODULE_SPECIFIER",
|
|
123
|
-
/**
|
|
124
|
-
* @param {string} request
|
|
125
|
-
* @param {string} reason
|
|
126
|
-
* @param {string} [base]
|
|
127
|
-
*/
|
|
128
|
-
(request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
|
|
129
|
-
TypeError
|
|
130
|
-
), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
|
131
|
-
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
132
|
-
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
133
|
-
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
134
|
-
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
135
|
-
/**
|
|
136
|
-
* @param {string} packagePath
|
|
137
|
-
* @param {string} subpath
|
|
138
|
-
* @param {string} [base]
|
|
139
|
-
*/
|
|
140
|
-
(packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
|
|
141
|
-
Error
|
|
142
|
-
), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
143
|
-
let inspected = inspect(value);
|
|
144
|
-
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
145
|
-
}, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
|
|
146
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
147
|
-
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
148
|
-
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
149
|
-
|
|
150
|
-
// ../../core/src/shared/utils/module.ts
|
|
151
|
-
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
152
|
-
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
153
|
-
), pathToFileURL(args[0]).href) : import.meta.resolve(...args);
|
|
154
|
-
var usesRegisterHooks = (nodeVersion) => Number(nodeVersion.split(".")[0]) >= 26, typescriptLoaderRegistration = null, typescriptLoaderRegistrationError = null;
|
|
155
|
-
function registerTypescriptLoader() {
|
|
156
|
-
return typescriptLoaderRegistration ??= (async () => {
|
|
157
|
-
if (usesRegisterHooks(process.versions.node))
|
|
158
|
-
try {
|
|
159
|
-
let { load } = await import("storybook/internal/bin/loader");
|
|
160
|
-
nodeModule.registerHooks({ load });
|
|
161
|
-
return;
|
|
162
|
-
} catch {
|
|
163
|
-
}
|
|
164
|
-
let typescriptLoaderUrl = importMetaResolve("storybook/internal/bin/loader");
|
|
165
|
-
nodeModule.register(typescriptLoaderUrl, import.meta.url);
|
|
166
|
-
})().catch(async (error) => {
|
|
167
|
-
typescriptLoaderRegistrationError = error;
|
|
168
|
-
let { logger } = await import("storybook/internal/node-logger");
|
|
169
|
-
logger.debug(`Storybook's TypeScript loader hooks could not be registered: ${error}`);
|
|
170
|
-
}), typescriptLoaderRegistration;
|
|
171
|
-
}
|
|
172
|
-
async function importModule(path, { skipCache = !1 } = {}) {
|
|
173
|
-
await registerTypescriptLoader();
|
|
174
|
-
let mod;
|
|
175
|
-
try {
|
|
176
|
-
let resolvedPath = win32.isAbsolute(path) ? pathToFileURL(path).href : path;
|
|
177
|
-
mod = await import(skipCache ? `${resolvedPath}?${Date.now()}` : resolvedPath);
|
|
178
|
-
} catch (importError) {
|
|
179
|
-
try {
|
|
180
|
-
let require3 = createRequire(import.meta.url);
|
|
181
|
-
skipCache && delete require3.cache[require3.resolve(path)], mod = require3(path);
|
|
182
|
-
} catch {
|
|
183
|
-
throw typescriptLoaderRegistrationError && importError instanceof Error && (importError.cause = typescriptLoaderRegistrationError), importError;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return mod.default ?? mod;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ../cli-storybook/src/postinstallAddon.ts
|
|
190
|
-
var DIR_CWD = process.cwd(), require2 = createRequire2(join2(DIR_CWD, "package.json")), NO_HOOK_EXIT_CODE = 3, RESOLVE_IN_CHILD = `
|
|
191
|
-
try {
|
|
192
|
-
process.stdout.write(require.resolve(process.argv[1], { paths: [process.cwd()] }));
|
|
193
|
-
} catch (error) {
|
|
194
|
-
process.exit(error.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED' ? ${NO_HOOK_EXIT_CODE} : 1);
|
|
195
|
-
}`, postinstallAddon = async (addonName, options) => {
|
|
196
|
-
let hookPath = `${addonName}/postinstall`, logger = options.logger, modulePath;
|
|
197
|
-
try {
|
|
198
|
-
modulePath = require2.resolve(hookPath, { paths: [DIR_CWD] });
|
|
199
|
-
} catch {
|
|
200
|
-
let result = spawnSync(process.execPath, ["-e", RESOLVE_IN_CHILD, hookPath], {
|
|
201
|
-
cwd: DIR_CWD,
|
|
202
|
-
encoding: "utf8",
|
|
203
|
-
timeout: 3e4
|
|
204
|
-
});
|
|
205
|
-
if (result.status === NO_HOOK_EXIT_CODE)
|
|
206
|
-
return;
|
|
207
|
-
result.status === 0 && result.stdout.trim() && (modulePath = result.stdout.trim());
|
|
208
|
-
}
|
|
209
|
-
if (!modulePath)
|
|
210
|
-
try {
|
|
211
|
-
modulePath = import.meta.resolve(hookPath);
|
|
212
|
-
} catch {
|
|
213
|
-
logger.warn(
|
|
214
|
-
`Could not resolve the postinstall hook of ${addonName}, skipping its configuration. Run \`npx storybook add ${addonName}\` to set it up manually.`
|
|
215
|
-
);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
let moduleFilePath = modulePath.startsWith("file:") ? fileURLToPath2(modulePath) : modulePath, moduledLoaded;
|
|
219
|
-
try {
|
|
220
|
-
moduledLoaded = await import(pathToFileURL2(moduleFilePath).href).catch(() => importModule(moduleFilePath)).catch(() => require2(moduleFilePath)).catch(() => import(hookPath)).catch(() => importModule(hookPath)).catch(() => require2(hookPath));
|
|
221
|
-
} catch (e) {
|
|
222
|
-
logger.warn(
|
|
223
|
-
`Could not load the postinstall hook of ${addonName} (${String(
|
|
224
|
-
e
|
|
225
|
-
)}), skipping its configuration. Run \`npx storybook add ${addonName}\` to set it up manually.`
|
|
226
|
-
);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
let postinstall = moduledLoaded?.default || moduledLoaded?.postinstall || moduledLoaded;
|
|
230
|
-
if (!postinstall || typeof postinstall != "function") {
|
|
231
|
-
logger.error(`Error finding postinstall function for ${addonName}`);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
try {
|
|
235
|
-
await postinstall(options);
|
|
236
|
-
} catch (e) {
|
|
237
|
-
throw e;
|
|
238
|
-
}
|
|
239
|
-
}, configureDeferredAddons = async (addons, options) => {
|
|
240
|
-
for (let addon of addons)
|
|
241
|
-
try {
|
|
242
|
-
await postinstallAddon(addon, options);
|
|
243
|
-
} catch (e) {
|
|
244
|
-
options.logger.warn(
|
|
245
|
-
`Could not configure ${addon}: ${e}. Run \`npx storybook add ${addon}\` to set it up manually.`
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
export {
|
|
250
|
-
configureDeferredAddons,
|
|
251
|
-
postinstallAddon
|
|
252
|
-
};
|