From 286433a489dfb82b1c05d5f954b3ab1a8cc52720 Mon Sep 17 00:00:00 2001 From: decaffeinate Date: Thu, 25 Jul 2019 17:27:44 +0630 Subject: [PATCH] decaffeinate: Run post-processing cleanups on gulpfile.coffee --- packages/extension/gulpfile.js | 146 ++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 68 deletions(-) diff --git a/packages/extension/gulpfile.js b/packages/extension/gulpfile.js index 7920241ca69f..cd544e64b699 100644 --- a/packages/extension/gulpfile.js +++ b/packages/extension/gulpfile.js @@ -1,90 +1,100 @@ +/* eslint-disable + @cypress/dev/no-return-before, + no-unused-vars, +*/ +// TODO: This file was created by bulk-decaffeinate. +// Fix any style issues and re-enable lint. /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const fs = require("fs-extra"); -const pkg = require("./package.json"); -const gulp = require("gulp"); -const clean = require("gulp-clean"); -const rename = require("gulp-rename"); -const runSeq = require("run-sequence"); -const source = require("vinyl-source-stream"); -const Promise = require("bluebird"); -const coffeeify = require("coffeeify"); -const browserify = require("browserify"); -const icons = require("@cypress/icons"); +const fs = require('fs-extra') +const pkg = require('./package.json') +const gulp = require('gulp') +const clean = require('gulp-clean') +const rename = require('gulp-rename') +const runSeq = require('run-sequence') +const source = require('vinyl-source-stream') +const Promise = require('bluebird') +const coffeeify = require('coffeeify') +const browserify = require('browserify') +const icons = require('@cypress/icons') -gulp.task("clean", () => - gulp.src("dist") +gulp.task('clean', () => { + return gulp.src('dist') .pipe(clean()) -); +}) -gulp.task("manifest", function(done) { - gulp.src("app/manifest.json") - .pipe(gulp.dest("dist")) - .on("end", () => - fs.readJson("dist/manifest.json", function(err, json) { - json.version = pkg.version; - return fs.writeJson("dist/manifest.json", json, {spaces: 2}, done); +gulp.task('manifest', (done) => { + gulp.src('app/manifest.json') + .pipe(gulp.dest('dist')) + .on('end', () => { + return fs.readJson('dist/manifest.json', (err, json) => { + json.version = pkg.version + + return fs.writeJson('dist/manifest.json', json, { spaces: 2 }, done) }) - ); - return null; -}); + }) + + return null +}) -gulp.task("backup", () => - gulp.src("dist/background.js") - .pipe(rename("background_src.js")) - .pipe(gulp.dest("dist")) -); +gulp.task('backup', () => { + return gulp.src('dist/background.js') + .pipe(rename('background_src.js')) + .pipe(gulp.dest('dist')) +}) -gulp.task("background", () => - browserify({ - entries: "app/background.coffee", - transform: coffeeify +gulp.task('background', () => { + return browserify({ + entries: 'app/background.coffee', + transform: coffeeify, }) .bundle() - .pipe(source("background.js")) - .pipe(gulp.dest("dist")) -); + .pipe(source('background.js')) + .pipe(gulp.dest('dist')) +}) -gulp.task("html", () => - gulp.src("app/**/*.html") - .pipe(gulp.dest("dist")) -); +gulp.task('html', () => { + return gulp.src('app/**/*.html') + .pipe(gulp.dest('dist')) +}) -gulp.task("css", () => - gulp.src("app/**/*.css") - .pipe(gulp.dest("dist")) -); +gulp.task('css', () => { + return gulp.src('app/**/*.css') + .pipe(gulp.dest('dist')) +}) -gulp.task("icons", () => - gulp.src([ - icons.getPathToIcon("icon_16x16.png"), - icons.getPathToIcon("icon_19x19.png"), - icons.getPathToIcon("icon_38x38.png"), - icons.getPathToIcon("icon_48x48.png"), - icons.getPathToIcon("icon_128x128.png") +gulp.task('icons', () => { + return gulp.src([ + icons.getPathToIcon('icon_16x16.png'), + icons.getPathToIcon('icon_19x19.png'), + icons.getPathToIcon('icon_38x38.png'), + icons.getPathToIcon('icon_48x48.png'), + icons.getPathToIcon('icon_128x128.png'), ]) - .pipe(gulp.dest("dist/icons")) -); + .pipe(gulp.dest('dist/icons')) +}) -gulp.task("logos", () => - gulp.src([ - icons.getPathToLogo("cypress-bw.png") +gulp.task('logos', () => { + return gulp.src([ + icons.getPathToLogo('cypress-bw.png'), ]) - .pipe(gulp.dest("dist/logos")) -); + .pipe(gulp.dest('dist/logos')) +}) -gulp.task("watch", ["build"], () => gulp.watch("app/**/*", ["build"])); +gulp.task('watch', ['build'], () => { + return gulp.watch('app/**/*', ['build']) +}) -gulp.task("build", () => - runSeq("clean", [ - "icons", - "logos", - "manifest", - "background", - "html", - "css" +gulp.task('build', () => { + return runSeq('clean', [ + 'icons', + 'logos', + 'manifest', + 'background', + 'html', + 'css', ]) -); +})