Front-End Task Automation
Friday, 25 October 13
with Grunt,Bower,Yeoman and NPM
Agenda
Overview:
- What is automation
- Reasons of automation
- Old ways of workflow
- Automation systems available
Demonstration of NPM, Grunt, Yeoman and Bower:
Application to Learning Management System:
What is automation?
- The term automation, inspired by the earlier word
Automatic (coming from automaton), was not widely used
before 1947, when General Motors established the automation
department.[1] It was during this time that industry was rapidly
adopting feedback controllers, which were introduced in the
1930s.
- The technique, method, or system of operating or
controlling a process by highly automatic means, as by
electronic devices, reducing human intervention to a minimum.
- Simply make the system work automatically.
Reasons of automation?
- Increase effectiveness, efficiency and coverage.
- Decrease monotonous process which can lead to
unexpected mistake.
- Time saving translates to cost savings
- Because developers are LAZY, and we’d rather play pool
while running the automation….
Old ways of workflow
- Scaffolding
- Convert PSD to sprite Gifs, Pngs or Jpgs
- Create index.html
- Download external vendors e.g jQuery, jQuery ui, angularJS,
Bootstrap
- Reference the vendors inside the “href”
- Open browser, test and do tweaks and reload browser
It would be +1 if the dev is doing some compression or minify
on CSS, Javascript or assets with YUI Compressor or UglifyJS.
http://yui.github.io/yuicompressor/
time
spe
nt
task
size
non-
geek
gee
k
does it
manually
makes fun of
geek’s
lose
s
gets
annoy
ed
writes
script to
automate win
s
Automation systems available
- Java ANT - BASH
- RPM - Maven
- Make
#!/bin/bash
# ALWAYS OVERWRITE MOST
RECENT
cat js/app.js > js/site.js
# PLUGINS
cat js/jQuery.js >> js/site.js
cat js/someMinifiedPlugin.js >>
js/site.js
$ ./pack.sh
http://mechanics.flite.com/blog/2012/06/19/why-we-use-node-dot-js-and-grunt-to-build-javascript/
Not all developer can write bash
New workflow for lazy
developers
Is a package manager that installs, publishes and manages node
programs written in javascript and runs under Node.js platform.
Download and install Node.js from http://nodejs.org
Usage
$ npm init
$ npm info bower
$ npm install –g bower
$ npm install bower –save-dev
$ npm update
package.json
Yeoman
Modern workflow for modern web apps
Whats up Yo?
http://yeoman.io/whyyeoman.html
Yo scaffolds out a new application, from bootstraping
grunt configuration and tasks, installs basic bower
components and CSS
Features:
- Fast scaffolding
- Generators for BackboneJS, EmberJS and AngularJS
- Automatically compiles Coffeescripts & Compass
- Killer package management using Bower
- Run’s headless browser unit testing using PhantomJS
Installing Yo and
generators
$ npm install –g yo
$ npm install –g generator-angular
$ npm install –g generator-webapp
$ yo webapp
$ yo angular
GRUNT
The JavaScript Task Runner
Grunt is a way to automate operations and to
performing repetitive tasks. Once you have done the
configuration the less work you have to do when
doing minification, compilation, deployment, unit
testing, image optimisation and etc.
Task Runner
Features:
- Unit Testing - Cache busting with revisions
- CSS Compressor - JS Linting
- Concatenation - Watch files for live reload
- Uglify - Set up proxy server
- Image Optimisation - Execute linux command
- A lot more…..
Installing Grunt
$ npm install grunt –save-dev
$ npm install grunt-cli –save-dev
Gruntfile.json
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
dist: {
src: 'dist/myfile.js',
dest: 'dist/myfile.min.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
};
Sample minify with Grunt
$ gruntmytask will run all the targets
of mytask
$ gruntmytask:target will run the specific
target of mytask
$ gruntclean
$ gruntsass:dev
Executing Builds
- Bower is a package manager for the web.
- Reads from a bower.json file
- Handles dependencies!
Installation
$ sudo npm install -g bower
$ bower init
$ bower list
$ bower search
$ bower install bootstrap –save
Bower
Bower.json
{
"dependencies": {
"bootstrap": "~3.0.2"
}
}
Composer does 2 things:
1) Downloads libraries and their dependencies.
2) Sets up autoloading so you don’t need “require” statements
Bower only does number 1.
Thanks!
Q uestions?

More Related Content

PDF
Yeoman + grunt + bower
PDF
Yeoman + Grunt + Bower - Google I/O Rewind Sri Lanka
PDF
Not Quite As Painful Threading
PPT
Using Firebug & YSlow
PPTX
Azure Web SItes - Things they don't teach kids in school - Multi-Mania
PPT
Intro to jQuery - Tulsa Ruby Group
PDF
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
PPTX
Introduction to Docker session (at Nairuby meetup)
Yeoman + grunt + bower
Yeoman + Grunt + Bower - Google I/O Rewind Sri Lanka
Not Quite As Painful Threading
Using Firebug & YSlow
Azure Web SItes - Things they don't teach kids in school - Multi-Mania
Intro to jQuery - Tulsa Ruby Group
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
Introduction to Docker session (at Nairuby meetup)

Similar to Front end task automation using grunt, yeoman and npm(1) (20)

PDF
Front end workflow with yeoman
PDF
Letsyo
PDF
Yeoman Workflow
PDF
Kickstarting Node.js Projects with Yeoman
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
PDF
Spring Boot & Actuators
PDF
Linux tag 2013 Data Center Automation with YADT
PDF
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)
PDF
OpenStack Murano introduction
PDF
Distributed Queue System using Gearman
PPT
Building An Automated Infrastructure
PPTX
Android internals By Rajesh Khetan
PDF
[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...
PPT
Building Automated Infrastructures
PDF
Grunt.js and Yeoman, Continous Integration
PPTX
Yeoman
PPTX
Yeoman
PPTX
Azure Functions @ global azure day 2017
PPT
TI TechDays 2010: swiftBoot
PDF
Agile project management in IT - Sebastian Sussmann
Front end workflow with yeoman
Letsyo
Yeoman Workflow
Kickstarting Node.js Projects with Yeoman
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Spring Boot & Actuators
Linux tag 2013 Data Center Automation with YADT
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)
OpenStack Murano introduction
Distributed Queue System using Gearman
Building An Automated Infrastructure
Android internals By Rajesh Khetan
[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...
Building Automated Infrastructures
Grunt.js and Yeoman, Continous Integration
Yeoman
Yeoman
Azure Functions @ global azure day 2017
TI TechDays 2010: swiftBoot
Agile project management in IT - Sebastian Sussmann
Ad

Recently uploaded (20)

PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
Auditboard EB SOX Playbook 2023 edition.
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
Rapid Prototyping: A lecture on prototyping techniques for interface design
Ensemble model-based arrhythmia classification with local interpretable model...
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Early detection and classification of bone marrow changes in lumbar vertebrae...
Auditboard EB SOX Playbook 2023 edition.
Presentation - Principles of Instructional Design.pptx
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
giants, standing on the shoulders of - by Daniel Stenberg
Build Real-Time ML Apps with Python, Feast & NoSQL
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
EIS-Webinar-Regulated-Industries-2025-08.pdf
LMS bot: enhanced learning management systems for improved student learning e...
Introduction to MCP and A2A Protocols: Enabling Agent Communication
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Lung cancer patients survival prediction using outlier detection and optimize...
Ad

Front end task automation using grunt, yeoman and npm(1)

  • 1. Front-End Task Automation Friday, 25 October 13 with Grunt,Bower,Yeoman and NPM
  • 2. Agenda Overview: - What is automation - Reasons of automation - Old ways of workflow - Automation systems available Demonstration of NPM, Grunt, Yeoman and Bower: Application to Learning Management System:
  • 3. What is automation? - The term automation, inspired by the earlier word Automatic (coming from automaton), was not widely used before 1947, when General Motors established the automation department.[1] It was during this time that industry was rapidly adopting feedback controllers, which were introduced in the 1930s. - The technique, method, or system of operating or controlling a process by highly automatic means, as by electronic devices, reducing human intervention to a minimum. - Simply make the system work automatically.
  • 4. Reasons of automation? - Increase effectiveness, efficiency and coverage. - Decrease monotonous process which can lead to unexpected mistake. - Time saving translates to cost savings - Because developers are LAZY, and we’d rather play pool while running the automation….
  • 5. Old ways of workflow - Scaffolding - Convert PSD to sprite Gifs, Pngs or Jpgs - Create index.html - Download external vendors e.g jQuery, jQuery ui, angularJS, Bootstrap - Reference the vendors inside the “href” - Open browser, test and do tweaks and reload browser It would be +1 if the dev is doing some compression or minify on CSS, Javascript or assets with YUI Compressor or UglifyJS. http://yui.github.io/yuicompressor/
  • 6. time spe nt task size non- geek gee k does it manually makes fun of geek’s lose s gets annoy ed writes script to automate win s
  • 7. Automation systems available - Java ANT - BASH - RPM - Maven - Make #!/bin/bash # ALWAYS OVERWRITE MOST RECENT cat js/app.js > js/site.js # PLUGINS cat js/jQuery.js >> js/site.js cat js/someMinifiedPlugin.js >> js/site.js $ ./pack.sh http://mechanics.flite.com/blog/2012/06/19/why-we-use-node-dot-js-and-grunt-to-build-javascript/
  • 8. Not all developer can write bash
  • 9. New workflow for lazy developers
  • 10. Is a package manager that installs, publishes and manages node programs written in javascript and runs under Node.js platform. Download and install Node.js from http://nodejs.org
  • 11. Usage $ npm init $ npm info bower $ npm install –g bower $ npm install bower –save-dev $ npm update
  • 13. Yeoman Modern workflow for modern web apps
  • 14. Whats up Yo? http://yeoman.io/whyyeoman.html Yo scaffolds out a new application, from bootstraping grunt configuration and tasks, installs basic bower components and CSS Features: - Fast scaffolding - Generators for BackboneJS, EmberJS and AngularJS - Automatically compiles Coffeescripts & Compass - Killer package management using Bower - Run’s headless browser unit testing using PhantomJS
  • 15. Installing Yo and generators $ npm install –g yo $ npm install –g generator-angular $ npm install –g generator-webapp $ yo webapp $ yo angular
  • 17. Grunt is a way to automate operations and to performing repetitive tasks. Once you have done the configuration the less work you have to do when doing minification, compilation, deployment, unit testing, image optimisation and etc. Task Runner Features: - Unit Testing - Cache busting with revisions - CSS Compressor - JS Linting - Concatenation - Watch files for live reload - Uglify - Set up proxy server - Image Optimisation - Execute linux command - A lot more…..
  • 18. Installing Grunt $ npm install grunt –save-dev $ npm install grunt-cli –save-dev
  • 19. Gruntfile.json module.exports = function(grunt) { grunt.initConfig({ uglify: { dist: { src: 'dist/myfile.js', dest: 'dist/myfile.min.js' } } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask('default', ['uglify']); }; Sample minify with Grunt
  • 20. $ gruntmytask will run all the targets of mytask $ gruntmytask:target will run the specific target of mytask $ gruntclean $ gruntsass:dev Executing Builds
  • 21. - Bower is a package manager for the web. - Reads from a bower.json file - Handles dependencies! Installation $ sudo npm install -g bower $ bower init $ bower list $ bower search $ bower install bootstrap –save Bower
  • 22. Bower.json { "dependencies": { "bootstrap": "~3.0.2" } } Composer does 2 things: 1) Downloads libraries and their dependencies. 2) Sets up autoloading so you don’t need “require” statements Bower only does number 1.