|
4 | 4 |
|
5 | 5 | This Zod tutorial will give you everything you ever needed to know about [Zod](https://github.com/colinhacks/zod) - an amazing library for building type-safe AND runtime-safe applications.
|
6 | 6 |
|
7 |
| -## Quickstart |
8 |
| - |
9 | 7 | ```sh
|
10 | 8 | # Installs all dependencies
|
11 | 9 | npm install
|
12 | 10 |
|
13 |
| -# Starts the first exercise |
14 |
| -npm run exercise 01 |
15 |
| - |
16 |
| -# Runs linting and tests on the solution |
17 |
| -npm run solution 01 |
| 11 | +# Asks you which exercise you'd like to run, and runs it |
| 12 | +npm run exercise |
18 | 13 | ```
|
19 | 14 |
|
20 |
| -## How to take the tutorial |
| 15 | +## How to take the course |
21 | 16 |
|
22 |
| -You'll notice that the tutorial is split into exercises. Each exercise is split into a `*.problem.ts` and a `*.solution.ts`. |
| 17 | +You'll notice that the course is split into exercises. Each exercise is split into a `*.problem` and a `*.solution`. |
23 | 18 |
|
24 | 19 | To take an exercise:
|
25 | 20 |
|
26 |
| -1. Go into `*.problem.ts` |
27 |
| -2. Run `npm run exercise 01`, where `01` is the number of the exercise you're on. |
| 21 | +1. Run `npm run exercise` |
| 22 | +2. Choose which exercise you'd like to run. |
28 | 23 |
|
29 |
| -The `exercise` script will run TypeScript typechecks and a test suite on the exercise. |
| 24 | +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: |
30 | 25 |
|
31 |
| -This tutorial 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: |
32 |
| - |
33 |
| -1. Look for any 🕵️♂️ emojis to give you a hint on what to change |
34 |
| -1. Check out [Zod's docs](https://zod.dev) |
| 26 | +1. Check out [Zod's docs](https://zod.dev/). |
35 | 27 | 1. Try to find something that looks relevant.
|
36 | 28 | 1. Give it a go to see if it solves the problem.
|
37 | 29 |
|
38 | 30 | You'll know if you've succeeded because the tests will pass.
|
39 | 31 |
|
40 |
| -**If you succeed**, or **if you get stuck**, check out the `*.solution.ts`. You can see if your solution is better or worse than mine! |
41 |
| - |
42 |
| -You can run `npm run solution 01` to run the tests and typechecking on the solution. |
| 32 | +**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! |
43 | 33 |
|
44 | 34 | ## Acknowledgements
|
45 | 35 |
|
46 | 36 | 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).
|
47 | 37 |
|
48 | 38 | ## Reference
|
49 | 39 |
|
50 |
| -### `npm run exercise 01` |
51 |
| - |
52 |
| -Alias: `npm run e 01` |
53 |
| - |
54 |
| -Run the corresponding `*.problem.ts` file. |
55 |
| - |
56 |
| -### `npm run solution 01` |
| 40 | +### `npm run exercise` |
57 | 41 |
|
58 |
| -Alias: `npm run s 01` |
| 42 | +Alias: `npm run e` |
59 | 43 |
|
60 |
| -Run the corresponding `*.solution.ts` file. If there are multiple, it runs only the first one. |
| 44 | +Open a prompt for choosing which exercise you'd like to run. |
0 commit comments