We'd love for you to contribute to our source code and to make Momentum UI even better than it is today! Here are the guidelines we'd like you to follow:
- Questions, Issues or Ideas
- Requirements
- Development Environment
- Adding a new component
- Running the project locally
- Testing
- Code Guidelines
- Commit Guidelines
- Submitting a Code Review
- Run the start script which will build and watch the library, then serve it at localhost:4200
yarn start:core
from the root (momentum-ui) directoryyarn start
from the core (momentum-ui/core) directory
- You can access the playground
localhost:4200/playground
- cd into the core directory:
cd core/
- For a new component, create a directory in the "scss/components" directory:
scss/components/<componentName>
- Add a Scss file for your component:
<componentName>.scss
- If you need mixins or variables, add those files to the
<componentName>
directory:<componentName>/mixins.scss
<componentName>/variables.scss
- Add a "tests" directory and file for the snapshot tests:
/tests/<componentName>.cy.js
- Add an "examples" directory and file for the documentation:
/examples/<componentName>-default.html
└── scss
└── components
└── sample # component directory
├── sample.scss # component file
├── mixins.scss # mixins file
├── variables.scss # variables file
├── examples # examples directory
| └── sample-default.html # example file
└── tests # tests directory
└── sample.cy.js # component unit test
- In the
<componentName>/tests/
directory, ensure that you add test to take the snapshots for visual regression testing - Run the test and ensure that all tests are passing by running:
yarn test
from the core (momentum-ui/core) directoryyarn test:core
from the root (momentum-ui) directory
By contributing your code to the @momentum-ui/core
GitHub repository, you agree to license your contribution under the MIT license.