@storybook/vue3 11.0.0-rc.3 → 11.0.0
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/_browser-chunks/{chunk-ZXXNCHU7.js → chunk-FTNLYRVC.js} +2 -2
- package/dist/_node-chunks/{chunk-HCZJLA2R.js → chunk-FEPCDEC2.js} +89 -46
- package/dist/_node-chunks/{chunk-GZZJQ4KA.js → chunk-IXYCOERX.js} +84 -42
- package/dist/_node-chunks/{chunk-PJYH2H5M.js → chunk-YPMEPZAF.js} +42 -26
- package/dist/_node-chunks/{component-meta-2QQVU6VA.js → component-meta-H4SIVDTW.js} +5 -3
- package/dist/{chunk-Dka2iJUy.d.ts → chunk-CmSWgGT0.d.ts} +4 -4
- package/dist/docgen/docgen-worker.js +4 -2
- package/dist/docgen/index.d.ts +1 -1
- package/dist/docgen/index.js +3 -3
- package/dist/docs/register-print-hole.js +1 -1
- package/dist/entry-preview-docs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +2 -2
- package/package.json +2 -2
|
@@ -67,11 +67,11 @@ var printHole = (hole, value) => {
|
|
|
67
67
|
case "attr":
|
|
68
68
|
return value === void 0 ? "" : attribute(hole.name ?? arg, arg, value);
|
|
69
69
|
case "props":
|
|
70
|
-
return Object.entries(value).filter(([name]) => !hole.except.includes(name)).sort(([a], [b]) => attributeOrder(a, b)).map(([name, item]) => attribute(name, name, item)).join(
|
|
70
|
+
return Object.entries(value).filter(([name]) => !hole.except.includes(name)).sort(([a], [b]) => attributeOrder(a, b)).map(([name, item]) => attribute(name, name, item)).join(hole.separator);
|
|
71
71
|
case "slots": {
|
|
72
72
|
let set = hole.slots.filter((name) => Object.hasOwn(value, name)).sort(slotOrder);
|
|
73
73
|
if (set.length === 0)
|
|
74
|
-
return hole.tag ?
|
|
74
|
+
return hole.tag ? hole.closing : "";
|
|
75
75
|
let children = set.map((name) => wrapSlotContent(name, slot(name, value[name]))).map((child) => indent(child, hole.indent)).join(`
|
|
76
76
|
`);
|
|
77
77
|
return hole.tag ? `>
|
|
@@ -292,7 +292,7 @@ function partitionArgsByRole(args) {
|
|
|
292
292
|
slots: args.filter((arg) => arg.role === "slot").sort((a, b) => slotOrder(a.name, b.name))
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function createRenderContext(
|
|
295
|
+
function createRenderContext(marks) {
|
|
296
296
|
return {
|
|
297
297
|
imports: {},
|
|
298
298
|
// `ref` is reserved up front so no hoisted arg can shadow the Vue import a v-model may need.
|
|
@@ -301,7 +301,8 @@ function createRenderContext(mark) {
|
|
|
301
301
|
hoistedArgs: /* @__PURE__ */ new Map(),
|
|
302
302
|
componentImports: /* @__PURE__ */ new Set(),
|
|
303
303
|
statements: [],
|
|
304
|
-
mark
|
|
304
|
+
mark: marks?.mark,
|
|
305
|
+
measure: marks?.unmark ?? ((code) => code)
|
|
305
306
|
};
|
|
306
307
|
}
|
|
307
308
|
var marked = (ctx, hole, text, space) => ctx.mark ? ctx.mark(hole, text, space) : text, attributeHole = (name, arg) => ({
|
|
@@ -447,30 +448,23 @@ function importStatementForBinding(localName, binding) {
|
|
|
447
448
|
}
|
|
448
449
|
function normalizeTemplateBlock(source) {
|
|
449
450
|
let lines = source.split(`
|
|
450
|
-
`), start
|
|
451
|
-
|
|
452
|
-
let line = lines[lineIndex], contentIndex = line.search(/\S/);
|
|
453
|
-
if (contentIndex === -1) {
|
|
454
|
-
lines[lineIndex] = "";
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if (start ??= lineIndex, end = lineIndex + 1, commonPrefix === void 0) {
|
|
458
|
-
commonPrefix = line.slice(0, contentIndex);
|
|
459
|
-
continue;
|
|
460
|
-
}
|
|
461
|
-
let index = 0;
|
|
462
|
-
for (; index < commonPrefix.length && index < contentIndex && commonPrefix[index] === line[index]; )
|
|
463
|
-
index += 1;
|
|
464
|
-
commonPrefix = commonPrefix.slice(0, index);
|
|
465
|
-
}
|
|
466
|
-
if (start === void 0)
|
|
451
|
+
`).map((line) => /\S/.test(line) ? line : ""), start = lines.findIndex((line) => line !== "");
|
|
452
|
+
if (start === -1)
|
|
467
453
|
return "";
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
lines[lineIndex] = lines[lineIndex].slice(commonPrefix.length);
|
|
471
|
-
return lines.slice(start, end).join(`
|
|
454
|
+
let end = lines.findLastIndex((line) => line !== "") + 1, indent2 = templateIndent(source);
|
|
455
|
+
return lines.slice(start, end).map((line) => line.slice(indent2.length)).join(`
|
|
472
456
|
`);
|
|
473
457
|
}
|
|
458
|
+
function templateIndent(source) {
|
|
459
|
+
let indents = source.split(`
|
|
460
|
+
`).filter((line) => /\S/.test(line)).map((line) => /^\s*/.exec(line)[0]);
|
|
461
|
+
return indents.reduce((common, indent2) => {
|
|
462
|
+
let length = 0;
|
|
463
|
+
for (; length < common.length && common[length] === indent2[length]; )
|
|
464
|
+
length += 1;
|
|
465
|
+
return common.slice(0, length);
|
|
466
|
+
}, indents[0] ?? "");
|
|
467
|
+
}
|
|
474
468
|
|
|
475
469
|
// src/docgen/story-docs/print-h/print-h.ts
|
|
476
470
|
var H_FUNCTION = "h", ARGS_NAME = "args", ARGS_BINDING = `v-bind="${ARGS_NAME}"`, NO_DOCGEN = { props: /* @__PURE__ */ new Set(), events: /* @__PURE__ */ new Set(), slots: /* @__PURE__ */ new Set() }, VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
@@ -769,6 +763,7 @@ import {
|
|
|
769
763
|
unwrapExpression as unwrapExpression7,
|
|
770
764
|
walk as walk4
|
|
771
765
|
} from "storybook/internal/csf-tools";
|
|
766
|
+
import { SNIPPET_INDENT, layOutWrittenTag } from "storybook/internal/docs-tools";
|
|
772
767
|
|
|
773
768
|
// src/docgen/story-docs/transform-template/forward-setup.ts
|
|
774
769
|
import {
|
|
@@ -1032,7 +1027,8 @@ function transformTemplate(input) {
|
|
|
1032
1027
|
slots: input.slots ?? /* @__PURE__ */ new Set(),
|
|
1033
1028
|
argsStory: input.argsStory ?? !1,
|
|
1034
1029
|
importBindings: input.importBindings ?? /* @__PURE__ */ new Map(),
|
|
1035
|
-
template
|
|
1030
|
+
template,
|
|
1031
|
+
indent: templateIndent(template)
|
|
1036
1032
|
};
|
|
1037
1033
|
if (!(input.setup && !seedForwardedSetup(input.setup, state)) && collectTemplateScopeBindings(ast.children, state.ctx) && ast.children.every((child) => transformNode(child, state)) && !(input.setup && !appendSetupStatements(input.setup, state)))
|
|
1038
1034
|
return {
|
|
@@ -1117,6 +1113,7 @@ function transformElement(node, state) {
|
|
|
1117
1113
|
}, attributesByName = attributePropsByName(node), plan = planArgsBindingExpansion(node, attributesByName, state);
|
|
1118
1114
|
if (!plan)
|
|
1119
1115
|
return !1;
|
|
1116
|
+
let propEdits = state.edits.length;
|
|
1120
1117
|
for (let prop of node.props) {
|
|
1121
1118
|
if (plan.removed.has(prop)) {
|
|
1122
1119
|
state.edits.push(replacementFor(prop, "", state.template));
|
|
@@ -1137,20 +1134,25 @@ function transformElement(node, state) {
|
|
|
1137
1134
|
if (prop.type === NodeTypes.DIRECTIVE && !transformDirective(prop, attributesByName, element, state))
|
|
1138
1135
|
return !1;
|
|
1139
1136
|
}
|
|
1140
|
-
let
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1137
|
+
let closeStart = layOutStartTag(
|
|
1138
|
+
node,
|
|
1139
|
+
plan.directive,
|
|
1140
|
+
element,
|
|
1141
|
+
state.edits.splice(propEdits),
|
|
1142
|
+
state
|
|
1143
|
+
), slotsHole = (text, tag) => {
|
|
1144
|
+
let place = { kind: "slots", slots: element.unsetSlots, indent: "", spread: !0 };
|
|
1145
|
+
return marked(state.ctx, tag ? { ...place, tag, closing: text } : place, text);
|
|
1146
|
+
};
|
|
1145
1147
|
if (element.slotChildren.length > 0) {
|
|
1146
1148
|
if (hasNonWhitespaceChildren(node))
|
|
1147
1149
|
return !1;
|
|
1148
|
-
let after = element.unsetSlots.length > 0 ? slotsHole("") : "", edit = slotChildrenEdit(node, element.slotChildren, after, state.template);
|
|
1150
|
+
let after = element.unsetSlots.length > 0 ? slotsHole("") : "", edit = slotChildrenEdit(node, element.slotChildren, after, state.template, closeStart);
|
|
1149
1151
|
if (!edit)
|
|
1150
1152
|
return !1;
|
|
1151
1153
|
state.edits.push(edit);
|
|
1152
1154
|
} else if (node.isSelfClosing && element.unsetSlots.length > 0) {
|
|
1153
|
-
let end = node.loc.end.offset, start = blankRunStart(state.template, end - 2);
|
|
1155
|
+
let end = node.loc.end.offset, start = closeStart ?? blankRunStart(state.template, end - 2);
|
|
1154
1156
|
state.edits.push({ start, end, text: slotsHole(state.template.slice(start, end), node.tag) });
|
|
1155
1157
|
}
|
|
1156
1158
|
return node.children.every((child) => transformNode(child, state));
|
|
@@ -1180,7 +1182,7 @@ function planArgsBindingExpansion(node, attributesByName, state) {
|
|
|
1180
1182
|
}
|
|
1181
1183
|
return { directive, surviving, removed };
|
|
1182
1184
|
}
|
|
1183
|
-
function expandArgsBinding({ directive, surviving
|
|
1185
|
+
function expandArgsBinding({ directive, surviving }, attributesByName, element, state) {
|
|
1184
1186
|
let rendered = renderArgsBindingExpansion(surviving, state.ctx, {
|
|
1185
1187
|
roleAware: element.storyTag,
|
|
1186
1188
|
renderSlotArg: (slot) => renderSlotArgContent(slot, state.ctx, state.importBindings, state.componentImports)
|
|
@@ -1196,13 +1198,13 @@ function expandArgsBinding({ directive, surviving, removed }, attributesByName,
|
|
|
1196
1198
|
),
|
|
1197
1199
|
...surviving.map((arg) => arg.name),
|
|
1198
1200
|
...state.slots
|
|
1199
|
-
],
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
"",
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
return state.edits.push({ ...edit, text: edit.text + added }), !0;
|
|
1201
|
+
], except = [...new Set(printed)];
|
|
1202
|
+
element.expansion = {
|
|
1203
|
+
attributes: rendered.attributes,
|
|
1204
|
+
added: (separator) => marked(state.ctx, { kind: "props", except, separator, spread: !0 }, "", separator)
|
|
1205
|
+
};
|
|
1206
|
+
let edit = replacementFor(directive, rendered.attributes.join(" "), state.template);
|
|
1207
|
+
return state.edits.push({ ...edit, text: edit.text + element.expansion.added(" ") }), !0;
|
|
1206
1208
|
}
|
|
1207
1209
|
function boundProp(prop, directive, attributesByName, element, state) {
|
|
1208
1210
|
let binding = prop.type === NodeTypes.DIRECTIVE ? prop : void 0, name = binding ? binding.name === "bind" && !setsOwnKey(binding) ? staticDirectiveArg(binding) : void 0 : prop.name, exp = binding?.exp?.type === NodeTypes.SIMPLE_EXPRESSION ? binding.exp : void 0, read = exp && state.argsByName.get(exactArgsMemberName(exp.content.trim()) ?? ""), later = attributesByName.get(name ?? "")?.some(
|
|
@@ -1440,6 +1442,42 @@ function replacementFor(prop, text, template) {
|
|
|
1440
1442
|
` && template[lineEnd] === `
|
|
1441
1443
|
` ? { start: lineStart - 1, end: lineEnd, text } : { start: lineStart, end, text };
|
|
1442
1444
|
}
|
|
1445
|
+
function layOutStartTag(node, directive, element, propEdits, state) {
|
|
1446
|
+
let { template } = state, tagEnd = openTagEndOffset(node, template), keep = () => {
|
|
1447
|
+
state.edits.push(...propEdits);
|
|
1448
|
+
};
|
|
1449
|
+
if (!element.expansion || tagEnd === void 0)
|
|
1450
|
+
return keep();
|
|
1451
|
+
let attributes = [];
|
|
1452
|
+
for (let prop of node.props) {
|
|
1453
|
+
let start = prop.loc.start.offset, end = prop.loc.end.offset;
|
|
1454
|
+
if (prop === directive) {
|
|
1455
|
+
attributes.push(...element.expansion.attributes, element.expansion.added);
|
|
1456
|
+
continue;
|
|
1457
|
+
}
|
|
1458
|
+
let inside = propEdits.filter((edit) => edit.start >= start && edit.end <= end), around = propEdits.filter(
|
|
1459
|
+
(edit) => edit.start < end && edit.end > start && !inside.includes(edit)
|
|
1460
|
+
);
|
|
1461
|
+
if (around.some((edit) => edit.text !== ""))
|
|
1462
|
+
return keep();
|
|
1463
|
+
let text2 = around.length > 0 ? "" : applyEdits(
|
|
1464
|
+
template.slice(start, end),
|
|
1465
|
+
inside.map((edit) => ({ ...edit, start: edit.start - start, end: edit.end - start }))
|
|
1466
|
+
);
|
|
1467
|
+
text2 !== "" && attributes.push(text2);
|
|
1468
|
+
}
|
|
1469
|
+
let close = node.isSelfClosing ? "/>" : ">", tag = {
|
|
1470
|
+
start: node.loc.start.offset,
|
|
1471
|
+
nameEnd: node.loc.start.offset + 1 + node.tag.length,
|
|
1472
|
+
closeStart: tagEnd - close.length,
|
|
1473
|
+
close
|
|
1474
|
+
}, text = layOutWrittenTag(template, tag, attributes, {
|
|
1475
|
+
measure: state.ctx.measure,
|
|
1476
|
+
// The snippet's `<template>` holds the markup dedented, one level in.
|
|
1477
|
+
before: (written) => SNIPPET_INDENT + written.slice(state.indent.length)
|
|
1478
|
+
});
|
|
1479
|
+
return text === void 0 ? keep() : (state.edits.push({ start: tag.nameEnd, end: tag.closeStart, text }), tag.closeStart);
|
|
1480
|
+
}
|
|
1443
1481
|
function blankRunStart(template, index) {
|
|
1444
1482
|
let cursor = index;
|
|
1445
1483
|
for (; cursor > 0 && BLANK_REGEXP.test(template[cursor - 1]); )
|
|
@@ -1452,14 +1490,14 @@ function blankRunEnd(template, index) {
|
|
|
1452
1490
|
cursor += 1;
|
|
1453
1491
|
return cursor;
|
|
1454
1492
|
}
|
|
1455
|
-
function slotChildrenEdit(node, children, after, template) {
|
|
1493
|
+
function slotChildrenEdit(node, children, after, template, closeStart) {
|
|
1456
1494
|
let baseIndent = " ".repeat(Math.max(node.loc.start.column - 1, 0)), joined = `
|
|
1457
1495
|
${children.map((child) => indentBy(child, `${baseIndent} `)).join(`
|
|
1458
1496
|
`)}${after}
|
|
1459
1497
|
${baseIndent}`;
|
|
1460
1498
|
if (node.isSelfClosing) {
|
|
1461
|
-
let start = node.loc.end.offset - 2;
|
|
1462
|
-
for (; start > 0 && template[start - 1] === " "; )
|
|
1499
|
+
let start = closeStart ?? node.loc.end.offset - 2;
|
|
1500
|
+
for (; closeStart === void 0 && start > 0 && template[start - 1] === " "; )
|
|
1463
1501
|
start -= 1;
|
|
1464
1502
|
return { start, end: node.loc.end.offset, text: `>${joined}</${node.tag}>` };
|
|
1465
1503
|
}
|
|
@@ -1670,10 +1708,10 @@ function enrichStoryDoc(csf, storyExport, storyDoc, options) {
|
|
|
1670
1708
|
let resolved = resolveStaticStoryArgs(storyExport, docgenArgInfo, options), { classified } = resolved, { args, unresolved: classifyUnresolved } = classified, unresolved = [...classifyUnresolved, ...resolved.unresolved];
|
|
1671
1709
|
if (args.length === 0 && unresolved.length > 0)
|
|
1672
1710
|
return withWarning(noSnippetWarning(unresolved));
|
|
1673
|
-
let print = (
|
|
1711
|
+
let print = (marks2) => renderStaticStorySnippet(renderer, classified, componentName, docgenArgInfo, options, marks2), rendered = print();
|
|
1674
1712
|
if (!rendered)
|
|
1675
1713
|
return withWarning(UNRENDERED_WARNINGS[renderer.kind]);
|
|
1676
|
-
let marks = createHoleMarks([rendered.snippet]), printed = print(marks
|
|
1714
|
+
let marks = createHoleMarks([rendered.snippet]), printed = print(marks)?.snippet, holes = printed === void 0 ? void 0 : marks.toTemplate(printed);
|
|
1677
1715
|
return {
|
|
1678
1716
|
...storyDoc,
|
|
1679
1717
|
snippet: rendered.snippet,
|
|
@@ -1693,6 +1731,11 @@ function laidOut(template) {
|
|
|
1693
1731
|
else if (segment.kind === "slots") {
|
|
1694
1732
|
let line = /[^\n]*$/.exec(stripHoles(result))[0];
|
|
1695
1733
|
result.push({ ...segment, indent: /^\s*/.exec(line)[0] + (segment.tag ? " " : "") });
|
|
1734
|
+
} else if (segment.kind === "props" && segment.separator.startsWith(`
|
|
1735
|
+
`)) {
|
|
1736
|
+
let line = /[^\n]*$/.exec(stripHoles(result))[0], separator = `
|
|
1737
|
+
${/^\s*/.exec(line)[0]}`;
|
|
1738
|
+
result.push({ ...segment, separator, space: separator });
|
|
1696
1739
|
} else if (typeof previous == "string" && /\n[ \t]+$/.test(previous) && segment.text === "" && segment.space === void 0 && (next === void 0 || typeof next == "string" && next.startsWith(`
|
|
1697
1740
|
`))) {
|
|
1698
1741
|
let space = /[ \t]+$/.exec(previous)[0];
|
|
@@ -1740,8 +1783,8 @@ function resolveStaticStoryArgs(storyExport, docgenArgInfo, options) {
|
|
|
1740
1783
|
unresolved: resolved.unresolved
|
|
1741
1784
|
};
|
|
1742
1785
|
}
|
|
1743
|
-
function renderStaticStorySnippet(renderer, classified, componentName, docgenArgInfo, options,
|
|
1744
|
-
let componentImportStatement = options.snippet?.componentImportStatement, { args } = classified, ctx = createRenderContext(
|
|
1786
|
+
function renderStaticStorySnippet(renderer, classified, componentName, docgenArgInfo, options, marks) {
|
|
1787
|
+
let componentImportStatement = options.snippet?.componentImportStatement, { args } = classified, ctx = createRenderContext(marks), slots = docgenArgInfo.slots;
|
|
1745
1788
|
if (renderer.kind === "sfc")
|
|
1746
1789
|
return componentImportStatement ? transformTemplate({
|
|
1747
1790
|
args,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
collectComponentMetaSources,
|
|
6
6
|
relative
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YPMEPZAF.js";
|
|
8
8
|
|
|
9
9
|
// src/docgen/component-docgen/arg-types/extractArgTypes.ts
|
|
10
10
|
import { convert, extractComponentProps, hasDocgen } from "storybook/internal/docs-tools";
|
|
@@ -320,7 +320,7 @@ function createNamedTypeDetailResolver({
|
|
|
320
320
|
|
|
321
321
|
// src/docgen/component-docgen/build-docgen.ts
|
|
322
322
|
import { readFile } from "node:fs/promises";
|
|
323
|
-
import { join } from "node:path";
|
|
323
|
+
import { join, parse } from "node:path";
|
|
324
324
|
import {
|
|
325
325
|
extractComponentDescription,
|
|
326
326
|
extractDescription,
|
|
@@ -334,6 +334,31 @@ import {
|
|
|
334
334
|
getStoryImportPathFromEntry
|
|
335
335
|
} from "storybook/internal/common";
|
|
336
336
|
|
|
337
|
+
// src/docgen/component-docgen/component-docs.ts
|
|
338
|
+
import { readFileSync } from "node:fs";
|
|
339
|
+
import { readDeclarationDocs } from "storybook/internal/common";
|
|
340
|
+
import {
|
|
341
|
+
SourceEditor,
|
|
342
|
+
parseReferenceModule
|
|
343
|
+
} from "storybook/internal/csf-tools";
|
|
344
|
+
import { parse as parseSfc } from "@vue/language-core";
|
|
345
|
+
function readSfcModule(filePath) {
|
|
346
|
+
try {
|
|
347
|
+
let script = parseSfc(readFileSync(filePath, "utf8")).descriptor.script?.content ?? "", editor = new SourceEditor(script, filePath);
|
|
348
|
+
return {
|
|
349
|
+
filePath,
|
|
350
|
+
editor: editor.program.body.some(({ type }) => type === "ExportDefaultDeclaration") ? editor : new SourceEditor(`${script}
|
|
351
|
+
export default {};`, filePath)
|
|
352
|
+
};
|
|
353
|
+
} catch {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
var readComponentDocs = (component) => readDeclarationDocs(
|
|
358
|
+
component,
|
|
359
|
+
(filePath) => (filePath.endsWith(".vue") ? readSfcModule : parseReferenceModule)(filePath)
|
|
360
|
+
);
|
|
361
|
+
|
|
337
362
|
// src/docgen/component-docgen/resolve-component/follow-re-export.ts
|
|
338
363
|
function followReExport(checker, filePath, exportName) {
|
|
339
364
|
let program = checker.getProgram(), sourceFile = program?.getSourceFile(filePath);
|
|
@@ -406,7 +431,7 @@ function getUsableComponentName(component) {
|
|
|
406
431
|
if (!(!name || NON_COMPONENT_NAMES.has(name.split(".")[0]) || !META_COMPONENT_NAME.test(name)))
|
|
407
432
|
return name;
|
|
408
433
|
}
|
|
409
|
-
async function extractVueComponentDocgen(context, resolvedComponent,
|
|
434
|
+
async function extractVueComponentDocgen(context, resolvedComponent, errorContext = "") {
|
|
410
435
|
let checker = context.getChecker(resolvedComponent.path), declaredExport = followReExport(
|
|
411
436
|
checker,
|
|
412
437
|
resolvedComponent.path,
|
|
@@ -414,11 +439,7 @@ async function extractVueComponentDocgen(context, resolvedComponent, { metaJsDoc
|
|
|
414
439
|
) ?? {
|
|
415
440
|
path: resolvedComponent.path,
|
|
416
441
|
exportName: resolvedComponent.exportName
|
|
417
|
-
}, componentMeta = (await collectComponentMetaSources(
|
|
418
|
-
checker,
|
|
419
|
-
declaredExport.path,
|
|
420
|
-
context.typescript
|
|
421
|
-
)).find((meta) => meta.exportName === declaredExport.exportName);
|
|
442
|
+
}, componentMeta = (await collectComponentMetaSources(checker, declaredExport.path)).find((meta) => meta.exportName === declaredExport.exportName);
|
|
422
443
|
if (!componentMeta)
|
|
423
444
|
return {
|
|
424
445
|
error: {
|
|
@@ -426,11 +447,7 @@ async function extractVueComponentDocgen(context, resolvedComponent, { metaJsDoc
|
|
|
426
447
|
message: `vue-component-meta extracted no component metadata for the "${declaredExport.exportName}" export of ${relative(process.cwd(), declaredExport.path)}${errorContext}.`
|
|
427
448
|
}
|
|
428
449
|
};
|
|
429
|
-
let
|
|
430
|
-
metaJsDoc,
|
|
431
|
-
componentMeta.description,
|
|
432
|
-
componentMeta.jsDocTags
|
|
433
|
-
), resolveNamedTypeDetail = createNamedTypeDetailResolver({
|
|
450
|
+
let resolveNamedTypeDetail = createNamedTypeDetailResolver({
|
|
434
451
|
checker,
|
|
435
452
|
typescript: context.typescript,
|
|
436
453
|
componentPath: declaredExport.path
|
|
@@ -438,18 +455,15 @@ async function extractVueComponentDocgen(context, resolvedComponent, { metaJsDoc
|
|
|
438
455
|
return {
|
|
439
456
|
path: declaredExport.path,
|
|
440
457
|
componentMeta,
|
|
441
|
-
description,
|
|
442
|
-
summary,
|
|
443
|
-
jsDocTags,
|
|
444
458
|
argTypes: extractArgTypes({ __docgenInfo: componentMeta }, resolveNamedTypeDetail) ?? void 0,
|
|
445
459
|
apiDescription: buildApiDescription(componentMeta)
|
|
446
460
|
};
|
|
447
461
|
}
|
|
448
462
|
async function buildSubcomponentDocgen(csf, storyPath, storyFilePath, declared, context) {
|
|
449
|
-
let failure = (error) => ({
|
|
463
|
+
let failure = (error, docs = { jsDocTags: {} }) => ({
|
|
450
464
|
name: declared.componentName,
|
|
451
465
|
path: storyFilePath,
|
|
452
|
-
|
|
466
|
+
...docs,
|
|
453
467
|
error
|
|
454
468
|
});
|
|
455
469
|
try {
|
|
@@ -458,16 +472,20 @@ async function buildSubcomponentDocgen(csf, storyPath, storyFilePath, declared,
|
|
|
458
472
|
return failure(
|
|
459
473
|
unresolvedComponentError(resolved.reason, `meta.subcomponents.${declared.name}`)
|
|
460
474
|
);
|
|
461
|
-
let
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
475
|
+
let componentDocs = readComponentDocs(resolved.component), docs = extractComponentDescription(
|
|
476
|
+
void 0,
|
|
477
|
+
componentDocs?.description,
|
|
478
|
+
componentDocs?.tags
|
|
479
|
+
), extracted = await extractVueComponentDocgen(
|
|
480
|
+
context,
|
|
481
|
+
resolved.component,
|
|
482
|
+
` (subcomponent "${declared.name}")`
|
|
483
|
+
);
|
|
484
|
+
return "error" in extracted ? failure(extracted.error, docs) : {
|
|
465
485
|
name: declared.componentName,
|
|
466
486
|
// Written like the story's index path, as in the other renderers, not as a machine path.
|
|
467
487
|
path: componentPathFromStory(storyFilePath, storyPath, extracted.path),
|
|
468
|
-
|
|
469
|
-
summary: extracted.summary,
|
|
470
|
-
jsDocTags: extracted.jsDocTags,
|
|
488
|
+
...docs,
|
|
471
489
|
argTypes: extracted.argTypes,
|
|
472
490
|
apiDescription: extracted.apiDescription,
|
|
473
491
|
renderer: "vue3"
|
|
@@ -479,7 +497,7 @@ async function buildSubcomponentDocgen(csf, storyPath, storyFilePath, declared,
|
|
|
479
497
|
});
|
|
480
498
|
}
|
|
481
499
|
}
|
|
482
|
-
async function
|
|
500
|
+
async function describeStoryComponent(input, context = {}) {
|
|
483
501
|
let storyFilePath = getStoryImportPathFromEntry(input.entry);
|
|
484
502
|
if (!storyFilePath)
|
|
485
503
|
return;
|
|
@@ -491,12 +509,7 @@ async function buildDocgenPayload(input, context) {
|
|
|
491
509
|
return;
|
|
492
510
|
throw error;
|
|
493
511
|
}
|
|
494
|
-
let fallbackName = componentNameFromTitle(input.entry.title),
|
|
495
|
-
id: getComponentIdFromEntry(input.entry),
|
|
496
|
-
name,
|
|
497
|
-
path: storyFilePath,
|
|
498
|
-
jsDocTags: {}
|
|
499
|
-
}), csf;
|
|
512
|
+
let fallbackName = componentNameFromTitle(input.entry.title), id = getComponentIdFromEntry(input.entry), csf;
|
|
500
513
|
try {
|
|
501
514
|
csf = loadCsf(storyFile, {
|
|
502
515
|
makeTitle: () => input.entry.title,
|
|
@@ -504,7 +517,7 @@ async function buildDocgenPayload(input, context) {
|
|
|
504
517
|
}).parse();
|
|
505
518
|
} catch (error) {
|
|
506
519
|
return {
|
|
507
|
-
|
|
520
|
+
docs: { id, name: fallbackName, path: storyFilePath, jsDocTags: {} },
|
|
508
521
|
error: {
|
|
509
522
|
name: "Story file could not be parsed",
|
|
510
523
|
message: `${error instanceof Error ? error.message : String(error)}
|
|
@@ -514,14 +527,19 @@ ${storyFile}`
|
|
|
514
527
|
}
|
|
515
528
|
};
|
|
516
529
|
}
|
|
517
|
-
let authoredComponentName = getUsableComponentName(csf._meta?.component),
|
|
530
|
+
let authoredComponentName = getUsableComponentName(csf._meta?.component), metaJsDoc = extractDescription(csf._metaStatement, csf.editor) || void 0, resolved = resolveMetaComponent(csf, storyPath);
|
|
518
531
|
if ("reason" in resolved) {
|
|
519
532
|
let error = unresolvedComponentError(
|
|
520
533
|
resolved.reason,
|
|
521
534
|
resolved.reason === "no-meta-component" ? "your story file" : "meta.component"
|
|
522
535
|
);
|
|
523
536
|
return {
|
|
524
|
-
|
|
537
|
+
docs: {
|
|
538
|
+
id,
|
|
539
|
+
name: authoredComponentName ?? fallbackName,
|
|
540
|
+
path: storyFilePath,
|
|
541
|
+
...extractComponentDescription(metaJsDoc, void 0)
|
|
542
|
+
},
|
|
525
543
|
error: {
|
|
526
544
|
name: error.name,
|
|
527
545
|
message: (csf._metaStatement ? storyShapeError(error.message, csf._metaStatement, csf.editor).message : error.message) + `
|
|
@@ -531,8 +549,34 @@ ${storyFile}`
|
|
|
531
549
|
}
|
|
532
550
|
};
|
|
533
551
|
}
|
|
534
|
-
let { component } = resolved,
|
|
535
|
-
|
|
552
|
+
let { component } = resolved, componentDocs = readComponentDocs(component), exportedName = component.exportName === "default" ? parse(component.path).name : component.exportName;
|
|
553
|
+
return {
|
|
554
|
+
docs: {
|
|
555
|
+
id,
|
|
556
|
+
name: (authoredComponentName ?? exportedName) || fallbackName,
|
|
557
|
+
path: storyFilePath,
|
|
558
|
+
...extractComponentDescription(metaJsDoc, componentDocs?.description, componentDocs?.tags)
|
|
559
|
+
},
|
|
560
|
+
csf,
|
|
561
|
+
storyPath,
|
|
562
|
+
storyFilePath,
|
|
563
|
+
component
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
async function buildBasicDocgen(input, context = {}) {
|
|
567
|
+
let described = await describeStoryComponent(input, context);
|
|
568
|
+
if (described)
|
|
569
|
+
return "error" in described ? { ...described.docs, error: described.error } : described.docs;
|
|
570
|
+
}
|
|
571
|
+
async function buildDocgenPayload(input, context) {
|
|
572
|
+
let described = await describeStoryComponent(input, context);
|
|
573
|
+
if (!described)
|
|
574
|
+
return;
|
|
575
|
+
let { docs } = described;
|
|
576
|
+
if ("error" in described)
|
|
577
|
+
return { ...docs, error: described.error };
|
|
578
|
+
let { csf, storyPath, storyFilePath, component } = described, [primaryDocgen, subcomponentEntries] = await Promise.all([
|
|
579
|
+
extractVueComponentDocgen(context, component),
|
|
536
580
|
Promise.all(
|
|
537
581
|
extractDeclaredSubcomponents(csf).map(
|
|
538
582
|
async (declaredSubcomponent) => [
|
|
@@ -548,11 +592,8 @@ ${storyFile}`
|
|
|
548
592
|
)
|
|
549
593
|
).then((entries) => Object.fromEntries(entries))
|
|
550
594
|
]);
|
|
551
|
-
return "error" in primaryDocgen ? { ...
|
|
552
|
-
...
|
|
553
|
-
description: primaryDocgen.description,
|
|
554
|
-
summary: primaryDocgen.summary,
|
|
555
|
-
jsDocTags: primaryDocgen.jsDocTags,
|
|
595
|
+
return "error" in primaryDocgen ? { ...docs, error: primaryDocgen.error } : {
|
|
596
|
+
...docs,
|
|
556
597
|
vueComponentMeta: primaryDocgen.componentMeta,
|
|
557
598
|
argTypes: primaryDocgen.argTypes,
|
|
558
599
|
apiDescription: primaryDocgen.apiDescription,
|
|
@@ -565,5 +606,6 @@ export {
|
|
|
565
606
|
extractArgTypes,
|
|
566
607
|
buildApiDescription,
|
|
567
608
|
createNamedTypeDetailResolver,
|
|
609
|
+
buildBasicDocgen,
|
|
568
610
|
buildDocgenPayload
|
|
569
611
|
};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// src/docgen/component-docgen/component-meta/component-meta.ts
|
|
2
2
|
import { readFile, stat } from "node:fs/promises";
|
|
3
|
-
import { join as join2, parse as parse2 } from "node:path";
|
|
3
|
+
import { isAbsolute as isAbsolute2, join as join2, parse as parse2, resolve as resolve2 } from "node:path";
|
|
4
4
|
import { getProjectRoot } from "storybook/internal/common";
|
|
5
|
-
import {
|
|
6
|
-
extractComponentJsDocInfo,
|
|
7
|
-
resolveExportedSymbol
|
|
8
|
-
} from "storybook/internal/component-meta";
|
|
9
5
|
|
|
10
6
|
// ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
11
7
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
@@ -92,7 +88,7 @@ async function createVueComponentMetaChecker(tsconfigPath = "tsconfig.json") {
|
|
|
92
88
|
let projectRoot = getProjectRoot(), projectTsConfigPath = join2(projectRoot, tsconfigPath), defaultChecker = createCheckerByJson(projectRoot, { include: ["**/*"] }, CHECKER_OPTIONS);
|
|
93
89
|
return await fileExists(projectTsConfigPath) ? (await getTsConfigReferences(projectTsConfigPath)).length > 0 ? defaultChecker : createChecker(projectTsConfigPath, CHECKER_OPTIONS) : defaultChecker;
|
|
94
90
|
}
|
|
95
|
-
async function collectComponentMetaSources(checker, id
|
|
91
|
+
async function collectComponentMetaSources(checker, id) {
|
|
96
92
|
let entries = [];
|
|
97
93
|
for (let name of checker.getExportNames(id)) {
|
|
98
94
|
let meta;
|
|
@@ -100,22 +96,19 @@ async function collectComponentMetaSources(checker, id, typescript) {
|
|
|
100
96
|
meta = checker.getComponentMeta(id, name);
|
|
101
97
|
} catch {
|
|
102
98
|
}
|
|
103
|
-
meta && entries.push({
|
|
104
|
-
name,
|
|
105
|
-
meta,
|
|
106
|
-
jsDocInfo: typescript ? extractVueComponentJsDocInfo(typescript, checker, id, name) : void 0
|
|
107
|
-
});
|
|
99
|
+
meta && entries.push({ name, meta });
|
|
108
100
|
}
|
|
109
101
|
if (entries.length === 0)
|
|
110
102
|
return [];
|
|
111
103
|
let typeParams = await extractVueSfcTypeParams(id), fixedComponentsMeta = await applyVueDocgenApiTempFixes(
|
|
112
104
|
id,
|
|
113
105
|
entries.map((entry) => entry.meta),
|
|
114
|
-
entries.map((entry) => entry.name)
|
|
106
|
+
entries.map((entry) => entry.name),
|
|
107
|
+
getVueDocgenApiOptions(checker)
|
|
115
108
|
);
|
|
116
109
|
entries = entries.map((entry, index) => ({ ...entry, meta: fixedComponentsMeta[index] }));
|
|
117
110
|
let metaSources = [];
|
|
118
|
-
return entries.forEach(({ name, meta
|
|
111
|
+
return entries.forEach(({ name, meta }) => {
|
|
119
112
|
if (!meta.props.length && !meta.events.length && !meta.slots.length && !meta.exposed.length || meta.type === TypeMeta.Unknown)
|
|
120
113
|
return;
|
|
121
114
|
["props", "events", "slots", "exposed"].forEach((key) => {
|
|
@@ -134,12 +127,12 @@ async function collectComponentMetaSources(checker, id, typescript) {
|
|
|
134
127
|
exportName: name,
|
|
135
128
|
displayName: name === "default" ? getFilenameWithoutExtension(id) : name,
|
|
136
129
|
typeParams,
|
|
137
|
-
|
|
130
|
+
// Not spread: the `description` of the meta is a getter that reads the docblock.
|
|
131
|
+
name: meta.name,
|
|
132
|
+
type: meta.type,
|
|
138
133
|
props: meta.props.filter(isDocumented),
|
|
139
134
|
events: meta.events.filter(isDocumented),
|
|
140
135
|
slots: meta.slots.filter(isDocumented),
|
|
141
|
-
description: jsDocInfo?.description,
|
|
142
|
-
jsDocTags: jsDocInfo?.jsDocTags,
|
|
143
136
|
exposed: exposed.filter(isDocumented),
|
|
144
137
|
sourceFiles: relative(process.cwd(), id)
|
|
145
138
|
})
|
|
@@ -162,14 +155,6 @@ async function extractVueSfcTypeParams(id) {
|
|
|
162
155
|
return;
|
|
163
156
|
}
|
|
164
157
|
}
|
|
165
|
-
function extractVueComponentJsDocInfo(typescript, checker, id, exportName) {
|
|
166
|
-
let program = checker.getProgram(), sourceFile = program?.getSourceFile(id.replace(/\\/g, "/"));
|
|
167
|
-
if (!program || !sourceFile)
|
|
168
|
-
return;
|
|
169
|
-
let typeChecker = program.getTypeChecker(), symbol = resolveExportedSymbol(typescript, typeChecker, sourceFile, exportName);
|
|
170
|
-
if (symbol)
|
|
171
|
-
return extractComponentJsDocInfo(typescript, typeChecker, symbol);
|
|
172
|
-
}
|
|
173
158
|
function getFilenameWithoutExtension(filename) {
|
|
174
159
|
return parse2(filename).name;
|
|
175
160
|
}
|
|
@@ -183,12 +168,34 @@ async function fileExists(fullPath) {
|
|
|
183
168
|
return !1;
|
|
184
169
|
}
|
|
185
170
|
}
|
|
186
|
-
|
|
171
|
+
function getVueDocgenApiOptions(checker) {
|
|
172
|
+
try {
|
|
173
|
+
let alias = getVueDocgenApiAliases(checker.getProgram()?.getCompilerOptions());
|
|
174
|
+
return alias ? { alias } : void 0;
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function getVueDocgenApiAliases(compilerOptions) {
|
|
180
|
+
let paths = compilerOptions?.paths, basePath = compilerOptions?.baseUrl ?? compilerOptions?.pathsBasePath;
|
|
181
|
+
if (!paths || !basePath)
|
|
182
|
+
return;
|
|
183
|
+
let aliases = {};
|
|
184
|
+
for (let [pattern, targets] of Object.entries(paths)) {
|
|
185
|
+
let target = targets[0];
|
|
186
|
+
if (!pattern.endsWith("/*") || !target?.endsWith("/*"))
|
|
187
|
+
continue;
|
|
188
|
+
let aliasKey = pattern.slice(0, -2), targetDir = target.slice(0, -2);
|
|
189
|
+
!aliasKey || aliasKey.includes("*") || targetDir.includes("*") || (aliases[aliasKey] = isAbsolute2(targetDir) ? targetDir : resolve2(basePath, targetDir));
|
|
190
|
+
}
|
|
191
|
+
return Object.keys(aliases).length > 0 ? aliases : void 0;
|
|
192
|
+
}
|
|
193
|
+
async function applyVueDocgenApiTempFixes(filename, componentsMeta, exportNames, docgenOptions) {
|
|
187
194
|
let source = await readVueDocgenApiFallbackSource(filename), hasEvents = componentsMeta.some((meta) => meta.events.length > 0), needsEventRestore = hasRuntimeEmitsDeclaration(source), needsSlots = hasTemplateSlotGap(filename, componentsMeta, source);
|
|
188
195
|
if (!hasEvents && !needsEventRestore && !needsSlots)
|
|
189
196
|
return componentsMeta;
|
|
190
197
|
try {
|
|
191
|
-
let parsedComponentDocs = await
|
|
198
|
+
let parsedComponentDocs = await parseMultiForFallback(filename, docgenOptions), parsedByExportName = new Map(parsedComponentDocs.map((doc) => [doc.exportName, doc]));
|
|
192
199
|
componentsMeta.forEach((meta, index) => {
|
|
193
200
|
let parsed = parsedByExportName.get(exportNames[index]);
|
|
194
201
|
parsed && ((hasEvents || needsEventRestore) && mergeEventDescriptions(meta, parsed.events), needsEventRestore && restoreMissingRuntimeEvents(meta, parsed.events), needsSlots && mergeTemplateSlots(meta, parsed.slots, source));
|
|
@@ -197,6 +204,14 @@ async function applyVueDocgenApiTempFixes(filename, componentsMeta, exportNames)
|
|
|
197
204
|
}
|
|
198
205
|
return componentsMeta;
|
|
199
206
|
}
|
|
207
|
+
var isParsableTypeSource = (fullFilePath) => !/[\\/]node_modules[\\/]/.test(fullFilePath) && !fullFilePath.endsWith(".vue");
|
|
208
|
+
async function parseMultiForFallback(filename, docgenOptions) {
|
|
209
|
+
try {
|
|
210
|
+
return await parseMulti(filename, docgenOptions);
|
|
211
|
+
} catch {
|
|
212
|
+
return parseMulti(filename, { ...docgenOptions, validExtends: isParsableTypeSource });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
200
215
|
async function readVueDocgenApiFallbackSource(filename) {
|
|
201
216
|
if (/\.(?:vue|tsx?|jsx?)$/.test(filename))
|
|
202
217
|
try {
|
|
@@ -300,5 +315,6 @@ export {
|
|
|
300
315
|
CHECKER_OPTIONS,
|
|
301
316
|
createVueComponentMetaChecker,
|
|
302
317
|
collectComponentMetaSources,
|
|
318
|
+
getVueDocgenApiAliases,
|
|
303
319
|
applyVueDocgenApiTempFixes
|
|
304
320
|
};
|
|
@@ -2,11 +2,13 @@ import {
|
|
|
2
2
|
CHECKER_OPTIONS,
|
|
3
3
|
applyVueDocgenApiTempFixes,
|
|
4
4
|
collectComponentMetaSources,
|
|
5
|
-
createVueComponentMetaChecker
|
|
6
|
-
|
|
5
|
+
createVueComponentMetaChecker,
|
|
6
|
+
getVueDocgenApiAliases
|
|
7
|
+
} from "./chunk-YPMEPZAF.js";
|
|
7
8
|
export {
|
|
8
9
|
CHECKER_OPTIONS,
|
|
9
10
|
applyVueDocgenApiTempFixes,
|
|
10
11
|
collectComponentMetaSources,
|
|
11
|
-
createVueComponentMetaChecker
|
|
12
|
+
createVueComponentMetaChecker,
|
|
13
|
+
getVueDocgenApiAliases
|
|
12
14
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentMeta, ComponentMetaChecker, MetaCheckerOptions } from "vue-component-meta";
|
|
2
|
+
import { DocGenOptions } from "vue-docgen-api";
|
|
2
3
|
import ts from "typescript";
|
|
3
4
|
|
|
4
5
|
//#region code/renderers/vue3/.dts-emit/code/renderers/vue3/src/docgen/component-docgen/component-meta/component-meta.d.ts
|
|
@@ -10,8 +11,7 @@ type MetaSource = {
|
|
|
10
11
|
displayName: string; /** Component-level TypeScript type parameters declared by the SFC. */
|
|
11
12
|
typeParams?: string;
|
|
12
13
|
sourceFiles: string;
|
|
13
|
-
|
|
14
|
-
} & Serializable<ComponentMeta> & MetaCheckerOptions['schema'];
|
|
14
|
+
} & Serializable<Omit<ComponentMeta, 'description'>> & MetaCheckerOptions['schema'];
|
|
15
15
|
/** Checker options shared by every path so legacy and server extraction produce identical meta. */
|
|
16
16
|
declare const CHECKER_OPTIONS: MetaCheckerOptions;
|
|
17
17
|
/**
|
|
@@ -25,7 +25,7 @@ declare function createVueComponentMetaChecker(tsconfigPath?: string): Promise<C
|
|
|
25
25
|
* Exports whose meta is empty or of an unknown type are dropped, so a file with one non-component
|
|
26
26
|
* export cannot suppress the docgen of its siblings.
|
|
27
27
|
*/
|
|
28
|
-
declare function collectComponentMetaSources(checker: ComponentMetaChecker, id: string
|
|
28
|
+
declare function collectComponentMetaSources(checker: ComponentMetaChecker, id: string): Promise<MetaSource[]>;
|
|
29
29
|
/**
|
|
30
30
|
* Fills the gaps Volar cannot extract yet from a `vue-docgen-api` parse of the same file:
|
|
31
31
|
*
|
|
@@ -39,6 +39,6 @@ declare function collectComponentMetaSources(checker: ComponentMetaChecker, id:
|
|
|
39
39
|
* actually present in the extracted meta. Delete each merge once Volar covers it, and uninstall
|
|
40
40
|
* the vue-docgen-api dependency when both are gone.
|
|
41
41
|
*/
|
|
42
|
-
declare function applyVueDocgenApiTempFixes(filename: string, componentsMeta: ComponentMeta[], exportNames: string[]): Promise<ComponentMeta[]>;
|
|
42
|
+
declare function applyVueDocgenApiTempFixes(filename: string, componentsMeta: ComponentMeta[], exportNames: string[], docgenOptions?: DocGenOptions): Promise<ComponentMeta[]>;
|
|
43
43
|
//#endregion
|
|
44
44
|
export { createVueComponentMetaChecker as a, collectComponentMetaSources as i, MetaSource as n, applyVueDocgenApiTempFixes as r, CHECKER_OPTIONS as t };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildBasicDocgen,
|
|
2
3
|
buildDocgenPayload
|
|
3
|
-
} from "../_node-chunks/chunk-
|
|
4
|
+
} from "../_node-chunks/chunk-IXYCOERX.js";
|
|
4
5
|
import "../_node-chunks/chunk-B2AO4N3K.js";
|
|
5
6
|
import {
|
|
6
7
|
CHECKER_OPTIONS
|
|
7
|
-
} from "../_node-chunks/chunk-
|
|
8
|
+
} from "../_node-chunks/chunk-YPMEPZAF.js";
|
|
8
9
|
|
|
9
10
|
// src/docgen/docgen-worker.ts
|
|
10
11
|
import { createLazyDocgenMiddleware, loadTypeScriptCompilerApi } from "storybook/internal/common";
|
|
@@ -225,6 +226,7 @@ var createDocgenProvider = () => createLazyDocgenMiddleware({
|
|
|
225
226
|
return;
|
|
226
227
|
}
|
|
227
228
|
},
|
|
229
|
+
extractBasic: (input) => buildBasicDocgen(input),
|
|
228
230
|
extract: async (manager, input) => {
|
|
229
231
|
let ours = await buildDocgenPayload(input, {
|
|
230
232
|
getChecker: (componentPath) => manager.getCheckerForFile(componentPath),
|
package/dist/docgen/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as StoryContext$1 } from "../chunk-DIk4dpkW.js";
|
|
2
|
-
import { i as collectComponentMetaSources, n as MetaSource, r as applyVueDocgenApiTempFixes, t as CHECKER_OPTIONS } from "../chunk-
|
|
2
|
+
import { i as collectComponentMetaSources, n as MetaSource, r as applyVueDocgenApiTempFixes, t as CHECKER_OPTIONS } from "../chunk-CmSWgGT0.js";
|
|
3
3
|
import { DocgenPayload, DocgenProviderInput, StoryDocsPayload, StoryDocsProviderInput, StrictArgTypes } from "storybook/internal/types";
|
|
4
4
|
import { ComponentMetaChecker } from "vue-component-meta";
|
|
5
5
|
import ts from "typescript";
|
package/dist/docgen/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStoryDocsPayload
|
|
3
|
-
} from "../_node-chunks/chunk-
|
|
3
|
+
} from "../_node-chunks/chunk-FEPCDEC2.js";
|
|
4
4
|
import {
|
|
5
5
|
buildApiDescription,
|
|
6
6
|
buildDocgenPayload,
|
|
7
7
|
createNamedTypeDetailResolver,
|
|
8
8
|
extractArgTypes
|
|
9
|
-
} from "../_node-chunks/chunk-
|
|
9
|
+
} from "../_node-chunks/chunk-IXYCOERX.js";
|
|
10
10
|
import "../_node-chunks/chunk-B2AO4N3K.js";
|
|
11
11
|
import {
|
|
12
12
|
CHECKER_OPTIONS,
|
|
13
13
|
applyVueDocgenApiTempFixes,
|
|
14
14
|
collectComponentMetaSources
|
|
15
|
-
} from "../_node-chunks/chunk-
|
|
15
|
+
} from "../_node-chunks/chunk-YPMEPZAF.js";
|
|
16
16
|
|
|
17
17
|
// src/docgen/story-docs/source-decorator/sourceDecorator.ts
|
|
18
18
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../_browser-chunks/chunk-
|
|
1
|
+
import "../_browser-chunks/chunk-FTNLYRVC.js";
|
|
2
2
|
import "../_browser-chunks/chunk-4BE7D4DS.js";
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
entry_preview_docs_exports
|
|
8
8
|
} from "./_browser-chunks/chunk-SERTEPAZ.js";
|
|
9
|
-
import "./_browser-chunks/chunk-
|
|
9
|
+
import "./_browser-chunks/chunk-FTNLYRVC.js";
|
|
10
10
|
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
11
11
|
|
|
12
12
|
// src/globals.ts
|
package/dist/preset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createVueComponentMetaChecker, i as collectComponentMetaSources } from "./chunk-
|
|
1
|
+
import { a as createVueComponentMetaChecker, i as collectComponentMetaSources } from "./chunk-CmSWgGT0.js";
|
|
2
2
|
import { DocgenProviderDescriptor, IndexEntry, Options, PresetProperty, PresetPropertyFn, StorybookConfigRaw } from "storybook/internal/types";
|
|
3
3
|
import { parse } from "vue-docgen-api";
|
|
4
4
|
import { ImportParser } from "storybook/internal/core-server";
|
package/dist/preset.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStoryDocsPayload
|
|
3
|
-
} from "./_node-chunks/chunk-
|
|
3
|
+
} from "./_node-chunks/chunk-FEPCDEC2.js";
|
|
4
4
|
import "./_node-chunks/chunk-B2AO4N3K.js";
|
|
5
5
|
|
|
6
6
|
// src/preset.ts
|
|
@@ -38,7 +38,7 @@ var experimental_storyDocsProvider = createWorkerGatedStoryDocsProvider({
|
|
|
38
38
|
|
|
39
39
|
// src/docgen/engine.ts
|
|
40
40
|
var experimental_vueDocgenEngine = async () => ({
|
|
41
|
-
componentMeta: () => import("./_node-chunks/component-meta-
|
|
41
|
+
componentMeta: () => import("./_node-chunks/component-meta-H4SIVDTW.js"),
|
|
42
42
|
vueDocgenApi: () => import("./_node-chunks/vue-docgen-api-IRJAMTGH.js")
|
|
43
43
|
});
|
|
44
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/vue3",
|
|
3
|
-
"version": "11.0.0
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Storybook Vue 3 renderer: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"vue-tsc": "latest"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"storybook": "^11.0.0
|
|
74
|
+
"storybook": "^11.0.0",
|
|
75
75
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
76
76
|
"vue": "^3.0.0"
|
|
77
77
|
},
|