Difference between revisions of "DPS909 & OSD600 Winter 2017 - Lab 2"

From CDOT Wiki
Jump to: navigation, search
(3. Contributing fixes to package.json files)
Line 37: Line 37:
 
For our first contribution to an open source project, we're going to go looking for ways we can help existing node.js based projects do a better job with their <code>package.json</code> files.  This could involve a number of things:
 
For our first contribution to an open source project, we're going to go looking for ways we can help existing node.js based projects do a better job with their <code>package.json</code> files.  This could involve a number of things:
 
* correcting errors generated by http://package-json-validator.com/ for a <code>package.json</code> file
 
* correcting errors generated by http://package-json-validator.com/ for a <code>package.json</code> file
* adding missing optional fields to a <code>package.json</code> file
+
* adding missing optional fields to a <code>package.json</code> file, for example: <code>keywords</code>
  
Before we can fix any issues with existing <code>package.json</code> files, we have to find some!  Our first task is to locate 1 module with an issue per student:
+
Before we can fix any issues with existing <code>package.json</code> files, we have to find some!  Our first task is to locate 1 module with an issue per student.  '''Please do not fix a bug until we have found a bug for everyone'''.
 +
 
 +
Here are some queries to get you started.  Also look at the '''Dependencies''' and '''Dependents''' lists for any module you examine on npmjs.  When you find a module that is missing <code>keywords</code> or has some other issue, add it below, making sure to copy the style I have begun on row 1.  Also, be careful not to add duplicates:
 +
 
 +
* [https://www.npmjs.com/browse/star most starred packages on npmjs]
 +
* [https://www.npmjs.com/browse/depended most depended-upon packages on npmjs]
 +
* [https://www.google.ca/search?hl=en&as_q=&as_epq=inurl%3Apackage+json&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=github.com&as_occt=any&safe=images&as_filetype=pdf&as_rights=#hl=en&as_qdr=all&q=%22inurl:package.json%22+site:github.com+filetype:json Google query of package.json files on github.com]
 +
 
 +
To get you started, I've already found and fixed one, and also listed a couple of others I noticed in 5 minutes of searching on npmjs and Github.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 46: Line 54:
 
! Assigned Student
 
! Assigned Student
 
! Pull Request URL
 
! Pull Request URL
 +
! Blog Post URL
 
|-
 
|-
 
| 1
 
| 1
Line 51: Line 60:
 
| [https://github.com/humphd humphd]
 
| [https://github.com/humphd humphd]
 
| https://github.com/request/request/pull/2514
 
| https://github.com/request/request/pull/2514
 +
|
 
|-
 
|-
 
| 2
 
| 2
Line 56: Line 66:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|-
 
|-
 
| 3
 
| 3
 
| [https://www.npmjs.com/package/dat-next dat-next]
 
| [https://www.npmjs.com/package/dat-next dat-next]
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 66: Line 78:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|-
 
|-
 
| 5
 
| 5
Line 71: Line 84:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|-
 
|-
 
| 6
 
| 6
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
 
| 7
 
| 7
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 84: Line 100:
 
| 8
 
| 8
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 90: Line 107:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 95: Line 113:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 100: Line 119:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 105: Line 125:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 110: Line 131:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 115: Line 137:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 120: Line 143:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 125: Line 149:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 130: Line 155:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 135: Line 161:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 140: Line 167:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 145: Line 173:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 150: Line 179:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 155: Line 185:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 160: Line 191:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
 
| 24
 
| 24
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
 
|-
 
|-
 
| 25
 
| 25
 +
|
 
|  
 
|  
 
|  
 
|  
Line 173: Line 207:
 
|-
 
|-
 
| 26
 
| 26
 +
|
 
|  
 
|  
 
|  
 
|  
Line 179: Line 214:
 
| 27
 
| 27
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 184: Line 220:
 
| 28
 
| 28
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 189: Line 226:
 
| 29
 
| 29
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 194: Line 232:
 
| 30
 
| 30
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 199: Line 238:
 
| 31
 
| 31
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 205: Line 245:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 210: Line 251:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 215: Line 257:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
Line 220: Line 263:
 
|  
 
|  
 
|  
 
|  
 +
|
 
|  
 
|  
 
|-
 
|-
 
| 36
 
| 36
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 229: Line 274:
 
| 37
 
| 37
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 234: Line 280:
 
| 38
 
| 38
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
Line 239: Line 286:
 
| 39
 
| 39
 
|  
 
|  
 +
|
 
|  
 
|  
 
|  
 
|  
 
|}
 
|}
  
[https://www.google.ca/search?hl=en&as_q=&as_epq=inurl%3Apackage+json&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=github.com&as_occt=any&safe=images&as_filetype=pdf&as_rights=#hl=en&as_qdr=all&q=%22inurl:package.json%22+site:github.com+filetype:json list of package.json files on github.com]
 
  
  

Revision as of 14:46, 18 January 2017

Contributing to an Open Source Project on Github

In this lab you will contribute a fix to an open source project on Github. Successfully completing this lab will require you to have first worked through, and understood, this week's git walkthroughs. If you have not already done so, please setup git and Github as described in the following:

1. Install node.js

We will be contributing to projects that use node.js, its package manager npm, and the npmjs module registry. In order to complete this lab, you will need to install node.js, which you can download here.

2. Understanding package.json

Node uses a special file named package.json to specify metadata about a module. You can read a complete description of package.json at https://docs.npmjs.com/files/package.json.

A package.json file has to be valid JSON, and must include a few fields. However, many of the fields are optional. Let's look at some examples from popular node.js open source projects:

These package.json files have common elements, such as:

There are also some optional fields you can include, for example:

The metadata in package.json is used by the command-line tool npm as well as by the online registry https://www.npmjs.com/. Providing good data for these tools makes it easier for developers to find and use node modules.

3. Contributing fixes to package.json files

For our first contribution to an open source project, we're going to go looking for ways we can help existing node.js based projects do a better job with their package.json files. This could involve a number of things:

Before we can fix any issues with existing package.json files, we have to find some! Our first task is to locate 1 module with an issue per student. Please do not fix a bug until we have found a bug for everyone.

Here are some queries to get you started. Also look at the Dependencies and Dependents lists for any module you examine on npmjs. When you find a module that is missing keywords or has some other issue, add it below, making sure to copy the style I have begun on row 1. Also, be careful not to add duplicates:

To get you started, I've already found and fixed one, and also listed a couple of others I noticed in 5 minutes of searching on npmjs and Github.

# NPMJS Module Assigned Student Pull Request URL Blog Post URL
1 request humphd https://github.com/request/request/pull/2514
2 gulp-util
3 dat-next
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39


...

Submission

You will have completed your lab when you have done the following:

  • Create a Pull Request to a project fixing some problem or omission in their package.json file
  • Write a blog post about the process you took to complete this Pull Request, and about what happened next. Was it accepted? How long did it take? What did they say?
  • Write about your feelings contributing to your first open source project. What went well? What was hard? What surprised you?

You should complete Lab 2 before the start of week 3.