Skip to content

Commit ed72229

Browse files
author
Tajudeen
committed
Fix event-stream import to use namespace import instead of default
1 parent 07a1430 commit ed72229

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

build/lib/util.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const ternary_stream_1 = require("ternary-stream");
3636
const root = path.dirname(path.dirname(__dirname));
3737
const NoCancellationToken = { isCancellationRequested: () => false };
3838
function incremental(streamProvider, initial, supportsCancellation) {
39-
const input = event_stream_1.default.through();
40-
const output = event_stream_1.default.through();
39+
const input = event_stream_1.through();
40+
const output = event_stream_1.through();
4141
let state = 'idle';
4242
let buffer = Object.create(null);
4343
const token = !supportsCancellation ? undefined : { isCancellationRequested: () => Object.keys(buffer).length > 0 };
@@ -46,7 +46,7 @@ function incremental(streamProvider, initial, supportsCancellation) {
4646
const stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken);
4747
input
4848
.pipe(stream)
49-
.pipe(event_stream_1.default.through(undefined, () => {
49+
.pipe(event_stream_1.through(undefined, () => {
5050
state = 'idle';
5151
eventuallyRun();
5252
}))
@@ -62,24 +62,24 @@ function incremental(streamProvider, initial, supportsCancellation) {
6262
}
6363
const data = paths.map(path => buffer[path]);
6464
buffer = Object.create(null);
65-
run(event_stream_1.default.readArray(data), true);
65+
run(event_stream_1.readArray(data), true);
6666
}, 500);
6767
input.on('data', (f) => {
6868
buffer[f.path] = f;
6969
if (state === 'idle') {
7070
eventuallyRun();
7171
}
7272
});
73-
return event_stream_1.default.duplex(input, output);
73+
return event_stream_1.duplex(input, output);
7474
}
7575
function debounce(task, duration = 500) {
76-
const input = event_stream_1.default.through();
77-
const output = event_stream_1.default.through();
76+
const input = event_stream_1.through();
77+
const output = event_stream_1.through();
7878
let state = 'idle';
7979
const run = () => {
8080
state = 'running';
8181
task()
82-
.pipe(event_stream_1.default.through(undefined, () => {
82+
.pipe(event_stream_1.through(undefined, () => {
8383
const shouldRunAgain = state === 'stale';
8484
state = 'idle';
8585
if (shouldRunAgain) {
@@ -98,21 +98,21 @@ function debounce(task, duration = 500) {
9898
state = 'stale';
9999
}
100100
});
101-
return event_stream_1.default.duplex(input, output);
101+
return event_stream_1.duplex(input, output);
102102
}
103103
function fixWin32DirectoryPermissions() {
104104
if (!/win32/.test(process.platform)) {
105-
return event_stream_1.default.through();
105+
return event_stream_1.through();
106106
}
107-
return event_stream_1.default.mapSync(f => {
107+
return event_stream_1.mapSync(f => {
108108
if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) {
109109
f.stat.mode = 16877;
110110
}
111111
return f;
112112
});
113113
}
114114
function setExecutableBit(pattern) {
115-
const setBit = event_stream_1.default.mapSync(f => {
115+
const setBit = event_stream_1.mapSync(f => {
116116
if (!f.stat) {
117117
const stat = { isFile() { return true; }, mode: 0 };
118118
f.stat = stat;
@@ -123,13 +123,13 @@ function setExecutableBit(pattern) {
123123
if (!pattern) {
124124
return setBit;
125125
}
126-
const input = event_stream_1.default.through();
126+
const input = event_stream_1.through();
127127
const filter = (0, gulp_filter_1.default)(pattern, { restore: true });
128128
const output = input
129129
.pipe(filter)
130130
.pipe(setBit)
131131
.pipe(filter.restore);
132-
return event_stream_1.default.duplex(input, output);
132+
return event_stream_1.duplex(input, output);
133133
}
134134
function toFileUri(filePath) {
135135
const match = filePath.match(/^([a-z])\:(.*)$/i);
@@ -139,7 +139,7 @@ function toFileUri(filePath) {
139139
return 'file://' + filePath.replace(/\\/g, '/');
140140
}
141141
function skipDirectories() {
142-
return event_stream_1.default.mapSync(f => {
142+
return event_stream_1.mapSync(f => {
143143
if (!f.isDirectory()) {
144144
return f;
145145
}
@@ -152,14 +152,14 @@ function cleanNodeModules(rulePath) {
152152
.filter(line => line && !/^#/.test(line));
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)}`);
155-
const input = event_stream_1.default.through();
156-
const output = event_stream_1.default.merge(input.pipe((0, gulp_filter_1.default)(['**', ...excludes])), input.pipe((0, gulp_filter_1.default)(includes)));
157-
return event_stream_1.default.duplex(input, output);
155+
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)));
157+
return event_stream_1.duplex(input, output);
158158
}
159159
function loadSourcemaps() {
160-
const input = event_stream_1.default.through();
160+
const input = event_stream_1.through();
161161
const output = input
162-
.pipe(event_stream_1.default.map((f, cb) => {
162+
.pipe(event_stream_1.map((f, cb) => {
163163
if (f.sourceMap) {
164164
cb(undefined, f);
165165
return;
@@ -195,48 +195,48 @@ function loadSourcemaps() {
195195
cb(undefined, f);
196196
});
197197
}));
198-
return event_stream_1.default.duplex(input, output);
198+
return event_stream_1.duplex(input, output);
199199
}
200200
function stripSourceMappingURL() {
201-
const input = event_stream_1.default.through();
201+
const input = event_stream_1.through();
202202
const output = input
203-
.pipe(event_stream_1.default.mapSync(f => {
203+
.pipe(event_stream_1.mapSync(f => {
204204
const contents = f.contents.toString('utf8');
205205
f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8');
206206
return f;
207207
}));
208-
return event_stream_1.default.duplex(input, output);
208+
return event_stream_1.duplex(input, output);
209209
}
210210
/** Splits items in the stream based on the predicate, sending them to onTrue if true, or onFalse otherwise */
211-
function $if(test, onTrue, onFalse = event_stream_1.default.through()) {
211+
function $if(test, onTrue, onFalse = event_stream_1.through()) {
212212
if (typeof test === 'boolean') {
213213
return test ? onTrue : onFalse;
214214
}
215215
return (0, ternary_stream_1.default)(test, onTrue, onFalse);
216216
}
217217
/** Operator that appends the js files' original path a sourceURL, so debug locations map */
218218
function appendOwnPathSourceURL() {
219-
const input = event_stream_1.default.through();
219+
const input = event_stream_1.through();
220220
const output = input
221-
.pipe(event_stream_1.default.mapSync(f => {
221+
.pipe(event_stream_1.mapSync(f => {
222222
if (!(f.contents instanceof Buffer)) {
223223
throw new Error(`contents of ${f.path} are not a buffer`);
224224
}
225225
f.contents = Buffer.concat([f.contents, Buffer.from(`\n//# sourceURL=${(0, url_1.pathToFileURL)(f.path)}`)]);
226226
return f;
227227
}));
228-
return event_stream_1.default.duplex(input, output);
228+
return event_stream_1.duplex(input, output);
229229
}
230230
function rewriteSourceMappingURL(sourceMappingURLBase) {
231-
const input = event_stream_1.default.through();
231+
const input = event_stream_1.through();
232232
const output = input
233-
.pipe(event_stream_1.default.mapSync(f => {
233+
.pipe(event_stream_1.mapSync(f => {
234234
const contents = f.contents.toString('utf8');
235235
const str = `//# sourceMappingURL=${sourceMappingURLBase}/${path.dirname(f.relative).replace(/\\/g, '/')}/$1`;
236236
f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, str));
237237
return f;
238238
}));
239-
return event_stream_1.default.duplex(input, output);
239+
return event_stream_1.duplex(input, output);
240240
}
241241
function rimraf(dir) {
242242
const result = () => new Promise((c, e) => {
@@ -287,15 +287,15 @@ function rebase(count) {
287287
});
288288
}
289289
function filter(fn) {
290-
const result = event_stream_1.default.through(function (data) {
290+
const result = event_stream_1.through(function (data) {
291291
if (fn(data)) {
292292
this.emit('data', data);
293293
}
294294
else {
295295
result.restore.push(data);
296296
}
297297
});
298-
result.restore = event_stream_1.default.through();
298+
result.restore = event_stream_1.through();
299299
return result;
300300
}
301301
function streamToPromise(stream) {

build/lib/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import es from 'event-stream';
6+
import * as es from 'event-stream';
77
import _debounce from 'debounce';
88
import _filter from 'gulp-filter';
99
import rename from 'gulp-rename';

0 commit comments

Comments
 (0)