Closed anodynos closed 10 years ago
Is there some reason package.json can't be used as a fall back ?
This has been brought up many times in the Bower issue tracker and has been declined. This is not the place to implement it.
Also it would be usefull to display which components failed to be associated with a .js
Sure, that could be useful. @robdodson what do you think?
Yeah it would be easy to list out the components that didn't make the cut. I'll see if I can put together a PR sometime this week.
I don't see why this isn't the place to implement grabbing main
from a package.json file. You're already assuming a top-level js file is the main file; how is that any better?
@mlmorg because package.json is for node and its main
might not be the same as the browser one or even work.
Sure, but doesn't a top-level js file run the same risk?
@mlmorg you're right.
I'm not opposed to adding it. Although I think the task itself could probably use some house cleaning. It's starting to turn into two giant callbacks.
@robdodson definitely
Does anyone have an example of a library that defines a main js file in package.json but not bower.json? Just so I can put together a test fixture. @anodynos @mlmorg ?
Backbone.js?
@mlmorg perfect, thanks!
also Underscore.js has no bower.json, but has package.json and main in it, though both of them work fine at the moment, since they have main js-file names same way as package, but for example backbone-forms doesn't have bower.json and has no main js-file named as package, so it's simply ignored, though it has main in package.json, which can be used by bower-requirejs to provide path for Require.js
This should be addressed by this commit in the postinstall-refactor branch (https://github.com/robdodson/grunt-bower-requirejs/commit/1779f4d4e7633c4d6e0e47629921d491f95d7e2c). There's a test for backbone-amd
which doesn't have a bower.json
but does have a package.json
which properly specifies the location of the main file. Feel free to PR additional tests if you'd like.
Fixed in v0.8.0
I think it would be a good automation and safe assumption (?) for "main" of component's
package.json
's to come into play, ifbower.json
doesn't have a "main" or is missing completelly. For example, knockout hasbut no "main".
jQuery (1.9.1) is even worse, it doesnt have a
bower.json
. EDIT: jquery does work, through the look for a top level .js file tactic. Is there some reasonpackage.json
can't be used as a fall back ?Also it would be usefull to display which components failed to be associated with a .js