Skip to content

Commit

Permalink
Update gulpfile.js
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Feb 10, 2018
1 parent 181455c commit 0ea5ae2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/
50 changes: 25 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -131,7 +131,7 @@ const buildDist = function(filename, opts, isProduction) {
screw_ie8: true,
warnings: false,
},
}),
})
);
}
return webpackStream(webpackOpts, null, function(err, stats) {
Expand Down Expand Up @@ -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')))
)
);
});

Expand All @@ -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'))),
]),
),
])
)
);
});

Expand All @@ -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]}');`
)
)
);
});

Expand All @@ -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')))
)
)
)
);
});

Expand All @@ -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)))
)
)
)
);
});

Expand All @@ -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)))
)
)
)
);
});

Expand Down
2 changes: 1 addition & 1 deletion scripts/getBabelOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function(options) {
moduleMap: {},
plugins: [],
},
options,
options
);

const fbjsPreset = require('babel-preset-fbjs/configure')({
Expand Down
2 changes: 1 addition & 1 deletion scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]),
Expand Down
14 changes: 7 additions & 7 deletions scripts/testDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function testDependencies(topLevelPackagePath, packagePaths) {
return packagePaths.reduce(
(errors, packagePath) =>
errors.concat(testPackageDependencies(topLevelPackagePath, packagePath)),
[],
[]
);
}

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);
Expand All @@ -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']);
Expand All @@ -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.'
);
}

Expand Down

0 comments on commit 0ea5ae2

Please sign in to comment.