Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aniaw committed Apr 26, 2015
0 parents commit 233d699
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
*.iml
node_modules
app/bower_components
37 changes: 37 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"forin": true,
"freeze": true,
"immed": true,
"indent": 4,
"jquery": true,
"latedef": true,
"maxcomplexity": 10,
"maxdepth": 2,
"maxlen": 160,
"maxparams": 20,
"maxstatements": 0,
"newcap": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
"devel": true,
"globals": {
"beforeEach": true,
"describe": true,
"expect": true,
"it": true
}
}
70 changes: 70 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*jshint camelcase:false*/

'use strict';

module.exports = function (grunt)
{

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');

var config = {
app: 'app'
};

grunt.initConfig({
config: config,
jshint: {
options: {
jshintrc: true
},
all: ['app/**/*.js', 'test/**/*.js']
},
watch: {
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= config.app %>/**/*.html', '<%= config.app %>/**/*.js'
]
}
},
connect: {
options: {
port: 9000, livereload: 35729, hostname: 'localhost'
},
livereload: {
options: {
open: true, middleware: function (connect)
{
return [
connect().use('/bower_components', connect.static('./bower_components')), connect.static(config.app)

];
}
}
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js',
singleRun: true
},
dev: {
configFile: 'test/karma.conf.js',
singleRun: false
}
}
});

grunt.registerTask('serve', function ()
{
grunt.task.run([
'connect:livereload', 'watch'
]);
});

grunt.registerTask('default', ['serve']);
};
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
##JavaScript Workshop
16 changes: 16 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>JavaScript Workshop</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body class="container">
<div class="page-header">
<h1>JavaScript
<small>Workshop</small>
</h1>
</div>

</body>
</html>
10 changes: 10 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "js-workshop",
"version": "0.0.0",
"dependencies": {
"bootstrap": "~3.1.1"
},
"devDependencies": {
},
"appPath": "app"
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "js-workshop",
"description": "JavaScript Workshop",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-contrib-connect": "^0.7.1",
"karma-phantomjs-launcher": "~0.1.4",
"karma": "~0.12.16",
"karma-coverage": "~0.2.4",
"karma-jasmine": "~0.1.5",
"karma-spec-reporter": "0.0.13"
},
"engines": {
"node": ">=0.10.0"
},
"repository": {
"type": "git",
"url": "https://github.com/aniaw/js-workshop"
},
"scripts": {
"start": "grunt karma:dev",
"test": "grunt karma:unit"
}
}
77 changes: 77 additions & 0 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*global module*/
module.exports = function (config) {
'use strict';

config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// base path, that will be used to resolve files and exclude
basePath: '../',

// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],

// list of files / patterns to load in the browser
files: [
'app/**/*.js',
'test/spec/**/*.js'
],

// list of files / patterns to exclude
exclude: [],

// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['spec', 'coverage'],

preprocessors: {
'app/**/*.js': 'coverage'
},

coverageReporter: {
dir: 'target/coverage/',
type: 'html'
},

// web server port
port: 8080,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: [
'PhantomJS'
],

// Which plugins to enable
plugins: [
'karma-phantomjs-launcher', 'karma-coverage', 'karma-jasmine', 'karma-spec-reporter'
],

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,

colors: true,

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,

//https://github.com/karma-runner/karma/issues/895
usePolling: true

// Uncomment the following lines if you are using grunt's server to run the tests
// proxies: {
// '/': 'http://localhost:9000/'
// },
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});
};

0 comments on commit 233d699

Please sign in to comment.