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
* 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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-1
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,22 @@
1
1
# Contributing
2
2
3
3
## Quick Start
4
+
4
5
Fork this project, then:
5
-
```
6
+
7
+
```bash
6
8
npm install
7
9
npm start
8
10
```
11
+
9
12
Submit a pull request to the master branch to request merging your change.
10
13
11
14
## Branch Organization
15
+
12
16
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.
13
17
14
18
## npm Scripts
19
+
15
20
This project uses npm scripts for automation
16
21
17
22
|Script|Description|
@@ -22,17 +27,21 @@ This project uses npm scripts for automation
22
27
There are many other scripts in package.json, but these are the two you're most likely to run.
23
28
24
29
## Semantic Versioning
30
+
25
31
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.
26
32
27
33
## Proposing a Change
34
+
28
35
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.
29
36
30
37
## Style Guide
38
+
31
39
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.
32
40
33
41
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.
34
42
35
43
## Code Conventions
44
+
36
45
- Use semicolons ;
37
46
- 2 spaces for indentation (no tabs). Install the [Editorconfig](http://editorconfig.org) plugin for your editor to enforce this automatically.
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).
31
54
32
55
## Initial Machine Setup
33
56
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).
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:**
40
65
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).
43
71
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`.
48
73
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).
51
90
2. Run `npm install` - If you forget to do this, you'll see this: `babel-node: command not found`.
52
91
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.
53
92
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.
54
93
5. Don't run the project from a symbolic link. It may cause issues with file watches.
55
94
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.
56
95
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).
57
96
8. Install watchman with `brew install watchman` if you are having the following error after an initial `npm start -s`:
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
108
+
```
109
+
69
110
9. Tip: Things to check if you get an `npm run lint` error or build error:
70
111
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:
72
113
73
114
1. Change the `npm run lint` script to `"esw webpack.config.* src tools; exit 0"`
74
115
1. Change the `npm run lint:watch` script to `"esw webpack.config.* src tools --watch; exit 0"`
75
116
76
117
> Note: Adding `exit 0` will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors.
77
-
78
118
* Ensure the `eslint`/`esw` globally installed version matches the version used in the project. This will ensure the `esw` keyword is resolved.
119
+
79
120
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`.
80
121
81
-
<aid="technologies"/>
122
+
---
123
+
82
124
## Technologies
83
125
84
126
Slingshot offers a rich development experience using the following technologies:
@@ -100,5 +142,9 @@ Slingshot offers a rich development experience using the following technologies:
100
142
| [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) |
101
143
102
144
The starter kit includes a working example app that puts all of the above to use.
0 commit comments