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

Commit

Permalink
feat(datepicker): provide $datepicker module
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Jan 20, 2014
1 parent 4e2dda1 commit 0cc99cf
Show file tree
Hide file tree
Showing 9 changed files with 942 additions and 13 deletions.
66 changes: 53 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,20 @@ module.exports = function (grunt) {
dist: {
options: {
// Replace all 'use strict' statements in the code with a single one at the top
banner: '(function(window, document, $, undefined) {\n\'use strict\';\n',
footer: '\n})(window, document, window.jQuery);\n',
banner: '(function(window, document, undefined) {\n\'use strict\';\n',
footer: '\n})(window, document);\n',
process: function(src, filepath) {
return '// Source: ' + filepath + '\n' +
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
}
},
files: {
'<%= yo.dist %>/<%= pkg.name %>.js': [
'<%= yo.src %>/module.js',
'<%= yo.src %>/{,*/}*.js'
]
}
files: [{
src: ['<%= yo.src %>/module.js', '<%= yo.src %>/{,*/}*.js'],
dest: '<%= yo.dist %>/<%= pkg.name %>.js'
}, {
src: ['<%= yo.dist %>/modules/{,*/}*.tpl.js'],
dest: '<%= yo.dist %>/<%= pkg.name %>.tpl.js'
}]
},
banner: {
options: {
Expand Down Expand Up @@ -385,6 +386,35 @@ module.exports = function (grunt) {
},

ngtemplates: {
test: {
options: {
module: function(src) { return 'mgcrea.ngStrap.' + src.match(/src\/(.+)\/.*/)[1]; },
url: function(url) { return url.replace('src/', ''); }
},
files: [{
expand: true,
flatten: true,
cwd: '<%= yo.src %>',
src: '{,*/}/*.tpl.html',
dest: '.tmp/ngtemplates',
ext: '.tpl.js'
}]
},
dist: {
options: {
module: function(src) { return 'mgcrea.ngStrap.' + src.match(/src\/(.+)\/.*/)[1]; },
url: function(url) { return url.replace('src/', ''); },
usemin: 'scripts/angular-strap.tpl.min.js' // docs
},
files: [{
expand: true,
flatten: true,
cwd: '<%= yo.src %>',
src: '{,*/}/*.tpl.html',
dest: '<%= yo.dist %>/modules',
ext: '.tpl.js'
}]
},
docs: {
options: {
module: 'mgcrea.ngStrapDocs',
Expand All @@ -395,11 +425,12 @@ module.exports = function (grunt) {
src: '{,*/}docs/*.html',
dest: '.tmp/ngtemplates/scripts/src-docs.js'
},
// {
// cwd: '<%= yo.docs %>',
// src: 'views/{,*/}*.html',
// dest: '.tmp/ngtemplates/scripts/docs-views.js'
// }
{
cwd: '<%= yo.docs %>',
// src: 'views/{,*/}*.html',
src: 'views/{aside,sidebar}.html',
dest: '.tmp/ngtemplates/scripts/docs-views.js'
}
]
}
},
Expand All @@ -417,6 +448,12 @@ module.exports = function (grunt) {
src: '{,*/}*.js',
dest: '<%= yo.dist %>',
ext: '.min.js'
}, {
expand: true,
cwd: '<%= yo.dist %>',
src: '{,*/}*.tpl.js',
dest: '<%= yo.dist %>',
ext: '.tpl.min.js'
}]
}
},
Expand Down Expand Up @@ -455,12 +492,14 @@ module.exports = function (grunt) {
'clean:server',
// 'concurrent:test',
// 'autoprefixer',
'ngtemplates:test',
'connect:test',
'karma:unit'
]);

grunt.registerTask('build', [
'clean:dist',
'ngtemplates:dist',
'concat:dist',
'ngmin:dist',
'ngmin:modules',
Expand All @@ -475,6 +514,7 @@ module.exports = function (grunt) {
'less:docs',
'autoprefixer',
'nginclude:docs',
'ngtemplates:dist',
'ngtemplates:docs',
'concat:generated',
'ngmin:docs',
Expand Down

0 comments on commit 0cc99cf

Please sign in to comment.