diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 835ccf10d04b69371f8bfa3be344333815937c30..f282b006cd863010000892e3208bbaafb2c10cf2 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -22,14 +22,14 @@ var editorEntryPoints = [ { name: 'vs/editor/editor.main', include: [], - exclude: [ 'vs/css', 'vs/nls' ], - prepend: [ 'out-build/vs/css.js', 'out-build/vs/nls.js' ], + exclude: ['vs/css', 'vs/nls'], + prepend: ['out-build/vs/css.js', 'out-build/vs/nls.js'], }, { name: 'vs/base/common/worker/simpleWorker', - include: [ 'vs/editor/common/services/editorSimpleWorker' ], - prepend: [ 'vs/loader.js' ], - append: [ 'vs/base/worker/workerMain' ], + include: ['vs/editor/common/services/editorSimpleWorker'], + prepend: ['vs/loader.js'], + append: ['vs/base/worker/workerMain'], dest: 'vs/base/worker/workerMain.js' } ]; @@ -88,7 +88,7 @@ gulp.task('clean-minified-editor', util.rimraf('out-editor-min')); gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor')); gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core')); -gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function() { +gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function () { return es.merge( // other assets es.merge( @@ -99,7 +99,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed // package.json gulp.src('build/monaco/package.json') - .pipe(es.through(function(data) { + .pipe(es.through(function (data) { var json = JSON.parse(data.contents.toString()); json.private = false; data.contents = new Buffer(JSON.stringify(json, null, ' ')); @@ -109,7 +109,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed // README.md gulp.src('build/monaco/README-npm.md') - .pipe(es.through(function(data) { + .pipe(es.through(function (data) { this.emit('data', new File({ path: data.path.replace(/README-npm\.md/, 'README.md'), base: data.base, @@ -126,10 +126,10 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed // min folder es.merge( gulp.src('out-editor-min/**/*') - ).pipe(filterStream(function(path) { + ).pipe(filterStream(function (path) { // no map files return !/(\.js\.map$)|(nls\.metadata\.json$)|(bundleInfo\.json$)/.test(path); - })).pipe(es.through(function(data) { + })).pipe(es.through(function (data) { // tweak the sourceMappingURL if (!/\.js$/.test(data.path)) { this.emit('data', data); @@ -149,43 +149,43 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed // min-maps folder es.merge( gulp.src('out-editor-min/**/*') - ).pipe(filterStream(function(path) { + ).pipe(filterStream(function (path) { // no map files return /\.js\.map$/.test(path); })).pipe(gulp.dest('out-monaco-editor-core/min-maps')) ); }); -gulp.task('analyze-editor-distro', function() { +gulp.task('analyze-editor-distro', function () { // @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file var bundleInfo = require('../out-editor/bundleInfo.json'); var graph = bundleInfo.graph; var bundles = bundleInfo.bundles; var inverseGraph = {}; - Object.keys(graph).forEach(function(module) { + Object.keys(graph).forEach(function (module) { var dependencies = graph[module]; - dependencies.forEach(function(dep) { + dependencies.forEach(function (dep) { inverseGraph[dep] = inverseGraph[dep] || []; inverseGraph[dep].push(module); }); }); var detailed = {}; - Object.keys(bundles).forEach(function(entryPoint) { + Object.keys(bundles).forEach(function (entryPoint) { var included = bundles[entryPoint]; var includedMap = {}; - included.forEach(function(included) { + included.forEach(function (included) { includedMap[included] = true; }); var explanation = []; - included.map(function(included) { + included.map(function (included) { if (included.indexOf('!') >= 0) { return; } - var reason = (inverseGraph[included]||[]).filter(function(mod) { + var reason = (inverseGraph[included] || []).filter(function (mod) { return !!includedMap[mod]; }); explanation.push({ @@ -201,7 +201,7 @@ gulp.task('analyze-editor-distro', function() { }); function filterStream(testFunc) { - return es.through(function(data) { + return es.through(function (data) { if (!testFunc(data.relative)) { return; } diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index c9c244c38d84ff9a89e2c504cd05f376423bd6db..ac1b08c6fd26ba8b88316d9f3acabb5f5bfa7f9a 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -31,7 +31,7 @@ const compilations = glob.sync('**/tsconfig.json', { const getBaseUrl = out => `https://ticino.blob.core.windows.net/sourcemaps/${commit}/${out}`; -const languages = i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages: []); +const languages = i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []); const tasks = compilations.map(function (tsconfigFile) { const absolutePath = path.join(extensionsPath, tsconfigFile); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index c324b78063ae75cc8abec3c8ce6feb3fa539cdb4..849a8a1018dc27152677211f4367accb006040eb 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -312,7 +312,7 @@ function packageTask(platform, arch, opts) { .pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node'])) .pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a'])) .pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node'])); - // .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar')); + // .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar')); let all = es.merge( packageJsonStream, @@ -408,7 +408,7 @@ const apiHostname = process.env.TRANSIFEX_API_URL; const apiName = process.env.TRANSIFEX_API_NAME; const apiToken = process.env.TRANSIFEX_API_TOKEN; -gulp.task('vscode-translations-push', [ 'optimize-vscode' ], function () { +gulp.task('vscode-translations-push', ['optimize-vscode'], function () { const pathToMetadata = './out-vscode/nls.metadata.json'; const pathToExtensions = './extensions/*'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; @@ -418,10 +418,10 @@ gulp.task('vscode-translations-push', [ 'optimize-vscode' ], function () { gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken) - ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); + ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); }); -gulp.task('vscode-translations-push-test', [ 'optimize-vscode' ], function () { +gulp.task('vscode-translations-push-test', ['optimize-vscode'], function () { const pathToMetadata = './out-vscode/nls.metadata.json'; const pathToExtensions = './extensions/*'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; @@ -431,7 +431,7 @@ gulp.task('vscode-translations-push-test', [ 'optimize-vscode' ], function () { gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken) - ).pipe(vfs.dest('../vscode-transifex-input')); + ).pipe(vfs.dest('../vscode-transifex-input')); }); gulp.task('vscode-translations-pull', function () { diff --git a/build/lib/watch/watch-nsfw.js b/build/lib/watch/watch-nsfw.js index 7c70c95b13f6c5432843f678f9ad975f8af91e01..306ab4810399b95cb0162793f54f893b740d1772 100644 --- a/build/lib/watch/watch-nsfw.js +++ b/build/lib/watch/watch-nsfw.js @@ -35,7 +35,7 @@ function watch(root) { result.emit('data', file); } - nsfw(root, function(events) { + nsfw(root, function (events) { for (var i = 0; i < events.length; i++) { var e = events[i]; var changeType = e.action; @@ -47,16 +47,16 @@ function watch(root) { handleEvent(path.join(e.directory, e.file), toChangeType(changeType)); } } - }).then(function(watcher) { + }).then(function (watcher) { watcher.start(); - }); + }); - return result; + return result; } var cache = Object.create(null); -module.exports = function(pattern, options) { +module.exports = function (pattern, options) { options = options || {}; var cwd = path.normalize(options.cwd || process.cwd()); @@ -66,7 +66,7 @@ module.exports = function(pattern, options) { watcher = cache[cwd] = watch(cwd); } - var rebase = !options.base ? es.through() : es.mapSync(function(f) { + var rebase = !options.base ? es.through() : es.mapSync(function (f) { f.base = options.base; return f; }); @@ -74,13 +74,13 @@ module.exports = function(pattern, options) { return watcher .pipe(filter(['**', '!.git{,/**}'])) // ignore all things git .pipe(filter(pattern)) - .pipe(es.map(function(file, cb) { - fs.stat(file.path, function(err, stat) { + .pipe(es.map(function (file, cb) { + fs.stat(file.path, function (err, stat) { if (err && err.code === 'ENOENT') { return cb(null, file); } if (err) { return cb(); } if (!stat.isFile()) { return cb(); } - fs.readFile(file.path, function(err, contents) { + fs.readFile(file.path, function (err, contents) { if (err && err.code === 'ENOENT') { return cb(null, file); } if (err) { return cb(); } diff --git a/build/lib/watch/watch-win32.js b/build/lib/watch/watch-win32.js index aae55adc6ec00d12e1444171a4cc435aeee15ed9..de9c76c90d614e0d0398f7cfab49cdfe2c269c08 100644 --- a/build/lib/watch/watch-win32.js +++ b/build/lib/watch/watch-win32.js @@ -24,7 +24,7 @@ function watch(root) { var result = es.through(); var child = cp.spawn(watcherPath, [root]); - child.stdout.on('data', function(data) { + child.stdout.on('data', function (data) { //@ts-ignore review var lines = data.toString('utf8').split('\n'); for (var i = 0; i < lines.length; i++) { @@ -53,11 +53,11 @@ function watch(root) { } }); - child.stderr.on('data', function(data) { + child.stderr.on('data', function (data) { result.emit('error', data); }); - child.on('exit', function(code) { + child.on('exit', function (code) { result.emit('error', 'Watcher died with code ' + code); child = null; }); @@ -71,7 +71,7 @@ function watch(root) { var cache = Object.create(null); -module.exports = function(pattern, options) { +module.exports = function (pattern, options) { options = options || {}; var cwd = path.normalize(options.cwd || process.cwd());