File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed
Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env bun
22
3+ import { styleText } from 'node:util'
34import { version } from './system'
45
56// [-npe] --> [-n, -p, -e]
@@ -118,18 +119,11 @@ Examples
118119`
119120
120121
121- const colors = {
122- boldwhite : str => `\x1b[1;37m${ str } \x1b[0m` ,
123- gray : str => `\x1b[90m${ str } \x1b[0m` ,
124- green : str => `\x1b[32m${ str } \x1b[0m` ,
125- cyan : str => `\x1b[36m${ str } \x1b[0m` ,
126- }
127-
128122function format ( line ) {
129- return line . match ( / ^ \w [ \w ] + $ / ) ? colors . boldwhite ( line ) // titles
130- : '┏┃┗' . includes ( line . trim ( ) [ 0 ] ) ? colors . green ( line ) // ascii art
131- : line . includes ( '#' ) ? colors . cyan ( line ) // comments
132- : colors . gray ( line )
123+ return line . match ( / ^ \w [ \w ] + $ / ) ? styleText ( [ 'bold' , 'white' ] , line ) // titles
124+ : '┏┃┗' . includes ( line . trim ( ) [ 0 ] ) ? styleText ( [ 'green' ] , line ) // ascii art
125+ : line . includes ( '#' ) ? styleText ( [ 'cyan' ] , line ) // comments
126+ : styleText ( [ 'gray' ] , line )
133127}
134128
135129export function printHelp ( ) {
Original file line number Diff line number Diff line change @@ -3,14 +3,10 @@ import { mkdir, rm } from 'node:fs/promises'
33import { fileURLToPath } from 'node:url'
44import { join } from 'node:path'
55
6+ import { version as pkgVersion } from '../package.json' with { type : 'json' }
67import { compileJS } from './asset'
78
8- async function getVersion ( ) {
9- const file = Bun . file ( join ( import . meta. dir , '../package.json' ) )
10- return ( await file . json ( ) ) . version
11- }
12-
13- export const version = await getVersion ( )
9+ export const version = pkgVersion
1410
1511export function getClientFiles ( ) {
1612 return 'error hmr mount transitions' . split ( ' ' ) . map ( name => {
You can’t perform that action at this time.
0 commit comments