Skip to content

Commit 5c73b2d

Browse files
authored
Merge pull request #3 from coderoad/feature/upgrade-build
Feature/upgrade build
2 parents 4078071 + 5915897 commit 5c73b2d

File tree

3 files changed

+339
-307
lines changed

3 files changed

+339
-307
lines changed

‎CODEROAD.md renamed to ‎TUTORIAL.md

+22-179
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
# Learn NPM package json
22

3-
> The Node Package Manager (NPM) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
4-
5-
```config
6-
config:
7-
testRunner:
8-
command: npm run programmatic-test
9-
path: coderoad
10-
actions:
11-
commits:
12-
- '55a9b6d'
13-
- 'd58d630'
14-
commands:
15-
- npm install
16-
repo:
17-
uri: https://github.com/coderoad/fcc-learn-npm
18-
branch: v0.3.0
19-
dependencies:
20-
- name: node
21-
version: >=10
22-
```
3+
The Node Package Manager (NPM) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
234

24-
## Intro
5+
## L1 Intro
256

267
> Introduction to the package.json
278
@@ -37,7 +18,7 @@ Most developers prefer to install packages local to each project to create a sep
3718
The `package.json` file is the center of any Node.js project or NPM package. It stores information about your project, similar to how the <head> section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; "name" and "version", but it’s good practice to provide additional information about your project that could be useful to future users or maintainers.
3819
If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges.
3920

40-
## Author
21+
## L2 Author
4122

4223
> Package.json author
4324
@@ -47,27 +28,12 @@ One of the most common pieces of information in this file is the `author` field.
4728
"author": "Jane Doe",
4829
```
4930

50-
### Step 1
51-
52-
```config
53-
setup:
54-
files:
55-
- package.json
56-
commits:
57-
- '5326ec8'
58-
commands:
59-
- npm install
60-
solution:
61-
files:
62-
- package.json
63-
commits:
64-
- '424cf66'
65-
```
31+
### L2S1
6632

6733
Add your name as the `author` of the project in the package.json file.
6834
**Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,).
6935

70-
## Description
36+
## L3 Description
7137

7238
> Package.json description
7339
@@ -82,26 +48,13 @@ Here's an example:
8248
"description": "A project that does something awesome",
8349
```
8450

85-
### Step 1
86-
87-
```config
88-
setup:
89-
files:
90-
- package.json
91-
commits:
92-
- '68ddb97'
93-
solution:
94-
files:
95-
- package.json
96-
commits:
97-
- '138ad0e'
98-
```
51+
### L3S1
9952

10053
Add a `description` to the package.json file of your project.
10154

10255
**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields.
10356

104-
## Keywords
57+
## L4 Keywords
10558

10659
> Package.json keywords
10760
@@ -115,26 +68,13 @@ Here's an example:
11568

11669
As you can see, this field is structured as an array of double-quoted strings.
11770

118-
### Step 1
119-
120-
```config
121-
setup:
122-
files:
123-
- package.json
124-
commits:
125-
- '2069439'
126-
solution:
127-
files:
128-
- package.json
129-
commits:
130-
- 'f2ed460'
131-
```
71+
### L4S1
13272

13373
Add an array of suitable strings to the `keywords` field in the package.json file of your project.
13474

13575
One of the keywords should be "freecodecamp".
13676

137-
## License
77+
## L5 License
13878

13979
> Package.json license
14080
@@ -146,24 +86,11 @@ Some common licenses for open source projects include MIT and BSD. License infor
14686
"license": "MIT",
14787
```
14888

149-
### Step 1
150-
151-
```config
152-
setup:
153-
files:
154-
- package.json
155-
commits:
156-
- 'f2229d1'
157-
solution:
158-
files:
159-
- package.json
160-
commits:
161-
- '9378267'
162-
```
89+
### L5S1
16390

16491
Fill the `license` field in the package.json file of your project as you find suitable.
16592

166-
## Version
93+
## L6 Version
16794

16895
> Package.json version
16996
@@ -173,24 +100,11 @@ A `version` is one of the required fields of your package.json file. This field
173100
"version": "1.2.0",
174101
```
175102

176-
### Step 1
177-
178-
```config
179-
setup:
180-
files:
181-
- package.json
182-
commits:
183-
- '60a4e7b'
184-
solution:
185-
files:
186-
- package.json
187-
commits:
188-
- 'f9f7f29'
189-
```
103+
### L6S1
190104

191105
Add a `version` to the package.json file of your project.
192106

193-
## External Packages
107+
## L7 External Packages
194108

195109
> Installing dependencies from NPM
196110
@@ -215,29 +129,13 @@ npm install express
215129

216130
Installed packages are created in a `node_modules` folder in your project. Avoid editing or changing the node_modules folder or its contents.
217131

218-
### Step 1
219-
220-
```config
221-
setup:
222-
files:
223-
- package.json
224-
commits:
225-
- 'e97c095'
226-
watchers:
227-
- package.json
228-
- node_modules/moment
229-
solution:
230-
files:
231-
- package.json
232-
commits:
233-
- '97af83a'
234-
```
132+
### L7S1
235133

236134
Install the "moment" package to the `dependencies` field of your package.json file by running the command line npm install.
237135

238136
**Note:** Moment is a handy library for working with time and dates.
239137

240-
## Semantic Versioning
138+
## L8 Semantic Versioning
241139

242140
> Versioning packages
243141
@@ -262,27 +160,11 @@ Using the NPM cli, a specific version of a package can be installed by specifyin
262160
npm install express@4.17.0
263161
```
264162

265-
### Step 1
266-
267-
```config
268-
setup:
269-
files:
270-
- package.json
271-
commits:
272-
- 'be03933'
273-
watchers:
274-
- package.json
275-
- node_modules/moment
276-
solution:
277-
files:
278-
- package.json
279-
commits:
280-
- 'ba77ae7'
281-
```
163+
### L8S1
282164

283165
In the dependencies section of your package.json file, change the `version` of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2
284166

285-
## Receive Patch Updates
167+
## L9 Receive Patch Updates
286168

287169
> Using `~` to recieve patches
288170
@@ -294,27 +176,14 @@ To allow an npm dependency to update to the latest PATCH version, you can prefix
294176
"package": "~1.3.8"
295177
```
296178

297-
### Step 1
298-
299-
```config
300-
setup:
301-
files:
302-
- package.json
303-
commits:
304-
- 'c4ff0f6'
305-
solution:
306-
files:
307-
- package.json
308-
commits:
309-
- 'cc1f2a5'
310-
```
179+
### L9S1
311180

312181
In the package.json file, your current rule for how npm may upgrade moment is to use a specific version (2.10.2). But now, you want to allow the latest 2.10.x version.
313182
Use the tilde (`~`) character to prefix the version of moment in your dependencies, and allow npm to update it to any new PATCH release.
314183

315184
**Note:** The version numbers themselves should not be changed.
316185

317-
## Receive Minor Updates
186+
## L10 Receive Minor Updates
318187

319188
> Using `^` to receive minor updates
320189
@@ -328,26 +197,13 @@ Your current version of moment should be "~2.10.2" which allows npm to install t
328197

329198
This would allow updates to any 1.x.x version of the package.
330199

331-
### Step 1
332-
333-
```config
334-
setup:
335-
files:
336-
- package.json
337-
commits:
338-
- 'fb75ecf'
339-
solution:
340-
files:
341-
- package.json
342-
commits:
343-
- 'd0e1a22'
344-
```
200+
### L10S1
345201

346202
Use the caret (`^`) to prefix the version of moment in your dependencies and allow npm to update it to any new MINOR release.
347203

348204
**Note:** The version numbers themselves should not be changed.
349205

350-
## Remove a Dependency
206+
## L11 Remove a Dependency
351207

352208
> Removing a dependency
353209
@@ -357,20 +213,7 @@ But what if you want to remove an external package that you no longer need? You
357213

358214
This same method applies to removing other fields in your package.json as well.
359215

360-
### Step 1
361-
362-
```config
363-
setup:
364-
files:
365-
- package.json
366-
commits:
367-
- 'da1e99e'
368-
solution:
369-
files:
370-
- package.json
371-
commits:
372-
- '796b176'
373-
```
216+
### L11S1
374217

375218
Remove the moment package from your dependencies.
376219

0 commit comments

Comments
 (0)