On Github Kidde82 / presentation-gulp-bower-yeoman
Created by Christian Persson
- Why we are using Bower, Gulp and Yeoman - This presentation will not cover making public components but how we can use it internallyReusable/independent components
Speed up development
Angular directives
Bower components
- Build new development as reusable/independent components - Faster development - Creating Bower components - Angular Directives - All tools require NodeJsA package manager for the web
www.bower.io - Bower is a package manager for the web - Public packages (angular, jQuery) - Install private package from git repoInstall Bower
$ npm install -g bower
Install Packages
# Install a bower-registered package $ bower install angular # Install package from git repository $ bower install git://github.com/Kidde82/presentation-bower.git
Package will be installed in the current directory
- NodeJS is required - You can set up a private registry as wellInstalled packages is found in /bower_componens folder
So if you installed the angular package, this is how to reference it in your code
-
Automate and enhance your workflow
www.gulp.com - Compile ts to js - Compile scss or less to css - Minifying, concatenating - TestingInstall Gulp
$ npm install -g gulp-
gulp-typescript - Compiles typescript to js, also create .d.ts
gulp-sass - Compiles sass files to css
gulp-uglify - Minify javascript
gulp-minify - Minify css
gulp-concat - Concatenate files
-Gulp watch
Automatically run test
Code coverage
Webserver with live reload
- You can create a task that only compiles and runs test on the changed files only - Code coverage tresholdAlmost 2000 plugins
Create your own plugins
-Scaffolding tool for modern webapps
www.yeoman.io - Public generators (angular, react, wordpress) - Install private generators from git repoInstall Yeoman
$ npm install -g yo
Install generator
$ npm install -g generator-angular-
Create a new folder and open it
(foldername will be the app name in this case)
# Notice that you remove the word "generator" when calling yo $ yo angular
You can pass parameters
Let's say we want typescript and not javascript
$ yo angular --typescript- Installs all npm dependencies - All bower dependencies - Adds all template files with correct name
Or if you just want a controller and not a whole app
$ yo angular:controller nameOfController --typescript-
Use your own custom template
In a team, everyone will use the same template
Your developing speed will increase
-Time for demo!
-