|
1 | 1 | # Contributing |
2 | 2 |
|
| 3 | +## Can I Contribute? |
| 4 | + |
| 5 | +We appreciate contributions of all kinds -- whether that is a bug fix, or a new component. |
| 6 | + |
| 7 | +Before making a PR with a brand new component, hook or feature, it may be helpful to consider whether it solves the following: |
| 8 | + |
| 9 | +- Can the feature be used across multiple MongoDB Products? |
| 10 | +- Is it abstracting logic that many developers or components could utilize? |
| 11 | +- Have you considered how to make this as generalizable as possible? |
| 12 | + |
| 13 | +## Roadmap |
| 14 | + |
| 15 | +If you're interested in contributing, and want to know what projects we have on deck, check out our roadmap [here](https://wiki.corp.mongodb.com/display/DESIGN/Design+Systems). |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +### TypeScript |
| 20 | + |
| 21 | +LeafyGreen uses TypeScript, to help make consumption of this library as intuitive and error-free as possible. If you're new to TypeScript, these resources may be able to help you get started: |
| 22 | + |
| 23 | +1. [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) |
| 24 | +2. [TypeScript Cheatsheet](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet) |
| 25 | + |
| 26 | +### Emotion |
| 27 | + |
| 28 | +For styling, we use the CSS-in-JS library, Emotion. To get started with Emotion check out their documentation [here](https://emotion.sh/docs/introduction). |
| 29 | + |
| 30 | +We've created a wrapper around the Emotion library, which can be brought into new components as such: |
| 31 | + |
| 32 | +`import { css, cx } from @leafygreen-ui/emotion` |
| 33 | + |
| 34 | +When using the library, you must use our Emotion instance, because of constraits over how styles are injected into the page. |
| 35 | + |
| 36 | +### `yarn create-package [your-package-name]` |
| 37 | + |
| 38 | +We've created a scaffolding script to help you get started with new components quickly and easily. Run `yarn create-package [your-package-name]` and you'll have all of the necessary boilerplate code available out of the box. |
| 39 | + |
| 40 | +### React Design Patterns |
| 41 | + |
| 42 | +As far as design patterns leveraged by our components we tend to favor: |
| 43 | + |
| 44 | +- Functional components over class-based components |
| 45 | +- Creating abstractable hooks where possible, that can be used across multiple components |
| 46 | +- Native Array methods to bringing in other libraries, such as Lodash |
| 47 | +- Using default exports over named exports |
| 48 | + |
3 | 49 | ## Code Style |
4 | 50 |
|
| 51 | +### Prettier |
| 52 | + |
5 | 53 | We use an automatic code formatter called [Prettier](https://prettier.io/). Run `yarn prettier` after making any changes to the code. |
6 | 54 |
|
7 | 55 | ## Branch Organization |
|
0 commit comments