@@ -9,21 +9,17 @@ import {
99 rmSync ,
1010 writeFileSync ,
1111} from "fs" ;
12- import { configure , getConfig , logger , LogLevel } from "./src/utils/logger" ;
13- import { getTheme } from "./src/utils/themes" ;
12+ import { logger } from "./src/utils/console /logger" ;
13+ import { getTheme , themeManager } from "./src/utils/console /themes" ;
1414
1515// Read version from package.json
1616const packageJson = JSON . parse ( readFileSync ( "package.json" , "utf-8" ) ) ;
1717const version = packageJson . version ;
1818
19- configure ( {
20- level : LogLevel . TRACE ,
21- } ) ;
22-
2319async function main ( ) {
2420 const startTime = Date . now ( ) ;
2521
26- logger . format . header ( "Building Axogen CLI and Library" ) ;
22+ logger . header ( "Building Axogen CLI and Library" ) ;
2723 console . log ( ) ; // Add some spacing
2824
2925 setupDirectories ( ) ;
@@ -49,12 +45,13 @@ async function main() {
4945
5046 const duration = Date . now ( ) - startTime ;
5147 console . log ( ) ; // Add spacing before final summary
52- logger . success ( `Build completed in ${ duration } ms` ) ;
48+ logger . success ( `Build completed <muted>[ ${ duration } ms]</muted> ` ) ;
5349
5450 console . log ( ) ; // Add spacing
55- logger . format . divider ( "Next Steps" ) ;
56- logger . info ( `Run ${ logger . text . command ( "./bin/axogen --version" ) } to test` ) ;
57- logger . info ( "Library built with tsup for better IDE support!" ) ;
51+ logger . divider ( "Next Steps" ) ;
52+ logger . info ( `Run <secondary>./bin/axogen --version</secondary> to test` ) ;
53+ logger . divider ( ) ;
54+ console . log ( ) ; // Add spacing
5855}
5956
6057function setupDirectories ( ) {
@@ -101,7 +98,7 @@ async function typeCheck() {
10198 // Fallback: if tsc not available, warn but continue
10299 logger . warn ( "TypeScript compiler not found, skipping type check" ) ;
103100 logger . info (
104- `Install typescript globally: ${ logger . text . command ( " bun add -g typescript" ) } `
101+ `Install typescript globally: <secondary> bun add -g typescript</secondary> `
105102 ) ;
106103 }
107104}
@@ -185,7 +182,7 @@ async function buildLibraryWithTsup() {
185182 return true ;
186183 } catch ( error ) {
187184 logger . warn ( "tsup not available, falling back to bun build" ) ;
188- logger . info ( `Install tsup: ${ logger . text . command ( " bun add -D tsup" ) } ` ) ;
185+ logger . info ( `Install tsup: <secondary> bun add -D tsup</secondary> ` ) ;
189186
190187 // Fallback to original bun build method
191188 return await buildLibraryFallback ( ) ;
@@ -242,14 +239,13 @@ async function generateTypes() {
242239 } catch ( error ) {
243240 logger . warn ( "Could not generate TypeScript declarations" ) ;
244241 logger . info (
245- `Install typescript: ${ logger . text . command ( " bun add -D typescript" ) } `
242+ `Install typescript: <secondary> bun add -D typescript</secondary> `
246243 ) ;
247244 }
248245}
249246
250247function handleBuildFailure ( result : Bun . BuildOutput ) {
251- const config = getConfig ( ) ;
252- const theme = getTheme ( config . theme ) ;
248+ const theme = themeManager . theme ;
253249
254250 if ( result . logs . length > 0 ) {
255251 // Group logs by level
@@ -262,7 +258,7 @@ function handleBuildFailure(result: Bun.BuildOutput) {
262258 warnings . length > 0 && `${ warnings . length } warnings` ,
263259 ] . filter ( Boolean ) ;
264260
265- const subtitle = `${ logger . text . muted ( " Found:" ) } ${ result . logs . length } build issue${ result . logs . length !== 1 ? "s" : "" } ${ logger . text . muted ( summaryParts . join ( " • " ) ) } ` ;
261+ const subtitle = `< muted> Found:</muted> ${ result . logs . length } build issue${ result . logs . length !== 1 ? "s" : "" } <muted> ${ summaryParts . join ( " • " ) } </muted> ` ;
266262
267263 // Map logs to items
268264 const items = result . logs . map ( ( log ) => {
@@ -272,25 +268,23 @@ function handleBuildFailure(result: Bun.BuildOutput) {
272268
273269 return {
274270 level : log . level ,
275- icon : "•" ,
276271 key : location ,
277272 description : log . message ,
278273 extra : log . name ,
279274 } ;
280275 } ) ;
281276
282277 logger . logIssues ( {
283- title : "Build failed!" ,
284- titleIcon : "✗" ,
278+ title : "✗ Build failed!" ,
285279 subtitle,
286280 levels : {
287- error : { color : theme . colors . error , icon : "❌ "} ,
288- warning : { color : theme . colors . warning , icon : "⚠️ "} ,
281+ error : { color : "error "} ,
282+ warning : { color : "warning "} ,
289283 } ,
290284 items,
291285 footer : "Fix these issues and rebuild" ,
292286 footerIcon : "!" ,
293- footerIconColor : theme . colors . warning ,
287+ footerIconColor : " warning" ,
294288 } ) ;
295289 } else {
296290 // No specific logs, just show generic error
@@ -311,7 +305,7 @@ ${builtCode}`;
311305 writeFileSync ( "bin/axogen" , executableContent ) ;
312306 chmodSync ( "bin/axogen" , "755" ) ;
313307
314- logger . file ( "Executable created at bin/axogen" ) ;
308+ logger . file ( "Executable created" , " bin/axogen") ;
315309}
316310
317311function cleanup ( ) {
0 commit comments