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
Copy file name to clipboardExpand all lines: docs/development.md
+71-1Lines changed: 71 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,23 @@
1
+
<!--
2
+
3
+
@license Apache-2.0
4
+
5
+
Copyright (c) 2018 The Stdlib Authors.
6
+
7
+
Licensed under the Apache License, Version 2.0 (the "License");
8
+
you may not use this file except in compliance with the License.
9
+
You may obtain a copy of the License at
10
+
11
+
http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+
Unless required by applicable law or agreed to in writing, software
14
+
distributed under the License is distributed on an "AS IS" BASIS,
15
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+
See the License for the specific language governing permissions and
17
+
limitations under the License.
18
+
19
+
-->
20
+
1
21
# Development
2
22
3
23
> Development guide for stdlib.
@@ -19,7 +39,7 @@ Developing and running stdlib **requires** the following prerequisites:
19
39
-[GNU bash][bash]: an sh-compatible shell
20
40
-[curl][curl], [wget][wget], or [fetch][fetch] (FreeBSD): utilities for downloading remote resources
21
41
-[Node.js][node-js]: JavaScript runtime (version `>= 0.10`; although the latest stable version is **strongly** recommended)
22
-
-[npm][npm]: package manager (version `> 2.7.0`; if Node `< 1.0.0`, version `> 2.7.0` and `< 4.0.0`)
42
+
-[npm][npm]: package manager (version `> 2.7.0`; if Node `< 1.0.0`, version `> 2.7.0` and `< 4.0.0`; if Node `< 6.0.0`, version `> 2.7.0` and `< 6.0.0`)
23
43
24
44
While not required to run stdlib, the following dependencies **may** be required for testing, benchmarking, and general development:
25
45
@@ -54,24 +74,32 @@ The following external libraries can be automatically downloaded and compiled fr
54
74
55
75
To acquire the source code, first navigate to the parent directory into which you want to place the project git repository. Because of this project's heavy reliance on [GNU make][make], the directory path should **not** include spaces or any other shell meta characters such as `$` or `:`, as these characters will cause [GNU make][make] and the installation process to fail.
where `<username>` is your GitHub username (assuming you are using GitHub to manage public repositories). The repository has a large commit history, leading to slow download times. If you are not interested in code archeology, you can reduce the download time by limiting the clone [depth][git-clone-depth].
Once you have finished cloning the repository into the destination directory, you should see the folder `stdlib`. To proceed with configuring your environment, navigate to the project folder.
88
118
119
+
<!-- run-disable -->
120
+
89
121
```bash
90
122
$ cd stdlib
91
123
```
@@ -94,6 +126,8 @@ $ cd stdlib
94
126
95
127
Determine the absolute path of the `lib/node_modules` directory within the repository. For example, from the repository directory
Once finished, you may need to reload the configuration file in existing shells. For example, in a bash shell,
109
143
144
+
<!-- run-disable -->
145
+
110
146
```bash
111
147
$ source~/.bash_profile
112
148
```
113
149
114
150
To verify that the [`NODE_PATH`][node-path] environment variable is properly set,
115
151
152
+
<!-- run-disable -->
153
+
116
154
```bash
117
155
$ echo$NODE_PATH
118
156
```
@@ -121,6 +159,8 @@ $ echo $NODE_PATH
121
159
122
160
To install external libraries (**optional**),
123
161
162
+
<!-- run-disable -->
163
+
124
164
```bash
125
165
$ make install-deps
126
166
```
@@ -129,24 +169,32 @@ While external library dependencies are not always required, installing these de
129
169
130
170
To install language dependencies (**optional**),
131
171
172
+
<!-- run-disable -->
173
+
132
174
```bash
133
175
$ make install-lang-deps
134
176
```
135
177
136
178
To install development dependencies (e.g., [Node.js][node-js] module dependencies),
137
179
180
+
<!-- run-disable -->
181
+
138
182
```bash
139
183
$ make install
140
184
```
141
185
142
186
To run dependency diagnostics,
143
187
188
+
<!-- run-disable -->
189
+
144
190
```bash
145
191
$ make deps-info
146
192
```
147
193
148
194
To initialize the development environment,
149
195
196
+
<!-- run-disable -->
197
+
150
198
```bash
151
199
$ make init
152
200
```
@@ -157,6 +205,8 @@ Initializing the development environment configures git hooks and other bells an
157
205
158
206
To verify your environment, run project tests.
159
207
208
+
<!-- run-disable -->
209
+
160
210
```bash
161
211
$ make test
162
212
$ make examples
@@ -169,12 +219,16 @@ Note that each of the previous commands may take considerable time (>30 minutes)
169
219
170
220
If you have previously downloaded stdlib using `git clone`, you can update an existing source tree from the base project directory using `git pull`.
171
221
222
+
<!-- run-disable -->
223
+
172
224
```bash
173
225
$ git pull
174
226
```
175
227
176
228
If you are working with a [forked][github-fork] repository and wish to [sync][github-fork-sync] your local repository with the [upstream][git-remotes] project (i.e., incorporate changes from the main project repository into your local repository), assuming you have [configured a remote][github-remote] which points to the upstream repository,
177
229
230
+
<!-- run-disable -->
231
+
178
232
```bash
179
233
$ git fetch upstream
180
234
$ git merge upstream/<branch>
@@ -205,6 +259,8 @@ workshops workshops
205
259
206
260
- Occasionally, new versions of external dependencies may cause conflicts with existing builds. Most of the time, running
207
261
262
+
<!-- run-disable -->
263
+
208
264
```bash
209
265
$ make clean
210
266
$ make install
@@ -220,18 +276,24 @@ workshops workshops
220
276
221
277
To run all project tests,
222
278
279
+
<!-- run-disable -->
280
+
223
281
```bash
224
282
$ make test
225
283
```
226
284
227
285
To run selecttests,
228
286
287
+
<!-- run-disable -->
288
+
229
289
```bash
230
290
$ make TESTS_FILTER=.*/<pattern>/.*test
231
291
```
232
292
233
293
where `<pattern>` is a pattern matching a particular path. For example, to test only base special math functions
234
294
295
+
<!-- run-disable -->
296
+
235
297
```bash
236
298
$ make TESTS_FILTER=.*/math/base/special/.*test
237
299
```
@@ -240,13 +302,17 @@ where the pattern `.*/math/base/special/.*` matches any test file whose absolute
240
302
241
303
To generate a test coverage report,
242
304
305
+
<!-- run-disable -->
306
+
243
307
```bash
244
308
$ make TESTS_FILTER=.*/<pattern>/.* test-cov
245
309
$ make view-cov
246
310
```
247
311
248
312
If you are developing a tool (i.e., code located in the `tools` directory), to run tools tests
249
313
314
+
<!-- run-disable -->
315
+
250
316
```bash
251
317
$ make TESTS_FILTER=.*/<pattern>/.* tools-test
252
318
$ make TESTS_FILTER=.*/<pattern>/.* tools-test-cov
@@ -255,12 +321,16 @@ $ make view-cov
255
321
256
322
Similarly, to run benchmarks
257
323
324
+
<!-- run-disable -->
325
+
258
326
```bash
259
327
$ make BENCHMARKS_FILTER=.*/<pattern>/.* benchmark
0 commit comments