Skip to content

syncing fork repo #4

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
fae1963
1.3.2
nathwan2 Sep 17, 2019
83c9e2d
update
nathwan2 Sep 24, 2019
847df4b
update
nathwan2 Sep 24, 2019
6f04e7d
test
nathwan2 Sep 27, 2019
cae34b6
push
nathwan2 Oct 8, 2019
ece3438
oo
nathwan2 Oct 8, 2019
c8fcbf0
Merge pull request #1 from web/master
kenyonJ Oct 11, 2019
111e500
Updated Git Installation
aa7401 Oct 12, 2019
23eca50
Cleaned Up Files
aa7401 Oct 12, 2019
a43b857
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 12, 2019
9b23edb
Updated ESLint and JSDoc Exercise
aa7401 Oct 12, 2019
d1c17c9
Fixed Callback Code
aa7401 Oct 12, 2019
9629baa
Updated Lab Sheet
aa7401 Oct 12, 2019
c0aa4ed
Completed Lab Sheet
aa7401 Oct 12, 2019
63ea40e
grammatical change
charle44 Oct 12, 2019
54e75d8
Updated the Nested Callback Lab
aa7401 Oct 15, 2019
c3cc178
Added Promise Working Example
aa7401 Oct 15, 2019
a736124
bug fix
aa7401 Oct 15, 2019
cc11aad
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 15, 2019
6d5c6a9
Fixed Promise Bug
aa7401 Oct 15, 2019
edceed4
Modified the Modularity Exercise
aa7401 Oct 18, 2019
dd1f05f
Fixed Some Spelling Errors
aa7401 Oct 18, 2019
96e8e4b
Added More Exercises
aa7401 Oct 20, 2019
bbcc9ab
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 20, 2019
b385bb0
Removed Module Call
aa7401 Oct 22, 2019
93cc681
Added Code to Callback
aa7401 Oct 22, 2019
648ead1
added instructions for Win10 Users
aa7401 Oct 22, 2019
c035290
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 22, 2019
ba038cb
Added Component Notes
aa7401 Oct 23, 2019
8b1f989
fixed typo in 3.3
charle44 Oct 23, 2019
0e7ec41
typo ammendment
charle44 Oct 23, 2019
210ae92
Added Notes on Installing the Browser Preview
aa7401 Oct 25, 2019
48310c0
resolved Issue #25
bordasb Oct 25, 2019
fbf8869
Merge pull request #27 from charle44/patch-7
aa7401 Oct 26, 2019
59e3e7f
Merge pull request #26 from charle44/patch-6
aa7401 Oct 26, 2019
e12506b
Merge pull request #18 from charle44/patch-5
aa7401 Oct 26, 2019
afa4426
Merge pull request #19 from nathwan2/master
aa7401 Oct 26, 2019
fd08afd
Merge pull request #21 from kenyonJ/master
aa7401 Oct 26, 2019
a4ffe9c
Added Notes on Script Explorer
aa7401 Nov 2, 2019
c46de19
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Nov 2, 2019
ce57bbc
#28 mock-fs example created
bordasb Nov 4, 2019
b0d1c68
fixes done to file_system unit test
Nov 8, 2019
7cf77b6
trying to fix file_system unit test
Nov 8, 2019
5b4ac41
Removed Merge Conflict
aa7401 Nov 8, 2019
c4d788d
Replaced Module
aa7401 Nov 8, 2019
a98fdec
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Nov 8, 2019
54a02fa
Now we throw specific errors, not generic
harjaus Nov 8, 2019
a69a9c8
Added dependency
harjaus Nov 8, 2019
bc98b02
We no longer done.fail() on everything, we expect no errors on catch
harjaus Nov 8, 2019
6e14868
trying to fix mockfs exercise
Nov 8, 2019
5e5e55d
Now throws correct error on file not existing
harjaus Nov 8, 2019
39db18b
Reading mocking works
harjaus Nov 8, 2019
8102229
Now reads as binary
harjaus Nov 8, 2019
0b9b9e1
Now writes synchronously, fixes bug
harjaus Nov 8, 2019
39518ac
Now can mock writing to filesystem
harjaus Nov 8, 2019
213478a
Removed unnecessary files
harjaus Nov 8, 2019
0789e71
Merge branch 'fixingMockFS'
harjaus Nov 8, 2019
d4fc244
minor typo and semantic fixes
bordasb Nov 11, 2019
2cf6567
corrected the bracket notation example
bordasb Nov 12, 2019
9ff5136
fixed displayed directory tree
bordasb Nov 12, 2019
92f29a5
fixed displayed directory tree
bordasb Nov 12, 2019
7af1d8d
Added Notes on managing modules
aa7401 Nov 14, 2019
30c5f0b
improvements made to file_system mock-fs exercise
bordasb Nov 25, 2019
333dcb2
#28 create example to demonstrate saving file to mock-fs
bordasb Nov 25, 2019
d8ae634
#28 webserver handles incoming files
bordasb Nov 25, 2019
2940aab
Merge branch 'fixingMockFS'
bordasb Nov 25, 2019
b166a8c
Added New Materials
aa7401 Nov 29, 2019
502647f
Merge pull request #35 from web/iss034/explain-context
aa7401 Nov 29, 2019
9cc86d4
Added Manual Mock Example
aa7401 Jan 12, 2020
d43bfb8
removed unintentional inserted solutions by nathwan2 from 02/01/index…
bordasb Jan 25, 2020
2bc3e3d
added guide about npm install -production
bordasb Jan 25, 2020
e01b52b
fixed dependencies in package.json, added start script
bordasb Jan 25, 2020
a5d0506
removed npm-debug.log bloat file from root
bordasb Jan 25, 2020
5786574
removed unnecessarily pasted example code which came from 07 Unit Tes…
bordasb Jan 25, 2020
3bf1be1
added missing line
bordasb Jan 25, 2020
46cab3c
corrected lab code
aa7401 Jan 30, 2020
666baa5
merged corrected content
bordasb Feb 2, 2020
be072e1
solutions added for 02/01/index 1.3.2 TYU
bordasb Feb 2, 2020
034f604
fine tuned 02_HTTP.md, added solutions for 02_HTTP
bordasb Jun 26, 2020
77a9bdf
moved npm chapter to 01_Setup.md
bordasb Jul 1, 2020
f68c14c
updated and corrected the content in 03_HTML.md and exercises/03_HTML/
bordasb Jul 13, 2020
bac10be
solutions added for 03_html
bordasb Jul 14, 2020
c2c0cc9
fixed minor errors
bordasb Sep 14, 2020
e4321b0
fixed errors and added all solutions up to the end of 04_css
bordasb Sep 19, 2020
078678a
fixed errors and added all solutions up to the end of 05_javascript
bordasb Sep 29, 2020
059e611
fixed errors and added solutions for 06_code_quality
bordasb Oct 7, 2020
276525a
sample solutions and error fixes for 07_unit_testing
bordasb Oct 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"no-var": 2,
"prefer-arrow-callback": 1,
"prefer-const": 2,
"prefer-template": "error",
"quotes": [1, "single"],
"semi": [1, "never"],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ coverage/
docs/
sessions/
screenshots/*
out/

# sqlite databases
# *.db
Expand Down
60 changes: 60 additions & 0 deletions 01 Setup Win10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

# Setup for Windows 10 Users

The tools used in this module are designed to be used in a Unix or Linux environment. Whilst this will create challenges for Windows 10 user there are some steps you will need to take. Please read and follow the steps below carefully:

Install the Windows Subsystem for Linux (WSL). Open PowerShell as Administrator and run:

``` shell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```

Restart your computer when prompted.

Now install Visual Studio Code and once launched install the [remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) component by Microsoft. You should also install the [browser-preview](https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview) component which will allow you to open html web pages.

![remote-wsl](exercises/.images/remote-wsl.png)

Now you need to install Ubuntu. This can be found by searching for `run linux on windows` in the Microsoft Store. You will be presented with the following screen.

![Microsoft Store](exercises/.images/store.png)

Choose the Ubuntu operating system (v18.04 LTS) and install. Once installed, click on the **Launch** button, this will open a console window and you will need to wait for a few minutes for the installation to complete.

## Cloning the Forked Repository

You will now need to fork the foundation lab by clicking on the Fork button. This will create a copy of the repository. See the standard setup instructions for more details.

Now you can clone your forked repository by running the following command in the Ubuntu console, replacing xxx with the URL of your repository.

```shell
git clone xxx
```

This will create a directory called `foundation` in the Ubuntu console. The final step is to launch VS Code from within the WSL environment by running the following command:

```shell
code foundation
```

This will launch VS Code from within the WSL with the contents of the `foundation/` directory. If you open the integrated terminal (using the **Terminal** menu) you will see that you have the full ubuntu bash shell. You can now run all the remaining steps from this integrated terminal, just as you would for a standard Linux install.

## Installing NodeJS

These steps are identical to those used on a full Ubuntu installation. Start by installing the Node Version Manager (NVM) tool:

```shell
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm --version
nvm install node
```

If the `nvm` command is not found you will need to reload the shell:

```shell
source ~/.profile
```

Now try to install again.

Now you can go directly to step 4 in the standard setup instructions.
41 changes: 36 additions & 5 deletions 01 Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

In this worksheet you will learn how to configure your work environment using VS Code. You should start by installing **Visual Studio Code** (NOT VISUAL STUDIO!) from the [website](https://code.visualstudio.com), note that it might already be installed. If you are using a Coventry University computer and the software is not installed you can do this using AppsAnywhere.

If you are using Windows 10 you will also need to install [Git](https://git-scm.com/download/win), this may already be installed on a Coventry University computer.
If you are using Windows 10 you will also need to install [Git](https://git-scm.com/download/win), this may already be installed on a Coventry University computer. If you are on MacOS you may already have it installed as it comes with the XCode IDE but if you have recently updated your OS you may need to run the `xcode-select --install` command to update the **Xcode Command-line Tools** but if you don't want to install XCode you can install git using [HomeBrew](http://brew.sh/) using the `brew install git` command. If you are running Ubuntu you can install it using the `sudo apt install git` command.

DO NOT INSTALL THE GIT GUI TOOLS!

Visual Studio Code comes with an integrated **Terminal** that can be used instead of the standard _Command Prompt_ or _Terminal_. If you are using Linux or MacOS this will give you a Bash prompt however on Windows 10 it defaults to the _Command Prompt_ and will need to be changed to the _Bash Shell_.

Expand Down Expand Up @@ -139,14 +141,43 @@ $ node index.js

Now we have the server up and running so the final task is to view the web page using the web browser. Simply open the Chrome browser and navigate to localhost:8080 where you should see a message. If this works you are ready to start the lab exercises.

## 5 Pushing the Changes to GitHub
## 5 Using npm and its package.json

**Have a look at your `package.json` file and understand its contents**.
- When you are starting a new _project_, **you have to create this yourself**:

1. Use the `npm init` command to create the package.json file
- You can leave all the options default, just leave them empty and keep pressing enter
- Alternatively you can run `npm init --yes`, it will simply leave everything default
2. Install the dependencies for the first time using the `-S` _switch_ with `npm install`
- e.g.: `npm install -S koa koa-bodyparser`
- This would add something like this to the `package.json` file:
```json
"dependencies": {
"koa": "^2.11.0",
"koa-bodyparser": "^4.2.1"
}
```
- When you next run `npm install -S <package>`, the given package's _newest version_ will be simply added to the list, or in case of a new version for a _previously listed_ dependency, the _version number_ will be updated
- This `-S` is just a short version of the `--save` _switch_
- **You can use the alternative `--save-dev` switch to install and save them as _development dependencies_**
- Something that you wouldn't want to deploy, but is necessary for development
- E.g. we will use `jest` for testing, and `eslint` for linting during the development phase, but these shouldn't be required to be installed during deployment
- You are done with adding the dependencies, now simply use `npm install` to install all of them at once!
- If you don't want to install development dependencies, use `npm install --production`
3. This `package.json` file is also useful to store _scripts_:
- Look at the following line: ` "start": "nodemon index.js"`
- This lets us simply type `npm start` in the terminal to start our application via _nodemon_
- Nodemon is a great tool that restarts the application every time we save a file in the given folder, so we don't actually have to manually stop and restart it after every modification.

## 6 Pushing the Changes to GitHub

As you work through the lab activities two things are likely to happen:

1. You make changes to the code that you want to push to the forked copy of your repository.
2. You will need to pull any bug fixes from the original repository.

### 5.1 Configuring the Repository
### 6.1 Configuring the Repository

Before you start interacting with the GitHub server you need to configure the local repository. Open the Bash Shell and run the following commands:

Expand All @@ -157,7 +188,7 @@ git config user.email 'doej@coventry.ac.uk'

remember to replace the values with you own name and your university email (but without the uni part).

### 5.2 Pushing Changes
### 6.2 Pushing Changes

**NOTE: You only need to carry out this step when you have make changes to the code! This will normally need to take place each time you complete a "Test Your Understanding" section.**

Expand All @@ -175,7 +206,7 @@ Now you should click on the **Sync** icon (shown below) to push the new commit u

At this point you should be able to refresh your GitHub repository page to see the changes.

### 5.3 Pulling from Upstream
### 6.3 Pulling from Upstream

As new materials and resources are added to the original repository (and bugs fixed) you will want to merge these into your forked repository. Before you can do this you will need to add a link to the upstream repository. Open a bash shell:

Expand Down
Loading