SlideShare ist ein Scribd-Unternehmen logo
1 von 23
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?

Weitere ähnliche Inhalte

Ähnlich wie Front-End Automation with Grunt, Bower, Yeoman and NPM

Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeomanhassan hafez
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanPatrick Buergin
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & ActuatorsVMware Tanzu
 
Linux tag 2013 Data Center Automation with YADT
Linux tag 2013 Data Center Automation with YADTLinux tag 2013 Data Center Automation with YADT
Linux tag 2013 Data Center Automation with YADTSchlomo Schapiro
 
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)
JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(下)JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(下)
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)Simon Su
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introductionVictor Zhang
 
Distributed Queue System using Gearman
Distributed Queue System using GearmanDistributed Queue System using Gearman
Distributed Queue System using GearmanEric Cho
 
Building An Automated Infrastructure
Building An Automated InfrastructureBuilding An Automated Infrastructure
Building An Automated Infrastructureelliando dias
 
Android internals By Rajesh Khetan
Android internals By Rajesh KhetanAndroid internals By Rajesh Khetan
Android internals By Rajesh KhetanRajesh Khetan
 
[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...
[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...
[BreizhCamp, format 15min] Construire et automatiser l'ecosystème de son Saa...François-Guillaume Ribreau
 
Building Automated Infrastructures
Building Automated InfrastructuresBuilding Automated Infrastructures
Building Automated Infrastructureselliando dias
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Yeoman
YeomanYeoman
Yeomanarybik
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017Sean Feldman
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootandrewmurraympc
 
Agile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian SussmannAgile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian SussmannDevDay.org
 

Ähnlich wie Front-End Automation with Grunt, Bower, Yeoman and NPM (20)

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

Kürzlich hochgeladen

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Kürzlich hochgeladen (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Front-End Automation with Grunt, Bower, Yeoman and NPM

  • 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.