0.0.10 • Published 1 year ago

@mengxun/quick-template v0.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

quick-template

my own quick template

Install

  • npm install @mengxun/quick-template -g

How to Use?

You should to set your own git storage of your templates, every template should be stored on each branch, the branch's name is same as the template's name

And then, you can use the command like this to set your git config

qt config git.type -u <your plat name e.g. github>

qt config git.origin -u <your host name, e.g. https://github.com>

qt config git.owner -u <your user name e.g. mengxun1437>

qt config git.name -u <your repository's name e.g. quick-template>

After that, you can use the command like this to set the templates you have

qt config templates -a <the name of branch your used to store template e.g. nodejs>

# change the -a to -d, then you can delete the template

You can also opt like this to set some global props

qt config globalProps -a <global props e.g. projectName/projectDescription>

qt config handleFiles -a <handle files e.g. package.json/README.md>

# the cli will find the path from handleFiles and then find the globalProps in these files to replace them

NOTE: You should set global props like this 👇

{
  "name": "${projectName}",
  "version": "1.0.0",
  "description": "${projectDescription}",
}

this will be transformed to

{
  "name": "<projectName>",
  "version": "1.0.0",
  "description": "<projectDescription>",
}

After that, you can opt like above to set if some Commands need show

qt config extraCommands.<template name e.g. nodejs> -a <extra command e.g. repoAuthor>

And then, when you use init, the cli will ask you the command

At last, you can use like qt config git.name to check your config Also you can find the .quick-template file in your system, and modify it to change the config And you can also use qt edit config to change

Usage

qt init is a quick command for you to choice the template of your own, incase every time you create a new project with complex options

Other

here is the default config in this cli

{
    "git": {
        "type": "github",
        "origin": "https://github.com",
        "owner": "mengxun1437",
        "name": "quick-template"
    },
    "globalProps": [
        "projectName",
        "projectDescription",
        "projectAuthor"
    ],
    "templates": [
        "nodejs-cli"
    ],
    "handleFiles": [
        "package.json",
        "README.md"
    ],
    "extraCommands": {
        "nodejs-cli": [
            "repoAuthor",
            "command"
        ]
    }
}

you can see this https://github.com/mengxun1437/quick-template/tree/nodejs-cli to check my nodejs-cli template

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago