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

Be smart about the main attribute on package.json #49

Open
giggio opened this issue Jul 18, 2015 · 3 comments
Open

Be smart about the main attribute on package.json #49

giggio opened this issue Jul 18, 2015 · 3 comments

Comments

@giggio
Copy link

giggio commented Jul 18, 2015

If napa detects that the downloaded files don't contain a package.json, it currently creates one. I would add that it should be smart about the main attribute.
If there is a file on the root with the same name of the package, use that as main. For example, if I specify that I want to use jquery-validation-unobtrusive, and that the name I want to use for it is jquery.validate.unobtrusive, it should set the main to jquery.validate.unobtrusive.js, which is a file of the same name that is located on the root.
Maybe also check /lib and /bin.
This is somewhat connected to what was proposed on #18, but it would offer a convention, so I don't always need to configure.

@shama
Copy link
Owner

shama commented Jul 18, 2015

+1 Sounds good. Do you know of a good package on npm for detecting a potential main filename?

@giggio
Copy link
Author

giggio commented Jul 20, 2015

@shama No, I don't. :( But it should not be difficult to implement this logic I suggested.

@sparty02
Copy link

sparty02 commented May 6, 2016

Related: If there is a bower.json in the package root, it would be convenient to pickup the main from that too!

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

No branches or pull requests

3 participants