Library / SDK
total-typescript/total-typescript-book avatar
total-typescript/total-typescript-book

total-typescript-book: a course that ships as a repository of runnable exercises

The companion repo for the upcoming Total TypeScript book

1,793 stars174 forksTypeScriptNOASSERTION

At a glance

What is it?
The total-typescript-book repository is the companion codebase for Matt Pocock's Total TypeScript course, and it is built as a set of exercises where each one exists twice, as a `*.problem` file and a `*.solution` file, run through a small CLI that picks an exercise and checks your answer with tests. It is GPL licensed, pinned to pnpm 8.15.6, and the last push was on 2026-06-24.
Who is it for?
Adopt this repository if you are working through the Total TypeScript course and want the exercises to run locally with type checking and tests, because the problem and solution split and the per-exercise npm scripts are the point of the repository. Do not adopt it as a TypeScript learning resource in general, since the code is coupled to the course and to a paid product, and the exercises assume you are working alongside the videos.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 122 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A course that is a repository, not a set of snippets

This repository is the companion repo for the Total TypeScript book, and the homepage is totaltypescript.com, with the author named in the package metadata as Matt Pocock.

The interesting decision is what a course repository actually contains. The answer here is a working codebase with tests, not a list of code fragments to copy. The README describes the course as split into exercises, and each exercise is split into a `*.problem` and a `*.solution`.

That pairing is the mechanism the whole thing rests on. A problem file is the exercise as you first meet it, with a type error or a failing test or a missing implementation. A solution file is the author's version, which you are told to look at only after you have tried, and which the README invites you to compare against your own: you can see if your solution is better or worse than mine.

That last framing is the pedagogical point of the repository. The tests are the judge, and the solution is a reference rather than an answer key, so the exercise remains a puzzle with more than one right answer rather than a transcription exercise.

The primary language is TypeScript, the default branch is `main`, and there are no GitHub releases, which fits a course repository whose content changes with the book rather than with a versioned package. The last push was on 2026-06-24, so the tree is a few months old rather than abandoned, and the repository is not archived.

The learning loop the README asks you to follow

The instructions are unusually explicit about the order of operations, and the order is the pedagogy.

The first step is to run the exercise command and choose which exercise you want to run. Then the README tells you to check out TypeScript's docs, try to find something that looks relevant, and give it a go to see if it solves the problem. You will know if you have succeeded because the tests will pass.

And only then, if you succeed or if you get stuck, do you unpause the video and check out the `*.solution`.

That last clause is the interesting one, because it removes the usual failure mode of a book repository, which is that the solution is right there and you read it first. The README calls this an encouragement of active, exploratory learning, and it is a claim about the design of the material rather than about the technology.

The reference section then documents the one command that drives all of this. The `pnpm run exercise` alias, which is `pnpm run e`, opens a prompt for choosing which exercise you would like to run.

The subtlety is in the word alias. The scripts in the package metadata are not just `exercise`; there is a `solution` script, aliased to `s`, which runs the same CLI with the `--solution` flag, and then a numbered script for every exercise in the course, `e-001` and `s-001` through `e-013` and `s-013` and beyond. So there is a script for every single exercise, and the shorthand lets you reach any of them without going through the interactive prompt.

The `e` and `s` convention is worth internalising before you start, because it is the difference between running an exercise and looking at its answer, and the difference is one character.

Why pnpm, and what the install actually pulls in

The quickstart gives pnpm a paragraph of its own, and the reason is scale. The README says that because this course is so big, we are using `pnpm` as the package manager, and describes it as like `npm` but resulting in fewer `node_modules` saved to disk.

That is a real constraint rather than a preference. A course repository with a hundred exercises, each with its own dependency set, would multiply hard-linked package stores into gigabytes under npm, and the checkout would be slow on a laptop with a spinning disk. The `packageManager` field pins `[email protected]`, so the version is fixed for the repository, and the install is:

sh
# Installs all dependencies
pnpm install

# Asks you which exercise you'd like to run, and runs it
pnpm run exercise

The dependency list in the package metadata is short and tells you what the exercises are built with. TypeScript is at `^5.5.2`, and the test runner is Vitest at `^1.6.0`. The exercise runner itself is `@total-typescript/exercise-cli` at a pinned `0.5.1`, with `@total-typescript/helpers` alongside it, and the CLI is invoked as `tt-cli`.

The rest of the tooling is ordinary but telling. `jsdom` at `^21.1.1` is there so that DOM-dependent exercises can run under Node rather than in a browser, `vite-tsconfig-paths` makes the path aliases in `tsconfig.json` work inside Vitest, `nodemon` and `npm-run-all` handle the running and the script aggregation, `cross-fetch` is a fetch polyfill for the Node versions in play, and `prettier` at `^2.8.7` formats the book content.

The `vite.config.mts` file at the root and the `tsconfig.json` alongside it complete the picture: the exercises are TypeScript projects with path aliases, tested with Vitest, which is why the README can promise that the tests will tell you whether you have solved the problem.

Book content, StackBlitz preparation and the test scripts

The repository holds more than exercises. There is a `book-content/` directory, and the `format-book` script runs `tsx book-content/formatter/format.ts` over it, which is how the prose that accompanies the code is kept formatted.

There is also a `prepare` script that runs `tt-cli prepare-stackblitz`, and StackBlitz is the browser-based IDE that lets a reader run an exercise without installing anything locally. That is a significant piece of the design: the same exercise that runs through `pnpm run exercise` locally can be run in a browser by whoever is reading the book, and the prepare script is what makes that possible by producing the StackBlitz project for each exercise.

The test side has its own scripts. `ci` runs `(cd scripts/tests && npx vitest run)`, and `update-snapshots` runs the same with `-u`. Snapshot testing is the right technique for a course like this, because the expected output of an exercise is often a type error message or a printed value, and a snapshot captures that exactly without hand-writing an assertion for every case.

One small inconsistency is worth noting for anyone who clones the repository. The `ci` and `update-snapshots` scripts change into a `scripts/tests` directory, and the top-level entries do not list a `scripts` directory, so the CI scripts appear to point at a path that is not part of the published tree, or the listing is incomplete. The `workshop.md` file at the root is presumably the workshop companion to the book.

The `renovate.json` in the tree keeps the dependency set current, which matters for a course repository that will be worked through over months while the toolchain moves underneath it.

Licence, maintenance and what this repository is not

The licence is GPL, as declared in the package metadata, with the details in the `LICENSE.md` file at the root. The project metadata records it as a custom licence that GitHub cannot classify, so the file in the repository is the one to read. GPL for a course repository is a reasonable choice, since the material is meant to be shared and remixed, and it is worth noting that this covers the code and the prose, not the commercial course itself.

The maintenance position is straightforward and worth stating plainly. The last push was on 2026-06-24, which is more than six months before today, and the repository is not archived. There are no GitHub releases, so there is no version to pin, and the content tracks the book rather than a release schedule.

That last point has a practical consequence. A course repository is reorganised as the book is revised. Exercise numbers move, files are renamed, and the `e-014` script that worked in one printing of the book may not exist in the next. Anyone following along should be on the same revision of the repository as the book they are reading, which is the one operational caveat the README does not spell out.

And it is worth being clear about what this repository is not. It is not a TypeScript tutorial library, and the exercises are not a curriculum you can work through standalone. The README points at the TypeScript documentation as the reference to consult, and the acknowledgements ask readers to sign up for the Total TypeScript course, with a link to Matt's Discord and Twitter. The repository is the laboratory that goes with the teaching, not a replacement for it.

Where the book repository is the wrong tool

There are three cases where reaching for this repository is the wrong move, and they are worth separating from the good one.

The first is when you want to learn TypeScript rather than follow this course. The exercises are written to teach the specific things the book teaches, and the repository is coupled to a paid product and a video. A general exercise repository, or the TypeScript handbook the README itself points you to, serves a different purpose and does not require a checkout of this size.

The second is when you want a production starter for a TypeScript project. This is a course workspace with an exercise CLI, a book content formatter and a StackBlitz preparation step, and none of that belongs in an application repository. The upstream Vite, Vitest and type checking setup in a real project would be simpler and better maintained.

The third is when your team wants to contribute. The acknowledgements point to Matt's Discord, and the package has a `CONTRIBUTING` story in the book and the community rather than an upstream contribution path, so the project is best treated as a learning artefact you can read and run rather than a codebase you will be sending patches to.

The alternative approach, and the one to weigh against, is to work through the book with the exercises in a local editor and a test runner you already have. The difference in approach is that this repository gives you the author's exact toolchain, the exact type errors he expects and the exact snapshot of the correct output, which removes a class of false negatives where a correct answer fails because your Vitest version formats the error differently. That is worth a lot to someone learning, and worth nothing to someone shipping.

Editorial conclusion

Adopt this repository if you are working through the Total TypeScript course and want the exercises to run locally with type checking and tests, because the problem and solution split and the per-exercise npm scripts are the point of the repository. Do not adopt it as a TypeScript learning resource in general, since the code is coupled to the course and to a paid product, and the exercises assume you are working alongside the videos. Verify three things first: that your Node and pnpm versions match the pinned `packageManager` field, that the exercise CLI can find the exercise files in your checkout, and that the `*.problem` and `*.solution` files are the ones the video refers to, since the repository is reorganised between editions of the book.

Frequently asked questions

What is the total-typescript-book repository?

It is the companion repo for the Total TypeScript course by Matt Pocock. The course is split into exercises, and each exercise is split into a `*.problem` file and a `*.solution` file, so the code you are asked to write sits next to the author's version.

How do I run an exercise in the Total TypeScript book?

Install pnpm globally, run `pnpm install`, then run `pnpm run exercise`, which is aliased as `pnpm run e` and opens a prompt for choosing the exercise. The per-exercise scripts such as `e-001` and `s-001` run a specific one, with the `s` variants showing the solution.

Why does the Total TypeScript book use pnpm?

Because the course is large. The README says that because the course is so big they are using pnpm, which is like npm but results in fewer node_modules saved to disk. The package manager is pinned to [email protected] in the packageManager field.

What tools do the Total TypeScript exercises use?

TypeScript at 5.5, Vitest at 1.6 for the tests, the exercise runner `@total-typescript/exercise-cli` invoked as `tt-cli`, jsdom for DOM dependent exercises under Node, and `vite-tsconfig-paths` so path aliases resolve in the tests. A `prepare` script runs `tt-cli prepare-stackblitz` so exercises can also be run in a browser.

What licence is the total-typescript-book repository under?

The package metadata declares the GPL licence, with the details in the LICENSE.md file at the repository root. The project metadata records it as a custom licence that GitHub cannot classify, and there are no GitHub releases, so the content tracks the book rather than a versioned package.

Official sources

  1. Issues
  2. Project website
  3. README
  4. total-typescript/total-typescript-book on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/total-typescript-total-typescript-book.svg)](https://hysenlabs.com/projects/total-typescript-total-typescript-book)

Was this useful?