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

    Creating custom app templates for quasar-cli

    CLI
    6
    11
    3807
    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.
    • D
      dsl101 last edited by

      I’m sure there must be some documentation about this, but I just can’t find it on the docs site. Is there a guide anywhere for creating and using a custom app template with quasar init? I had a look in the source code, and it seems like just using a URL might work, but what format data does it expect back? Is it possible to use ‘local’ templates via a file / path reference? Is it possible to ‘register’ these with quasar-cli and use them by name?

      Many thanks!

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

        I think you can only add your own template repo (from Github). For instance,

        quasar init smolinari/my-own-super-duper-quasar-template-repo new-app

        Scott

        1 Reply Last reply Reply Quote 0
        • D
          dsl101 last edited by

          Thanks - I tried a few things, and forked the existing template. Then I found the correct format for the init command:

          quasar init @myrepo/quasar-template-default test
          

          The @ is crucial - otherwise it tries to load a sub-version of the official template.

          1 Reply Last reply Reply Quote 2
          • D
            dpamio last edited by

            And do you know how to refer to a specific branch on that repo? And also how to specify a local folder?

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

              @dpamio for branch use #. Example: quasar init @myrepo/quasar-template-default#some_branch test

              1 Reply Last reply Reply Quote 0
              • D
                dpamio last edited by

                Ouch! I was almost sure it was that way but I may had some typo in other place because it didn’t work. Will try again.

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

                  I’ve updated the docs to mention the hash.

                  Scott

                  1 Reply Last reply Reply Quote 1
                  • mesqueeb
                    mesqueeb last edited by mesqueeb

                    Hey guys!
                    I have a lot of custom templates that I use across multiple projects, but are not things I can upload to NPM or anything.
                    It’s mainly 4 categories I’m talking about: Vuex module templates, Vue component templates, Stylus helper files, build/config files.

                    The problem is, I need these sporadically throughout my projects, not just on the initial init of Quasar. Similar to the Quasar new plugin command!
                    I want to find a method where I could have a single source of truth where I keep all my templates, then just have a name for each file, and be able to template install assigned-name or something in any project I have.

                    Now I’m manually copy pasting them from a folder on my desktop whenever I need them. : D not ideal… Any advice greatly appreciated!

                    These are the things I have templates for:

                    • Vuex store modules:
                      • a main module.js template which has some preset mutations I use to write any new module on
                      • a modal management module
                      • a collection management module
                      • a generic api pre-set modal, etc.
                    • Vue components:
                      • a main component.js template with some standard computed props / mixins / stylus setup I use to write any new component on
                      • extra wrappers with custom settings around quasar components
                      • a modal aggregation component linked to modals vuex module
                      • signin/signup mocks, etc.
                    • Stylus helpers:
                      • I often write helper files with some functions/mixins meant for general use
                      • Stuff like my own breakpoint wrappers, my own margin padding mixin system, etc.
                    • Build/config files:
                      • Configuration files for things like: rollup, wallaby, babelrc, eslint, etc…
                    1 Reply Last reply Reply Quote 0
                    • rstoenescu
                      rstoenescu Admin last edited by

                      Use vue init <user>/<repo> 🙂

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

                        @rstoenescu Thanks. I’m trying to install a helpers folder I have in a private repo on Github:

                        vue init mesqueeb/templates/tree/master/styles/helpers helpers
                        // but I get:
                        (node:58697) ExperimentalWarning: The fs.promises API is experimental
                           vue-cli · Failed to download repo mesqueeb/templates/tree/master/styles/helpers: Response code 404 (Not Found)
                        
                        I 1 Reply Last reply Reply Quote 1
                        • I
                          iancesarvidinha @mesqueeb last edited by

                          @mesqueeb i have the same problem. I need use my private repository, but i don’t know how

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