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/parse-entry.ts","../src/result.ts","../src/schema/story-report.schema.ts","../../executable-stories-formatters/schemas/story-report-v1.json","../src/schema/parse.ts"],"sourcesContent":["/**\n * Server-safe entry: parseStoryReport, Result types, schema constants.\n *\n * No React, no hooks, no client-only code. Safe to call from Next.js Server\n * Components, build scripts, edge functions, or anywhere else outside the\n * browser. The main \"executable-stories-react\" entry is marked \"use client\"\n * because it touches createContext; this entry stays clean.\n */\n\nexport { parseStoryReport } from \"./schema/parse\";\nexport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./schema/story-report.schema\";\nexport type { Result, ReportParseError, ReportParseErrorCode } from \"./result\";\nexport { ok, err } from \"./result\";\nexport type {\n StoryReport,\n ReportFeature as StoryReportFeature,\n ReportScenario as StoryReportScenario,\n ReportStep as StoryReportStep,\n ReportDocEntry as StoryReportDocEntry,\n ReportSummary as StoryReportSummary,\n} from \"executable-stories-formatters\";\n","/**\n * Result<T> — explicit success/error type matching the cookbook convention.\n *\n * Used at the boundary where a StoryReport is parsed: the consumer hands us\n * an unknown value (file contents, fetch body, prop) and we return a Result.\n */\n\nexport type Result<T, E = ReportParseError> =\n | { ok: true; data: T }\n | { ok: false; error: E };\n\nexport interface ReportParseError {\n message: string;\n code: ReportParseErrorCode;\n issues?: readonly { path: string; message: string }[];\n}\n\nexport type ReportParseErrorCode =\n | \"INVALID_INPUT\"\n | \"SCHEMA_VERSION_MISMATCH\"\n | \"VALIDATION_FAILED\";\n\nexport const ok = <T>(data: T): Result<T> => ({ ok: true, data });\nexport const err = (error: ReportParseError): Result<never> => ({ ok: false, error });\n","/**\n * StoryReport runtime Zod schema, derived from the canonical JSON Schema\n * at executable-stories-formatters/schemas/story-report-v1.json.\n *\n * Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,\n * only this file needs updating — the rest of the package consumes\n * `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.\n *\n * The JSON Schema is bundled at build time by tsup (resolveJsonModule).\n */\n\nimport { z } from \"zod\";\nimport schemaJson from \"../../../executable-stories-formatters/schemas/story-report-v1.json\" with { type: \"json\" };\n\nconst compiled = z.fromJSONSchema(schemaJson as Parameters<typeof z.fromJSONSchema>[0]);\n\nexport const storyReportSchema = compiled;\nexport type StoryReportSchemaShape = z.infer<typeof compiled>;\n\nexport const STORY_REPORT_SCHEMA_MAJOR = 1 as const;\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://executable-stories.dev/schemas/story-report-v1.schema.json\",\n \"title\": \"StoryReport\",\n \"description\": \"Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract — additive-only within a major. Distinct from internal TestRunResult.\",\n \"type\": \"object\",\n \"$ref\": \"#/$defs/StoryReport\",\n \"$defs\": {\n \"StoryReport\": {\n \"type\": \"object\",\n \"description\": \"Top-level report containing all features, runtime metadata, and a pre-computed summary.\",\n \"properties\": {\n \"schemaVersion\": {\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.[0-9]+$\",\n \"description\": \"Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x.\"\n },\n \"runId\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Unique deterministic identifier for this run.\"\n },\n \"startedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run start time as Unix epoch milliseconds.\"\n },\n \"finishedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run finish time as Unix epoch milliseconds.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Total run duration in milliseconds.\"\n },\n \"projectRoot\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred).\"\n },\n \"packageVersion\": {\n \"type\": \"string\",\n \"description\": \"Version of the package under test, if known.\"\n },\n \"gitSha\": {\n \"type\": \"string\",\n \"description\": \"Git commit SHA at the time of the run.\"\n },\n \"ci\": {\n \"$ref\": \"#/$defs/CIInfo\"\n },\n \"coverage\": {\n \"$ref\": \"#/$defs/CoverageSummary\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\",\n \"description\": \"Pre-computed counts across all features and scenarios.\"\n },\n \"features\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Feature\" },\n \"description\": \"Features grouped by sourceFile, sorted by title.\"\n }\n },\n \"required\": [\"schemaVersion\", \"runId\", \"startedAtMs\", \"finishedAtMs\", \"durationMs\", \"projectRoot\", \"summary\", \"features\"],\n \"additionalProperties\": false\n },\n \"Summary\": {\n \"type\": \"object\",\n \"description\": \"Counts by status. Sums equal 'total'.\",\n \"properties\": {\n \"total\": { \"type\": \"integer\", \"minimum\": 0 },\n \"passed\": { \"type\": \"integer\", \"minimum\": 0 },\n \"failed\": { \"type\": \"integer\", \"minimum\": 0 },\n \"skipped\": { \"type\": \"integer\", \"minimum\": 0 },\n \"pending\": { \"type\": \"integer\", \"minimum\": 0 },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 }\n },\n \"required\": [\"total\", \"passed\", \"failed\", \"skipped\", \"pending\", \"durationMs\"],\n \"additionalProperties\": false\n },\n \"Feature\": {\n \"type\": \"object\",\n \"description\": \"A group of scenarios from the same source file.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable slug derived from the relative source path. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Display title. Derived from describe block when present, otherwise the file basename.\"\n },\n \"sourceFile\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Source path, relative to projectRoot when possible.\"\n },\n \"summary\": { \"$ref\": \"#/$defs/Summary\" },\n \"scenarios\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Scenario\" },\n \"description\": \"Scenarios in this feature, in declaration order.\"\n }\n },\n \"required\": [\"id\", \"title\", \"sourceFile\", \"summary\", \"scenarios\"],\n \"additionalProperties\": false\n },\n \"Scenario\": {\n \"type\": \"object\",\n \"description\": \"A single scenario with its steps, story-level doc entries, and attachments.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor.\"\n },\n \"title\": { \"type\": \"string\", \"minLength\": 1 },\n \"status\": { \"$ref\": \"#/$defs/TestStatus\" },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 },\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Normalized tags, deduplicated, lowercased.\"\n },\n \"tickets\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Ticket\" }\n },\n \"sourceLine\": { \"type\": \"integer\", \"minimum\": 1 },\n \"errorMessage\": { \"type\": \"string\" },\n \"errorStack\": { \"type\": \"string\" },\n \"retry\": { \"type\": \"integer\", \"minimum\": 0 },\n \"retries\": { \"type\": \"integer\", \"minimum\": 0 },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" },\n \"description\": \"Story-level doc entries (rendered before steps).\"\n },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Step\" }\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Attachment\" }\n }\n },\n \"required\": [\"id\", \"title\", \"status\", \"durationMs\", \"tags\", \"retry\", \"retries\", \"docEntries\", \"steps\", \"attachments\"],\n \"additionalProperties\": false\n },\n \"Step\": {\n \"type\": \"object\",\n \"description\": \"A single BDD step.\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"index\": { \"type\": \"integer\", \"minimum\": 0 },\n \"keyword\": { \"$ref\": \"#/$defs/StepKeyword\" },\n \"text\": { \"type\": \"string\" },\n \"status\": { \"$ref\": \"#/$defs/TestStatus\" },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 },\n \"errorMessage\": { \"type\": \"string\" },\n \"mode\": { \"$ref\": \"#/$defs/StepMode\" },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" },\n \"description\": \"Doc entries attached to this step.\"\n }\n },\n \"required\": [\"id\", \"index\", \"keyword\", \"text\", \"status\", \"durationMs\", \"docEntries\"],\n \"additionalProperties\": false\n },\n \"StepKeyword\": {\n \"type\": \"string\",\n \"enum\": [\"Given\", \"When\", \"Then\", \"And\", \"But\"]\n },\n \"StepMode\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"skip\", \"only\", \"todo\", \"fails\", \"concurrent\"]\n },\n \"TestStatus\": {\n \"type\": \"string\",\n \"enum\": [\"passed\", \"failed\", \"skipped\", \"pending\"]\n },\n \"Ticket\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"url\": { \"type\": \"string\" }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"Attachment\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"mediaType\": { \"type\": \"string\", \"minLength\": 1 },\n \"body\": { \"type\": \"string\" },\n \"contentEncoding\": {\n \"type\": \"string\",\n \"enum\": [\"BASE64\", \"IDENTITY\"]\n }\n },\n \"required\": [\"name\", \"mediaType\", \"body\", \"contentEncoding\"],\n \"additionalProperties\": false\n },\n \"CIInfo\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" },\n \"buildNumber\": { \"type\": \"string\" },\n \"branch\": { \"type\": \"string\" },\n \"commitSha\": { \"type\": \"string\" },\n \"prNumber\": { \"type\": \"string\" }\n },\n \"required\": [\"name\"],\n \"additionalProperties\": false\n },\n \"CoverageSummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"linesPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"branchesPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"functionsPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"statementsPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 }\n },\n \"additionalProperties\": false\n },\n \"DocPhase\": {\n \"type\": \"string\",\n \"enum\": [\"static\", \"runtime\"]\n },\n \"DocEntry\": {\n \"oneOf\": [\n { \"$ref\": \"#/$defs/DocNote\" },\n { \"$ref\": \"#/$defs/DocTag\" },\n { \"$ref\": \"#/$defs/DocKv\" },\n { \"$ref\": \"#/$defs/DocCode\" },\n { \"$ref\": \"#/$defs/DocTable\" },\n { \"$ref\": \"#/$defs/DocLink\" },\n { \"$ref\": \"#/$defs/DocSection\" },\n { \"$ref\": \"#/$defs/DocMermaid\" },\n { \"$ref\": \"#/$defs/DocScreenshot\" },\n { \"$ref\": \"#/$defs/DocCustom\" }\n ]\n },\n \"DocNote\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"note\" },\n \"text\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"text\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTag\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"tag\" },\n \"names\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"names\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocKv\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"kv\" },\n \"label\": { \"type\": \"string\" },\n \"value\": {},\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCode\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"code\" },\n \"label\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"lang\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"content\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTable\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"table\" },\n \"label\": { \"type\": \"string\" },\n \"columns\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"rows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"columns\", \"rows\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocLink\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"link\" },\n \"label\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"url\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocSection\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"section\" },\n \"title\": { \"type\": \"string\" },\n \"markdown\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"title\", \"markdown\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocMermaid\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"mermaid\" },\n \"code\": { \"type\": \"string\" },\n \"title\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"code\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocScreenshot\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"screenshot\" },\n \"path\": { \"type\": \"string\" },\n \"alt\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCustom\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"custom\" },\n \"type\": { \"type\": \"string\", \"minLength\": 1 },\n \"data\": {},\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"type\", \"data\", \"phase\"],\n \"additionalProperties\": false\n }\n }\n}\n","/**\n * parseStoryReport — boundary validator. Accepts unknown input (file contents,\n * fetch body, prop) and returns a Result-typed StoryReport.\n */\n\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { Result } from \"../result\";\nimport { ok, err } from \"../result\";\nimport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./story-report.schema\";\n\nexport function parseStoryReport(input: unknown): Result<StoryReport> {\n if (input === null || typeof input !== \"object\") {\n return err({\n message: \"Expected a StoryReport object.\",\n code: \"INVALID_INPUT\",\n });\n }\n\n const versionRaw = (input as { schemaVersion?: unknown }).schemaVersion;\n if (typeof versionRaw === \"string\") {\n const major = versionRaw.split(\".\")[0];\n if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {\n return err({\n message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,\n code: \"SCHEMA_VERSION_MISMATCH\",\n });\n }\n }\n\n const parsed = storyReportSchema.safeParse(input);\n if (parsed.success) {\n return ok(parsed.data as StoryReport);\n }\n\n const issues = parsed.error.issues.map((i) => ({\n path: i.path.join(\".\") || \"/\",\n message: i.message,\n }));\n\n return err({\n message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? \"\" : \"s\"}).`,\n code: \"VALIDATION_FAILED\",\n issues,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsBO,IAAM,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AACH;","names":[]}
|
package/dist/parse.d.cts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StoryReport } from 'executable-stories-formatters';
|
|
2
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-formatters';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
7
|
+
*
|
|
8
|
+
* Used at the boundary where a StoryReport is parsed: the consumer hands us
|
|
9
|
+
* an unknown value (file contents, fetch body, prop) and we return a Result.
|
|
10
|
+
*/
|
|
11
|
+
type Result<T, E = ReportParseError> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
data: T;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: E;
|
|
17
|
+
};
|
|
18
|
+
interface ReportParseError {
|
|
19
|
+
message: string;
|
|
20
|
+
code: ReportParseErrorCode;
|
|
21
|
+
issues?: readonly {
|
|
22
|
+
path: string;
|
|
23
|
+
message: string;
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
|
|
27
|
+
declare const ok: <T>(data: T) => Result<T>;
|
|
28
|
+
declare const err: (error: ReportParseError) => Result<never>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
32
|
+
* fetch body, prop) and returns a Result-typed StoryReport.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
declare function parseStoryReport(input: unknown): Result<StoryReport>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* StoryReport runtime Zod schema, derived from the canonical JSON Schema
|
|
39
|
+
* at executable-stories-formatters/schemas/story-report-v1.json.
|
|
40
|
+
*
|
|
41
|
+
* Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,
|
|
42
|
+
* only this file needs updating — the rest of the package consumes
|
|
43
|
+
* `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.
|
|
44
|
+
*
|
|
45
|
+
* The JSON Schema is bundled at build time by tsup (resolveJsonModule).
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
49
|
+
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
50
|
+
|
|
51
|
+
export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema };
|
package/dist/parse.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StoryReport } from 'executable-stories-formatters';
|
|
2
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-formatters';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
7
|
+
*
|
|
8
|
+
* Used at the boundary where a StoryReport is parsed: the consumer hands us
|
|
9
|
+
* an unknown value (file contents, fetch body, prop) and we return a Result.
|
|
10
|
+
*/
|
|
11
|
+
type Result<T, E = ReportParseError> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
data: T;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: E;
|
|
17
|
+
};
|
|
18
|
+
interface ReportParseError {
|
|
19
|
+
message: string;
|
|
20
|
+
code: ReportParseErrorCode;
|
|
21
|
+
issues?: readonly {
|
|
22
|
+
path: string;
|
|
23
|
+
message: string;
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
|
|
27
|
+
declare const ok: <T>(data: T) => Result<T>;
|
|
28
|
+
declare const err: (error: ReportParseError) => Result<never>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
32
|
+
* fetch body, prop) and returns a Result-typed StoryReport.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
declare function parseStoryReport(input: unknown): Result<StoryReport>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* StoryReport runtime Zod schema, derived from the canonical JSON Schema
|
|
39
|
+
* at executable-stories-formatters/schemas/story-report-v1.json.
|
|
40
|
+
*
|
|
41
|
+
* Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,
|
|
42
|
+
* only this file needs updating — the rest of the package consumes
|
|
43
|
+
* `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.
|
|
44
|
+
*
|
|
45
|
+
* The JSON Schema is bundled at build time by tsup (resolveJsonModule).
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
49
|
+
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
50
|
+
|
|
51
|
+
export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema };
|
package/dist/parse.js
ADDED
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
// src/result.ts
|
|
2
|
+
var ok = (data) => ({ ok: true, data });
|
|
3
|
+
var err = (error) => ({ ok: false, error });
|
|
4
|
+
|
|
5
|
+
// src/schema/story-report.schema.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
// ../executable-stories-formatters/schemas/story-report-v1.json
|
|
9
|
+
var story_report_v1_default = {
|
|
10
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
11
|
+
$id: "https://executable-stories.dev/schemas/story-report-v1.schema.json",
|
|
12
|
+
title: "StoryReport",
|
|
13
|
+
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.",
|
|
14
|
+
type: "object",
|
|
15
|
+
$ref: "#/$defs/StoryReport",
|
|
16
|
+
$defs: {
|
|
17
|
+
StoryReport: {
|
|
18
|
+
type: "object",
|
|
19
|
+
description: "Top-level report containing all features, runtime metadata, and a pre-computed summary.",
|
|
20
|
+
properties: {
|
|
21
|
+
schemaVersion: {
|
|
22
|
+
type: "string",
|
|
23
|
+
pattern: "^1\\.[0-9]+$",
|
|
24
|
+
description: "Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x."
|
|
25
|
+
},
|
|
26
|
+
runId: {
|
|
27
|
+
type: "string",
|
|
28
|
+
minLength: 1,
|
|
29
|
+
description: "Unique deterministic identifier for this run."
|
|
30
|
+
},
|
|
31
|
+
startedAtMs: {
|
|
32
|
+
type: "number",
|
|
33
|
+
minimum: 0,
|
|
34
|
+
description: "Run start time as Unix epoch milliseconds."
|
|
35
|
+
},
|
|
36
|
+
finishedAtMs: {
|
|
37
|
+
type: "number",
|
|
38
|
+
minimum: 0,
|
|
39
|
+
description: "Run finish time as Unix epoch milliseconds."
|
|
40
|
+
},
|
|
41
|
+
durationMs: {
|
|
42
|
+
type: "number",
|
|
43
|
+
minimum: 0,
|
|
44
|
+
description: "Total run duration in milliseconds."
|
|
45
|
+
},
|
|
46
|
+
projectRoot: {
|
|
47
|
+
type: "string",
|
|
48
|
+
minLength: 1,
|
|
49
|
+
description: "Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred)."
|
|
50
|
+
},
|
|
51
|
+
packageVersion: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "Version of the package under test, if known."
|
|
54
|
+
},
|
|
55
|
+
gitSha: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Git commit SHA at the time of the run."
|
|
58
|
+
},
|
|
59
|
+
ci: {
|
|
60
|
+
$ref: "#/$defs/CIInfo"
|
|
61
|
+
},
|
|
62
|
+
coverage: {
|
|
63
|
+
$ref: "#/$defs/CoverageSummary"
|
|
64
|
+
},
|
|
65
|
+
summary: {
|
|
66
|
+
$ref: "#/$defs/Summary",
|
|
67
|
+
description: "Pre-computed counts across all features and scenarios."
|
|
68
|
+
},
|
|
69
|
+
features: {
|
|
70
|
+
type: "array",
|
|
71
|
+
items: { $ref: "#/$defs/Feature" },
|
|
72
|
+
description: "Features grouped by sourceFile, sorted by title."
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
required: ["schemaVersion", "runId", "startedAtMs", "finishedAtMs", "durationMs", "projectRoot", "summary", "features"],
|
|
76
|
+
additionalProperties: false
|
|
77
|
+
},
|
|
78
|
+
Summary: {
|
|
79
|
+
type: "object",
|
|
80
|
+
description: "Counts by status. Sums equal 'total'.",
|
|
81
|
+
properties: {
|
|
82
|
+
total: { type: "integer", minimum: 0 },
|
|
83
|
+
passed: { type: "integer", minimum: 0 },
|
|
84
|
+
failed: { type: "integer", minimum: 0 },
|
|
85
|
+
skipped: { type: "integer", minimum: 0 },
|
|
86
|
+
pending: { type: "integer", minimum: 0 },
|
|
87
|
+
durationMs: { type: "number", minimum: 0 }
|
|
88
|
+
},
|
|
89
|
+
required: ["total", "passed", "failed", "skipped", "pending", "durationMs"],
|
|
90
|
+
additionalProperties: false
|
|
91
|
+
},
|
|
92
|
+
Feature: {
|
|
93
|
+
type: "object",
|
|
94
|
+
description: "A group of scenarios from the same source file.",
|
|
95
|
+
properties: {
|
|
96
|
+
id: {
|
|
97
|
+
type: "string",
|
|
98
|
+
minLength: 1,
|
|
99
|
+
description: "Stable slug derived from the relative source path. Suitable for use as a deep-link anchor."
|
|
100
|
+
},
|
|
101
|
+
title: {
|
|
102
|
+
type: "string",
|
|
103
|
+
minLength: 1,
|
|
104
|
+
description: "Display title. Derived from describe block when present, otherwise the file basename."
|
|
105
|
+
},
|
|
106
|
+
sourceFile: {
|
|
107
|
+
type: "string",
|
|
108
|
+
minLength: 1,
|
|
109
|
+
description: "Source path, relative to projectRoot when possible."
|
|
110
|
+
},
|
|
111
|
+
summary: { $ref: "#/$defs/Summary" },
|
|
112
|
+
scenarios: {
|
|
113
|
+
type: "array",
|
|
114
|
+
items: { $ref: "#/$defs/Scenario" },
|
|
115
|
+
description: "Scenarios in this feature, in declaration order."
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
required: ["id", "title", "sourceFile", "summary", "scenarios"],
|
|
119
|
+
additionalProperties: false
|
|
120
|
+
},
|
|
121
|
+
Scenario: {
|
|
122
|
+
type: "object",
|
|
123
|
+
description: "A single scenario with its steps, story-level doc entries, and attachments.",
|
|
124
|
+
properties: {
|
|
125
|
+
id: {
|
|
126
|
+
type: "string",
|
|
127
|
+
minLength: 1,
|
|
128
|
+
description: "Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor."
|
|
129
|
+
},
|
|
130
|
+
title: { type: "string", minLength: 1 },
|
|
131
|
+
status: { $ref: "#/$defs/TestStatus" },
|
|
132
|
+
durationMs: { type: "number", minimum: 0 },
|
|
133
|
+
tags: {
|
|
134
|
+
type: "array",
|
|
135
|
+
items: { type: "string" },
|
|
136
|
+
description: "Normalized tags, deduplicated, lowercased."
|
|
137
|
+
},
|
|
138
|
+
tickets: {
|
|
139
|
+
type: "array",
|
|
140
|
+
items: { $ref: "#/$defs/Ticket" }
|
|
141
|
+
},
|
|
142
|
+
sourceLine: { type: "integer", minimum: 1 },
|
|
143
|
+
errorMessage: { type: "string" },
|
|
144
|
+
errorStack: { type: "string" },
|
|
145
|
+
retry: { type: "integer", minimum: 0 },
|
|
146
|
+
retries: { type: "integer", minimum: 0 },
|
|
147
|
+
docEntries: {
|
|
148
|
+
type: "array",
|
|
149
|
+
items: { $ref: "#/$defs/DocEntry" },
|
|
150
|
+
description: "Story-level doc entries (rendered before steps)."
|
|
151
|
+
},
|
|
152
|
+
steps: {
|
|
153
|
+
type: "array",
|
|
154
|
+
items: { $ref: "#/$defs/Step" }
|
|
155
|
+
},
|
|
156
|
+
attachments: {
|
|
157
|
+
type: "array",
|
|
158
|
+
items: { $ref: "#/$defs/Attachment" }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
required: ["id", "title", "status", "durationMs", "tags", "retry", "retries", "docEntries", "steps", "attachments"],
|
|
162
|
+
additionalProperties: false
|
|
163
|
+
},
|
|
164
|
+
Step: {
|
|
165
|
+
type: "object",
|
|
166
|
+
description: "A single BDD step.",
|
|
167
|
+
properties: {
|
|
168
|
+
id: { type: "string", minLength: 1 },
|
|
169
|
+
index: { type: "integer", minimum: 0 },
|
|
170
|
+
keyword: { $ref: "#/$defs/StepKeyword" },
|
|
171
|
+
text: { type: "string" },
|
|
172
|
+
status: { $ref: "#/$defs/TestStatus" },
|
|
173
|
+
durationMs: { type: "number", minimum: 0 },
|
|
174
|
+
errorMessage: { type: "string" },
|
|
175
|
+
mode: { $ref: "#/$defs/StepMode" },
|
|
176
|
+
docEntries: {
|
|
177
|
+
type: "array",
|
|
178
|
+
items: { $ref: "#/$defs/DocEntry" },
|
|
179
|
+
description: "Doc entries attached to this step."
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
required: ["id", "index", "keyword", "text", "status", "durationMs", "docEntries"],
|
|
183
|
+
additionalProperties: false
|
|
184
|
+
},
|
|
185
|
+
StepKeyword: {
|
|
186
|
+
type: "string",
|
|
187
|
+
enum: ["Given", "When", "Then", "And", "But"]
|
|
188
|
+
},
|
|
189
|
+
StepMode: {
|
|
190
|
+
type: "string",
|
|
191
|
+
enum: ["normal", "skip", "only", "todo", "fails", "concurrent"]
|
|
192
|
+
},
|
|
193
|
+
TestStatus: {
|
|
194
|
+
type: "string",
|
|
195
|
+
enum: ["passed", "failed", "skipped", "pending"]
|
|
196
|
+
},
|
|
197
|
+
Ticket: {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
id: { type: "string", minLength: 1 },
|
|
201
|
+
url: { type: "string" }
|
|
202
|
+
},
|
|
203
|
+
required: ["id"],
|
|
204
|
+
additionalProperties: false
|
|
205
|
+
},
|
|
206
|
+
Attachment: {
|
|
207
|
+
type: "object",
|
|
208
|
+
properties: {
|
|
209
|
+
name: { type: "string" },
|
|
210
|
+
mediaType: { type: "string", minLength: 1 },
|
|
211
|
+
body: { type: "string" },
|
|
212
|
+
contentEncoding: {
|
|
213
|
+
type: "string",
|
|
214
|
+
enum: ["BASE64", "IDENTITY"]
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
required: ["name", "mediaType", "body", "contentEncoding"],
|
|
218
|
+
additionalProperties: false
|
|
219
|
+
},
|
|
220
|
+
CIInfo: {
|
|
221
|
+
type: "object",
|
|
222
|
+
properties: {
|
|
223
|
+
name: { type: "string" },
|
|
224
|
+
url: { type: "string" },
|
|
225
|
+
buildNumber: { type: "string" },
|
|
226
|
+
branch: { type: "string" },
|
|
227
|
+
commitSha: { type: "string" },
|
|
228
|
+
prNumber: { type: "string" }
|
|
229
|
+
},
|
|
230
|
+
required: ["name"],
|
|
231
|
+
additionalProperties: false
|
|
232
|
+
},
|
|
233
|
+
CoverageSummary: {
|
|
234
|
+
type: "object",
|
|
235
|
+
properties: {
|
|
236
|
+
linesPct: { type: "number", minimum: 0, maximum: 100 },
|
|
237
|
+
branchesPct: { type: "number", minimum: 0, maximum: 100 },
|
|
238
|
+
functionsPct: { type: "number", minimum: 0, maximum: 100 },
|
|
239
|
+
statementsPct: { type: "number", minimum: 0, maximum: 100 }
|
|
240
|
+
},
|
|
241
|
+
additionalProperties: false
|
|
242
|
+
},
|
|
243
|
+
DocPhase: {
|
|
244
|
+
type: "string",
|
|
245
|
+
enum: ["static", "runtime"]
|
|
246
|
+
},
|
|
247
|
+
DocEntry: {
|
|
248
|
+
oneOf: [
|
|
249
|
+
{ $ref: "#/$defs/DocNote" },
|
|
250
|
+
{ $ref: "#/$defs/DocTag" },
|
|
251
|
+
{ $ref: "#/$defs/DocKv" },
|
|
252
|
+
{ $ref: "#/$defs/DocCode" },
|
|
253
|
+
{ $ref: "#/$defs/DocTable" },
|
|
254
|
+
{ $ref: "#/$defs/DocLink" },
|
|
255
|
+
{ $ref: "#/$defs/DocSection" },
|
|
256
|
+
{ $ref: "#/$defs/DocMermaid" },
|
|
257
|
+
{ $ref: "#/$defs/DocScreenshot" },
|
|
258
|
+
{ $ref: "#/$defs/DocCustom" }
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
DocNote: {
|
|
262
|
+
type: "object",
|
|
263
|
+
properties: {
|
|
264
|
+
kind: { const: "note" },
|
|
265
|
+
text: { type: "string" },
|
|
266
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
267
|
+
children: {
|
|
268
|
+
type: "array",
|
|
269
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
required: ["kind", "text", "phase"],
|
|
273
|
+
additionalProperties: false
|
|
274
|
+
},
|
|
275
|
+
DocTag: {
|
|
276
|
+
type: "object",
|
|
277
|
+
properties: {
|
|
278
|
+
kind: { const: "tag" },
|
|
279
|
+
names: { type: "array", items: { type: "string" } },
|
|
280
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
281
|
+
children: {
|
|
282
|
+
type: "array",
|
|
283
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
required: ["kind", "names", "phase"],
|
|
287
|
+
additionalProperties: false
|
|
288
|
+
},
|
|
289
|
+
DocKv: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: {
|
|
292
|
+
kind: { const: "kv" },
|
|
293
|
+
label: { type: "string" },
|
|
294
|
+
value: {},
|
|
295
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
296
|
+
children: {
|
|
297
|
+
type: "array",
|
|
298
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
required: ["kind", "label", "value", "phase"],
|
|
302
|
+
additionalProperties: false
|
|
303
|
+
},
|
|
304
|
+
DocCode: {
|
|
305
|
+
type: "object",
|
|
306
|
+
properties: {
|
|
307
|
+
kind: { const: "code" },
|
|
308
|
+
label: { type: "string" },
|
|
309
|
+
content: { type: "string" },
|
|
310
|
+
lang: { type: "string" },
|
|
311
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
312
|
+
children: {
|
|
313
|
+
type: "array",
|
|
314
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
required: ["kind", "label", "content", "phase"],
|
|
318
|
+
additionalProperties: false
|
|
319
|
+
},
|
|
320
|
+
DocTable: {
|
|
321
|
+
type: "object",
|
|
322
|
+
properties: {
|
|
323
|
+
kind: { const: "table" },
|
|
324
|
+
label: { type: "string" },
|
|
325
|
+
columns: { type: "array", items: { type: "string" } },
|
|
326
|
+
rows: {
|
|
327
|
+
type: "array",
|
|
328
|
+
items: {
|
|
329
|
+
type: "array",
|
|
330
|
+
items: { type: "string" }
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
334
|
+
children: {
|
|
335
|
+
type: "array",
|
|
336
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
required: ["kind", "label", "columns", "rows", "phase"],
|
|
340
|
+
additionalProperties: false
|
|
341
|
+
},
|
|
342
|
+
DocLink: {
|
|
343
|
+
type: "object",
|
|
344
|
+
properties: {
|
|
345
|
+
kind: { const: "link" },
|
|
346
|
+
label: { type: "string" },
|
|
347
|
+
url: { type: "string" },
|
|
348
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
349
|
+
children: {
|
|
350
|
+
type: "array",
|
|
351
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
required: ["kind", "label", "url", "phase"],
|
|
355
|
+
additionalProperties: false
|
|
356
|
+
},
|
|
357
|
+
DocSection: {
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {
|
|
360
|
+
kind: { const: "section" },
|
|
361
|
+
title: { type: "string" },
|
|
362
|
+
markdown: { type: "string" },
|
|
363
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
364
|
+
children: {
|
|
365
|
+
type: "array",
|
|
366
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
required: ["kind", "title", "markdown", "phase"],
|
|
370
|
+
additionalProperties: false
|
|
371
|
+
},
|
|
372
|
+
DocMermaid: {
|
|
373
|
+
type: "object",
|
|
374
|
+
properties: {
|
|
375
|
+
kind: { const: "mermaid" },
|
|
376
|
+
code: { type: "string" },
|
|
377
|
+
title: { type: "string" },
|
|
378
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
379
|
+
children: {
|
|
380
|
+
type: "array",
|
|
381
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
required: ["kind", "code", "phase"],
|
|
385
|
+
additionalProperties: false
|
|
386
|
+
},
|
|
387
|
+
DocScreenshot: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: {
|
|
390
|
+
kind: { const: "screenshot" },
|
|
391
|
+
path: { type: "string" },
|
|
392
|
+
alt: { type: "string" },
|
|
393
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
394
|
+
children: {
|
|
395
|
+
type: "array",
|
|
396
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
required: ["kind", "path", "phase"],
|
|
400
|
+
additionalProperties: false
|
|
401
|
+
},
|
|
402
|
+
DocCustom: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
kind: { const: "custom" },
|
|
406
|
+
type: { type: "string", minLength: 1 },
|
|
407
|
+
data: {},
|
|
408
|
+
phase: { $ref: "#/$defs/DocPhase" },
|
|
409
|
+
children: {
|
|
410
|
+
type: "array",
|
|
411
|
+
items: { $ref: "#/$defs/DocEntry" }
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
required: ["kind", "type", "data", "phase"],
|
|
415
|
+
additionalProperties: false
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
// src/schema/story-report.schema.ts
|
|
421
|
+
var compiled = z.fromJSONSchema(story_report_v1_default);
|
|
422
|
+
var storyReportSchema = compiled;
|
|
423
|
+
var STORY_REPORT_SCHEMA_MAJOR = 1;
|
|
424
|
+
|
|
425
|
+
// src/schema/parse.ts
|
|
426
|
+
function parseStoryReport(input) {
|
|
427
|
+
if (input === null || typeof input !== "object") {
|
|
428
|
+
return err({
|
|
429
|
+
message: "Expected a StoryReport object.",
|
|
430
|
+
code: "INVALID_INPUT"
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
const versionRaw = input.schemaVersion;
|
|
434
|
+
if (typeof versionRaw === "string") {
|
|
435
|
+
const major = versionRaw.split(".")[0];
|
|
436
|
+
if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {
|
|
437
|
+
return err({
|
|
438
|
+
message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,
|
|
439
|
+
code: "SCHEMA_VERSION_MISMATCH"
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
const parsed = storyReportSchema.safeParse(input);
|
|
444
|
+
if (parsed.success) {
|
|
445
|
+
return ok(parsed.data);
|
|
446
|
+
}
|
|
447
|
+
const issues = parsed.error.issues.map((i) => ({
|
|
448
|
+
path: i.path.join(".") || "/",
|
|
449
|
+
message: i.message
|
|
450
|
+
}));
|
|
451
|
+
return err({
|
|
452
|
+
message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? "" : "s"}).`,
|
|
453
|
+
code: "VALIDATION_FAILED",
|
|
454
|
+
issues
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
export {
|
|
458
|
+
STORY_REPORT_SCHEMA_MAJOR,
|
|
459
|
+
err,
|
|
460
|
+
ok,
|
|
461
|
+
parseStoryReport,
|
|
462
|
+
storyReportSchema
|
|
463
|
+
};
|
|
464
|
+
//# sourceMappingURL=parse.js.map
|