From 4b73fe68de3395ae89e44391a29f9865debeaf9b Mon Sep 17 00:00:00 2001 From: xavijam Date: Thu, 14 Jan 2016 13:57:13 +0100 Subject: [PATCH] Moving tasks to files --- Gruntfile.js | 96 +++++--------------------------------------- dist/cartostyles.css | 2 +- package.json | 6 ++- tasks/clean.js | 13 ++++++ tasks/concat.js | 10 +++++ tasks/connect.js | 13 ++++++ tasks/cssmin.js | 12 ++++++ tasks/sass.js | 16 ++++++++ tasks/shell.js | 5 +++ tasks/watch.js | 16 ++++++++ 10 files changed, 100 insertions(+), 89 deletions(-) create mode 100644 tasks/clean.js create mode 100644 tasks/concat.js create mode 100644 tasks/connect.js create mode 100644 tasks/cssmin.js create mode 100644 tasks/sass.js create mode 100644 tasks/shell.js create mode 100644 tasks/watch.js diff --git a/Gruntfile.js b/Gruntfile.js index b36b373..60c06a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,92 +1,14 @@ -module.exports = function(grunt) { +module.exports = function (grunt) { require('load-grunt-tasks')(grunt); grunt.initConfig({ - concat: { - dist: { - options: {}, - files: { - 'dist/cartostyles.css': [ - '.tmp/src/scss/**/*.css' - ] - } - } - }, - connect: { - server: { - options: { - port: 9003, - livereload: 35732, - open: true, - hostname: '0.0.0.0', // to be able to access the server not only from localhost - base: { - path: '.' - } - } - } - }, - clean: { - dist: { - files: [{ - dot: true, - src: [ - '.sass-cache', - '.tmp', - 'dist', - '!dist/.git*' - ] - }] - } - }, - sass: { - dist: { - options: { - sourceMap: false, - outputStyle: 'compressed' - }, - files: [{ - expand: true, - src: [ - 'src/scss/**/*.scss' - ], - dest: '.tmp', - ext: '.css' - }] - } - }, - cssmin: { - dist: { - options: { - check: 'gzip' - }, - files: { - 'dist/cartostyles.css': [ - 'dist/cartostyles.css' - ] - } - } - }, - shell: { - dist: { - command: 'styleguide' - } - }, - watch: { - scss: { - files: [ - 'src/scss/**/*.scss' - ], - tasks: [ - 'sass', - 'concat', - 'cssmin' - ], - options: { - spawn: false, - livereload: 35732 - } - } - } + concat: require('./tasks/concat'), + connect: require('./tasks/connect'), + clean: require('./tasks/clean'), + sass: require('./tasks/sass'), + cssmin: require('./tasks/cssmin'), + shell: require('./tasks/shell'), + watch: require('./tasks/watch') }); var baseTasks = [ @@ -108,4 +30,4 @@ module.exports = function(grunt) { grunt.registerTask('dev', devTasks); grunt.registerTask('build', baseTasks); grunt.registerTask('default', baseTasks); -} +}; diff --git a/dist/cartostyles.css b/dist/cartostyles.css index 9efb436..51331a3 100644 --- a/dist/cartostyles.css +++ b/dist/cartostyles.css @@ -1 +1 @@ -.CDB-Shape-dot{display:inline-block;width:8px;min-width:8px;height:8px;border-radius:8px}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}mark{background:#ff0;color:#000}sub,sup{line-height:0;position:relative}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}optgroup{font-weight:700}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline}body{margin:0;line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0} \ No newline at end of file +.CDB-Shape-button,.CDB-Shape-dot,.CDB-Shape-tooltip{width:8px;min-width:8px;height:8px;border-radius:8px;display:inline-block}.CDB-Shape-button,.CDB-Shape-dot,.CDB-Shape-tooltip,.u-iBlock{display:inline-block}.CDB-Shape-button{background:red}.CDB-Shape-tooltip{background:green}.u-tSpace{margin-top:4px}.u-tSpace-xl{margin-top:12px}.u-rSpace{margin-right:4px}.u-rSpace--m{margin-right:8px}.u-rSpace--xl{margin-right:12px}.u-lSpace{margin-left:4px}.u-lSpace--xl{margin-left:12px}.u-iBlock{vertical-align:middle}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}mark{background:#ff0;color:#000}sub,sup{line-height:0;position:relative}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}optgroup{font-weight:700}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline}body{margin:0;line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0} \ No newline at end of file diff --git a/package.json b/package.json index 2704ff9..94aeb15 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,10 @@ "library", "CartoDB", "share", - "assets" + "assets", + "styleguide", + "shared components", + "editor", + "deep-insights" ] } diff --git a/tasks/clean.js b/tasks/clean.js new file mode 100644 index 0000000..5f08315 --- /dev/null +++ b/tasks/clean.js @@ -0,0 +1,13 @@ +module.exports = { + dist: { + files: [{ + dot: true, + src: [ + '.sass-cache', + '.tmp', + 'dist', + '!dist/.git*' + ] + }] + } +}; diff --git a/tasks/concat.js b/tasks/concat.js new file mode 100644 index 0000000..1c8846b --- /dev/null +++ b/tasks/concat.js @@ -0,0 +1,10 @@ +module.exports = { + dist: { + options: {}, + files: { + 'dist/cartostyles.css': [ + '.tmp/src/scss/**/*.css' + ] + } + } +}; diff --git a/tasks/connect.js b/tasks/connect.js new file mode 100644 index 0000000..1f986f1 --- /dev/null +++ b/tasks/connect.js @@ -0,0 +1,13 @@ +module.exports = { + server: { + options: { + port: 9003, + livereload: 35732, + open: true, + hostname: '0.0.0.0', // to be able to access the server not only from localhost + base: { + path: '.' + } + } + } +}; diff --git a/tasks/cssmin.js b/tasks/cssmin.js new file mode 100644 index 0000000..27f4ee8 --- /dev/null +++ b/tasks/cssmin.js @@ -0,0 +1,12 @@ +module.exports = { + dist: { + options: { + check: 'gzip' + }, + files: { + 'dist/cartostyles.css': [ + 'dist/cartostyles.css' + ] + } + } +}; diff --git a/tasks/sass.js b/tasks/sass.js new file mode 100644 index 0000000..a6c6152 --- /dev/null +++ b/tasks/sass.js @@ -0,0 +1,16 @@ +module.exports = { + dist: { + options: { + sourceMap: false, + outputStyle: 'compressed' + }, + files: [{ + expand: true, + src: [ + 'src/scss/**/*.scss' + ], + dest: '.tmp', + ext: '.css' + }] + } +}; diff --git a/tasks/shell.js b/tasks/shell.js new file mode 100644 index 0000000..99da8aa --- /dev/null +++ b/tasks/shell.js @@ -0,0 +1,5 @@ +module.exports = { + dist: { + command: 'styleguide' + } +}; diff --git a/tasks/watch.js b/tasks/watch.js new file mode 100644 index 0000000..d8ff37e --- /dev/null +++ b/tasks/watch.js @@ -0,0 +1,16 @@ +module.exports = { + scss: { + files: [ + 'src/scss/**/*.scss' + ], + tasks: [ + 'sass', + 'concat', + 'cssmin' + ], + options: { + spawn: false, + livereload: 35732 + } + } +};