0

I am a newer in packagist development.

I made two commands to make documents ands cruds on my symfony6 project for mongo Documents (with auto documentation from nelmio-api-bundle).

Now I use this commands in many projects and I want to create a bundle to make the modifications on these commands easier in all my projects.

So, I created a project, using the symfony documentation for create a bundle. I pushed it on github, then and I created a package successfully on packagist.

I can require my bundle using composer require ama/symfony-mongo-maker-bundle:dev-main but when i call my commands (ex: symfony console make:document), I have an error :

" There are no commands defined in the "make" namespace. ".

It's my first and very small crash-test bundle project. I haven't been able to find the solution in the Symfony documentation or in the examples from other bundles, as they are all so different from each other. I would be truly grateful if someone could show me the way.

My bundle repository here My package link here

Thank you :)

I tried many configurations in services.yaml, re-make my bundle from scratch, clear composer...

Caleb
  • 205
  • 1
  • 8
AlexM
  • 1
  • I looked at your repo and this is just a guess but because you are using the AbstractBundle class I don't think your extension is being called. Check the docs and see how to move the extension code directly into your bundle. Plus you really should not need to override AbstractBundle::getPath. Here is a [working example](https://github.com/cerad/s62bundle/blob/main/src-my-bundle/src/CeradMyBundle.php). Maybe it will help. – Cerad Aug 25 '23 at 13:26
  • This by the way is a classic example of why you should include the relevant code in your question as opposed to just linking to a repo. You have updated the repo several times already. Hopefully things are now working but it makes your question pretty much useless to stackoverflow. – Cerad Aug 25 '23 at 19:43
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 25 '23 at 21:15
  • Hello Cerad, yes I changed my code on my repo but only after it finally worked, thanks to your example and the symfony documentation ! The problem was in my bundle file, exactly as you suggested. htank you very much ! :). The working bundle is now on a new repo that I hope maintain for years : https://gitlab.com/AlexandraMasvidal/ama-symfony-mongo-maker. Be sure I will publish my code in my next questions ;) – AlexM Aug 26 '23 at 10:01

0 Answers0