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

FIX #46: Fallback to index.js if no main attribute in package.json #78

Merged
merged 4 commits into from Nov 26, 2014

Conversation

KnisterPeter
Copy link
Contributor

No description provided.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@@ -118,9 +118,16 @@ module Node: MODULE_SYSTEM = struct
let rec f = function
| "main" :: file :: _ ->
let path = Files_js.normalize_path (Filename.dirname package) file in
path_if_exists path
if Sys.file_exists path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so you want to try foo.js when you have main: foo in package.json.

Could you please rewrite this case to conform to the pattern used elsewhere in this file, which would be something like:

seq
(fun () -> path_if_exists path)
(fun () -> seqf
(fun ext -> path_if_exists (path ^ ext)) (* try all extensions *)
Files_js.flow_extensions)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I try to, but I have to learn a little more OCaml before. 😄

@KnisterPeter
Copy link
Contributor Author

IMHO this is ready for merging, isn't it?

@KnisterPeter
Copy link
Contributor Author

You where right, it was not neccessary. I'll removed this check.

avikchaudhuri added a commit that referenced this pull request Nov 26, 2014
FIX #46: Fallback to index.js if no main attribute in package.json
@avikchaudhuri avikchaudhuri merged commit 9f6396f into facebook:master Nov 26, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants