Skip to content

Commit

Permalink
feat: adds lesson_10 homework and lesson_11 pre-work. (code-different…
Browse files Browse the repository at this point in the history
…ly#328)

* feat: adds initial app implementation

* feat: adds sample data

* chore: add csv-parser library

* feat: adds partially completed sample code

* chore: adds proper tests

* chore: adds assignment instructions

* chore: add github checks for lesson 10

* feat: adds lesson_11 prework

* fix: updating dependencies correctly

Signed-off-by: Anthony D. Mays <[email protected]>

---------

Signed-off-by: Anthony D. Mays <[email protected]>
  • Loading branch information
anthonydmays authored Oct 16, 2024
1 parent ff75e98 commit fc54da1
Show file tree
Hide file tree
Showing 33 changed files with 7,291 additions and 228 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check_lesson_10_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check Lesson 10 Pull Request

on:
pull_request:
branches: [ "main" ]
paths:
- "lesson_10/libraries/**"

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Build Lesson 10 with Node.js
working-directory: ./lesson_10/libraries
run: |
npm ci
npm run check
7 changes: 7 additions & 0 deletions .github/workflows/check_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "lesson_06/expression/**"
- "lesson_07/conditionals/**"
- "lesson_09/types/**"
- "lesson_10/libraries/**"

jobs:
build:
Expand Down Expand Up @@ -75,4 +76,10 @@ jobs:
working-directory: ./lesson_09/types
run: ./gradlew check

- name: Build Lesson 10 with Node.js
working-directory: ./lesson_10/libraries
run: |
npm ci
npm run compile
34 changes: 33 additions & 1 deletion lesson_10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,36 @@ Please review the following resources before lecture:

## Homework

TODO(anthonydmays): Complete this
- [ ] Complete [Loading the Media Collection](#loading-the-media-collection) assignment.
- [ ] Do pre-work for [lesson 11](/lesson_11/).

### Loading The Media Collection

For this assignment, you are tasked with writing code to load data from a set of CSV files.

* Use the example loader file at [libraries/src/loaders/anthony_mays_loader.ts][example-loader-file] to make your own unique copy of the loader.
* Implement the `loadMediaItems` method by loading the data from the [data/media_items.csv][media-items-file] file.

To try out the app with your loader, you can run the following command.

```bash
npm run compile
npm start -- --loader yourLoaderNameHere
```

Before submitting your work, be sure to run the tests.

```bash
npm run test
```

### Extra credit

For additional credit on this assignment, combine the credits with the media items you loaded by modifying the `loadData` method. You can test that you've loaded everything correctly by using this special command:

```bash
LOADER_NAME=yourLoaderNameHere npm run test
```

[example-loader-file]: ./libraries/src/loaders/anthony_mays_loader.ts
[media-items-file]: ./libraries/data/media_items.csv
9 changes: 9 additions & 0 deletions lesson_10/libraries/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
quote_type = single
1 change: 1 addition & 0 deletions lesson_10/libraries/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
3 changes: 3 additions & 0 deletions lesson_10/libraries/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
1 change: 1 addition & 0 deletions lesson_10/libraries/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
201 changes: 201 additions & 0 deletions lesson_10/libraries/data/credits.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
id,media_item_id,role,name
1,1,Director,John Doe
2,1,Producer,Jane Smith
3,2,Actor,Chris Evans
4,2,Actor,Scarlett Johansson
5,3,Writer,Mark Twain
6,3,Composer,Hans Zimmer
7,4,Director,Steven Spielberg
8,4,Producer,Kathleen Kennedy
9,5,Actor,Robert Downey Jr.
10,5,Actor,Chris Hemsworth
11,6,Writer,George R.R. Martin
12,6,Composer,John Williams
13,7,Director,Christopher Nolan
14,7,Producer,Emma Thomas
15,8,Actor,Leonardo DiCaprio
16,8,Actor,Brad Pitt
17,9,Writer,J.K. Rowling
18,9,Composer,Howard Shore
19,10,Director,Quentin Tarantino
20,10,Producer,Lawrence Bender
21,11,Actor,Tom Hanks
22,11,Actor,Robin Wright
23,12,Writer,Stephen King
24,12,Composer,Danny Elfman
25,13,Director,Martin Scorsese
26,13,Producer,Irwin Winkler
27,14,Actor,Matt Damon
28,14,Actor,Ben Affleck
29,15,Writer,Agatha Christie
30,15,Composer,Ennio Morricone
31,16,Director,James Cameron
32,16,Producer,Gale Anne Hurd
33,17,Actor,Will Smith
34,17,Actor,Tommy Lee Jones
35,18,Writer,Arthur Conan Doyle
36,18,Composer,James Horner
37,19,Director,Peter Jackson
38,19,Producer,Fran Walsh
39,20,Actor,Daniel Radcliffe
40,20,Actor,Emma Watson
41,21,Writer,Isaac Asimov
42,21,Composer,Alan Silvestri
43,22,Director,Tim Burton
44,22,Producer,Denise Di Novi
45,23,Actor,Johnny Depp
46,23,Actor,Helena Bonham Carter
47,24,Writer,Ray Bradbury
48,24,Composer,Michael Giacchino
49,25,Director,Alfred Hitchcock
50,25,Producer,David O. Selznick
51,26,Actor,Humphrey Bogart
52,26,Actor,Ingrid Bergman
53,27,Writer,Ernest Hemingway
54,27,Composer,Max Steiner
55,28,Director,Stanley Kubrick
56,28,Producer,Jan Harlan
57,29,Actor,Marlon Brando
58,29,Actor,Al Pacino
59,30,Writer,F. Scott Fitzgerald
60,30,Composer,Alexandre Desplat
61,31,Director,Francis Ford Coppola
62,31,Producer,Gray Frederickson
63,32,Actor,Clint Eastwood
64,32,Actor,Morgan Freeman
65,33,Writer,William Shakespeare
66,33,Composer,John Barry
67,34,Director,Ridley Scott
68,34,Producer,David Giler
69,35,Actor,Harrison Ford
70,35,Actor,Carrie Fisher
71,36,Writer,Charles Dickens
72,36,Composer,Elmer Bernstein
73,37,Director,David Fincher
74,37,Producer,Cean Chaffin
75,38,Actor,Edward Norton
76,38,Actor,Brad Pitt
77,39,Writer,Jane Austen
78,39,Composer,Thomas Newman
79,40,Director,Clint Eastwood
80,40,Producer,Robert Lorenz
81,41,Actor,Christian Bale
82,41,Actor,Heath Ledger
83,42,Writer,Leo Tolstoy
84,42,Composer,James Newton Howard
85,43,Director,George Lucas
86,43,Producer,Gary Kurtz
87,44,Actor,Mark Hamill
88,44,Actor,Harrison Ford
89,45,Writer,Victor Hugo
90,45,Composer,Patrick Doyle
91,46,Director,Michael Bay
92,46,Producer,Jerry Bruckheimer
93,47,Actor,Shia LaBeouf
94,47,Actor,Megan Fox
95,48,Writer,Edgar Allan Poe
96,48,Composer,John Ottman
97,49,Director,James Wan
98,49,Producer,Rob Cowan
99,50,Actor,Patrick Wilson
100,50,Actor,Vera Farmiga
101,51,Writer,H.G. Wells
102,51,Composer,Marco Beltrami
103,52,Director,Guillermo del Toro
104,52,Producer,J. Miles Dale
105,53,Actor,Sally Hawkins
106,53,Actor,Michael Shannon
107,54,Writer,George Orwell
108,54,Composer,Clint Mansell
109,55,Director,Denis Villeneuve
110,55,Producer,Andrew Kosove
111,56,Actor,Ryan Gosling
112,56,Actor,Harrison Ford
113,57,Writer,Philip K. Dick
114,57,Composer,Hans Zimmer
115,58,Director,Paul Thomas Anderson
116,58,Producer,JoAnne Sellar
117,59,Actor,Daniel Day-Lewis
118,59,Actor,Paul Dano
119,60,Writer,John Steinbeck
120,60,Composer,Jonny Greenwood
121,61,Director,David Lynch
122,61,Producer,Mark Frost
123,62,Actor,Kyle MacLachlan
124,62,Actor,Laura Dern
125,63,Writer,Franz Kafka
126,63,Composer,Angelo Badalamenti
127,64,Director,Joel Coen
128,64,Producer,Ethan Coen
129,65,Actor,Jeff Bridges
130,65,Actor,John Goodman
131,66,Writer,William Faulkner
132,66,Composer,Carter Burwell
133,67,Director,Spike Lee
134,67,Producer,Jon Kilik
135,68,Actor,Denzel Washington
136,68,Actor,Spike Lee
137,69,Writer,James Joyce
138,69,Composer,Terence Blanchard
139,70,Director,Woody Allen
140,70,Producer,Letty Aronson
141,71,Actor,Diane Keaton
142,71,Actor,Mia Farrow
143,72,Writer,Marcel Proust
144,72,Composer,Philip Glass
145,73,Director,Jean-Luc Godard
146,73,Producer,Georges de Beauregard
147,74,Actor,Jean-Paul Belmondo
148,74,Actor,Anna Karina
149,75,Writer,James Baldwin
150,75,Composer,Michel Legrand
151,76,Director,Akira Kurosawa
152,76,Producer,Sôjirô Motoki
153,77,Actor,Toshirô Mifune
154,77,Actor,Takashi Shimura
155,78,Writer,Yukio Mishima
156,78,Composer,Fumio Hayasaka
157,79,Director,Ingmar Bergman
158,79,Producer,Allan Ekelund
159,80,Actor,Max von Sydow
160,80,Actor,Liv Ullmann
161,81,Writer,Henrik Ibsen
162,81,Composer,Erik Nordgren
163,82,Director,Federico Fellini
164,82,Producer,Angelo Rizzoli
165,83,Actor,Marcello Mastroianni
166,83,Actor,Anita Ekberg
167,84,Writer,Italo Calvino
168,84,Composer,Nino Rota
169,85,Director,Roberto Rossellini
170,85,Producer,Salvo D'Angelo
171,86,Actor,Anna Magnani
172,86,Actor,Aldo Fabrizi
173,87,Writer,Umberto Eco
174,87,Composer,Ennio Morricone
175,88,Director,Michelangelo Antonioni
176,88,Producer,Carlo Ponti
177,89,Actor,Monica Vitti
178,89,Actor,Alain Delon
179,90,Writer,Giuseppe Tomasi di Lampedusa
180,90,Composer,Giovanni Fusco
181,91,Director,Luchino Visconti
182,91,Producer,Goffredo Lombardo
183,92,Actor,Burt Lancaster
184,92,Actor,Claudia Cardinale
185,93,Writer,Primo Levi
186,93,Composer,Franco Mannino
187,94,Director,Pier Paolo Pasolini
188,94,Producer,Alfredo Bini
189,95,Actor,Franco Citti
190,95,Actor,Silvana Mangano
191,96,Writer,Alberto Moravia
192,96,Composer,Carlo Rustichelli
193,97,Director,Sergio Leone
194,97,Producer,Claudio Mancini
195,98,Actor,Clint Eastwood
196,98,Actor,Lee Van Cleef
197,99,Writer,Giovanni Verga
198,99,Composer,Ennio Morricone
199,100,Director,Franco Zeffirelli
200,100,Producer,John Brabourne
Loading

0 comments on commit fc54da1

Please sign in to comment.