2

I'd like to develop a reusable external Symfony 3 bundle installable with composer. I understood how to use composer to install a "private" vendor through a personal git repository, but I can't figure it out how to setup the environment for the development of the library/bundle.

Should I create an empty Symfony project to reproduce the environment and developing my library/bundle with only it under git versioning? 'Couse it doesn't sound like a good idea to me. Or should I develop the library/bundle as it is and relay only on Unit Testing? Or, worse, should I develop the library/bundle, pushing to the develop branch and pulling it in my current project under develop?

I think that I'm too far way from the right answer. Please, show me the right way. Thanks.

DilumN
  • 2,889
  • 6
  • 30
  • 44
  • 1
    Take a look at https://stackoverflow.com/a/21526873/1101589 seems like a proper answer – Yehor Apr 09 '18 at 16:51

2 Answers2

0

Create the bundle insiste you project andò once si finished... Create new repository with you bundle Ad your bundle repo on packagist.org Now you can install your bundle via composee

sensorario
  • 20,262
  • 30
  • 97
  • 159
  • This is exactly what I said I don't won't do because it's tricky and sounds like a workaround. I don't want to copy and paste my edits in the repository wile working :) – Cristoforo Cervino Feb 01 '17 at 11:44
  • once you have installed your bundle with packages, .. you MUST remove it from src folder – sensorario Feb 01 '17 at 13:29
0

just create your bundle, initially, inside a symfony project, when you have an initial version up and running, put it in a seperate repo, and add to packagist.

now pull the package into your symfony project using composer, and remove the original from your src folder.

at this point you can just use the git repo, pulled in by composer, to make changes in, and push changes upstream (just work with git inside your vendors/your-bundle/ folder)

Sam Janssens
  • 1,491
  • 1
  • 12
  • 30