Newbie question about developing extensions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goodwill
    Junior Member
    • Feb 2020
    • 28

    Newbie question about developing extensions

    Hey there,

    I've been trying to create extensions for EspoCRM and I've hit a little snag. I'm following the instructions to a tee. When I try to go to my extension in UI, EspoCRM starts looking for my controller in transpiled/src/controllers. But my controller is over at client/custom/mymodule/src/controllers/mycontroller.js.

    Is there any step that I'm missing , do I have to transpile my extension, I'm not using ES6

    Thanks a bunch!
  • yuri
    Member
    • Mar 2014
    • 8448

    #2
    Hi,

    Did you run:

    Code:
    node build --copy
    Template repository for EspoCRM extensions. Contribute to espocrm/ext-template development by creating an account on GitHub.


    You can also configure a file watcher in the IDE so that changed files are automatically copied and transpiled whenever you save. https://github.com/espocrm/ext-templ...e#file-watcher

    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • goodwill
      Junior Member
      • Feb 2020
      • 28

      #3
      Oh, I didn't use ext-template, I'm doing it the old way but in the latest version, I have a local instance that I built from source, I did grunt offline
      How can I do it without ext-template?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8448

        #4
        You don't need to transpile then. Maybe you have jsTranspiled​ enabled in custom/Espo/Modules/YourModuleName/Resources/module.json

        All our extensions don't use ES6 yet, and work fine. For example, ext-real-estate.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • goodwill
          Junior Member
          • Feb 2020
          • 28

          #5
          That did the trick ?

          ​If I were to use ES6 does grunt offline do the trick or do I have to transpile another way

          Comment

          • yuri
            Member
            • Mar 2014
            • 8448

            #6
            If you want to use ES6, better to use ext-template as it has all needed tools.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • goodwill
              Junior Member
              • Feb 2020
              • 28

              #7
              What does this section do ?

              Code:
              {
              "scriptList": [
              "__APPEND__",
              "client/custom/modules/{@nameHyphen}/lib/init.js"
              ]
              }
              Do I have to create /lib/init.js? What should i put inside of it ?​

              I did create using ext-template, I see this file Resources/metadata/app/client.json has been created but there is no lib folder or init.js anywhere

              Comment

              • goodwill
                Junior Member
                • Feb 2020
                • 28

                #8
                Originally posted by goodwill
                What does this section do ?

                Code:
                {
                "scriptList": [
                "__APPEND__",
                "client/custom/modules/{@nameHyphen}/lib/init.js"
                ]
                }
                Do I have to create /lib/init.js? What should i put inside of it ?​

                I did create using ext-template, I see this file Resources/metadata/app/client.json has been created but there is no lib folder or init.js anywhere
                I think i did figure it out using schema file

                JS files to include on the HTML page. Use __APPEND__ to append custom values w/o removing existing.

                Comment

                • goodwill
                  Junior Member
                  • Feb 2020
                  • 28

                  #9
                  Sorry to bother again
                  But i have no luck using ES6 ?​ when I try to access my view it's looking for this file

                  Code:
                  site/client/custom/modules/learn-espo/lib/transpiled/src/views/learnespo.js
                  when I check the site/client/custom/modules/learn-espo/lib/ there is just init.js which is empty ( i created an empty file init.js in lib )

                  Comment

                  • goodwill
                    Junior Member
                    • Feb 2020
                    • 28

                    #10
                    I just wanted to create a View and Template and Access it using
                    Code:
                    http://127.0.0.1/espo/site/#LearnEspo
                    I could do it using the old way but using ES6 seems I'm missing something

                    Comment

                    • yuri
                      Member
                      • Mar 2014
                      • 8448

                      #11
                      I'm not sure I understand. If you want to use ES6, I can only recommend to start from scratch with the ext-template. It's too complicated w/o it.
                      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                      Comment

                      Working...