Skip to content

Conversation

skyronic
Copy link
Collaborator

This adds a new make command to the vue cli to generate items (see issue #7). The boilerplates are defined in each repo in a .vue-boilerplates folder. For an example, see an example .vue-boilerplate dir in my fork of webpack-simple.

$ vue make Usage: vue-make make <type> [name] Options: -h, --help output usage information -l, --list list available generators and usage examples 
$ vue make component auth/RegisterComponent Created: src/auth/RegisterComponent.vue 
$ vue make --list Examples: # Create a new Vue Component in a `.vue` format $ vue make component widgets/CounterWidget # Create a new Vue directive $ vue make directive DatePicker 

Still a lot of work to do before it's usable, but I dog-fooded it for a day and it works quite nice for a toy project.

Things that can be added on top of this:

  • Add extra flags which customize the content of a generated file
  • Right now, the file is copied verbatim. We can have some flags passed and used to replace text on the files.
  • Ideally I'd like to use something like vue make:component like laravel.
  • Crowd-source ideas for generators to add...
@yyx990803
Copy link
Member

Cool! I like the idea.

@yyx990803
Copy link
Member

One thing is can we keep code style consistent - I didn't include it in vue-cli but ideally can you lint your code against this: https://github.com/feross/standard

@skyronic
Copy link
Collaborator Author

Ok. Awesome! I'll lint them, make this more functional and send pull requests to different template repos. Will update this pull request.

@zigomir
Copy link
Contributor

zigomir commented Apr 26, 2016

I discussed this with @skyronic and we agreed on closing it.

Main reasoning is that we want to keep vue-cli focused to get initial template on your disk from where you just run npm run xyz scripts to do your development and/or builds.

@zigomir zigomir closed this Apr 26, 2016
@hootlex
Copy link
Member

hootlex commented Jun 2, 2016

@zigomir @yyx990803 Maybe this pr should be re-opened? Creating components by running something like vue generate component Hello would be very cool and time saving!

IMO, since we have vue-cli it is nice to give it extra features instead of having to install external libs, for example yeoman and add extra plugins there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants