|
| 1 | +<a href="https://totaltypescript.com"><img src="https://res.cloudinary.com/total-typescript/image/upload/v1662641493/beginners-typescript-tutorial/github_2x_vxqai9.png" alt="beginner typescript tutorial" /></a> |
| 2 | + |
| 3 | +## Quickstart |
| 4 | + |
| 5 | +Clone this repo or [open in Gitpod](https://gitpod.io/#https://github.com/total-typescript/beginners-typescript). |
| 6 | + |
| 7 | +```sh |
| 8 | +# Installs all dependencies |
| 9 | +npm install |
| 10 | + |
| 11 | +# Starts the first exercise |
| 12 | +npm run exercise 01 |
| 13 | + |
| 14 | +# Runs linting and tests on the solution |
| 15 | +npm run solution 01 |
| 16 | +``` |
| 17 | + |
| 18 | +## Video Walkthrough |
| 19 | + |
| 20 | +I walked through the first few exercises on [VSCode's live stream](https://www.youtube.com/watch?v=p6dO9u0M7MQ)! The plan for these exercises is to develop them into a full workshop, and then bundle them into the full video course - [Total TypeScript](https://totaltypescript.com). |
| 21 | + |
| 22 | +## How to take the course |
| 23 | + |
| 24 | +You'll notice that the course is split into exercises. Each exercise is split into a `*.problem.ts` and a `*.solution.ts`. |
| 25 | + |
| 26 | +To take an exercise: |
| 27 | + |
| 28 | +1. Go into `*.problem.ts` |
| 29 | +2. Run `npm run exercise 01`, where `01` is the number of the exercise you're on. |
| 30 | + |
| 31 | +The `exercise` script will run TypeScript typechecks and a test suite on the exercise. |
| 32 | + |
| 33 | +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: |
| 34 | + |
| 35 | +1. Check out [TypeScript's docs](https://www.typescriptlang.org/docs/handbook/intro.html) |
| 36 | +2. Try to find something that looks relevant. |
| 37 | +3. Give it a go to see if it solves the problem. |
| 38 | + |
| 39 | +You'll know if you've succeeded because the tests will pass. |
| 40 | + |
| 41 | +**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! |
| 42 | + |
| 43 | +You can run `npm run solution 01` to run the tests and typechecking on the solution. |
| 44 | + |
| 45 | +## Acknowledgements |
| 46 | + |
| 47 | +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). |
| 48 | + |
| 49 | +## Reference |
| 50 | + |
| 51 | +### `npm run exercise 01` |
| 52 | + |
| 53 | +Alias: `npm run e 01` |
| 54 | + |
| 55 | +Run the corresponding `*.problem.ts` file. |
| 56 | + |
| 57 | +### `npm run solution 01` |
| 58 | + |
| 59 | +Alias: `npm run s 01` |
| 60 | + |
| 61 | +Run the corresponding `*.solution.ts` file. If there are multiple, it runs only the first one. |
0 commit comments