From 0ea5ae272664cf4482f097c59bdef93534b7d94b Mon Sep 17 00:00:00 2001 From: Orta Date: Fri, 9 Feb 2018 10:17:04 -0500 Subject: [PATCH] Update gulpfile.js --- .prettierignore | 1 + gulpfile.js | 50 ++++++++++++++++++------------------ scripts/getBabelOptions.js | 2 +- scripts/jest/preprocessor.js | 2 +- scripts/testDependencies.js | 14 +++++----- 5 files changed, 35 insertions(+), 34 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000000..5093a29b859a5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +scripts/ diff --git a/gulpfile.js b/gulpfile.js index 855980658440d..8143f6669112a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -116,7 +116,7 @@ const buildDist = function(filename, opts, isProduction) { plugins: [ new webpackStream.webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify( - isProduction ? 'production' : 'development', + isProduction ? 'production' : 'development' ), }), new webpackStream.webpack.optimize.OccurenceOrderPlugin(), @@ -131,7 +131,7 @@ const buildDist = function(filename, opts, isProduction) { screw_ie8: true, warnings: false, }, - }), + }) ); } return webpackStream(webpackOpts, null, function(err, stats) { @@ -265,8 +265,8 @@ gulp.task('modules', function() { ]) .pipe(babel(babelOptions)) .pipe(flatten()) - .pipe(gulp.dest(path.join(DIST, build.package, 'lib'))), - ), + .pipe(gulp.dest(path.join(DIST, build.package, 'lib'))) + ) ); }); @@ -287,8 +287,8 @@ gulp.task('copy-files', function() { .src(['*' + PACKAGES + '/' + build.package + '/*.graphql']) .pipe(flatten()) .pipe(gulp.dest(path.join(DIST, build.package, 'lib'))), - ]), - ), + ]) + ) ); }); @@ -298,9 +298,9 @@ gulp.task('exports', ['copy-files', 'modules'], function() { fs.writeFileSync( path.join(DIST, build.package, exportName + '.js'), PRODUCTION_HEADER + - `\nmodule.exports = require('./lib/${build.exports[exportName]}');`, - ), - ), + `\nmodule.exports = require('./lib/${build.exports[exportName]}');` + ) + ) ); }); @@ -315,10 +315,10 @@ gulp.task('bins', ['modules'], function() { .pipe(buildDist(bin.output, bin, /* isProduction */ false)) .pipe(header(SCRIPT_HASHBANG + PRODUCTION_HEADER)) .pipe(chmod(0o755)) - .pipe(gulp.dest(path.join(DIST, build.package, 'bin'))), - ), - ), - ), + .pipe(gulp.dest(path.join(DIST, build.package, 'bin'))) + ) + ) + ) ); }); @@ -333,15 +333,15 @@ gulp.task('bundles', ['modules'], function() { buildDist( bundle.output + '.js', bundle, - /* isProduction */ false, - ), + /* isProduction */ false + ) ) .pipe(derequire()) .pipe(header(DEVELOPMENT_HEADER)) - .pipe(gulp.dest(path.join(DIST, build.package))), - ), - ), - ), + .pipe(gulp.dest(path.join(DIST, build.package))) + ) + ) + ) ); }); @@ -356,14 +356,14 @@ gulp.task('bundles:min', ['modules'], function() { buildDist( bundle.output + '.min.js', bundle, - /* isProduction */ true, - ), + /* isProduction */ true + ) ) .pipe(header(PRODUCTION_HEADER)) - .pipe(gulp.dest(path.join(DIST, build.package))), - ), - ), - ), + .pipe(gulp.dest(path.join(DIST, build.package))) + ) + ) + ) ); }); diff --git a/scripts/getBabelOptions.js b/scripts/getBabelOptions.js index bb87def80383b..f2cf93b905a0f 100644 --- a/scripts/getBabelOptions.js +++ b/scripts/getBabelOptions.js @@ -17,7 +17,7 @@ module.exports = function(options) { moduleMap: {}, plugins: [], }, - options, + options ); const fbjsPreset = require('babel-preset-fbjs/configure')({ diff --git a/scripts/jest/preprocessor.js b/scripts/jest/preprocessor.js index bbbc539425922..57b7478ae7e79 100644 --- a/scripts/jest/preprocessor.js +++ b/scripts/jest/preprocessor.js @@ -63,7 +63,7 @@ module.exports = { testSchemaPath, path.join( path.dirname(require.resolve('babel-preset-fbjs')), - 'package.json', + 'package.json' ), path.join(__dirname, '..', 'getBabelOptions.js'), ]), diff --git a/scripts/testDependencies.js b/scripts/testDependencies.js index 4c3b68cba10dc..f14e0f0d6ca2b 100644 --- a/scripts/testDependencies.js +++ b/scripts/testDependencies.js @@ -37,7 +37,7 @@ function testDependencies(topLevelPackagePath, packagePaths) { return packagePaths.reduce( (errors, packagePath) => errors.concat(testPackageDependencies(topLevelPackagePath, packagePath)), - [], + [] ); } @@ -45,7 +45,7 @@ function testPackageDependencies(topLevelPackagePath, packagePath) { const errors = []; const topLevelPackageJson = require(path.join( topLevelPackagePath, - 'package.json', + 'package.json' )); const packageJson = require(path.join(packagePath, 'package.json')); const packageName = path.basename(packagePath); @@ -54,28 +54,28 @@ function testPackageDependencies(topLevelPackagePath, packagePath) { errors, packageJson.name, packageName, - `${packageName} should have a matching package name.`, + `${packageName} should have a matching package name.` ); expectEqual( errors, packageJson.optionalDependencies, undefined, - `${packageName} should have no optional dependencies.`, + `${packageName} should have no optional dependencies.` ); expectEqual( errors, packageJson.bundledDependencies, undefined, - `${packageName} should have no bundled dependencies.`, + `${packageName} should have no bundled dependencies.` ); expectEqual( errors, packageJson.devDependencies, undefined, - `${packageName} should have no dev dependencies.`, + `${packageName} should have no dev dependencies.` ); const requiredRepoPackages = new Set(['relay-runtime', 'relay-compiler']); @@ -93,7 +93,7 @@ function testPackageDependencies(topLevelPackagePath, packagePath) { getDependency(topLevelPackageJson, dependencyName), getDependency(packageJson, dependencyName), `${packageName} should have same ${dependencyName} version ` + - 'as the top level package.json.', + 'as the top level package.json.' ); }