This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,21 @@ import { execSync } from 'child_process';
44import { join } from 'path' ;
55
66try {
7- if ( process . argv . includes ( '--compile' ) )
7+ const typecheck = process . argv . includes ( '--compile' ) ;
8+ if ( typecheck )
89 console . log ( 'Running TypeScript compiler...' ) ,
910 execSync ( 'npx tsc --noEmit --incremental false' , {
1011 stdio : 'inherit' ,
1112 cwd : process . cwd ( ) ,
1213 } ) ;
1314 else console . log ( 'pre compile run...' ) ;
14-
15- execSync ( 'npx tsx compiler/src/index.ts' , {
15+ const argv = process . argv . includes ( '--log' ) ? ' --log' : '' ;
16+ execSync ( 'npx tsx compiler/src/index.ts' + argv , {
1617 stdio : 'inherit' ,
1718 cwd : join ( process . cwd ( ) , 'node_modules/typedcssx' ) ,
1819 } ) ;
19-
20- console . log ( ' Compilation completed successfully.' ) ;
20+ const completed = typecheck ? 'completed ' : '' ;
21+ console . log ( ` Compilation ${ completed } successfully` ) ;
2122} catch ( error ) {
2223 console . error ( 'Compilation failed:' , error . message ) ;
2324 process . exit ( 1 ) ;
Original file line number Diff line number Diff line change @@ -17,14 +17,10 @@ export const buildIn = (styleSheet: string, global?: string): void => {
1717 const cssData = fs . readFileSync ( filePath , 'utf-8' ) ;
1818 if ( ! cssData . includes ( styleSheet ) ) {
1919 fs . appendFileSync ( filePath , styleSheet , 'utf-8' ) ;
20- console . log ( message + styleSheet ) ;
2120 }
22- } else {
23- fs . appendFileSync ( filePath , styleSheet , 'utf-8' ) ;
24- console . log ( message + styleSheet ) ;
21+ if ( process . argv . includes ( '--log' ) ) console . log ( message + styleSheet ) ;
2522 }
2623 } catch ( error ) {
2724 console . error ( 'Error writing to file:' , error ) ;
28- console . error ( 'Stack trace:' , error ) ;
2925 }
3026} ;
You can’t perform that action at this time.
0 commit comments