mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: add word boundary to dev server hook regex, fix box() crash, add 27 tests
- hooks.json: add \b word boundary anchors to dev server blocking regex to prevent false positives matching "npm run develop", "npm run devtools" etc. - skill-create-output.js: guard box() horizontal repeat with Math.max(0, ...) to prevent RangeError when title exceeds container width - Add 13 tests for setup-package-manager.js CLI argument parsing - Add 14 tests for skill-create-output.js SkillCreateOutput class - All 333 tests passing
This commit is contained in:
parent
dc9aefbee1
commit
924bac4ddf
5 changed files with 383 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ const SPINNER = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇',
|
|||
// Helper functions
|
||||
function box(title, content, width = 60) {
|
||||
const lines = content.split('\n');
|
||||
const top = `${BOX.topLeft}${BOX.horizontal} ${chalk.bold(chalk.cyan(title))} ${BOX.horizontal.repeat(width - title.length - 5)}${BOX.topRight}`;
|
||||
const top = `${BOX.topLeft}${BOX.horizontal} ${chalk.bold(chalk.cyan(title))} ${BOX.horizontal.repeat(Math.max(0, width - title.length - 5))}${BOX.topRight}`;
|
||||
const bottom = `${BOX.bottomLeft}${BOX.horizontal.repeat(width - 1)}${BOX.bottomRight}`;
|
||||
const middle = lines.map(line => {
|
||||
const padding = width - 3 - stripAnsi(line).length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue