hhvm/hhvm-autoload

RFC: automatically create a skeleton configuration if there is none

fredemmott opened this issue · 5 comments

Should have src/ and lib/ in roots if present. Should have test/ or tests/ in devRoots if present. SHould loudly say it created it.

@simonwelsh , @jesseschalken : thoughts?

As more and more of the Hack libraries add in hhvm-autoload, this'll be useful to those that get it without realising.

Another option would be to have that as an implicit default configuration, but not write the file... I'm not sure which is more surprising magic though :p

also cc @TJ09 :)

TJ09 commented

Auto-generation still doesn't solve the need for manual action on the project owner's part (you need to start requiring hh_autoload.php for any of this to work). I wonder if adding some magic that prevents the autoload step from failing without a config file also makes it more likely that the second manual step is forgotten. Overall, more parts "just working" is probably better.

Maybe the default path(s) can be derived from composer.json if present? I'm not sure if that's again "too much magic," and wouldn't work in a long-term composer-less future; the defaults you mention feel like they should cover the majority of cases, though.

I was thinking of also making composer spew out a big colorful readme message when this happens, including the 'use hh_autoload.php' thing :)