-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6605a92
commit 1191c0e
Showing
12 changed files
with
135 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
# 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 | ||
|
||
- [Questions, Issues or Ideas](../CONTRIBUTING.md#question) | ||
- [Issues](../CONTRIBUTING.md#issue) | ||
- [Features](../CONTRIBUTING.md#feature) | ||
- [Requirements](../CONTRIBUTING.md#requirements) | ||
- [Development Environment](../CONTRIBUTING.md#environment) | ||
- [Running the project locally](#running) | ||
- [Adding a new component](#component) | ||
- [Testing](#testing) | ||
- [Code Guidelines](#rules) | ||
- [Commit Guidelines](../CONTRIBUTING.md#commit) | ||
- [Submitting a Code Review](../CONTRIBUTING.md#code-review) | ||
|
||
## <a name="running"></a> 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` | ||
|
||
## <a name="component"></a> 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: | ||
``` bash | ||
└── lib | ||
└── sample # component directory | ||
├── sample.vue # component file | ||
├── index.js # barrel file | ||
├── examples # examples directory | ||
| ├── example-sample-default.vue # default example component | ||
| └── index.json # 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) | ||
``` | ||
**You can also reference the sample component at `src/lib/sample/` | ||
|
||
## <a name="testing"></a> 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 | ||
|
||
|
||
## <a name="rules"></a> Coding Guidelines | ||
|
||
### Vue TypeScript | ||
|
||
We follow the vue [Style Guide](https://vue.io/guide/styleguide) | ||
|
||
|
||
## License | ||
|
||
By contributing your code to the `@momentum-ui/vue` GitHub repository, you agree to license your contribution under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div> | ||
<md-sample>Default</md-sample> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ExampleSampleDefault', | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
"example-sample-default" | ||
] |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Sample should match snapshot 1`] = `<main class="md-sample"></main>`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { shallowMount } from '@vue/test-utils'; | ||
import Sample from '../sample.vue'; | ||
|
||
describe('Sample', () => { | ||
it('should match snapshot', () => { | ||
const wrapper = shallowMount(Sample); | ||
expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters