|
2 | 2 | import minimist from 'minimist'
|
3 | 3 | import fs from 'node:fs'
|
4 | 4 | import path from 'node:path'
|
5 |
| -import chalk from 'chalk' |
| 5 | +import pico from 'picocolors' |
6 | 6 | import semver from 'semver'
|
7 | 7 | import enquirer from 'enquirer'
|
8 | 8 | import { execa } from 'execa'
|
@@ -73,16 +73,16 @@ const inc = i => semver.inc(currentVersion, i, preId)
|
73 | 73 | const run = (bin, args, opts = {}) =>
|
74 | 74 | execa(bin, args, { stdio: 'inherit', ...opts })
|
75 | 75 | const dryRun = (bin, args, opts = {}) =>
|
76 |
| - console.log(chalk.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts) |
| 76 | + console.log(pico.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts) |
77 | 77 | const runIfNotDry = isDryRun ? dryRun : run
|
78 | 78 | const getPkgRoot = pkg => path.resolve(__dirname, '../packages/' + pkg)
|
79 |
| -const step = msg => console.log(chalk.cyan(msg)) |
| 79 | +const step = msg => console.log(pico.cyan(msg)) |
80 | 80 |
|
81 | 81 | async function main() {
|
82 | 82 | if (!(await isInSyncWithRemote())) {
|
83 | 83 | return
|
84 | 84 | } else {
|
85 |
| - console.log(`${chalk.green(`✓`)} commit is up-to-date with rmeote.\n`) |
| 85 | + console.log(`${pico.green(`✓`)} commit is up-to-date with rmeote.\n`) |
86 | 86 | }
|
87 | 87 |
|
88 | 88 | let targetVersion = args._[0]
|
@@ -285,7 +285,7 @@ async function main() {
|
285 | 285 |
|
286 | 286 | if (skippedPackages.length) {
|
287 | 287 | console.log(
|
288 |
| - chalk.yellow( |
| 288 | + pico.yellow( |
289 | 289 | `The following packages are skipped and NOT published:\n- ${skippedPackages.join(
|
290 | 290 | '\n- '
|
291 | 291 | )}`
|
@@ -361,7 +361,7 @@ function updateDeps(pkg, depType, version, getNewPackageName) {
|
361 | 361 | const newName = getNewPackageName(dep)
|
362 | 362 | const newVersion = newName === dep ? version : `npm:${newName}@${version}`
|
363 | 363 | console.log(
|
364 |
| - chalk.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`) |
| 364 | + pico.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`) |
365 | 365 | )
|
366 | 366 | deps[dep] = newVersion
|
367 | 367 | }
|
@@ -407,10 +407,10 @@ async function publishPackage(pkgName, version) {
|
407 | 407 | stdio: 'pipe'
|
408 | 408 | }
|
409 | 409 | )
|
410 |
| - console.log(chalk.green(`Successfully published ${pkgName}@${version}`)) |
| 410 | + console.log(pico.green(`Successfully published ${pkgName}@${version}`)) |
411 | 411 | } catch (e) {
|
412 | 412 | if (e.stderr.match(/previously published/)) {
|
413 |
| - console.log(chalk.red(`Skipping already published: ${pkgName}`)) |
| 413 | + console.log(pico.red(`Skipping already published: ${pkgName}`)) |
414 | 414 | } else {
|
415 | 415 | throw e
|
416 | 416 | }
|
|
0 commit comments