@@ -22,7 +22,7 @@ const glob_1 = require("glob");
2222const gulp_1 = require ( "gulp" ) ;
2323const path = require ( "path" ) ;
2424const crypto_1 = require ( "crypto" ) ;
25- const vinyl_1 = require ( "vinyl" ) ;
25+ const File = require ( "vinyl" ) ;
2626const stats_1 = require ( "./stats" ) ;
2727const util2 = require ( "./util" ) ;
2828const gulp_filter_1 = require ( "gulp-filter" ) ;
@@ -44,7 +44,7 @@ function minifyExtensionResources(input) {
4444 return input
4545 . pipe ( jsonFilter )
4646 . pipe ( ( 0 , gulp_buffer_1 ) ( ) )
47- . pipe ( event_stream_1 . default . mapSync ( ( f ) => {
47+ . pipe ( event_stream_1 . mapSync ( ( f ) => {
4848 const errors = [ ] ;
4949 const value = jsoncParser . parse ( f . contents . toString ( 'utf8' ) , errors , { allowTrailingComma : true } ) ;
5050 if ( errors . length === 0 ) {
@@ -60,7 +60,7 @@ function updateExtensionPackageJSON(input, update) {
6060 return input
6161 . pipe ( packageJsonFilter )
6262 . pipe ( ( 0 , gulp_buffer_1 ) ( ) )
63- . pipe ( event_stream_1 . default . mapSync ( ( f ) => {
63+ . pipe ( event_stream_1 . mapSync ( ( f ) => {
6464 const data = JSON . parse ( f . contents . toString ( 'utf8' ) ) ;
6565 f . contents = Buffer . from ( JSON . stringify ( update ( data ) ) ) ;
6666 return f ;
@@ -92,7 +92,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
9292 const vsce = require ( '@vscode/vsce' ) ;
9393 const webpack = require ( 'webpack' ) ;
9494 const webpackGulp = require ( 'webpack-stream' ) ;
95- const result = event_stream_1 . default . through ( ) ;
95+ const result = event_stream_1 . through ( ) ;
9696 const packagedDependencies = [ ] ;
9797 const packageJsonConfig = require ( path . join ( extensionPath , 'package.json' ) ) ;
9898 if ( packageJsonConfig . dependencies ) {
@@ -111,15 +111,15 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
111111 vsce . listFiles ( { cwd : extensionPath , packageManager : vsce . PackageManager . None , packagedDependencies } ) . then ( fileNames => {
112112 const files = fileNames
113113 . map ( fileName => path . join ( extensionPath , fileName ) )
114- . map ( filePath => new vinyl_1 . default ( {
114+ . map ( filePath => new File ( {
115115 path : filePath ,
116116 stat : fs . statSync ( filePath ) ,
117117 base : extensionPath ,
118118 contents : fs . createReadStream ( filePath )
119119 } ) ) ;
120120 // check for a webpack configuration files, then invoke webpack
121121 // and merge its output with the files stream.
122- const webpackConfigLocations = glob_1 . default . sync ( path . join ( extensionPath , '**' , webpackConfigFileName ) , { ignore : [ '**/node_modules' ] } ) ;
122+ const webpackConfigLocations = glob_1 . sync ( path . join ( extensionPath , '**' , webpackConfigFileName ) , { ignore : [ '**/node_modules' ] } ) ;
123123 const webpackStreams = webpackConfigLocations . flatMap ( webpackConfigPath => {
124124 const webpackDone = ( err , stats ) => {
125125 ( 0 , fancy_log_1 ) ( `Bundled extension: ${ ansi_colors_1 . yellow ( path . join ( path . basename ( extensionPath ) , path . relative ( extensionPath , webpackConfigPath ) ) ) } ...` ) ;
@@ -155,12 +155,12 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
155155 }
156156 const relativeOutputPath = path . relative ( extensionPath , webpackConfig . output . path ) ;
157157 return webpackGulp ( webpackConfig , webpack , webpackDone )
158- . pipe ( event_stream_1 . default . through ( function ( data ) {
158+ . pipe ( event_stream_1 . through ( function ( data ) {
159159 data . stat = data . stat || { } ;
160160 data . base = extensionPath ;
161161 this . emit ( 'data' , data ) ;
162162 } ) )
163- . pipe ( event_stream_1 . default . through ( function ( data ) {
163+ . pipe ( event_stream_1 . through ( function ( data ) {
164164 // source map handling:
165165 // * rewrite sourceMappingURL
166166 // * save to disk so that upload-task picks this up
@@ -174,7 +174,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
174174 } ) ) ;
175175 } ) ;
176176 } ) ;
177- event_stream_1 . default . merge ( ...webpackStreams , event_stream_1 . default . readArray ( files ) )
177+ event_stream_1 . merge ( ...webpackStreams , event_stream_1 . readArray ( files ) )
178178 // .pipe(es.through(function (data) {
179179 // // debug
180180 // console.log('out', data.path, data.contents.length);
@@ -190,18 +190,18 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
190190}
191191function fromLocalNormal ( extensionPath ) {
192192 const vsce = require ( '@vscode/vsce' ) ;
193- const result = event_stream_1 . default . through ( ) ;
193+ const result = event_stream_1 . through ( ) ;
194194 vsce . listFiles ( { cwd : extensionPath , packageManager : vsce . PackageManager . Npm } )
195195 . then ( fileNames => {
196196 const files = fileNames
197197 . map ( fileName => path . join ( extensionPath , fileName ) )
198- . map ( filePath => new vinyl_1 . default ( {
198+ . map ( filePath => new File ( {
199199 path : filePath ,
200200 stat : fs . statSync ( filePath ) ,
201201 base : extensionPath ,
202202 contents : fs . createReadStream ( filePath )
203203 } ) ) ;
204- event_stream_1 . default . readArray ( files ) . pipe ( result ) ;
204+ event_stream_1 . readArray ( files ) . pipe ( result ) ;
205205 } )
206206 . catch ( err => result . emit ( 'error' , err ) ) ;
207207 return result . pipe ( ( 0 , stats_1 . createStatsStream ) ( path . basename ( extensionPath ) ) ) ;
@@ -237,9 +237,9 @@ function fromVsix(vsixPath, { name: extensionName, version, sha256, metadata })
237237 const json = require ( 'gulp-json-editor' ) ;
238238 ( 0 , fancy_log_1 ) ( 'Using local VSIX for extension:' , ansi_colors_1 . yellow ( `${ extensionName } @${ version } ` ) , '...' ) ;
239239 const packageJsonFilter = ( 0 , gulp_filter_1 ) ( 'package.json' , { restore : true } ) ;
240- return gulp_1 . default . src ( vsixPath )
240+ return gulp_1 . src ( vsixPath )
241241 . pipe ( ( 0 , gulp_buffer_1 ) ( ) )
242- . pipe ( event_stream_1 . default . mapSync ( ( f ) => {
242+ . pipe ( event_stream_1 . mapSync ( ( f ) => {
243243 const hash = crypto_1 . default . createHash ( 'sha256' ) ;
244244 hash . update ( f . contents ) ;
245245 const checksum = hash . digest ( 'hex' ) ;
@@ -353,7 +353,7 @@ function packageNativeLocalExtensionsStream(forWeb, disableMangle) {
353353 * @returns a stream
354354 */
355355function packageAllLocalExtensionsStream ( forWeb , disableMangle ) {
356- return event_stream_1 . default . merge ( [
356+ return event_stream_1 . merge ( [
357357 packageNonNativeLocalExtensionsStream ( forWeb , disableMangle ) ,
358358 packageNativeLocalExtensionsStream ( forWeb , disableMangle )
359359 ] ) ;
@@ -365,7 +365,7 @@ function packageAllLocalExtensionsStream(forWeb, disableMangle) {
365365 */
366366function doPackageLocalExtensionsStream ( forWeb , disableMangle , native ) {
367367 const nativeExtensionsSet = new Set ( nativeExtensions ) ;
368- const localExtensionsDescriptions = ( glob_1 . default . sync ( 'extensions/*/package.json' )
368+ const localExtensionsDescriptions = ( glob_1 . sync ( 'extensions/*/package.json' )
369369 . map ( manifestPath => {
370370 const absoluteManifestPath = path . join ( root , manifestPath ) ;
371371 const extensionPath = path . dirname ( path . join ( root , manifestPath ) ) ;
@@ -376,7 +376,7 @@ function doPackageLocalExtensionsStream(forWeb, disableMangle, native) {
376376 . filter ( ( { name } ) => excludedExtensions . indexOf ( name ) === - 1 )
377377 . filter ( ( { name } ) => builtInExtensions . every ( b => b . name !== name ) )
378378 . filter ( ( { manifestPath } ) => ( forWeb ? isWebExtension ( require ( manifestPath ) ) : true ) ) ) ;
379- const localExtensionsStream = minifyExtensionResources ( event_stream_1 . default . merge ( ...localExtensionsDescriptions . map ( extension => {
379+ const localExtensionsStream = minifyExtensionResources ( event_stream_1 . merge ( ...localExtensionsDescriptions . map ( extension => {
380380 return fromLocal ( extension . path , forWeb , disableMangle )
381381 . pipe ( ( 0 , gulp_rename_1 ) ( p => p . dirname = `extensions/${ extension . name } /${ p . dirname } ` ) ) ;
382382 } ) ) ) ;
@@ -389,7 +389,7 @@ function doPackageLocalExtensionsStream(forWeb, disableMangle, native) {
389389 const productionDependencies = ( 0 , dependencies_1 . getProductionDependencies ) ( 'extensions/' ) ;
390390 const dependenciesSrc = productionDependencies . map ( d => path . relative ( root , d ) ) . map ( d => [ `${ d } /**` , `!${ d } /**/{test,tests}/**` ] ) . flat ( ) ;
391391 if ( dependenciesSrc . length > 0 ) {
392- result = event_stream_1 . default . merge ( localExtensionsStream , gulp_1 . default . src ( dependenciesSrc , { base : '.' } )
392+ result = event_stream_1 . merge ( localExtensionsStream , gulp_1 . src ( dependenciesSrc , { base : '.' } )
393393 . pipe ( util2 . cleanNodeModules ( path . join ( root , 'build' , '.moduleignore' ) ) )
394394 . pipe ( util2 . cleanNodeModules ( path . join ( root , 'build' , `.moduleignore.${ process . platform } ` ) ) ) ) ;
395395 }
@@ -405,7 +405,7 @@ function packageMarketplaceExtensionsStream(forWeb) {
405405 ...builtInExtensions . filter ( ( { name } ) => ( forWeb ? ! marketplaceWebExtensionsExclude . has ( name ) : true ) ) ,
406406 ...( forWeb ? webBuiltInExtensions : [ ] )
407407 ] ;
408- const marketplaceExtensionsStream = minifyExtensionResources ( event_stream_1 . default . merge ( ...marketplaceExtensionsDescriptions
408+ const marketplaceExtensionsStream = minifyExtensionResources ( event_stream_1 . merge ( ...marketplaceExtensionsDescriptions
409409 . map ( extension => {
410410 const src = ( 0 , builtInExtensions_1 . getExtensionStream ) ( extension ) . pipe ( ( 0 , gulp_rename_1 ) ( p => p . dirname = `extensions/${ p . dirname } ` ) ) ;
411411 return updateExtensionPackageJSON ( src , ( data ) => {
0 commit comments