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
First, clone a copy of the main jQuery git repo by running:
43
43
44
-
`git clone git://github.com/jquery/jquery.git`
44
+
```bash
45
+
git clone git://github.com/jquery/jquery.git
46
+
```
45
47
46
48
Enter the directory and install the node dependencies:
47
49
48
-
`cd jquery && npm install`
50
+
```bash
51
+
cd jquery && npm install
52
+
```
49
53
50
54
51
55
Make sure you have `grunt` installed by testing:
52
56
53
-
`grunt -version`
57
+
```bash
58
+
grunt -version
59
+
```
54
60
55
61
56
62
57
63
Then, to get a complete, minified (w/ Uglify.js), linted (w/ JSHint) version of jQuery, type the following:
58
64
59
-
`grunt`
65
+
```bash
66
+
grunt
67
+
```
60
68
61
69
62
70
The built version of jQuery will be put in the `dist/` subdirectory.
@@ -75,21 +83,27 @@ To create a custom build, use the following special `grunt` commands:
75
83
76
84
Exclude `dimensions`:
77
85
78
-
`grunt build:*:*:-dimensions`
86
+
```bash
87
+
grunt build:*:*:-dimensions
88
+
```
79
89
80
90
Exclude `effects`:
81
91
82
-
`grunt build:*:*:-effects`
92
+
```bash
93
+
grunt build:*:*:-effects
94
+
```
83
95
84
96
Exclude `offset`:
85
97
86
-
`grunt build:*:*:-offset`
87
-
98
+
```bash
99
+
grunt build:*:*:-offset
100
+
```
88
101
89
102
Exclude **all** optional modules:
90
103
91
-
`grunt build:*:*:-dimensions:-effects:-offset`
92
-
104
+
```bash
105
+
grunt build:*:*:-dimensions:-effects:-offset
106
+
```
93
107
94
108
95
109
@@ -99,8 +113,9 @@ Running the Unit Tests
99
113
100
114
Start grunt to auto-build jQuery as you work:
101
115
102
-
`cd jquery && grunt watch`
103
-
116
+
```bash
117
+
cd jquery && grunt watch
118
+
```
104
119
105
120
106
121
Run the unit tests with a local server that supports PHP. No database is required. Pre-configured php local servers are available for Windows and Mac. Here are some options:
@@ -118,14 +133,14 @@ Building to a different directory
118
133
119
134
If you want to build jQuery to a directory that is different from the default location:
120
135
121
-
`grunt && grunt dist:/path/to/special/location/`
122
-
136
+
```bash
137
+
grunt && grunt dist:/path/to/special/location/
138
+
```
123
139
With this example, the output files would be:
124
140
125
141
```bash
126
142
/path/to/special/location/jquery.js
127
143
/path/to/special/location/jquery.min.js
128
-
129
144
```
130
145
131
146
If you want to add a permanent copy destination, create a file in `dist/` called ".destination.json". Inside the file, paste and customize the following:
@@ -135,7 +150,6 @@ If you want to add a permanent copy destination, create a file in `dist/` called
135
150
{
136
151
"/Absolute/path/to/other/destination": true
137
152
}
138
-
139
153
```
140
154
141
155
@@ -148,8 +162,9 @@ Updating Submodules
148
162
149
163
Update the submodules to what is probably the latest upstream code.
150
164
151
-
`grunt submodules`
152
-
165
+
```bash
166
+
grunt submodules
167
+
```
153
168
154
169
Note: This task will also be run any time the default `grunt` command is used.
155
170
@@ -167,46 +182,61 @@ be able to work with them manually.
167
182
168
183
Following are the steps to manually get the submodules:
If you want to work inside a submodule, it is possible, but first you need to checkout a branch:
184
205
185
-
1.`cd src/sizzle`
186
-
2.`git checkout master`
206
+
```bash
207
+
cd src/sizzle
208
+
git checkout master
209
+
```
187
210
188
211
After you've committed your changes to the submodule, you'll update the jquery project to point to the new commit,
189
212
but remember to push the submodule changes before pushing the new jquery commit:
190
213
191
-
1.`cd src/sizzle`
192
-
2.`git push origin master`
193
-
3.`cd ..`
194
-
4.`git add src/sizzle`
195
-
5.`git commit`
214
+
```bash
215
+
cd src/sizzle
216
+
git push origin master
217
+
cd ..
218
+
git add src/sizzle
219
+
git commit
220
+
```
196
221
197
222
198
223
### cleaning ###
199
224
200
225
If you want to purge your working directory back to the status of upstream, following commands can be used (remember everything you've worked on is gone after these):
201
226
202
-
1.`git reset --hard upstream/master`
203
-
2.`git clean -fdx`
227
+
```bash
228
+
git reset --hard upstream/master
229
+
git clean -fdx
230
+
```
204
231
205
232
### rebasing ###
206
233
207
234
For feature/topic branches, you should always used the `--rebase` flag to `git pull`, or if you are usually handling many temporary "to be in a github pull request" branches, run following to automate this:
208
235
209
-
*`git config branch.autosetuprebase local` (see `man git-config` for more information)
236
+
```bash
237
+
git config branch.autosetuprebase local
238
+
```
239
+
(see `man git-config` for more information)
210
240
211
241
### handling merge conflicts ###
212
242
@@ -229,51 +259,91 @@ Following are some commands that can be used there:
229
259
230
260
### Test methods ###
231
261
232
-
expect( numAssertions );
233
-
stop();
234
-
start();
235
-
note: QUnit's eventual addition of an argument to stop/start is ignored in this test suite
236
-
so that start and stop can be passed as callbacks without worrying about their parameters
262
+
```js
263
+
expect( numAssertions );
264
+
stop();
265
+
start();
266
+
```
267
+
268
+
269
+
note: QUnit's eventual addition of an argument to stop/start is ignored in this test suite so that start and stop can be passed as callbacks without worrying about their parameters
237
270
238
271
### Test assertions ###
239
272
240
-
ok( value, [message] );
241
-
equal( actual, expected, [message] );
242
-
notEqual( actual, expected, [message] );
243
-
deepEqual( actual, expected, [message] );
244
-
notDeepEqual( actual, expected, [message] );
245
-
strictEqual( actual, expected, [message] );
246
-
notStrictEqual( actual, expected, [message] );
247
-
raises( block, [expected], [message] );
273
+
274
+
```js
275
+
ok( value, [message] );
276
+
equal( actual, expected, [message] );
277
+
notEqual( actual, expected, [message] );
278
+
deepEqual( actual, expected, [message] );
279
+
notDeepEqual( actual, expected, [message] );
280
+
strictEqual( actual, expected, [message] );
281
+
notStrictEqual( actual, expected, [message] );
282
+
raises( block, [expected], [message] );
283
+
```
284
+
248
285
249
286
Test Suite Convenience Methods Reference (See [test/data/testinit.js](https://github.com/jquery/jquery/blob/master/test/data/testinit.js))
250
287
------------------------------
251
288
252
289
### Returns an array of elements with the given IDs ###
0 commit comments