@imolko/create-ultra-reporter 2.1.23-beta
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 +219 -0
- package/bin/classes/index.d.ts +0 -0
- package/bin/classes/index.js +2 -0
- package/bin/classes/index.js.map +1 -0
- package/bin/classes/logger.d.ts +42 -0
- package/bin/classes/logger.js +185 -0
- package/bin/classes/logger.js.map +1 -0
- package/bin/cli.d.ts +2 -0
- package/bin/cli.js +48 -0
- package/bin/cli.js.map +1 -0
- package/bin/commands/build.d.ts +2 -0
- package/bin/commands/build.js +151 -0
- package/bin/commands/build.js.map +1 -0
- package/bin/commands/create.d.ts +60 -0
- package/bin/commands/create.js +368 -0
- package/bin/commands/create.js.map +1 -0
- package/bin/commands/generate-documentation.d.ts +2 -0
- package/bin/commands/generate-documentation.js +249 -0
- package/bin/commands/generate-documentation.js.map +1 -0
- package/bin/commands/generate.d.ts +2 -0
- package/bin/commands/generate.js +79 -0
- package/bin/commands/generate.js.map +1 -0
- package/bin/commands/index.d.ts +6 -0
- package/bin/commands/index.js +16 -0
- package/bin/commands/index.js.map +1 -0
- package/bin/commands/init.d.ts +2 -0
- package/bin/commands/init.js +54 -0
- package/bin/commands/init.js.map +1 -0
- package/bin/commands/serve.d.ts +2 -0
- package/bin/commands/serve.js +124 -0
- package/bin/commands/serve.js.map +1 -0
- package/bin/commands/types.d.ts +65 -0
- package/bin/commands/types.js +9 -0
- package/bin/commands/types.js.map +1 -0
- package/bin/config/reader.d.ts +17 -0
- package/bin/config/reader.js +166 -0
- package/bin/config/reader.js.map +1 -0
- package/bin/config/types.d.ts +57 -0
- package/bin/config/types.js +21 -0
- package/bin/config/types.js.map +1 -0
- package/bin/data/documentation-folder.d.ts +1 -0
- package/bin/data/documentation-folder.js +5 -0
- package/bin/data/documentation-folder.js.map +1 -0
- package/bin/data/files-generated.d.ts +1 -0
- package/bin/data/files-generated.js +10 -0
- package/bin/data/files-generated.js.map +1 -0
- package/bin/data/index.d.ts +2 -0
- package/bin/data/index.js +8 -0
- package/bin/data/index.js.map +1 -0
- package/bin/pipeline/generate.d.ts +26 -0
- package/bin/pipeline/generate.js +269 -0
- package/bin/pipeline/generate.js.map +1 -0
- package/bin/reporters/data-loading.d.ts +121 -0
- package/bin/reporters/data-loading.js +398 -0
- package/bin/reporters/data-loading.js.map +1 -0
- package/bin/reporters/data-transformation.d.ts +101 -0
- package/bin/reporters/data-transformation.js +392 -0
- package/bin/reporters/data-transformation.js.map +1 -0
- package/bin/reporters/file-writing.d.ts +29 -0
- package/bin/reporters/file-writing.js +100 -0
- package/bin/reporters/file-writing.js.map +1 -0
- package/bin/reporters/generate-domain-documentation.d.ts +17 -0
- package/bin/reporters/generate-domain-documentation.js +161 -0
- package/bin/reporters/generate-domain-documentation.js.map +1 -0
- package/bin/reporters/generate-use-cases-documentation.d.ts +18 -0
- package/bin/reporters/generate-use-cases-documentation.js +123 -0
- package/bin/reporters/generate-use-cases-documentation.js.map +1 -0
- package/bin/reporters/rendering.d.ts +116 -0
- package/bin/reporters/rendering.js +385 -0
- package/bin/reporters/rendering.js.map +1 -0
- package/bin/reporters/templates/README.md +28 -0
- package/bin/reporters/templates/card.template.jsx +5 -0
- package/bin/reporters/templates/cards-container.template.jsx +5 -0
- package/bin/reporters/types.d.ts +190 -0
- package/bin/reporters/types.js +8 -0
- package/bin/reporters/types.js.map +1 -0
- package/bin/scaffold/assembler.d.ts +13 -0
- package/bin/scaffold/assembler.js +371 -0
- package/bin/scaffold/assembler.js.map +1 -0
- package/bin/scaffold/doc-assembler.d.ts +10 -0
- package/bin/scaffold/doc-assembler.js +113 -0
- package/bin/scaffold/doc-assembler.js.map +1 -0
- package/bin/scripts/add-import.d.ts +1 -0
- package/bin/scripts/add-import.js +26 -0
- package/bin/scripts/add-import.js.map +1 -0
- package/bin/scripts/converter.d.ts +6 -0
- package/bin/scripts/converter.js +120 -0
- package/bin/scripts/converter.js.map +1 -0
- package/bin/scripts/copy-files.d.ts +1 -0
- package/bin/scripts/copy-files.js +96 -0
- package/bin/scripts/copy-files.js.map +1 -0
- package/bin/scripts/create-folder.d.ts +1 -0
- package/bin/scripts/create-folder.js +23 -0
- package/bin/scripts/create-folder.js.map +1 -0
- package/bin/scripts/delete-paths.d.ts +1 -0
- package/bin/scripts/delete-paths.js +34 -0
- package/bin/scripts/delete-paths.js.map +1 -0
- package/bin/scripts/exists-file.d.ts +5 -0
- package/bin/scripts/exists-file.js +12 -0
- package/bin/scripts/exists-file.js.map +1 -0
- package/bin/scripts/generate-track-artifacts.d.ts +1 -0
- package/bin/scripts/generate-track-artifacts.js +59 -0
- package/bin/scripts/generate-track-artifacts.js.map +1 -0
- package/bin/scripts/get-artifacts.d.ts +1 -0
- package/bin/scripts/get-artifacts.js +38 -0
- package/bin/scripts/get-artifacts.js.map +1 -0
- package/bin/scripts/get-directories.d.ts +1 -0
- package/bin/scripts/get-directories.js +10 -0
- package/bin/scripts/get-directories.js.map +1 -0
- package/bin/scripts/get-file.d.ts +9 -0
- package/bin/scripts/get-file.js +38 -0
- package/bin/scripts/get-file.js.map +1 -0
- package/bin/scripts/labels.d.ts +35 -0
- package/bin/scripts/labels.js +108 -0
- package/bin/scripts/labels.js.map +1 -0
- package/bin/scripts/markdown.d.ts +34 -0
- package/bin/scripts/markdown.js +99 -0
- package/bin/scripts/markdown.js.map +1 -0
- package/bin/scripts/names.d.ts +18 -0
- package/bin/scripts/names.js +64 -0
- package/bin/scripts/names.js.map +1 -0
- package/bin/scripts/track-artifacts.d.ts +2 -0
- package/bin/scripts/track-artifacts.js +101 -0
- package/bin/scripts/track-artifacts.js.map +1 -0
- package/bin/utils/create-folder.d.ts +1 -0
- package/bin/utils/create-folder.js +23 -0
- package/bin/utils/create-folder.js.map +1 -0
- package/bin/utils/delete-markdown-files.d.ts +1 -0
- package/bin/utils/delete-markdown-files.js +46 -0
- package/bin/utils/delete-markdown-files.js.map +1 -0
- package/bin/utils/delete-paths.d.ts +5 -0
- package/bin/utils/delete-paths.js +26 -0
- package/bin/utils/delete-paths.js.map +1 -0
- package/bin/utils/exists-file.d.ts +6 -0
- package/bin/utils/exists-file.js +13 -0
- package/bin/utils/exists-file.js.map +1 -0
- package/bin/utils/exists-folder.d.ts +6 -0
- package/bin/utils/exists-folder.js +13 -0
- package/bin/utils/exists-folder.js.map +1 -0
- package/bin/utils/get-internal-resource-path.d.ts +1 -0
- package/bin/utils/get-internal-resource-path.js +43 -0
- package/bin/utils/get-internal-resource-path.js.map +1 -0
- package/bin/utils/get-json-file.d.ts +1 -0
- package/bin/utils/get-json-file.js +27 -0
- package/bin/utils/get-json-file.js.map +1 -0
- package/bin/utils/index.d.ts +6 -0
- package/bin/utils/index.js +16 -0
- package/bin/utils/index.js.map +1 -0
- package/bin/utils/run-command.d.ts +5 -0
- package/bin/utils/run-command.js +36 -0
- package/bin/utils/run-command.js.map +1 -0
- package/jsdoc.conf.json +30 -0
- package/package.json +75 -0
- package/templates/documentation/README.md +41 -0
- package/templates/documentation/docs/.gitkeep +0 -0
- package/templates/documentation/docusaurus.config.ts +127 -0
- package/templates/documentation/package-lock.json +19431 -0
- package/templates/documentation/package.json +49 -0
- package/templates/documentation/sidebars.ts +33 -0
- package/templates/documentation/src/components/ArtifactTable/FilterBar.tsx +185 -0
- package/templates/documentation/src/components/ArtifactTable/index.tsx +298 -0
- package/templates/documentation/src/components/ArtifactTable/styles.module.css +282 -0
- package/templates/documentation/src/components/ArtifactTable/types.ts +31 -0
- package/templates/documentation/src/components/HomepageFeatures/index.tsx +77 -0
- package/templates/documentation/src/components/HomepageFeatures/styles.module.css +11 -0
- package/templates/documentation/src/css/custom.css +30 -0
- package/templates/documentation/src/pages/index.module.css +23 -0
- package/templates/documentation/src/pages/index.tsx +43 -0
- package/templates/documentation/src/pages/markdown-page.md +7 -0
- package/templates/documentation/static/.nojekyll +0 -0
- package/templates/documentation/static/img/docusaurus-social-card.jpg +0 -0
- package/templates/documentation/static/img/docusaurus.png +0 -0
- package/templates/documentation/static/img/favicon.ico +0 -0
- package/templates/documentation/static/img/logo.svg +1 -0
- package/templates/documentation/static/img/logo_imolko_azul.png +0 -0
- package/templates/documentation/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/templates/documentation/static/img/undraw_docusaurus_react.svg +170 -0
- package/templates/documentation/static/img/undraw_docusaurus_tree.svg +40 -0
- package/templates/documentation/tsconfig.json +8 -0
- package/templates/documentation/ultra-reporter.config.json +55 -0
- package/templates/track-artifacts-script.ts +44 -0
- package/tsconfig.build-track.json +39 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Domain Reporter Orchestrator
|
|
4
|
+
//
|
|
5
|
+
// Composed pipeline: load → transform → render → write.
|
|
6
|
+
// Replaces the monolithic ReporterDomainGenerator class with independently
|
|
7
|
+
// testable functions from data-loading, data-transformation, rendering,
|
|
8
|
+
// and file-writing layers.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.generateDomainDocumentation = generateDomainDocumentation;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const get_file_1 = require("../scripts/get-file");
|
|
48
|
+
const markdown_1 = require("../scripts/markdown");
|
|
49
|
+
const data_loading_1 = require("./data-loading");
|
|
50
|
+
const data_transformation_1 = require("./data-transformation");
|
|
51
|
+
const rendering_1 = require("./rendering");
|
|
52
|
+
const file_writing_1 = require("./file-writing");
|
|
53
|
+
const data_transformation_2 = require("./data-transformation");
|
|
54
|
+
/**
|
|
55
|
+
* Generates domain documentation by composing the full pipeline:
|
|
56
|
+
* load artifacts/JSDoc/tests → match & enrich → render → write.
|
|
57
|
+
*
|
|
58
|
+
* @param args - Paths and naming configuration
|
|
59
|
+
*/
|
|
60
|
+
async function generateDomainDocumentation(args) {
|
|
61
|
+
const cwd = process.cwd();
|
|
62
|
+
const packageRootName = args.packageRootName || 'domainX';
|
|
63
|
+
const contextName = args.contextName || 'default';
|
|
64
|
+
const documentationPath = args.documentationPath || './documentation';
|
|
65
|
+
const domainPath = args.domainPath || './domain/src';
|
|
66
|
+
const domainTabName = args.domainTabName || 'domain';
|
|
67
|
+
const aggregateTabName = args.aggregateTabName || 'aggregate';
|
|
68
|
+
console.log('[reporter-domain] Generating Domain Report...');
|
|
69
|
+
// Resolve data paths
|
|
70
|
+
const dataDir = `${documentationPath}/.data-generated/${packageRootName}`;
|
|
71
|
+
const artifactsDataPath = path.resolve(cwd, `${dataDir}/artifacts.json`);
|
|
72
|
+
const jsdocReportDataPath = path.resolve(cwd, `${dataDir}/jsdoc-report.txt`);
|
|
73
|
+
const testResultsDataPath = path.resolve(cwd, `${dataDir}/test-results.json`);
|
|
74
|
+
// ---- 1. Load raw data ----
|
|
75
|
+
const artifacts = await (0, data_loading_1.loadArtifacts)(artifactsDataPath);
|
|
76
|
+
const jsdocData = await (0, data_loading_1.loadJsdocReport)(jsdocReportDataPath);
|
|
77
|
+
const allTestResults = await (0, data_loading_1.loadTestResults)(testResultsDataPath);
|
|
78
|
+
// ---- 2. Match JSDoc to artifacts ----
|
|
79
|
+
const jsdocByPath = (0, data_transformation_1.matchJsdocToArtifacts)(jsdocData, artifacts);
|
|
80
|
+
// ---- 3. Enrich each artifact ----
|
|
81
|
+
const enrichedArtifacts = [];
|
|
82
|
+
for (const artifact of artifacts) {
|
|
83
|
+
const jsdocElems = jsdocByPath.get(artifact.jsondocMustMatchPath) || [];
|
|
84
|
+
const enriched = await (0, data_transformation_1.enrichArtifact)(artifact, jsdocElems, allTestResults, cwd, domainPath, contextName);
|
|
85
|
+
enrichedArtifacts.push(enriched);
|
|
86
|
+
}
|
|
87
|
+
// ---- 4. Render and write artifact pages ----
|
|
88
|
+
const targetDomainPath = `${documentationPath}/docs/${domainTabName}`;
|
|
89
|
+
const targetAggregatePath = `${documentationPath}/docs/${aggregateTabName}`;
|
|
90
|
+
const pages = [];
|
|
91
|
+
for (const enriched of enrichedArtifacts) {
|
|
92
|
+
// Render with skipAttachments=true so we can defer attachments
|
|
93
|
+
// replacement until after minification (preserving natural markdown formatting)
|
|
94
|
+
let markdown = (0, rendering_1.renderArtifactPage)(enriched, { skipAttachments: true, repoSourceUrl: args.repoSourceUrl });
|
|
95
|
+
// Beautify normalizes whitespace (trim spaces inside tags, normalize
|
|
96
|
+
// attribute spacing), then minify removes whitespace between tags
|
|
97
|
+
markdown = (0, markdown_1.beautifyMarkdown)(markdown);
|
|
98
|
+
markdown = (0, markdown_1.minifyMarkdown)(markdown);
|
|
99
|
+
// Replace attachments marker BEFORE stripJsxComments so the marker
|
|
100
|
+
// is still present for replacement. This is done after minification
|
|
101
|
+
// so attachment markdown keeps its natural formatting.
|
|
102
|
+
if (enriched.hasAttachments && enriched.attachmentsMd) {
|
|
103
|
+
const attachmentsHtml = `\n\n<div style={{ backgroundColor: '#EEE', margin: '32px 0', padding: '16px' }}>\n\n` +
|
|
104
|
+
`${enriched.attachmentsMd}\n\n </div>\n\n`;
|
|
105
|
+
markdown = markdown.replace('{/* attachments-md */}', attachmentsHtml);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
markdown = markdown.replace('{/* attachments-md */}', '');
|
|
109
|
+
}
|
|
110
|
+
// Strip remaining JSX comment markers (e.g., leftover { /* method-definition */ },
|
|
111
|
+
// { /* test-panel */ } placeholders from recursive template composition)
|
|
112
|
+
markdown = (0, markdown_1.stripJsxComments)(markdown);
|
|
113
|
+
// Build dest paths — aggregates also go to the aggregates tab
|
|
114
|
+
const destPaths = [
|
|
115
|
+
path.resolve(cwd, targetDomainPath, `${enriched.idMarkdown}.md`),
|
|
116
|
+
];
|
|
117
|
+
if (enriched.type === 'aggregate') {
|
|
118
|
+
destPaths.push(path.resolve(cwd, targetAggregatePath, `${enriched.idMarkdown}.md`));
|
|
119
|
+
}
|
|
120
|
+
pages.push({ markdown, destPaths });
|
|
121
|
+
}
|
|
122
|
+
(0, file_writing_1.writeArtifactPages)(pages);
|
|
123
|
+
// ---- 5. Generate artifact manifest for searchable table ----
|
|
124
|
+
const manifestEntries = (0, data_transformation_2.buildManifestEntries)(enrichedArtifacts, contextName);
|
|
125
|
+
(0, file_writing_1.appendManifestToStatic)(manifestEntries, documentationPath);
|
|
126
|
+
// ---- 6. Write category index.mdx pages ----
|
|
127
|
+
const domainIndexMdx = `---
|
|
128
|
+
title: Domain Artifacts
|
|
129
|
+
---
|
|
130
|
+
import ArtifactTable from '@site/src/components/ArtifactTable';
|
|
131
|
+
|
|
132
|
+
<ArtifactTable category="domain-artifacts" />
|
|
133
|
+
`;
|
|
134
|
+
const aggregateIndexMdx = `---
|
|
135
|
+
title: Aggregates
|
|
136
|
+
---
|
|
137
|
+
import ArtifactTable from '@site/src/components/ArtifactTable';
|
|
138
|
+
|
|
139
|
+
<ArtifactTable category="aggregates" />
|
|
140
|
+
`;
|
|
141
|
+
fs.mkdirSync(path.resolve(cwd, targetDomainPath), { recursive: true });
|
|
142
|
+
fs.writeFileSync(path.resolve(cwd, targetDomainPath, 'index.mdx'), domainIndexMdx);
|
|
143
|
+
fs.mkdirSync(path.resolve(cwd, targetAggregatePath), { recursive: true });
|
|
144
|
+
fs.writeFileSync(path.resolve(cwd, targetAggregatePath, 'index.mdx'), aggregateIndexMdx);
|
|
145
|
+
// ---- 7. Generate intro page ----
|
|
146
|
+
await generateIntro(cwd, domainPath, documentationPath);
|
|
147
|
+
console.log('[reporter-domain] Domain Report Generated!');
|
|
148
|
+
}
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
// generateIntro — writes the context-intro page directly (no aggregate cards)
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
async function generateIntro(cwd, domainPath, documentationPath) {
|
|
153
|
+
// Read context-intro.md
|
|
154
|
+
const introPath = path.resolve(cwd, domainPath, 'context-intro.md');
|
|
155
|
+
const contextIntroMd = await (0, get_file_1.getFile)(introPath);
|
|
156
|
+
const destPath = path.resolve(cwd, documentationPath, 'docs', 'intro.md');
|
|
157
|
+
const dir = path.dirname(destPath);
|
|
158
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
159
|
+
fs.writeFileSync(destPath, contextIntroMd);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=generate-domain-documentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-domain-documentation.js","sourceRoot":"","sources":["../../src/reporters/generate-domain-documentation.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,+BAA+B;AAC/B,EAAE;AACF,wDAAwD;AACxD,2EAA2E;AAC3E,wEAAwE;AACxE,2BAA2B;AAC3B,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8B9E,kEA6HC;AAzJD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA8C;AAC9C,kDAAyF;AACzF,iDAAiF;AACjF,+DAA8E;AAC9E,2CAAiD;AACjD,iDAA0F;AAE1F,+DAA6D;AAa7D;;;;;GAKG;AACI,KAAK,UAAU,2BAA2B,CAC/C,IAAwB;IAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,SAAS,CAAC;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,cAAc,CAAC;IACrD,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,QAAQ,CAAC;IACrD,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC;IAE9D,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAE7D,qBAAqB;IACrB,MAAM,OAAO,GAAG,GAAG,iBAAiB,oBAAoB,eAAe,EAAE,CAAC;IAC1E,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,iBAAiB,CAAC,CAAC;IACzE,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CA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;IACnC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface UseCasesReporterArgs {
|
|
2
|
+
packageRootName: string;
|
|
3
|
+
title: string;
|
|
4
|
+
documentationPath: string;
|
|
5
|
+
useCasesPath: string;
|
|
6
|
+
useCasesTabName: string;
|
|
7
|
+
templateDir: string;
|
|
8
|
+
cwd: string;
|
|
9
|
+
repoSourceUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates use-cases documentation by composing the full pipeline:
|
|
13
|
+
* load test results → discover folders → load definitions & attachments
|
|
14
|
+
* → enrich → render → write.
|
|
15
|
+
*
|
|
16
|
+
* @param args - Paths and naming configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateUseCasesDocumentation(args: UseCasesReporterArgs): Promise<void>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Use-Cases Reporter Orchestrator
|
|
4
|
+
//
|
|
5
|
+
// Composed pipeline: load → transform → render → write.
|
|
6
|
+
// Replaces the monolithic ReporterUseCasesGenerator class with independently
|
|
7
|
+
// testable functions from data-loading, data-transformation, rendering,
|
|
8
|
+
// and file-writing layers.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.generateUseCasesDocumentation = generateUseCasesDocumentation;
|
|
45
|
+
const path = __importStar(require("path"));
|
|
46
|
+
const markdown_1 = require("../scripts/markdown");
|
|
47
|
+
const data_loading_1 = require("./data-loading");
|
|
48
|
+
const data_transformation_1 = require("./data-transformation");
|
|
49
|
+
const rendering_1 = require("./rendering");
|
|
50
|
+
const file_writing_1 = require("./file-writing");
|
|
51
|
+
/**
|
|
52
|
+
* Generates use-cases documentation by composing the full pipeline:
|
|
53
|
+
* load test results → discover folders → load definitions & attachments
|
|
54
|
+
* → enrich → render → write.
|
|
55
|
+
*
|
|
56
|
+
* @param args - Paths and naming configuration
|
|
57
|
+
*/
|
|
58
|
+
async function generateUseCasesDocumentation(args) {
|
|
59
|
+
const cwd = args.cwd || process.cwd();
|
|
60
|
+
const packageRootName = args.packageRootName || 'featuresX';
|
|
61
|
+
const title = args.title || 'Default Use Cases';
|
|
62
|
+
const documentationPath = args.documentationPath || './documentation';
|
|
63
|
+
const useCasesPath = args.useCasesPath || './use-cases';
|
|
64
|
+
const useCasesTabName = args.useCasesTabName || 'domain';
|
|
65
|
+
console.log('[reporter-use-case] Generating Use Case Report...');
|
|
66
|
+
// Resolve data paths
|
|
67
|
+
const testResultsDataPath = path.resolve(cwd, `${documentationPath}/.data-generated/${packageRootName}/test-results.json`);
|
|
68
|
+
const targetDocusaurusPath = path.resolve(cwd, `${documentationPath}/docs/${useCasesTabName}`);
|
|
69
|
+
// ---- 1. Load test results ----
|
|
70
|
+
const allTestResults = await (0, data_loading_1.loadTestResults)(testResultsDataPath);
|
|
71
|
+
// ---- 2. Discover use-case folders ----
|
|
72
|
+
const resolvedUseCasesPath = path.resolve(cwd, useCasesPath);
|
|
73
|
+
const folders = await (0, data_loading_1.loadUseCaseFolders)(resolvedUseCasesPath);
|
|
74
|
+
// ---- 3. Process each folder: load → enrich → render ----
|
|
75
|
+
const pages = [];
|
|
76
|
+
for (let index = 0; index < folders.length; index++) {
|
|
77
|
+
const folderName = folders[index];
|
|
78
|
+
const useCaseDirPath = path.resolve(resolvedUseCasesPath, folderName);
|
|
79
|
+
const useCaseRelativePath = path.relative(cwd, path.resolve(resolvedUseCasesPath, folderName));
|
|
80
|
+
// Load definition and attachments (legacy yaml + .md frontmatter merged)
|
|
81
|
+
const { definition: definitionData, attachmentsMd } = await (0, data_loading_1.loadUseCaseMetadataAndContent)(useCaseDirPath);
|
|
82
|
+
// Build raw use-case
|
|
83
|
+
const raw = {
|
|
84
|
+
title: definitionData.title || 'Error: Definition has not title',
|
|
85
|
+
description: definitionData.description ||
|
|
86
|
+
'Error: Definition has not description',
|
|
87
|
+
type: definitionData.type || 'Error: Definition has not type',
|
|
88
|
+
modelStatus: definitionData.modelStatus || 'UNDEFINED',
|
|
89
|
+
tags: definitionData.tags || [],
|
|
90
|
+
attachmentsMd: attachmentsMd || '',
|
|
91
|
+
path: useCaseRelativePath,
|
|
92
|
+
};
|
|
93
|
+
// Enrich with test results and IDs
|
|
94
|
+
const enriched = (0, data_transformation_1.enrichUseCase)(raw, allTestResults, index, title);
|
|
95
|
+
// Render with deferred attachments (skipAttachments=true so attachments
|
|
96
|
+
// replacement happens after minification, preserving natural markdown formatting)
|
|
97
|
+
let markdown = (0, rendering_1.renderUseCasePage)(enriched, { skipAttachments: true, repoSourceUrl: args.repoSourceUrl });
|
|
98
|
+
// Beautify normalizes whitespace, then minify removes whitespace between tags
|
|
99
|
+
markdown = (0, markdown_1.beautifyMarkdown)(markdown);
|
|
100
|
+
markdown = (0, markdown_1.minifyMarkdown)(markdown);
|
|
101
|
+
// Replace attachments marker BEFORE stripJsxComments so the marker
|
|
102
|
+
// is still present for replacement. Done after minification so
|
|
103
|
+
// attachment markdown keeps its natural formatting.
|
|
104
|
+
if (enriched.attachmentsMd) {
|
|
105
|
+
const attachmentsHtml = `\n\n<div style={{ backgroundColor: '#EEE', margin: '32px 0', padding: '16px' }}>\n\n` +
|
|
106
|
+
`${enriched.attachmentsMd}\n\n </div>\n\n`;
|
|
107
|
+
markdown = markdown.replace('{/* attachments-md */}', attachmentsHtml);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
markdown = markdown.replace('{/* attachments-md */}', '');
|
|
111
|
+
}
|
|
112
|
+
// Strip remaining JSX comment markers (e.g., leftover { /* method-definition */ },
|
|
113
|
+
// { /* test-panel */ } placeholders from recursive template composition)
|
|
114
|
+
markdown = (0, markdown_1.stripJsxComments)(markdown);
|
|
115
|
+
// Build destination path
|
|
116
|
+
const destPath = path.resolve(targetDocusaurusPath, `${enriched.idMarkdown}.md`);
|
|
117
|
+
pages.push({ markdown, destPath });
|
|
118
|
+
}
|
|
119
|
+
// ---- 4. Write output ----
|
|
120
|
+
(0, file_writing_1.writeUseCasePages)(pages);
|
|
121
|
+
console.log('[reporter-use-case] Use Cases Report Generated!');
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=generate-use-cases-documentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-use-cases-documentation.js","sourceRoot":"","sources":["../../src/reporters/generate-use-cases-documentation.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,kCAAkC;AAClC,EAAE;AACF,wDAAwD;AACxD,6EAA6E;AAC7E,wEAAwE;AACxE,2BAA2B;AAC3B,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B9E,sEA6FC;AAvHD,2CAA6B;AAC7B,kDAAyF;AACzF,iDAAoG;AACpG,+DAAsD;AACtD,2CAAgD;AAChD,iDAAmD;AAcnD;;;;;;GAMG;AACI,KAAK,UAAU,6BAA6B,CACjD,IAA0B;IAE1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACtC,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,WAAW,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,mBAAmB,CAAC;IAChD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC;IACtE,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,aAAa,CAAC;IACxD,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,QAAQ,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IAEjE,qBAAqB;IACrB,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CACtC,GAAG,EACH,GAAG,iBAAiB,oBAAoB,eAAe,oBAAoB,CAC5E,CAAC;IACF,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CACvC,GAAG,EACH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ase, MethodDefinition, Property, TestFile, TestResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a single code example as a styled HTML div.
|
|
4
|
+
*
|
|
5
|
+
* @param example - The example code string
|
|
6
|
+
* @returns HTML div string with inline styling
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderExample(example: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Renders a single test result as a collapsible detail element.
|
|
11
|
+
*
|
|
12
|
+
* Each test gets a colored status label (green=passed, red=failed,
|
|
13
|
+
* yellow=pending, blue=todo) and a messages section inside a styled div.
|
|
14
|
+
*
|
|
15
|
+
* @param test - The test result to render (may include annotation from JSDoc)
|
|
16
|
+
* @param testFilePath - The file path containing the test
|
|
17
|
+
* @param messages - Optional messages to display (@deprecated, prefer test.annotation)
|
|
18
|
+
* @returns HTML string for the test panel (includes trailing // test-panel marker)
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderTestPanel(test: TestResult, testFilePath: string, messages?: string[], repoSourceUrl?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Renders all test results across all test files as concatenated test panels.
|
|
23
|
+
*
|
|
24
|
+
* @param testFiles - Array of test files with their results
|
|
25
|
+
* @returns Concatenated HTML string of all test panels
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderTestPanels(testFiles: TestFile[], repoSourceUrl?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Renders the complete methods section with count header and collapsible
|
|
30
|
+
* method definitions. Returns empty string when there are no methods.
|
|
31
|
+
*
|
|
32
|
+
* @param methods - Array of method definitions
|
|
33
|
+
* @returns HTML string for the entire methods section, or '' if empty
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderMethodsSection(methods: MethodDefinition[]): string;
|
|
36
|
+
/**
|
|
37
|
+
* Renders the complete tests section with count header and collapsible test panels.
|
|
38
|
+
* Returns empty string when there are no tests.
|
|
39
|
+
*
|
|
40
|
+
* @param testFiles - Array of test files with their results
|
|
41
|
+
* @returns HTML string for the entire tests section, or '' if no tests
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderTestsSection(testFiles: TestFile[], repoSourceUrl?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Renders the complete properties section with count header and
|
|
46
|
+
* collapsible table. Returns empty string when there are no properties.
|
|
47
|
+
*
|
|
48
|
+
* @param properties - Array of property definitions
|
|
49
|
+
* @returns HTML string for the entire properties section, or '' if empty
|
|
50
|
+
*/
|
|
51
|
+
export declare function renderPropertiesSection(properties: Property[]): string;
|
|
52
|
+
/**
|
|
53
|
+
* Renders a markdown table of artifact properties (name, type, description).
|
|
54
|
+
*
|
|
55
|
+
* The type column renders as a link using the same logic as the monolith's
|
|
56
|
+
* linkToType: strips `<...>` suffix that follows a dot (e.g., `java.util.List<String>`
|
|
57
|
+
* → `java.util.List`), then converts the type name using names().fileName.
|
|
58
|
+
*
|
|
59
|
+
* @param properties - Array of property definitions
|
|
60
|
+
* @returns HTML table string
|
|
61
|
+
*/
|
|
62
|
+
export declare function renderPropertiesTable(properties: Property[]): string;
|
|
63
|
+
/**
|
|
64
|
+
* Renders a single method definition with name, description,
|
|
65
|
+
* parameters table, and examples.
|
|
66
|
+
*
|
|
67
|
+
* @param method - The method definition to render
|
|
68
|
+
* @returns HTML string for the method definition (includes trailing
|
|
69
|
+
* // method-definition marker for composition)
|
|
70
|
+
*/
|
|
71
|
+
export declare function renderMethodDefinition(method: MethodDefinition): string;
|
|
72
|
+
/**
|
|
73
|
+
* Renders multiple method definitions by composing renderMethodDefinition
|
|
74
|
+
* calls. Uses the trailing `{ /* method-definition * / }` marker for
|
|
75
|
+
* recursive composition (matches the monolith template pattern).
|
|
76
|
+
*
|
|
77
|
+
* @param methods - Array of method definitions
|
|
78
|
+
* @returns Concatenated HTML string of all method definitions
|
|
79
|
+
*/
|
|
80
|
+
export declare function renderMethodDefinitions(methods: MethodDefinition[]): string;
|
|
81
|
+
/** Options for {@link renderArtifactPage}. */
|
|
82
|
+
export interface RenderArtifactPageOptions {
|
|
83
|
+
/**
|
|
84
|
+
* When `true`, the `{/* attachments-md * /}` marker is left in place
|
|
85
|
+
* so the caller can replace it after minification (matching the original
|
|
86
|
+
* monolith behavior where attachments keep their natural formatting).
|
|
87
|
+
*/
|
|
88
|
+
skipAttachments?: boolean;
|
|
89
|
+
/** Base URL for linking test file paths to the source repository. */
|
|
90
|
+
repoSourceUrl?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Renders the full artifact documentation page.
|
|
94
|
+
*
|
|
95
|
+
* Composes all sections: header (title, type+tags, description), attachments,
|
|
96
|
+
* properties table, method definitions, and test panels.
|
|
97
|
+
*
|
|
98
|
+
* @param artifact - The fully enriched artifact to render
|
|
99
|
+
* @param options - Optional rendering flags
|
|
100
|
+
* @returns Complete HTML page string for the artifact
|
|
101
|
+
*/
|
|
102
|
+
export declare function renderArtifactPage(artifact: EnrichedArtifact, options?: RenderArtifactPageOptions): string;
|
|
103
|
+
/**
|
|
104
|
+
* Renders a full use-case documentation page.
|
|
105
|
+
*
|
|
106
|
+
* Composes: header (title, type+modelStatus+tags, description),
|
|
107
|
+
* attachments section, and test panels.
|
|
108
|
+
*
|
|
109
|
+
* @param useCase - The fully enriched use-case to render
|
|
110
|
+
* @param options - Optional rendering flags
|
|
111
|
+
* @returns Complete HTML page string for the use-case
|
|
112
|
+
*/
|
|
113
|
+
export declare function renderUseCasePage(useCase: EnrichedUseCase, options?: {
|
|
114
|
+
skipAttachments?: boolean;
|
|
115
|
+
repoSourceUrl?: string;
|
|
116
|
+
}): string;
|