@@ -93,7 +93,7 @@ function fromLocalWebpack(extensionPath: string): Stream {
9393 . pipe ( packageJsonFilter . restore ) ;
9494
9595
96- const webpackStreams = webpackConfigLocations . map ( webpackConfigPath => ( ) => {
96+ const webpackStreams = webpackConfigLocations . map ( webpackConfigPath => {
9797
9898 const webpackDone = ( err : any , stats : any ) => {
9999 fancyLog ( `Bundled extension: ${ ansiColors . yellow ( path . join ( path . basename ( extensionPath ) , path . relative ( extensionPath , webpackConfigPath ) ) ) } ...` ) ;
@@ -140,7 +140,7 @@ function fromLocalWebpack(extensionPath: string): Stream {
140140 } ) ) ;
141141 } ) ;
142142
143- es . merge ( sequence ( webpackStreams ) , patchFilesStream )
143+ es . merge ( ... webpackStreams , patchFilesStream )
144144 // .pipe(es.through(function (data) {
145145 // // debug
146146 // console.log('out', data.path, data.contents.length);
@@ -227,31 +227,7 @@ interface IBuiltInExtension {
227227
228228const builtInExtensions : IBuiltInExtension [ ] = require ( '../builtInExtensions.json' ) ;
229229
230- /**
231- * We're doing way too much stuff at once, with webpack et al. So much stuff
232- * that while downloading extensions from the marketplace, node js doesn't get enough
233- * stack frames to complete the download in under 2 minutes, at which point the
234- * marketplace server cuts off the http request. So, we sequentialize the extensino tasks.
235- */
236- function sequence ( streamProviders : { ( ) : Stream } [ ] ) : Stream {
237- const result = es . through ( ) ;
238-
239- function pop ( ) {
240- if ( streamProviders . length === 0 ) {
241- result . emit ( 'end' ) ;
242- } else {
243- const fn = streamProviders . shift ( ) ! ;
244- fn ( )
245- . on ( 'end' , function ( ) { setTimeout ( pop , 0 ) ; } )
246- . pipe ( result , { end : false } ) ;
247- }
248- }
249-
250- pop ( ) ;
251- return result ;
252- }
253-
254- export function packageExtensionsStream ( ) : NodeJS . ReadWriteStream {
230+ export function packageLocalExtensionsStream ( ) : NodeJS . ReadWriteStream {
255231 const localExtensionDescriptions = ( < string [ ] > glob . sync ( 'extensions/*/package.json' ) )
256232 . map ( manifestPath => {
257233 const extensionPath = path . dirname ( path . join ( root , manifestPath ) ) ;
@@ -261,22 +237,22 @@ export function packageExtensionsStream(): NodeJS.ReadWriteStream {
261237 . filter ( ( { name } ) => excludedExtensions . indexOf ( name ) === - 1 )
262238 . filter ( ( { name } ) => builtInExtensions . every ( b => b . name !== name ) ) ;
263239
264- const localExtensions = ( ) => sequence ( [ ...localExtensionDescriptions . map ( extension => ( ) => {
265- return fromLocal ( extension . path )
266- . pipe ( rename ( p => p . dirname = `extensions/${ extension . name } /${ p . dirname } ` ) ) ;
267- } ) ] ) ;
268-
269- const localExtensionDependencies = ( ) => gulp . src ( 'extensions/node_modules/**' , { base : '.' } ) ;
270-
271- const marketplaceExtensions = ( ) => es . merge (
272- ...builtInExtensions
273- . map ( extension => {
274- return fromMarketplace ( extension . name , extension . version , extension . metadata )
275- . pipe ( rename ( p => p . dirname = `extensions/${ extension . name } /${ p . dirname } ` ) ) ;
276- } )
277- ) ;
240+ return es . merge (
241+ gulp . src ( 'extensions/node_modules/**' , { base : '.' } ) ,
242+ ...localExtensionDescriptions . map ( extension => {
243+ return fromLocal ( extension . path )
244+ . pipe ( rename ( p => p . dirname = `extensions/${ extension . name } /${ p . dirname } ` ) ) ;
245+ } )
246+ )
247+ . pipe ( util2 . setExecutableBit ( [ '**/*.sh' ] ) )
248+ . pipe ( filter ( [ '**' , '!**/*.js.map' ] ) ) ;
249+ }
278250
279- return sequence ( [ localExtensions , localExtensionDependencies , marketplaceExtensions ] )
251+ export function packageMarketplaceExtensionsStream ( ) : NodeJS . ReadWriteStream {
252+ return es . merge ( builtInExtensions . map ( extension => {
253+ return fromMarketplace ( extension . name , extension . version , extension . metadata )
254+ . pipe ( rename ( p => p . dirname = `extensions/${ extension . name } /${ p . dirname } ` ) ) ;
255+ } ) )
280256 . pipe ( util2 . setExecutableBit ( [ '**/*.sh' ] ) )
281257 . pipe ( filter ( [ '**' , '!**/*.js.map' ] ) ) ;
282258}
0 commit comments