executable-stories-formatters 0.14.0 → 0.15.1

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.
Files changed (42) hide show
  1. package/dist/cli.js +346 -167
  2. package/dist/cli.js.map +1 -1
  3. package/dist/index.cjs +8 -2
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +9 -0
  6. package/dist/index.d.ts +9 -0
  7. package/dist/index.js +8 -2
  8. package/dist/index.js.map +1 -1
  9. package/package.json +4 -2
  10. package/schemas/README.md +1 -1
  11. package/templates/astro-starlight/astro.config.mjs +57 -0
  12. package/templates/astro-starlight/gitignore +14 -0
  13. package/templates/astro-starlight/package.json +20 -0
  14. package/templates/astro-starlight/public/stories/assets/.gitkeep +0 -0
  15. package/templates/astro-starlight/public/stories/notes-index.json +4 -0
  16. package/templates/astro-starlight/public/stories/story-report.json +17 -0
  17. package/templates/astro-starlight/src/components/ApiOperations.astro +366 -0
  18. package/templates/astro-starlight/src/components/Checklist.astro +15 -0
  19. package/templates/astro-starlight/src/components/HealthDashboard.astro +171 -0
  20. package/templates/astro-starlight/src/components/PageTitle.astro +53 -0
  21. package/templates/astro-starlight/src/components/VerifiedBy.astro +281 -0
  22. package/templates/astro-starlight/src/components/VerifiedStep.astro +91 -0
  23. package/templates/astro-starlight/src/content/docs/examples/example-adr.mdx +45 -0
  24. package/templates/astro-starlight/src/content/docs/guides/behavior-portal.mdx +41 -0
  25. package/templates/astro-starlight/src/content/docs/guides/writing-docs.mdx +49 -0
  26. package/templates/astro-starlight/src/content/docs/index.mdx +49 -0
  27. package/templates/astro-starlight/src/content/docs/stories/.gitkeep +0 -0
  28. package/templates/astro-starlight/src/content.config.ts +18 -0
  29. package/templates/astro-starlight/src/lib/config.ts +50 -0
  30. package/templates/astro-starlight/src/lib/render-doc-entry.ts +154 -0
  31. package/templates/astro-starlight/src/lib/report-health.ts +61 -0
  32. package/templates/astro-starlight/src/lib/verification.ts +247 -0
  33. package/templates/astro-starlight/src/pages/explorer/explorer.css +729 -0
  34. package/templates/astro-starlight/src/pages/explorer/index.astro +404 -0
  35. package/templates/astro-starlight/src/styles/global.css +293 -0
  36. package/templates/astro-starlight/src/styles/themes/corporate.css +83 -0
  37. package/templates/astro-starlight/src/styles/themes/dashboard.css +76 -0
  38. package/templates/astro-starlight/src/styles/themes/default.css +86 -0
  39. package/templates/astro-starlight/src/styles/themes/minimal.css +87 -0
  40. package/templates/astro-starlight/src/styles/themes/playful.css +77 -0
  41. package/templates/astro-starlight/src/styles/themes/terminal.css +77 -0
  42. package/templates/astro-starlight/tsconfig.json +13 -0
package/dist/index.d.cts CHANGED
@@ -364,6 +364,8 @@ interface MarkdownFormatterOptions {
364
364
  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
365
365
  /** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
366
366
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
367
+ /** Render a business-context link line under a scenario heading. Undefined to skip. */
368
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
367
369
  }
368
370
 
369
371
  /** Astro/Starlight formatter options */
@@ -493,6 +495,7 @@ interface ResolvedFormatterOptions {
493
495
  customRenderers?: MarkdownRenderers;
494
496
  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
495
497
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
498
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
496
499
  };
497
500
  };
498
501
  assetMode: "none" | "copy";
@@ -1943,6 +1946,12 @@ interface MarkdownOptions {
1943
1946
  * line, or undefined to skip. Off by default — only the living-docs site opts in.
1944
1947
  */
1945
1948
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
1949
+ /**
1950
+ * Render a link line under a scenario heading pointing at hand-written context
1951
+ * (the scenario's note page). Return the markdown line, or undefined to skip.
1952
+ * Off by default — only the living-docs site opts in.
1953
+ */
1954
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
1946
1955
  }
1947
1956
  /**
1948
1957
  * Markdown Formatter.
package/dist/index.d.ts CHANGED
@@ -364,6 +364,8 @@ interface MarkdownFormatterOptions {
364
364
  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
365
365
  /** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
366
366
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
367
+ /** Render a business-context link line under a scenario heading. Undefined to skip. */
368
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
367
369
  }
368
370
 
369
371
  /** Astro/Starlight formatter options */
@@ -493,6 +495,7 @@ interface ResolvedFormatterOptions {
493
495
  customRenderers?: MarkdownRenderers;
494
496
  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
495
497
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
498
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
496
499
  };
497
500
  };
498
501
  assetMode: "none" | "copy";
@@ -1943,6 +1946,12 @@ interface MarkdownOptions {
1943
1946
  * line, or undefined to skip. Off by default — only the living-docs site opts in.
1944
1947
  */
1945
1948
  scenarioBadge?: (tc: TestCaseResult) => string | undefined;
1949
+ /**
1950
+ * Render a link line under a scenario heading pointing at hand-written context
1951
+ * (the scenario's note page). Return the markdown line, or undefined to skip.
1952
+ * Off by default — only the living-docs site opts in.
1953
+ */
1954
+ scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
1946
1955
  }
1947
1956
  /**
1948
1957
  * Markdown Formatter.
package/dist/index.js CHANGED
@@ -15126,7 +15126,8 @@ var MarkdownFormatter = class {
15126
15126
  includeSourceLinks: options.includeSourceLinks ?? true,
15127
15127
  customRenderers: options.customRenderers,
15128
15128
  scenarioAnchor: options.scenarioAnchor,
15129
- scenarioBadge: options.scenarioBadge
15129
+ scenarioBadge: options.scenarioBadge,
15130
+ scenarioNoteLink: options.scenarioNoteLink
15130
15131
  };
15131
15132
  }
15132
15133
  /**
@@ -15337,6 +15338,10 @@ var MarkdownFormatter = class {
15337
15338
  if (badge) {
15338
15339
  lines.push(badge);
15339
15340
  }
15341
+ const noteLink = this.options.scenarioNoteLink?.(tc);
15342
+ if (noteLink) {
15343
+ lines.push(noteLink);
15344
+ }
15340
15345
  if (this.options.includeSourceLinks && this.options.permalinkBaseUrl && tc.sourceFile !== "unknown") {
15341
15346
  const permalink = this.buildPermalink(tc);
15342
15347
  lines.push(`Source: [${tc.sourceFile}](${permalink})`);
@@ -21879,7 +21884,8 @@ var ReportGenerator = class {
21879
21884
  traceUrlTemplate: options.astro?.markdown?.traceUrlTemplate,
21880
21885
  customRenderers: options.astro?.markdown?.customRenderers,
21881
21886
  scenarioAnchor: options.astro?.markdown?.scenarioAnchor,
21882
- scenarioBadge: options.astro?.markdown?.scenarioBadge
21887
+ scenarioBadge: options.astro?.markdown?.scenarioBadge,
21888
+ scenarioNoteLink: options.astro?.markdown?.scenarioNoteLink
21883
21889
  }
21884
21890
  },
21885
21891
  assetMode: options.assetMode ?? "none",