Skip to content

Commit

Permalink
Upgraded to newest CLI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Dec 6, 2023
1 parent de16614 commit 3d610c2
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 39 deletions.
41 changes: 13 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,37 @@ Clone this repo or [open in Gitpod](https://gitpod.io/#https://github.com/total-
# Installs all dependencies
npm install

# Starts the first exercise
npm run exercise 01

# Runs linting and tests on the solution
npm run solution 01
# Asks you which exercise you'd like to run, and runs it
npm run exercise
```

## How to take the course

You'll notice that the course is split into modules. Each module is a group of related exercises.

Each exercise is split into a `*.problem.ts` and a `*.solution.ts`.
You'll notice that the course is split into exercises. Each exercise is split into a `*.problem` and a `*.solution`.

To take an exercise:

1. Go into `*.problem.ts`
2. Run `npm run exercise 01`, where `01` is the number of the exercise (not module) you're on.
1. Run `npm run exercise`
2. Choose which exercise you'd like to run.

The `exercise` script will run TypeScript typechecks and a test suite on the exercise.
This course encourages **active, exploratory learning**. In the video, I'll explain a problem, and **you'll be asked to try to find a solution**. To attempt a solution, you'll need to:

This course encourages **active, exploratory learning**. I'll present a problem, and **you'll be asked to try to find a solution**. To attempt a solution, you'll need to:

1. Check out [TypeScript's docs](https://www.typescriptlang.org/docs/handbook/intro.html)
2. Try to find something that looks relevant.
3. Give it a go to see if it solves the problem.
1. Check out [TypeScript's docs](https://www.typescriptlang.org/docs/handbook/intro.html).
1. Try to find something that looks relevant.
1. Give it a go to see if it solves the problem.

You'll know if you've succeeded because the tests will pass.

**If you succeed**, or **if you get stuck**, unpause the video and check out the `*.solution.ts`. You can see if your solution is better or worse than mine!

You can run `npm run solution 01` to run the tests and typechecking on the solution.
**If you succeed**, or **if you get stuck**, unpause the video and check out the `*.solution`. You can see if your solution is better or worse than mine!

## Acknowledgements

Say thanks to Matt on [Twitter](https://twitter.com/mattpocockuk) or by joining his [Discord](https://discord.gg/8S5ujhfTB3). Consider signing up to his [Total TypeScript course](https://totaltypescript.com).

## Reference

### `npm run exercise 01`

Alias: `npm run e 01`

Run the corresponding `*.problem.ts` file.

### `npm run solution 01`
### `pnpm run exercise`

Alias: `npm run s 01`
Alias: `pnpm run e`

Run the corresponding `*.solution.ts` file. If there are multiple, it runs only the first one.
Open a prompt for choosing which exercise you'd like to run.
91 changes: 82 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Matt Pocock <mattpocockvoice@gmail.com>",
"license": "GPL",
"devDependencies": {
"@total-typescript/exercise-cli": "^0.3.2",
"@total-typescript/exercise-cli": "^0.4.0",
"@types/node": "^18.6.5",
"@types/react": "^18.0.27",
"cross-fetch": "^3.1.5",
Expand Down Expand Up @@ -102,7 +102,23 @@
"e-34": "tt-cli run 34",
"s-34": "tt-cli run 34 --solution",
"e-29.2": "tt-cli run 29.2",
"s-29.2": "tt-cli run 29.2 --solution"
"s-29.2": "tt-cli run 29.2 --solution",
"e-00": "tt-cli run 00",
"s-00": "tt-cli run 00 --solution",
"e-04.5": "tt-cli run 04.5",
"s-04.5": "tt-cli run 04.5 --solution",
"e-06.5": "tt-cli run 06.5",
"s-06.5": "tt-cli run 06.5 --solution",
"e-11.1": "tt-cli run 11.1",
"s-11.1": "tt-cli run 11.1 --solution",
"e-11.2": "tt-cli run 11.2",
"s-11.2": "tt-cli run 11.2 --solution",
"e-14.5": "tt-cli run 14.5",
"s-14.5": "tt-cli run 14.5 --solution",
"e-14.6": "tt-cli run 14.6",
"s-14.6": "tt-cli run 14.6 --solution",
"e-16.5": "tt-cli run 16.5",
"s-16.5": "tt-cli run 16.5 --solution"
},
"dependencies": {
"ts-toolbelt": "^9.6.0"
Expand Down

0 comments on commit 3d610c2

Please sign in to comment.