@@ -103,38 +103,43 @@ class VersionManager {
103103
104104 async getExistingPackages ( ) {
105105 // Find what packages already exist on npm
106- let promises = [ ] ;
107- for ( let name in this . workspacePackages ) {
108- let filePath = this . workspacePackages [ name ] . location + '/package.json' ;
109- let pkg = JSON . parse ( fs . readFileSync ( filePath , 'utf8' ) ) ;
110- if ( pkg . private ) {
111- continue ;
112- }
106+ let packages = Object . keys ( this . workspacePackages ) ;
107+ for ( let i = 0 ; i < packages . length ; i += 20 ) {
108+ let promises = [ ] ;
109+ for ( let name of packages . slice ( i , i + 20 ) ) {
110+ let filePath = this . workspacePackages [ name ] . location + '/package.json' ;
111+ let pkg = JSON . parse ( fs . readFileSync ( filePath , 'utf8' ) ) ;
112+ if ( pkg . private ) {
113+ continue ;
114+ }
113115
114- promises . push (
115- fetch ( `https://registry.npmjs.com/${ name } ` )
116- . then ( res => {
117- if ( res . ok ) {
118- return res . json ( ) ;
119- }
120- } )
121- . then ( json => {
122- if ( ! json ) {
123- return ;
124- }
116+ console . log ( 'Checking ' + name + ' on npm' ) ;
125117
126- let tags = json [ 'dist-tags' ] ;
127- for ( let tag in tags ) {
128- if ( ! tags [ tag ] . includes ( 'nightly' ) ) {
129- this . existingPackages . add ( name ) ;
130- break ;
118+ promises . push (
119+ fetch ( `https://registry.npmjs.com/${ name } ` )
120+ . then ( res => {
121+ if ( res . ok ) {
122+ return res . json ( ) ;
123+ }
124+ } )
125+ . then ( json => {
126+ if ( ! json ) {
127+ return ;
131128 }
132- }
133- } )
134- ) ;
135- }
136129
137- await Promise . all ( promises ) ;
130+ let tags = json [ 'dist-tags' ] ;
131+ for ( let tag in tags ) {
132+ if ( ! tags [ tag ] . includes ( 'nightly' ) ) {
133+ this . existingPackages . add ( name ) ;
134+ break ;
135+ }
136+ }
137+ } )
138+ ) ;
139+ }
140+
141+ await Promise . all ( promises ) ;
142+ }
138143 }
139144
140145 getChangedPackages ( ) {
0 commit comments