Skip to content

Commit 7b75fe8

Browse files
committed
Update contributing doc
1 parent bd37a18 commit 7b75fe8

File tree

1 file changed

+26
-37
lines changed

1 file changed

+26
-37
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,60 @@
22

33
Thanks you for considering a contribution to FocusTrap!
44

5-
FocusTrap is built using tools written for
6-
[nodejs](http://nodejs.org). We recommend installing Node with
7-
[nvm](https://github.com/creationix/nvm). this also means that
8-
dependencies are managed with an [`npm`](https://npmjs.org) `package.json`
9-
file.
5+
## Before Starting
106

11-
You can install dependencies with:
7+
FocusTrap is built using tools written for [nodejs](http://nodejs.org). We recommend installing Node with [nvm](https://github.com/creationix/nvm). Dependencies are managed through `package.json`.
8+
9+
You use the same node version we are developing with by running
1210

1311
```bash
14-
npm install
12+
nvm use
1513
```
1614

15+
> You may need to run `nvm install` if you haven't installed the node version we require.
16+
17+
## Getting Started
18+
19+
All commands should be run using yarn. If you haven't switched to [yarn](https://yarnpkg.com/en/) yet, now's a great time!
20+
21+
> If you are familiar with npm then using yarn should be a breeze. You can keep using npm if you'd prefer but you will miss out on the safety and security of yarn
22+
1723
## Running
1824

1925
A production build can be built by running:
2026

2127
```bash
22-
npm run prepublish
28+
yarn build
2329
```
2430

25-
However most of the time developing with FocusTrap, you will want
26-
to reference the example app:
31+
However most of the time developing with FocusTrap, you will want to work from the example app. Boot that up with:
2732

2833
```bash
29-
npm start
34+
yarn start
3035
```
3136

32-
This will host the demo at `http://localhost:8080`.
37+
This will host a local development server at `http://localhost:8080`.
3338

3439
## Testing
3540

36-
FocusTrap uses [Karma](https://karma-runner.github.io). You can run tests
37-
with:
41+
FocusTrap uses [Karma](https://karma-runner.github.io). You can run tests with:
3842

3943
```bash
40-
npm test
44+
yarn test
4145
```
4246

43-
Be sure to check the `./coverage` folder to verify all code paths are
44-
touched.
47+
## Prettier
4548

46-
## Conventions
49+
We use [prettier](https://github.com/prettier/prettier) to ensure consistent style across all packages. Automated tests continually check that code formatting is consistent, failing the build if it is not. Make sure this doesn't happen by running:
4750

48-
**Consider master unsafe**, use [`npm`](https://www.npmjs.com/package/microcosm) for the latest stable version.
49-
50-
### Javascript
51-
52-
FocusTrap uses ES6 Javascript (compiled using [Babel](babeljs.io)). As
53-
for style, shoot for:
54-
55-
- No semicolons
56-
- Commas last,
57-
- 2 spaces for indentation (no tabs)
58-
- Prefer ' over ", use string interpolation
59-
- 80 character line length
51+
```bash
52+
yarn format
53+
```
6054

6155
### Testing
6256

63-
Additionally, we aspire for 100% code coverage. However 100% code
64-
coverage is not a foolproof indicator of good testing. Tests that
65-
cover as much surface area as possible (for the sake of coverage)
66-
should be avoided. This is a much softer measure than a style guide,
67-
and will fall to code review for enforcement.
57+
Additionally, we aspire for 100% code coverage. However 100% code coverage is not a foolproof indicator of good testing. Tests that cover as much surface area as possible (for the sake of coverage) should be avoided. This is a much softer measure than a style guide, and will fall to code review for enforcement.
6858

6959
### Reviews
7060

71-
All changes should be submitted through pull request. Ideally, at
72-
least two :+1:s should be given before a pull request is merge.
61+
All changes should be submitted through pull request. Ideally, at least two :+1:s should be given before a pull request is merge.

0 commit comments

Comments
 (0)