mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
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:
@@ -11,6 +11,10 @@ import { GRAPH_FILE } from '../constants.mjs';
|
||||
async function buildGraph() {
|
||||
const graph = new Graph({ multi: true });
|
||||
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...");
|
||||
for (const file of htmlFiles) {
|
||||
@@ -66,6 +70,10 @@ async function buildGraph() {
|
||||
|
||||
console.log("Processing code for graph...");
|
||||
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) {
|
||||
const fileName = path.basename(file);
|
||||
|
||||
Reference in New Issue
Block a user