Skip to content

Commit dd68d50

Browse files
ivannietocoryhouse
authored andcommitted
Markdown docs lint and cleanup (coryhouse#547)
* Format CONTRIBUTING markdown to fit standards * Format CONTRIBUTORS markdown to fit standards * Format PR TEMPLATE markdown to fit standards * Format FAQ markdown to fit standards and clarify edition * Format README markdown to fit standards and clarify edition * Format README markdown to fit standards and clarify edition
1 parent 325ed92 commit dd68d50

File tree

5 files changed

+163
-100
lines changed

5 files changed

+163
-100
lines changed

Diff for: CONTRIBUTING.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Contributing
22

33
## Quick Start
4+
45
Fork this project, then:
5-
```
6+
7+
```bash
68
npm install
79
npm start
810
```
11+
912
Submit a pull request to the master branch to request merging your change.
1013

1114
## Branch Organization
15+
1216
All features should be worked out of a well named feature branch. Branch off the master branch. Submit a pull request to merge your work into the master branch when your work is ready for review.
1317

1418
## npm Scripts
19+
1520
This project uses npm scripts for automation
1621

1722
|Script|Description|
@@ -22,17 +27,21 @@ This project uses npm scripts for automation
2227
There are many other scripts in package.json, but these are the two you're most likely to run.
2328

2429
## Semantic Versioning
30+
2531
This project follows [semantic versioning](http://semver.org). We release patch versions for bugfixes, minor versions for new features, and major versions for any breaking changes.
2632

2733
## Proposing a Change
34+
2835
If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend filing an issue. This lets us reach an agreement on your proposal before you put significant effort into it.
2936

3037
## Style Guide
38+
3139
ESLint will catch most styling issues that may exist in your code. You can check the status of your code styling by running npm start.
3240

3341
However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at [Airbnb's Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.
3442

3543
## Code Conventions
44+
3645
- Use semicolons ;
3746
- 2 spaces for indentation (no tabs). Install the [Editorconfig](http://editorconfig.org) plugin for your editor to enforce this automatically.
3847
- Prefer ' over "

Diff for: CONTRIBUTORS.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
react-slingshot contributors (sorted alphabetically)
2-
====================================================
1+
# contributors
2+
3+
## react-slingshot
4+
5+
---
6+
37
* Atif Afzal ([atfzl](https://github.com/atfzl))
48
* Andrew Murray ([radarhere](https://github.com/radarhere))
59
* Barry Staes ([barrystaes](https://github.com/barrystaes))

Diff for: PULL_REQUEST_TEMPLATE.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
# Pull Request Template
2+
13
The code review checklist below is used for all pull requests.
24

35
1. Review the list before submitting your pull request.
46
2. Leave the list intact for the code reviewer's use.
57

6-
Thanks! :)
7-
8-
## Code Review Checklist
8+
## Checklist
99

1010
- [ ] Latest code from master has been merged into the pull request branch
1111
- [ ] Honors [the seven code virtues](https://pragprog.com/magazines/2011-08/how-virtuous-is-your-code)
@@ -22,3 +22,7 @@ Thanks! :)
2222
- [ ] Automated tests exist and pass
2323
- [ ] Build is successful (`npm run build`)
2424
- [ ] Works in IE 11, Chrome, Firefox, and Edge
25+
26+
## Thanks!
27+
28+
:heart:

Diff for: README.md

+85-39
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<p align="center"><img src="https://cloud.githubusercontent.com/assets/3129129/22811426/bb69dc06-ef0c-11e6-8092-a0bea9060b35.png"/></p>
1+
<p align="center">
2+
<img src="https://cloud.githubusercontent.com/assets/3129129/22811426/bb69dc06-ef0c-11e6-8092-a0bea9060b35.png"/>
3+
</p>
4+
5+
---
26

37
[![Build status: Linux](https://img.shields.io/travis/coryhouse/react-slingshot.svg?style=flat-square)](https://travis-ci.org/coryhouse/react-slingshot)
48
[![Build status: Windows](https://img.shields.io/appveyor/ci/coryhouse/react-slingshot/master.svg?style=flat-square)](https://ci.appveyor.com/project/coryhouse/react-slingshot/branch/master)
59
[![Dependency Status](https://david-dm.org/coryhouse/react-slingshot.svg?style=flat-square)](https://david-dm.org/coryhouse/react-slingshot)
610
[![Coverage Status](https://img.shields.io/coveralls/coryhouse/react-slingshot/master.svg?style=flat-square)](https://coveralls.io/github/coryhouse/react-slingshot?branch=master)
711

8-
A comprehensive starter kit for rapid application development using React.
12+
A comprehensive starter kit for rapid application development using React.
913

1014
Why Slingshot?
1115

@@ -18,67 +22,105 @@ Why Slingshot?
1822

1923
[![React Slingshot Production Build](https://img.youtube.com/vi/qlfDLsX-J0U/0.jpg)](https://www.youtube.com/watch?v=qlfDLsX-J0U)
2024

21-
## Get Started
25+
# Get Started
26+
27+
1. **Initial Machine Setup**
28+
29+
First time running the starter kit? Then complete the [Initial Machine Setup](#initial-machine-setup).
30+
31+
2. **Clone the project**
32+
33+
`git clone https://github.com/coryhouse/react-slingshot.git`.
34+
35+
3. **Run the setup script**
36+
37+
`npm run setup`
38+
39+
4. **Run the example app**
2240

23-
1. **Initial Machine Setup**. First time running the starter kit? Then complete the [Initial Machine Setup](https://github.com/coryhouse/react-slingshot#initial-machine-setup).
24-
2. **Clone the project**. `git clone https://github.com/coryhouse/react-slingshot.git`.
25-
3. **Run the setup script**. `npm run setup`
26-
4. **Run the example app**. `npm start -s`
27-
This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.
28-
5. **Review the example app.** This starter kit includes a working example app that calculates fuel savings. Note how all source code is placed under /src. Tests are placed alongside the file under test. The final built app is placed under /dist. These are the files you run in production.
29-
6. **Delete the example app files.** Once you're comfortable with how the example app works, you can [delete those files and begin creating your own app](https://github.com/coryhouse/react-slingshot/blob/master/docs/FAQ.md#i-just-want-an-empty-starter-kit).
30-
7. **Having issues?** See "Having Issues?" below.
41+
`npm start -s`
42+
43+
This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.
44+
45+
5. **Review the example app.**
46+
47+
This starter kit includes a working example app that calculates fuel savings. Note how all source code is placed under /src. Tests are placed alongside the file under test. The final built app is placed under /dist. These are the files you run in production.
48+
49+
6. **Delete the example app files.**
50+
51+
Once you're comfortable with how the example app works, you can [delete those files and begin creating your own app](./docs/FAQ.md#i-just-want-an-empty-starter-kit).
52+
53+
7. **Having issues?** See [Having Issues?](#having-issues-try-these-things-first).
3154

3255
## Initial Machine Setup
3356

34-
1. **Install [Node 4.0.0 or greater](https://nodejs.org)** - (5.0 or greater is recommended for optimal build performance). Need to run multiple versions of Node? Use [nvm](https://github.com/creationix/nvm).
35-
2. **Install [Git](https://git-scm.com/downloads)**.
57+
1. **Install [Node 4.0.0 or greater](https://nodejs.org)**
58+
59+
(5.0 or greater is recommended for optimal build performance)
60+
Need to run multiple versions of Node? Use [nvm](https://github.com/creationix/nvm).
61+
62+
2. **Install [Git](https://git-scm.com/downloads)**.
63+
3664
3. **[Disable safe write in your editor](https://webpack.js.org/guides/development/#adjusting-your-text-editor)** to assure hot reloading works properly.
37-
4. On a Mac? You're all set. If you're on Linux or Windows, complete the steps for your OS below.
38-
39-
**On Linux:**
4065

41-
* Run this to [increase the limit](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) on the number of files Linux will watch. [Here's why](https://github.com/coryhouse/react-slingshot/issues/6).
42-
`echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
66+
4. On a Mac? You're all set. If you're on Linux or Windows, complete the steps for your OS below.
67+
68+
### On Linux
69+
70+
* Run this to [increase the limit](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) on the number of files Linux will watch. [Here's why](https://github.com/coryhouse/react-slingshot/issues/6).
4371

44-
**On Windows:**
45-
46-
* **Install [Python 2.7](https://www.python.org/downloads/)**. Some node modules may rely on node-gyp, which requires Python on Windows.
47-
* **Install C++ Compiler**. Browser-sync requires a C++ compiler on Windows. [Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs) comes bundled with a free C++ compiler. Or, if you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).
72+
`echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`.
4873

49-
## Having Issues? Try these things first.
50-
1. Make sure you ran all steps in [Get started](https://github.com/coryhouse/react-slingshot/blob/master/README.md#get-started) including the [initial machine setup](https://github.com/coryhouse/react-slingshot#initial-machine-setup).
74+
### On Windows
75+
76+
* **Install [Python 2.7](https://www.python.org/downloads/)**. Some node modules may rely on node-gyp, which requires Python on Windows.
77+
* **Install C++ Compiler**. Browser-sync requires a C++ compiler on Windows.
78+
79+
[Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs) comes bundled with a free C++ compiler.
80+
81+
If you already have Visual Studio installed:
82+
Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop.
83+
The C++ compiler is used to compile browser-sync (and perhaps other Node modules).
84+
85+
---
86+
87+
## Having Issues? Try these things first
88+
89+
1. Make sure you ran all steps in [Get started](#get-started) including the [initial machine setup](#initial-machine-setup).
5190
2. Run `npm install` - If you forget to do this, you'll see this: `babel-node: command not found`.
5291
3. Install the latest version of Node. Or install [Node 5.12.0](https://nodejs.org/download/release/v5.12.0/) if you're having issues on Windows. Node 6 has issues on some Windows machines.
5392
4. Make sure files with names that begin with a dot (.editorconfig, .gitignore, .npmrc) are copied to the project directory root. This is easy to overlook if you copy this repository manually.
5493
5. Don't run the project from a symbolic link. It may cause issues with file watches.
5594
6. Delete any .eslintrc that you're storing in your user directory. Also, disable any ESLint plugin / custom rules that you've enabled within your editor. These will conflict with the ESLint rules defined in this project.
5695
7. Make sure you don't have NODE_ENV set to production on your machine. If you do then the [development dependencies won't be installed](https://github.com/coryhouse/react-slingshot/issues/400#issuecomment-290497767). Here's [how to check](http://stackoverflow.com/a/27939821/26180).
5796
8. Install watchman with `brew install watchman` if you are having the following error after an initial `npm start -s`:
58-
```sh
59-
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
60-
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
61-
events.js:160
62-
throw er; // Unhandled 'error' event
63-
^
64-
65-
Error: Error watching file for changes: EMFILE
66-
at exports._errnoException (util.js:1022:11)
67-
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
68-
```
97+
98+
```bash
99+
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
100+
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
101+
events.js:160
102+
throw er; // Unhandled 'error' event
103+
^
104+
105+
Error: Error watching file for changes: EMFILE
106+
at exports._errnoException (util.js:1022:11)
107+
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
108+
```
109+
69110
9. Tip: Things to check if you get an `npm run lint` error or build error:
70111

71-
* If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with `Exit status 1`. To fix:
112+
* If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with `Exit status 1`. To fix:
72113

73114
1. Change the `npm run lint` script to `"esw webpack.config.* src tools; exit 0"`
74115
1. Change the `npm run lint:watch` script to `"esw webpack.config.* src tools --watch; exit 0"`
75116

76117
> Note: Adding `exit 0` will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors.
77-
78118
* Ensure the `eslint`/`esw` globally installed version matches the version used in the project. This will ensure the `esw` keyword is resolved.
119+
79120
10. Rebuild node-sass with `npm rebuild node-sass` if you are having and error like `Node Sass does not yet support your current environment on macOS XXX` after an initial `npm start -s`.
80121

81-
<a id="technologies"/>
122+
---
123+
82124
## Technologies
83125

84126
Slingshot offers a rich development experience using the following technologies:
@@ -100,5 +142,9 @@ Slingshot offers a rich development experience using the following technologies:
100142
| [npm Scripts](https://docs.npmjs.com/misc/scripts)| Glues all this together in a handy automated build. | [Pluralsight course](https://www.pluralsight.com/courses/npm-build-tool-introduction), [Why not Gulp?](https://medium.com/@housecor/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.vtaziro8n) |
101143
102144
The starter kit includes a working example app that puts all of the above to use.
145+
146+
---
147+
103148
## Questions?
104-
Check out the [FAQ](/docs/FAQ.md)
149+
150+
Check out the [FAQ](./docs/FAQ.md)

0 commit comments

Comments
 (0)