@storybook/angular-vite 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.
@@ -1,17 +1,6 @@
1
- import CJS_COMPAT_NODE_URL_4pl39hy6w4x from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_4pl39hy6w4x from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_4pl39hy6w4x from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_4pl39hy6w4x.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_4pl39hy6w4x.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_4pl39hy6w4x.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
- resolveStoryComponent
14
- } from "../_node-chunks/chunk-KF3ADECJ.js";
2
+ resolveStoryComponents
3
+ } from "../_node-chunks/chunk-MIQVDAHU.js";
15
4
 
16
5
  // src/docgen/docgen-worker.ts
17
6
  import {
@@ -21,20 +10,11 @@ import {
21
10
  import { logger as logger6 } from "storybook/internal/node-logger";
22
11
 
23
12
  // ../../lib/angular-cm/dist/index.js
24
- import CJS_COMPAT_NODE_URL_wzeatufvkt from "node:url";
25
- import CJS_COMPAT_NODE_PATH_wzeatufvkt from "node:path";
26
- import CJS_COMPAT_NODE_MODULE_wzeatufvkt from "node:module";
27
13
  import { isInNodeModules } from "storybook/internal/common";
28
14
  import {
29
15
  ComponentMetaManager,
30
16
  parseTsconfigCommandLine
31
17
  } from "storybook/internal/component-meta";
32
- import CJS_COMPAT_NODE_URL_r3c3rhnvdz2 from "node:url";
33
- import CJS_COMPAT_NODE_PATH_r3c3rhnvdz2 from "node:path";
34
- import CJS_COMPAT_NODE_MODULE_r3c3rhnvdz2 from "node:module";
35
- import CJS_COMPAT_NODE_URL_r3c3rhnvdz from "node:url";
36
- import CJS_COMPAT_NODE_PATH_r3c3rhnvdz from "node:path";
37
- import CJS_COMPAT_NODE_MODULE_r3c3rhnvdz from "node:module";
38
18
  import "storybook/internal/common";
39
19
  import "storybook/internal/server-errors";
40
20
  import { existsSync, readFileSync, statSync } from "node:fs";
@@ -57,7 +37,7 @@ import {
57
37
  ProjectFileTracker
58
38
  } from "storybook/internal/component-meta";
59
39
  import * as path from "node:path";
60
- var __filename = CJS_COMPAT_NODE_URL_wzeatufvkt.fileURLToPath(import.meta.url), __dirname = CJS_COMPAT_NODE_PATH_wzeatufvkt.dirname(__filename), require2 = CJS_COMPAT_NODE_MODULE_wzeatufvkt.createRequire(import.meta.url), resolvedSymbol = (ctx, node) => {
40
+ var resolvedSymbol = (ctx, node) => {
61
41
  let symbol = ctx.checker.getSymbolAtLocation(node);
62
42
  return symbol && symbol.flags & ctx.ts.SymbolFlags.Alias ? ctx.checker.getAliasedSymbol(symbol) : symbol;
63
43
  }, resolvedNameSymbol = (ctx, name) => {
@@ -405,291 +385,16 @@ ${detailLines(lines).join(`
405
385
  argTypes[argType.name] = argType;
406
386
  });
407
387
  }), argTypes;
408
- }, __filename = CJS_COMPAT_NODE_URL_r3c3rhnvdz.fileURLToPath(import.meta.url), __dirname = CJS_COMPAT_NODE_PATH_r3c3rhnvdz.dirname(__filename), require22 = CJS_COMPAT_NODE_MODULE_r3c3rhnvdz.createRequire(import.meta.url), _lazyMatch = () => {
409
- var __lib__ = (() => {
410
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
411
- for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
412
- }, H = (r, e, n, a) => {
413
- 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 });
414
- return r;
415
- }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
416
- q(w, { default: () => re });
417
- 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) => {
418
- let e = /* @__PURE__ */ new Map();
419
- return (n) => {
420
- let a = e.get(n);
421
- if (a) return a;
422
- let t = r(n);
423
- return e.set(n, t), t;
424
- };
425
- }, rr = (r, e, n = {}) => {
426
- let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
427
- if (v(e)(a) && a.index === r.length) return a.output;
428
- throw new Error(`Failed to parse at index ${a.indexMax}`);
429
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
430
- let n = {};
431
- for (let a of r) {
432
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
433
- let t = a.charCodeAt(0);
434
- n[t] = !0;
435
- }
436
- return (a) => {
437
- let t = a.index, o = a.input;
438
- for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
439
- let u = a.index;
440
- if (u > t) {
441
- if (!h(e) && !a.options.silent) {
442
- let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
443
- h(c) || a.output.push(c);
444
- }
445
- a.indexMax = Math.max(a.indexMax, a.index);
446
- }
447
- return !0;
448
- };
449
- }, nr = (r, e) => {
450
- let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
451
- return g((o) => {
452
- t.lastIndex = o.index;
453
- let u = t.exec(o.input);
454
- if (u) {
455
- if (!h(e) && !o.options.silent) {
456
- let s = d(e) ? e(...u, o.input, String(o.index)) : e;
457
- h(s) || o.output.push(s);
458
- }
459
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
460
- } else return !1;
461
- });
462
- }, ar = (r, e) => (n) => {
463
- if (n.input.startsWith(r, n.index)) {
464
- if (!h(e) && !n.options.silent) {
465
- let t = d(e) ? e(r, n.input, String(n.index)) : e;
466
- h(t) || n.output.push(t);
467
- }
468
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
469
- } else return !1;
470
- }, C = (r, e, n, a) => {
471
- let t = v(r);
472
- return g(_(M((o) => {
473
- let u = 0;
474
- for (; u < n; ) {
475
- let s = o.index;
476
- if (!t(o) || (u += 1, o.index === s)) break;
477
- }
478
- return u >= e;
479
- })));
480
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
481
- let n = r.map(v);
482
- return g(_(M((a) => {
483
- for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
484
- return !0;
485
- })));
486
- }, l = (r, e) => {
487
- let n = r.map(v);
488
- return g(_((a) => {
489
- for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
490
- return !1;
491
- }));
492
- }, M = (r, e = !1) => {
493
- let n = v(r);
494
- return (a) => {
495
- let t = a.index, o = a.output.length, u = n(a);
496
- return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
497
- };
498
- }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
499
- let r = 0;
500
- return (e) => {
501
- let n = v(e), a = r += 1;
502
- return (t) => {
503
- var o;
504
- if (t.options.memoization === !1) return n(t);
505
- let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
506
- if (c === !1) return !1;
507
- if (W(c)) return t.index = c, !0;
508
- if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
509
- {
510
- let Z = t.output.length;
511
- if (n(t)) {
512
- let D = t.index, U = t.output.length;
513
- if (U > Z) {
514
- let ee = t.output.slice(Z, U);
515
- s.set(u, { index: D, output: ee });
516
- } else s.set(u, D);
517
- return !0;
518
- } else return s.set(u, !1), !1;
519
- }
520
- };
521
- };
522
- })(), E = (r) => {
523
- let e;
524
- return (n) => (e || (e = v(r())), e(n));
525
- }, v = Y((r) => {
526
- if (d(r)) return Q(r) ? E(r) : r;
527
- if (b(r) || X(r)) return i(r);
528
- if (A(r)) return x(r);
529
- if (K(r)) return l(Object.values(r));
530
- throw new Error("Invalid rule");
531
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
532
- let e = "";
533
- for (; r > 0; ) {
534
- let n = (r - 1) % 26;
535
- e = P[n] + e, r = Math.floor((r - 1) / 26);
536
- }
537
- return e;
538
- }, O = (r) => {
539
- let e = 0;
540
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
541
- return e;
542
- }, S = (r, e) => {
543
- if (e < r) return S(e, r);
544
- let n = [];
545
- for (; r <= e; ) n.push(r++);
546
- return n;
547
- }, 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) => {
548
- let e = {};
549
- return (n) => e[n] ?? (e[n] = r(n));
550
- }, 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) => {
551
- let n = Array.isArray(r) ? r : [r];
552
- if (!n.length) return !1;
553
- let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
554
- return a.some((s) => s.test(o));
555
- };
556
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
557
- var re = $;
558
- return J(w);
559
- })();
560
- return __lib__.default || __lib__;
561
- }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
388
+ }, _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
562
389
  function normalizeWindowsPath(input = "") {
563
390
  return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
564
391
  }
565
- 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]:[/\\]/, sep = "/", normalize = function(path2) {
566
- if (path2.length === 0)
567
- return ".";
568
- path2 = normalizeWindowsPath(path2);
569
- let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
570
- return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
571
- }, join = function(...segments) {
572
- let path2 = "";
573
- for (let seg of segments)
574
- if (seg)
575
- if (path2.length > 0) {
576
- let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
577
- pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
578
- } else
579
- path2 += seg;
580
- return normalize(path2);
581
- };
582
- function cwd() {
583
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
584
- }
585
- var resolve = function(...arguments_) {
586
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
587
- let resolvedPath = "", resolvedAbsolute = !1;
588
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
589
- let path2 = index >= 0 ? arguments_[index] : cwd();
590
- !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path2));
591
- }
592
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
593
- };
594
- function normalizeString(path2, allowAboveRoot) {
595
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
596
- for (let index = 0; index <= path2.length; ++index) {
597
- if (index < path2.length)
598
- char = path2[index];
599
- else {
600
- if (char === "/")
601
- break;
602
- char = "/";
603
- }
604
- if (char === "/") {
605
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
606
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
607
- if (res.length > 2) {
608
- let lastSlashIndex = res.lastIndexOf("/");
609
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
610
- continue;
611
- } else if (res.length > 0) {
612
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
613
- continue;
614
- }
615
- }
616
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
617
- } else
618
- res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
619
- lastSlash = index, dots = 0;
620
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
621
- }
622
- return res;
623
- }
624
- var isAbsolute = function(p) {
392
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, isAbsolute = function(p) {
625
393
  return _IS_ABSOLUTE_RE.test(p);
626
- }, toNamespacedPath = function(p) {
627
- return normalizeWindowsPath(p);
628
- }, extname = function(p) {
629
- if (p === "..") return "";
630
- let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
631
- return match && match[1] || "";
632
- }, relative = function(from, to) {
633
- let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
634
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
635
- return _to.join("/");
636
- let _fromCopy = [..._from];
637
- for (let segment of _fromCopy) {
638
- if (_to[0] !== segment)
639
- break;
640
- _from.shift(), _to.shift();
641
- }
642
- return [..._from.map(() => ".."), ..._to].join("/");
643
394
  }, dirname2 = function(p) {
644
395
  let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
645
396
  return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
646
- }, format = function(p) {
647
- let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
648
- Boolean
649
- );
650
- return normalizeWindowsPath(
651
- p.root ? resolve(...segments) : segments.join("/")
652
- );
653
- }, basename = function(p, extension) {
654
- let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
655
- for (let i = segments.length - 1; i >= 0; i--) {
656
- let val = segments[i];
657
- if (val) {
658
- lastSegment = val;
659
- break;
660
- }
661
- }
662
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
663
- }, parse = function(p) {
664
- let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename(p), extension = extname(base);
665
- return {
666
- root,
667
- dir: dirname2(p),
668
- base,
669
- ext: extension,
670
- name: base.slice(0, base.length - extension.length)
671
- };
672
- }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
673
- __proto__: null,
674
- basename,
675
- dirname: dirname2,
676
- extname,
677
- format,
678
- isAbsolute,
679
- join,
680
- matchesGlob,
681
- normalize,
682
- normalizeString,
683
- parse,
684
- relative,
685
- resolve,
686
- sep,
687
- toNamespacedPath
688
- }, delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
689
- get(_, prop) {
690
- return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
691
- }
692
- }), posix = mix(":"), win32 = mix(";"), __filename2 = CJS_COMPAT_NODE_URL_r3c3rhnvdz2.fileURLToPath(import.meta.url), __dirname2 = CJS_COMPAT_NODE_PATH_r3c3rhnvdz2.dirname(__filename2), require3 = CJS_COMPAT_NODE_MODULE_r3c3rhnvdz2.createRequire(import.meta.url), DOCGEN_NODE_GUARDS = [
397
+ }, DOCGEN_NODE_GUARDS = [
693
398
  "isArrayLiteralExpression",
694
399
  "isArrayTypeNode",
695
400
  "isArrowFunction",
@@ -2790,15 +2495,7 @@ var AngularComponentMetaManager = class extends ComponentMetaManager {
2790
2495
  }
2791
2496
  };
2792
2497
 
2793
- // ../../lib/component-meta-typescript/dist/index.js
2794
- import CJS_COMPAT_NODE_URL_r3c3rhnvdz4 from "node:url";
2795
- import CJS_COMPAT_NODE_PATH_r3c3rhnvdz4 from "node:path";
2796
- import CJS_COMPAT_NODE_MODULE_r3c3rhnvdz4 from "node:module";
2797
-
2798
- // ../../lib/component-meta-typescript/dist/_node-chunks/chunk-IDD6AHYE.js
2799
- import CJS_COMPAT_NODE_URL_r3c3rhnvdz3 from "node:url";
2800
- import CJS_COMPAT_NODE_PATH_r3c3rhnvdz3 from "node:path";
2801
- import CJS_COMPAT_NODE_MODULE_r3c3rhnvdz3 from "node:module";
2498
+ // ../../lib/component-meta-typescript/dist/_node-chunks/chunk-LDXLIZQK.js
2802
2499
  import { pathToFileURL } from "node:url";
2803
2500
  import {
2804
2501
  getTypeScriptDocgenApi as getTypeScriptDocgenApi2,
@@ -2810,170 +2507,17 @@ import {
2810
2507
  TypeScriptMissingForDocgenError as TypeScriptMissingForDocgenError2,
2811
2508
  TypeScriptWithoutCompilerApiError as TypeScriptWithoutCompilerApiError2
2812
2509
  } from "storybook/internal/server-errors";
2813
- var __filename3 = CJS_COMPAT_NODE_URL_r3c3rhnvdz3.fileURLToPath(import.meta.url), __dirname3 = CJS_COMPAT_NODE_PATH_r3c3rhnvdz3.dirname(__filename3), require4 = CJS_COMPAT_NODE_MODULE_r3c3rhnvdz3.createRequire(import.meta.url), _lazyMatch2 = () => {
2814
- var __lib__ = (() => {
2815
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
2816
- for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
2817
- }, H = (r, e, n, a) => {
2818
- 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 });
2819
- return r;
2820
- }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
2821
- q(w, { default: () => re });
2822
- 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) => {
2823
- let e = /* @__PURE__ */ new Map();
2824
- return (n) => {
2825
- let a = e.get(n);
2826
- if (a) return a;
2827
- let t = r(n);
2828
- return e.set(n, t), t;
2829
- };
2830
- }, rr = (r, e, n = {}) => {
2831
- let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
2832
- if (v(e)(a) && a.index === r.length) return a.output;
2833
- throw new Error(`Failed to parse at index ${a.indexMax}`);
2834
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
2835
- let n = {};
2836
- for (let a of r) {
2837
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
2838
- let t = a.charCodeAt(0);
2839
- n[t] = !0;
2840
- }
2841
- return (a) => {
2842
- let t = a.index, o = a.input;
2843
- for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
2844
- let u = a.index;
2845
- if (u > t) {
2846
- if (!h(e) && !a.options.silent) {
2847
- let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
2848
- h(c) || a.output.push(c);
2849
- }
2850
- a.indexMax = Math.max(a.indexMax, a.index);
2851
- }
2852
- return !0;
2853
- };
2854
- }, nr = (r, e) => {
2855
- let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
2856
- return g((o) => {
2857
- t.lastIndex = o.index;
2858
- let u = t.exec(o.input);
2859
- if (u) {
2860
- if (!h(e) && !o.options.silent) {
2861
- let s = d(e) ? e(...u, o.input, String(o.index)) : e;
2862
- h(s) || o.output.push(s);
2863
- }
2864
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
2865
- } else return !1;
2866
- });
2867
- }, ar = (r, e) => (n) => {
2868
- if (n.input.startsWith(r, n.index)) {
2869
- if (!h(e) && !n.options.silent) {
2870
- let t = d(e) ? e(r, n.input, String(n.index)) : e;
2871
- h(t) || n.output.push(t);
2872
- }
2873
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
2874
- } else return !1;
2875
- }, C = (r, e, n, a) => {
2876
- let t = v(r);
2877
- return g(_(M((o) => {
2878
- let u = 0;
2879
- for (; u < n; ) {
2880
- let s = o.index;
2881
- if (!t(o) || (u += 1, o.index === s)) break;
2882
- }
2883
- return u >= e;
2884
- })));
2885
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
2886
- let n = r.map(v);
2887
- return g(_(M((a) => {
2888
- for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
2889
- return !0;
2890
- })));
2891
- }, l = (r, e) => {
2892
- let n = r.map(v);
2893
- return g(_((a) => {
2894
- for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
2895
- return !1;
2896
- }));
2897
- }, M = (r, e = !1) => {
2898
- let n = v(r);
2899
- return (a) => {
2900
- let t = a.index, o = a.output.length, u = n(a);
2901
- return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
2902
- };
2903
- }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
2904
- let r = 0;
2905
- return (e) => {
2906
- let n = v(e), a = r += 1;
2907
- return (t) => {
2908
- var o;
2909
- if (t.options.memoization === !1) return n(t);
2910
- let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
2911
- if (c === !1) return !1;
2912
- if (W(c)) return t.index = c, !0;
2913
- if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
2914
- {
2915
- let Z = t.output.length;
2916
- if (n(t)) {
2917
- let D = t.index, U = t.output.length;
2918
- if (U > Z) {
2919
- let ee = t.output.slice(Z, U);
2920
- s.set(u, { index: D, output: ee });
2921
- } else s.set(u, D);
2922
- return !0;
2923
- } else return s.set(u, !1), !1;
2924
- }
2925
- };
2926
- };
2927
- })(), E = (r) => {
2928
- let e;
2929
- return (n) => (e || (e = v(r())), e(n));
2930
- }, v = Y((r) => {
2931
- if (d(r)) return Q(r) ? E(r) : r;
2932
- if (b(r) || X(r)) return i(r);
2933
- if (A(r)) return x(r);
2934
- if (K(r)) return l(Object.values(r));
2935
- throw new Error("Invalid rule");
2936
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
2937
- let e = "";
2938
- for (; r > 0; ) {
2939
- let n = (r - 1) % 26;
2940
- e = P[n] + e, r = Math.floor((r - 1) / 26);
2941
- }
2942
- return e;
2943
- }, O = (r) => {
2944
- let e = 0;
2945
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
2946
- return e;
2947
- }, S = (r, e) => {
2948
- if (e < r) return S(e, r);
2949
- let n = [];
2950
- for (; r <= e; ) n.push(r++);
2951
- return n;
2952
- }, 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) => {
2953
- let e = {};
2954
- return (n) => e[n] ?? (e[n] = r(n));
2955
- }, 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) => {
2956
- let n = Array.isArray(r) ? r : [r];
2957
- if (!n.length) return !1;
2958
- let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
2959
- return a.some((s) => s.test(o));
2960
- };
2961
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
2962
- var re = $;
2963
- return J(w);
2964
- })();
2965
- return __lib__.default || __lib__;
2966
- }, _match2, zeptomatch2 = (path2, pattern) => (_match2 || (_match2 = _lazyMatch2(), _lazyMatch2 = null), _match2(path2, pattern)), _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
2510
+ var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
2967
2511
  function normalizeWindowsPath2(input = "") {
2968
2512
  return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r) => r.toUpperCase());
2969
2513
  }
2970
- var _UNC_REGEX2 = /^[/\\]{2}/, _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE2 = /^[A-Za-z]:$/, _ROOT_FOLDER_RE2 = /^\/([A-Za-z]:)?$/, _EXTNAME_RE2 = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE2 = /^[/\\]|^[a-zA-Z]:[/\\]/, sep2 = "/", normalize2 = function(path2) {
2514
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE2 = /^[A-Za-z]:$/, normalize = function(path2) {
2971
2515
  if (path2.length === 0)
2972
2516
  return ".";
2973
2517
  path2 = normalizeWindowsPath2(path2);
2974
- let isUNCPath = path2.match(_UNC_REGEX2), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
2975
- return path2 = normalizeString2(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE2.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
2976
- }, join2 = function(...segments) {
2518
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
2519
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE2.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
2520
+ }, join = function(...segments) {
2977
2521
  let path2 = "";
2978
2522
  for (let seg of segments)
2979
2523
  if (seg)
@@ -2982,21 +2526,9 @@ var _UNC_REGEX2 = /^[/\\]{2}/, _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\
2982
2526
  pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
2983
2527
  } else
2984
2528
  path2 += seg;
2985
- return normalize2(path2);
2986
- };
2987
- function cwd2() {
2988
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
2989
- }
2990
- var resolve2 = function(...arguments_) {
2991
- arguments_ = arguments_.map((argument) => normalizeWindowsPath2(argument));
2992
- let resolvedPath = "", resolvedAbsolute = !1;
2993
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
2994
- let path2 = index >= 0 ? arguments_[index] : cwd2();
2995
- !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
2996
- }
2997
- return resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
2529
+ return normalize(path2);
2998
2530
  };
2999
- function normalizeString2(path2, allowAboveRoot) {
2531
+ function normalizeString(path2, allowAboveRoot) {
3000
2532
  let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
3001
2533
  for (let index = 0; index <= path2.length; ++index) {
3002
2534
  if (index < path2.length)
@@ -3028,73 +2560,8 @@ function normalizeString2(path2, allowAboveRoot) {
3028
2560
  }
3029
2561
  var isAbsolute2 = function(p) {
3030
2562
  return _IS_ABSOLUTE_RE2.test(p);
3031
- }, toNamespacedPath2 = function(p) {
3032
- return normalizeWindowsPath2(p);
3033
- }, extname2 = function(p) {
3034
- if (p === "..") return "";
3035
- let match = _EXTNAME_RE2.exec(normalizeWindowsPath2(p));
3036
- return match && match[1] || "";
3037
- }, relative2 = function(from, to) {
3038
- let _from = resolve2(from).replace(_ROOT_FOLDER_RE2, "$1").split("/"), _to = resolve2(to).replace(_ROOT_FOLDER_RE2, "$1").split("/");
3039
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
3040
- return _to.join("/");
3041
- let _fromCopy = [..._from];
3042
- for (let segment of _fromCopy) {
3043
- if (_to[0] !== segment)
3044
- break;
3045
- _from.shift(), _to.shift();
3046
- }
3047
- return [..._from.map(() => ".."), ..._to].join("/");
3048
- }, dirname3 = function(p) {
3049
- let segments = normalizeWindowsPath2(p).replace(/\/$/, "").split("/").slice(0, -1);
3050
- return segments.length === 1 && _DRIVE_LETTER_RE2.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
3051
- }, format2 = function(p) {
3052
- let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
3053
- Boolean
3054
- );
3055
- return normalizeWindowsPath2(
3056
- p.root ? resolve2(...segments) : segments.join("/")
3057
- );
3058
- }, basename2 = function(p, extension) {
3059
- let segments = normalizeWindowsPath2(p).split("/"), lastSegment = "";
3060
- for (let i = segments.length - 1; i >= 0; i--) {
3061
- let val = segments[i];
3062
- if (val) {
3063
- lastSegment = val;
3064
- break;
3065
- }
3066
- }
3067
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
3068
- }, parse2 = function(p) {
3069
- let root = _PATH_ROOT_RE2.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename2(p), extension = extname2(base);
3070
- return {
3071
- root,
3072
- dir: dirname3(p),
3073
- base,
3074
- ext: extension,
3075
- name: base.slice(0, base.length - extension.length)
3076
- };
3077
- }, matchesGlob2 = (path2, pattern) => zeptomatch2(pattern, normalize2(path2)), _path2 = {
3078
- __proto__: null,
3079
- basename: basename2,
3080
- dirname: dirname3,
3081
- extname: extname2,
3082
- format: format2,
3083
- isAbsolute: isAbsolute2,
3084
- join: join2,
3085
- matchesGlob: matchesGlob2,
3086
- normalize: normalize2,
3087
- normalizeString: normalizeString2,
3088
- parse: parse2,
3089
- relative: relative2,
3090
- resolve: resolve2,
3091
- sep: sep2,
3092
- toNamespacedPath: toNamespacedPath2
3093
- }, delimiter2 = globalThis.process?.platform === "win32" ? ";" : ":", _platforms2 = { posix: void 0, win32: void 0 }, mix2 = (del = delimiter2) => new Proxy(_path2, {
3094
- get(_, prop) {
3095
- return prop === "delimiter" ? del : prop === "posix" ? posix2 : prop === "win32" ? win322 : _platforms2[prop] || _path2[prop];
3096
- }
3097
- }), posix2 = mix2(":"), win322 = mix2(";"), DOCGEN_APIS = ["compiler", "native"], NATIVE_ENTRY_POINTS = { sync: "./sync", ast: "./ast", factory: "./ast/factory" };
2563
+ };
2564
+ var DOCGEN_APIS = ["compiler", "native"], NATIVE_ENTRY_POINTS = { sync: "./sync", ast: "./ast", factory: "./ast/factory" };
3098
2565
  async function loadNativeTypeScriptModules(importEntry) {
3099
2566
  let [sync, ast, factory] = await Promise.all(
3100
2567
  Object.values(NATIVE_ENTRY_POINTS).map((subpath) => importEntry(subpath))
@@ -3120,7 +2587,7 @@ var importPackageEntry = ({ version, packageDir, main, exports }, subpath) => {
3120
2587
  throw new Error(
3121
2588
  `TypeScript ${version} at ${packageDir} has no "${subpath}" entry point that Storybook can import`
3122
2589
  );
3123
- return import(pathToFileURL(join2(packageDir, entry)).href);
2590
+ return import(pathToFileURL(join(packageDir, entry)).href);
3124
2591
  };
3125
2592
  function loadDocgenTypeScript(typeScriptSpecifier) {
3126
2593
  if (typeScriptSpecifier) {
@@ -3138,14 +2605,14 @@ import {
3138
2605
  filterSourceFilePaths as filterSourceFilePaths2
3139
2606
  } from "storybook/internal/component-meta";
3140
2607
  import { logger as logger5 } from "storybook/internal/node-logger";
3141
- var __filename4 = CJS_COMPAT_NODE_URL_r3c3rhnvdz4.fileURLToPath(import.meta.url), __dirname4 = CJS_COMPAT_NODE_PATH_r3c3rhnvdz4.dirname(__filename4), require5 = CJS_COMPAT_NODE_MODULE_r3c3rhnvdz4.createRequire(import.meta.url);
3142
2608
 
3143
2609
  // src/docgen/build-docgen.ts
3144
2610
  import {
2611
+ componentPathFromStory,
3145
2612
  getComponentIdFromEntry,
3146
2613
  getStoryImportPathFromEntry
3147
2614
  } from "storybook/internal/common";
3148
- import { resolve as resolve3 } from "node:path";
2615
+ import { resolve } from "node:path";
3149
2616
 
3150
2617
  // src/docgen/api-description.ts
3151
2618
  var readMember = (name, argType) => {
@@ -3237,48 +2704,39 @@ var inputsOf = (entry) => "inputsClass" in entry ? entry.inputsClass ?? [] : [],
3237
2704
  members: enumeration.childs.map((child) => ({ name: child.name, value: child.value }))
3238
2705
  }))
3239
2706
  };
3240
- }, errorPayload = (base, name, message) => ({ ...base, jsDocTags: {}, error: { name, message } }), buildDocgenPayload = (input, context) => {
3241
- let { manager, options, logger: logger7 } = context, storyImportPath = getStoryImportPathFromEntry(input.entry);
3242
- if (!storyImportPath)
3243
- return;
3244
- let storyFilePath = (context.resolvePath ?? ((importPath) => resolve3(process.cwd(), importPath)))(storyImportPath), resolved = resolveStoryComponent(storyFilePath, input.entry.title);
3245
- if ("reason" in resolved) {
3246
- if (resolved.reason === "no-meta-component") {
3247
- logger7.debug(`No Angular component resolved from ${storyFilePath}: ${resolved.reason}.`);
3248
- return;
3249
- }
3250
- let unreadableBase = {
3251
- id: getComponentIdFromEntry(input.entry),
3252
- name: resolved.reason === "unreadable-component-expression" ? resolved.expression : input.entry.title.split("/").at(-1) ?? input.entry.title,
3253
- path: storyImportPath
3254
- };
3255
- return errorPayload(
3256
- unreadableBase,
3257
- "AngularComponentMetaNotFound",
3258
- resolved.reason === "unreadable-component-expression" ? `The story file sets \`component: ${resolved.expression}\`, which does not resolve to a class.
3259
- Storybook follows an imported name, a namespace-import property access, or a chain of property accesses and spreads through modules it can resolve. Assign the component to a name in ${storyFilePath}.` : (
3260
- // `meta.component` may reach this binding through another module (e.g. a spread config
3261
- // object), so the type-only or namespace import is not necessarily written in the story
3262
- // file itself - naming it here would send the reader to the wrong file.
3263
- `Resolving \`meta.component\` from ${storyFilePath} reached a binding that is a type-only or namespace import, which carries no class to document.
2707
+ }, notFound = (message) => ({
2708
+ error: { name: "AngularComponentMetaNotFound", message }
2709
+ }), unresolvedError = (resolution, reference, storyFilePath) => {
2710
+ switch (resolution.reason) {
2711
+ case "unreadable-component-expression":
2712
+ return notFound(
2713
+ `The story file sets \`${reference}: ${resolution.expression}\`, which does not resolve to a class.
2714
+ Storybook follows an imported name, a namespace-import property access, or a chain of property accesses and spreads through modules it can resolve. Assign the component to a name in ${storyFilePath}.`
2715
+ );
2716
+ case "no-component-import":
2717
+ return notFound(
2718
+ `Resolving \`meta.${reference}\` from ${storyFilePath} reached a binding that is a type-only or namespace import, which carries no class to document.
3264
2719
  Import the component as a value in whichever module declares that binding.`
3265
- )
3266
- );
2720
+ );
2721
+ case "missing-export":
2722
+ return notFound(
2723
+ `The story file sets \`${reference}: ${resolution.expression}\`, but "${resolution.importId}" has no export "${resolution.exportName}".
2724
+ Check the name against the module's exports, and any barrel that re-exports it.`
2725
+ );
2726
+ case "no-meta-component":
2727
+ return notFound(`The story file ${storyFilePath} sets no \`meta.${reference}\`.`);
2728
+ default: {
2729
+ let unhandled = resolution;
2730
+ throw new Error(`Unhandled resolution ${JSON.stringify(unhandled)}`);
2731
+ }
3267
2732
  }
3268
- let { component } = resolved, displayName = component.exportName === "default" ? component.localName : component.exportName, base = {
3269
- id: getComponentIdFromEntry(input.entry),
3270
- name: displayName,
3271
- path: storyImportPath
3272
- };
2733
+ }, extractClassDocgen = (component, displayName, reference, storyFilePath, { manager, options, logger: logger7 }) => {
3273
2734
  if (!component.path)
3274
- return errorPayload(
3275
- base,
3276
- "AngularComponentMetaNotFound",
3277
- // `component.importId` may be read from a module `meta.component` only reaches through a
3278
- // chain (e.g. a spread config object), so the import is not necessarily written in the story
3279
- // file itself - naming it here would send the reader to the wrong file.
3280
- `Storybook could not resolve the import of "${displayName}" from "${component.importId}", reached while resolving \`meta.component\` from ${storyFilePath}.
3281
- Check the import specifier (and any tsconfig path aliases it relies on) in whichever module actually imports it.`
2735
+ return notFound(
2736
+ // The import can be written in another module the reference reaches, such as a barrel, so the
2737
+ // message names the module that writes it.
2738
+ `Storybook could not resolve the import "${component.importId}" of "${displayName}" in ${component.importer ?? storyFilePath}, reached while resolving \`meta.${reference}\` from ${storyFilePath}.
2739
+ Check the import specifier there, and any tsconfig path aliases it relies on.`
3282
2740
  );
3283
2741
  let meta;
3284
2742
  try {
@@ -3287,16 +2745,15 @@ Check the import specifier (and any tsconfig path aliases it relies on) in which
3287
2745
  localName: component.localName
3288
2746
  });
3289
2747
  } catch (err) {
3290
- return errorPayload(
3291
- base,
3292
- "AngularComponentMetaExtractionFailed",
3293
- `The analyzer threw while extracting "${component.exportName}" from ${component.path}: ${err instanceof Error ? err.message : String(err)}`
3294
- );
2748
+ return {
2749
+ error: {
2750
+ name: "AngularComponentMetaExtractionFailed",
2751
+ message: `The analyzer threw while extracting "${component.exportName}" from ${component.path}: ${err instanceof Error ? err.message : String(err)}`
2752
+ }
2753
+ };
3295
2754
  }
3296
2755
  if (!meta)
3297
- return errorPayload(
3298
- base,
3299
- "AngularComponentMetaNotFound",
2756
+ return notFound(
3300
2757
  `No metadata was extracted for the "${component.exportName}" export of ${component.path}.
3301
2758
  Check that the file exports the component class and is covered by a tsconfig.json in or above its directory.`
3302
2759
  );
@@ -3314,7 +2771,6 @@ Check that the file exports the component class and is covered by a tsconfig.jso
3314
2771
  context: meta.context
3315
2772
  }), jsDocTags = meta.jsDocInfo?.jsDocTags ?? analyzerJsDocTags(meta.entry), description = describedBy(meta.jsDocInfo?.description) ?? describedBy(meta.entry.rawdescription) ?? describedBy(meta.entry.description);
3316
2773
  return {
3317
- ...base,
3318
2774
  // The analyzer knows the class name even when the story file imported it as a default export.
3319
2775
  name: meta.entry.name,
3320
2776
  description,
@@ -3322,9 +2778,74 @@ Check that the file exports the component class and is covered by a tsconfig.jso
3322
2778
  jsDocTags,
3323
2779
  argTypes,
3324
2780
  apiDescription: buildApiDescription(apiArgTypes, meta.entry.name),
3325
- renderer: "angular",
3326
2781
  angularComponentMeta: metaToSnippetMeta(meta)
3327
2782
  };
2783
+ }, displayNameOf = (component) => component.exportName === "default" ? component.localName : component.exportName, buildSubcomponentDocgen = ({ name, resolution }, storyFilePath, storyImportPath, context) => {
2784
+ let reference = `subcomponents.${name}`;
2785
+ if ("reason" in resolution) {
2786
+ let { error } = unresolvedError(resolution, reference, storyFilePath);
2787
+ return { name, path: storyImportPath, jsDocTags: {}, error };
2788
+ }
2789
+ let docgen = extractClassDocgen(
2790
+ resolution.component,
2791
+ displayNameOf(resolution.component),
2792
+ reference,
2793
+ storyFilePath,
2794
+ context
2795
+ );
2796
+ if ("error" in docgen)
2797
+ return { name, path: storyImportPath, jsDocTags: {}, error: docgen.error };
2798
+ let { angularComponentMeta: _, ...entry } = docgen, { path: path2 } = resolution.component;
2799
+ return {
2800
+ ...entry,
2801
+ path: path2 ? componentPathFromStory(storyImportPath, storyFilePath, path2) : storyImportPath,
2802
+ renderer: "angular"
2803
+ };
2804
+ }, buildDocgenPayload = (input, context) => {
2805
+ let storyImportPath = getStoryImportPathFromEntry(input.entry);
2806
+ if (!storyImportPath)
2807
+ return;
2808
+ let storyFilePath = (context.resolvePath ?? ((importPath) => resolve(process.cwd(), importPath)))(storyImportPath), { component: resolved, subcomponents } = resolveStoryComponents(
2809
+ storyFilePath,
2810
+ input.entry.title
2811
+ ), id = getComponentIdFromEntry(input.entry);
2812
+ if ("reason" in resolved) {
2813
+ if (resolved.reason === "no-meta-component") {
2814
+ context.logger.debug(
2815
+ `No Angular component resolved from ${storyFilePath}: ${resolved.reason}.`
2816
+ );
2817
+ return;
2818
+ }
2819
+ let { error } = unresolvedError(resolved, "component", storyFilePath);
2820
+ return {
2821
+ id,
2822
+ name: resolved.reason === "unreadable-component-expression" ? resolved.expression : input.entry.title.split("/").at(-1) ?? input.entry.title,
2823
+ path: storyImportPath,
2824
+ jsDocTags: {},
2825
+ error
2826
+ };
2827
+ }
2828
+ let base = { id, name: displayNameOf(resolved.component), path: storyImportPath }, docgen = extractClassDocgen(
2829
+ resolved.component,
2830
+ base.name,
2831
+ "component",
2832
+ storyFilePath,
2833
+ context
2834
+ );
2835
+ if ("error" in docgen)
2836
+ return { ...base, jsDocTags: {}, error: docgen.error };
2837
+ let subcomponentEntries = Object.fromEntries(
2838
+ subcomponents.map((subcomponent) => [
2839
+ subcomponent.name,
2840
+ buildSubcomponentDocgen(subcomponent, storyFilePath, storyImportPath, context)
2841
+ ])
2842
+ );
2843
+ return {
2844
+ ...base,
2845
+ ...docgen,
2846
+ renderer: "angular",
2847
+ ...subcomponents.length > 0 ? { subcomponents: subcomponentEntries } : {}
2848
+ };
3328
2849
  };
3329
2850
 
3330
2851
  // src/docgen/docgen-worker.ts