My struggles with Composer

Minimum stability, dev-master, tagging. Sigh. I got my head around semantic versioning and most of the packages work as expected.

Using Gists as micropackages

I use gists to “remember” some extra functions. And I thought to myself I might add composer.jsom to load them when required using Composer.

Well, not so fast. Everything works as expected, unless I load function gist package with the root composer.json, but fails when required only by the subpackage. So it works, but not recursively.

I search for recursive gist loading

So far no luck. I have already tried:

There is an article about not loading recursively by design. Might be affected by it…

I might consider tagging gists, but… Gists are quick when used from web. To tag a commit, there’s need to clone, tag and push gist’s repository. Not bad, but there’s but (not-so-elegant).

Another thing: when you edit composer.json from the web, you’ll be surprised that:

[Composer\Repository\InvalidRepositoryException]                                                                                 
  No valid composer.json was found in any branch or tag of https://gist.github.com/XXXXXXX.git, could not load a package from it.

So when you need to change something, still you’ll end up reseting master with keeping changes and amending them back onto first commit.

To be continued…

Post about WIP
  • “Another thing: when you edit composer.json from the web…”

    This lead me to quite a bit of frustration. It appears that it is due to a composer bug dealing with empty commit messages. Whenever you make edits from the Gist web interface, the commit messages are empty. This causes a parsing failure in Composer and, instead of telling you that, Composer just says it cannot find anything: https://github.com/composer/composer/issues/3565 .

    Thankfully, this bug is fixed, at least if you are willing to install the latest Composer snapshot (it is not included in the most recent packaged release, which is 1.0.0-alpha9 at the time of this writing). My composer.json file is at https://github.com/evought/VCard-Tools/blob/vcardToolsRefactor/composer.json . It successfully loads evought/data-uri with the latest composer snapshot but fails against the previous release.