File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed
Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 11import { ProjectGraph } from 'nx/src/config/project-graph' ;
22import chalk from 'chalk' ;
3- import { colorProjectName } from '../utils/output' ;
3+ import { colorProjectName , printHeader } from '../utils/output' ;
44import { $ } from 'execa' ;
55import * as path from 'node:path' ;
66
77export function syncPackageJson ( projectsList : string [ ] , graph : ProjectGraph ) {
8- console . log (
9- chalk . bgCyan ( chalk . black ( ' SYNC ' ) ) ,
10- `Copy "package.json" files to projects output to sync package version\n`
11- ) ;
8+ console . log ( printHeader ( 'sync' , 'cyan' ) , `Copy "package.json" files to projects output to sync package version\n` ) ;
129 const projects = projectsList . map ( ( projectName ) => graph . nodes [ projectName ] ) ;
1310
1411 const file = 'package.json' ;
Original file line number Diff line number Diff line change @@ -113,11 +113,11 @@ import { handleChangelog } from './changelog';
113113 return process . exit ( 0 ) ;
114114 } else {
115115 if ( projectsList . size === 0 ) {
116- console . error (
117- printHeader ( 'Projects' , 'redBright ' ) ,
118- `Trying to publish but no projects were specified. This would release ALL projects with tag ' ${ tag } '! Exiting... `
116+ console . log (
117+ printHeader ( 'Projects' , 'yellow ' ) ,
118+ `⏭️ Trying to publish but no projects were specified, skipping publish step altogether `
119119 ) ;
120- return process . exit ( 1 ) ;
120+ return process . exit ( 0 ) ;
121121 }
122122
123123 const projectsListArray = Array . from ( projectsList . values ( ) ) ;
Original file line number Diff line number Diff line change 1- import chalk , { ColorName } from 'chalk' ;
1+ import chalk , { ColorName , ForegroundColorName } from 'chalk' ;
22
33const colors = [
44 { instance : chalk . green , spinnerColor : 'green' } ,
@@ -46,6 +46,6 @@ export async function suppressOutput<T>(fn: () => T): Promise<T> {
4646 return result ;
4747}
4848
49- export function printHeader ( title : string , color : ColorName ) : string {
50- return chalk . reset . inverse . bold [ color ] ( ` ${ title . toUpperCase ( ) } ` ) ;
49+ export function printHeader ( title : string , color : ForegroundColorName ) : string {
50+ return chalk . reset [ color ] . inverse . bold ( ` ${ title . toUpperCase ( ) } ` ) ;
5151}
You can’t perform that action at this time.
0 commit comments