Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit e02078b

Browse files
committed
[FT] First package and grunt
1 parent 0b28dc5 commit e02078b

2 files changed

Lines changed: 65 additions & 2 deletions

File tree

gruntFile.js

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,41 @@ module.exports = function (grunt) {
22

33
grunt.loadNpmTasks('grunt-karma');
44
grunt.loadNpmTasks('grunt-contrib-jshint');
5+
grunt.loadNpmTasks('grunt-contrib-uglify');
6+
grunt.loadNpmTasks('grunt-contrib-copy');
57

68
// Default task.
79
grunt.registerTask('default', ['jshint', 'karma']);
10+
grunt.registerTask('build-doc', ['uglify', 'copy']);
811

912
var testConfig = function(configFile, customOptions) {
10-
var options = { configFile: configFile };
13+
var options = { configFile: configFile, keepalive: false };
1114
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: ['dots'] };
1215
return grunt.util._.extend(options, customOptions, travisOptions);
1316
};
1417

1518
// Project configuration.
1619
grunt.initConfig({
20+
pkg: grunt.file.readJSON('package.json'),
21+
meta: {
22+
banner: ['/**',
23+
' * <%= pkg.name %> - <%= pkg.description %>',
24+
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
25+
' * @link <%= pkg.homepage %>',
26+
' * @license <%= pkg.license %>',
27+
' */',
28+
''].join('\n'),
29+
destName : 'out/build/<%= pkg.name %>',
30+
view : {
31+
humaName : "UI Map",
32+
repoName : "ui-map"
33+
}
34+
},
1735
karma: {
1836
unit: testConfig('test/karma.conf.js')
1937
},
2038
jshint:{
21-
all:['ui-codemirror.js', 'gruntFile.js','test/**/*.js'],
39+
files:['<%= pkg.name %>.js', 'gruntFile.js', 'test/**/*Spec.js', 'demo/**/*.js'],
2240
options:{
2341
curly:true,
2442
eqeqeq:true,
@@ -31,6 +49,29 @@ module.exports = function (grunt) {
3149
eqnull:true,
3250
globals:{}
3351
}
52+
},
53+
uglify: {
54+
options: {banner: '<%= meta.banner %>'},
55+
build: {
56+
files: {
57+
'<%= meta.destName %>.min.js': ['<%= pkg.name %>.js']
58+
}
59+
}
60+
},
61+
copy: {
62+
main: {
63+
files: [
64+
{src: ['demo/demo.html'], dest: 'out/demos.html', filter: 'isFile'}
65+
]
66+
},
67+
template : {
68+
options : {processContent : function(content){
69+
return grunt.template.process(content);
70+
}},
71+
files: [
72+
{src: ['out/.tmpl/index.tmpl'], dest: 'out/index.html'}
73+
]
74+
}
3475
}
3576
});
3677

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "angular-ui-map",
3+
"version": "0.0.3",
4+
"description": "This directive allows you to add map elements.",
5+
"author": "https://github.com/angular-ui/ui-map/graphs/contributors",
6+
"license": "MIT",
7+
"homepage": "http://angular-ui.github.com",
8+
"main": "./ui-map.js",
9+
"dependencies": {},
10+
"devDependencies": {
11+
"grunt": "~0.4.1",
12+
"grunt-karma": "~0.4.x",
13+
"grunt-contrib-jshint": "~0.2.0",
14+
"grunt-contrib-uglify": "~0.2.0",
15+
"grunt-contrib-copy": "~0.4.1"
16+
},
17+
"scripts": {},
18+
"repository": {
19+
"type": "git",
20+
"url": "git://github.com/angular-ui/ui-map.git"
21+
}
22+
}

0 commit comments

Comments
 (0)