php-pds / skeleton

Standard PHP package skeleton.
Creative Commons Attribution Share Alike 4.0 International
2.32k stars 167 forks source link

`vendor/` Directory Considerations #19

Closed ramsey closed 7 years ago

ramsey commented 7 years ago

While libraries shouldn't commit the vendor directory to version control, there are instances where it might be beneficial for projects to commit the vendor directory.

Open for discussion, consider revising the vendor/ section to read:

The vendor/ directory MUST be reserved for use by package managers (e.g.: Composer).

If the repository type is designated as a "project" in its composer.json file, the vendor/ directory SHOULD be ignored by revision control tools (e.g.: Git, Mercurial, Subversion, etc.). It SHOULD NOT be committed to revision control repositories.

If the repository type is designated as a "library" (the default) or otherwise in its composer.json file, the vendor/ directory MUST be ignored by revision control tools (e.g.: Git, Mercurial, Subversion, etc.). It MUST NOT be committed to revision control repositories.

This publication does not otherwise define the structure and contents of the directory.

pmjones commented 7 years ago

This is a very good point. Now that I think about it, I have tried very hard to support each point in the draft with research. However, the bits about "not committing to version control" are a habitual bias toward Composer, and not strictly supported by the findings. Perhaps the thing to do is say "reserved for package managers ... not otherwise defined" and leave the rest out?

ramsey commented 7 years ago

I think that will suffice.

pmjones commented 7 years ago

Indeed, on further consideration, the research shows a lack of vendor/ directories. That's because Composer says (effectively) "this is reserved, don't use it." I wonder if leaving it out entirely would make even more sense.

pmjones commented 7 years ago

@ramsey You might want to submit a PR with the changes you'd like to see, because then you get automatic credit via GitHub. (You can go so far as to remove the vendor/ stuff entirely if you like, and reference this issue.)

ramsey commented 7 years ago

Will do. Thanks!

pmjones commented 7 years ago

@ramsey If you don't think you'll get around to it in the next couple of days, I can take care of it. Let me know!

ramsey commented 7 years ago

It'll be a few days before I can get to it. I haven't had Internet access since December 16. Long story. :-)

pmjones commented 7 years ago

Noted, and good luck with the internet situation.

ssmusoke commented 6 years ago

This is just me thinking - why not add a vendor directory and a .gitignore file (excluding it) so that it is clear that the directory exists but is ignored