# advanced-patterns-workshop: an exercise-driven TypeScript practice repo with per-lesson solution files

> total-typescript/advanced-patterns-workshop ships each lesson as a *.problem file next to a *.solution file and drives them through the tt-cli exercise runner. It suits developers who want to attempt TypeScript pattern problems against vitest rather than read slides, and it offers little for anyone looking for a library to depend on.

**total-typescript/advanced-patterns-workshop** — An interactive TypeScript repo on advanced patterns (WIP)

- Repository: https://github.com/total-typescript/advanced-patterns-workshop
- Stars: 1,462 · Forks: 233
- Language: TypeScript
- License: not declared
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/total-typescript-advanced-patterns-workshop

## What advanced-patterns-workshop actually ships

The repository is a course material archive, not a package anyone installs into an application. Its description calls it an interactive TypeScript repo on advanced patterns and marks itself as work in progress. The top level holds a src directory, a tsconfig.json, a vite.config.mts, an og-image-new.png banner, a renovate.json, a .github folder, and a .vscode folder, which is the layout of a small TypeScript project rather than a library with a published entry point.

The package.json names the project advanced-patterns-workshop at version 1.0.0 and lists author Matt Pocock with the address team@totaltypescript.com. Everything in the dependency block sits in devDependencies, not dependencies: the exercise runner @total-typescript/exercise-cli, typescript pinned to 5.7.2, vitest, vite-tsconfig-paths, jsdom, cross-fetch, prettier, and the Node type definitions. There is no runtime dependency and no build that produces a consumable artifact, so the project is a working surface for reading and editing exercises.

The README also points to an hosted opening through Gitpod using the repository URL, so a reader can reach a running environment without configuring Node locally, and it asks readers to acknowledge Matt Pocock on Twitter or Discord and mentions the Total TypeScript course. If your goal is a type-level technique you can drop into a production codebase, this repository teaches by example rather than by shipping code.

## The problem and solution file pairing

The core mechanic is a naming convention. The README states that the course is split into exercises, and that each exercise is split into a *.problem and a *.solution. That pairing is what makes the repository self-checking: the problem file is the task, the solution file is the author's answer sitting in the same tree.

The README frames the intended loop as active, exploratory learning. In the video the author explains a problem, and the reader is asked to find a solution, which the README says involves checking TypeScript's own documentation, trying something that looks relevant, and running it to see whether it solves the problem. The signal of success is stated plainly: the tests pass. The README then says to unpause the video and open the *.solution whether you succeeded or got stuck, and to compare your solution against the author's, better or worse.

That comparison step is the part worth thinking about before you start. A solution file is one author's approach to a type-level puzzle, not a canonical answer, and the README frames the comparison as a judgement call. Working through a problem and then reading the answer teaches something different from reading the answer first, and the repository does not hide the answers from you.

## Running the tt-cli exercise runner

Every script in package.json delegates to a single binary, tt-cli, which comes from the @total-typescript/exercise-cli package. The general entry point asks which exercise you would like to run, and the README documents it with the alias npm run e.

```sh
# Installs all dependencies
npm install

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

Because the scripts are thin wrappers, the same runner has an explicit per-exercise form. The exercise is identified by a two-digit number, and each numbered exercise has a matching pair of scripts for the problem and for the solution.

```sh
npm run e-00
npm run s-00
```

Those two lines target exercise 00, the first script opening the problem and the second opening the author's solution. The pattern continues through the numbered entries, with e-01, e-02 and onward up to e-16 in the visible script list, each paired with an s- entry that adds the --solution flag. The runner itself is invoked as tt-cli run 00 or tt-cli run 00 --solution, so the numeric argument is the selection mechanism and the flag is what switches to the answer file.

There is also a whole-run variant that opens a chooser instead of a specific exercise.

```sh
npm run solution
npm run s
```

If you want the author's answer for a given exercise without picking the number each time, the solution alias opens the same chooser but starts in solution mode.

## Test running, snapshots and the StackBlitz prepare step

The test setup is unusual and worth understanding before you edit anything. The ci script does not run vitest at the repository root. It changes directory into a scripts/tests subdirectory first and then invokes npx vitest run, and the update-snapshots script does the same with the -u flag added.

```json
{
  "ci": "(cd scripts/tests && npx vitest run)",
  "update-snapshots": "(cd scripts/tests && npx vitest run -u)"
}
```

This tells you two things. First, the checks live under scripts/tests rather than alongside the source, which is consistent with a course repo where the harness is shared across all exercises. Second, the presence of a snapshot update script means the test suite compares stored output against a recorded value, so a formatting or type-string difference can fail a test even when your logic is right, and the snapshot can be rewritten with npm run update-snapshots. That is a real editing hazard: a snapshot updated too early will lock in whatever your first attempt produced.

There is a third script worth knowing about. The prepare entry point calls tt-cli prepare-stackblitz, which is what makes the Gitpod and in-browser flows plausible, since it packages the exercise for a StackBlitz sandbox.

```json
{ "prepare": "tt-cli prepare-stackblitz" }
```

Note that prepare is also a well-known npm lifecycle hook name, so this script runs automatically on install in some setups. The name is not documented in the README.

## Where the friction is, and where the tool is wrong for you

There are real limits here, and the material is honest about some of them. The repository has no GitHub releases, so there is no versioned distribution to pin in a course syllabus, and the description marks the project as work in progress, which means the set of exercises can change without a release note. The last push was on 2026-08-07, and the repository is not archived.

A second limit is that the answer key is not hidden. The *.solution files sit alongside the *.problem files by design, so anyone using this as a self-study tool has to manage their own temptation, and anyone adapting the exercises for a team will have to strip or rename the solution files to make the exercise meaningful.

A third is that this is the wrong tool for several ordinary jobs. If you want a type utility to import, there is no published module surface and no build output; you would be copying code by hand. If you want a text editor with inline type hints, a type checker to run in CI on your own codebase, or a structured curriculum with progress tracking, this repository does not attempt any of that. The audience is narrow: someone learning advanced TypeScript patterns by writing them and running tests.

There is also a real alternative approach, and it sits in a neighbouring repository from the same author rather than a competing product. The course author also publishes a text-based tutorial of advanced TypeScript patterns. The tutorial teaches the same material in prose with annotated code, which suits a reader who wants an explanation first. This workshop teaches by exercise, where the type error or a failing test is the feedback channel and the documentation is consulted as a reference. A reader who already knows the patterns gets more from the tutorial; a reader who learns by iterating against assertions gets more from the workshop.

## Licence, upgrades and running cost of the material

The repository metadata for the licence is unknown, but the package.json field states GPL-2.0. Treat that as the package declaration, not a verified licence grant, and read the repository licence file yourself before redistributing exercises or solutions in a commercial or internal training setting. This is a practical note about copyleft terms, not legal advice.

Upgrades are cheap in effort and infrequent in release. renovate.json is present at the top level, which is the configuration for automated dependency update pull requests, and the typescript dependency is pinned to the exact version 5.7.2 while the exercise runner uses a caret range. Type-level behaviour changes between TypeScript versions often, so if you pull a newer compiler and the assertions start failing, the pinned version in package.json is the reference point for what the exercises were written against.

The running cost is otherwise a local Node install and a terminal. There is no server, no database and no account to create.

## Conclusion

Adopt this repository if you are practising TypeScript type patterns and want a runnable exercise with a reference answer for comparison. Do not adopt it as a production dependency, since it publishes no library API and no releases. Before starting, run npm install and npm run exercise once on your machine to confirm the tt-cli runner and vitest behave under your Node and TypeScript setup, and decide in advance whether you want to peek at the *.solution files, because they are present in the same tree and the workflow depends on you resisting them.

## FAQ

### How do I install and run an exercise in advanced-patterns-workshop?

Run npm install to install the dependencies, then run npm run exercise and pick an exercise from the prompt. The same command is available as the shorter alias npm run e.

### How are the answers to the exercises stored in advanced-patterns-workshop?

Each exercise is split into a *.problem file and a *.solution file inside the same source tree. The solution scripts such as npm run s-00 or npm run s open the author's answer so you can compare it with your own.

### How do I run the tests for advanced-patterns-workshop?

The ci script runs vitest from a scripts/tests subdirectory rather than the repository root, and npm run update-snapshots reruns the same suite with snapshot updating enabled.

## Sources

- [Issues](https://github.com/total-typescript/advanced-patterns-workshop/issues)
- [README](https://github.com/total-typescript/advanced-patterns-workshop/blob/main/README.md)
- [total-typescript/advanced-patterns-workshop on GitHub](https://github.com/total-typescript/advanced-patterns-workshop)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/total-typescript-advanced-patterns-workshop
