If you are aiming to create a truly awesome library, then you should try to develop it independently of any other software that you create.
He must perform only one exact task. And this is probably done after some commits, so for the initial creation of the library it takes only one week or two to arrive at a stable first version. And this version can be tagged and then used elsewhere.
When marking, strictly follow semantic version control - this way you can use a library with a version restriction, for example "~ 1.0", which means at least version 1.0, but any is acceptable up to 1.9999 if it is not 2.0 (which would mean incompatible changes).
And then you really do not need to update any other software when releasing a new version of the library. You only need to update if you want to include the corrected errors. Without corrections, you can update, but there is no need to do this immediately after the release of a new version of the library.
The composer will take care of all the dependencies you need. The most important thing if you run the new library is to include composer.json from the very beginning in the repository.
What if you really want to always include the latest version of the library in any other software that you write? I am not sure that you are aware of the consequences of this. This means that you are strictly tying your other software to the latest version of the library. Break this version or submit an unpleasant mistake, and all your software breaks. Therefore, the ability to upgrade or not is actually a function. You will find that all external libraries that you could use will follow the same release mechanism: they mark the new version if an important bug is fixed, or if a reasonable number of new functions have been implemented. They do not wait until you approve the new version - you must approve THEIR new version of your software by explicitly updating it to the latest. And the same goes for the internal library.
Try to avoid messing with the dev-master solutions mentioned here. They may work, but Composer works best when used with tags. If you have a fairly stable state for your library, mark it "0.0.0" and enable this version everywhere, not "dev-master". And then the tag according to the rules of the semantic version.
source share