mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user