scotch / angular-brunch-seed

AngularJS + Brunch
Other
228 stars 78 forks source link

Bower should use components directory instead vendor. #50

Closed kylefinley closed 10 years ago

kylefinley commented 11 years ago

To keep with the Bower convention, package should be stored in the components directory.

The problem is that adding:

config.coffee

        'js/components.js': /^components/

js/components.js does not build. The vendor directory must be receiving special accommodations somewhere.

release/component

kylefinley commented 10 years ago

Commit 4cffcba08874a5b101fb0ffd9b85f63576804ff6 (v0.4.0) adds native bower support, and moves bower components to bower_components so the old vendor settings should work now.

lecaros commented 10 years ago

I'm afraid that brunch is not being able to put all the js files into vendor.js. Was just trying to make it work, but the only way I get bootstrap working is by including the boostrap.js file into vendor folder.

My config.coffee relevant lines are;

files:
javascripts:
  joinTo:
    'js/app.js': /^app/
    'js/vendor.js': /^(bower_components|vendor)/

I've run another test, trying to use

'js/components.js': /^bower_components/

so I can check which files from this folder are not being used. There are certain files which, somehow, are not getting into components.js, but I can't figure out the reason :s

kylefinley commented 10 years ago

@lecaros,

Are you using angular-ui/bootstrap which was add here? Or are you adding twbs/bootstrap? If you are using twbs/bootstrap you might try it again, it looks like they just updated it (12hrs ago). The previous version was not compatible with Bower v1.0 it didn't have a main section in the bower.json. Brunch uses the main section to determine which files to include. If you are working with a component that doesn't have a main section you can provide it manual as I have here, but without that addition the files won't load. I suspect that is the problem you where having.

Please let me know if that helps.

lecaros commented 10 years ago

@kylefinley I've just tried using the bootstrap (not angular-bootstrap). It's installed unde bower_components folder. Noticed it has 2 files one is bower.json and the other is .bower.json (notice the dot at the beginning). Brunch is using the one with a dot, which has a wrong path in main section. So, to this concern (loading files from components folder) brunch is just fine. Thanks for your help!

kylefinley commented 10 years ago

@lecaros,

I just want to make sure that I understand. This issue is now resolved?

It seems to be working for me, but I just wanted to make sure it's working for you.

For me, After adding "bootstrap" to bower.json and running bower install:

{
  "dependencies": {
    "bootstrap": "~2.3.2",
  ///...
  }
}

This is the contents of `bower_components/bootstrap/.bower.json (with the dot):

{
  "name": "bootstrap",
  "version": "2.3.2",
  "main": [
    "./docs/assets/js/bootstrap.js",
    "./docs/assets/css/bootstrap.css"
  ],
  "dependencies": {
    "jquery": ">=1.8.0 <2.1.0"
  },
  "homepage": "https://github.com/twitter/bootstrap",
  "_release": "2.3.2",
  "_resolution": {
    "type": "version",
    "tag": "v2.3.2",
    "commit": "b4c4072679943773a7582daa63f545ba818fa627"
  },
  "_source": "git://github.com/twitter/bootstrap.git",
  "_target": "~2.3.2"
}

And the bootstrap js files are being complied into _public/js/vendor.js

lecaros commented 10 years ago

@kylefinley, yes, this is resolved, and working for bootstrap 2.

thanks again

kylefinley commented 10 years ago

Your welcome. Please let me know if you have any other questions