Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 3.12 KB

CONTRIBUTING.md

File metadata and controls

65 lines (50 loc) · 3.12 KB

Contributing

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.

Table of Contents

Running the project locally

  • 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) directory
    • yarn start from the angularjs (momentum-ui/angularjs) directory
  • You can access the playground localhost:4300/playground

Adding a new component

  1. cd into the angularjs directory: cd angularjs/
  2. For a new component, create a directory in the "src/lib/" directory: src/lib/<component-name>/
  3. Add a component file for your component: <component-name>.component.ts
  4. Add a module file for your component: index.ts
  5. Add a "tests" directory and file for unit tests: /tests/<component-name>.spec.ts
  6. Add an "examples" directory and file for the documentation: /examples/<component-name>-default.component.ts

Your components directory should look like this:

└── 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)

Testing

  • 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) directory
    • yarn test:core from the root (momentum-ui) directory

Coding Guidelines

AngularJS

Adhere to the Style Guide

License

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