Skip to content

Commit e5425eb

Browse files
authored
Merge pull request #184 from marshalhayes/master
clarification and formatting changes to ensure CONTRIBUTING steps are easy to follow
2 parents 2ac1d70 + 42c1e32 commit e5425eb

File tree

1 file changed

+63
-71
lines changed

1 file changed

+63
-71
lines changed

CONTRIBUTING.md

Lines changed: 63 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,68 @@
1-
# How to contribute
1+
# How to Contribute
22

33
This project is still a work in progress, but we encourage everyone to join, propose ideas and help in the development!
44

5-
## Getting Started
5+
## Getting Started
66

7-
If you want to help develop this library, here are the steps to get started with:
7+
If you want to help develop this library, here are the steps to get started:
88

99
1. Fork the repository to your account, and then clone it your computer:
10-
```bash
11-
git clone https://github.com/YOURGITHUBHANDLE/ml5-library.git
12-
```
13-
14-
2. Install dependencies:
15-
16-
```bash
17-
cd ml5-library
18-
npm install
19-
```
20-
21-
3. This project is developed using [webpack](https://webpack.js.org/). Webpack is a module bundler that allows to "bundle" different files into one file. This allows you to write files for specific things and then mix them all together into one single file that you can import in your page.
22-
23-
Under the `/src` folder you will see that there are sub-folders for all ml5 methods. You can edit each file individually and then `build` everything into one single library.
24-
25-
Before `building` the library you can see if everything is working.
26-
27-
Run this command from the root of the project:
2810
```bash
29-
npm run start
11+
git clone https://github.com/YOURGITHUBHANDLE/ml5-library.git
3012
```
3113

32-
Will output something like this:
14+
2. Install dependencies:
3315

3416
```bash
35-
Project is running at http://localhost:8080/
36-
webpack output is served from /
37-
38-
Hash: 16b80528bf532975b279
39-
Version: webpack 2.6.1
40-
Time: 4905ms
41-
Asset Size Chunks Chunk Names
42-
ml5.js 1.55 MB 0 [emitted] [big] main
43-
chunk {0} ml5.js (main) 1.5 MB [entry] [rendered]
44-
[9] (webpack)/buildin/global.js 509 bytes {0} [built]
45-
[191] ./src/index.js 403 bytes {0} [built]
46-
[192] ./~/babel-polyfill/lib/index.js 833 bytes {0} [built]
47-
[193] (webpack)-dev-server/client?http://localhost:8080 5.68 kB {0} [built]
48-
[196] ./src/ImageNet/index.js 5.63 kB {0} [built]
49-
[198] ./src/Lstm/index.js 7.7 kB {0} [built]
50-
[200] ./src/NeuralNetwork/index.js 6.8 kB {0} [built]
51-
[204] ./~/babel-polyfill/~/regenerator-runtime/runtime.js 24.4 kB {0} [built]
52-
[404] ./~/core-js/shim.js 8.18 kB {0} [built]
53-
[507] ./~/strip-ansi/index.js 161 bytes {0} [built]
54-
[509] ./~/url/url.js 23.3 kB {0} [built]
55-
[511] (webpack)-dev-server/client/overlay.js 3.73 kB {0} [built]
56-
[512] (webpack)-dev-server/client/socket.js 897 bytes {0} [built]
57-
[513] (webpack)/hot/emitter.js 77 bytes {0} [built]
58-
[515] multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js 52 bytes {0} [built]
59-
+ 501 hidden modules
60-
webpack: Compiled successfully.
17+
cd ml5-library
18+
npm install
6119
```
6220

63-
This means the project is actively being 'build' when you change any of the files in the `/src` folder. Any change you make to any file in the `/src` folder will rebuild the `ml5.js` and the `ml5.min.js` libraries.
64-
65-
4. Develop!
66-
67-
Create a new folder called `/experiments` in the project's root folder. Create an `index.html` file and add the following:
21+
3. This project is developed using [Webpack](https://webpack.js.org/). Webpack is a module bundler that "bundles" different files into one file. This file is usually called a library.
22+
23+
Under the `/src` folder there are sub-folders for all `ml5` methods. Before building the library, you can check to see everything is working:
24+
25+
- Run this command from the root of the project:
26+
```bash
27+
npm run start
28+
```
29+
30+
That should output something similar to this:
31+
32+
```bash
33+
Project is running at http://localhost:8080/
34+
webpack output is served from /
35+
36+
Hash: 16b80528bf532975b279
37+
Version: webpack 2.6.1
38+
Time: 4905ms
39+
Asset Size Chunks Chunk Names
40+
ml5.js 1.55 MB 0 [emitted] [big] main
41+
chunk {0} ml5.js (main) 1.5 MB [entry] [rendered]
42+
[9] (webpack)/buildin/global.js 509 bytes {0} [built]
43+
[191] ./src/index.js 403 bytes {0} [built]
44+
[192] ./~/babel-polyfill/lib/index.js 833 bytes {0} [built]
45+
[193] (webpack)-dev-server/client?http://localhost:8080 5.68 kB {0} [built]
46+
[196] ./src/ImageNet/index.js 5.63 kB {0} [built]
47+
[198] ./src/Lstm/index.js 7.7 kB {0} [built]
48+
[200] ./src/NeuralNetwork/index.js 6.8 kB {0} [built]
49+
[204] ./~/babel-polyfill/~/regenerator-runtime/runtime.js 24.4 kB {0} [built]
50+
[404] ./~/core-js/shim.js 8.18 kB {0} [built]
51+
[507] ./~/strip-ansi/index.js 161 bytes {0} [built]
52+
[509] ./~/url/url.js 23.3 kB {0} [built]
53+
[511] (webpack)-dev-server/client/overlay.js 3.73 kB {0} [built]
54+
[512] (webpack)-dev-server/client/socket.js 897 bytes {0} [built]
55+
[513] (webpack)/hot/emitter.js 77 bytes {0} [built]
56+
[515] multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js 52 bytes {0} [built]
57+
+ 501 hidden modules
58+
webpack: Compiled successfully.
59+
```
60+
61+
If you see this message, it means the project is actively being built by Webpack's `webpack-dev-server`. Any changes you make to any file in the `/src` folder will automatically rebuild the `ml5.js` and `ml5.min.js` libraries as long as the server continues to run.
62+
63+
4. Develop!
64+
65+
Create a new folder called `/experiments` in the project's root folder. Create an `index.html` file inside `/experiments` and add the following:
6866

6967
```html
7068
<!DOCTYPE html>
@@ -83,45 +81,39 @@ Create a new folder called `/experiments` in the project's root folder. Create a
8381
</html>
8482
```
8583

86-
This is just a simple `html` file that has a reference to the `ml5` library.
84+
This is just a simple `html` file that has a reference to the `ml5` library.
8785

88-
Now open the file `/src/index.js` and modify the first lines:
86+
Next, open the `/src/index.js` file and add this after the last line:
8987

9088
```javascript
91-
'use strict';
92-
console.log('ml5 loaded');
93-
```
94-
95-
To something like this:
96-
97-
```javascript
98-
'use strict';
9989
console.log('Hello Test Development!');
10090
```
10191

102-
If you now go to `http://localhost:8080/experiments/index.html` and open the console, you should see `Hello Test Development!`. Now try changing any other file. Webpack will rebuild the library for you. So if you reload the `index.html` page you should see your changes.
92+
If you now go to `http://localhost:8080/` and open the console, you should see `Hello Test Development!`. As you make changes, you will simply need to reload the `index.html` page to see them.
93+
94+
5. Once you have finished testing, you can build the library. Just close the `webpack-dev-server` and run
10395

104-
5. Once you have test it, you can build the library. Just close the `webpack-dev-server` and run
10596
```bash
10697
npm run build
10798
```
10899

109-
That should output something very similar to the `webpack-dev-server` but you'll notice that at the end is this line:
100+
That should output something very similar to the `webpack-dev-server` from step 3 but you'll notice at the end is this line:
110101
111102
```bash
112103
> webpack --config webpack.prod.babel.js
113104
> Done in 15.13s.
114105
```
115106
116-
Which means the library was successfully built and minified.
107+
If you see this, it means the library was successfully built and minified.
108+
117109
118-
6. (OPTIONAL) Commit your changes. We are using [commitizen](https://github.com/commitizen/cz-cli) to commit changes. Commitizen is a tool that allows you to specify commit in a more precise way. You can run it instead of your regular `git commit -m 'msg'` with:
110+
6. (OPTIONAL) Commit your changes. We are using [Commitizen](https://github.com/commitizen/cz-cli) to commit changes. Commitizen is a tool that allows you to specify commits in a more precise way. You can run it instead of your regular `git commit -m 'msg'` with:
119111
120112
```bash
121113
npm run commit
122114
```
123115
124-
That will show you an interactive prompt to commit:
116+
That will show you an interactive prompt to commit:
125117
```bash
126118
? Select the type of change that you're committing: (Use arrow keys)
127119
❯ feat: A new feature
@@ -135,7 +127,7 @@ Create a new folder called `/experiments` in the project's root folder. Create a
135127

136128
Just be sure to add files before running commitizen!
137129

138-
7. Push your code and make a Pull Request!
130+
7. (OPTIONAL) Push your code and submit a Pull Request!
139131

140132
## Running Unit Tests
141133

0 commit comments

Comments
 (0)