Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
fix(grunt): fixed grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Feb 23, 2013
1 parent 1dfe1a4 commit 06599ae
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 115 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
npm-debug.log
test/coverage
components/
node_modules/
!.gitignore
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ before_script:
- npm install -g grunt-cli

script:
- grunt lint test
- grunt
127 changes: 127 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
'use strict';

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/**\n' +
' * <%= pkg.description %>\n' +
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * @link <%= pkg.homepage %>\n' +
' * @author <%= pkg.author %>\n' +
' * @license MIT License, http://www.opensource.org/licenses/MIT\n' +
' */\n'
},
build: {
dest: 'dist'
},
concat: {
options: {
banner: '<%= meta.banner %>'
},
build: {
files: {
'<%= build.dest %>/<%= pkg.name %>.js': ['src/common.js', 'src/directives/*.js']
}
}
},
uglify: {
options: {
banner: '<%= meta.banner %>'
},
build: {
files: {
'<%= build.dest %>/<%= pkg.name %>.min.js': ['<%= build.dest %>/<%= pkg.name %>.js']
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/directives/*.js', 'test/unit/*.js'],
options: {
curly: true,
browser: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
expr: true,
node: true,
globals: {
exports: true,
angular: false,
$: false
}
}
},
// watch: {
// files: '<config:jshint.files>',
// tasks: 'default'
// },
testacular: {
options: {
configFile: 'test/testacular.conf.js',
browsers: ['PhantomJS'],
reporters: ['dots'],
singleRun: true
}
}
});

// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');

// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');

// Load the plugin that provides the "watch" task.
//grunt.loadNpmTasks('grunt-contrib-watch');


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

// Build task.
grunt.registerTask('build', ['jshint', 'testacular', 'concat', 'uglify']);


// Provides the "testacular" task.
grunt.registerTask('testacular', 'Starts up a testacular server.', function() {
var done = this.async();
require('testacular').server.start(this.options(), function(code) {
done(code === 0);
});
});

// Provides the "bump" task.
grunt.registerTask('bump', 'Increment version number', function() {
var versionType = grunt.option('type');
function bumpVersion(version, versionType) {
var type = {patch: 2, minor: 1, major: 0},
parts = version.split('.'),
idx = type[versionType || 'patch'];
parts[idx] = parseInt(parts[idx], 10) + 1;
while(++idx < parts.length) { parts[idx] = 0; }
return parts.join('.');
}
var version;
function updateFile(file) {
var json = grunt.file.readJSON(file);
version = json.version = bumpVersion(json.version, versionType || 'patch');
grunt.file.write(file, JSON.stringify(json, null, ' '));
}
updateFile('package.json');
updateFile('component.json');
grunt.log.ok('Version bumped to ' + version);
});

};
5 changes: 2 additions & 3 deletions dist/angular-strap.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* AngularStrap - Twitter Bootstrap directives for AngularJS
* @version v0.6.6 - 2013-02-13
* @version v0.6.6 - 2013-02-23
* @link http://mgcrea.github.com/angular-strap
* @author Olivier Louvignes
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/


angular.module('$strap.config', []).value('$strap.config', {});
angular.module('$strap.filters', ['$strap.config']);
angular.module('$strap.directives', ['$strap.config']);
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-strap.min.js

Large diffs are not rendered by default.

104 changes: 0 additions & 104 deletions grunt.js

This file was deleted.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"author": "Olivier Louvignes",
"name": "angular-strap",
"description": "AngularStrap - Twitter Bootstrap directives for AngularJS",
"version": "0.6.6",
"homepage": "http://mgcrea.github.com/angular-strap",
"author": "Olivier Louvignes <olivier@mg-crea.com>",
"repository": {
"type": "git",
"url": "git://github.com/angular-strap/angular-strap.git"
Expand All @@ -13,11 +13,15 @@
},
"dependencies": {},
"devDependencies": {
"testacular": ">= 0.4.0",
"grunt": ">= 0.3.17"
"testacular": ">= 0.6.0",
"grunt": ">= 0.4.0",
"grunt-contrib-concat": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-uglify": "*",
"grunt-testacular": "~0.3.0"
},
"scripts": {
"test": "testacular start test/testacular.conf.js --single-run --browsers PhantomJS",
"test-server": "testacular start test/testacular.conf.js --browsers PhantomJS"
}
}
}

0 comments on commit 06599ae

Please sign in to comment.