Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
young-steveo committed Feb 1, 2013
1 parent b283281 commit b4b6656
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 0 deletions.
82 changes: 82 additions & 0 deletions gruntfile.js
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
18 changes: 18 additions & 0 deletions jshint.json
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
}
}
30 changes: 30 additions & 0 deletions package.json
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"
}
14 changes: 14 additions & 0 deletions test/grunt.tmpl
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>

0 comments on commit b4b6656

Please sign in to comment.