Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Latest commit

 

History

History
executable file
·
69 lines (51 loc) · 3.01 KB

CONTRIBUTING.md

File metadata and controls

executable file
·
69 lines (51 loc) · 3.01 KB

Contributing

We'd love for you to contribute to our source code and to make Momentum UI Vue even better than it is today! Below are the guidelines to follow.

Table of Contents

Running the project locally

  • Run the play script which will build and watch the library, then serve it at localhost:5000
    • yarn start from the vue (momentum-ui/vue) directory
    • yarn start:vue from the root (momentum-ui) directory
  • You can access the playground localhost:5000

Adding a new component

  1. cd into the vue directory: cd vue/
  2. Use yarn scripts to create yourComponent. Replace <component-name> with the kebab-cased name of the new component.
    • Create Component: yarn new <component-name>
  3. Start the app and the new component will now be availble in the Playground.

Your components directory should look like this:

└── lib
    └── sample                                    # component directory
        ├── index.vue                             # component file
        ├── index.js                              # barrel file
        ├── examples                              # examples directory
        |   ├── default.vue                       # default example component
        |   └── index.js                          # examples barrel file
        └── tests                                 # tests directory
            ├── sample.spec.js                    # component unit test
            └── __snapshots__                     # snapshots directory (will be generated Jest)
                └── sample.spec.js.snap           # snapshots file (will be generated by Jest)

Testing

  • In the <component-name>/tests/ directory, ensure that you add tests to cover all of the component code.
  • Run the test and ensure that all tests are passing by running:
    • yarn test from the vue (momentum-ui/vue) directory
    • yarn test:vue from the root (momentum-ui) directory

Coding Guidelines

Vue TypeScript

We follow the vue Style Guide

ESLINT

We use eslint-plugin-vue. You need set Visual Studio Code or Sublime Text manually according this document.

License

By contributing your code to the @momentum-ui/vue GitHub repository, you agree to license your contribution under the MIT license.