2
2
3
3
## Code of Conduct
4
4
5
- The Code of Conduct explains the * bare minimum * behavior
6
- expectations the Node Foundation requires of its contributors.
7
- [ Please read it before participating. ] ( https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md )
5
+ Please read the
6
+ [ Code of Conduct ] ( https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md )
7
+ which explains the minimum behavior expectations for Node.js contributors.
8
8
9
9
## Issue Contributions
10
10
11
- When opening new issues or commenting on existing issues on this repository
12
- please make sure discussions are related to concrete technical issues with the
13
- Node.js software.
11
+ When opening issues or commenting on existing issues, please make sure
12
+ discussions are related to concrete technical issues with Node.js.
14
13
15
- For general help using Node.js, please file an issue at the
14
+ * For general help using Node.js, please file an issue at the
16
15
[ Node.js help repository] ( https://github.com/nodejs/help/issues ) .
17
16
18
- Discussion of non-technical topics including subjects like intellectual
19
- property, trademark, and high level project questions should move to the
20
- [ Technical Steering Committee (TSC)] ( https://github.com/nodejs/TSC/issues )
21
- instead.
17
+ * Discussion of non-technical topics (such as intellectual property and
18
+ trademark) should use the
19
+ [ Technical Steering Committee (TSC) repository] ( https://github.com/nodejs/TSC/issues ) .
22
20
23
21
## Code Contributions
24
22
25
- The Node.js project has an open governance model and welcomes new contributors.
26
- Individuals making significant and valuable contributions are made
27
- _ Collaborators_ and given commit-access to the project. See the
28
- [ GOVERNANCE.md] ( ./GOVERNANCE.md ) document for more information about how this
29
- works.
30
-
31
- This document will guide you through the contribution process.
23
+ This section will guide you through the contribution process.
32
24
33
25
### Step 1: Fork
34
26
35
- Fork the project [ on GitHub] ( https://github.com/nodejs/node ) and check out your
36
- copy locally.
27
+ Fork the project [ on GitHub] ( https://github.com/nodejs/node ) and clone your fork
28
+ locally.
37
29
38
30
``` text
39
31
$ git clone [email protected] :username/node.git
@@ -49,24 +41,18 @@ and built upon.
49
41
#### Dependencies
50
42
51
43
Node.js has several bundled dependencies in the * deps/* and the * tools/*
52
- directories that are not part of the project proper. Any changes to files
53
- in those directories or its subdirectories should be sent to their respective
54
- projects. Do not send a patch to Node.js. We cannot accept such patches.
44
+ directories that are not part of the project proper. Changes to files in those
45
+ directories should be sent to their respective projects. Do not send a patch to
46
+ Node.js. We cannot accept such patches.
55
47
56
48
In case of doubt, open an issue in the
57
49
[ issue tracker] ( https://github.com/nodejs/node/issues/ ) or contact one of the
58
50
[ project Collaborators] ( https://github.com/nodejs/node/#current-project-team-members ) .
59
- Especially do so if you plan to work on something big. Nothing is more
60
- frustrating than seeing your hard work go to waste because your vision
61
- does not align with the project team. (Node.js has two IRC channels:
51
+ Node.js has two IRC channels:
62
52
[ #Node.js] ( http://webchat.freenode.net/?channels=node.js ) for general help and
63
53
questions, and
64
54
[ #Node-dev] ( http://webchat.freenode.net/?channels=node-dev ) for development of
65
- Node.js core specifically).
66
-
67
- For instructions on updating the version of V8 included in the * deps/*
68
- directory, please refer to [ the Maintaining V8 in Node.js guide] ( https://github.com/nodejs/node/blob/master/doc/guides/maintaining-V8.md ) .
69
-
55
+ Node.js core specifically.
70
56
71
57
### Step 2: Branch
72
58
@@ -95,35 +81,37 @@ $ git add my/changed/files
95
81
$ git commit
96
82
```
97
83
98
- ### Commit guidelines
84
+ ### Commit message guidelines
99
85
100
- Writing good commit logs is important. A commit log should describe what
101
- changed and why. Follow these guidelines when writing one:
86
+ The commit message should describe what changed and why.
102
87
103
88
1 . The first line should:
104
89
- contain a short description of the change
105
90
- be 50 characters or less
106
91
- be entirely in lowercase with the exception of proper nouns, acronyms, and
107
92
the words that refer to code, like function/variable names
108
93
- be prefixed with the name of the changed subsystem and start with an
109
- imperative verb. Examples: "net: add localAddress and localPort
110
- to Socket", "src: fix typos in node_lttng_provider.h"
111
- - be meaningful; it is what other people see when they
112
- run ` git shortlog ` or ` git log --oneline ` .<br >
113
- Check the output of ` git log --oneline files/you/changed ` to find out
114
- what subsystem (or subsystems) your changes touch
94
+ imperative verb. Check the output of ` git log --oneline files/you/changed ` to
95
+ find out what subsystems your changes touch.
96
+
97
+ Examples:
98
+ - ` net: add localAddress and localPort to Socket `
99
+ - ` src: fix typos in node_lttng_provider.h `
100
+
101
+
115
102
2 . Keep the second line blank.
116
103
3 . Wrap all other lines at 72 columns.
117
- - If your patch fixes an open issue, you can add a reference to it at the end
118
- of the log. Use the ` Fixes: ` prefix and the full issue URL. For other references
119
- use ` Refs: ` . For example:
120
- ``` txt
121
- Fixes: https://github.com/nodejs/node/issues/1337
122
- Refs: http://eslint.org/docs/rules/space-in-parens.html
123
- Refs: https://github.com/nodejs/node/pull/3615
124
- ```
125
104
126
- A good commit log can look something like this:
105
+ 4 . If your patch fixes an open issue, you can add a reference to it at the end
106
+ of the log. Use the ` Fixes: ` prefix and the full issue URL. For other references
107
+ use ` Refs: ` .
108
+
109
+ Examples:
110
+ - ` Fixes: https://github.com/nodejs/node/issues/1337 `
111
+ - ` Refs: http://eslint.org/docs/rules/space-in-parens.html `
112
+ - ` Refs: https://github.com/nodejs/node/pull/3615 `
113
+
114
+ Sample complete commit message:
127
115
128
116
``` txt
129
117
subsystem: explain the commit in one line
@@ -143,7 +131,8 @@ Refs: http://eslint.org/docs/rules/space-in-parens.html
143
131
144
132
### Step 4: Rebase
145
133
146
- Use ` git rebase ` (not ` git merge ` ) to sync your work from time to time.
134
+ Use ` git rebase ` (not ` git merge ` ) to synchronize your work with the main
135
+ repository.
147
136
148
137
``` text
149
138
$ git fetch upstream
@@ -152,12 +141,12 @@ $ git rebase upstream/master
152
141
153
142
### Step 5: Test
154
143
155
- Bug fixes and features ** should come with tests** . Add your tests in the
156
- ` test/parallel/ ` directory. For guidance on how to write a test for the Node.js
157
- project, see this [ guide ] ( ./doc/guides/writing-tests.md ) . Looking at other tests
158
- to see how they should be structured can also help .
144
+ Bug fixes and features should come with tests. Read the
145
+ [ guide for writing tests in Node.js] ( ./doc/guides/writing-tests.md ) . Looking at
146
+ other tests to see how they should be structured can also help. Add your
147
+ tests in the ` test/parallel/ ` directory if you are unsure where to put them .
159
148
160
- To run the tests on Unix / macOS:
149
+ To run the tests (including code linting) on Unix / macOS:
161
150
162
151
``` text
163
152
$ ./configure && make -j4 test
@@ -174,28 +163,24 @@ Windows:
174
163
Make sure the linter does not report any issues and that all tests pass. Please
175
164
do not submit patches that fail either check.
176
165
177
- Running ` make test ` /` vcbuild test ` will run the linter as well unless one or
178
- more tests fail.
179
-
180
166
If you want to run the linter without running tests, use
181
167
` make lint ` /` vcbuild lint ` . It will run both JavaScript linting and
182
168
C++ linting.
183
169
184
- If you are updating tests and just want to run a single test to check it, you
185
- can use this syntax to run it exactly as the test harness would:
170
+ If you are updating tests and just want to run a single test to check it:
186
171
187
172
``` text
188
173
$ python tools/test.py -v --mode=release parallel/test-stream2-transform
189
174
```
190
175
191
- You can run tests directly with node:
176
+ You can usually run tests directly with node:
192
177
193
178
``` text
194
179
$ ./node ./test/parallel/test-stream2-transform.js
195
180
```
196
181
197
- Remember to recompile with ` make -j4 ` in between test runs if you change
198
- core modules .
182
+ Remember to recompile with ` make -j4 ` in between test runs if you change code in
183
+ the ` lib ` or ` src ` directories .
199
184
200
185
### Step 6: Push
201
186
@@ -208,7 +193,7 @@ Pull requests are usually reviewed within a few days.
208
193
### Step 7: Discuss and update
209
194
210
195
You will probably get feedback or requests for changes to your Pull Request.
211
- This is a big part of the submission process so don't be disheartened !
196
+ This is a big part of the submission process so don't be discouraged !
212
197
213
198
To make changes to an existing Pull Request, make the changes to your branch.
214
199
When you push that branch to your fork, GitHub will automatically update the
0 commit comments