yeoman / generator-angular

Yeoman generator for AngularJS
http://yeoman.io
5.73k stars 1.44k forks source link

Use bootstrap sub-generator #16

Closed btford closed 10 years ago

btford commented 11 years ago

Right now, the Angular generator itself fetches and installs bootstrap. Instead, a sub-generator should be used.

btford commented 11 years ago

See: https://github.com/yeoman/generator/issues/150

danielmcormond commented 11 years ago

For future reference, the URL above has changed to this: https://github.com/yeoman/generator/issues/150

btford commented 11 years ago

@sindresorhus Any chance I can get permission to publish https://github.com/yeoman/generator-bootstrap on npm so I can close this?

sindresorhus commented 11 years ago

Strange, I was sure I added you when I published it. This has happened multiple times before. Must be some npm weirdess. Anyway, added now.

btford commented 11 years ago

Thanks!

btford commented 11 years ago

@sindresorhus is there some way we can get all of the generators installed on one command? It feels kind of silly to do npm install generator-angular generator-karma generator-bootstrap. Could generator-angular have the other two as deps and somehow load/register them?

sindresorhus commented 11 years ago

@btford I too find it silly, see https://github.com/yeoman/generator/issues/170 Just needs someone fixing it. Patch welcome ;)

danielmcormond commented 11 years ago

Hi guys, I think @passy is right about using peerDependencies. Isn't it as simple as adding this to package.json?

"peerDependencies": {
  "generator-bootstrap": "~0.1.0",
  "generator-karma": "~0.2.0"
}

I could submit a PR but wasn't sure what repo/branch to target.

btford commented 11 years ago

Would this also help fix yeoman/yo#19 ?

danielmcormond commented 11 years ago

@btford Yes. I think it would at least allow us to remove generator-mocha from the default yo dependencies, and instead reference it via peerDependencies in the generators which need it.

sindresorhus commented 11 years ago

@danielmcormond this is the first I heard about peerDeps installing deps. Though I have to admit I've never fully understood them. I thought they we're more of a way to enforce it to use existing install of a parent deps.

If this is true, maybe we could do the same for yo, where we currently require npm install -g yo bower grunt-cli, could become just npm install -g yo and then yo would have bower and grunt-cli as peerDeps?

kevva commented 11 years ago

@sindresorhus, yep. We should do it.

eddiemonge commented 11 years ago

updated wiki with instructions

xenoterracide commented 11 years ago

possibly a separate issue, but I was trying to use angular-ui.bootstrap and the samples didn't work correctly due to the bootstrap that's installed being incomplete (relative img was missing). I was going to suggest that bootstrap should just be handled as a bower dep. But this might be another option. Personal opinion, bootstrap.css is not maintained by my repo and thus should not be commited to my repo, makes sense to pull it in with bower instead. (note: can make a separate issue)

eddiemonge commented 10 years ago

Closing this since its pretty close anyway. Including the bootstrap line lets bower-install install the necessary bootstrap files

AlJohri commented 10 years ago

@eddiemonge @btford

Is there another issue or pull request working on this? I don't see generator-bootstrap listed under the peerDependencies for generator-angular?

It seems like this generator uses its own serious of questions to download and install bootstrap? https://github.com/yeoman/generator-angular/blob/master/app/index.js#L147

I think it would be ideal to use bootstrap as a sub-generator.

eddiemonge commented 10 years ago

It doesnt need to be a subgenerator since bower-install mostly handles the installation of bootstrap now. The installation questions merely ask if you want it and which flavor.