Domanda

I know how git submodules works, and how we can use it..

now i am in situation where main application that depends on many other composer packages and along with that i have to made and develop a small another package that will be separate from main project (kind of lib.)

so how can i develop this small package along with main project without making it separate project and without publishing to any vcs just withing that project directory. so later i can take it out and do whatever i want.

i don't think that i need to place my code in /vendor directory and start developing there (don't know if its possible?)

whats the best way you think i have not so much experience with composer but now loving it.

[actually its not sub module, its just a dependency for main application]

È stato utile?

Soluzione

You can always separate that part of the code later into a package of it's own, and avoid having to create a separate repository for that small code part. Doing this would probably mean you create a separate namespace for this library, keep it separate in the directory structure (you know you can have more than one key-value-pair for PSR-0 or PSR-4 autoloading in your main composer.json), and when the time has come, you move the code into a package, also split the autoload definition (i.e. delete the library autoloading in the main package and add an appropriate version of it into the new Composer library).

On the other hand, the question is how keen you are grabbing all that development history later if you do separate this library into a new Composer package? Why not start with a dedicated repository right now? But even if you want to have both, Git has a tool for this: Detach (move) subdirectory into separate Git repository

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top