Skip to content

Commit 6b76e56

Browse files
author
Tajudeen
committed
Fix all remaining module import issues in build/lib files
Fixed: - event_stream_1.default -> event_stream_1 (in extensions.js, stats.js) - gulp_filter_1.default -> gulp_filter_1 (in util.js) - gulp_rename_1.default -> gulp_rename_1 (in util.js) - glob_1.default -> glob_1 (in extensions.js) - gulp_1.default -> gulp_1 (in extensions.js) - vinyl_1.default -> File (in extensions.js) - child_process_1.default -> child_process (in dependencies.js) - ansi_colors_1.default -> ansi_colors_1 (in stats.js) All build tasks now complete successfully.
1 parent e25ce3e commit 6b76e56

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

build/lib/dependencies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
77
exports.getProductionDependencies = getProductionDependencies;
88
const fs = require("fs");
99
const path = require("path");
10-
const child_process_1 = require("child_process");
10+
const child_process = require("child_process");
1111
const root = fs.realpathSync(path.dirname(path.dirname(__dirname)));
1212
function getNpmProductionDependencies(folder) {
1313
let raw;
1414
try {
15-
raw = child_process_1.default.execSync('npm ls --all --omit=dev --parseable', { cwd: folder, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, null] });
15+
raw = child_process.execSync('npm ls --all --omit=dev --parseable', { cwd: folder, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, null] });
1616
}
1717
catch (err) {
1818
const regex = /^npm ERR! .*$/gm;

build/lib/extensions.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const glob_1 = require("glob");
2222
const gulp_1 = require("gulp");
2323
const path = require("path");
2424
const crypto_1 = require("crypto");
25-
const vinyl_1 = require("vinyl");
25+
const File = require("vinyl");
2626
const stats_1 = require("./stats");
2727
const util2 = require("./util");
2828
const 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
}
191191
function 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
*/
355355
function 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
*/
366366
function 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) => {

build/lib/stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const _entries = new Map();
4040
function createStatsStream(group, log) {
4141
const entry = new Entry(group, 0, 0);
4242
_entries.set(entry.name, entry);
43-
return event_stream_1.default.through(function (data) {
43+
return event_stream_1.through(function (data) {
4444
const file = data;
4545
if (typeof file.path === 'string') {
4646
entry.totalCount += 1;

build/lib/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function setExecutableBit(pattern) {
124124
return setBit;
125125
}
126126
const input = event_stream_1.through();
127-
const filter = (0, gulp_filter_1.default)(pattern, { restore: true });
127+
const filter = (0, gulp_filter_1)(pattern, { restore: true });
128128
const output = input
129129
.pipe(filter)
130130
.pipe(setBit)
@@ -153,7 +153,7 @@ function cleanNodeModules(rulePath) {
153153
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
154154
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
155155
const input = event_stream_1.through();
156-
const output = event_stream_1.merge(input.pipe((0, gulp_filter_1.default)(['**', ...excludes])), input.pipe((0, gulp_filter_1.default)(includes)));
156+
const output = event_stream_1.merge(input.pipe((0, gulp_filter_1)(['**', ...excludes])), input.pipe((0, gulp_filter_1)(includes)));
157157
return event_stream_1.duplex(input, output);
158158
}
159159
function loadSourcemaps() {
@@ -281,7 +281,7 @@ function ensureDir(dirPath) {
281281
fs.mkdirSync(dirPath);
282282
}
283283
function rebase(count) {
284-
return (0, gulp_rename_1.default)(f => {
284+
return (0, gulp_rename_1)(f => {
285285
const parts = f.dirname ? f.dirname.split(/[\/\\]/) : [];
286286
f.dirname = parts.slice(count).join(path.sep);
287287
});

0 commit comments

Comments
 (0)