@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,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Docusaurus scaffold assembler
|
|
4
|
+
//
|
|
5
|
+
// Assembles the Docusaurus working site into .ultra-reporter/docusaurus/.
|
|
6
|
+
// - Copies template files from the library's templates/documentation/
|
|
7
|
+
// - Generates docusaurus.config.ts from ultra-reporter.config.json
|
|
8
|
+
// - Generates sidebars.ts with dynamic sections
|
|
9
|
+
// - Merges .ultra-reporter-overrides/ if present
|
|
10
|
+
// - Version-stamps the scaffold to detect library updates
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.assembleScaffold = assembleScaffold;
|
|
47
|
+
exports.isScaffoldCurrent = isScaffoldCurrent;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const reader_1 = require("../config/reader");
|
|
51
|
+
const SCAFFOLD_VERSION_FILE = '.scaffold-version';
|
|
52
|
+
const CURRENT_SCAFFOLD_VERSION = '1.0.0';
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Public API
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
/**
|
|
57
|
+
* Assembles (or re-assembles if needed) the Docusaurus scaffold into the
|
|
58
|
+
* .ultra-reporter/docusaurus/ directory.
|
|
59
|
+
*
|
|
60
|
+
* @param configDir - Directory containing ultra-reporter.config.json
|
|
61
|
+
* @param libraryTemplateDir - Path to the library's templates/documentation/ directory
|
|
62
|
+
* @param force - If true, re-assemble even if version matches
|
|
63
|
+
*/
|
|
64
|
+
function assembleScaffold(configDir, libraryTemplateDir, force = false) {
|
|
65
|
+
const config = (0, reader_1.readConfig)(configDir);
|
|
66
|
+
const docusaurusDir = path.resolve(configDir, '.ultra-reporter', 'docusaurus');
|
|
67
|
+
// Check if re-assembly is needed
|
|
68
|
+
if (!force && isScaffoldCurrent(docusaurusDir)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Ensure the docusaurus directory exists
|
|
72
|
+
fs.mkdirSync(docusaurusDir, { recursive: true });
|
|
73
|
+
// Copy static template files (NOT docusaurus.config.ts or sidebars.ts — we generate those)
|
|
74
|
+
copyTemplateFiles(libraryTemplateDir, docusaurusDir);
|
|
75
|
+
// Generate dynamic config files
|
|
76
|
+
generateDocusaurusConfig(config, docusaurusDir);
|
|
77
|
+
generateSidebars(config, docusaurusDir);
|
|
78
|
+
// Generate docs directory with .gitkeep
|
|
79
|
+
const docsDir = path.join(docusaurusDir, 'docs');
|
|
80
|
+
fs.mkdirSync(docsDir, { recursive: true });
|
|
81
|
+
fs.writeFileSync(path.join(docsDir, '.gitkeep'), '');
|
|
82
|
+
// Merge overrides if present
|
|
83
|
+
mergeOverrides(configDir, docusaurusDir);
|
|
84
|
+
// Write version stamp
|
|
85
|
+
fs.writeFileSync(path.join(docusaurusDir, SCAFFOLD_VERSION_FILE), CURRENT_SCAFFOLD_VERSION);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Checks if an existing scaffold is up-to-date.
|
|
89
|
+
*/
|
|
90
|
+
function isScaffoldCurrent(docusaurusDir) {
|
|
91
|
+
const versionPath = path.join(docusaurusDir, SCAFFOLD_VERSION_FILE);
|
|
92
|
+
if (!fs.existsSync(versionPath)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const version = fs.readFileSync(versionPath, 'utf-8').trim();
|
|
97
|
+
return version === CURRENT_SCAFFOLD_VERSION;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Template copying
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* Copies template files from the library to the Docusaurus directory.
|
|
108
|
+
* Skips files we generate dynamically (docusaurus.config.ts, sidebars.ts).
|
|
109
|
+
*/
|
|
110
|
+
function copyTemplateFiles(srcDir, destDir) {
|
|
111
|
+
const skipFiles = new Set([
|
|
112
|
+
'docusaurus.config.ts',
|
|
113
|
+
'sidebars.ts',
|
|
114
|
+
'ultra-reporter.config.json',
|
|
115
|
+
'.gitignore',
|
|
116
|
+
'docs/.gitkeep',
|
|
117
|
+
SCAFFOLD_VERSION_FILE,
|
|
118
|
+
]);
|
|
119
|
+
copyDirRecursive(srcDir, destDir, skipFiles);
|
|
120
|
+
}
|
|
121
|
+
function copyDirRecursive(src, dest, skipFiles) {
|
|
122
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
123
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
124
|
+
for (const entry of entries) {
|
|
125
|
+
const srcPath = path.join(src, entry.name);
|
|
126
|
+
const destPath = path.join(dest, entry.name);
|
|
127
|
+
// Compute relative path for skip check
|
|
128
|
+
const relPath = path.relative(src, srcPath);
|
|
129
|
+
if (skipFiles.has(entry.name) || skipFiles.has(relPath)) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (entry.isDirectory()) {
|
|
133
|
+
copyDirRecursive(srcPath, destPath, skipFiles);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
fs.copyFileSync(srcPath, destPath);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Config generation
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
/**
|
|
144
|
+
* Generates docusaurus.config.ts from the ultra-reporter config.
|
|
145
|
+
*/
|
|
146
|
+
function generateDocusaurusConfig(config, docusaurusDir) {
|
|
147
|
+
const domainName = config.domain.name;
|
|
148
|
+
const title = `${domainName.charAt(0).toUpperCase() + domainName.slice(1)} Docs`;
|
|
149
|
+
const content = `import { themes as prismThemes } from "prism-react-renderer";
|
|
150
|
+
import type { Config } from "@docusaurus/types";
|
|
151
|
+
import type * as Preset from "@docusaurus/preset-classic";
|
|
152
|
+
|
|
153
|
+
const config: Config = {
|
|
154
|
+
title: "${title}",
|
|
155
|
+
tagline: "${domainName} Documentation",
|
|
156
|
+
favicon: "img/favicon.ico",
|
|
157
|
+
|
|
158
|
+
url: "https://your-docusaurus-site.example.com",
|
|
159
|
+
baseUrl: "/",
|
|
160
|
+
|
|
161
|
+
organizationName: "imolko",
|
|
162
|
+
projectName: "${domainName}",
|
|
163
|
+
|
|
164
|
+
onBrokenLinks: "throw",
|
|
165
|
+
onBrokenMarkdownLinks: "warn",
|
|
166
|
+
|
|
167
|
+
i18n: {
|
|
168
|
+
defaultLocale: "en",
|
|
169
|
+
locales: ["en"],
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
presets: [
|
|
173
|
+
[
|
|
174
|
+
"classic",
|
|
175
|
+
{
|
|
176
|
+
docs: {
|
|
177
|
+
sidebarPath: "./sidebars.ts",
|
|
178
|
+
},
|
|
179
|
+
theme: {
|
|
180
|
+
customCss: "./src/css/custom.css",
|
|
181
|
+
},
|
|
182
|
+
} satisfies Preset.Options,
|
|
183
|
+
],
|
|
184
|
+
],
|
|
185
|
+
|
|
186
|
+
themeConfig: {
|
|
187
|
+
image: "img/docusaurus-social-card.jpg",
|
|
188
|
+
navbar: {
|
|
189
|
+
title: "${title}",
|
|
190
|
+
logo: {
|
|
191
|
+
alt: "${domainName} Logo",
|
|
192
|
+
src: "img/logo_imolko_azul.png",
|
|
193
|
+
},
|
|
194
|
+
items: [
|
|
195
|
+
{
|
|
196
|
+
type: "docSidebar",
|
|
197
|
+
sidebarId: "tutorialSidebar",
|
|
198
|
+
position: "left",
|
|
199
|
+
label: "Documentation",
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
footer: {
|
|
204
|
+
style: "dark",
|
|
205
|
+
links: [
|
|
206
|
+
{
|
|
207
|
+
title: "Docs",
|
|
208
|
+
items: [
|
|
209
|
+
{
|
|
210
|
+
label: "Aggregates",
|
|
211
|
+
to: "/docs/category/aggregates",
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
label: "Domain Artifacts",
|
|
215
|
+
to: "/docs/category/domain-artifacts",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: "Intro",
|
|
219
|
+
to: "/docs/intro",
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
copyright: \`Copyright © \${new Date().getFullYear()} Imolko, Inc. Built with Docusaurus.\`,
|
|
225
|
+
},
|
|
226
|
+
prism: {
|
|
227
|
+
theme: prismThemes.github,
|
|
228
|
+
darkTheme: prismThemes.dracula,
|
|
229
|
+
},
|
|
230
|
+
} satisfies Preset.ThemeConfig,
|
|
231
|
+
|
|
232
|
+
markdown: {
|
|
233
|
+
mermaid: true,
|
|
234
|
+
},
|
|
235
|
+
themes: ['@docusaurus/theme-mermaid'],
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export default config;
|
|
239
|
+
`;
|
|
240
|
+
fs.writeFileSync(path.join(docusaurusDir, 'docusaurus.config.ts'), content);
|
|
241
|
+
}
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
// Sidebars generation
|
|
244
|
+
// ---------------------------------------------------------------------------
|
|
245
|
+
/**
|
|
246
|
+
* Generates sidebars.ts with dynamic sections based on config.
|
|
247
|
+
*/
|
|
248
|
+
function generateSidebars(config, docusaurusDir) {
|
|
249
|
+
const domainName = config.domain.name;
|
|
250
|
+
const hasUseCases = !!config.useCases;
|
|
251
|
+
const hasUserDocs = !!config.docs;
|
|
252
|
+
const sections = [];
|
|
253
|
+
// Aggregates section
|
|
254
|
+
sections.push(` {
|
|
255
|
+
type: 'category' as const,
|
|
256
|
+
label: '${domainName} Aggregates',
|
|
257
|
+
link: {
|
|
258
|
+
type: 'generated-index',
|
|
259
|
+
description: 'Aggregates del dominio',
|
|
260
|
+
},
|
|
261
|
+
items: [
|
|
262
|
+
{
|
|
263
|
+
type: 'autogenerated',
|
|
264
|
+
dirName: 'aggregates',
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
}`);
|
|
268
|
+
// Domain artifacts section
|
|
269
|
+
sections.push(` {
|
|
270
|
+
type: 'category' as const,
|
|
271
|
+
label: '${domainName} Domain Artifacts',
|
|
272
|
+
link: {
|
|
273
|
+
type: 'generated-index',
|
|
274
|
+
description: 'Todos los artefactos del dominio',
|
|
275
|
+
},
|
|
276
|
+
items: [
|
|
277
|
+
{
|
|
278
|
+
type: 'autogenerated',
|
|
279
|
+
dirName: 'domain',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
}`);
|
|
283
|
+
// Use-cases section
|
|
284
|
+
if (hasUseCases) {
|
|
285
|
+
sections.push(` {
|
|
286
|
+
type: 'category' as const,
|
|
287
|
+
label: '${config.useCases.title}',
|
|
288
|
+
link: {
|
|
289
|
+
type: 'generated-index',
|
|
290
|
+
description: 'Todos los casos de uso',
|
|
291
|
+
},
|
|
292
|
+
items: [
|
|
293
|
+
{
|
|
294
|
+
type: 'autogenerated',
|
|
295
|
+
dirName: 'use-cases',
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
}`);
|
|
299
|
+
}
|
|
300
|
+
// User docs section
|
|
301
|
+
if (hasUserDocs) {
|
|
302
|
+
sections.push(` {
|
|
303
|
+
type: 'category' as const,
|
|
304
|
+
label: 'Documentation',
|
|
305
|
+
link: {
|
|
306
|
+
type: 'generated-index',
|
|
307
|
+
description: 'Manual documentation',
|
|
308
|
+
},
|
|
309
|
+
items: [
|
|
310
|
+
{
|
|
311
|
+
type: 'autogenerated',
|
|
312
|
+
dirName: 'user',
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
}`);
|
|
316
|
+
}
|
|
317
|
+
const content = `import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
|
|
318
|
+
|
|
319
|
+
const sidebars: SidebarsConfig = {
|
|
320
|
+
tutorialSidebar: [
|
|
321
|
+
${sections.join(',\n')},
|
|
322
|
+
],
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export default sidebars;
|
|
326
|
+
`;
|
|
327
|
+
fs.writeFileSync(path.join(docusaurusDir, 'sidebars.ts'), content);
|
|
328
|
+
}
|
|
329
|
+
// ---------------------------------------------------------------------------
|
|
330
|
+
// Override merging
|
|
331
|
+
// ---------------------------------------------------------------------------
|
|
332
|
+
/**
|
|
333
|
+
* Merges .ultra-reporter-overrides/ into the Docusaurus scaffold.
|
|
334
|
+
* Handles: docusaurus.config.override.ts, custom.css, components/, static/
|
|
335
|
+
*/
|
|
336
|
+
function mergeOverrides(configDir, docusaurusDir) {
|
|
337
|
+
const overridesDir = path.resolve(configDir, '.ultra-reporter-overrides');
|
|
338
|
+
if (!fs.existsSync(overridesDir)) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
// Merge docusaurus.config.override.ts
|
|
342
|
+
const configOverride = path.join(overridesDir, 'docusaurus.config.override.ts');
|
|
343
|
+
if (fs.existsSync(configOverride)) {
|
|
344
|
+
const overrideContent = fs.readFileSync(configOverride, 'utf-8');
|
|
345
|
+
// Append the override to the generated config
|
|
346
|
+
const configPath = path.join(docusaurusDir, 'docusaurus.config.ts');
|
|
347
|
+
const existingConfig = fs.readFileSync(configPath, 'utf-8');
|
|
348
|
+
// Deep merge: insert override content before export default
|
|
349
|
+
const merged = existingConfig.replace('export default config;', `// User overrides from .ultra-reporter-overrides/\n${overrideContent}\n\nexport default config;`);
|
|
350
|
+
fs.writeFileSync(configPath, merged);
|
|
351
|
+
}
|
|
352
|
+
// Copy custom.css
|
|
353
|
+
const customCss = path.join(overridesDir, 'custom.css');
|
|
354
|
+
if (fs.existsSync(customCss)) {
|
|
355
|
+
const destCss = path.join(docusaurusDir, 'src', 'css', 'custom.css');
|
|
356
|
+
const existing = fs.readFileSync(destCss, 'utf-8');
|
|
357
|
+
const overrideCss = fs.readFileSync(customCss, 'utf-8');
|
|
358
|
+
fs.writeFileSync(destCss, existing + '\n\n/* User overrides */\n' + overrideCss);
|
|
359
|
+
}
|
|
360
|
+
// Copy components/
|
|
361
|
+
const overrideComponents = path.join(overridesDir, 'components');
|
|
362
|
+
if (fs.existsSync(overrideComponents)) {
|
|
363
|
+
copyDirRecursive(overrideComponents, path.join(docusaurusDir, 'src', 'components'), new Set());
|
|
364
|
+
}
|
|
365
|
+
// Copy static/
|
|
366
|
+
const overrideStatic = path.join(overridesDir, 'static');
|
|
367
|
+
if (fs.existsSync(overrideStatic)) {
|
|
368
|
+
copyDirRecursive(overrideStatic, path.join(docusaurusDir, 'static'), new Set());
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=assembler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembler.js","sourceRoot":"","sources":["../../src/scaffold/assembler.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gCAAgC;AAChC,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,qEAAqE;AACrE,kDAAkD;AAClD,mDAAmD;AACnD,4DAA4D;AAC5D,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsB9E,4CAoCC;AAKD,8CAWC;AAxED,uCAAyB;AACzB,2CAA6B;AAC7B,6CAA8C;AAG9C,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAClD,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEzC,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAAiB,EACjB,kBAA0B,EAC1B,KAAK,GAAG,KAAK;IAEb,MAAM,MAAM,GA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gBAAgB,CACd,cAAc,EACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EAClC,IAAI,GAAG,EAAE,CACV,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assembles all documentation sources into the Docusaurus docs directory.
|
|
3
|
+
*
|
|
4
|
+
* 1. Cleans .ultra-reporter/docusaurus/docs/
|
|
5
|
+
* 2. Copies generated docs (domain, aggregates, use-cases)
|
|
6
|
+
* 3. Copies user manual docs (if configured)
|
|
7
|
+
*
|
|
8
|
+
* @param configDir - Directory containing ultra-reporter.config.json
|
|
9
|
+
*/
|
|
10
|
+
export declare function assembleDocs(configDir: string): void;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Document assembler
|
|
4
|
+
//
|
|
5
|
+
// Combines generated docs (.ultra-reporter/generated-docs/) and user manual
|
|
6
|
+
// docs (docs/) into the Docusaurus docs directory (.ultra-reporter/docusaurus/docs/).
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.assembleDocs = assembleDocs;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const reader_1 = require("../config/reader");
|
|
46
|
+
/**
|
|
47
|
+
* Assembles all documentation sources into the Docusaurus docs directory.
|
|
48
|
+
*
|
|
49
|
+
* 1. Cleans .ultra-reporter/docusaurus/docs/
|
|
50
|
+
* 2. Copies generated docs (domain, aggregates, use-cases)
|
|
51
|
+
* 3. Copies user manual docs (if configured)
|
|
52
|
+
*
|
|
53
|
+
* @param configDir - Directory containing ultra-reporter.config.json
|
|
54
|
+
*/
|
|
55
|
+
function assembleDocs(configDir) {
|
|
56
|
+
const config = (0, reader_1.readConfig)(configDir);
|
|
57
|
+
const docusaurusDocsDir = path.resolve(configDir, '.ultra-reporter', 'docusaurus', 'docs');
|
|
58
|
+
const generatedDocsDir = path.resolve(configDir, '.ultra-reporter', 'generated-docs');
|
|
59
|
+
// Clean the Docusaurus docs directory (keep .gitkeep)
|
|
60
|
+
if (fs.existsSync(docusaurusDocsDir)) {
|
|
61
|
+
cleanDir(docusaurusDocsDir);
|
|
62
|
+
}
|
|
63
|
+
fs.mkdirSync(docusaurusDocsDir, { recursive: true });
|
|
64
|
+
// Copy generated docs
|
|
65
|
+
copyDirIfExists(path.join(generatedDocsDir, 'domain'), path.join(docusaurusDocsDir, 'domain'));
|
|
66
|
+
copyDirIfExists(path.join(generatedDocsDir, 'aggregates'), path.join(docusaurusDocsDir, 'aggregates'));
|
|
67
|
+
copyDirIfExists(path.join(generatedDocsDir, 'use-cases'), path.join(docusaurusDocsDir, 'use-cases'));
|
|
68
|
+
// Copy user manual docs
|
|
69
|
+
if (config.docs) {
|
|
70
|
+
const userDocsDir = path.resolve(configDir, config.docs.path);
|
|
71
|
+
if (fs.existsSync(userDocsDir)) {
|
|
72
|
+
copyDirRecursive(userDocsDir, path.join(docusaurusDocsDir, 'user'));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// Helpers
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
/** Removes all files and subdirectories from a directory. */
|
|
80
|
+
function cleanDir(dir) {
|
|
81
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
82
|
+
for (const entry of entries) {
|
|
83
|
+
const entryPath = path.join(dir, entry.name);
|
|
84
|
+
if (entry.isDirectory()) {
|
|
85
|
+
fs.rmSync(entryPath, { recursive: true, force: true });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
fs.unlinkSync(entryPath);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Copies a directory tree if the source exists. */
|
|
93
|
+
function copyDirIfExists(src, dest) {
|
|
94
|
+
if (fs.existsSync(src)) {
|
|
95
|
+
copyDirRecursive(src, dest);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Recursively copies a directory tree. */
|
|
99
|
+
function copyDirRecursive(src, dest) {
|
|
100
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
101
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
102
|
+
for (const entry of entries) {
|
|
103
|
+
const srcPath = path.join(src, entry.name);
|
|
104
|
+
const destPath = path.join(dest, entry.name);
|
|
105
|
+
if (entry.isDirectory()) {
|
|
106
|
+
copyDirRecursive(srcPath, destPath);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
fs.copyFileSync(srcPath, destPath);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=doc-assembler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-assembler.js","sourceRoot":"","sources":["../../src/scaffold/doc-assembler.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,EAAE;AACF,4EAA4E;AAC5E,sFAAsF;AACtF,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAe9E,oCA6CC;AA1DD,uCAAyB;AACzB,2CAA6B;AAC7B,6CAA8C;AAE9C;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAC,SAAiB;IAC5C,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC;IAErC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CACpC,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,MAAM,CACP,CAAC;IACF,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CACnC,SAAS,EACT,iBAAiB,EACjB,gBAAgB,CACjB,CAAC;IAEF,sDAAsD;IACtD,IAAI,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACrC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC9B,CAAC;IACD,EAAE,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErD,sBAAs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EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC;AAED,oDAAoD;AACpD,SAAS,eAAe,CAAC,GAAW,EAAE,IAAY;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,2CAA2C;AAC3C,SAAS,gBAAgB,CAAC,GAAW,EAAE,IAAY;IACjD,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExC,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addImports(content: string, elems: string[], source: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addImports = addImports;
|
|
4
|
+
function addImports(content, elems, source) {
|
|
5
|
+
const sourceSatanized = source.replace(/\./g, "\\.").replace(/\//g, "\\/");
|
|
6
|
+
let newContent = content;
|
|
7
|
+
for (const elem of elems) {
|
|
8
|
+
let regExpStr = `(import[\\s\n]+\\{)([\\s\n]*[a-zA-Z0-9,\\s\n]*)(${elem})([a-zA-Z0-9,\\s\n]*[\\s\n]+)(\\}[\\s\n]+from[\\s\n]+['"]{1}${sourceSatanized}['"]{1})`;
|
|
9
|
+
let regExp = new RegExp(regExpStr);
|
|
10
|
+
if (regExp.test(newContent)) {
|
|
11
|
+
// La importacion ya hiciste
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
regExpStr = `(import[\\s\n]+\\{)([\\s\n]+[a-zA-Z0-9,\\s\n]+[\\s\n]+)(\\}[\\s\n]+from[\\s\n]+['"]{1}${sourceSatanized}['"]{1})`;
|
|
15
|
+
regExp = new RegExp(regExpStr);
|
|
16
|
+
const match = newContent.match(regExp);
|
|
17
|
+
if (match) {
|
|
18
|
+
newContent = newContent.replace(match[0], `${match[1]} ${elem}, ${match[2]}${match[3]}`);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
newContent = `import { ${elem} } from '${source}';\n${newContent}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return newContent;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=add-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-import.js","sourceRoot":"","sources":["../../src/scripts/add-import.ts"],"names":[],"mappings":";;AAAA,gCA0BC;AA1BD,SAAgB,UAAU,CAAC,OAAe,EAAE,KAAe,EAAE,MAAc;IACzE,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3E,IAAI,UAAU,GAAG,OAAO,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,SAAS,GAAG,mDAAmD,IAAI,+DAA+D,eAAe,UAAU,CAAC;QAChK,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;QAEnC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,4BAA4B;YAC5B,SAAS;QACX,CAAC;QAED,SAAS,GAAG,yFAAyF,eAAe,UAAU,CAAC;QAC/H,MAAM,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEvC,IAAI,KAAK,EAAE,CAAC;YACV,UAAU,GAAG,UAAU,CAAC,OAAO,CAC7B,KAAK,CAAC,CAAC,CAAC,EACR,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAC9C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,UAAU,GAAG,YAAY,IAAI,YAAY,MAAM,OAAO,UAAU,EAAE,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convierte un formato JSON de pruebas antiguo a un nuevo formato
|
|
3
|
+
* @param inputFilePath Ruta del archivo JSON de entrada
|
|
4
|
+
* @param outputFilePath Ruta del archivo JSON de salida
|
|
5
|
+
*/
|
|
6
|
+
export declare function convertTestJsonFormat(inputFilePath: string, outputFilePath: string): void;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.convertTestJsonFormat = convertTestJsonFormat;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
/**
|
|
39
|
+
* Convierte un formato JSON de pruebas antiguo a un nuevo formato
|
|
40
|
+
* @param inputFilePath Ruta del archivo JSON de entrada
|
|
41
|
+
* @param outputFilePath Ruta del archivo JSON de salida
|
|
42
|
+
*/
|
|
43
|
+
function convertTestJsonFormat(inputFilePath, outputFilePath) {
|
|
44
|
+
try {
|
|
45
|
+
// Leer el archivo de entrada
|
|
46
|
+
const inputData = fs.readFileSync(inputFilePath, 'utf8');
|
|
47
|
+
const oldJson = JSON.parse(inputData);
|
|
48
|
+
// Obtener los resultados de las pruebas y organizarlos por archivo
|
|
49
|
+
const testFileMap = new Map();
|
|
50
|
+
oldJson.results.tests.forEach(test => {
|
|
51
|
+
if (!testFileMap.has(test.filePath)) {
|
|
52
|
+
testFileMap.set(test.filePath, []);
|
|
53
|
+
}
|
|
54
|
+
testFileMap.get(test.filePath)?.push(test);
|
|
55
|
+
});
|
|
56
|
+
// Crear la estructura del nuevo JSON
|
|
57
|
+
const newJson = {
|
|
58
|
+
numFailedTestSuites: 0,
|
|
59
|
+
numFailedTests: oldJson.results.summary.failed,
|
|
60
|
+
numPassedTestSuites: testFileMap.size, // Asumimos que todos los archivos pasaron
|
|
61
|
+
numPassedTests: oldJson.results.summary.passed,
|
|
62
|
+
numPendingTestSuites: 0,
|
|
63
|
+
numPendingTests: oldJson.results.summary.pending,
|
|
64
|
+
numRuntimeErrorTestSuites: 0,
|
|
65
|
+
numTodoTests: oldJson.results.summary.other, // Asumimos que 'other' son pruebas TODO
|
|
66
|
+
numTotalTestSuites: testFileMap.size,
|
|
67
|
+
numTotalTests: oldJson.results.summary.tests,
|
|
68
|
+
startTime: oldJson.results.summary.start,
|
|
69
|
+
success: oldJson.results.summary.failed === 0,
|
|
70
|
+
testResults: []
|
|
71
|
+
};
|
|
72
|
+
// Convertir cada archivo de pruebas al nuevo formato
|
|
73
|
+
testFileMap.forEach((tests, filePath) => {
|
|
74
|
+
const passingTests = tests.filter(test => test.status === 'passed').length;
|
|
75
|
+
const failingTests = tests.filter(test => test.status === 'failed').length;
|
|
76
|
+
const pendingTests = tests.filter(test => test.status === 'pending').length;
|
|
77
|
+
const todoTests = tests.length - passingTests - failingTests - pendingTests;
|
|
78
|
+
// Calculamos un tiempo de ejecución estimado para las pruebas
|
|
79
|
+
const totalDuration = tests.reduce((sum, test) => sum + test.duration, 0);
|
|
80
|
+
const startTime = oldJson.results.summary.start;
|
|
81
|
+
const endTime = startTime + totalDuration;
|
|
82
|
+
const testFile = {
|
|
83
|
+
numFailingTests: failingTests,
|
|
84
|
+
numPassingTests: passingTests,
|
|
85
|
+
numPendingTests: pendingTests,
|
|
86
|
+
numTodoTests: todoTests,
|
|
87
|
+
perfStats: {
|
|
88
|
+
end: endTime,
|
|
89
|
+
runtime: totalDuration,
|
|
90
|
+
slow: false,
|
|
91
|
+
start: startTime
|
|
92
|
+
},
|
|
93
|
+
testFilePath: filePath,
|
|
94
|
+
failureMessage: null,
|
|
95
|
+
testResults: tests.map(test => {
|
|
96
|
+
// Extraer el título del ancestro y el título de la prueba desde la suite
|
|
97
|
+
const suiteParts = test.suite.split(' > ');
|
|
98
|
+
const ancestorTitles = suiteParts.length > 1 ? [suiteParts[1]] : [];
|
|
99
|
+
const title = test.name.split(' ').slice(ancestorTitles.length > 0 ? 1 : 0).join(' ');
|
|
100
|
+
return {
|
|
101
|
+
ancestorTitles,
|
|
102
|
+
duration: test.duration,
|
|
103
|
+
failureMessages: [],
|
|
104
|
+
fullName: test.name,
|
|
105
|
+
status: test.status,
|
|
106
|
+
title
|
|
107
|
+
};
|
|
108
|
+
})
|
|
109
|
+
};
|
|
110
|
+
newJson.testResults.push(testFile);
|
|
111
|
+
});
|
|
112
|
+
// Escribir el archivo de salida
|
|
113
|
+
fs.writeFileSync(outputFilePath, JSON.stringify(newJson, null, 2), 'utf8');
|
|
114
|
+
console.log(`Conversión exitosa. Archivo guardado en: ${outputFilePath}`);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error('Error durante la conversión:', error);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=converter.js.map
|