{"id":15295014,"url":"https://github.com/hjeti/vue-generator","last_synced_at":"2025-08-20T18:32:53.337Z","repository":{"id":51109041,"uuid":"83838576","full_name":"hjeti/vue-generator","owner":"hjeti","description":"A CLI generator for Vue components, views and store modules","archived":false,"fork":false,"pushed_at":"2019-04-08T14:28:09.000Z","size":34,"stargazers_count":124,"open_issues_count":5,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T06:21:05.455Z","etag":null,"topics":["cli-generators","generator","vue","vue-components","vuejs","vuejs2","vuex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hjeti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-03T20:30:30.000Z","updated_at":"2024-04-14T06:21:05.455Z","dependencies_parsed_at":"2022-09-18T12:03:40.959Z","dependency_job_id":null,"html_url":"https://github.com/hjeti/vue-generator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjeti%2Fvue-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjeti%2Fvue-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjeti%2Fvue-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjeti%2Fvue-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hjeti","download_url":"https://codeload.github.com/hjeti/vue-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-generators","generator","vue","vue-components","vuejs","vuejs2","vuex"],"created_at":"2024-09-30T17:08:18.354Z","updated_at":"2024-12-19T14:07:18.617Z","avatar_url":"https://github.com/hjeti.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","脚手架","Components \u0026 Libraries","Scaffold","Scaffold [🔝](#readme)"],"sub_categories":["Development Tools","部分","Scaffold","Parts"],"readme":"# vue-generator\nA CLI generator for Vue components, views and store modules\n\nSupports Vue 2.x\n\n## Install\n\n```console\n$ npm install -g vue-generator\n```\n\n## Usage\n\nThe most basic command runs a wizard to create a component, view or store.\n\n```console\n$ vg\n``` \n\n**Note**: Names can be inputted in any format (slug-case, camelCase, PascalCase etc.). \n\n## Templates\n\nVue generator comes with default templates but all the templates are fully customizable. \nThere are two ways to customize templates:\n\n**edit default templates**\n\nThe default templates can be customized to fit your needs. Run ```vg show-templates``` to open the default template directory.\n\n**create custom templates**\n\nIt's also possible to create custom templates in another directory. \nThe best way to start is by copying the default templates ```vg copy-templates``` and edit them. \nDon't forget to run ```vg init``` or set the template path with ```vg settings``` to use your custom templates with vue-generator\n\nThere are 3 template types:\n\n* view\n* component\n* store\n\nA template path should at least contain 3 folders with the names that match the template types.\n\n#### custom template folders\n\nIt's also possible to add other custom template folders. If you created a custom template folder and want to use it \nwhen creating a view, store or component you have to set the ```-t, -template \u003ctemplate\u003e``` option of the following commands\n```vg component```, ```vg view``` and ```vg store```\n\n#### Template folder structure\n\nInside a template folder there are no limits it can contain as much files and folder as possible.\n\n#### Variables\n\nTemplates can be customized by using variables. Variables can be used as folder name in the following format ```{variable}```. \nInside files you can use the handlebar syntax ```{{variable}}```.\n\n**available variables:**\n\n* ```name```: Name in it's original format\n* ```name_pc```: Name converted to PascalCase\n* ```name_sc```: Name converted to slug-case\n* ```name_cc```: Name converted to CamelCase\n\nSee default templates for examples.\n\n## Settings\n\nThere are four layers of settings (From least to most important):\n\n* default global settings\n* global settings in user directory .vuegenerator file\n* local settings in .vuegenerator file in current directory\n* options of the command you are running\n\nAn option will always override a local setting etc. \n\nThe four layers combined determine the settings used in every command.\n\nYou can see the settings of a directory by running ```vg settings```. \nThis is without the option overrides of course.\n\n## Commands\n\n#### help\n\nShow help\n\n```console\n$ vg -h\n```\n\n#### wizard\n\nStarts a wizard to create a component, view or store module. \n\n```console\n$ vg wizard [type] [name]\n```\n\nArguments:\n\n* ```type```: (Optional) The type of template you want to use (store, page, view). \n* ```name```: (Optional) The name you want to use in the template.\n\nExamples:\n```console\n$ vg\n$ vg wizard view\n$ vg wizard\n$ vg wizard component scrollBar\n```\n\n#### init\n\nCreate a local settings file (.vuegenerator). Local settings always override global settings.\n\n```console\n$ vg init\n```\n\n#### component\n\nDirectly create a component based on the current settings.\n\n```console\n$ vg component \u003cname\u003e\n```\n\nArguments:\n\n* ```name```: The name you want to use for the component.\n\nOptions:\n\n* ```-d, --destination \u003cdestination\u003e```: Override the destination for component.\n* ```-p, --template-path \u003ctemplate-path\u003e```: Override template path.\n* ```-t, --template \u003ctemplate\u003e```: Override template type. By default it uses the 'component' folder from the template path. With this option you can use a different template folder.\n* ```-f, --force```: Force creation of a component. By default it's impossible to create a component if the destination path doesn't exist. This option forces the creation of a component and will generates the destination folders if they don't exist. \n\nExamples:\n```console\n$ vg component check-box\n$ vg component RadioButton -d ./components/ui \n$ vg component videoPlayer -d ./src/components/players/ -t base-video-component -f\n```\n\n#### view\n\nDirectly create a view based on the current settings.\n\n```console\n$ vg view \u003cname\u003e\n```\n\nArguments:\n\n* ```name```: The name you want to use for the view.\n\nOptions:\n\n* ```-d, --destination \u003cdestination\u003e```: Override the destination for view.\n* ```-p, --template-path \u003ctemplate-path\u003e```: Override template path.\n* ```-t, --template \u003ctemplate\u003e```: Override template type. By default it uses the 'view' folder from the template path. With this option you can use a different template folder.\n* ```-f, --force```: Force creation of a view. By default it's impossible to create a component if the destination path doesn't exist. This option forces the creation of a component and will generates the destination folders if they don't exist. \n\nExamples:\n```console\n$ vg view home\n$ vg view Contact -d ./components/view \n$ vg view video-detail -p ./custom-templates -t detail-view\n```\n\n#### store\n\nDirectly create a store module based on the current settings.\n\n```console\n$ vg store \u003cname\u003e\n```\n\nArguments:\n\n* ```name```: The name you want to use for the store module.\n\nOptions:\n\n* ```-d, --destination \u003cdestination\u003e```: Override the destination for store module.\n* ```-p, --template-path \u003ctemplate-path\u003e```: Override template path.\n* ```-t, --template \u003ctemplate\u003e```: Override template type. By default it uses the 'store' folder from the template path. With this option you can use a different template folder.\n* ```-f, --force```: Force creation of a store. By default it's impossible to create a component if the destination path doesn't exist. This option forces the creation of a component and will generates the destination folders if they don't exist. \n\nExamples:\n```console\n$ vg store user\n$ vg store shopping-cart -d ./modules \n$ vg store Car -t complex-store\n```\n\n#### settings\n\nSet or display settings. Without any options it will display the settings. By default it will set the settings locally in a .vuegenerator file.\nYou can also set global settings by using the global option ```-g --global```.\n\n```console\n$ vg settings\n```\n\nOptions:\n\n* ```-v, --view-destination \u003cdestination\u003e```: Set default view destination.\n* ```-c, --component-destination \u003cdestination\u003e```: Set default component destination.\n* ```-s, --store-destination \u003cdestination\u003e```: Set default store destination.\n* ```-t, --template-path \u003ctemplate-path\u003e```: Set template path.\n* ```-l, --log```: Log global or local settings depending on the global flag.\n* ```-g, --global```: Set global settings.\n\nExamples:\n```console\n$ vg settings -l\n$ vg settings -v ./view -c ./component -s ./store/modules -t ./template\n$ vg settings -g -c ./components\n```\n\n#### reset\n\nReset global settings to the defaults.\n\n```console\n$ vg reset\n```\n\n#### show-templates\n\nOpen the default template directory. The default templates can be edited to fit your needs. \n\n```console\n$ vg show-templates\n```\n\n#### copy-templates\n\nCopy the default templates to another directory. This is handy when you want to customize the default templates. \nDon't forget to run ```vg init``` or set the template path with ```vg settings```.\n\n```console\n$ vg copy-templates\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjeti%2Fvue-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjeti%2Fvue-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjeti%2Fvue-generator/lists"}