feat(build): add logging for spec and code file discovery with warnings when none found

- Log the number of specification HTML files found in `SPEC_DIR`.
- Emit a warning if no specification HTML files are present.
- Log the number of code files found in `CODE_DIR`.
- Emit a warning if no code files are present.
This commit is contained in:
2026-03-27 10:12:48 +05:30
parent b42a69d9f8
commit 3f0c4c217a
+8
View File
@@ -11,6 +11,10 @@ import { GRAPH_FILE } from '../constants.mjs';
async function buildGraph() { async function buildGraph() {
const graph = new Graph({ multi: true }); const graph = new Graph({ multi: true });
const htmlFiles = await glob(path.join(SPEC_DIR, '*.html')); const htmlFiles = await glob(path.join(SPEC_DIR, '*.html'));
console.log(`Found ${htmlFiles.length} specification HTML file(s) in ${SPEC_DIR}`);
if (htmlFiles.length === 0) {
console.warn(`Warning: No specification HTML files found in ${SPEC_DIR}`);
}
console.log("Processing specification for graph..."); console.log("Processing specification for graph...");
for (const file of htmlFiles) { for (const file of htmlFiles) {
@@ -66,6 +70,10 @@ async function buildGraph() {
console.log("Processing code for graph..."); console.log("Processing code for graph...");
const jsFiles = await glob(path.join(CODE_DIR, '**/*.mts')); const jsFiles = await glob(path.join(CODE_DIR, '**/*.mts'));
console.log(`Found ${jsFiles.length} code file(s) in ${CODE_DIR}`);
if (jsFiles.length === 0) {
console.warn(`Warning: No code files found in ${CODE_DIR}`);
}
for (const file of jsFiles) { for (const file of jsFiles) {
const fileName = path.basename(file); const fileName = path.basename(file);