executable-stories-formatters 0.15.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.
- package/dist/cli.js +41 -9
- package/dist/cli.js.map +1 -1
- package/package.json +3 -2
- package/schemas/README.md +1 -1
- package/templates/astro-starlight/astro.config.mjs +57 -0
- package/templates/astro-starlight/gitignore +14 -0
- package/templates/astro-starlight/package.json +20 -0
- package/templates/astro-starlight/public/stories/assets/.gitkeep +0 -0
- package/templates/astro-starlight/public/stories/notes-index.json +4 -0
- package/templates/astro-starlight/public/stories/story-report.json +17 -0
- package/templates/astro-starlight/src/components/ApiOperations.astro +366 -0
- package/templates/astro-starlight/src/components/Checklist.astro +15 -0
- package/templates/astro-starlight/src/components/HealthDashboard.astro +171 -0
- package/templates/astro-starlight/src/components/PageTitle.astro +53 -0
- package/templates/astro-starlight/src/components/VerifiedBy.astro +281 -0
- package/templates/astro-starlight/src/components/VerifiedStep.astro +91 -0
- package/templates/astro-starlight/src/content/docs/examples/example-adr.mdx +45 -0
- package/templates/astro-starlight/src/content/docs/guides/behavior-portal.mdx +41 -0
- package/templates/astro-starlight/src/content/docs/guides/writing-docs.mdx +49 -0
- package/templates/astro-starlight/src/content/docs/index.mdx +49 -0
- package/templates/astro-starlight/src/content/docs/stories/.gitkeep +0 -0
- package/templates/astro-starlight/src/content.config.ts +18 -0
- package/templates/astro-starlight/src/lib/config.ts +50 -0
- package/templates/astro-starlight/src/lib/render-doc-entry.ts +154 -0
- package/templates/astro-starlight/src/lib/report-health.ts +61 -0
- package/templates/astro-starlight/src/lib/verification.ts +247 -0
- package/templates/astro-starlight/src/pages/explorer/explorer.css +729 -0
- package/templates/astro-starlight/src/pages/explorer/index.astro +404 -0
- package/templates/astro-starlight/src/styles/global.css +293 -0
- package/templates/astro-starlight/src/styles/themes/corporate.css +83 -0
- package/templates/astro-starlight/src/styles/themes/dashboard.css +76 -0
- package/templates/astro-starlight/src/styles/themes/default.css +86 -0
- package/templates/astro-starlight/src/styles/themes/minimal.css +87 -0
- package/templates/astro-starlight/src/styles/themes/playful.css +77 -0
- package/templates/astro-starlight/src/styles/themes/terminal.css +77 -0
- package/templates/astro-starlight/tsconfig.json +13 -0
package/dist/cli.js
CHANGED
|
@@ -21987,6 +21987,9 @@ import { fileURLToPath } from "url";
|
|
|
21987
21987
|
var __dirname = path10.dirname(fileURLToPath(import.meta.url));
|
|
21988
21988
|
var FRAMEWORK_DIRS = ["src/components", "src/lib", "src/styles", "src/pages"];
|
|
21989
21989
|
var FRAMEWORK_FILES = ["tsconfig.json"];
|
|
21990
|
+
function isScaffoldedAstroSite(dir) {
|
|
21991
|
+
return fs9.existsSync(path10.join(dir, "astro.config.mjs"));
|
|
21992
|
+
}
|
|
21990
21993
|
function initAstro(options = {}) {
|
|
21991
21994
|
const targetDir = options.targetDir ?? "./story-docs";
|
|
21992
21995
|
const force = options.force ?? false;
|
|
@@ -22012,7 +22015,7 @@ function initAstro(options = {}) {
|
|
|
22012
22015
|
return { targetDir };
|
|
22013
22016
|
}
|
|
22014
22017
|
function updateFrameworkFiles(templateDir, targetDir) {
|
|
22015
|
-
if (!
|
|
22018
|
+
if (!isScaffoldedAstroSite(targetDir)) {
|
|
22016
22019
|
throw new Error(
|
|
22017
22020
|
`"${targetDir}" does not look like a scaffolded docs site. Run init-astro (without --update) first.`
|
|
22018
22021
|
);
|
|
@@ -22057,7 +22060,8 @@ function copyDirRecursive(src, dest, onFile, baseSrc = src) {
|
|
|
22057
22060
|
const entries = fs9.readdirSync(src, { withFileTypes: true });
|
|
22058
22061
|
for (const entry of entries) {
|
|
22059
22062
|
const srcPath = path10.join(src, entry.name);
|
|
22060
|
-
const
|
|
22063
|
+
const destName = entry.name === "gitignore" ? ".gitignore" : entry.name;
|
|
22064
|
+
const destPath = path10.join(dest, destName);
|
|
22061
22065
|
if (entry.isDirectory()) {
|
|
22062
22066
|
copyDirRecursive(srcPath, destPath, onFile, baseSrc);
|
|
22063
22067
|
} else {
|
|
@@ -23019,6 +23023,12 @@ ${schemaResult.errors.map((e) => ` ${e}`).join("\n")}`,
|
|
|
23019
23023
|
}
|
|
23020
23024
|
async function buildDocs(options) {
|
|
23021
23025
|
const siteDir = path16.resolve(options.siteDir);
|
|
23026
|
+
if (!isScaffoldedAstroSite(siteDir)) {
|
|
23027
|
+
throw new BuildDocsError(
|
|
23028
|
+
`"${siteDir}" is not a scaffolded Astro docs site (no astro.config.mjs). Run "executable-stories init-astro <dir>" first, then pass it with --site-dir <dir>.`,
|
|
23029
|
+
"usage"
|
|
23030
|
+
);
|
|
23031
|
+
}
|
|
23022
23032
|
const storiesPublicDir = path16.join(siteDir, "public", "stories");
|
|
23023
23033
|
const assetsDir = path16.join(storiesPublicDir, "assets");
|
|
23024
23034
|
const storyPagesDir = path16.join(siteDir, "src", "content", "docs", "stories");
|
|
@@ -23152,6 +23162,7 @@ executable-stories \u2014 Generate reports from test results JSON.
|
|
|
23152
23162
|
USAGE
|
|
23153
23163
|
executable-stories format <file> [options]
|
|
23154
23164
|
executable-stories format --stdin [options]
|
|
23165
|
+
executable-stories watch <raw-run.json> [options]
|
|
23155
23166
|
executable-stories compare <baseline-file> <current-file> [options]
|
|
23156
23167
|
executable-stories gate-release <dev-run.json> <rc-run.json> [options]
|
|
23157
23168
|
executable-stories review <file> --changed-files <path> [options]
|
|
@@ -23162,6 +23173,7 @@ USAGE
|
|
|
23162
23173
|
executable-stories validate <file>
|
|
23163
23174
|
executable-stories validate --stdin
|
|
23164
23175
|
executable-stories init-astro [directory]
|
|
23176
|
+
executable-stories build-docs <raw-run.json> [--site-dir <dir>] [options]
|
|
23165
23177
|
executable-stories new <template> "<name>" [options]
|
|
23166
23178
|
executable-stories check-links <dir> [options]
|
|
23167
23179
|
executable-stories import-openapi <spec> [options]
|
|
@@ -23183,6 +23195,7 @@ SUBCOMMANDS
|
|
|
23183
23195
|
triage Discovery worklist for agent loops: failing scenarios, regressions first, each with the code it covers
|
|
23184
23196
|
validate Validate a JSON file against the schema (no output generated)
|
|
23185
23197
|
init-astro Scaffold an Astro docs site for story output (Starlight with themed CSS)
|
|
23198
|
+
build-docs Build the living-docs site: one page per story file + Explorer data (auto-pickup, prunes deleted stories)
|
|
23186
23199
|
new Scaffold a docs page from a template (adr, runbook, decision-log, incident, scenario-note)
|
|
23187
23200
|
check-links Scan docs for broken internal/external links (CI-friendly exit code)
|
|
23188
23201
|
import-openapi Generate API doc pages from an OpenAPI spec, linked to verifying stories
|
|
@@ -23192,7 +23205,7 @@ SUBCOMMANDS
|
|
|
23192
23205
|
|
|
23193
23206
|
OPTIONS
|
|
23194
23207
|
--format <formats> Comma-separated formats: html, markdown, release-manifest, traceability-matrix, junit, cucumber-json, cucumber-messages, cucumber-html, astro, confluence, story-report-json, scenario-index-json, behavior-manifest-json, or custom names from config (default: html)
|
|
23195
|
-
astro Themed Markdown (for
|
|
23208
|
+
astro Themed Markdown primitive (single aggregated page; for a full site use "build-docs")
|
|
23196
23209
|
confluence Atlassian Document Format (ADF) JSON for Confluence / Jira
|
|
23197
23210
|
behavior-manifest-json Agent-readable behavior manifest and debugger warnings
|
|
23198
23211
|
html Custom HTML report (accessible, dark mode, mermaid)
|
|
@@ -23313,6 +23326,20 @@ DEPLOY
|
|
|
23313
23326
|
INIT-ASTRO
|
|
23314
23327
|
executable-stories init-astro [directory] Scaffold into directory (default: ./story-docs)
|
|
23315
23328
|
--force Overwrite existing directory
|
|
23329
|
+
--update Refresh framework files only (keeps your content + config)
|
|
23330
|
+
|
|
23331
|
+
BUILD-DOCS
|
|
23332
|
+
Build the multi-page living-docs site from a raw run: one Astro page per story
|
|
23333
|
+
file plus Explorer data (scenario-links.json, story-report.json). Auto-pickup \u2014
|
|
23334
|
+
a new *.story.test.ts becomes a new page on the next run; deleting a story
|
|
23335
|
+
prunes its page. This is the headline living-docs flow; "format --format astro"
|
|
23336
|
+
is a low-level primitive that emits a single aggregated page, not a site.
|
|
23337
|
+
|
|
23338
|
+
executable-stories build-docs <raw-run.json> [--site-dir <dir>]
|
|
23339
|
+
--site-dir <dir> Target site dir (default: a scaffolded init-astro site)
|
|
23340
|
+
--openapi <spec> Link generated API pages to verifying stories
|
|
23341
|
+
--baseline <prev-report> Diff against a prior story-report.json for change markers
|
|
23342
|
+
--audience-split Split pages by audience (business vs technical)
|
|
23316
23343
|
|
|
23317
23344
|
PUBLISH-CONFLUENCE
|
|
23318
23345
|
executable-stories publish-confluence <file.adf.json> [options]
|
|
@@ -23419,12 +23446,17 @@ async function parseCliArgs(argv) {
|
|
|
23419
23446
|
console.log("To change theme, edit astro.config.mjs customCss array.");
|
|
23420
23447
|
console.log("");
|
|
23421
23448
|
console.log("Next steps:");
|
|
23422
|
-
console.log(` cd ${result.targetDir}`);
|
|
23423
|
-
console.log("
|
|
23424
|
-
console.log("
|
|
23425
|
-
console.log("");
|
|
23426
|
-
console.log("
|
|
23427
|
-
console.log(
|
|
23449
|
+
console.log(` 1. cd ${result.targetDir} && pnpm install # or npm install`);
|
|
23450
|
+
console.log(" 2. In your TEST project, add the StoryReporter with a rawRunPath, e.g.");
|
|
23451
|
+
console.log(" StoryReporter({ rawRunPath: 'reports/raw-run.json' })");
|
|
23452
|
+
console.log(" (this is what writes the raw run that build-docs reads)");
|
|
23453
|
+
console.log(" 3. Run your tests to produce reports/raw-run.json:");
|
|
23454
|
+
console.log(" pnpm test");
|
|
23455
|
+
console.log(" 4. Build the living-docs site (story pages, explorer data, API pages):");
|
|
23456
|
+
console.log(
|
|
23457
|
+
` executable-stories build-docs reports/raw-run.json --site-dir ${result.targetDir} [--openapi spec.json]`
|
|
23458
|
+
);
|
|
23459
|
+
console.log(` 5. Preview it: cd ${result.targetDir} && pnpm dev`);
|
|
23428
23460
|
console.log("");
|
|
23429
23461
|
console.log("Later, pull template/design improvements without losing your content:");
|
|
23430
23462
|
console.log(` executable-stories init-astro ${result.targetDir} --update`);
|