executable-stories-react 0.1.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/README.md +238 -0
- package/dist/index.cjs +1021 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +202 -0
- package/dist/index.d.ts +202 -0
- package/dist/index.js +964 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.cjs +846 -0
- package/dist/interactive.cjs.map +1 -0
- package/dist/interactive.d.cts +116 -0
- package/dist/interactive.d.ts +116 -0
- package/dist/interactive.js +820 -0
- package/dist/interactive.js.map +1 -0
- package/dist/parse.cjs +495 -0
- package/dist/parse.cjs.map +1 -0
- package/dist/parse.d.cts +51 -0
- package/dist/parse.d.ts +51 -0
- package/dist/parse.js +464 -0
- package/dist/parse.js.map +1 -0
- package/dist/styles.css +244 -0
- package/package.json +84 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactive/ReportInteractive.tsx","../src/context/ReportRoot.tsx","../src/context/ReportContext.ts","../src/hooks/useReport.ts","../src/components/ReportSummary.tsx","../src/components/doc/DocNote.tsx","../src/components/doc/DocTag.tsx","../src/components/doc/DocKv.tsx","../src/hooks/useRenderers.ts","../src/components/doc/DocCode.tsx","../src/components/doc/DocTable.tsx","../src/components/doc/DocLink.tsx","../src/components/doc/DocSection.tsx","../src/components/doc/DocMermaid.tsx","../src/components/doc/DocScreenshot.tsx","../src/components/doc/DocCustom.tsx","../src/components/doc/DocEntry.tsx","../src/components/ReportDocEntries.tsx","../src/components/ReportSteps.tsx","../src/components/ReportScenario.tsx","../src/components/ReportScenarioList.tsx","../src/components/ReportFeature.tsx","../src/components/ReportFeatureList.tsx","../src/components/ReportEmpty.tsx","../src/components/ReportSchemaError.tsx","../src/interactive/ReportSearch.tsx","../src/interactive/ReportFailureBanner.tsx","../src/interactive/ReportShortcutsHelp.tsx","../src/interactive/use-keyboard-shortcuts.ts","../src/interactive/use-deep-link-scroll.ts","../src/interactive/filter.ts"],"sourcesContent":["\"use client\";\n\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { Result } from \"../result\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportRoot } from \"../context/ReportRoot\";\nimport { ReportSummary } from \"../components/ReportSummary\";\nimport { ReportFeatureList } from \"../components/ReportFeatureList\";\nimport { ReportEmpty } from \"../components/ReportEmpty\";\nimport { ReportSchemaError } from \"../components/ReportSchemaError\";\nimport { ReportSearch } from \"./ReportSearch\";\nimport { ReportFailureBanner } from \"./ReportFailureBanner\";\nimport { ReportShortcutsHelp } from \"./ReportShortcutsHelp\";\nimport { useKeyboardShortcuts } from \"./use-keyboard-shortcuts\";\nimport { useDeepLinkScroll } from \"./use-deep-link-scroll\";\nimport { filterReport, listFailures } from \"./filter\";\n\nexport interface ReportInteractiveProps {\n /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */\n report: StoryReport | Result<StoryReport>;\n /** Renderers keyed by `story.custom({ type })` strings. */\n customRenderers?: CustomRenderers;\n /** Optional overrides for the heavy built-ins (mermaid, code, section). */\n renderers?: BuiltinRenderers;\n className?: string;\n title?: string;\n dataTheme?: \"light\" | \"dark\";\n}\n\nfunction isResult(value: ReportInteractiveProps[\"report\"]): value is Result<StoryReport> {\n return typeof value === \"object\"\n && value !== null\n && \"ok\" in (value as object)\n && typeof (value as { ok: unknown }).ok === \"boolean\";\n}\n\nexport function ReportInteractive(props: ReportInteractiveProps) {\n const { report, className, title, dataTheme } = props;\n\n if (isResult(report)) {\n if (!report.ok) {\n return (\n <main\n className={[\"es-report\", className].filter(Boolean).join(\" \")}\n aria-label={title ?? \"Test report\"}\n data-theme={dataTheme}\n >\n <ReportSchemaError error={report.error} />\n </main>\n );\n }\n return <ReportInteractiveView {...props} report={report.data} />;\n }\n\n return <ReportInteractiveView {...props} report={report} />;\n}\n\ninterface ReportInteractiveViewProps extends Omit<ReportInteractiveProps, \"report\"> {\n report: StoryReport;\n}\n\nfunction ReportInteractiveView({\n report,\n customRenderers,\n renderers,\n className,\n title,\n dataTheme,\n}: ReportInteractiveViewProps) {\n const [query, setQuery] = useState(\"\");\n const [helpOpen, setHelpOpen] = useState(false);\n const searchRef = useRef<HTMLInputElement>(null);\n const failures = useMemo(() => listFailures(report), [report]);\n const filtered = useMemo(() => filterReport(report, query), [report, query]);\n const failureIndexRef = useRef(0);\n\n const focusSearch = useCallback(() => {\n searchRef.current?.focus();\n }, []);\n\n const scrollToScenario = useCallback((scenarioId: string) => {\n if (typeof document === \"undefined\") return;\n const el = document.getElementById(scenarioId);\n if (!el) return;\n el.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n if (typeof history !== \"undefined\") {\n history.replaceState(null, \"\", `#${scenarioId}`);\n }\n }, []);\n\n const stepFailure = useCallback(\n (direction: 1 | -1) => {\n if (failures.length === 0) return;\n failureIndexRef.current =\n (failureIndexRef.current + direction + failures.length) % failures.length;\n const target = failures[failureIndexRef.current];\n if (target) scrollToScenario(target.scenarioId);\n },\n [failures, scrollToScenario],\n );\n\n const toggleHelp = useCallback(() => {\n setHelpOpen((v) => !v);\n }, []);\n\n const escape = useCallback(() => {\n if (helpOpen) setHelpOpen(false);\n else if (query !== \"\") setQuery(\"\");\n }, [helpOpen, query]);\n\n useKeyboardShortcuts({\n onFocusSearch: focusSearch,\n onNextFailure: () => stepFailure(1),\n onPrevFailure: () => stepFailure(-1),\n onToggleHelp: toggleHelp,\n onEscape: escape,\n });\n\n useDeepLinkScroll();\n\n const hasContent = filtered.features.length > 0;\n const totalScenarios = report.summary.total;\n const matchedScenarios = filtered.summary.total;\n\n return (\n <ReportRoot\n report={filtered}\n customRenderers={customRenderers}\n renderers={renderers}\n >\n <main\n className={[\"es-report\", \"es-report-interactive\", className].filter(Boolean).join(\" \")}\n aria-label={title ?? \"Test report\"}\n data-theme={dataTheme}\n >\n <header className=\"es-report-header\">\n <h1>{title ?? \"Story Report\"}</h1>\n <ReportSummary />\n <ReportSearch\n ref={searchRef}\n value={query}\n onChange={setQuery}\n matchedCount={matchedScenarios}\n totalCount={totalScenarios}\n />\n </header>\n <ReportFailureBanner failures={failures} />\n {hasContent ? <ReportFeatureList /> : <ReportEmpty message={query ? \"No scenarios match the search.\" : undefined} />}\n <button\n type=\"button\"\n className=\"es-shortcuts-trigger\"\n aria-label=\"Keyboard shortcuts\"\n aria-keyshortcuts=\"Shift+?\"\n onClick={toggleHelp}\n >\n ?\n </button>\n <ReportShortcutsHelp open={helpOpen} onClose={() => setHelpOpen(false)} />\n </main>\n </ReportRoot>\n );\n}\n","import { useMemo, type ReactNode } from \"react\";\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportContext, type ReportContextValue } from \"./ReportContext\";\n\nexport interface ReportRootProps {\n report: StoryReport;\n customRenderers?: CustomRenderers;\n renderers?: BuiltinRenderers;\n children: ReactNode;\n}\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function ReportRoot({\n report,\n customRenderers,\n renderers,\n children,\n}: ReportRootProps) {\n const value = useMemo<ReportContextValue>(\n () => ({\n report,\n customRenderers: customRenderers ?? EMPTY_CUSTOM,\n renderers: renderers ?? EMPTY_RENDERERS,\n }),\n [report, customRenderers, renderers],\n );\n return <ReportContext.Provider value={value}>{children}</ReportContext.Provider>;\n}\n","import { createContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nexport interface ReportContextValue {\n report: StoryReport;\n customRenderers: CustomRenderers;\n renderers: BuiltinRenderers;\n}\n\nexport const ReportContext = createContext<ReportContextValue | null>(null);\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\n\nexport function useReport() {\n const ctx = useContext(ReportContext);\n if (!ctx) {\n throw new Error(\n \"useReport must be used inside <ReportRoot> or <Report>. Wrap your tree with one of those.\",\n );\n }\n return ctx.report;\n}\n","import type { ReportSummary as ReportSummaryT } from \"executable-stories-formatters\";\nimport { useReport } from \"../hooks/useReport\";\n\nexport interface ReportSummaryProps {\n className?: string;\n}\n\nexport function ReportSummary({ className }: ReportSummaryProps) {\n const report = useReport();\n return (\n <ReportSummaryView\n summary={report.summary}\n {...(className !== undefined && { className })}\n ariaLabel=\"Run summary\"\n />\n );\n}\n\nexport interface ReportSummaryViewProps {\n summary: ReportSummaryT;\n className?: string;\n ariaLabel?: string;\n}\n\nexport function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps) {\n return (\n <p\n className={[\"es-report-summary\", className].filter(Boolean).join(\" \")}\n aria-label={ariaLabel}\n >\n <span>\n <strong>{summary.total}</strong> scenario{summary.total === 1 ? \"\" : \"s\"}\n </span>\n {\" · \"}\n <span data-status=\"passed\">{summary.passed} passed</span>\n {\" · \"}\n <span data-status=\"failed\">{summary.failed} failed</span>\n {summary.skipped > 0 ? (\n <>\n {\" · \"}\n <span data-status=\"skipped\">{summary.skipped} skipped</span>\n </>\n ) : null}\n {summary.pending > 0 ? (\n <>\n {\" · \"}\n <span data-status=\"pending\">{summary.pending} pending</span>\n </>\n ) : null}\n </p>\n );\n}\n","import type { ReportDocNote } from \"executable-stories-formatters\";\n\nexport function DocNote({ entry }: { entry: ReportDocNote }) {\n return <p className=\"es-doc es-doc-note\">{entry.text}</p>;\n}\n","import type { ReportDocTag } from \"executable-stories-formatters\";\n\nexport function DocTag({ entry }: { entry: ReportDocTag }) {\n return (\n <ul className=\"es-doc es-tags\" aria-label=\"Tags\">\n {entry.names.map((n) => (\n <li key={n}>{n}</li>\n ))}\n </ul>\n );\n}\n","import type { ReportDocKv } from \"executable-stories-formatters\";\n\nfunction formatValue(value: unknown): string {\n if (value === null) return \"null\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport function DocKv({ entry }: { entry: ReportDocKv }) {\n return (\n <dl className=\"es-doc es-doc-kv\">\n <dt>{entry.label}</dt>\n <dd>{formatValue(entry.value)}</dd>\n </dl>\n );\n}\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function useCustomRenderers(): CustomRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.customRenderers ?? EMPTY_CUSTOM;\n}\n\nexport function useBuiltinRenderers(): BuiltinRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.renderers ?? EMPTY_RENDERERS;\n}\n","import type { ReportDocCode } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCode({ entry }: { entry: ReportDocCode }) {\n const renderers = useBuiltinRenderers();\n if (renderers.code) {\n return <>{renderers.code(entry)}</>;\n }\n return (\n <figure className=\"es-doc es-doc-code\">\n <figcaption>{entry.label}</figcaption>\n <pre>\n <code className={entry.lang ? `language-${entry.lang}` : undefined}>\n {entry.content}\n </code>\n </pre>\n </figure>\n );\n}\n","import type { ReportDocTable } from \"executable-stories-formatters\";\n\nexport function DocTable({ entry }: { entry: ReportDocTable }) {\n return (\n <figure className=\"es-doc es-doc-table\">\n <figcaption>{entry.label}</figcaption>\n <table>\n <thead>\n <tr>\n {entry.columns.map((c) => (\n <th key={c} scope=\"col\">{c}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {entry.rows.map((row, i) => (\n <tr key={i}>\n {row.map((cell, j) => (\n <td key={j}>{cell}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </figure>\n );\n}\n","import type { ReportDocLink } from \"executable-stories-formatters\";\n\nexport function DocLink({ entry }: { entry: ReportDocLink }) {\n return (\n <a\n className=\"es-doc es-doc-link\"\n href={entry.url}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n >\n {entry.label}\n </a>\n );\n}\n","import { marked } from \"marked\";\nimport type { ReportDocSection } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * Strips the most common dangerous patterns from marked-generated HTML:\n * - <script>...</script> blocks\n * - <style>...</style> blocks\n * - on* event-handler attributes\n * - javascript: URLs on href / src\n *\n * Not a substitute for a full HTML sanitizer (DOMPurify, sanitize-html).\n * For high-untrust input, supply `renderers.section` with your own sanitizer.\n */\nfunction safeMarkdownHtml(markdown: string): string {\n const raw = marked.parse(markdown, { async: false }) as string;\n return raw\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi, \"\")\n .replace(/<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*\"[^\"]*\"/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*'[^']*'/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*[^\\s>]+/gi, \"\")\n .replace(/(href|src)\\s*=\\s*\"\\s*javascript:[^\"]*\"/gi, '$1=\"#\"')\n .replace(/(href|src)\\s*=\\s*'\\s*javascript:[^']*'/gi, \"$1='#'\");\n}\n\nexport function DocSection({ entry }: { entry: ReportDocSection }) {\n const renderers = useBuiltinRenderers();\n if (renderers.section) {\n return <>{renderers.section(entry)}</>;\n }\n const html = safeMarkdownHtml(entry.markdown);\n return (\n <section className=\"es-doc es-doc-section\" aria-label={entry.title}>\n {entry.title ? <h4 className=\"es-doc-section-title\">{entry.title}</h4> : null}\n <div\n className=\"es-doc-section-content\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </section>\n );\n}\n","import type { ReportDocMermaid } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * Renders mermaid source as a semantic <pre data-mermaid> by default.\n *\n * AI agents and screen readers get the raw source. To render the diagram\n * visually, supply a `renderers.mermaid` prop with a client-only component\n * (e.g., one that dynamically imports the mermaid library on mount).\n */\nexport function DocMermaid({ entry }: { entry: ReportDocMermaid }) {\n const renderers = useBuiltinRenderers();\n if (renderers.mermaid) {\n return <>{renderers.mermaid(entry)}</>;\n }\n return (\n <figure\n className=\"es-doc es-doc-mermaid\"\n aria-label={entry.title ?? \"Diagram\"}\n >\n {entry.title ? <figcaption>{entry.title}</figcaption> : null}\n <pre data-mermaid>{entry.code}</pre>\n </figure>\n );\n}\n","import type { ReportDocScreenshot } from \"executable-stories-formatters\";\n\nexport function DocScreenshot({ entry }: { entry: ReportDocScreenshot }) {\n return (\n <figure className=\"es-doc es-doc-screenshot\">\n <img src={entry.path} alt={entry.alt ?? \"\"} loading=\"lazy\" />\n {entry.alt ? <figcaption>{entry.alt}</figcaption> : null}\n </figure>\n );\n}\n","import type { ReportDocCustom } from \"executable-stories-formatters\";\nimport { useCustomRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCustom({ entry }: { entry: ReportDocCustom }) {\n const renderers = useCustomRenderers();\n const renderer = renderers[entry.type];\n if (renderer) {\n return <>{renderer(entry)}</>;\n }\n return (\n <div className=\"es-doc es-doc-custom\" data-type={entry.type}>\n <p className=\"es-doc-custom-type\">{entry.type}</p>\n <pre>{safeStringify(entry.data)}</pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-formatters\";\nimport { DocNote } from \"./DocNote\";\nimport { DocTag } from \"./DocTag\";\nimport { DocKv } from \"./DocKv\";\nimport { DocCode } from \"./DocCode\";\nimport { DocTable } from \"./DocTable\";\nimport { DocLink } from \"./DocLink\";\nimport { DocSection } from \"./DocSection\";\nimport { DocMermaid } from \"./DocMermaid\";\nimport { DocScreenshot } from \"./DocScreenshot\";\nimport { DocCustom } from \"./DocCustom\";\n\nexport function DocEntry({ entry }: { entry: ReportDocEntry }) {\n switch (entry.kind) {\n case \"note\":\n return <DocNote entry={entry} />;\n case \"tag\":\n return <DocTag entry={entry} />;\n case \"kv\":\n return <DocKv entry={entry} />;\n case \"code\":\n return <DocCode entry={entry} />;\n case \"table\":\n return <DocTable entry={entry} />;\n case \"link\":\n return <DocLink entry={entry} />;\n case \"section\":\n return <DocSection entry={entry} />;\n case \"mermaid\":\n return <DocMermaid entry={entry} />;\n case \"screenshot\":\n return <DocScreenshot entry={entry} />;\n case \"custom\":\n return <DocCustom entry={entry} />;\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-formatters\";\nimport { DocEntry } from \"./doc/DocEntry\";\n\nexport interface ReportDocEntriesProps {\n entries: readonly ReportDocEntry[];\n}\n\nexport function ReportDocEntries({ entries }: ReportDocEntriesProps) {\n if (entries.length === 0) return null;\n return (\n <>\n {entries.map((entry, i) => (\n <DocEntry key={i} entry={entry} />\n ))}\n </>\n );\n}\n","import type { ReportStep, ReportScenario } from \"executable-stories-formatters\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\n\nexport interface ReportStepsProps {\n scenario: ReportScenario;\n}\n\nexport function ReportSteps({ scenario }: ReportStepsProps) {\n if (scenario.steps.length === 0) return null;\n return (\n <ol className=\"es-steps\">\n {scenario.steps.map((step) => (\n <ReportStepItem key={step.id} step={step} />\n ))}\n </ol>\n );\n}\n\nexport function ReportStepItem({ step }: { step: ReportStep }) {\n return (\n <li\n id={step.id}\n className={`es-step es-step-${step.status}`}\n data-status={step.status}\n >\n <span className=\"es-step-keyword\">{step.keyword}</span>\n <span className=\"es-step-text\">{step.text}</span>\n {step.errorMessage ? (\n <pre className=\"es-scenario-error\" role=\"alert\">{step.errorMessage}</pre>\n ) : null}\n {step.docEntries.length > 0 ? (\n <div className=\"es-step-docs\">\n <ReportDocEntries entries={step.docEntries} />\n </div>\n ) : null}\n </li>\n );\n}\n","import type { ReportScenario as ReportScenarioT } from \"executable-stories-formatters\";\nimport { ReportSteps } from \"./ReportSteps\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\n\nexport interface ReportScenarioProps {\n scenario: ReportScenarioT;\n}\n\nconst STATUS_LABEL: Record<ReportScenarioT[\"status\"], string> = {\n passed: \"Passed\",\n failed: \"Failed\",\n skipped: \"Skipped\",\n pending: \"Pending\",\n};\n\nexport function ReportScenario({ scenario }: ReportScenarioProps) {\n const titleId = `${scenario.id}-title`;\n return (\n <article\n id={scenario.id}\n className={`es-scenario es-status-${scenario.status}`}\n aria-labelledby={titleId}\n data-status={scenario.status}\n >\n <h3 id={titleId} className=\"es-scenario-title\">\n <span>{scenario.title}</span>\n <span className=\"es-scenario-status\" aria-label={`Status: ${STATUS_LABEL[scenario.status]}`}>\n {STATUS_LABEL[scenario.status]}\n </span>\n </h3>\n {scenario.tags.length > 0 ? (\n <ul className=\"es-tags\" aria-label=\"Tags\">\n {scenario.tags.map((t) => (\n <li key={t}>{t}</li>\n ))}\n </ul>\n ) : null}\n {scenario.errorMessage ? (\n <pre className=\"es-scenario-error\" role=\"alert\">{scenario.errorMessage}</pre>\n ) : null}\n {scenario.docEntries.length > 0 ? (\n <div className=\"es-scenario-docs\">\n <ReportDocEntries entries={scenario.docEntries} />\n </div>\n ) : null}\n <ReportSteps scenario={scenario} />\n </article>\n );\n}\n","import type { ReportFeature } from \"executable-stories-formatters\";\nimport { ReportScenario } from \"./ReportScenario\";\n\nexport interface ReportScenarioListProps {\n feature: ReportFeature;\n}\n\nexport function ReportScenarioList({ feature }: ReportScenarioListProps) {\n return (\n <>\n {feature.scenarios.map((scenario) => (\n <ReportScenario key={scenario.id} scenario={scenario} />\n ))}\n </>\n );\n}\n","import type { ReportFeature as ReportFeatureT } from \"executable-stories-formatters\";\nimport { ReportScenarioList } from \"./ReportScenarioList\";\nimport { ReportSummaryView } from \"./ReportSummary\";\n\nexport interface ReportFeatureProps {\n feature: ReportFeatureT;\n}\n\nexport function ReportFeature({ feature }: ReportFeatureProps) {\n const titleId = `${feature.id}-title`;\n return (\n <section\n id={feature.id}\n className=\"es-feature\"\n aria-labelledby={titleId}\n >\n <h2 id={titleId} className=\"es-feature-title\">{feature.title}</h2>\n <p className=\"es-feature-source\">{feature.sourceFile}</p>\n <ReportSummaryView summary={feature.summary} className=\"es-feature-summary\" />\n <ReportScenarioList feature={feature} />\n </section>\n );\n}\n","import { useReport } from \"../hooks/useReport\";\nimport { ReportFeature } from \"./ReportFeature\";\n\nexport function ReportFeatureList() {\n const report = useReport();\n return (\n <>\n {report.features.map((feature) => (\n <ReportFeature key={feature.id} feature={feature} />\n ))}\n </>\n );\n}\n","export interface ReportEmptyProps {\n message?: string;\n}\n\nexport function ReportEmpty({ message }: ReportEmptyProps) {\n return (\n <section className=\"es-empty\" aria-live=\"polite\">\n <p>{message ?? \"No scenarios in this report.\"}</p>\n </section>\n );\n}\n","import type { ReportParseError } from \"../result\";\n\nexport interface ReportSchemaErrorProps {\n error: ReportParseError;\n}\n\nexport function ReportSchemaError({ error }: ReportSchemaErrorProps) {\n return (\n <section className=\"es-schema-error\" role=\"alert\" aria-live=\"assertive\">\n <p>\n <strong>Report could not be displayed.</strong>\n </p>\n <p>{error.message}</p>\n {error.code === \"SCHEMA_VERSION_MISMATCH\" ? (\n <p>\n The report bundle is newer than this version of <code>executable-stories-react</code>.\n Upgrade the package, or regenerate the report with an older formatters CLI.\n </p>\n ) : null}\n {error.issues && error.issues.length > 0 ? (\n <details>\n <summary>{error.issues.length} validation issue{error.issues.length === 1 ? \"\" : \"s\"}</summary>\n <pre>\n {error.issues\n .slice(0, 20)\n .map((i) => `${i.path}: ${i.message}`)\n .join(\"\\n\")}\n </pre>\n </details>\n ) : null}\n </section>\n );\n}\n","\"use client\";\n\nimport {\n forwardRef,\n useId,\n type ChangeEvent,\n type KeyboardEvent,\n} from \"react\";\n\nexport interface ReportSearchProps {\n value: string;\n onChange: (next: string) => void;\n matchedCount?: number;\n totalCount?: number;\n placeholder?: string;\n className?: string;\n}\n\nexport const ReportSearch = forwardRef<HTMLInputElement, ReportSearchProps>(\n function ReportSearch(props, ref) {\n const {\n value,\n onChange,\n matchedCount,\n totalCount,\n placeholder = \"Search scenarios, tags, or step text…\",\n className,\n } = props;\n const inputId = useId();\n const showCounts =\n typeof matchedCount === \"number\" && typeof totalCount === \"number\";\n\n function handleChange(e: ChangeEvent<HTMLInputElement>) {\n onChange(e.target.value);\n }\n\n function handleKeyDown(e: KeyboardEvent<HTMLInputElement>) {\n if (e.key === \"Escape\" && value !== \"\") {\n onChange(\"\");\n e.preventDefault();\n }\n }\n\n return (\n <div className={[\"es-search\", className].filter(Boolean).join(\" \")}>\n <label htmlFor={inputId} className=\"es-search-label\">\n Search\n </label>\n <input\n ref={ref}\n id={inputId}\n type=\"search\"\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n autoComplete=\"off\"\n spellCheck={false}\n aria-keyshortcuts=\"/\"\n />\n {showCounts ? (\n <span className=\"es-search-counts\" aria-live=\"polite\">\n {value\n ? `${matchedCount} of ${totalCount}`\n : `${totalCount} total`}\n </span>\n ) : null}\n </div>\n );\n },\n);\n","\"use client\";\n\nimport { useCallback } from \"react\";\nimport type { FailureRef } from \"./filter\";\n\nexport interface ReportFailureBannerProps {\n failures: readonly FailureRef[];\n}\n\nexport function ReportFailureBanner({ failures }: ReportFailureBannerProps) {\n const first = failures[0];\n\n const jumpToFirst = useCallback(() => {\n if (!first) return;\n if (typeof window === \"undefined\") return;\n const el = document.getElementById(first.scenarioId);\n el?.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n if (typeof history !== \"undefined\") {\n history.replaceState(null, \"\", `#${first.scenarioId}`);\n }\n }, [first]);\n\n if (failures.length === 0) return null;\n\n return (\n <aside\n className=\"es-failure-banner\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Failure summary\"\n >\n <span className=\"es-failure-banner-text\">\n <strong>{failures.length}</strong>{\" \"}\n failure{failures.length === 1 ? \"\" : \"s\"}\n </span>\n <button\n type=\"button\"\n className=\"es-failure-banner-jump\"\n onClick={jumpToFirst}\n aria-label=\"Jump to first failure\"\n >\n Jump to first ↓\n </button>\n </aside>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nexport interface ReportShortcutsHelpProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst SHORTCUTS: ReadonlyArray<{ keys: string; description: string }> = [\n { keys: \"/\", description: \"Focus search\" },\n { keys: \"f\", description: \"Jump to next failure\" },\n { keys: \"Shift+F\", description: \"Jump to previous failure\" },\n { keys: \"Esc\", description: \"Clear search / close dialog\" },\n { keys: \"?\", description: \"Toggle this help\" },\n];\n\nexport function ReportShortcutsHelp({ open, onClose }: ReportShortcutsHelpProps) {\n const dialogRef = useRef<HTMLDialogElement>(null);\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n if (open && !dialog.open) dialog.showModal();\n else if (!open && dialog.open) dialog.close();\n }, [open]);\n\n return (\n <dialog\n ref={dialogRef}\n className=\"es-shortcuts-help\"\n aria-label=\"Keyboard shortcuts\"\n onClose={onClose}\n >\n <h2>Keyboard shortcuts</h2>\n <dl>\n {SHORTCUTS.map((s) => (\n <div key={s.keys}>\n <dt>\n <kbd>{s.keys}</kbd>\n </dt>\n <dd>{s.description}</dd>\n </div>\n ))}\n </dl>\n <form method=\"dialog\">\n <button type=\"submit\" className=\"es-shortcuts-close\">Close</button>\n </form>\n </dialog>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nexport interface KeyboardShortcutHandlers {\n onFocusSearch?: () => void;\n onNextFailure?: () => void;\n onPrevFailure?: () => void;\n onToggleHelp?: () => void;\n onEscape?: () => void;\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n const tag = target.tagName;\n if (tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\") return true;\n if (target.isContentEditable) return true;\n return false;\n}\n\n/**\n * Attaches one keydown listener for the lifetime of the component, regardless\n * of how often the consumer passes a fresh handlers object. Handlers are read\n * from a ref so each keypress hits the latest version — see Vercel's\n * advanced-use-latest pattern.\n */\nexport function useKeyboardShortcuts(handlers: KeyboardShortcutHandlers): void {\n const ref = useRef(handlers);\n ref.current = handlers;\n\n useEffect(() => {\n function onKeyDown(e: KeyboardEvent) {\n const h = ref.current;\n if (e.key === \"Escape\") {\n h.onEscape?.();\n return;\n }\n\n if (isEditableTarget(e.target)) return;\n if (e.metaKey || e.ctrlKey || e.altKey) return;\n\n switch (e.key) {\n case \"/\":\n h.onFocusSearch?.();\n e.preventDefault();\n return;\n case \"?\":\n h.onToggleHelp?.();\n e.preventDefault();\n return;\n case \"f\":\n h.onNextFailure?.();\n e.preventDefault();\n return;\n case \"F\":\n h.onPrevFailure?.();\n e.preventDefault();\n return;\n default:\n return;\n }\n }\n\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, []);\n}\n","\"use client\";\n\nimport { useEffect } from \"react\";\n\n/**\n * Scrolls to a scenario by URL hash on mount and whenever the hash changes.\n * No-op in SSR (only runs in useEffect).\n */\nexport function useDeepLinkScroll(): void {\n useEffect(() => {\n function scrollToHash() {\n const hash = window.location.hash.replace(/^#/, \"\");\n if (!hash) return;\n const el = document.getElementById(hash);\n if (!el) return;\n requestAnimationFrame(() => {\n el.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n });\n }\n scrollToHash();\n window.addEventListener(\"hashchange\", scrollToHash);\n return () => window.removeEventListener(\"hashchange\", scrollToHash);\n }, []);\n}\n","/**\n * Pure functions for filtering a StoryReport by a search query.\n * Used by <ReportInteractive>. Kept side-effect-free so it can be unit-tested.\n */\n\nimport type {\n ReportScenario,\n ReportFeature,\n StoryReport,\n} from \"executable-stories-formatters\";\n\nexport function normalizeQuery(query: string): string {\n return query.trim().toLowerCase();\n}\n\nfunction scenarioMatches(scenario: ReportScenario, q: string): boolean {\n if (q === \"\") return true;\n if (scenario.title.toLowerCase().includes(q)) return true;\n for (const tag of scenario.tags) {\n if (tag.toLowerCase().includes(q)) return true;\n }\n for (const step of scenario.steps) {\n if (step.text.toLowerCase().includes(q)) return true;\n }\n return false;\n}\n\nfunction summarizeScenarios(scenarios: ReportScenario[]) {\n let total = 0,\n passed = 0,\n failed = 0,\n skipped = 0,\n pending = 0,\n durationMs = 0;\n for (const s of scenarios) {\n total += 1;\n durationMs += s.durationMs;\n if (s.status === \"passed\") passed += 1;\n else if (s.status === \"failed\") failed += 1;\n else if (s.status === \"skipped\") skipped += 1;\n else pending += 1;\n }\n return { total, passed, failed, skipped, pending, durationMs };\n}\n\nexport function filterReport(report: StoryReport, query: string): StoryReport {\n const q = normalizeQuery(query);\n if (q === \"\") return report;\n\n const features: ReportFeature[] = [];\n let topTotal = 0,\n topPassed = 0,\n topFailed = 0,\n topSkipped = 0,\n topPending = 0,\n topDuration = 0;\n\n for (const feature of report.features) {\n const matched = feature.scenarios.filter((s) => scenarioMatches(s, q));\n if (matched.length === 0) continue;\n const summary = summarizeScenarios(matched);\n features.push({ ...feature, summary, scenarios: matched });\n topTotal += summary.total;\n topPassed += summary.passed;\n topFailed += summary.failed;\n topSkipped += summary.skipped;\n topPending += summary.pending;\n topDuration += summary.durationMs;\n }\n\n return {\n ...report,\n summary: {\n total: topTotal,\n passed: topPassed,\n failed: topFailed,\n skipped: topSkipped,\n pending: topPending,\n durationMs: topDuration,\n },\n features,\n };\n}\n\nexport interface FailureRef {\n featureId: string;\n scenarioId: string;\n scenarioTitle: string;\n errorMessage?: string;\n}\n\nexport function listFailures(report: StoryReport): FailureRef[] {\n const out: FailureRef[] = [];\n for (const feature of report.features) {\n for (const scenario of feature.scenarios) {\n if (scenario.status === \"failed\") {\n const ref: FailureRef = {\n featureId: feature.id,\n scenarioId: scenario.id,\n scenarioTitle: scenario.title,\n };\n if (scenario.errorMessage !== undefined) {\n ref.errorMessage = scenario.errorMessage;\n }\n out.push(ref);\n }\n }\n }\n return out;\n}\n"],"mappings":";;;AAEA;AAAA,EACE,e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AAA,cACf,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,KAAK;AAAA,kBACL,OAAO;AAAA,kBACP,UAAU;AAAA,kBACV,cAAc;AAAA,kBACd,YAAY;AAAA;AAAA,cACd;AAAA,eACF;AAAA,YACA,gBAAAA,MAAC,uBAAoB,UAAoB;AAAA,YACxC,aAAa,gBAAAA,MAAC,qBAAkB,IAAK,gBAAAA,MAAC,eAAY,SAAS,QAAQ,mCAAmC,QAAW;AAAA,YAClH,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,cAAW;AAAA,gBACX,qBAAkB;AAAA,gBAClB,SAAS;AAAA,gBACV;AAAA;AAAA,YAED;AAAA,YACA,gBAAAA,MAAC,uBAAoB,MAAM,UAAU,SAAS,MAAM,YAAY,KAAK,GAAG;AAAA;AAAA;AAAA,MAC1E;AAAA;AAAA,EACF;AAEJ;","names":["useCallback","useMemo","useRef","jsx","jsx","jsx","jsx","jsxs","useContext","EMPTY_CUSTOM","EMPTY_RENDERERS","useContext","Fragment","jsx","jsxs","jsx","jsxs","jsx","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","Fragment","jsx","jsxs","jsx","Fragment","jsx","jsx","jsxs","jsx","jsxs","Fragment","jsx","jsx","jsxs","Fragment","jsx","jsx","jsx","jsxs","jsx","jsxs","ReportSearch","jsx","jsxs","jsx","jsxs","useEffect","useRef","useEffect","jsx","jsxs","useRef","useMemo","useCallback"]}
|
package/dist/parse.cjs
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/parse-entry.ts
|
|
21
|
+
var parse_entry_exports = {};
|
|
22
|
+
__export(parse_entry_exports, {
|
|
23
|
+
STORY_REPORT_SCHEMA_MAJOR: () => STORY_REPORT_SCHEMA_MAJOR,
|
|
24
|
+
err: () => err,
|
|
25
|
+
ok: () => ok,
|
|
26
|
+
parseStoryReport: () => parseStoryReport,
|
|
27
|
+
storyReportSchema: () => storyReportSchema
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(parse_entry_exports);
|
|
30
|
+
|
|
31
|
+
// src/result.ts
|
|
32
|
+
var ok = (data) => ({ ok: true, data });
|
|
33
|
+
var err = (error) => ({ ok: false, error });
|
|
34
|
+
|
|
35
|
+
// src/schema/story-report.schema.ts
|
|
36
|
+
var import_zod = require("zod");
|
|
37
|
+
|
|
38
|
+
// ../executable-stories-formatters/schemas/story-report-v1.json
|
|
39
|
+
var story_report_v1_default = {
|
|
40
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
41
|
+
$id: "https://executable-stories.dev/schemas/story-report-v1.schema.json",
|
|
42
|
+
title: "StoryReport",
|
|
43
|
+
description: "Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract \u2014 additive-only within a major. Distinct from internal TestRunResult.",
|
|
44
|
+
type: "object",
|
|
45
|
+
$ref: "#/$defs/StoryReport",
|
|
46
|
+
$defs: {
|
|
47
|
+
StoryReport: {
|
|
48
|
+
type: "object",
|
|
49
|
+
description: "Top-level report containing all features, runtime metadata, and a pre-computed summary.",
|
|
50
|
+
properties: {
|
|
51
|
+
schemaVersion: {
|
|
52
|
+
type: "string",
|
|
53
|
+
pattern: "^1\\.[0-9]+$",
|
|
54
|
+
description: "Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x."
|
|
55
|
+
},
|
|
56
|
+
runId: {
|
|
57
|
+
type: "string",
|
|
58
|
+
minLength: 1,
|
|
59
|
+
description: "Unique deterministic identifier for this run."
|
|
60
|
+
},
|
|
61
|
+
startedAtMs: {
|
|
62
|
+
type: "number",
|
|
63
|
+
minimum: 0,
|
|
64
|
+
description: "Run start time as Unix epoch milliseconds."
|
|
65
|
+
},
|
|
66
|
+
finishedAtMs: {
|
|
67
|
+
type: "number",
|
|
68
|
+
minimum: 0,
|
|
69
|
+
description: "Run finish time as Unix epoch milliseconds."
|
|
70
|
+
},
|
|
71
|
+
durationMs: {
|
|
72
|
+
type: "number",
|
|
73
|
+
minimum: 0,
|
|
74
|
+
description: "Total run duration in milliseconds."
|
|
75
|
+
},
|
|
76
|
+
projectRoot: {
|
|
77
|
+
type: "string",
|
|
78
|
+
minLength: 1,
|
|
79
|
+
description: "Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred)."
|
|
80
|
+
},
|
|
81
|
+
packageVersion: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Version of the package under test, if known."
|
|
84
|
+
},
|
|
85
|
+
gitSha: {
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "Git commit SHA at the time of the run."
|
|
88
|
+
},
|
|
89
|
+
ci: {
|
|
90
|
+
$ref: "#/$defs/CIInfo"
|
|
91
|
+
},
|
|
92
|
+
coverage: {
|
|
93
|
+
$ref: "#/$defs/CoverageSummary"
|
|
94
|
+
},
|
|
95
|
+
summary: {
|
|
96
|
+
$ref: "#/$defs/Summary",
|
|
97
|
+
description: "Pre-computed counts across all features and scenarios."
|
|
98
|
+
},
|
|
99
|
+
features: {
|
|
100
|
+
type: "array",
|
|
101
|
+
items: { $ref: "#/$defs/Feature" },
|
|
102
|
+
description: "Features grouped by sourceFile, sorted by title."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
required: ["schemaVersion", "runId", "startedAtMs", "finishedAtMs", "durationMs", "projectRoot", "summary", "features"],
|
|
106
|
+
additionalProperties: false
|
|
107
|
+
},
|
|
108
|
+
Summary: {
|
|
109
|
+
type: "object",
|
|
110
|
+
description: "Counts by status. Sums equal 'total'.",
|
|
111
|
+
properties: {
|
|
112
|
+
total: { type: "integer", minimum: 0 },
|
|
113
|
+
passed: { type: "integer", minimum: 0 },
|
|
114
|
+
failed: { type: "integer", minimum: 0 },
|
|
115
|
+
skipped: { type: "integer", minimum: 0 },
|
|
116
|
+
pending: { type: "integer", minimum: 0 },
|
|
117
|
+
durationMs: { type: "number", minimum: 0 }
|
|
118
|
+
},
|
|
119
|
+
required: ["total", "passed", "failed", "skipped", "pending", "durationMs"],
|
|
120
|
+
additionalProperties: false
|
|
121
|
+
},
|
|
122
|
+
Feature: {
|
|
123
|
+
type: "object",
|
|
124
|
+
description: "A group of scenarios from the same source file.",
|
|
125
|
+
properties: {
|
|
126
|
+
id: {
|
|
127
|
+
type: "string",
|
|
128
|
+
minLength: 1,
|
|
129
|
+
description: "Stable slug derived from the relative source path. Suitable for use as a deep-link anchor."
|
|
130
|
+
},
|
|
131
|
+
title: {
|
|
132
|
+
type: "string",
|
|
133
|
+
minLength: 1,
|
|
134
|
+
description: "Display title. Derived from describe block when present, otherwise the file basename."
|
|
135
|
+
},
|
|
136
|
+
sourceFile: {
|
|
137
|
+
type: "string",
|
|
138
|
+
minLength: 1,
|
|
139
|
+
description: "Source path, relative to projectRoot when possible."
|
|
140
|
+
},
|
|
141
|
+
summary: { $ref: "#/$defs/Summary" },
|
|
142
|
+
scenarios: {
|
|
143
|
+
type: "array",
|
|
144
|
+
items: { $ref: "#/$defs/Scenario" },
|
|
145
|
+
description: "Scenarios in this feature, in declaration order."
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
required: ["id", "title", "sourceFile", "summary", "scenarios"],
|
|
149
|
+
additionalProperties: false
|
|
150
|
+
},
|
|
151
|
+
Scenario: {
|
|
152
|
+
type: "object",
|
|
153
|
+
description: "A single scenario with its steps, story-level doc entries, and attachments.",
|
|
154
|
+
properties: {
|
|
155
|
+
id: {
|
|
156
|
+
type: "string",
|
|
157
|
+
minLength: 1,
|
|
158
|
+
description: "Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor."
|
|
159
|
+
},
|
|
160
|
+
title: { type: "string", minLength: 1 },
|
|
161
|
+
status: { $ref: "#/$defs/TestStatus" },
|
|
162
|
+
durationMs: { type: "number", minimum: 0 },
|
|
163
|
+
tags: {
|
|
164
|
+
type: "array",
|
|
165
|
+
items: { type: "string" },
|
|
166
|
+
description: "Normalized tags, deduplicated, lowercased."
|
|
167
|
+
},
|
|
168
|
+
tickets: {
|
|
169
|
+
type: "array",
|
|
170
|
+
items: { $ref: "#/$defs/Ticket" }
|
|
171
|
+
},
|
|
172
|
+
sourceLine: { type: "integer", minimum: 1 },
|
|
173
|
+
errorMessage: { type: "string" },
|
|
174
|
+
errorStack: { type: "string" },
|
|
175
|
+
retry: { type: "integer", minimum: 0 },
|
|
176
|
+
retries: { type: "integer", minimum: 0 },
|
|
177
|
+
docEntries: {
|
|
178
|
+
type: "array",
|
|
179
|
+
items: { $ref: "#/$defs/DocEntry" },
|
|
180
|
+
description: "Story-level doc entries (rendered before steps)."
|
|
181
|
+
},
|
|
182
|
+
steps: {
|
|
183
|
+
type: "array",
|
|
184
|
+
items: { $ref: "#/$defs/Step" }
|
|
185
|
+
},
|
|
186
|
+
attachments: {
|
|
187
|
+
type: "array",
|
|
188
|
+
items: { $ref: "#/$defs/Attachment" }
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
required: ["id", "title", "status", "durationMs", "tags", "retry", "retries", "docEntries", "steps", "attachments"],
|
|
192
|
+
additionalProperties: false
|
|
193
|
+
},
|
|
194
|
+
Step: {
|
|
195
|
+
type: "object",
|
|
196
|
+
description: "A single BDD step.",
|
|
197
|
+
properties: {
|
|
198
|
+
id: { type: "string", minLength: 1 },
|
|
199
|
+
index: { type: "integer", minimum: 0 },
|
|
200
|
+
keyword: { $ref: "#/$defs/StepKeyword" },
|
|
201
|
+
text: { type: "string" },
|
|
202
|
+
status: { $ref: "#/$defs/TestStatus" },
|
|
203
|
+
durationMs: { type: "number", minimum: 0 },
|
|
204
|
+
errorMessage: { type: "string" },
|
|
205
|
+
mode: { $ref: "#/$defs/StepMode" },
|
|
206
|
+
docEntries: {
|
|
207
|
+
type: "array",
|
|
208
|
+
items: { $ref: "#/$defs/DocEntry" },
|
|
209
|
+
description: "Doc entries attached to this step."
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
required: ["id", "index", "keyword", "text", "status", "durationMs", "docEntries"],
|
|
213
|
+
additionalProperties: false
|
|
214
|
+
},
|
|
215
|
+
StepKeyword: {
|
|
216
|
+
type: "string",
|
|
217
|
+
enum: ["Given", "When", "Then", "And", "But"]
|
|
218
|
+
},
|
|
219
|
+
StepMode: {
|
|
220
|
+
type: "string",
|
|
221
|
+
enum: ["normal", "skip", "only", "todo", "fails", "concurrent"]
|
|
222
|
+
},
|
|
223
|
+
TestStatus: {
|
|
224
|
+
type: "string",
|
|
225
|
+
enum: ["passed", "failed", "skipped", "pending"]
|
|
226
|
+
},
|
|
227
|
+
Ticket: {
|
|
228
|
+
type: "object",
|
|
229
|
+
properties: {
|
|
230
|
+
id: { type: "string", minLength: 1 },
|
|
231
|
+
url: { type: "string" }
|
|
232
|
+
},
|
|
233
|
+
required: ["id"],
|
|
234
|
+
additionalProperties: false
|
|
235
|
+
},
|
|
236
|
+
Attachment: {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: {
|
|
239
|
+
name: { type: "string" },
|
|
240
|
+
mediaType: { type: "string", minLength: 1 },
|
|
241
|
+
body: { type: "string" },
|
|
242
|
+
contentEncoding: {
|
|
243
|
+
type: "string",
|
|
244
|
+
enum: ["BASE64", "IDENTITY"]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
required: ["name", "mediaType", "body", "contentEncoding"],
|
|
248
|
+
additionalProperties: false
|
|
249
|
+
},
|
|
250
|
+
CIInfo: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: {
|
|
253
|
+
name: { type: "string" },
|
|
254
|
+
url: { type: "string" },
|
|
255
|
+
buildNumber: { type: "string" },
|
|
256
|
+
branch: { type: "string" },
|
|
257
|
+
commitSha: { type: "string" },
|
|
258
|
+
prNumber: { type: "string" }
|
|
259
|
+
},
|
|
260
|
+
required: ["name"],
|
|
261
|
+
additionalProperties: false
|
|
262
|
+
},
|
|
263
|
+
CoverageSummary: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
linesPct: { type: "number", minimum: 0, maximum: 100 },
|
|
267
|
+
branchesPct: { type: "number", minimum: 0, maximum: 100 },
|
|
268
|
+
functionsPct: { type: "number", minimum: 0, maximum: 100 },
|
|
269
|
+
statementsPct: { type: "number", minimum: 0, maximum: 100 }
|
|
270
|
+
},
|
|
271
|
+
additionalProperties: false
|
|
272
|
+
},
|
|
273
|
+
DocPhase: {
|
|
274
|
+
type: "string",
|
|
275
|
+
enum: ["static", "runtime"]
|
|
276
|
+
},
|
|
277
|
+
DocEntry: {
|
|
278
|
+
oneOf: [
|
|
279
|
+
{ $ref: "#/$defs/DocNote" },
|
|
280
|
+
{ $ref: "#/$defs/DocTag" },
|
|
281
|
+
{ $ref: "#/$defs/DocKv" },
|
|
282
|
+
{ $ref: "#/$defs/DocCode" },
|
|
283
|
+
{ $ref: "#/$defs/DocTable" },
|
|
284
|
+
{ $ref: "#/$defs/DocLink" },
|
|
285
|
+
{ $ref: "#/$defs/DocSection" },
|
|
286
|
+
{ $ref: "#/$defs/DocMermaid" },
|
|
287
|
+
{ $ref: "#/$defs/DocScreenshot" },
|
|
288
|
+
{ $ref: "#/$defs/DocCustom" }
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
DocNote: {
|
|
292
|
+
type: "object",
|
|
293
|
+
properties: {
|
|
294
|
+
kind: { const: "note" },
|
|
295
|
+
text: { type: "string" },
|
|
296
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
297
|
+
children: {
|
|
298
|
+
type: "array",
|
|
299
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
required: ["kind", "text", "phase"],
|
|
303
|
+
additionalProperties: false
|
|
304
|
+
},
|
|
305
|
+
DocTag: {
|
|
306
|
+
type: "object",
|
|
307
|
+
properties: {
|
|
308
|
+
kind: { const: "tag" },
|
|
309
|
+
names: { type: "array", items: { type: "string" } },
|
|
310
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
311
|
+
children: {
|
|
312
|
+
type: "array",
|
|
313
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
required: ["kind", "names", "phase"],
|
|
317
|
+
additionalProperties: false
|
|
318
|
+
},
|
|
319
|
+
DocKv: {
|
|
320
|
+
type: "object",
|
|
321
|
+
properties: {
|
|
322
|
+
kind: { const: "kv" },
|
|
323
|
+
label: { type: "string" },
|
|
324
|
+
value: {},
|
|
325
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
326
|
+
children: {
|
|
327
|
+
type: "array",
|
|
328
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
required: ["kind", "label", "value", "phase"],
|
|
332
|
+
additionalProperties: false
|
|
333
|
+
},
|
|
334
|
+
DocCode: {
|
|
335
|
+
type: "object",
|
|
336
|
+
properties: {
|
|
337
|
+
kind: { const: "code" },
|
|
338
|
+
label: { type: "string" },
|
|
339
|
+
content: { type: "string" },
|
|
340
|
+
lang: { type: "string" },
|
|
341
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
342
|
+
children: {
|
|
343
|
+
type: "array",
|
|
344
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
required: ["kind", "label", "content", "phase"],
|
|
348
|
+
additionalProperties: false
|
|
349
|
+
},
|
|
350
|
+
DocTable: {
|
|
351
|
+
type: "object",
|
|
352
|
+
properties: {
|
|
353
|
+
kind: { const: "table" },
|
|
354
|
+
label: { type: "string" },
|
|
355
|
+
columns: { type: "array", items: { type: "string" } },
|
|
356
|
+
rows: {
|
|
357
|
+
type: "array",
|
|
358
|
+
items: {
|
|
359
|
+
type: "array",
|
|
360
|
+
items: { type: "string" }
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
364
|
+
children: {
|
|
365
|
+
type: "array",
|
|
366
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
required: ["kind", "label", "columns", "rows", "phase"],
|
|
370
|
+
additionalProperties: false
|
|
371
|
+
},
|
|
372
|
+
DocLink: {
|
|
373
|
+
type: "object",
|
|
374
|
+
properties: {
|
|
375
|
+
kind: { const: "link" },
|
|
376
|
+
label: { type: "string" },
|
|
377
|
+
url: { type: "string" },
|
|
378
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
379
|
+
children: {
|
|
380
|
+
type: "array",
|
|
381
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
required: ["kind", "label", "url", "phase"],
|
|
385
|
+
additionalProperties: false
|
|
386
|
+
},
|
|
387
|
+
DocSection: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: {
|
|
390
|
+
kind: { const: "section" },
|
|
391
|
+
title: { type: "string" },
|
|
392
|
+
markdown: { type: "string" },
|
|
393
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
394
|
+
children: {
|
|
395
|
+
type: "array",
|
|
396
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
required: ["kind", "title", "markdown", "phase"],
|
|
400
|
+
additionalProperties: false
|
|
401
|
+
},
|
|
402
|
+
DocMermaid: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
kind: { const: "mermaid" },
|
|
406
|
+
code: { type: "string" },
|
|
407
|
+
title: { type: "string" },
|
|
408
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
409
|
+
children: {
|
|
410
|
+
type: "array",
|
|
411
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
required: ["kind", "code", "phase"],
|
|
415
|
+
additionalProperties: false
|
|
416
|
+
},
|
|
417
|
+
DocScreenshot: {
|
|
418
|
+
type: "object",
|
|
419
|
+
properties: {
|
|
420
|
+
kind: { const: "screenshot" },
|
|
421
|
+
path: { type: "string" },
|
|
422
|
+
alt: { type: "string" },
|
|
423
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
424
|
+
children: {
|
|
425
|
+
type: "array",
|
|
426
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
required: ["kind", "path", "phase"],
|
|
430
|
+
additionalProperties: false
|
|
431
|
+
},
|
|
432
|
+
DocCustom: {
|
|
433
|
+
type: "object",
|
|
434
|
+
properties: {
|
|
435
|
+
kind: { const: "custom" },
|
|
436
|
+
type: { type: "string", minLength: 1 },
|
|
437
|
+
data: {},
|
|
438
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
439
|
+
children: {
|
|
440
|
+
type: "array",
|
|
441
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
required: ["kind", "type", "data", "phase"],
|
|
445
|
+
additionalProperties: false
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
// src/schema/story-report.schema.ts
|
|
451
|
+
var compiled = import_zod.z.fromJSONSchema(story_report_v1_default);
|
|
452
|
+
var storyReportSchema = compiled;
|
|
453
|
+
var STORY_REPORT_SCHEMA_MAJOR = 1;
|
|
454
|
+
|
|
455
|
+
// src/schema/parse.ts
|
|
456
|
+
function parseStoryReport(input) {
|
|
457
|
+
if (input === null || typeof input !== "object") {
|
|
458
|
+
return err({
|
|
459
|
+
message: "Expected a StoryReport object.",
|
|
460
|
+
code: "INVALID_INPUT"
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
const versionRaw = input.schemaVersion;
|
|
464
|
+
if (typeof versionRaw === "string") {
|
|
465
|
+
const major = versionRaw.split(".")[0];
|
|
466
|
+
if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {
|
|
467
|
+
return err({
|
|
468
|
+
message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,
|
|
469
|
+
code: "SCHEMA_VERSION_MISMATCH"
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
const parsed = storyReportSchema.safeParse(input);
|
|
474
|
+
if (parsed.success) {
|
|
475
|
+
return ok(parsed.data);
|
|
476
|
+
}
|
|
477
|
+
const issues = parsed.error.issues.map((i) => ({
|
|
478
|
+
path: i.path.join(".") || "/",
|
|
479
|
+
message: i.message
|
|
480
|
+
}));
|
|
481
|
+
return err({
|
|
482
|
+
message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? "" : "s"}).`,
|
|
483
|
+
code: "VALIDATION_FAILED",
|
|
484
|
+
issues
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
488
|
+
0 && (module.exports = {
|
|
489
|
+
STORY_REPORT_SCHEMA_MAJOR,
|
|
490
|
+
err,
|
|
491
|
+
ok,
|
|
492
|
+
parseStoryReport,
|
|
493
|
+
storyReportSchema
|
|
494
|
+
});
|
|
495
|
+
//# sourceMappingURL=parse.cjs.map
|