@@ -103,38 +103,43 @@ class VersionManager {
103
103
104
104
async getExistingPackages ( ) {
105
105
// 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
+ }
113
115
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' ) ;
125
117
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 ;
131
128
}
132
- }
133
- } )
134
- ) ;
135
- }
136
129
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
+ }
138
143
}
139
144
140
145
getChangedPackages ( ) {
0 commit comments