Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3227 from uswds/dw-test-codeclimate
Run prettier on project js [and test codeclimate]
- Loading branch information
Showing
38 changed files
with
833 additions
and
891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ jobs: | |
|
||
workflows: | ||
version: 2 | ||
build-and-publish-if-master: | ||
circle-uswds: | ||
jobs: | ||
- build | ||
- deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
module.exports = [ | ||
'> 2%', | ||
'Last 2 versions', | ||
'IE 11', | ||
]; | ||
module.exports = ["> 2%", "Last 2 versions", "IE 11"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,45 @@ | ||
const gulp = require('gulp'); | ||
const del = require('del'); | ||
const dutil = require('./doc-util'); | ||
const cFlags = require('./cflags'); | ||
const gulp = require("gulp"); | ||
const del = require("del"); | ||
const dutil = require("./doc-util"); | ||
const cFlags = require("./cflags"); | ||
|
||
gulp.task('clean-dist', (done) => { | ||
gulp.task("clean-dist", done => { | ||
if (!cFlags.cleanup) { | ||
dutil.logMessage( | ||
'clean-dist', | ||
'Skipping cleaning up the distribution directories.', | ||
"clean-dist", | ||
"Skipping cleaning up the distribution directories." | ||
); | ||
return done(); | ||
} | ||
dutil.logMessage('clean-dist', 'Removing distribution directories.'); | ||
dutil.logMessage("clean-dist", "Removing distribution directories."); | ||
|
||
return del('dist'); | ||
return del("dist"); | ||
}); | ||
|
||
gulp.task("docs", done => { | ||
dutil.logMessage("docs", "Copying documentation dist dir"); | ||
|
||
gulp.task('docs', (done) => { | ||
dutil.logMessage('docs', 'Copying documentation dist dir'); | ||
|
||
const stream = gulp.src([ | ||
'README.md', | ||
'LICENSE.md', | ||
'CONTRIBUTING.md', | ||
]) | ||
.pipe(gulp.dest('dist')); | ||
const stream = gulp | ||
.src(["README.md", "LICENSE.md", "CONTRIBUTING.md"]) | ||
.pipe(gulp.dest("dist")); | ||
|
||
done(); | ||
return stream; | ||
}); | ||
|
||
|
||
gulp.task('build', | ||
gulp.task( | ||
"build", | ||
gulp.series( | ||
(done) => { | ||
done => { | ||
dutil.logIntroduction(); | ||
dutil.logMessage( | ||
'build', | ||
'Creating distribution directories.', | ||
); | ||
dutil.logMessage("build", "Creating distribution directories."); | ||
done(); | ||
}, | ||
'clean-dist', | ||
'docs', | ||
gulp.parallel( | ||
'sass', | ||
'javascript', | ||
'images', | ||
'fonts', | ||
), | ||
"clean-dist", | ||
"docs", | ||
gulp.parallel("sass", "javascript", "images", "fonts"), | ||
// We need to copy the Sass to dist *after* the sass task, to ensure | ||
// that vendor libraries have been copied to the Sass directory first. | ||
'copy-dist-sass', | ||
)); | ||
"copy-dist-sass" | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
test: true, | ||
cleanup: true, | ||
cleanup: true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,64 @@ | ||
const log = require('fancy-log'); | ||
const colors = require('ansi-colors'); | ||
const notifier = require('node-notifier'); | ||
const pkg = require('../../package.json'); | ||
const log = require("fancy-log"); | ||
const colors = require("ansi-colors"); | ||
const notifier = require("node-notifier"); | ||
const pkg = require("../../package.json"); | ||
|
||
const shellPrefix = '$'; | ||
const shellPrefix = "$"; | ||
|
||
function drawFlag() { | ||
log( | ||
colors.white(''), | ||
); | ||
log( | ||
colors.white('* * * * * ========================'), | ||
); | ||
log( | ||
colors.white('* * * * * ========================'), | ||
); | ||
log( | ||
colors.white('* * * * * ========================'), | ||
); | ||
log( | ||
colors.white('* * * * * ========================'), | ||
); | ||
log( | ||
colors.white('=================================='), | ||
); | ||
log( | ||
colors.white('=================================='), | ||
); | ||
log( | ||
colors.white('=================================='), | ||
); | ||
log( | ||
colors.white(''), | ||
); | ||
log(colors.white("")); | ||
log(colors.white("* * * * * ========================")); | ||
log(colors.white("* * * * * ========================")); | ||
log(colors.white("* * * * * ========================")); | ||
log(colors.white("* * * * * ========================")); | ||
log(colors.white("==================================")); | ||
log(colors.white("==================================")); | ||
log(colors.white("==================================")); | ||
log(colors.white("")); | ||
} | ||
|
||
function notify(title, message, wait) { | ||
notifier.notify({ | ||
title, | ||
message, | ||
icon: 'src/img/favicons/favicon-192.png', | ||
wait, | ||
icon: "src/img/favicons/favicon-192.png", | ||
wait | ||
}); | ||
} | ||
|
||
module.exports = { | ||
pkg: { | ||
name: pkg.name, | ||
version: pkg.version, | ||
version: pkg.version | ||
}, | ||
|
||
dirName: `${pkg.name}-${pkg.version}`, | ||
|
||
logIntroduction(message) { | ||
const introMessage = message || 'USWDS'; | ||
log( | ||
colors.yellow(`${introMessage} v${pkg.version}`), | ||
); | ||
const introMessage = message || "USWDS"; | ||
log(colors.yellow(`${introMessage} v${pkg.version}`)); | ||
drawFlag(); | ||
}, | ||
|
||
logCommand(name, message) { | ||
log( | ||
shellPrefix, | ||
colors.cyan(name), | ||
colors.magenta(message), | ||
); | ||
log(shellPrefix, colors.cyan(name), colors.magenta(message)); | ||
}, | ||
|
||
|
||
logHelp(name, message) { | ||
log( | ||
shellPrefix, | ||
colors.cyan(name), | ||
colors.yellow(message), | ||
); | ||
log(shellPrefix, colors.cyan(name), colors.yellow(message)); | ||
}, | ||
|
||
logData(name, message) { | ||
log( | ||
colors.cyan(name), | ||
colors.yellow(message), | ||
); | ||
log(colors.cyan(name), colors.yellow(message)); | ||
}, | ||
|
||
logError(name, message) { | ||
log( | ||
colors.red(name), | ||
colors.yellow(message), | ||
); | ||
log(colors.red(name), colors.yellow(message)); | ||
notify(`${this.dirName} gulp ${name}`, message, true); | ||
}, | ||
|
||
logMessage(name, message) { | ||
log( | ||
colors.cyan(name), | ||
colors.green(message), | ||
); | ||
log(colors.cyan(name), colors.green(message)); | ||
notify(`${this.dirName} gulp ${name}`, message, false); | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.