You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24-7
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ We strive to make developing RMWC as frictionless as possible, both for ourselve
8
8
9
9
### Setting up your development environment
10
10
11
-
You'll need a recent version of [nodejs](https://nodejs.org/en/) to work on RMWC. We test using the latest node versions, so use the latest where possible. The dev environment is verified to work with Node versions 7 and up.
11
+
You'll need a recent version of [nodejs](https://nodejs.org/en/) to work on RMWC. We test using the latest node versions, so use the latest where possible. The dev environment is verified to work with Node versions 7 and up. Currently, RMWC development has only been done on Mac. If you are using a windows or linux based machine, please document your experience!
12
12
13
13
> **NOTE**: If you expect to commit updated or new dependencies, please ensure you are using npm 5, which will
14
14
> also update `package-lock.json` correctly when you install or upgrade packages.
@@ -20,6 +20,29 @@ [email protected]:jamesmfriedman/rmwc.git # or a path to your fork
20
20
cd rmwc && npm i
21
21
```
22
22
23
+
### Contributing to Existing Components
24
+
25
+
The most importing thing to know about RMWC is that a lot is done automatically for you based on the Flow Types. Because of this, your typings have to be correct.
26
+
27
+
- The Prop types in the docs are automatically generated at build time from the Flow Types. DO NOT update a docgen.json file manually
28
+
- Typescript definitions are also automatically generated from the Flow Types. The best check for this to make sure Typescript is working is to run `npm run build:code`. This will create the Typescript definition files and happily report any errors to you. Read more about Types below.
29
+
- The markdown files are actually pulled in at build time and are the actual docs you see on the doc site.
30
+
31
+
It is also worth noting that the foundation / adapter integration that `material-components-web` suggests using can appear daunting at times. Don't let it scare you out of trying to give back. When in doubt, just ping us on [Discord](https://discordapp.com/invite/4BSUxCW)
32
+
33
+
## Cheat sheet
34
+
-`npm start` - run the docs site
35
+
-`npm run test:watch` - run the tests in watch mode while developing
36
+
-`npm run build:code` - compile the code to check for Typescript issues
37
+
-`npm run docgen` - generates the prop types for the docs. This will unfortunately spit out some unfixable errors that you can mostly disregard. This automatically gets run when the docs get built, but you can manually run it for testing purposes.
38
+
39
+
## Typings
40
+
41
+
- Flow and Typescript are similar enough to where a light conversion process is all that is needed to turn one into the other
42
+
- While `any` is generally considered bad practice, it is an escape hatch that you can employ to get out of some impossible intersections.
43
+
- Flow uses a leading `?` for nullable types, but Typescript doesn't recognize this. Instead, use a union of `value | null`
44
+
45
+
23
46
### Building Components
24
47
25
48
Each component requires the following items in order to be complete:
@@ -52,12 +75,6 @@ To "build" the library for distribution
0 commit comments