-
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
Main is an alias #8
Conversation
Nice! I like the wording and it clearly states the purpose of |
Hmm, I guess I can remove that language and leave the default to be implementation specific. For single file resources bower already generates a |
@@ -50,7 +50,7 @@ Used for search by keyword. Helps make your package easier to discover without p | |||
|
|||
#### main [string|array of strings] | |||
|
|||
The primary acting files necessary to use your package. While Bower does not directly use these files, they are listed with the commands `bower list --json` and `bower list --paths`, so they can be used by build tools. | |||
The primary filename to use as an alias for the package name. Any "requires" or "imports" of the package name symbol should reference this file instead. While Bower does not directly use these files, they are listed with the commands `bower list --json` and `bower list --paths`, so they can be used by build tools. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording is a bit clumsy. This change also seems to merge 2 different ideas for main
. If we change things, then I'd suggest that main
should be used the same way as npm and Component(1) - the entry point for the component's JS if it uses a module format.
This spec is for bower though and for bower |
Regardless of an extension to
main
being accepted #7, I want to clarify the originalmain
intent and how build tools are already using it.main
is a way to alias the package name to a file inside the package. Its a convenience to package authors so they can organize their internal directories however they wish but still export there module as a simple symbol.Bower already understands the
index.js
convention. Again taken from node, but Sprockets also supports it as well. When you install a package from a url, it writes tofoo/index.js
.index.js
is the implicit value ofmain
.index
is fine, but not everything wants to name their file that in the package.main
is a way to rewrite that path to another.