diff --git a/package.json b/package.json index 790799e..b536272 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "@shopify/prettier-plugin-liquid": "^1.9.3", "better-sqlite3": "^12.2.0", "cheerio": "^1.1.2", - "cli-progress": "^3.12.0", "css": "^3.0.0", "glob": "^11.0.3", "html-validate": "^10.0.0", diff --git a/test/build-html-validate.mjs b/test/build-html-validate.mjs index d6ebe7d..14d86f7 100644 --- a/test/build-html-validate.mjs +++ b/test/build-html-validate.mjs @@ -1,5 +1,4 @@ import { glob } from "glob"; -import cliProgress from "cli-progress"; import { Worker } from "worker_threads"; import path from "path"; import { fileURLToPath } from "url"; @@ -28,21 +27,6 @@ console.log(`๐Ÿงช Validating ${targets.length} files with ${MAX_WORKERS} paralle await validateParallel(); async function validateParallel() { - const multibar = new cliProgress.MultiBar( - { - format: "[{bar}] {percentage}% | {value}/{total} | {status}", - hideCursor: true, - clearOnComplete: false, - stopOnComplete: true, - forceRedraw: false, - }, - cliProgress.Presets.shades_classic, - ); - - const overallBar = multibar.create(targets.length, 0, { - status: "Starting...", - }); - let completedTasks = 0; let allTestsPassed = true; const results = []; @@ -54,7 +38,6 @@ async function validateParallel() { if (isDone) return; isDone = true; - multibar.stop(); workers.forEach((worker) => worker.terminate()); const failedResults = results.filter((r) => !r.isValid); @@ -65,9 +48,6 @@ async function validateParallel() { if (failedResults.length > 0) { console.log(`โŒ ${failedResults.length} files failed validation`); - failedResults.forEach((result) => { - console.log(`\nโœ… File: ${path.relative(process.cwd(), result.filePath)}\n${result.message.trim()}`); - }); process.exit(1); } else { console.log("โœจ All tests passed!\n"); @@ -81,15 +61,20 @@ async function validateParallel() { completedTasks++; results.push(result); + const relativeFilePath = path.relative(process.cwd(), result.filePath); + if (!result.isValid) { allTestsPassed = false; - multibar.log(`โŒ ${path.relative(process.cwd(), result.filePath)}\n${result.message.trim()}\n\n`); + console.log(`โŒ (${completedTasks} of ${targets.length}) ${relativeFilePath}`); + // Print error messages with indentation + const errorLines = result.message.trim().split("\n"); + errorLines.forEach((line) => { + console.log(`- ${line}`); + }); + } else { + console.log(`โœ… (${completedTasks} of ${targets.length}) ${relativeFilePath}`); } - overallBar.increment(1, { - status: path.basename(result.filePath), - }); - if (taskQueue.length > 0) { const nextTask = taskQueue.shift(); worker.postMessage({ filePath: nextTask, workerId }); diff --git a/yarn.lock b/yarn.lock index eb90098..fb46359 100644 --- a/yarn.lock +++ b/yarn.lock @@ -517,15 +517,6 @@ __metadata: languageName: node linkType: hard -"cli-progress@npm:^3.12.0": - version: 3.12.0 - resolution: "cli-progress@npm:3.12.0" - dependencies: - string-width: "npm:^4.2.3" - checksum: 10c0/f464cb19ebde2f3880620a2adfaeeefaec6cb15c8e610c8a659ca1047ee90d69f3bf2fdabbb1fe33ac408678e882e3e0eecdb84ab5df0edf930b269b8a72682d - languageName: node - linkType: hard - "cliui@npm:^5.0.0": version: 5.0.0 resolution: "cliui@npm:5.0.0" @@ -2640,7 +2631,6 @@ __metadata: "@shopify/prettier-plugin-liquid": "npm:^1.9.3" better-sqlite3: "npm:^12.2.0" cheerio: "npm:^1.1.2" - cli-progress: "npm:^3.12.0" css: "npm:^3.0.0" front-matter: "npm:^4.0.2" glob: "npm:^11.0.3" @@ -2832,7 +2822,7 @@ __metadata: languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: