Question

Today, I've putted my first project on Github and Packagist and I have a couple of questions on using both of them combined. Be aware that I am still unexperienced it this domain.

  1. Composer documentation is vast in teaching how to get the dependencies, but not how to create one, how to create the best composer.json for Github. For example, the version property is not recommended. But most of dependencies come in versions. Symfony2 comes in 2.4 or 2.3, for example. How do I maintain a version of my project in Github?

  2. In Packagist, a newly added project from Github is dev-master. How can I change is to stable or beta? I tried minimum-stability but that doesn't change it.

  3. I submitted this question a couple of hours ago. The question is that I can't add my own dependency (not some symfony bundle) beacuse the project is in dev-master (or so I think).

  4. Is there a way in Composer to construct my on custom error message (something like throw/catch) that will "be fired" when someone tries to install my project via composer but with properties in his own composer.json file that my project wouldn't like?

  5. Could someone list some best practices for a begginer on GitHub and Packagist. Maintaing tips, git tips, not-to-do tips, avoid tips, please-do tips or any other tips.

Also, if you wish to say something that is not in my question (my limited knowledge questions), please do so.

Thank you in advance for all the answers.

Was it helpful?

Solution

  1. Versioning is defined by git branches and git tags. If you want to release a version you just create a tag.

  2. Same, you have to tag releases for them to be stable. Branches are dev/unstable since they can change at any time. Tags are fixed points in time.

  3. Not sure what to say there, but might be fixed by 1/2

  4. No there is no way, and it really does not make much sense. If your project has requirements you should define them and then composer will make sure it can not be installed if those requirements are not met.

  5. That is a bit out of scope for stackoverflow I think, but I think the best advice I can give you is to follow the guidelines at http://semver.org/ for releasing versions. That's the most important thing everyone maintaining libraries should know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top