Upgrade to gulp4

This commit is contained in:
Alex Dima 2019-02-05 23:11:05 +01:00
parent 929177ff6a
commit d71299fe5d
8 changed files with 1043 additions and 788 deletions

View file

@ -80,6 +80,7 @@ const tasks = compilations.map(function (tsconfigFile) {
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
.pipe(compilation())
.pipe(util.toLatestVinylFile())
.pipe(build ? nlsDev.rewriteLocalizeCalls() : es.through())
.pipe(build ? util.stripSourceMappingURL() : es.through())
.pipe(sourcemaps.write('.', {

View file

@ -58,6 +58,7 @@ function createCompile(src, build, emitError) {
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
.pipe(ts(token))
.pipe(util.toLatestVinylFile())
.pipe(noDeclarationsFilter)
.pipe(build ? nls() : es.through())
.pipe(noDeclarationsFilter.restore)

View file

@ -66,6 +66,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean): (token
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
.pipe(ts(token))
.pipe(util.toLatestVinylFile())
.pipe(noDeclarationsFilter)
.pipe(build ? nls() : es.through())
.pipe(noDeclarationsFilter.restore)

View file

@ -11,6 +11,9 @@ declare module "vinyl" {
* A virtual file format.
*/
class File {
public static isVinyl(t: any): t is File;
constructor(options?: {
/**
* Default: process.cwd()

View file

@ -98,6 +98,18 @@ function skipDirectories() {
});
}
exports.skipDirectories = skipDirectories;
/**
* gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl)
*/
function toLatestVinylFile() {
return es.mapSync(f => {
if (VinylFile.isVinyl(f)) {
return f;
}
return new VinylFile(f);
});
}
exports.toLatestVinylFile = toLatestVinylFile;
function cleanNodeModule(name, excludes, includes) {
const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : '');
const negate = (str) => '!' + str;

View file

@ -129,6 +129,18 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
});
}
/**
* gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl)
*/
export function toLatestVinylFile(): NodeJS.ReadWriteStream {
return es.mapSync<VinylFile, VinylFile>(f => {
if (VinylFile.isVinyl(f)) {
return f;
}
return new VinylFile(f);
});
}
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
const negate = (str: string) => '!' + str;

View file

@ -83,23 +83,23 @@
"express": "^4.13.1",
"fancy-log": "^1.3.3",
"glob": "^5.0.13",
"gulp": "^3.8.9",
"gulp": "^4.0.0",
"gulp-atom-electron": "^1.19.2",
"gulp-azure-storage": "^0.8.2",
"gulp-azure-storage": "^0.9.0",
"gulp-buffer": "0.0.2",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.0",
"gulp-eslint": "^3.0.1",
"gulp-filter": "^3.0.0",
"gulp-flatmap": "^1.0.0",
"gulp-json-editor": "^2.2.1",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.3",
"gulp-eslint": "^5.0.0",
"gulp-filter": "^5.1.0",
"gulp-flatmap": "^1.0.2",
"gulp-json-editor": "^2.5.0",
"gulp-plumber": "^1.2.0",
"gulp-remote-src": "^0.4.4",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.5.2",
"gulp-shell": "^0.6.5",
"gulp-tsb": "2.0.5",
"gulp-tslint": "^8.1.2",
"gulp-tslint": "^8.1.3",
"gulp-uglify": "^3.0.0",
"gulp-vinyl-zip": "^2.1.2",
"husky": "^0.13.1",
@ -119,7 +119,7 @@
"pump": "^1.0.1",
"queue": "3.0.6",
"rcedit": "^1.1.0",
"remap-istanbul": "^0.6.4",
"remap-istanbul": "^0.13.0",
"rimraf": "^2.2.8",
"sinon": "^1.17.2",
"source-map": "^0.4.4",
@ -130,8 +130,8 @@
"typescript-tslint-plugin": "^0.0.7",
"uglify-es": "^3.0.18",
"underscore": "^1.8.2",
"vinyl": "^0.4.5",
"vinyl-fs": "^2.4.3",
"vinyl": "^2.0.0",
"vinyl-fs": "^3.0.0",
"vsce": "1.48.0",
"vscode-nls-dev": "3.2.2",
"webpack": "^4.16.5",

1775
yarn.lock

File diff suppressed because it is too large Load diff