Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.0 overhaul #1

Merged
merged 88 commits into from
Feb 9, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
d916285
start of filtering tests
Jan 26, 2015
cd135e8
reorganize files
adamgruber Jan 27, 2015
84ba0e3
update paths
adamgruber Jan 27, 2015
dd5c258
Remove functions to be handled by gulp build
adamgruber Jan 27, 2015
629664b
Create gulp tasks for linting and building
adamgruber Jan 27, 2015
5264176
update packages
adamgruber Jan 27, 2015
4e8a5fc
move jquery into packaged script
adamgruber Jan 27, 2015
b159b7f
update template to work with updated bootstrap collapse
adamgruber Jan 27, 2015
6c2c97d
filter using classes instead of jquery hide/show
adamgruber Jan 27, 2015
56c6838
add built files
adamgruber Jan 27, 2015
62f6e29
minify javascript; add templates file
Jan 28, 2015
8fb4933
move tasks to functions that can be called inside tasks
Jan 28, 2015
0e58227
update readme
Jan 28, 2015
214b304
Merge branch 'feature/filtering' into develop
Jan 28, 2015
dff36db
back to gulp.start()
Jan 28, 2015
b0adc64
fix watch detection
Jan 28, 2015
d7e5b6a
hide filtered suites
Jan 28, 2015
e90e45b
simplify nesting of styles
Jan 29, 2015
c2127a7
update styles
Jan 29, 2015
2d4a63b
logic to record skipped tests
Jan 29, 2015
e092675
show skipped in template
Jan 29, 2015
61fd89c
show chart when skipped tests exist
Jan 29, 2015
4973dda
updated test cases
Jan 29, 2015
baa5614
Merge branch 'develop' into feature/filter-enhance
Jan 29, 2015
46620fd
hide suites with no active filters
Jan 29, 2015
2b46d23
spacing tweaks; update footer
Jan 29, 2015
2604a66
Merge branch 'feature/filter-enhance' into develop
Jan 29, 2015
5c58395
Merge pull request #7 from grubera/develop
Jan 29, 2015
1055f53
post-release version bump
Jan 29, 2015
c61081a
require local version of handlebars
Jan 30, 2015
661c1ce
recompile templates
Jan 30, 2015
d0f4649
fix style
Jan 30, 2015
2299dba
version bump
Jan 30, 2015
c6e14f8
fix test sources
Jan 30, 2015
8ae6e1d
move moment into dependencies
Jan 30, 2015
bc91d34
updated readme
Jan 30, 2015
7332697
fix dependency issue
Jan 30, 2015
6e7b600
update package.json
Feb 2, 2015
323a5fb
hide parent suites when child suites are hidden by filters
Feb 3, 2015
e6afb1a
keep chart data at min width
Feb 3, 2015
c60e02e
update fiveby tests to use promises
Feb 3, 2015
14f42ee
update paths for fiveby tests
Feb 3, 2015
bcfead3
update fiveby config
Feb 3, 2015
481dc68
smarter filtering
Feb 3, 2015
5e93d87
update build files
Feb 3, 2015
7ab5413
turn off chart animation when there is a large number of charts
Feb 4, 2015
4b362ba
create Mochawesome object
Feb 4, 2015
de07440
update templates; use data attribute for filter
Feb 4, 2015
f670ff4
add quick summary to main page
Feb 4, 2015
814ffcf
quick summary styles and other tweaks
Feb 5, 2015
ed784e3
add title attribute in quick summary
Feb 5, 2015
3257f38
tests - icons via css not markup
Feb 5, 2015
884c26b
css icons instead of markup
Feb 5, 2015
5080662
filter click and window scroll
Feb 5, 2015
56bb7a7
update styles
Feb 5, 2015
357cfd0
build files
Feb 5, 2015
fa01051
better quick summary styles
Feb 5, 2015
9c2e28f
more style tweaks
Feb 5, 2015
8f4660a
split vendor and client scripts
Feb 5, 2015
7c5c236
update lodash
Feb 5, 2015
7e0cc13
only include parts of bootstrap needed
Feb 5, 2015
d2b2da9
update build files
Feb 5, 2015
3d58f29
Merge branch 'feature/quick-summary' into develop
Feb 6, 2015
f3c7df2
add font-awesome
Feb 6, 2015
e37ad49
style updates for mobile first
Feb 6, 2015
88312f9
updates for mobile
Feb 6, 2015
2be8a1e
add font-awesome fonts source
Feb 7, 2015
1ebbc91
custom font-icons
adamgruber Feb 8, 2015
25c64ba
mobile styles and tweaks
adamgruber Feb 8, 2015
bf3566f
remove media-queries.less
adamgruber Feb 8, 2015
acddaac
more mobile styles
adamgruber Feb 8, 2015
ae33630
mixin for applying font icon
adamgruber Feb 8, 2015
b6567ec
rework suite layout
adamgruber Feb 9, 2015
9b080a5
change colors of quick summary
adamgruber Feb 9, 2015
2755603
update icons/colors
adamgruber Feb 9, 2015
58fb5bb
footer updates
adamgruber Feb 9, 2015
cb2bfa9
localize google fonts
adamgruber Feb 9, 2015
46dd04d
throttle and debounce window events
adamgruber Feb 9, 2015
669890a
larger footer text
adamgruber Feb 9, 2015
a35a5cf
remove font-awesome; add lodash client side
adamgruber Feb 9, 2015
92f0579
update paths; mocha opts; fix watch error
adamgruber Feb 9, 2015
a28a216
clean and update build files
adamgruber Feb 9, 2015
4bcb15e
duration formatting tweaks
adamgruber Feb 9, 2015
dab110c
Merge branch 'feature/design-updates' into develop
adamgruber Feb 9, 2015
43b7a8f
updated docs; package.json
adamgruber Feb 9, 2015
b017417
adding travisci
adamgruber Feb 9, 2015
0ca7d38
fixing node dep
adamgruber Feb 9, 2015
212f513
format package.json
adamgruber Feb 9, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create gulp tasks for linting and building
  • Loading branch information
adamgruber committed Jan 27, 2015
commit 629664b05929bc25a255e7729bd56320c5e24802
92 changes: 92 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"maxerr" : 100, // {int} Maximum error before stopping

// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : 2, // {int} Number of spaces to use for indentation
"latedef" : false, // true: Require variables/functions to be defined before being used
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : false, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : false, // true: Require all defined variables be used
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line

// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : true, // true: Tolerate use of `eval` and `new Function()`
"expr" : true, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : false, // true: Tolerate defining variables inside control statements"
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
"laxcomma" : false, // true: Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"multistr" : false, // true: Tolerate multi-line strings
"proto" : false, // true: Tolerate using the `__proto__` property
"scripturl" : false, // true: Tolerate script-targeted URLs
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // true: Tolerate using this in a non-constructor function

// Environments
"browser" : false, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : false, // jQuery
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface

// Custom Globals
"globals": {
"after": true,
"afterEach": true,
"before": true,
"beforeEach": true,
"describe": true,
"expect": true,
"it": true,
"runs": true,
"spyOn": true,
"unescape": true,
"waits": true,
"waitsFor": true,
"require": true,
"define": true,
"module": true,
"describe": true
}
}
91 changes: 91 additions & 0 deletions client.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"maxerr" : 100, // {int} Maximum error before stopping

// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : 2, // {int} Number of spaces to use for indentation
"latedef" : false, // true: Require variables/functions to be defined before being used
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line

// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : true, // true: Tolerate use of `eval` and `new Function()`
"expr" : true, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : false, // true: Tolerate defining variables inside control statements"
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
"laxcomma" : false, // true: Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"multistr" : false, // true: Tolerate multi-line strings
"proto" : false, // true: Tolerate using the `__proto__` property
"scripturl" : false, // true: Tolerate script-targeted URLs
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // true: Tolerate using this in a non-constructor function

// Environments
"browser" : true, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : true, // jQuery
"mootools" : false, // MooTools
"node" : false, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface

// Custom Globals
"globals": {
"after": true,
"afterEach": true,
"before": true,
"beforeEach": true,
"describe": true,
"define": true,
"expect": true,
"it": true,
"runs": true,
"spyOn": true,
"unescape": true,
"waits": true,
"waitsFor": true,
"require": true,
"DJ": true
}
}
141 changes: 135 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,148 @@
//TODO: feeding in configs, logins, selenium servers, browsers.. tests should do this so they can run in isolation but that's a lot more maintenance...
var gulp = require('gulp');
var mocha = require('gulp-spawn-mocha');
var options = {reporter: 'mochawesome', timeout: 30000, slow: 1, "no-exit": true};
var gulp = require('gulp'),
gutil = require('gulp-util'),
path = require('path'),
plumber = require('gulp-plumber'),
less = require('gulp-less'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
merge = require('merge-stream'),
handlebars = require('gulp-handlebars'),
wrap = require('gulp-wrap'),
declare = require('gulp-declare'),
watch = require('gulp-watch'),
mocha = require('gulp-spawn-mocha'),
options = {reporter: 'mochawesome', timeout: 30000, slow: 1, "no-exit": true},
config = require('./lib/config');

var watchFiles = [
path.join(config.srcLessDir, '*.less'),
path.join(config.srcJsDir, '*.js'),
path.join('!', config.srcJsDir, 'hbsHelpers.js'),
path.join(config.srcHbsDir, '*.mu')
];

var lintPaths = {
server: './.jshintrc',
client: './client.jshintrc',
lint: [
'./lib/*.js',
'!./lib/templates.js'
],
felint: [
path.join(config.srcJsDir, '*.js')
]
};

function onWatchFileChanged(file) {
var ext = file.relative.slice(file.relative.indexOf('.') + 1);
gutil.log('Change detected in ' + file.relative);
if (ext === 'less') {
gulp.start('styles');
}
if (ext === 'js') {
gulp.start('scripts');
}
if (ext === 'mu') {
gulp.start('templates');
}
}

// Build Tasks
gulp.task('fonts', function () {
return gulp.src(path.join(config.bsFontsDir, '*'))
.pipe(gulp.dest(config.buildFontsDir));
});

gulp.task('styles', function () {
return gulp.src(path.join(config.srcLessDir, '[^_]*.less'))
.pipe(plumber({errorHandler: gutil.log}))
.pipe(less({
paths: [config.srcLessDir, config.bsLessDir],
compress: true
}))
.pipe(gulp.dest(config.buildCssDir));
});

gulp.task('scripts', function () {
return gulp.src(config.clientJsFiles)
.pipe(concat('mochawesome.js'))
.pipe(uglify())
.pipe(gulp.dest(config.buildJsDir));
});

gulp.task('templates', function () {
var partials = gulp.src(path.join(config.srcHbsDir, '_*.mu'))
.pipe(handlebars())
.pipe(wrap('Handlebars.registerPartial(<%= processPartialName(file.relative) %>, Handlebars.template(<%= contents %>));', {}, {
imports: {
processPartialName: function(fileName) {
// Strip the extension
// Escape the output with JSON.stringify
return JSON.stringify(path.basename(fileName, '.js'));
}
}
}));

var templates = gulp.src(path.join(config.srcHbsDir, '[^_]*.mu'))
.pipe(handlebars())
.pipe(wrap('Handlebars.template(<%= contents %>)'))
.pipe(declare({
root: 'exports',
noRedeclare: true, // Avoid duplicate declarations
processName: function(filePath) {
return declare.processNameByPath(filePath.replace('src/templates/', ''));
}
}));

var helpers = gulp.src(path.join(config.srcJsDir, 'hbsHelpers.js'));

return merge(partials, templates, helpers)
.pipe(concat('templates.js'))
.pipe(wrap('var Handlebars = require("handlebars");\n <%= contents %>'))
.pipe(gulp.dest(config.libDir));
});

// Test Tasks
gulp.task('fiveby', function () {
return gulp.src('test/**/*.js', '!test/test.js')
.pipe(mocha(options))
.on("error", console.warn.bind(console));
.on('error', console.warn.bind(console));
});

gulp.task('test', function () {
return gulp.src('test/test.js')
.pipe(mocha(options))
.on("error", console.warn.bind(console));
.on('error', console.warn.bind(console));
});

// Linting
gulp.task('svrlint', function () {
return gulp.src(lintPaths.lint)
.pipe(jshint(lintPaths.server))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});

gulp.task('felint', function () {
return gulp.src(lintPaths.felint)
.pipe(jshint(lintPaths.client))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});

// Watch Tasks
gulp.task('watch', function () {
watch(watchFiles, onWatchFileChanged);
});

// Default/Combo Tasks
gulp.task('build', ['lint'], function () {
return gulp.start('assemble');
});

gulp.task('lint', ['svrlint', 'felint']);

gulp.task('assemble', ['fonts', 'styles', 'scripts', 'templates']);

gulp.task('default', ['test']);
20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,25 @@
"mocha": "",
"moment": "^2.7.0",
"ncp": "^1.0.1",
"node-uuid": "^1.4.1",
"uglify-js": "^2.4.15"
"node-uuid": "^1.4.1"
},
"devDependencies": {
"fiveby": "git+https://github.dowjones.net/institutional/fiveby.git",
"gulp": "^3.8.1",
"gulp-spawn-mocha": "^0.1.5",
"gulp-concat": "^2.4.3",
"gulp-declare": "^0.3.0",
"gulp-handlebars": "^3.0.1",
"gulp-jshint": "^1.9.0",
"gulp-less": "^2.0.1",
"gulp-plumber": "^0.6.6",
"gulp-spawn-mocha": "^0.5.2",
"gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.2",
"gulp-watch": "^4.1.0",
"gulp-wrap": "^0.10.1",
"istanbul": "^0.3.5",
"jshint-stylish": "^1.0.0",
"merge-stream": "^0.1.7",
"should": "^3.3.2"
},
"scripts": {
Expand All @@ -36,4 +48,4 @@
"handlebars"
],
"license": "ISC"
}
}