@@ -14,7 +14,6 @@ import * as vsce from 'vsce';
1414import { createStatsStream } from './stats' ;
1515import * as util2 from './util' ;
1616import remote = require( 'gulp-remote-src' ) ;
17- const flatmap = require ( 'gulp-flatmap' ) ;
1817const vzip = require ( 'gulp-vinyl-zip' ) ;
1918const filter = require ( 'gulp-filter' ) ;
2019const rename = require ( 'gulp-rename' ) ;
@@ -26,7 +25,7 @@ const webpackGulp = require('webpack-stream');
2625
2726const root = path . resolve ( path . join ( __dirname , '..' , '..' ) ) ;
2827
29- export function fromLocal ( extensionPath : string , sourceMappingURLBase ?: string ) : Stream {
28+ function fromLocal ( extensionPath : string , sourceMappingURLBase ?: string ) : Stream {
3029 const webpackFilename = path . join ( extensionPath , 'extension.webpack.config.js' ) ;
3130 if ( fs . existsSync ( webpackFilename ) ) {
3231 return fromLocalWebpack ( extensionPath , sourceMappingURLBase ) ;
@@ -201,19 +200,16 @@ export function fromMarketplace(extensionName: string, version: string, metadata
201200 }
202201 } ;
203202
203+ const packageJsonFilter = filter ( 'package.json' , { restore : true } ) ;
204+
204205 return remote ( '' , options )
205- . pipe ( flatmap ( stream => {
206- const packageJsonFilter = filter ( 'package.json' , { restore : true } ) ;
207-
208- return stream
209- . pipe ( vzip . src ( ) )
210- . pipe ( filter ( 'extension/**' ) )
211- . pipe ( rename ( p => p . dirname = p . dirname . replace ( / ^ e x t e n s i o n \/ ? / , '' ) ) )
212- . pipe ( packageJsonFilter )
213- . pipe ( buffer ( ) )
214- . pipe ( json ( { __metadata : metadata } ) )
215- . pipe ( packageJsonFilter . restore ) ;
216- } ) ) ;
206+ . pipe ( vzip . src ( ) )
207+ . pipe ( filter ( 'extension/**' ) )
208+ . pipe ( rename ( p => p . dirname = p . dirname . replace ( / ^ e x t e n s i o n \/ ? / , '' ) ) )
209+ . pipe ( packageJsonFilter )
210+ . pipe ( buffer ( ) )
211+ . pipe ( json ( { __metadata : metadata } ) )
212+ . pipe ( packageJsonFilter . restore ) ;
217213}
218214
219215interface IPackageExtensionsOptions {
0 commit comments