3

I've got a GitHub repository that has the following directory structure:

config app vendor - Framework - Component1 - Component2 - Component3 - Component4 

So, I have a framework and want to make all its components to be install-able via composer (just like Symfony does), since those components are completely decoupled from each other and can be used as standalone libraries as well. The framework itself follows PSR-0.

What I'm falling to do is to submit each component as a package on https://packagist.org/packages/submit Seems like, that packagist wants only root of a repository and can't be used to submit nested folders.

Also, I didn't note any stuff about achieving what I want in official docs so far. Is there any way to do it? If not, what to re-organize to make it possbile?

1 Answer 1

1

If each of the components is independent, each needs its own composer.json and its own Packagist entry. Zend Framework does it this way. Zend-View, Zend-Pdf, etc. are all independent packages with their own files. If you look at the Zend Framework sample app, you'll then notice it pulls in several of its own independent packages.

Of course, a package for every component can get painful. You might consider bundling, which is a compromise technique. You consider all your packages, then group them into logical, related components with their own composer.json and Packagist entry. Symfony operates more like this. Console, for example, is a bundle of parts all related to (obviously) console operations. Even if I just want Console\Table in my consumer, I have to pull it all in.

As the code provider, you decide the best packaging arrangement for your consumers. It's a judgement call, and it may change over time.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.