Skip to content

Commit

Permalink
chore(build): tidy up file structure and add grunt file
Browse files Browse the repository at this point in the history
The grunt file is not really needed but it demonstrates how easy it is to do a jshint and testacular run
Also, this grunt build allows us to run both jshint and testacular in the .travis CI build.
Currently the demo page is self contained but it would be good to think about breaking it out into a partial that could be used by the super angular-ui component.
  • Loading branch information
petebacondarwin committed Mar 14, 2013
1 parent 2c62c92 commit ed91db7
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
components/
components/
node_modules/
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: node_js
node_js:
- "0.8"
language: node_js
node_js:
- "0.8"

before_install:
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -g [email protected]
- npm install -g bower
- npm install -g bower grunt-cli
- npm install
- bower install

script: "testacular start test.conf.js --browsers=Firefox,PhantomJS --reporters=dots"
script: "grunt"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2012 the AngularUI Team, http://angular-ui.github.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 changes: 4 additions & 0 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "angular-ui-date",
"version": "0.0.1",
"description": "This directive allows you to add a date-picker to your form elements.",
"author": "https://github.com/angular-ui/ui-date/graphs/contributors",
"license": "MIT",
"homepage": "http://angular-ui.github.com",
"main": "./ui-date.js",
"ignore": [
"**/.*",
Expand Down
File renamed without changes.
39 changes: 39 additions & 0 deletions gruntFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = function (grunt) {

grunt.loadNpmTasks('grunt-testacular');
grunt.loadNpmTasks('grunt-contrib-jshint');

// Default task.
grunt.registerTask('default', ['jshint', 'testacular']);

var testacularConfig = function(configFile, customOptions) {
var options = { configFile: configFile, keepalive: true };
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
return grunt.util._.extend(options, customOptions, travisOptions);
};

// Project configuration.
grunt.initConfig({
testacular: {
unit: {
options: testacularConfig('test/test.conf.js')
}
},
jshint:{
files:['*.js', 'test/**/*.js', 'demo/**/*.js'],
options:{
curly:true,
eqeqeq:true,
immed:true,
latedef:true,
newcap:true,
noarg:true,
sub:true,
boss:true,
eqnull:true,
globals:{}
}
}
});

};
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "angular-ui-date",
"version": "0.0.1",
"description": "This directive allows you to add a date-picker to your form elements.",
"author": "https://github.com/angular-ui/ui-date/graphs/contributors",
"license": "MIT",
"homepage": "http://angular-ui.github.com",
"main": "",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-testacular": "~0.3.0",
"grunt-contrib-jshint": "~0.2.0"
},
"scripts": {},
"repository": {
"type": "git",
"url": "git://github.com/angular-ui/ui-date.git"
}
}
2 changes: 1 addition & 1 deletion test.conf.js → test/test.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
basePath = '..';
files = [
JASMINE,
JASMINE_ADAPTER,
Expand All @@ -9,5 +10,4 @@ files = [
'test/*.spec.js'
];
singleRun = true;
autoWatch = true;
browsers = [ 'Chrome' ];

0 comments on commit ed91db7

Please sign in to comment.