Skip to content

Commit

Permalink
feat: adds lesson_07 homework and lesson_08 pre-work (#262)
Browse files Browse the repository at this point in the history
* feat: adds lesson_07 homework app

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

* fix: calculates pivot index correctly

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

* chore: add build checks

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

* docs: add lesson_08 functions

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

* docs: updating for typescript language

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

* feat: adds homework details

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

* chore: adds a fix script

---------

Signed-off-by: Anthony D. Mays <[email protected]>
  • Loading branch information
anthonydmays authored Oct 9, 2024
1 parent 7cf731a commit 70dccf2
Show file tree
Hide file tree
Showing 18 changed files with 6,116 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"ms-dotnettools.csdevkit",
"ritwickdey.LiveServer",
"mechatroner.rainbow-csv",
"alexcvzz.vscode-sqlite"
"alexcvzz.vscode-sqlite",
"Orta.vscode-jest",
"firsttris.vscode-jest-runner"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/check_lesson_07_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Lesson 07 Pull Request

on:
pull_request:
branches: [ "main" ]
paths:
- "lesson_07/conditionals/**"

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 Shared Lib with Node.js
working-directory: ./lib/typescript/codedifferently-instructional
run: npm ci

- name: Build Lesson 07 with Node.js
working-directory: ./lesson_07/conditionals
run: |
npm ci
npm run check
6 changes: 6 additions & 0 deletions .github/workflows/check_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ jobs:
npm ci
npm run compile
- name: Build Lesson 07 with Node.js
working-directory: ./lesson_07/conditionals
run: |
npm ci
npm run compile
10 changes: 9 additions & 1 deletion lesson_07/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ Please review the following resources before lecture:

## Homework

TODO(anthonydmays): Finish this
- [ ] Complete [Conditionals and Loops](#conditionals-and-loops) exercise.
- [ ] Do pre-work for [lesson 08](/lesson_08/).

## Conditionals and Loops

This exercise will provide you ample opportunities to practice your understanding of conditional expressions and loops. To complete this assignment, implement the functions in [lesson7.ts][lesson7-file], ensure the tests pass, and submit a PR. Remember to use the [Conventional Commits][conventional-commits] spec for your commit messages and pull requests.

[lesson7-file]: ./conditionals/src/lesson7.ts
[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/
8 changes: 8 additions & 0 deletions lesson_07/conditionals/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
1 change: 1 addition & 0 deletions lesson_07/conditionals/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
3 changes: 3 additions & 0 deletions lesson_07/conditionals/.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_07/conditionals/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
15 changes: 15 additions & 0 deletions lesson_07/conditionals/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// @ts-check

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
eslintConfigPrettier,
{
ignores: ["build"],
},
);
11 changes: 11 additions & 0 deletions lesson_07/conditionals/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest", { useESM: true }],
},
moduleNameMapper: {
"^(\\.\\.?\\/.+)\\.js$": "$1",
},
extensionsToTreatAsEsm: [".ts"],
};
Loading

0 comments on commit 70dccf2

Please sign in to comment.