Yeoman 1.0 Released
yeoman.io
yeoman.io
This can be as convenient as typing in "yo bootstrap" to set up a generic bootstrap site, to "yo phonegap-backbone" to set up a workflow for a backbone and phonegap application. It not only sets up the directory structures for you, it also manages requirements inside of your project from external parties, test environments, and gives you a nice little live-preview setup with grunt automatically.
For me, it takes a lot of that project setup time out of the way, so I can get started coding rather quickly.
So I still do most things the old school way. Then I'm done and writing code instead of trying to figure out why Yeoman is broken or the app it generates isn't loading.
To get a the scaffolding for a backbone app, and the pieces of a "blog" MVC module:
yo backbone # generates your application base and build workflow
yo backbone:model blog
yo backbone:collection blog
yo backbone:router blog
yo backbone:view blog
grunt server
[0] https://github.com/yeoman/generator-backboneFor example, app A depends on library B which depends on library C. If C is jQuery and those are all the dependencies you have, it's fine; but when a project grows a little larger, you do want a proper system.
This is not an uncommon thing; modularizing an app or library into many small, independent parts is simply good practice.
Concrete example: Our company has a library which is currently monolithic and too big for its own repo, so it needs to be broken up into many different modules.
For this we have to have a dependency system because every module in the library needs to be able to say that it needs another module to run.
Plus, if you are developing an app that uses (a bunch of modules from) the library, you want to be able to work on the module code concurrently. Having to minify/package library code and copy it into the app every time you make a change is very inconvenient.
Plus, eventually you need to bundle a single file, eg. mylib.min.js, that combine all the modules. Also a chore without a dependency system. Might be fine for just isolated one case, gets stupidly annoying for the next project, and the next, and so on.
What I like about Browserify is that you just require libraries in your code where you need them, and that way all dependencies are expressed in code; whereas Bower has explicit metadata, separate from the code, which may get out of sync over time.
For normal approach:
1. Google CDN jquery
2. Get the CDN link of jQuery
3. Add it to your template
For Yeoman/Bower:
1. bower install jquery
2. Get the link/path where bower installed jQuery
3. Add it to your template
I haven't found anything else that comes close for solely front end dev work.
Besides just being a great package overall, Yeoman really helped me appreciate how what seem like trivial niceties -- the speed of auto-build vs. stopping and restarting the local server and hitting Refresh -- can really make the difference between gradually losing interest because of the accumulation of small inconveniences and actually enjoying the development process enough to finish a project.
But now that I think more about it, doing both at once helped me with how I generally learn things, which is: copy example applications and go through the motions, and slowly experiment/break things until it all makes sense.
However, the problem with this is that if you kind-of-know something, you just mindlessly retype the code without getting much benefit. I kind-of-know MVC (or whatever Angular is) frameworks so to make things a challenge, I took the Todo/Hello-world Angular apps and re-wrote them in CoffeeScript. There was enough mental exercise there that my brain didn't atrophy from looking at Todo/Hello-world-level code, and at the same time, I got some practice with CoffeeScript.
I guess the main "resource" that made this possible was with Yeoman, which chirped at me everytime I screwed up in CoffeeScript (i.e. missed a whitespace) and made it easy, via TDD, to slowly construct an Angular app despite being incredibly confused with some of Angular's magic.
if ( $uri !~ /index\.html$) { rewrite ^(/.+)\.html$ $scheme://$host$1 permanent; }
Yeoman helps manage and coordinate various build tools, but for pretty permalinks on your production build, you're probably going to need something like a plugin for `grunt build` that renames files as they're copied into your /dist directory.
You can see our connect setup in this gist
EDIT: Removed confusing "client-side" reference caught by 9oliYQjP -- thanks!
yo understand:nowEDIT: No and yes.
$ yo webapp
$ npm ls | wc -l
240 $ node -v
v0.10.17
$ yo -v
1.0.0
# this works:
$ yo webapp
...
# this doesn't:
$ yo
...
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
TypeError: path must be a string
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at yoyo.Base.rootGeneratorName (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/base.js:533:24)
at yoyo.Base._setStorage (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/base.js:542:34)
at yoyo.Base (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/base.js:85:8)
at new yoyo (/usr/local/lib/node_modules/yo/bin/yoyo.js:12:18)
at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env.js:366:10)
at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env.js:409:24)
at init (/usr/local/lib/node_modules/yo/bin/yo:97:7)
at pre (/usr/local/lib/node_modules/yo/bin/yo:109:3) sudo npm install -g yo generator-webapp grunt-contrib-compass