How do you create a new module on the project?

profuel
profuel Sprykee Posts: 55 🪐 - Explorer
edited October 2023 in Spryker Development

Every new feature on the project is supposed to be developed inside a new module.

Either a ProductMatrix, CustomSearch or Sms.

How do you approach the new module in the beginning?

My options are:

  • use an existing module that resembles needed functionality and perform a cleanup
  • use Spryks

I'm more than happy too hear your opinions and feedback.

And if you have a suggestion what would help you in the new module creation, that's even better - we're thrilled to hear your ideas!

Comments

  • profuel
    profuel Sprykee Posts: 55 🪐 - Explorer

    To raise this topic higher, please check these PhpStorm modules that are quite helpful, creating a new module.

    https://plugins.jetbrains.com/plugin/18215-pyz

    https://plugins.jetbrains.com/plugin/18766-sprykerkit

  • bhupendra.doniwal
    bhupendra.doniwal Posts: 48 🧑🏻‍🚀 - Cadet

    Are there any VSCode modules available?
    Also, I need a reference for the Spryk what should I pass in the console? , i have already read the document and Readme.md

  • tim.koertgen
    tim.koertgen Spryker Solution Partner Posts: 4 🧑🏻‍🚀 - Cadet

    The PYZ plugin is awesome to extend on existing spryker modules. Makes it really easy. Only thing I am missing is that you can not define namespaces for each of your projects. E.g. if you have a project that uses the Pyz namespace and another one that uses some custom namespace, you always need to update the plugin config after switching the projects. That can be a bit annoying.

    I think the SprykerKit can be useful for new modules, but having to open the context menu so often to create the folder first, then the factory and facade, writer, etc. makes it hard to use. It is the same reason why I am not using the Spryks for now.

    It feels like coping over another module and modifying it to your needs is way easier / less work than having to use the context menu or sending multiple commands that sometimes just create the module folder. In combination with the regex rename files https://plugins.jetbrains.com/plugin/17063-regex-rename-files plugin, you can create new modules by copying over an existing one, rename all files and classes, and delete what you do not need in the end. Still feels like that is not the best way to be honest, but it is working well for now.

  • profuel
    profuel Sprykee Posts: 55 🪐 - Explorer

    Running console spryk:dump <Spryk name> will provide you list of possible arguments, but without the details.

    console spryk:dump AddYvesPage

    List of all "AddYvesPage" options:
    Option

    controller

    controllerMethod
    mode

    module

    organization

    theme

    To get details, please run the spryk via console spryk:run <SprykName>.

    When you know the arguments format and possible values, you may also run spryk in a fully automated mode, passing each argument as in this example:

    console spryk:run AddYvesPage --controller=Test --controllerMethod=index --mode=project --module=Test --organization=Pyz --theme=default

  • harry
    harry Posts: 9 🧑🏻‍🚀 - Cadet

    beginner i am

    i usually use this option

    • use an existing module that resembles needed functionality and perform a cleanup

    i think it's useful to dive deep the Spryker core code.

    somethings about tools, i using PHPStorm so i use the tool installed in the plugin market place