This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b283281
commit b4b6656
Showing
4 changed files
with
144 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/*global module:false*/ | ||
module.exports = function(grunt) { | ||
"use strict"; | ||
var config = { | ||
banner : [ | ||
'/**\n', | ||
' * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n', | ||
' * <%= pkg.description %>\n', | ||
' *\n', | ||
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n', | ||
' * Licensed <%= pkg.license %>\n', | ||
' */\n' | ||
].join(''), | ||
|
||
sources : [ | ||
'src/intro.js', | ||
|
||
// add'l packages | ||
|
||
'src/outro.js' | ||
], | ||
pkg : grunt.file.readJSON('package.json'), | ||
uglifyFiles : {} | ||
}; | ||
|
||
// setup dynamic filenames | ||
config.versioned = [config.pkg.name, config.pkg.version].join('-'); | ||
config.dist = ['dist/', '.js'].join(config.versioned); | ||
config.uglifyFiles[['dist/', '.min.js'].join(config.versioned)] = config.dist; | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
pkg : config.pkg, | ||
lint : { | ||
files : ['gruntfile.js', 'test/*.js', 'src/*'] | ||
}, | ||
clean : { | ||
dist : ['dist/'] | ||
}, | ||
concat : { | ||
options : { | ||
stripBanners : true, | ||
banner : config.banner | ||
}, | ||
dist : { | ||
src : config.sources, | ||
dest : config.dist | ||
} | ||
}, | ||
uglify : { | ||
options : { mangle : true }, | ||
dist : { | ||
files : config.uglifyFiles | ||
} | ||
}, | ||
jasmine : { | ||
tests : { | ||
src : ['dist/', '.min.js'].join(config.versioned), | ||
options : { | ||
specs : 'test/spec/*.spec.js', | ||
template : 'test/grunt.tmpl' | ||
} | ||
} | ||
}, | ||
jshint : { | ||
options : { | ||
jshintrc : 'jshint.json' | ||
}, | ||
source : config.dist | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-concat'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-jasmine'); | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
|
||
// Default task. | ||
grunt.registerTask('default', ['clean', 'concat', 'jshint', 'uglify', 'jasmine']); | ||
};s |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"curly" : true, | ||
"eqeqeq" : true, | ||
"immed" : true, | ||
"latedef" : true, | ||
"newcap" : true, | ||
"noarg" : true, | ||
"sub" : true, | ||
"undef" : true, | ||
"boss" : true, | ||
"eqnull" : true, | ||
"browser" : true, | ||
"globals" : { | ||
"_" : true, | ||
"module" : true, | ||
"exports" : 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "", | ||
"version": "0.0.1", | ||
"author": "Stephen Young <young.steveo@gmail.com>", | ||
"description": "", | ||
"contributors": [ | ||
{ | ||
"name": "Stephen Young", | ||
"email": "young.steveo@gmail.com" | ||
} | ||
], | ||
"main": null, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/..." | ||
}, | ||
"keywords": [], | ||
"dependencies": { }, | ||
"devDependencies": { | ||
"grunt": "0.4.0rc4", | ||
"grunt-contrib-concat": "0.1.1", | ||
"grunt-contrib-uglify": "0.1.0", | ||
"grunt-contrib-jasmine": "~0.2.0", | ||
"grunt-contrib-clean": "~0.4.0a", | ||
"grunt-contrib-copy": "~0.3.2", | ||
"grunt-contrib-jshint": "~0.1.0" | ||
}, | ||
"bundledDependencies": [], | ||
"license": "MIT" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Jasmine Spec Runner</title> | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script> | ||
<% with (scripts) { %> | ||
<% [].concat(jasmine, vendor, helpers, src, specs, reporters, start).forEach(function(script){ %> | ||
<script src="<%= script %>"></script> | ||
<% }) %> | ||
<% }; %> | ||
</head> | ||
<body></body> | ||
</html> |