Skip to content

Commit e897e13

Browse files
authored
Merge pull request #76 from dwyl/deploy-github-pages-issue-#51
Deploy GitHub pages issue #51
2 parents f6c999f + 81a7637 commit e897e13

File tree

5 files changed

+5056
-1300
lines changed

5 files changed

+5056
-1300
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ main ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ main ]
1111

1212
jobs:
1313
build:
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [14.x, 16.x, 18.x]
19+
node-version: [18.x, 20.x]
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:

README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
A **_step-by-step_ tutorial** showing you how to
66
build a **Todo List App _from scratch_** in **`JavaScript`**.
77

8-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dwyl/javascript-todo-list-tutorial/Node.js%20CI?style=flat-square)](https://github.com/dwyl/javascript-todo-list-tutorial/actions)
9-
[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/javascript-todo-list-tutorial/master.svg?style=flat-square)](https://codecov.io/github/dwyl/javascript-todo-list-tutorial?branch=master)
10-
[![Dependencies: None](https://img.shields.io/badge/dependencies-none-brightgreen.svg?style=flat-square)](https://github.com/dwyl/javascript-todo-list-tutorial/blob/master/package.json#L12 "Zero Dependencies")
8+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dwyl/javascript-todo-list-tutorial/ci.yml?label=build&style=flat-square&branch=main)](https://github.com/dwyl/javascript-todo-list-tutorial/actions)
9+
[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/javascript-todo-list-tutorial/main.svg?style=flat-square)](https://codecov.io/github/dwyl/javascript-todo-list-tutorial?branch=main)
10+
[![Dependencies: None](https://img.shields.io/badge/dependencies-none-brightgreen.svg?style=flat-square)](https://github.com/dwyl/javascript-todo-list-tutorial/blob/main/package.json#L12 "Zero Dependencies")
1111
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square)](https://github.com/dwyl/javascript-todo-list-tutorial/issues)
1212
[![HitCount](https://hits.dwyl.com/dwyl/todo-list-javascript-tutorial.svg)](https://hits.dwyl.com/dwyl/javascript-todo-list-tutorial)
13-
<!-- uncomment when service is working ... [![Inline docs](http://inch-ci.org/github/dwyl/javascript-todo-list-tutorial.svg?branch=master&style=flat-square)](http://inch-ci.org/github/dwyl/javascript-todo-list-tutorial) -->
13+
<!-- uncomment when service is working ... [![Inline docs](http://inch-ci.org/github/dwyl/javascript-todo-list-tutorial.svg?branch=main&style=flat-square)](http://inch-ci.org/github/dwyl/javascript-todo-list-tutorial) -->
1414

1515

16-
<a href="https://todomvc-app.herokuapp.com"
17-
alt="Try the Demo on Heroku!">
16+
<a href="https://dwyl.github.io/javascript-todo-list-tutorial/"
17+
alt="Try the Demo on GitHub Pages!">
1818
<img src="https://user-images.githubusercontent.com/194400/45237254-10d5e980-b2d6-11e8-8281-b95452bde519.gif"
1919
alt="Step one: learn JavaScript!">
2020
</a>
2121

2222
</div>
2323

24-
> Before you continue, try the demo: https://todomvc-app.herokuapp.com <br />
24+
> Before you continue, try the demo: https://dwyl.github.io/javascript-todo-list-tutorial/ <br />
2525
2626
> Add a few items to the list. Double-click/tap the item to edit it.
2727
Check-off your todos and navigate the footer to filter for Active/Completed.
@@ -72,7 +72,7 @@ into a "mini frontend framework" called "***elmish***".
7272
(_elmish is inspired by Elm but only meant for educational purposes!_)
7373

7474
The journey to creating **elmish** is captured in
75-
[**`elmish.md`**](https://github.com/dwyl/javascript-todo-list-tutorial/blob/master/elmish.md)
75+
[**`elmish.md`**](https://github.com/dwyl/javascript-todo-list-tutorial/blob/main/elmish.md)
7676
and fully documented code is in **`elmish.js`**.
7777
This means our Todo List App can be as concise
7878
and "declarative" as possible.
@@ -166,19 +166,19 @@ helper functions e.g: `mount`, `div`, `input` and `route`.
166166
You can _opt_ to _either_: <br />
167167

168168
**a)** read the `Elm`(_ish_) docs/tutorial
169-
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/master/elmish.md)
169+
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/main/elmish.md)
170170
***`before`*** building the Todo List App -
171171
this will give you both TDD practice
172172
and a deeper understanding of building a micro framework.
173173
i.e. "**_prospective_ learning**"<br />
174174

175175
**b)** refer the `Elm`(_ish_) docs/tutorial
176-
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/master/elmish.md)
176+
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/main/elmish.md)
177177
***`while`*** building the Todo List App when you "**_need_ to know**"
178178
how one of the helper functions works. i.e. "**_contextual_ learning**" <br />
179179

180180
**c)** **only _consult_** the `Elm`(_ish_) docs/tutorial
181-
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/master/elmish.md)
181+
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/main/elmish.md)
182182
***`if`*** you are "stuck" ***`while`*** building the Todo List App.
183183
i.e. "**_debug_ learning**" <br />
184184

@@ -201,13 +201,18 @@ If you are `new` to either of these tools,
201201
please see:
202202
[github.com/dwyl/**learn-tape**](https://github.com/dwyl/learn-tape)
203203
and
204-
[**front-end**-with-tape.md](https://github.com/dwyl/learn-tape/blob/master/front-end-with-tape.md)
204+
[**front-end**-with-tape.md](https://github.com/dwyl/learn-tape/blob/main/front-end-with-tape.md)
205205

206206
We will be using **JSDOC** for documentation.
207207
Please see [our tutorial](https://github.com/dwyl/learn-jsdoc) if this is new to you.
208208

209+
<br />
210+
209211
#### Create Files
210212

213+
Create a **`new`** directory e.g: `/todo-app`
214+
So that you can build the Todo List from scratch!
215+
211216
In your editor/terminal create the following files:
212217

213218
+ `test/todo-app.test.js`
@@ -241,7 +246,7 @@ if you have followed previous tutorials.
241246
> If anything is _unclear_ please revisit
242247
[https://github.com/dwyl/**learn-tape**](https://github.com/dwyl/learn-tape)
243248
and
244-
[**front-end**-with-tape.md](https://github.com/dwyl/learn-tape/blob/master/front-end-with-tape.md)
249+
[**front-end**-with-tape.md](https://github.com/dwyl/learn-tape/blob/main/front-end-with-tape.md)
245250

246251
If you attempt to run the test file: `node test/todo-app.test.js`
247252
you should see no output. <br />
@@ -274,7 +279,7 @@ has 3 keys:
274279

275280
> The TodoMVC Specification requires us to display a **`counter`**
276281
of the items in the Todo list:
277-
https://github.com/tastejs/todomvc/blob/master/app-spec.md#counter
282+
https://github.com/tastejs/todomvc/blob/main/app-spec.md#counter
278283

279284
![javascript-todo-list-count](https://user-images.githubusercontent.com/194400/73112092-e73a5400-3f04-11ea-90f6-d4ae541a129c.png)
280285

@@ -777,7 +782,7 @@ This is "_enough_" functionality to start _using_ the todo list (_ourselves_)
777782
and **UX-testing** it with _prospective_ "***users***".
778783

779784
If you followed through the "Elm(ish)" tutorial
780-
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/master/elmish.md)
785+
[`elmish.md`](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/main/elmish.md)
781786
you will have seen that we created a _sample_ `view` in the last few _tests_
782787
to "_exercise_" the DOM element creation functions.
783788
This means that we _already know_ how to build a `view` for our Todo List App!
@@ -1432,7 +1437,7 @@ people _using_ the app will interact with!
14321437
#### Requirements?
14331438

14341439
Take a look at this list of test output:
1435-
https://github.com/tastejs/todomvc/tree/master/tests#example-output
1440+
https://github.com/tastejs/todomvc/tree/main/tests#example-output
14361441

14371442
```
14381443
TodoMVC
@@ -1620,7 +1625,7 @@ however, in order to "listen" for the **`[Enter]`** key "event"
16201625

16211626
Thankfully, we touched upon this while building `Elm`(_ish_),
16221627
if you need a recap, see:
1623-
[**elmish.md#subscriptions-for-event-listeners**](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/master/elmish.md#subscriptions-for-event-listeners)
1628+
[**elmish.md#subscriptions-for-event-listeners**](https://github.com/dwyl/learn-elm-architecture-in-javascript/blob/main/elmish.md#subscriptions-for-event-listeners)
16241629

16251630
Try to make the "**2. New Todo**" batch of tests _pass_
16261631
by creating (_and exporting_) a **`subscriptions`** function
@@ -1940,7 +1945,7 @@ First let's review the TodoMVC "Editing" test assertions:
19401945
```
19411946

19421947
Further reading of the TodoMVC Spec:
1943-
https://github.com/tastejs/todomvc/blob/master/app-spec.md#item
1948+
https://github.com/tastejs/todomvc/blob/main/app-spec.md#item
19441949
reveals the following acceptance criteria:
19451950

19461951

@@ -2283,15 +2288,15 @@ which will handle the "double-click" event and set `model.editing`.
22832288
### 5.2 Double-Click item `<label>` to Edit
22842289

22852290
The TodoMVC ***spec*** for item
2286-
https://github.com/tastejs/todomvc/blob/master/app-spec.md#item
2291+
https://github.com/tastejs/todomvc/blob/main/app-spec.md#item
22872292
includes the line:
22882293

22892294
```sh
22902295
Double-clicking the <label> activates editing mode, by toggling the .editing class on its <li>
22912296
```
22922297

22932298
> _**Note**: the sample TodoMVC Browser Tests:
2294-
https://github.com/tastejs/todomvc/tree/master/tests#example-output
2299+
https://github.com/tastejs/todomvc/tree/main/tests#example-output
22952300
does **not** include a test-case for **double-clicking**.
22962301
We are going to add one below for "extra credit"._
22972302

@@ -3222,8 +3227,8 @@ please "star" the project on GitHub ⭐️ to show your appreciation
32223227
and share it with others in the community who might find it useful! Thanks! ✨
32233228

32243229
Consider sharing your creation with your friends
3225-
by deploying it to Heroku!
3226-
https://github.com/dwyl/learn-heroku
3230+
by deploying it to GitHub Pages!
3231+
https://github.com/dwyl/learn-github-pages
32273232

32283233

32293234
# Thanks for Learning with Us!

lib/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Zero Dependencies Node.js HTTP Server for running static on Heroku
1+
// Zero Dependencies Node.js HTTP Server for running static on localhost
22
var http = require('http');
33
var fs = require('fs');
44
var path = require('path');

0 commit comments

Comments
 (0)