Skip to content

Commit ca27460

Browse files
authored
Merge branch 'code-differently:main' into main
2 parents 933c415 + 34a55a0 commit ca27460

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+22237
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Check Lesson 06 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_06/expression/**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Build Shared Lib with Node.js
25+
working-directory: ./lib/javascript/codedifferently-instructional
26+
run: npm ci
27+
28+
- name: Build Lesson 06 with Node.js
29+
working-directory: ./lesson_06/expression
30+
run: |
31+
npm ci
32+
npm run check
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Check Lesson 06 Quiz Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_06/quiz/**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Build Shared Lib with Node.js
25+
working-directory: ./lib/javascript/codedifferently-instructional
26+
run: npm ci
27+
28+
- name: Build Lesson 06 Quiz with Node.js
29+
working-directory: ./lesson_06/quiz
30+
run: |
31+
npm ci
32+
npm run check

.github/workflows/check_push.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- "lib/**"
99
- "lesson_02/quiz/**"
1010
- "lesson_03/quiz/**"
11+
- "lesson_06/quiz/**"
12+
- "lesson_06/expression/**"
1113
jobs:
1214
build:
1315
runs-on: ubuntu-latest
@@ -71,3 +73,16 @@ jobs:
7173
npm ci
7274
npm run compile
7375
npm run lint
76+
77+
- name: Build Lesson 06 Quiz with Node.js
78+
working-directory: ./lesson_06/quiz
79+
run: |
80+
npm ci
81+
npm run compile
82+
npm run lint
83+
84+
- name: Build Lesson 06 Expression with Node.js
85+
working-directory: ./lesson_06/expression
86+
run: |
87+
npm ci
88+
npm run compile

lesson_06/README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,36 @@ Please review the following resources before lecture:
88

99
## Homework
1010

11-
- TODO(anthonydmays): Add details
11+
- [ ] Complete the [Expression Calculator](#expression-calculator) exercise.
12+
- [ ] Read article entitled [3 Questions That Will Make You A Phenomenal Rubber Duck][article-link]
13+
- [ ] Do pre-work for [lesson 07](/lesson_07/).
14+
15+
### Expression Calculator
16+
17+
For this assignment, you will need to implement the functions and logic required to calculate a mathematical expression. After implementing the `add`, `divide`, and `multiply` functions, you will combine these functions to compute the final result.
18+
19+
1. Update the [.env.test][env-file] file to configure the correct homework version.
20+
```bash
21+
# Example config for students assigned to homework "D".
22+
HW_VERSION=D
23+
```
24+
2. Run the program to determine the expression you must implement.
25+
```bash
26+
npm install
27+
npm run compile
28+
npm start
29+
```
30+
1. Update the code in the [expression_calculator.ts][calculator-file] file.
31+
2. To check your work, you can run the application using the first command below and run the tests using the second one.
32+
```bash
33+
npm start
34+
```
35+
1. As usual, make sure that you format your code and run the check command before creating your pull request.
36+
```bash
37+
npm run check
38+
```
39+
1. You must only submit changes to the `expression_calculator.ts` file to receive full credit.
40+
41+
[article-link]: https://blog.danslimmon.com/2024/01/18/3-questions-that-will-make-you-a-phenomenal-rubber-duck/
42+
[calculator-file]: ./expression/src/expression_calculator.ts
43+
[env-file]: ./expression/.env.test

lesson_06/expression/.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true

lesson_06/expression/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HW_VERSION=your assigned version here

lesson_06/expression/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

lesson_06/expression/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

lesson_06/expression/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

lesson_06/expression/eslint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @ts-check
2+
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import eslintConfigPrettier from "eslint-config-prettier";
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.strict,
10+
...tseslint.configs.stylistic,
11+
eslintConfigPrettier,
12+
{
13+
ignores: ["build"],
14+
},
15+
);

0 commit comments

Comments
 (0)