Skip to content

Commit 73b34da

Browse files
docs(Contributing): Updating contributing docs with a bit more info fixes rmwc#359
1 parent a9d9f0f commit 73b34da

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"space-before-function-paren": "off",
55
"indent": ["error", 2],
66
"max-len": [
7-
"error",
7+
"warn",
88
80,
99
{
1010
"ignoreComments": true,

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: 'none',
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true
6+
};

CONTRIBUTING.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We strive to make developing RMWC as frictionless as possible, both for ourselve
88

99
### Setting up your development environment
1010

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!
1212

1313
> **NOTE**: If you expect to commit updated or new dependencies, please ensure you are using npm 5, which will
1414
> 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
2020
cd rmwc && npm i
2121
```
2222

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+
2346
### Building Components
2447

2548
Each component requires the following items in order to be complete:
@@ -52,12 +75,6 @@ To "build" the library for distribution
5275
npm run build
5376
```
5477

55-
To build the umd module
56-
57-
```
58-
npm run build:lib
59-
```
60-
6178
To build the docs
6279

6380
```

0 commit comments

Comments
 (0)