Closed btford closed 10 years ago
For future reference, the URL above has changed to this: https://github.com/yeoman/generator/issues/150
@sindresorhus Any chance I can get permission to publish https://github.com/yeoman/generator-bootstrap on npm so I can close this?
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.
Thanks!
@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?
@btford I too find it silly, see https://github.com/yeoman/generator/issues/170 Just needs someone fixing it. Patch welcome ;)
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.
Would this also help fix yeoman/yo#19 ?
@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.
@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?
@sindresorhus, yep. We should do it.
updated wiki with instructions
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)
Closing this since its pretty close anyway. Including the bootstrap line lets bower-install install the necessary bootstrap files
@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.
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.
Right now, the Angular generator itself fetches and installs bootstrap. Instead, a sub-generator should be used.