[Suggestion] Command to generate boilerplates like Components/Stores/etc #7
It looks like Laravel! |
Yup, it's a very small feature in laravel but really enhances the workflow because the tiny details are quickly taken care of... I can see this aligning nicely with what I can imagine vue's philosophy is. |
Hmmm... just like |
+1 Awesome |
+1 |
@skyronic While I have nothing against Laravel, my guess is that vue-cli is trying to emulate npm-style commands instead, so something like I do foresee a complication though. This kind of feature would probably only be really useful with a config file, so that users could modify:
User-defined snippets a simpler alternative?I have enjoyed generators in frameworks like Rails, Ember, etc - but honestly, I think single-file generators are often overkill. Text editors typically allow the definition of extension-scoped snippets, so in Atom for example, this does quite nicely: '.text.vue':
'Vue Component':
prefix: 'vc'
body: """
<template>
${1}
</template>
<script>
export default {
data () {
return {${2}}
}
}
</script>
<style lang="scss" scoped>
${3}
</style>
""" |
@chrisvfritz I agree with you completely, and to be honest, I do have snippets for my use right now. But there are a lot of people who might not use sublime, or are comfortable setting up snippets or want something that "just works". Also I agree that using npm style spaces are better, that's the approach i've adopted in my initial work on this (you can see an example in #41 ) Additionally, we might want to later add commands which touch multiple files. |
@skyronic Ah, I hadn't seen that you'd started work on it! I very much like the way you've handled the configuration. |
Can we have a Main reason is we want |
@zigomir Good idea. Done. |
I've been browsing through https://github.com/vuejs/awesome-vue and one problem I see is that there's no unified way to build components/plugins. I've many many different ways of doing them. Some linking directly to .vue files and some of them to bundled file which I assume is preferred. Would love to see an official starter template for plugin/components that are shared through eg. npm. Any thoughts? |
Oops..missed #33 |
I'd like this as well. If vue-cli is going to steer clear of snippet/component level boilerplates, does anyone know of alternatives? Plop looks cool but I'm looking for something with less configuration. |
@chrisbraddock IMO if this is ever added it should be added at a template level. Using plop to generate components or routes once the project has been generated by vue-cli look good |
Plop is working really well. The author, Andrew, helped me get a basic store module generator going. That'll bang out |
can create a component in the right place with the right boilerplate. This can also be applied to vuex, where a single command can generate multiple files.
I personally feel it'll be best if the boilerplates are defined in the template repos itself rather than in vue-cli but i'm filing the issue here.