Skip to content

Commit efb10bc

Browse files
committed
chore(cli): cosmetic styling (badges, lotus); release: 1.0.3
1 parent 963b83b commit efb10bc

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ubon",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Security scanner for AI-generated React/Next.js and Python apps. Catches hardcoded secrets, accessibility issues, and vulnerabilities that traditional linters miss.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,26 @@ export class UbonScan {
123123
const groupedResults = this.groupByCategory(results);
124124

125125
Object.entries(groupedResults).forEach(([category, categoryResults]) => {
126-
console.log(`\n${this.getCategoryIcon(category)} ${chalk.bold(category.toUpperCase())}:`);
126+
const lotus = chalk.hex('#c99cb3')(this.getCategoryIcon(category));
127+
const count = chalk.gray(`(${categoryResults.length})`);
128+
console.log(`\n${lotus} ${chalk.bold(category.toUpperCase())} ${count}:`);
127129
categoryResults.forEach(result => {
128130
const isError = result.type === 'error';
129-
const icon = isError ? chalk.red('') : chalk.yellow('⚠️');
131+
const icon = isError ? chalk.red('') : chalk.yellow('');
130132
const location = result.file ? chalk.gray(` (${result.file}:${result.line})`) : '';
131-
const message = isError ? chalk.red(result.message) : chalk.yellow(result.message);
132-
console.log(` ${icon} ${message}${location}`);
133+
const sev = (result.severity || '').toLowerCase();
134+
const badge = sev === 'high'
135+
? chalk.bgRed.white(' HIGH ')
136+
: sev === 'medium'
137+
? chalk.bgYellow.black(' MED ')
138+
: sev === 'low'
139+
? chalk.bgBlue.white(' LOW ')
140+
: '';
141+
const rule = result.ruleId ? chalk.gray(` {${result.ruleId}}`) : '';
142+
const msgColor = isError ? chalk.red : chalk.yellow;
143+
console.log(` ${icon} ${badge} ${msgColor(result.message)}${location}${rule}`);
133144
if (result.fix) {
134-
console.log(` ${chalk.green('💡')} ${chalk.green(result.fix)}`);
145+
console.log(` ${chalk.hex('#c99cb3')('🪷')} ${chalk.green(result.fix)}`);
135146
}
136147
});
137148
});
@@ -165,7 +176,7 @@ export class UbonScan {
165176
const errors = results.filter(r => r.type === 'error').length;
166177
const warnings = results.filter(r => r.type === 'warning').length;
167178

168-
console.log(`\n📊 Summary: ${errors} errors, ${warnings} warnings`);
179+
console.log(`\n${chalk.hex('#c99cb3')('🪷')} ${chalk.bold('Summary')}: ${chalk.red(errors + ' errors')}, ${chalk.yellow(warnings + ' warnings')}`);
169180

170181
if (errors > 0) {
171182
this.logger.error('Critical issues found that should be fixed immediately');

src/utils/logger.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export class Logger {
55

66
info(message: string): void {
77
if (!this.silent) {
8-
console.log(chalk.blue('ℹ'), message);
8+
const brand = chalk.hex('#c99cb3');
9+
console.log(brand('🪷'), message);
910
}
1011
}
1112

@@ -29,19 +30,22 @@ export class Logger {
2930

3031
debug(message: string): void {
3132
if (this.verbose && !this.silent) {
32-
console.log(chalk.gray('🔍'), message);
33+
const brand = chalk.hex('#c99cb3');
34+
console.log(brand('🪷'), chalk.gray(message));
3335
}
3436
}
3537

3638
title(message: string): void {
3739
if (!this.silent) {
38-
console.log('\n' + chalk.bold.cyan('🔍 ' + message));
40+
const brand = chalk.hex('#c99cb3');
41+
console.log('\n' + brand.bold('🪷 ' + message));
3942
}
4043
}
4144

4245
separator(): void {
4346
if (!this.silent) {
44-
console.log(chalk.gray('─'.repeat(50)));
47+
const brand = chalk.hex('#c99cb3');
48+
console.log(brand('─'.repeat(50)));
4549
}
4650
}
4751
}

0 commit comments

Comments
 (0)