@@ -22,7 +22,7 @@ import { logger } from './logger.js';
2222import { getPackageManagerConfig } from './manager.js' ;
2323import { getNpmInfo , getNpmRegistry } from './npm.js' ;
2424import type { PackageInfo , ReleaseCLIOptions , ReleaseOptions } from './types.js' ;
25- import { isScopedPackage , joinArray , setOptions } from './utils.js' ;
25+ import { createSpin , isScopedPackage , joinArray , setOptions } from './utils.js' ;
2626import {
2727 diffColor ,
2828 getPreReleaseId ,
@@ -52,8 +52,13 @@ export async function getReleaseOptions(options: ReleaseCLIOptions) {
5252 await checkPackagePublishConfig ( opts ) ;
5353
5454 // npm info
55- for ( const pkg of opts . pkgs ) {
56- pkg . npmInfo = await getNpmInfo ( pkg ) ;
55+ {
56+ const spin = createSpin ( `Get npm info from npm registry` ) ;
57+ const list = await Promise . all ( opts . pkgs . map ( pkg => getNpmInfo ( pkg ) ) ) ;
58+ spin . stop ( ) ;
59+ list . forEach ( ( s , i ) => {
60+ opts . pkgs [ i ] . npmInfo = s ;
61+ } ) ;
5762 }
5863
5964 await selectTypeVersion ( opts ) ;
@@ -81,7 +86,7 @@ async function checkCLIOptions(opts: ReleaseCLIOptions) {
8186 }
8287 }
8388
84- if ( ! fs . existsSync ( cwd ) ) {
89+ if ( ! fs . existsSync ( cwd ! ) ) {
8590 throw new Error ( `[${ chalk . yellow ( '--cwd' ) } ] Directory "${ chalk . red ( cwd ) } " does not exist.` ) ;
8691 }
8792
@@ -96,7 +101,7 @@ async function checkCLIOptions(opts: ReleaseCLIOptions) {
96101}
97102
98103async function findPackages ( opts : ReleaseOptions ) {
99- const { rootPackage, packages } = await getPackages ( opts . cwd ) ;
104+ const { rootPackage, packages } = await getPackages ( opts . cwd ! ) ;
100105 if ( ! rootPackage || ! packages || packages . length == 0 ) {
101106 throw new Error ( 'No root package found.' ) ;
102107 }
0 commit comments