We'd love for you to contribute to our source code and to make Momentum UI Angularjs even better than it is today! Below are the guidelines 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:4300
yarn start:angularjs
from the root (momentum-ui) directoryyarn start
from the angularjs (momentum-ui/angularjs) directory
- You can access the playground
localhost:4300/playground
- cd into the angularjs directory:
cd angularjs/
- For a new component, create a directory in the "src/lib/" directory:
src/lib/<component-name>/
- Add a component file for your component:
<component-name>.component.ts
- Add a module file for your component:
index.ts
- Add a "tests" directory and file for unit tests:
/tests/<component-name>.spec.ts
- Add an "examples" directory and file for the documentation:
/examples/<component-name>-default.component.ts
└── lib
└── <component-name> # component directory
├── <component-name>.component.ts # component file
├── index.ts # module file
├── examples # examples directory
| ├── <component-name>-default.component.ts # default example component
| └── index.ts # examples module
└── tests # tests directory
├── <component-name>.component.spec.ts # component unit test
└── __snapshots__ # snapshots directory (will be generated Jest)
└── <component-name>.component.spec.ts.snap # snapshots file (will be generated by Jest)
- In the
<component-name>/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/angularjs
GitHub repository, you agree to license your contribution under the MIT license.