No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [V1] boot files from "common" directory

    CLI
    4
    18
    767
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • labs20
      labs20 last edited by

      Hi. I have multiple sub apps in a structure like this:

      + server
      + client
          + _common
              + wish_global_boot_files_were_here
          + quasar_app_1
              + assets
              + boot
              + etc
          + quasar_app_2
          + quasar_app_N
      

      Then I have some boot files that I want to use among the “quasar_app”'s fellows, doing that by placing them on a folder in “_common”.

      How to do it?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        What is the purpose of the different apps?

        Scott

        1 Reply Last reply Reply Quote 0
        • labs20
          labs20 last edited by

          I have different client versions, some with more some with less features for the same server app.

          Think like if it is an app for enterprise management (this is the server) and I have different clients for different areas of the enterprise, each one seeing very different aspects of the same app, and thus, sharing a lot of technical stuff (like boot files, for example).

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            You can do that all in one app, and should. 😄

            Scott

            1 Reply Last reply Reply Quote 0
            • labs20
              labs20 last edited by

              Yes, I know. But there are many reasons to not do, and not all are in my control, you know 😕

              So, no way out from my question: how to share boot files between projects?

              ¯_(ツ)_/¯

              Thanks!

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                Sorry, but I have no idea.

                Scott

                1 Reply Last reply Reply Quote 0
                • labs20
                  labs20 last edited by

                  Well, ok thanks!

                  @rstoenescu can you help, please?

                  1 Reply Last reply Reply Quote -1
                  • labs20
                    labs20 last edited by labs20

                    Another valid situation: I have a server framework and doing several different apps on same server base, and those apps share some boot files that embed common framework logic and each one still have some exclusive boot files that is individual app logic.

                    I suggest that quasar should look for a folder “common” (this name should be configured in quasar.conf) one path up from the project folder, and if it is founded, folders with same name than the ones created on the project folder should be used / recognized.

                    + server
                    - client
                        - _common        //  or "global" or "global_src"
                            + boot       // recognised: global boot files
                            + assets     // recognised: global assets files
                            + my_folder  // ignored OR could be used for imports
                        - quasar_app_1
                            - src
                                + assets
                                + boot
                                + etc
                        + quasar_app_2
                        + quasar_app_N
                    
                    1 Reply Last reply Reply Quote 0
                    • Hawkeye64
                      Hawkeye64 last edited by

                      I suggest using boot files to import your “common boot files”

                      1 Reply Last reply Reply Quote 1
                      • s.molinari
                        s.molinari last edited by

                        @Hawkeye64 - What about builds? Would that idea still work? Does the build system take anything into account outside the /src folder, which btw, @labs20 you are missing in your example folder hierarchy.

                        Scott

                        labs20 1 Reply Last reply Reply Quote 0
                        • labs20
                          labs20 @s.molinari last edited by

                          @s-molinari said in [V1] boot files from "common" directory:

                          /src folder, which btw, @labs20 you are missing in your example folder hierarchy.

                          Scott

                          uops!! fixed 🙂

                          1 Reply Last reply Reply Quote 0
                          • rstoenescu
                            rstoenescu Admin last edited by

                            @labs20 Hi,

                            Nothing stopping you from specifying boot files with relative path to the /boot (example: ‘…/…/some/common/folder’). Just make sure that you add that containing folder to quasar.conf.js > build > transpileDependencies. More info: Quasar CLI > quasar.conf.js.

                            1 Reply Last reply Reply Quote 0
                            • labs20
                              labs20 last edited by

                              hummm… ok!

                              Should had tried that before.

                              Thanks.

                              1 Reply Last reply Reply Quote 0
                              • labs20
                                labs20 last edited by

                                Hi, @rstoenescu!

                                Well, it didn’t worked.

                                I’ve tried:

                                        boot: [
                                            '../_common/boot/handler.js'
                                        ],
                                        ...
                                        transpileDependencies: [
                                            '../_common/boot',
                                        ]
                                

                                and:

                                        boot: [
                                            '../_common/boot/handler.js'
                                        ],
                                        ...
                                        transpileDependencies: [
                                            '../_common/boot/',
                                        ]
                                

                                and:

                                        boot: [
                                            '../_common/boot/handler.js'
                                        ],
                                        ...
                                        transpileDependencies: [
                                            '../_common/boot/handler.js',
                                        ]
                                

                                but none worked.

                                The error is:

                                 app:dev-server Booting up... +3ms
                                
                                 app:progress Compiling SPA... +163ms
                                 app:progress Compiled SPA in ~14s +14s
                                 ERROR  Failed to compile with 1 errors10:07:58 AM
                                
                                This dependency was not found:
                                
                                * boot/../_common/boot/handler.js in ./.quasar/client-entry.js
                                
                                To install it, you can run: npm install --save boot/../_common/boot/handler.js
                                
                                

                                Any help?

                                1 Reply Last reply Reply Quote 0
                                • s.molinari
                                  s.molinari last edited by

                                  I think the idea is to use the boot file to import your external common files. Quasar is only looking for a file name (string) for the file in the boot folder.

                                  Scott

                                  1 Reply Last reply Reply Quote 0
                                  • rstoenescu
                                    rstoenescu Admin last edited by

                                    @labs20 ‘…/_common’ means it resolves to ‘client/quasar_app_1/src’
                                    Your path should be ‘…/…/…/_common/…’

                                    labs20 1 Reply Last reply Reply Quote 0
                                    • labs20
                                      labs20 @rstoenescu last edited by

                                      @rstoenescu said in [V1] boot files from "common" directory:

                                      @labs20 ‘…/_common’ means it resolves to ‘client/quasar_app_1/src’
                                      Your path should be ‘…/…/…/_common/…’

                                      Yeap! Working like a charm. My bad!

                                      Thank you!

                                      1 Reply Last reply Reply Quote -1
                                      • s.molinari
                                        s.molinari last edited by

                                        I learned something too. 😁

                                        Scott

                                        1 Reply Last reply Reply Quote 1
                                        • First post
                                          Last post