Socket
Socket
Sign inDemoInstall

@calidae/vue-generate-component

Package Overview
Dependencies
357
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @calidae/vue-generate-component

Vue js component generator


Version published
Weekly downloads
8
Maintainers
4
Install size
29.7 MB
Created
Weekly downloads
 

Readme

Source

Vue js component generator

Developed upon the work of vue-generate-component.

CLI util for easy generate Vue component structure.

Installation

npm install -g @calidae/vue-generate-component

If you want to try it out without polluting your global npm, you can use npx:

npx @calidae/vue-generate-component [ARGUMENTS]

Usage

Create new component

vgc Footer

Will generate a folder called Footer in your current directory vue component file:

Footer.vue

<template>
  <div class="footer">
    Footer component
  </div>
</template>

<script>
export default {
  name: 'Footer',
  data () {
    return {}
  }
}
</script>

<style scoped></style>

Creating a index.js to simplify the import statements

If you want to create a index.js to simplify the import statements simply add the --index flag or use the alias -i

vgc Footer --index
vgc Footer -i

index.js

import Footer from './Footer'

export default Footer

Creating a boilerplate test file

If you want to create a **.spec.js test file as a boilerplate where start wrtiting your own tests simply add the --test flag or use the alias -t

vgc Footer --test
vgc Footer -t

Footer.spec.js

import Footer from './index.js'
import { mount } from '@vue/test-utils'

describe('Footer.vue', () => {
  it('renders main node', () => {
    const wrapper = mount(Footer)
    expect(wrapper.classes()).toContain('Footer')
  })
})

Disclaimer

This project tries to solve tedious copy&paste operations from our daily workflow. Please notice that the generated files will require some external libraries such as Vue, @vue/test-utils or Sass loader configuration. Make sure these libraries are available in your project.

TODO

  1. Add tests(!)
  2. Add ability to define folder path (now it only creates a folder in the current directory)
  3. swig@1.4.2 is no longer maintained
  4. ...

Keywords

FAQs

Last updated on 30 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc