1
1
const args = require ( 'minimist' ) ( process . argv . slice ( 2 ) )
2
2
const fs = require ( 'fs' )
3
3
const path = require ( 'path' )
4
- const chalk = require ( 'chalk ' )
4
+ const colors = require ( 'picocolors ' )
5
5
const semver = require ( 'semver' )
6
6
const currentVersion = require ( '../package.json' ) . version
7
7
const { prompt } = require ( 'enquirer' )
@@ -25,9 +25,9 @@ const inc = i => semver.inc(currentVersion, i, preId)
25
25
const run = ( bin , args , opts = { } ) =>
26
26
execa ( bin , args , { stdio : 'inherit' , ...opts } )
27
27
const dryRun = ( bin , args , opts = { } ) =>
28
- console . log ( chalk . blue ( `[dryrun] ${ bin } ${ args . join ( ' ' ) } ` ) , opts )
28
+ console . log ( colors . blue ( `[dryrun] ${ bin } ${ args . join ( ' ' ) } ` ) , opts )
29
29
const runIfNotDry = isDryRun ? dryRun : run
30
- const step = msg => console . log ( chalk . cyan ( msg ) )
30
+ const step = msg => console . log ( colors . cyan ( msg ) )
31
31
32
32
async function main ( ) {
33
33
let targetVersion = args . _ [ 0 ]
@@ -154,11 +154,11 @@ async function publishPackage(version, runIfNotDry) {
154
154
}
155
155
)
156
156
console . log (
157
- chalk . green ( `Successfully published ${ publishedName } @${ version } ` )
157
+ colors . green ( `Successfully published ${ publishedName } @${ version } ` )
158
158
)
159
159
} catch ( e ) {
160
160
if ( e . stderr . match ( / p r e v i o u s l y p u b l i s h e d / ) ) {
161
- console . log ( chalk . red ( `Skipping already published: ${ publishedName } ` ) )
161
+ console . log ( colors . red ( `Skipping already published: ${ publishedName } ` ) )
162
162
} else {
163
163
throw e
164
164
}
0 commit comments