-
Notifications
You must be signed in to change notification settings - Fork 140
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
Define main as the entry-point files, one-per-filetype #43
Conversation
Maybe we should also note that each entrypoint specifies both main file and loadpath. e.g. It's similar to how require.js defines work. That's how I think about it at least. |
Hmm, what does the load path do? It sounds like this is specific to module loaders. |
When I say load path I mean something like For example
It means that:
The This "load path" also exists in other module systems. For example Load path is core idea of many module systems, and bower probably should account for that. |
Thanks for clarifying. I hear you that its an important concept, but I'm not sure if its worth documenting here. Load path might be treated differently for different module loaders. |
Per filetype would be amazing. |
I would appreciate it if the example could also include font files and a compiled CSS file, for completeness. |
@cvrebert Font files and images can be referenced as relative paths in CSS files. There's no need for including fonts in |
@sheerun Yes, that's fine, I just want the example/spec to be extremely explicit about that. We had to do otherwise in Bootstrap (twbs/bootstrap#11296) due to lack of clarity about this. |
I already said it in other channels, but I'm not a big fan of "one entry-point per filetype". From all proposals I think this is the one which offers the least features and while it is often good to not have a lot of features for complexity reasons I think they are necessary here so Bower is beneficial enough to coexist and be maintained next to npm, because it is more specific to front end code and assets, instead of adding some front end specific logic to npm and package.json itself and drop Bower. What do we get here? More than one main file. In npm we typically declare one main file which is mostly a JavaScript file which is fine in server land. With Bower we can now declare more than one main file, because in front end land we often need more than just one JavaScript file for a component like an HTML file or a CSS file. What do we don't get? More than one main file of the same file type. I hoped Bower would become the package manager for all front end related code and assets, but this proposal focuses on code which can import its own dependencies if necessary: HTML, CSS and JavaScript (or one of the many languages compiling to one if those). What do I mean with that? We can declare a
|
Please also clarify whether globs are allowed (the answer presumably being "No" under this proposal). |
@donaldpipowitch Thank you for this input. You raise several good issues. The larger issue that we're addressing here is how |
Sounds good +1 |
This looks great now. |
@desandro So, what's blocking this now? The brunch and wiredep responses in the above issues sound neutral to positive; no rejections. |
Define main as the entry-point files, one-per-filetype
Merged. I'd like to add a separate page on bower.io for bower.json spec. I've opened bower/bower.github.io#133 to track progress on that. |
Per bower/spec#43 : > font files [...] are not `main` files as they are not entry-points. If you have a complaint about this, take it up with the Bower folks: https://github.com/bower/bower.json-spec/issues
Per bower/spec#43 : > Use source files with module exports and imports over pre-built distribution files. Also, the example in that PR doesn't include /dist/movement.css or /dist/movement.min.css in its `main`. If you have a complaint about this, take it up with the Bower folks: https://github.com/bower/bower.json-spec/issues
yes, this is what happened |
Sorry, I don't see why a CSS file violates the spec...? Maybe you don't want a CSS and Less file, but CSS should be okay...? |
@donaldpipowitch Yes, the difficult case is distributing a precompiled CSS file alongside its Less/Sass source. |
To address recent issue with Wiredep, I've proposed a new field |
Maybe as a novice, I don't understand the necessity of one file per type for main entry in bower. |
Per bower/spec#43 : > font files [...] are not `main` files as they are not entry-points. If you have a complaint about this, take it up with the Bower folks: https://github.com/bower/bower.json-spec/issues
Per bower/spec#43 : > font files [...] are not `main` files as they are not entry-points. If you have a complaint about this, take it up with the Bower folks: https://github.com/bower/bower.json-spec/issues
To resolved bower/bower#935 once and for all.
I've added example file structure and explanation.
Feedback welcome! This is a difficult thing to explain to novices.