Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can main contain globs? #30

Closed
donaldpipowitch opened this issue May 15, 2014 · 14 comments
Closed

Can main contain globs? #30

donaldpipowitch opened this issue May 15, 2014 · 14 comments

Comments

@donaldpipowitch
Copy link

I know that main shouldn't be a directory, but can it be a glob to files?

Say instead of

"main": [
  "dist/template1.html",
  "dist/template2.html",
  "dist/app.js"
]

a shorter

"main": [
  "dist/*.html",
  "dist/app.js"
]

?

The question would be what $ bower list --path would return? The glob or the expanded paths? (Maybe it could be configured like $ bower list --path --expand-glob.)

@sheerun
Copy link
Contributor

sheerun commented May 15, 2014

@donaldpipowitch Main should only include main css and javascript endpoint.

Please don't include templates there.

@donaldpipowitch
Copy link
Author

?

No templates? Why that? Any why just CSS and JavaScript? I would like to use Bower for all reusable assets - that shouldn't be to uncommon. Bootstrap includes Fonts as well.

@sheerun
Copy link
Contributor

sheerun commented May 15, 2014

Main specifies only endpoints, not all files that you want to use with bower.

If you want to use those files, just don't ignore them.

@donaldpipowitch
Copy link
Author

So Bootstrap misuses the main property in this case? And every non-ignored file inside a Bower package is declared as a reusable asset by default?

@sheerun
Copy link
Contributor

sheerun commented May 15, 2014

Yes, I think bootstrap misuses main. They use relative paths in css anyway: https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css#L266

I don't know what you mean by reusable asset, but all assets that are not ignored can be used in build process by grunt, gulp etc.

I wonder what other @bower developers think.

@desandro
Copy link
Member

I don't think globs in main are a good pattern, but I can see its utility. It should work with bower list --path.

This is part of a larger discussion around what main really is.

@benschwarz
Copy link
Member

I tend to think that any time a collection of paths is acceptable, that a glob should be able to be used.

@danielpetisme
Copy link

IMO, it's a bad practice https://github.com/webux/ux-angularjs-datagrid use glob in its bower's main. As consequence, the integration with grunt wiredep doesn't work...

@donaldpipowitch
Copy link
Author

I agree with you that it is a bad practice right now, because it isn't officially specified. However, if it would be part of the bower spec it would be no problem to add this feature to wiredep. I wouldn't say its bad per se.

@williamboman
Copy link

@donaldpipowitch +1

@blai
Copy link

blai commented Oct 2, 2014

I think on one hand we need to point out the main entries for js/css, on the other hand there's definitely a need to have a list of assets for packaging purpose. It'd be nice for future version of Bower to spec this up. Glob support might be a nice fit for the list of assets.

@DataTables
Copy link

I would also be interested in an official line on this in the specification. Globs can be useful for including a bunch of images, although I can also see that not supporting globs might make a developer think a bit more about what is being included.

@cvrebert
Copy link
Contributor

@desandro Could you close this since #43 has been merged?

@desandro
Copy link
Member

Closing as "no." But the general issue is still up for discussion. We'll be evaluating a separate data point to list all files used, like files that could contain globs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants